PHP Class Scalr\Model\Entity\Server

Author: N.V.
Inheritance: extends Scalr\Model\AbstractEntity, implements Scalr\DataType\AccessPermissionsInterface
Afficher le fichier Open project: scalr/scalr Class Usage Examples

Méthodes publiques

Свойство Type Description
$accountId integer Identifier of the Client's Account
$added DateTime Added time
$cloudLocation string Server cloud location
$cloudLocationZone string Zone a cloud is located
$envId integer Environment identifier
$farmId integer Farm identifier
$farmIndex integer Index within the Farm
$farmRoleId integer Identifier for the role in a farm
$id integer The identifier of the Server
$imageId string Image identifier
$index integer Index within the Farm Role
$initialized DateTime Initialized time
$instanceTypeName string Server instance type name
$lastSync DateTime Time the synchronization occured last
$localIp string Server local Ip
$os string Server OS type
$platform string Server platform
$rebootStart DateTime Time when server has been either rebooted or started
$remoteIp string Server remote Ip
$scalarized boolean Whether server is scalarized
$serverId string Server unique identifier
$shutdownScheduled DateTime Sheduled time for shutdown
$status string Status of a server
$type string Server instance type

Protected Properties

Свойство Type Description
$_environment Scalr\Model\Entity\Account\Environment
$_farm Farm
$_farmRole FarmRole
$_image Image
$_properties Scalr\Model\Collections\SettingsCollection Server properties collection
$_scalarizr Scalr_Net_Scalarizr_Client
$_scalarizrUpdateClient Scalr_Net_Scalarizr_UpdateClient
$_serverHistory Scalr\Model\Entity\Server\History

Méthodes publiques

Méthode Description
__get ( string $name ) : mixed Magic getter
__getDBServer ( ) : DBServer Gets old model from entity
__getEntityFromDBServer ( DBServer $DBServer ) : Server Gets entity from old model
delete ( )
findPk ( $serverId ) : mixed Temporary solution until we make serverId as primary key
findWithProperties ( array $criteria = null, array $group = null, array $order = null, integer $limit = null, integer $offset = null, boolean $countRecords = null ) : ArrayCollection | Server[] Searches servers by criteria and selecting and initiating their Properties
getEnvironment ( ) : Environment | null Get Environment entity
getFarm ( ) : Farm | null Get Farm entity
getFarmRole ( ) : FarmRole | null Get FarmRole entity
getHistory ( ) : Scalr\Model\Entity\Server\History Gets server history entity
getImage ( ) : Image | null Get Image entity
getImportantPropertyList ( ) : array Gets a list of important properties which must not be deleted
getPort ( string $portType ) : integer Gets port
getSettingCriteria ( string $name, string $value = null, array $criteria = null ) : array Gets filter criteria by the setting
getTerminateReason ( integer $reasonId ) : string Gets terminate reason
hasAccessPermissions ( $user, $environment = null, $modify = null )
isVersionSupported ( string $v ) : boolean Check if given version is less than scalarizr version
reboot ( boolean $hard = false ) Reboot action
resume ( ) Resume action
save ( )
setFreeFarmIndex ( ) Set free farm index for new server
setFreeFarmRoleIndex ( ) Set free farm role index for new server
setOs ( string $osType ) : Server Sets OS type
setTimeLog ( string $field, integer $secondsSinceBoot = null, integer $secondsSinceStart = null ) : boolean Add record for servers_launch_timelog
suspend ( User $user = null ) : boolean Marks server as to be suspended.
terminate ( integer | array $reason, boolean $forcefully = null, User $user = null ) : boolean Marks server as to be terminated.
updateStatus ( string $serverStatus ) : Server Updates Server status
versionInfo ( string $v ) : int[] Parses version info into machine representation

Method Details

__get() public méthode

Magic getter
public __get ( string $name ) : mixed
$name string Name of property that is accessed
Résultat mixed Returns property value

__getDBServer() public méthode

Gets old model from entity
public __getDBServer ( ) : DBServer
Résultat DBServer

__getEntityFromDBServer() public méthode

Gets entity from old model
public __getEntityFromDBServer ( DBServer $DBServer ) : Server
$DBServer DBServer Db server object
Résultat Server

delete() public méthode

See also: AbstractEntity::delete()
public delete ( )

findPk() public static méthode

Temporary solution until we make serverId as primary key
public static findPk ( $serverId ) : mixed
$serverId
Résultat mixed

findWithProperties() public static méthode

Searches servers by criteria and selecting and initiating their Properties
public static findWithProperties ( array $criteria = null, array $group = null, array $order = null, integer $limit = null, integer $offset = null, boolean $countRecords = null ) : ArrayCollection | Server[]
$criteria array optional The search criteria.
$group array optional The group by looks like [property1, ...], by default groups by `serverId`
$order array optional The results order looks like [property1 => true|false, ... ]
$limit integer optional The records limit
$offset integer optional The offset
$countRecords boolean optional True to calculate total number of the records without limit
Résultat Scalr\Model\Collections\ArrayCollection | Server[] Returns collection of the entities.

getEnvironment() public méthode

Get Environment entity
public getEnvironment ( ) : Environment | null
Résultat Scalr\Model\Entity\Account\Environment | null Return Environment entity or null

getFarm() public méthode

Get Farm entity
public getFarm ( ) : Farm | null
Résultat Farm | null Returns the Farm entity which is associated with the Server or null otherwise

getFarmRole() public méthode

Get FarmRole entity
public getFarmRole ( ) : FarmRole | null
Résultat FarmRole | null Returns the FarmRole entity which is associated with the Server or null otherwise

getHistory() public méthode

Gets server history entity
public getHistory ( ) : Scalr\Model\Entity\Server\History
Résultat Scalr\Model\Entity\Server\History Returns server history entity

getImage() public méthode

Get Image entity
public getImage ( ) : Image | null
Résultat Image | null Return Image entity or null

getImportantPropertyList() public static méthode

Gets a list of important properties which must not be deleted
public static getImportantPropertyList ( ) : array
Résultat array Returns array of properties

getPort() public méthode

Gets port
public getPort ( string $portType ) : integer
$portType string
Résultat integer

getSettingCriteria() public méthode

Gets filter criteria by the setting
public getSettingCriteria ( string $name, string $value = null, array $criteria = null ) : array
$name string Setting name
$value string optional Setting value
$criteria array optional Criteria, if already exists
Résultat array Returns extended criteria

getTerminateReason() public static méthode

Gets terminate reason
public static getTerminateReason ( integer $reasonId ) : string
$reasonId integer Reason id
Résultat string

hasAccessPermissions() public méthode

See also: AccessPermissionsInterface::hasAccessPermissions()
public hasAccessPermissions ( $user, $environment = null, $modify = null )

isVersionSupported() public méthode

Check if given version is less than scalarizr version
public isVersionSupported ( string $v ) : boolean
$v string Version
Résultat boolean

reboot() public méthode

Reboot action
public reboot ( boolean $hard = false )
$hard boolean optional Method: Hard (true) | Soft (false)

resume() public méthode

Resume action
public resume ( )

save() public méthode

See also: AbstractEntity::save()
public save ( )

setFreeFarmIndex() public méthode

Set free farm index for new server
public setFreeFarmIndex ( )

setFreeFarmRoleIndex() public méthode

Set free farm role index for new server

setOs() public méthode

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

setTimeLog() public méthode

Add record for servers_launch_timelog
public setTimeLog ( string $field, integer $secondsSinceBoot = null, integer $secondsSinceStart = null ) : boolean
$field string Field name which we should update
$secondsSinceBoot integer optional Seconds since boot. Field is used for field ts_hi If field is ts_launched, ts_hi, ts_bhu, ts_hu, value could be used as timestamp
$secondsSinceStart integer optional Seconds since start. Field is used for field ts_hi
Résultat boolean

suspend() public méthode

Marks server as to be suspended.
public suspend ( User $user = null ) : boolean
$user Scalr\Model\Entity\Account\User optional The user entity
Résultat boolean

terminate() public méthode

Marks server as to be terminated.
public terminate ( integer | array $reason, boolean $forcefully = null, User $user = null ) : boolean
$reason integer | array The reason possibly with the format parameters.
$forcefully boolean optional Method: forcefully (true) | gracefully (false)
$user Scalr\Model\Entity\Account\User optional The user entity
Résultat boolean

updateStatus() public méthode

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

versionInfo() public static méthode

Parses version info into machine representation
public static versionInfo ( string $v ) : int[]
$v string String representation of a version
Résultat int[]

Property Details

$_environment protected_oe property

protected Environment,Scalr\Model\Entity\Account $_environment
Résultat Scalr\Model\Entity\Account\Environment

$_farm protected_oe property

protected Farm,Scalr\Model\Entity $_farm
Résultat Farm

$_farmRole protected_oe property

protected FarmRole,Scalr\Model\Entity $_farmRole
Résultat FarmRole

$_image protected_oe property

protected Image,Scalr\Model\Entity $_image
Résultat Image

$_properties protected_oe property

Server properties collection
protected SettingsCollection,Scalr\Model\Collections $_properties
Résultat Scalr\Model\Collections\SettingsCollection

$_scalarizr protected_oe property

protected Scalr_Net_Scalarizr_Client $_scalarizr
Résultat Scalr_Net_Scalarizr_Client

$_scalarizrUpdateClient protected_oe property

protected Scalr_Net_Scalarizr_UpdateClient $_scalarizrUpdateClient
Résultat Scalr_Net_Scalarizr_UpdateClient

$_serverHistory protected_oe property

protected History,Scalr\Model\Entity\Server $_serverHistory
Résultat Scalr\Model\Entity\Server\History

$accountId public_oe property

Identifier of the Client's Account
public int $accountId
Résultat integer

$added public_oe property

Added time
public DateTime $added
Résultat DateTime

$cloudLocation public_oe property

Server cloud location
public string $cloudLocation
Résultat string

$cloudLocationZone public_oe property

Zone a cloud is located
public string $cloudLocationZone
Résultat string

$envId public_oe property

Environment identifier
public int $envId
Résultat integer

$farmId public_oe property

Farm identifier
public int $farmId
Résultat integer

$farmIndex public_oe property

Index within the Farm
public int $farmIndex
Résultat integer

$farmRoleId public_oe property

Identifier for the role in a farm
public int $farmRoleId
Résultat integer

$id public_oe property

The identifier of the Server
public int $id
Résultat integer

$imageId public_oe property

Image identifier
public string $imageId
Résultat string

$index public_oe property

Index within the Farm Role
public int $index
Résultat integer

$initialized public_oe property

Initialized time
public DateTime $initialized
Résultat DateTime

$instanceTypeName public_oe property

Server instance type name
public string $instanceTypeName
Résultat string

$lastSync public_oe property

Time the synchronization occured last
public DateTime $lastSync
Résultat DateTime

$localIp public_oe property

Server local Ip
public string $localIp
Résultat string

$os public_oe property

Server OS type
public string $os
Résultat string

$platform public_oe property

Server platform
public string $platform
Résultat string

$rebootStart public_oe property

Time when server has been either rebooted or started
public DateTime $rebootStart
Résultat DateTime

$remoteIp public_oe property

Server remote Ip
public string $remoteIp
Résultat string

$scalarized public_oe property

Whether server is scalarized
public bool $scalarized
Résultat boolean

$serverId public_oe property

Server unique identifier
public string $serverId
Résultat string

$shutdownScheduled public_oe property

Sheduled time for shutdown
public DateTime $shutdownScheduled
Résultat DateTime

$status public_oe property

Status of a server
public string $status
Résultat string

$type public_oe property

Server instance type
public string $type
Résultat string