@@ -11,11 +11,11 @@ |
||
| 11 | 11 | |
| 12 | 12 | class Hardware extends InitClass |
| 13 | 13 | { |
| 14 | - public function cdrom(){ |
|
| 15 | - return new CDROM\CDROM($this->HttpClient,$this->vmSource); |
|
| 14 | + public function cdrom() { |
|
| 15 | + return new CDROM\CDROM($this->HttpClient, $this->vmSource); |
|
| 16 | 16 | } |
| 17 | - public function boot(){ |
|
| 18 | - return new Boot($this->HttpClient,$this->vmSource); |
|
| 17 | + public function boot() { |
|
| 18 | + return new Boot($this->HttpClient, $this->vmSource); |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | } |
| 22 | 22 | \ No newline at end of file |
@@ -11,10 +11,10 @@ |
||
| 11 | 11 | class Boot extends InitClass |
| 12 | 12 | { |
| 13 | 13 | use MOID; |
| 14 | - public function getHardwareBoot($moid=null){ |
|
| 14 | + public function getHardwareBoot($moid=null) { |
|
| 15 | 15 | return ApiResponse::BodyResponse($this->HttpClient->get("vm/{$this->getMoid($moid)}/hardware/boot")); |
| 16 | 16 | } |
| 17 | - public function updateHardwareBoot($moid=null){ |
|
| 17 | + public function updateHardwareBoot($moid=null) { |
|
| 18 | 18 | return ApiResponse::BodyResponse($this->HttpClient->get("vm/{$this->getMoid($moid)}/hardware")); |
| 19 | 19 | } |
| 20 | 20 | } |
| 21 | 21 | \ No newline at end of file |
@@ -11,28 +11,28 @@ |
||
| 11 | 11 | class CDROM extends InitClass |
| 12 | 12 | { |
| 13 | 13 | use MOID; |
| 14 | - public function getListCdRom($moid=null){ |
|
| 14 | + public function getListCdRom($moid=null) { |
|
| 15 | 15 | return ApiResponse::BodyResponse($this->HttpClient->get("vm/{$this->getMoid($moid)}/hardware/cdrom")); |
| 16 | 16 | } |
| 17 | - public function createCdRom($config,$moid=null){ |
|
| 18 | - return ApiResponse::BodyResponse($this->HttpClient->post("vm/{$this->getMoid($moid)}/hardware/cdrom",[ |
|
| 17 | + public function createCdRom($config, $moid=null) { |
|
| 18 | + return ApiResponse::BodyResponse($this->HttpClient->post("vm/{$this->getMoid($moid)}/hardware/cdrom", [ |
|
| 19 | 19 | "json"=>$config |
| 20 | 20 | ])); |
| 21 | 21 | } |
| 22 | - public function getCdRom($cdrom,$moid=null){ |
|
| 22 | + public function getCdRom($cdrom, $moid=null) { |
|
| 23 | 23 | return ApiResponse::BodyResponse($this->HttpClient->get("vm/{$this->getMoid($moid)}/hardware/cdrom/$cdrom")); |
| 24 | 24 | } |
| 25 | - public function deleteCdRom($cdrom,$moid=null){ |
|
| 25 | + public function deleteCdRom($cdrom, $moid=null) { |
|
| 26 | 26 | return ApiResponse::BodyResponse($this->HttpClient->delete("vm/{$this->getMoid($moid)}/hardware/cdrom/$cdrom")); |
| 27 | 27 | } |
| 28 | - public function connectCdRom($cdrom,$moid=null){ |
|
| 28 | + public function connectCdRom($cdrom, $moid=null) { |
|
| 29 | 29 | return ApiResponse::BodyResponse($this->HttpClient->post("vm/{$this->getMoid($moid)}/hardware/cdrom/$cdrom/connect")); |
| 30 | 30 | } |
| 31 | - public function disconnectCdRom($cdrom,$moid=null){ |
|
| 31 | + public function disconnectCdRom($cdrom, $moid=null) { |
|
| 32 | 32 | return ApiResponse::BodyResponse($this->HttpClient->post("vm/{$this->getMoid($moid)}/hardware/cdrom/$cdrom/disconnect")); |
| 33 | 33 | } |
| 34 | - public function updateCdRom($cdrom,$config,$moid=null){ |
|
| 35 | - return ApiResponse::BodyResponse($this->HttpClient->patch("vm/{$this->getMoid($moid)}/hardware/cdrom/$cdrom",[ |
|
| 34 | + public function updateCdRom($cdrom, $config, $moid=null) { |
|
| 35 | + return ApiResponse::BodyResponse($this->HttpClient->patch("vm/{$this->getMoid($moid)}/hardware/cdrom/$cdrom", [ |
|
| 36 | 36 | "json"=>$config |
| 37 | 37 | ])); |
| 38 | 38 | } |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | class Hardware extends InitClass |
| 12 | 12 | { |
| 13 | 13 | use MOID; |
| 14 | - public function getHardware($moid=null){ |
|
| 14 | + public function getHardware($moid=null) { |
|
| 15 | 15 | return ApiResponse::BodyResponse($this->HttpClient->get("vm/{$this->getMoid($moid)}/hardware")); |
| 16 | 16 | } |
| 17 | 17 | } |
| 18 | 18 | \ No newline at end of file |
@@ -9,8 +9,8 @@ |
||
| 9 | 9 | |
| 10 | 10 | class Resources extends InitClass |
| 11 | 11 | { |
| 12 | - public function hardware(){ |
|
| 13 | - return new Hardware($this->HttpClient,$this->vmSource); |
|
| 12 | + public function hardware() { |
|
| 13 | + return new Hardware($this->HttpClient, $this->vmSource); |
|
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | } |
| 17 | 17 | \ No newline at end of file |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | const POWERED_ON="POWERED_ON"; |
| 22 | 22 | const POWERED_OFF="POWERED_OFF"; |
| 23 | 23 | const SUSPENDED="SUSPENDED"; |
| 24 | - public function __construct(Client $HttpClient,$properties,$moid) |
|
| 24 | + public function __construct(Client $HttpClient, $properties, $moid) |
|
| 25 | 25 | { |
| 26 | 26 | $this->HttpClient=$HttpClient; |
| 27 | 27 | $this->properties=isset($properties->value) ? $properties->value : $properties; |
@@ -31,35 +31,35 @@ discard block |
||
| 31 | 31 | { |
| 32 | 32 | return $this->properties->{$name}; |
| 33 | 33 | } |
| 34 | - public function reloadProperties(){ |
|
| 34 | + public function reloadProperties() { |
|
| 35 | 35 | $this->properties=ApiResponse::BodyResponse($this->HttpClient->get("vm/{$this->moid}"))->value; |
| 36 | 36 | return $this; |
| 37 | 37 | } |
| 38 | - public function power(){ |
|
| 39 | - return new Power($this->HttpClient,$this); |
|
| 38 | + public function power() { |
|
| 39 | + return new Power($this->HttpClient, $this); |
|
| 40 | 40 | } |
| 41 | - public function guestPower(){ |
|
| 42 | - return new GuestPower($this->HttpClient,$this); |
|
| 41 | + public function guestPower() { |
|
| 42 | + return new GuestPower($this->HttpClient, $this); |
|
| 43 | 43 | } |
| 44 | - public function tools(){ |
|
| 45 | - return new Tools($this->HttpClient,$this); |
|
| 44 | + public function tools() { |
|
| 45 | + return new Tools($this->HttpClient, $this); |
|
| 46 | 46 | } |
| 47 | - public function consoleTicket(){ |
|
| 48 | - return new ConsoleTickets($this->HttpClient,$this); |
|
| 47 | + public function consoleTicket() { |
|
| 48 | + return new ConsoleTickets($this->HttpClient, $this); |
|
| 49 | 49 | } |
| 50 | - public function hardware(){ |
|
| 51 | - return new Hardware($this->HttpClient,$this); |
|
| 50 | + public function hardware() { |
|
| 51 | + return new Hardware($this->HttpClient, $this); |
|
| 52 | 52 | } |
| 53 | - public function resources(){ |
|
| 54 | - return new Resources\Resources($this->HttpClient,$this); |
|
| 53 | + public function resources() { |
|
| 54 | + return new Resources\Resources($this->HttpClient, $this); |
|
| 55 | 55 | } |
| 56 | - public function isPoweredOn(){ |
|
| 56 | + public function isPoweredOn() { |
|
| 57 | 57 | return $this->properties->power_state==self::POWERED_ON; |
| 58 | 58 | } |
| 59 | - public function isPoweredOff(){ |
|
| 59 | + public function isPoweredOff() { |
|
| 60 | 60 | return $this->properties->power_state==self::POWERED_OFF; |
| 61 | 61 | } |
| 62 | - public function isSuspended(){ |
|
| 62 | + public function isSuspended() { |
|
| 63 | 63 | return $this->properties->power_state==self::SUSPENDED; |
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | 66 | \ No newline at end of file |