@@ -229,6 +229,59 @@ public function revertResize()
229229 $ this ->execute ($ this ->api ->revertServerResize (), ['revertResize ' => null , 'id ' => $ this ->id ]);
230230 }
231231
232+ /**
233+ * Gets a VNC console for a server.
234+ *
235+ * @param string $type The type of VNC console: novnc|xvpvnc.
236+ * Defaults to novnc.
237+ *
238+ * @return array
239+ */
240+ public function getVncConsole ($ type = Enum::CONSOLE_NOVNC ): array
241+ {
242+ $ response = $ this ->execute ($ this ->api ->getVncConsole (), ['id ' => $ this ->id , 'type ' => $ type ]);
243+ return Utils::jsonDecode ($ response )['console ' ];
244+ }
245+
246+ /**
247+ * Gets a RDP console for a server.
248+ *
249+ * @param string $type The type of VNC console: rdp-html5 (default).
250+ *
251+ * @return array
252+ */
253+ public function getRDPConsole ($ type = Enum::CONSOLE_RDP_HTML5 ): array
254+ {
255+ $ response = $ this ->execute ($ this ->api ->getRDPConsole (), ['id ' => $ this ->id , 'type ' => $ type ]);
256+ return Utils::jsonDecode ($ response )['console ' ];
257+ }
258+
259+ /**
260+ * Gets a Spice console for a server.
261+ *
262+ * @param string $type The type of VNC console: spice-html5.
263+ *
264+ * @return array
265+ */
266+ public function getSpiceConsole ($ type = Enum::CONSOLE_SPICE_HTML5 ): array
267+ {
268+ $ response = $ this ->execute ($ this ->api ->getSpiceConsole (), ['id ' => $ this ->id , 'type ' => $ type ]);
269+ return Utils::jsonDecode ($ response )['console ' ];
270+ }
271+
272+ /**
273+ * Gets a serial console for a server.
274+ *
275+ * @param string $type The type of VNC console: serial.
276+ *
277+ * @return array
278+ */
279+ public function getSerialConsole ($ type = Enum::CONSOLE_SERIAL ): array
280+ {
281+ $ response = $ this ->execute ($ this ->api ->getSerialConsole (), ['id ' => $ this ->id , 'type ' => $ type ]);
282+ return Utils::jsonDecode ($ response )['console ' ];
283+ }
284+
232285 /**
233286 * Creates an image for the current server.
234287 *
0 commit comments