mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Address TODOs
This commit is contained in:
@@ -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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user