Scalr\Modules\Platforms\Openstack\OpenstackPlatformModule::GetServerConsoleOutput PHP Method

GetServerConsoleOutput() public method

See also: Scalr\Modules\PlatformModuleInterface::GetServerConsoleOutput()
public GetServerConsoleOutput ( DBServer $DBServer )
$DBServer DBServer
    public function GetServerConsoleOutput(DBServer $DBServer)
    {
        if ($DBServer->GetRealStatus()->getName() != 'ACTIVE') {
            return false;
        }
        $client = $this->getOsClient($DBServer->GetEnvironmentObject(), $DBServer->GetProperty(\OPENSTACK_SERVER_PROPERTIES::CLOUD_LOCATION));
        if ($client->servers->isExtensionSupported(ServersExtension::consoleOutput())) {
            return $client->servers->getConsoleOutput($DBServer->GetCloudServerID(), 200);
        } else {
            throw new \Exception("Not supported by Openstack");
        }
    }