Scalr\Modules\Platforms\Cloudstack\CloudstackPlatformModule::RebootServer PHP Method

RebootServer() public method

See also: Scalr\Modules\PlatformModuleInterface::RebootServer()
public RebootServer ( DBServer $DBServer, $soft = true )
$DBServer DBServer
    public function RebootServer(DBServer $DBServer, $soft = true)
    {
        if ($soft) {
            throw new Exception("Soft reboot not supported by cloud");
        }
        $cs = $DBServer->GetEnvironmentObject()->cloudstack($this->platform);
        try {
            $cs->instance->reboot($DBServer->GetProperty(CLOUDSTACK_SERVER_PROPERTIES::SERVER_ID));
        } catch (NotFoundException $e) {
            throw new InstanceNotFoundException($e->getMessage(), $e->getCode(), $e);
        }
        return true;
    }