예제 #1
0
 /**
  * Removes a virtual machine
  * @return boolean true if virtual machine was removed, false otherwise
  */
 public function remove()
 {
     $api = VPSNET::getInstance();
     if ($this->id < 1) {
         trigger_error("To call VirtualMachine::remove() you must set its id", E_USER_ERROR);
         return false;
     }
     $api->setAPIResource('virtual_machines/' . $this->id);
     $result = $api->sendDELETERequest();
     $this->deleted = $result['info']['http_code'] == 200;
     return $this->deleted;
 }