From 816faa42b70922b42a7d77dcc7b2c6dad741ade0 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Fri, 18 Jul 2025 01:10:49 +0400 Subject: [PATCH] add executor getRuntime function --- src/Executor/Executor.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) 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