mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
add executor getRuntime function
This commit is contained in:
1 parent
1e61091834
commit
816faa42b7
1 file changed
+22
@@ -276,6 +276,28 @@ class Executor
|
||||
|
||||
return $response['body'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Runtime
|
||||
*
|
||||
* Get runtime information
|
||||
*
|
||||
* @param string $runtimeId
|
||||
* @return array
|
||||
* @throws Exception
|
||||
*/
|
||||
public function getRuntime(string $runtimeId): array
|
||||
{
|
||||
$response = $this->call($this->endpoint, self::METHOD_GET, "/runtimes/$runtimeId", [], [], true);
|
||||
|
||||
$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'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Call
|
||||
|
||||
Reference in new issue
Block a user