masoudniki /
vSphere
| 1 | <?php |
||
| 2 | |||
| 3 | |||
| 4 | namespace FNDEV\vShpare\Api\VM\Hardware\CDROM; |
||
| 5 | |||
| 6 | |||
| 7 | use FNDEV\vShpare\Api\VM\Abstracts\InitClass; |
||
| 8 | use FNDEV\vShpare\Api\VM\Traits\MOID; |
||
| 9 | use FNDEV\vShpare\ApiResponse; |
||
| 10 | |||
| 11 | class CDROM extends InitClass |
||
| 12 | { |
||
| 13 | use MOID; |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 14 | public function getListCdRom($moid=null){ |
||
| 15 | return ApiResponse::BodyResponse($this->HttpClient->get("vcenter/vm/{$this->getMoid($moid)}/hardware/cdrom")); |
||
| 16 | } |
||
| 17 | public function createCdRom($config,$moid=null){ |
||
| 18 | return ApiResponse::BodyResponse($this->HttpClient->post("vcenter/vm/{$this->getMoid($moid)}/hardware/cdrom",[ |
||
| 19 | "json"=>$config |
||
| 20 | ])); |
||
| 21 | } |
||
| 22 | public function getCdRom($cdrom,$moid=null){ |
||
| 23 | return ApiResponse::BodyResponse($this->HttpClient->get("vcenter/vm/{$this->getMoid($moid)}/hardware/cdrom/$cdrom")); |
||
| 24 | } |
||
| 25 | public function deleteCdRom($cdrom,$moid=null){ |
||
| 26 | return ApiResponse::BodyResponse($this->HttpClient->delete("vcenter/vm/{$this->getMoid($moid)}/hardware/cdrom/$cdrom")); |
||
| 27 | } |
||
| 28 | public function connectCdRom($cdrom,$moid=null){ |
||
| 29 | return ApiResponse::BodyResponse($this->HttpClient->post("vcenter/vm/{$this->getMoid($moid)}/hardware/cdrom/$cdrom/connect")); |
||
| 30 | } |
||
| 31 | public function disconnectCdRom($cdrom,$moid=null){ |
||
| 32 | return ApiResponse::BodyResponse($this->HttpClient->post("vcenter/vm/{$this->getMoid($moid)}/hardware/cdrom/$cdrom/disconnect")); |
||
| 33 | } |
||
| 34 | public function updateCdRom($cdrom,$config,$moid=null){ |
||
| 35 | return ApiResponse::BodyResponse($this->HttpClient->patch("vcenter/vm/{$this->getMoid($moid)}/hardware/cdrom/$cdrom",[ |
||
| 36 | "json"=>$config |
||
| 37 | ])); |
||
| 38 | } |
||
| 39 | |||
| 40 | } |