PHP Класс Scalr\Model\Entity\Server

Автор: N.V.
Наследование: extends Scalr\Model\AbstractEntity, implements Scalr\DataType\AccessPermissionsInterface
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$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)

Свойство Тип Описание
$_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

Открытые методы

Метод Описание
__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

Описание методов

__get() публичный Метод

Magic getter
public __get ( string $name ) : mixed
$name string Name of property that is accessed
Результат mixed Returns property value

__getDBServer() публичный Метод

Gets old model from entity
public __getDBServer ( ) : DBServer
Результат DBServer

__getEntityFromDBServer() публичный Метод

Gets entity from old model
public __getEntityFromDBServer ( DBServer $DBServer ) : Server
$DBServer DBServer Db server object
Результат Server

delete() публичный Метод

См. также: AbstractEntity::delete()
public delete ( )

findPk() публичный статический Метод

Temporary solution until we make serverId as primary key
public static findPk ( $serverId ) : mixed
$serverId
Результат mixed

findWithProperties() публичный статический Метод

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
Результат Scalr\Model\Collections\ArrayCollection | Server[] Returns collection of the entities.

getEnvironment() публичный Метод

Get Environment entity
public getEnvironment ( ) : Environment | null
Результат Scalr\Model\Entity\Account\Environment | null Return Environment entity or null

getFarm() публичный Метод

Get Farm entity
public getFarm ( ) : Farm | null
Результат Farm | null Returns the Farm entity which is associated with the Server or null otherwise

getFarmRole() публичный Метод

Get FarmRole entity
public getFarmRole ( ) : FarmRole | null
Результат FarmRole | null Returns the FarmRole entity which is associated with the Server or null otherwise

getHistory() публичный Метод

Gets server history entity
public getHistory ( ) : Scalr\Model\Entity\Server\History
Результат Scalr\Model\Entity\Server\History Returns server history entity

getImage() публичный Метод

Get Image entity
public getImage ( ) : Image | null
Результат Image | null Return Image entity or null

getImportantPropertyList() публичный статический Метод

Gets a list of important properties which must not be deleted
public static getImportantPropertyList ( ) : array
Результат array Returns array of properties

getPort() публичный Метод

Gets port
public getPort ( string $portType ) : integer
$portType string
Результат integer

getSettingCriteria() публичный Метод

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
Результат array Returns extended criteria

getTerminateReason() публичный статический Метод

Gets terminate reason
public static getTerminateReason ( integer $reasonId ) : string
$reasonId integer Reason id
Результат string

hasAccessPermissions() публичный Метод

См. также: AccessPermissionsInterface::hasAccessPermissions()
public hasAccessPermissions ( $user, $environment = null, $modify = null )

isVersionSupported() публичный Метод

Check if given version is less than scalarizr version
public isVersionSupported ( string $v ) : boolean
$v string Version
Результат boolean

reboot() публичный Метод

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

resume() публичный Метод

Resume action
public resume ( )

save() публичный Метод

См. также: AbstractEntity::save()
public save ( )

setFreeFarmIndex() публичный Метод

Set free farm index for new server
public setFreeFarmIndex ( )

setFreeFarmRoleIndex() публичный Метод

Set free farm role index for new server

setOs() публичный Метод

Sets OS type
public setOs ( string $osType ) : Server
$osType string Operating System type (linux/windows)
Результат Server

setTimeLog() публичный Метод

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
Результат boolean

suspend() публичный Метод

Marks server as to be suspended.
public suspend ( User $user = null ) : boolean
$user Scalr\Model\Entity\Account\User optional The user entity
Результат boolean

terminate() публичный Метод

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
Результат boolean

updateStatus() публичный Метод

Updates Server status
public updateStatus ( string $serverStatus ) : Server
$serverStatus string The status
Результат Server

versionInfo() публичный статический Метод

Parses version info into machine representation
public static versionInfo ( string $v ) : int[]
$v string String representation of a version
Результат int[]

Описание свойств

$_environment защищенное свойство

protected Environment,Scalr\Model\Entity\Account $_environment
Результат Scalr\Model\Entity\Account\Environment

$_farm защищенное свойство

protected Farm,Scalr\Model\Entity $_farm
Результат Farm

$_farmRole защищенное свойство

protected FarmRole,Scalr\Model\Entity $_farmRole
Результат FarmRole

$_image защищенное свойство

protected Image,Scalr\Model\Entity $_image
Результат Image

$_properties защищенное свойство

Server properties collection
protected SettingsCollection,Scalr\Model\Collections $_properties
Результат Scalr\Model\Collections\SettingsCollection

$_scalarizr защищенное свойство

protected Scalr_Net_Scalarizr_Client $_scalarizr
Результат Scalr_Net_Scalarizr_Client

$_scalarizrUpdateClient защищенное свойство

protected Scalr_Net_Scalarizr_UpdateClient $_scalarizrUpdateClient
Результат Scalr_Net_Scalarizr_UpdateClient

$_serverHistory защищенное свойство

protected History,Scalr\Model\Entity\Server $_serverHistory
Результат Scalr\Model\Entity\Server\History

$accountId публичное свойство

Identifier of the Client's Account
public int $accountId
Результат integer

$added публичное свойство

Added time
public DateTime $added
Результат DateTime

$cloudLocation публичное свойство

Server cloud location
public string $cloudLocation
Результат string

$cloudLocationZone публичное свойство

Zone a cloud is located
public string $cloudLocationZone
Результат string

$envId публичное свойство

Environment identifier
public int $envId
Результат integer

$farmId публичное свойство

Farm identifier
public int $farmId
Результат integer

$farmIndex публичное свойство

Index within the Farm
public int $farmIndex
Результат integer

$farmRoleId публичное свойство

Identifier for the role in a farm
public int $farmRoleId
Результат integer

$id публичное свойство

The identifier of the Server
public int $id
Результат integer

$imageId публичное свойство

Image identifier
public string $imageId
Результат string

$index публичное свойство

Index within the Farm Role
public int $index
Результат integer

$initialized публичное свойство

Initialized time
public DateTime $initialized
Результат DateTime

$instanceTypeName публичное свойство

Server instance type name
public string $instanceTypeName
Результат string

$lastSync публичное свойство

Time the synchronization occured last
public DateTime $lastSync
Результат DateTime

$localIp публичное свойство

Server local Ip
public string $localIp
Результат string

$os публичное свойство

Server OS type
public string $os
Результат string

$platform публичное свойство

Server platform
public string $platform
Результат string

$rebootStart публичное свойство

Time when server has been either rebooted or started
public DateTime $rebootStart
Результат DateTime

$remoteIp публичное свойство

Server remote Ip
public string $remoteIp
Результат string

$scalarized публичное свойство

Whether server is scalarized
public bool $scalarized
Результат boolean

$serverId публичное свойство

Server unique identifier
public string $serverId
Результат string

$shutdownScheduled публичное свойство

Sheduled time for shutdown
public DateTime $shutdownScheduled
Результат DateTime

$status публичное свойство

Status of a server
public string $status
Результат string

$type публичное свойство

Server instance type
public string $type
Результат string