Scalr\Modules\Platforms\GoogleCE\GoogleCEPlatformModule::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)
    {
        $gce = $this->getClient($DBServer->GetEnvironmentObject());
        try {
            $gce->instances->reset($DBServer->GetEnvironmentObject()->keychain(SERVER_PLATFORMS::GCE)->properties[Entity\CloudCredentialsProperty::GCE_PROJECT_ID], $DBServer->GetCloudLocation(), $DBServer->GetProperty(\GCE_SERVER_PROPERTIES::SERVER_NAME));
        } catch (Exception $e) {
            if (stristr($e->getMessage(), "not found")) {
                throw new InstanceNotFoundException($e->getMessage(), $e->getCode(), $e);
            }
            throw $e;
        }
        return true;
    }