File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -289,6 +289,30 @@ public function rebootServer(): array
289289 ];
290290 }
291291
292+ public function startServer () : array
293+ {
294+ return [
295+ 'method ' => 'POST ' ,
296+ 'path ' => 'servers/{id}/action ' ,
297+ 'params ' => [
298+ 'id ' => $ this ->params ->urlId ('server ' ),
299+ 'os-start ' => $ this ->params ->nullAction ()
300+ ],
301+ ];
302+ }
303+
304+ public function stopServer () : array
305+ {
306+ return [
307+ 'method ' => 'POST ' ,
308+ 'path ' => 'servers/{id}/action ' ,
309+ 'params ' => [
310+ 'id ' => $ this ->params ->urlId ('server ' ),
311+ 'os-stop ' => $ this ->params ->nullAction ()
312+ ],
313+ ];
314+ }
315+
292316 public function rebuildServer (): array
293317 {
294318 return [
Original file line number Diff line number Diff line change @@ -162,6 +162,28 @@ public function reboot(string $type = Enum::REBOOT_SOFT)
162162 ]);
163163 }
164164
165+ /**
166+ * Starts server
167+ */
168+ public function start ()
169+ {
170+ $ this ->execute ($ this ->api ->startServer (), [
171+ 'id ' => $ this ->id ,
172+ 'os-start ' => null
173+ ]);
174+ }
175+
176+ /**
177+ * Stops server
178+ */
179+ public function stop ()
180+ {
181+ $ this ->execute ($ this ->api ->stopServer (), [
182+ 'id ' => $ this ->id ,
183+ 'os-stop ' => null
184+ ]);
185+ }
186+
165187 /**
166188 * Rebuilds the server.
167189 *
You can’t perform that action at this time.
0 commit comments