Address TODOs

This commit is contained in:
Matej Baco
2023-03-14 11:13:03 +00:00
parent e7351f4eec
commit ed610fcdd4
14 changed files with 152 additions and 22 deletions
+24
View File
@@ -102,6 +102,30 @@ class Executor
return $response['body'];
}
/**
* Delete Runtime
*
* Deletes a runtime and cleans up any containers remaining.
*
* @param string $projectId
* @param string $deploymentId
*/
public function deleteRuntime(string $projectId, string $deploymentId)
{
$runtimeId = "$projectId-$deploymentId";
$route = "/runtimes/$runtimeId";
$response = $this->call(self::METHOD_DELETE, $route, [], [], true, 30);
$status = $response['headers']['status-code'];
if ($status >= 400) {
$message = \is_string($response['body']) ? $response['body'] : $response['body']['message'];
throw new \Exception($message, $status);
}
return $response['body'];
}
/**
* Create an execution
*