Skip to content

Commit 52d694a

Browse files
authored
Merge pull request #63 from open-runtimes/fix-create-execution-endpoint
Update endpoint from /execution to /executions
2 parents 30c0ebe + 68b0246 commit 52d694a

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

app/http.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,8 @@ function removeAllRuntimes(Table $activeRuntimes, Orchestration $orchestration):
693693
->send();
694694
});
695695

696-
Http::post('/v1/runtimes/:runtimeId/execution')
696+
Http::post('/v1/runtimes/:runtimeId/executions')
697+
->alias('/v1/runtimes/:runtimeId/execution')
697698
->desc('Create an execution')
698699
// Execution-related
699700
->param('runtimeId', '', new Text(64), 'The runtimeID to execute.')

tests/ExecutorTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -228,13 +228,13 @@ public function testExecute(array $data): void
228228
$response = $this->client->call(Client::METHOD_POST, '/runtimes', [], $params);
229229
$this->assertEquals(201, $response['headers']['status-code']);
230230

231-
$response = $this->client->call(Client::METHOD_POST, '/runtimes/test-exec/execution');
231+
$response = $this->client->call(Client::METHOD_POST, '/runtimes/test-exec/executions');
232232

233233
$this->assertEquals(200, $response['headers']['status-code']);
234234
$this->assertEquals(200, $response['body']['statusCode']);
235235

236236
/** Execute on cold-started runtime */
237-
$response = $this->client->call(Client::METHOD_POST, '/runtimes/test-exec/execution', [], [
237+
$response = $this->client->call(Client::METHOD_POST, '/runtimes/test-exec/executions', [], [
238238
'body' => 'test payload',
239239
'variables' => [
240240
'customVariable' => 'mySecret'
@@ -248,7 +248,7 @@ public function testExecute(array $data): void
248248
$this->assertEquals(200, $response['headers']['status-code']);
249249

250250
/** Execute on new runtime */
251-
$response = $this->client->call(Client::METHOD_POST, '/runtimes/test-exec-coldstart/execution', [], [
251+
$response = $this->client->call(Client::METHOD_POST, '/runtimes/test-exec-coldstart/executions', [], [
252252
'source' => $data['path'],
253253
'entrypoint' => 'index.php',
254254
'image' => 'openruntimes/php:v3-8.1',
@@ -379,7 +379,7 @@ public function testScenarios(string $image, string $entrypoint, string $folder,
379379
$path = $response['body']['path'];
380380

381381
/** Execute function */
382-
$response = $this->client->call(Client::METHOD_POST, "/runtimes/scenario-execute-{$folder}/execution", [], [
382+
$response = $this->client->call(Client::METHOD_POST, "/runtimes/scenario-execute-{$folder}/executions", [], [
383383
'source' => $path,
384384
'entrypoint' => $entrypoint,
385385
'image' => $image,
@@ -448,7 +448,7 @@ public function testCustomRuntimes(string $folder, string $image, string $entryp
448448
$path = $response['body']['path'];
449449

450450
// Execute function
451-
$response = $this->client->call(Client::METHOD_POST, "/runtimes/custom-execute-{$folder}/execution", [], [
451+
$response = $this->client->call(Client::METHOD_POST, "/runtimes/custom-execute-{$folder}/executions", [], [
452452
'source' => $path,
453453
'entrypoint' => $entrypoint,
454454
'image' => $image,

0 commit comments

Comments
 (0)