Total Complexity | 5 |
Total Lines | 32 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | class Power extends InitClass |
||
14 | { |
||
15 | use MOID; |
||
|
|||
16 | /** |
||
17 | * Returns the power state information of a virtual machine |
||
18 | */ |
||
19 | public function power($moid=null){ |
||
20 | return ApiResponse::BodyResponse($this->HttpClient->get("vcenter/vm/{$this->getMoid($moid)}/power")); |
||
21 | } |
||
22 | /** |
||
23 | * Returns the power state information of a virtual machine |
||
24 | */ |
||
25 | public function powerOff($moid=null){ |
||
26 | return !ApiResponse::HasError($this->HttpClient->post("vcenter/vm/{$this->getMoid($moid)}/power/stop")); |
||
27 | } |
||
28 | /** |
||
29 | * Powers on a powered-off or suspended virtual machine |
||
30 | */ |
||
31 | public function powerOn($moid=null){ |
||
32 | return !ApiResponse::HasError($this->HttpClient->post("vcenter/vm/{$this->getMoid($moid)}/power/start")); |
||
33 | } |
||
34 | /** |
||
35 | * Resets a powered-on virtual machine |
||
36 | */ |
||
37 | public function reset($moid=null){ |
||
39 | } |
||
40 | /** |
||
41 | * Returns the power state information of a virtual machine |
||
42 | */ |
||
43 | public function suspend($moid=null){ |
||
45 | } |
||
46 | } |