| Total Complexity | 4 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | class GuestPower extends InitClass |
||
| 14 | { |
||
| 15 | use MOID; |
||
|
|
|||
| 16 | /** |
||
| 17 | * Returns information about the guest operating system power state. |
||
| 18 | */ |
||
| 19 | public function power($moid=null){ |
||
| 20 | return ApiResponse::BodyResponse($this->HttpClient->get("vcenter/vm/{$this->getMoid($moid)}/guest/power")); |
||
| 21 | } |
||
| 22 | /** |
||
| 23 | * Issues a request to the guest operating system asking it to perform a clean shutdown of all services. This request returns immediately and does not wait for the guest operating system to complete the operation. |
||
| 24 | */ |
||
| 25 | public function shutdown($moid=null){ |
||
| 26 | return !ApiResponse::HasError($this->HttpClient->post("vcenter/vm/{$this->getMoid($moid)}/guest/power",[ |
||
| 27 | "query"=>[ |
||
| 28 | "action"=>"shutdown" |
||
| 29 | ] |
||
| 30 | ])); |
||
| 31 | } |
||
| 32 | /** |
||
| 33 | * Issues a request to the guest operating system asking it to perform a reboot. This request returns immediately and does not wait for the guest operating system to complete the operation |
||
| 34 | */ |
||
| 35 | public function reboot($moid=null){ |
||
| 36 | return !ApiResponse::HasError($this->HttpClient->post("vcenter/vm/{$this->getMoid($moid)}/guest/power",[ |
||
| 37 | "query"=>[ |
||
| 38 | "action"=>"reboot" |
||
| 39 | ] |
||
| 40 | ])); |
||
| 41 | } |
||
| 42 | /** |
||
| 43 | * Issues a request to the guest operating system asking it to perform a suspend operation. |
||
| 44 | */ |
||
| 45 | public function standby($moid=null){ |
||
| 49 | ] |
||
| 50 | ])); |
||
| 51 | } |
||
| 52 | |||
| 53 | } |