diff --git a/src/Executor/Executor.php b/src/Executor/Executor.php index df4c5fd8f5..666f01d779 100644 --- a/src/Executor/Executor.php +++ b/src/Executor/Executor.php @@ -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