PHP Class DBFarm

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

Méthodes publiques

Свойство Type Description
$ClientID
$Comments
$EnvID
$Hash
$ID
$Name
$RolesLaunchOrder
$ScalarizrCertificate
$Status
$TermOnSyncFail
$changedByUserId
$changedTime
$createdByUserEmail
$ownerId

Méthodes publiques

Méthode Description
AddRole ( DBRole $DBRole, string $platform, string $cloudLocation, integer $launchIndex, string $alias = "" ) : DBFarmRole Adds a role to farm
GetAllSettings ( ) : unknown_type Returns all farm settings
GetEnvironmentObject ( ) : Scalr_Environment
GetFarmRoleByBehavior ( string $behavior ) :
GetFarmRoleByRoleID ( integer $role_id ) : DBFarmRole
GetFarmRoleIdByAlias ( $alias )
GetFarmRoles ( ) : DBFarmRole[] Gets the list of the FarmRoles ordered by launch index.
GetMySQLInstances ( $only_master = false, $only_slaves = false )
GetServersByFilter ( array $filter_args = [], array $ufilter_args = [] ) : DBServer[] Gets the list of the servers by specified filter
GetSetting ( string $name ) : mixed Get Farm setting by name
LoadByID ( $id ) : DBFarm Load DBInstance by database id
LoadByIDOnlyName ( $id )
SetSetting ( string $name, mixed $value ) : void Set farm setting
__construct ( $id = null ) : void Constructor
__getNewFarmObject ( ) : Farm
__sleep ( )
__wakeup ( )
applyGlobalVarsToValue ( $value )
cloneFarm ( string | boolean $name = false, Scalr_Account_User $user, integer $envId ) : DBFarm Creates clone for the farm
cloneFarmRoles ( DBFarm $newFarm ) Clones FarmRoles with settings from this Farm to a new Farm
create ( string $name, Scalr_Account_User $user, integer $envId ) : DBFarm Initializes a new farm
getAwsTags ( ) : array Gets AWS tags that should be applied to the resource
getDefinition ( )
isLocked ( $throwException = true ) : boolean Check if farm is locked
loadFields ( array $record ) : DBFarm Load DBInstance
lock ( $userId, $comment, $restrict )
save ( )
setProject ( ProjectEntity | string $project ) : string Associates cost analytics project with the farm
unlock ( $userId )

Method Details

AddRole() public méthode

Adds a role to farm
public AddRole ( DBRole $DBRole, string $platform, string $cloudLocation, integer $launchIndex, string $alias = "" ) : DBFarmRole
$DBRole DBRole The role object
$platform string The cloud platform
$cloudLocation string The cloud location
$launchIndex integer Launch index
$alias string optional
Résultat DBFarmRole

GetAllSettings() public méthode

Returns all farm settings
public GetAllSettings ( ) : unknown_type
Résultat unknown_type

GetEnvironmentObject() public méthode

public GetEnvironmentObject ( ) : Scalr_Environment
Résultat Scalr_Environment

GetFarmRoleByBehavior() public méthode

public GetFarmRoleByBehavior ( string $behavior ) :
$behavior string
Résultat

GetFarmRoleByRoleID() public méthode

public GetFarmRoleByRoleID ( integer $role_id ) : DBFarmRole
$role_id integer
Résultat DBFarmRole

GetFarmRoleIdByAlias() public méthode

public GetFarmRoleIdByAlias ( $alias )

GetFarmRoles() public méthode

Gets the list of the FarmRoles ordered by launch index.
public GetFarmRoles ( ) : DBFarmRole[]
Résultat DBFarmRole[] Returns the list of the FarmRoles

GetMySQLInstances() public méthode

public GetMySQLInstances ( $only_master = false, $only_slaves = false )

GetServersByFilter() public méthode

Gets the list of the servers by specified filter
public GetServersByFilter ( array $filter_args = [], array $ufilter_args = [] ) : DBServer[]
$filter_args array optional Positive logic of filtering
$ufilter_args array optional Negation logic of filtering
Résultat DBServer[] Returns the list of the DBServers

GetSetting() public méthode

Get Farm setting by name
public GetSetting ( string $name ) : mixed
$name string
Résultat mixed

LoadByID() public static méthode

Load DBInstance by database id
public static LoadByID ( $id ) : DBFarm
$id
Résultat DBFarm

LoadByIDOnlyName() public static méthode

public static LoadByIDOnlyName ( $id )

SetSetting() public méthode

Set farm setting
public SetSetting ( string $name, mixed $value ) : void
$name string
$value mixed
Résultat void

__construct() public méthode

Constructor
public __construct ( $id = null ) : void
Résultat void

__getNewFarmObject() public méthode

public __getNewFarmObject ( ) : Farm
Résultat Scalr\Model\Entity\Farm

__sleep() public méthode

public __sleep ( )

__wakeup() public méthode

public __wakeup ( )

applyGlobalVarsToValue() public méthode

public applyGlobalVarsToValue ( $value )

cloneFarm() public méthode

Creates clone for the farm
public cloneFarm ( string | boolean $name = false, Scalr_Account_User $user, integer $envId ) : DBFarm
$name string | boolean The name of the farm
$user Scalr_Account_User The user object
$envId integer The identifier of the environment
Résultat DBFarm Returns clone

cloneFarmRoles() public méthode

Clones FarmRoles with settings from this Farm to a new Farm
public cloneFarmRoles ( DBFarm $newFarm )
$newFarm DBFarm A Farm into which Roles be cloned

create() public static méthode

TODO: Rewrite this terrible code.
public static create ( string $name, Scalr_Account_User $user, integer $envId ) : DBFarm
$name string The name of the farm
$user Scalr_Account_User The user
$envId integer The identifier of the environment
Résultat DBFarm

getAwsTags() public méthode

Gets AWS tags that should be applied to the resource
public getAwsTags ( ) : array
Résultat array Returns list of the AWS tags

getDefinition() public méthode

public getDefinition ( )

isLocked() public méthode

Check if farm is locked
public isLocked ( $throwException = true ) : boolean
$throwException
Résultat boolean

loadFields() public static méthode

Load DBInstance
public static loadFields ( array $record ) : DBFarm
$record array Array of farm fields
Résultat DBFarm

lock() public méthode

public lock ( $userId, $comment, $restrict )
$userId integer
$comment string
$restrict bool

save() public méthode

public save ( )

setProject() public méthode

It does not perform any actions if cost analytics is disabled
public setProject ( ProjectEntity | string $project ) : string
$project Scalr\Stats\CostAnalytics\Entity\ProjectEntity | string The project entity or its identifier
Résultat string Returns identifier of the associated project

unlock() public méthode

public unlock ( $userId )
$userId integer

Property Details

$ClientID public_oe property

public $ClientID

$Comments public_oe property

public $Comments

$EnvID public_oe property

public $EnvID

$Hash public_oe property

public $Hash

$ID public_oe property

public $ID

$Name public_oe property

public $Name

$RolesLaunchOrder public_oe property

public $RolesLaunchOrder

$ScalarizrCertificate public_oe property

public $ScalarizrCertificate

$Status public_oe property

public $Status

$TermOnSyncFail public_oe property

public $TermOnSyncFail

$changedByUserId public_oe property

public $changedByUserId

$changedTime public_oe property

public $changedTime

$createdByUserEmail public_oe property

public $createdByUserEmail

$ownerId public_oe property

public $ownerId