File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -463,6 +463,21 @@ public function changeName(string $name): Server
463463 }
464464 }
465465
466+ /**
467+ * Requests credentials for remote access via vnc over websocket to keyboard, monitor, and mouse for a server
468+ *
469+ * @see https://docs.hetzner.cloud/#resources-server-actions-post-16
470+ * @return \LKDev\HetznerCloud\Models\Actions\Action
471+ * @throws \LKDev\HetznerCloud\APIException
472+ */
473+ public function requestConsole (): Action
474+ {
475+ $ response = $ this ->httpClient ->post ($ this ->replaceServerIdInUri ('servers/{id}/actions/request_console ' ));
476+ if (! HetznerAPIClient::hasError ($ response )) {
477+ return Action::parse (json_decode ((string ) $ response ->getBody ())->action );
478+ }
479+ }
480+
466481 /**
467482 * @param string $uri
468483 * @return string
@@ -481,6 +496,7 @@ public static function parse($input)
481496 if ($ input == null ) {
482497 return null ;
483498 }
499+
484500 return (new self ($ input ->id ))->setAdditionalData ($ input );
485501 }
486502}
You can’t perform that action at this time.
0 commit comments