PHP Class DBServer

Afficher le fichier Open project: scalr/scalr Class Usage Examples

Méthodes publiques

Свойство Type Description
$clientId
$cloudLocation
$cloudLocationZone
$dateAdded
$dateInitialized
$dateRebootStart
$dateShutdownScheduled
$envId
$farmId
$farmIndex
$farmRoleId
$imageId
$index
$instanceTypeName
$isScalarized
$lastSync
$localIp
$operations
$osType
$platform
$platformPropsClasses
$remoteIp
$serverId
$status

Méthodes publiques

Méthode Description
Create ( ServerCreateInfo $creInfo, boolean $isImport = false, $setPendingStatus = false ) : DBServer
GetAllProperties ( )
GetClient ( ) : Client
GetCloudLocation ( ) : string Return cloud location (region)
GetCloudServerID ( boolean $skipCache = false ) : string Return real (Cloud) server ID
GetCloudUserData ( )
GetEnvironmentObject ( ) : Scalr_Environment
GetFarmObject ( ) : DBFarm Returns DBFarme object
GetFarmRoleObject ( ) : DBFarmRole Returns DBFarmRole object
GetFreeDeviceName ( $isHvm = false )
GetKey ( boolean $plain = false ) : string Returns Server authentification key (For messaging and Query-Env)
GetOsType ( ) : string
GetProperty ( string $propertyName, boolean $ignoreCache = false ) : mixed Get Server Property
GetRealStatus ( $skipCache = false ) : Scalr\Modules\Platforms\StatusAdapterInterface Gets real status
GetScalarizrVersion ( ) : array Return information about scalarizr version installed on instance
GetScriptingVars ( ) : array
GetSsh2Client ( ) : Scalr_Net_Ssh2_Client
IsExists ( $serverId )
IsRebooting ( )
IsSupported ( $v )
LoadByFarmRoleIDAndIndex ( integer $farm_roleid, integer $index ) : DBServer
LoadByID ( string $serverId ) : DBServer Loads server by specified identifier
LoadByLocalIp ( $localIp, $farmId )
LoadByPropertyValue ( string $propName, string $propValue ) : DBServer Return DBServer by property value
Remove ( ) : void Removes server from database
Save ( )
SendMessage ( Scalr_Messaging_Msg $message, $isEventNotice = false, $delayed = false ) : Scalr_Messaging_Msg Send message to instance
SetProperties ( array $props ) Set multiple server properties
SetProperty ( string $propertyName, mixed $propertyValue ) : void Set server property
__construct ( $serverId )
__destruct ( )
__get ( $name )
__sleep ( )
applyGlobalVarsToValue ( $value )
checkRequestRate ( string $resourseName = '' ) : integer Checks scalr inbound request rate (req/min)
executeScript ( array $script, Scalr_Messaging_Msg_ExecScript $msg ) : void Executes script
getAwsTags ( string $addNameTag = false ) : array Return list of tags that should be applied on EC2 resources
getAzureTags ( ) : array Return list of tags that should be applied for Azure instances
getFieldPropertyMap ( ) : array Gets array of DBServer public fields and db columns
getLaunchReason ( $reasonId )
getNameByConvention ( )
getOpenstackTags ( ) : array Return list of tags that should be applied for Openstack instances
getPort ( $portType )
getScalarizrRepository ( )
getServerHistory ( ) : Scalr\Model\Entity\Server\History Gets server history object
getSzrHost ( )
getTerminateReason ( integer $reasonId ) : string Gets terminate reason
getTerminatingServers ( ) : array Gets a list of servers which in the termination process
getType ( ) : string Return server flavor (instance type)
isCloudstack ( )
isOpenstack ( )
listByFilter ( array $filter = null ) : array Gets a list of servers by filter
load ( $serverinfo )
setOsType ( string $osType ) : DBServer Sets OS type
setScalarizrVersion ( $version )
setType ( string $type ) : DBServer Sets instance type type
suspend ( string | array $reason, boolean $forcefully = null, Scalr_Account_User | integer $user = null ) Marks server as to be suspended.
terminate ( integer | array $reason, boolean $forcefully = null, Scalr_Account_User | integer $user = null ) Marks server as to be terminated.
update ( array | Iterator $props ) Updates specified properties to database
updateStatus ( string $serverStatus ) : DBServer Updates Server status
updateTimelog ( $pointName, $secondsSinceBoot = null, $secondsSinceStart = null )

Private Methods

Méthode Description
GetVersionInfo ( $v )
Unbind ( )

Method Details

Create() public static méthode

public static Create ( ServerCreateInfo $creInfo, boolean $isImport = false, $setPendingStatus = false ) : DBServer
$creInfo ServerCreateInfo
$isImport boolean
Résultat DBServer

GetAllProperties() public méthode

public GetAllProperties ( )

GetClient() public méthode

public GetClient ( ) : Client
Résultat Client

GetCloudLocation() public méthode

Return cloud location (region)
public GetCloudLocation ( ) : string
Résultat string

GetCloudServerID() public méthode

Return real (Cloud) server ID
public GetCloudServerID ( boolean $skipCache = false ) : string
$skipCache boolean
Résultat string

GetCloudUserData() public méthode

public GetCloudUserData ( )

GetEnvironmentObject() public méthode

public GetEnvironmentObject ( ) : Scalr_Environment
Résultat Scalr_Environment

GetFarmObject() public méthode

Returns DBFarme object
public GetFarmObject ( ) : DBFarm
Résultat DBFarm

GetFarmRoleObject() public méthode

Returns DBFarmRole object
public GetFarmRoleObject ( ) : DBFarmRole
Résultat DBFarmRole

GetFreeDeviceName() public méthode

public GetFreeDeviceName ( $isHvm = false )

GetKey() public méthode

Returns Server authentification key (For messaging and Query-Env)
public GetKey ( boolean $plain = false ) : string
$plain boolean
Résultat string

GetOsType() public méthode

public GetOsType ( ) : string
Résultat string windows | linux

GetProperty() public méthode

Get Server Property
public GetProperty ( string $propertyName, boolean $ignoreCache = false ) : mixed
$propertyName string
$ignoreCache boolean
Résultat mixed

GetRealStatus() public méthode

Gets real status
public GetRealStatus ( $skipCache = false ) : Scalr\Modules\Platforms\StatusAdapterInterface
Résultat Scalr\Modules\Platforms\StatusAdapterInterface

GetScalarizrVersion() public méthode

Return information about scalarizr version installed on instance
public GetScalarizrVersion ( ) : array
Résultat array

GetScriptingVars() public méthode

public GetScriptingVars ( ) : array
Résultat array

GetSsh2Client() public méthode

public GetSsh2Client ( ) : Scalr_Net_Ssh2_Client
Résultat Scalr_Net_Ssh2_Client Enter description here ...

IsExists() public static méthode

public static IsExists ( $serverId )

IsRebooting() public méthode

public IsRebooting ( )

IsSupported() public méthode

public IsSupported ( $v )

LoadByFarmRoleIDAndIndex() public static méthode

public static LoadByFarmRoleIDAndIndex ( integer $farm_roleid, integer $index ) : DBServer
$farm_roleid integer
$index integer
Résultat DBServer

LoadByID() public static méthode

Loads server by specified identifier
public static LoadByID ( string $serverId ) : DBServer
$serverId string
Résultat DBServer

LoadByLocalIp() public static méthode

public static LoadByLocalIp ( $localIp, $farmId )

LoadByPropertyValue() public static méthode

Return DBServer by property value
public static LoadByPropertyValue ( string $propName, string $propValue ) : DBServer
$propName string
$propValue string
Résultat DBServer

Remove() public méthode

Removes server from database
public Remove ( ) : void
Résultat void

Save() public méthode

public Save ( )

SendMessage() public méthode

Send message to instance
public SendMessage ( Scalr_Messaging_Msg $message, $isEventNotice = false, $delayed = false ) : Scalr_Messaging_Msg
$message Scalr_Messaging_Msg
Résultat Scalr_Messaging_Msg

SetProperties() public méthode

Set multiple server properties
public SetProperties ( array $props )
$props array Associative array of the properties array(property => value)

SetProperty() public méthode

Set server property
public SetProperty ( string $propertyName, mixed $propertyValue ) : void
$propertyName string
$propertyValue mixed
Résultat void

__construct() public méthode

public __construct ( $serverId )

__destruct() public méthode

public __destruct ( )

__get() public méthode

public __get ( $name )

__sleep() public méthode

public __sleep ( )

applyGlobalVarsToValue() public méthode

public applyGlobalVarsToValue ( $value )

checkRequestRate() public méthode

Checks scalr inbound request rate (req/min)
public checkRequestRate ( string $resourseName = '' ) : integer
$resourseName string optional Resourse name
Résultat integer Returns the number of the requests per minute

executeScript() public méthode

Executes script
public executeScript ( array $script, Scalr_Messaging_Msg_ExecScript $msg ) : void
$script array Script settings
$msg Scalr_Messaging_Msg_ExecScript Scalarizr message
Résultat void

getAwsTags() public méthode

Return list of tags that should be applied on EC2 resources
public getAwsTags ( string $addNameTag = false ) : array
$addNameTag string
Résultat array

getAzureTags() public méthode

Return list of tags that should be applied for Azure instances
public getAzureTags ( ) : array
Résultat array

getFieldPropertyMap() public static méthode

Gets array of DBServer public fields and db columns
public static getFieldPropertyMap ( ) : array
Résultat array

getLaunchReason() public static méthode

public static getLaunchReason ( $reasonId )

getNameByConvention() public méthode

public getNameByConvention ( )

getOpenstackTags() public méthode

Return list of tags that should be applied for Openstack instances
public getOpenstackTags ( ) : array
Résultat array

getPort() public méthode

public getPort ( $portType )

getScalarizrRepository() public méthode

getServerHistory() public méthode

Gets server history object
See also: Scalr\Model\Entity\Server::getHistory()
Deprecation:
public getServerHistory ( ) : Scalr\Model\Entity\Server\History
Résultat Scalr\Model\Entity\Server\History Returns server history object

getSzrHost() public méthode

public getSzrHost ( )

getTerminateReason() public static méthode

Gets terminate reason
See also: Scalr\Model\Entity\Server::getTerminateReason()
Deprecation:
public static getTerminateReason ( integer $reasonId ) : string
$reasonId integer Reason id
Résultat string

getTerminatingServers() public static méthode

Gets a list of servers which in the termination process
public static getTerminatingServers ( ) : array
Résultat array Returns the list of the servers

getType() public méthode

Return server flavor (instance type)
public getType ( ) : string
Résultat string

isCloudstack() public méthode

public isCloudstack ( )

isOpenstack() public méthode

public isOpenstack ( )

listByFilter() public static méthode

Gets a list of servers by filter
public static listByFilter ( array $filter = null ) : array
$filter array optional Filter value ['envId' => 'value']
Résultat array Returns array of DBServer objects

load() public static méthode

public static load ( $serverinfo )

setOsType() public méthode

Sets OS type
public setOsType ( string $osType ) : DBServer
$osType string Operating System type (linux/windows)
Résultat DBServer

setScalarizrVersion() public méthode

public setScalarizrVersion ( $version )

setType() public méthode

Sets instance type type
public setType ( string $type ) : DBServer
$type string
Résultat DBServer

suspend() public méthode

Marks server as to be suspended.
public suspend ( string | array $reason, boolean $forcefully = null, Scalr_Account_User | integer $user = null )
$reason string | array The reason possibly with the format parameters.
$forcefully boolean optional Method: forcefully (true) | gracefully (false)
$user Scalr_Account_User | integer optional The user object or its unique identifier

terminate() public méthode

Marks server as to be terminated.
public terminate ( integer | array $reason, boolean $forcefully = null, Scalr_Account_User | integer $user = null )
$reason integer | array The reason possibly with the format parameters.
$forcefully boolean optional Method: forcefully (true) | gracefully (false)
$user Scalr_Account_User | integer optional The user object or its unique identifier

update() public méthode

Updates specified properties to database
public update ( array | Iterator $props )
$props array | Iterator The list of the properties to update

updateStatus() public méthode

Updates Server status
public updateStatus ( string $serverStatus ) : DBServer
$serverStatus string The status
Résultat DBServer

updateTimelog() public méthode

public updateTimelog ( $pointName, $secondsSinceBoot = null, $secondsSinceStart = null )

Property Details

$clientId public_oe property

public $clientId

$cloudLocation public_oe property

public $cloudLocation

$cloudLocationZone public_oe property

public $cloudLocationZone

$dateAdded public_oe property

public $dateAdded

$dateInitialized public_oe property

public $dateInitialized

$dateRebootStart public_oe property

public $dateRebootStart

$dateShutdownScheduled public_oe property

public $dateShutdownScheduled

$envId public_oe property

public $envId

$farmId public_oe property

public $farmId

$farmIndex public_oe property

public $farmIndex

$farmRoleId public_oe property

public $farmRoleId

$imageId public_oe property

public $imageId

$index public_oe property

public $index

$instanceTypeName public_oe property

public $instanceTypeName

$isScalarized public_oe property

public $isScalarized

$lastSync public_oe property

public $lastSync

$localIp public_oe property

public $localIp

$operations public_oe property

public $operations

$osType public_oe property

public $osType

$platform public_oe property

public $platform

$platformPropsClasses public_oe static_oe property

public static $platformPropsClasses

$remoteIp public_oe property

public $remoteIp

$serverId public_oe property

public $serverId

$status public_oe property

public $status