/**
  * {@inheritdoc}
  * @see \Scalr\Modules\PlatformModuleInterface::RebootServer()
  */
 public function RebootServer(DBServer $DBServer, $soft = true)
 {
     $client = $this->getOsClient($DBServer->GetEnvironmentObject(), $DBServer->GetProperty(\OPENSTACK_SERVER_PROPERTIES::CLOUD_LOCATION));
     if ($soft) {
         $client->servers->rebootServer($DBServer->GetProperty(\OPENSTACK_SERVER_PROPERTIES::SERVER_ID), RebootType::soft());
     } else {
         $client->servers->rebootServer($DBServer->GetProperty(\OPENSTACK_SERVER_PROPERTIES::SERVER_ID), RebootType::hard());
     }
     return true;
 }
Example #2
0
 /**
  * {@inheritdoc}
  * @see \Scalr\Modules\PlatformModuleInterface::RebootServer()
  */
 public function RebootServer(DBServer $DBServer, $soft = true)
 {
     $client = $this->getOsClient($DBServer->GetEnvironmentObject(), $DBServer->GetProperty(\OPENSTACK_SERVER_PROPERTIES::CLOUD_LOCATION));
     try {
         if ($soft) {
             $client->servers->rebootServer($DBServer->GetProperty(\OPENSTACK_SERVER_PROPERTIES::SERVER_ID), RebootType::soft());
         } else {
             $client->servers->rebootServer($DBServer->GetProperty(\OPENSTACK_SERVER_PROPERTIES::SERVER_ID), RebootType::hard());
         }
     } catch (NotFoundException $e) {
         throw new InstanceNotFoundException($e->getMessage(), $e->getCode(), $e);
     }
     return true;
 }