File tree Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Original file line number Diff line number Diff line change @@ -289,6 +289,30 @@ public function rebootServer(): array
289
289
];
290
290
}
291
291
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
+
292
316
public function rebuildServer (): array
293
317
{
294
318
return [
Original file line number Diff line number Diff line change @@ -162,6 +162,28 @@ public function reboot(string $type = Enum::REBOOT_SOFT)
162
162
]);
163
163
}
164
164
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
+
165
187
/**
166
188
* Rebuilds the server.
167
189
*
You can’t perform that action at this time.
0 commit comments