PHP Class Scalr_Environment

Following phpdocumentor comments have been derived from Scalr\DependencyInjection class:
Inheritance: extends Scalr_Model
ファイルを表示 Open project: scalr/scalr Class Usage Examples

Public Properties

Property Type Description
$clientId
$defaultPriority
$dtAdded
$id
$name
$status

Protected Properties

Property Type Description
$dbPropertyMap
$dbTableName

Public Methods

Method Description
__call ( $name, $arguments )
__get ( string $id ) : mixed
addTeam ( $teamId )
applyGlobalVarsToValue ( $value )
aws ( string | DBServer | DBFarmRole | DBEBSVolume $awsRegion = null, string $awsAccessKeyId = null, string $awsSecretAccessKey = null, string $certificate = null, string $privateKey = null ) : Aws Gets an Amazon Web Service (Aws) factory instance
azure ( ) : Azure Gets an Azure client instance
clearTeams ( )
cloudCredentialsList ( array $clouds = null, array $credentialsFilter = [], array $propertiesFilter = [], boolean $cacheResult = true ) : CloudCredentials[] Gets cloud credentials for listed clouds
cloudstack ( string $platform = 'cloudstack', string $apiUrl = null, string $apiKey = null, string $secretKey = null ) : CloudStack Gets an CloudStack client instance
create ( $name, $clientId )
delete ( $id = null )
enablePlatform ( $platform, $enabled = true )
get ( string $serviceid ) : mixed Gets an service or parameter by its id.
getAccountId ( ) : integer Gets identifier of the Account
getAwsTags ( ) : array Gets AWS tags that should be applied to the resource
getEnabledPlatforms ( $cacheResult = false, $clouds = null )
getFarmsCount ( )
getFullConfiguration ( ) : array Gets client_environment_properties
getLocations ( )
getPlatformConfigValue ( string $key, boolean $encrypted = true, string $group = '' ) : mixed Gets client_environment_properties value.
getRunningServersCount ( )
getTeams ( )
init ( string $className = null ) : Scalr_Environment Init
isPlatformEnabled ( $platform )
keychain ( string $cloud ) : CloudCredentials Gets specified cloud credentials for this environment
loadDefault ( $clientId )
openstack ( OpenStackConfig | string $platform, string $region = null ) : OpenStack Gets an OpenStack client instance
removeTeam ( $teamId )
save ( $forceInsert = false )
setPlatformConfig ( array $props, boolean $encrypt = true, string $group = '' ) Saves platform config value to database.

Protected Methods

Method Description
decryptValue ( $value )
encryptValue ( $value )

Private Methods

Method Description
getEncryptedVariables ( ) : array TODO: remove all variables encapsulated in cloud credentials Gets the list of the variables which need to be encrypted when we store them to database.
getLinkedVariables ( string $linkid = null ) : array TODO: migrate to the new cloud credentials entities Gets array of the linked variables

Method Details

__call() public method

See also: Scalr_Model::__call()
public __call ( $name, $arguments )

__get() public method

public __get ( string $id ) : mixed
$id string serviceid
return mixed

addTeam() public method

public addTeam ( $teamId )

applyGlobalVarsToValue() public method

public applyGlobalVarsToValue ( $value )

aws() public method

This method ensures that aws instance is always from the current environment scope.
public aws ( string | DBServer | DBFarmRole | DBEBSVolume $awsRegion = null, string $awsAccessKeyId = null, string $awsSecretAccessKey = null, string $certificate = null, string $privateKey = null ) : Aws
$awsRegion string | DBServer | DBFarmRole | DBEBSVolume optional The region or object which has both Scalr_Environment instance and cloud location itself
$awsAccessKeyId string optional The AccessKeyId
$awsSecretAccessKey string optional The SecretAccessKey
$certificate string optional Contains x.509 certificate
$privateKey string optional The private key for the certificate
return Scalr\Service\Aws Returns Aws instance

azure() public method

This method ensures that azure instance is always from the current environment scope
public azure ( ) : Azure
return Scalr\Service\Azure Returns azure instance from DI container

clearTeams() public method

public clearTeams ( )

cloudCredentialsList() public method

Gets cloud credentials for listed clouds
public cloudCredentialsList ( array $clouds = null, array $credentialsFilter = [], array $propertiesFilter = [], boolean $cacheResult = true ) : CloudCredentials[]
$clouds array optional Clouds list
$credentialsFilter array optional Criteria to filter by CloudCredentials properties
$propertiesFilter array optional Criteria to filter by CloudCredentialsProperties
$cacheResult boolean optional Cache result
return Scalr\Model\Entity\CloudCredentials[]

cloudstack() public method

This method ensures that cloudstack instance is always from the current environment scope
public cloudstack ( string $platform = 'cloudstack', string $apiUrl = null, string $apiKey = null, string $secretKey = null ) : CloudStack
$platform string Platform name
$apiUrl string The endpoint name url
$apiKey string Api key
$secretKey string Secret key
return Scalr\Service\CloudStack\CloudStack Returns cloudstack instance from DI container

create() public method

public create ( $name, $clientId )

decryptValue() protected method

protected decryptValue ( $value )

delete() public method

See also: Scalr_Model::delete()
public delete ( $id = null )

enablePlatform() public method

public enablePlatform ( $platform, $enabled = true )

encryptValue() protected method

protected encryptValue ( $value )

get() public method

Gets an service or parameter by its id.
public get ( string $serviceid ) : mixed
$serviceid string
return mixed

getAccountId() public method

Gets identifier of the Account
public getAccountId ( ) : integer
return integer Returns identifier of the Account

getAwsTags() public method

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

getEnabledPlatforms() public method

public getEnabledPlatforms ( $cacheResult = false, $clouds = null )

getFarmsCount() public method

public getFarmsCount ( )

getFullConfiguration() public method

Gets client_environment_properties
public getFullConfiguration ( ) : array
return array Returns all config entries

getLocations() public method

public getLocations ( )

getPlatformConfigValue() public method

Gets client_environment_properties value.
public getPlatformConfigValue ( string $key, boolean $encrypted = true, string $group = '' ) : mixed
$key string Property name.
$encrypted boolean optional This value is ignored and never taken into account
$group string optional Group name.
return mixed Returns config value on success or NULL if value does not exist.

getRunningServersCount() public method

getTeams() public method

public getTeams ( )

init() public static method

Init
public static init ( string $className = null ) : Scalr_Environment
$className string
return Scalr_Environment

isPlatformEnabled() public method

public isPlatformEnabled ( $platform )

keychain() public method

Gets specified cloud credentials for this environment
public keychain ( string $cloud ) : CloudCredentials
$cloud string The cloud name
return Scalr\Model\Entity\CloudCredentials

loadDefault() public method

public loadDefault ( $clientId )

openstack() public method

This method ensures that openstack instance is always from the current environment scope
public openstack ( OpenStackConfig | string $platform, string $region = null ) : OpenStack
$platform Scalr\Service\OpenStack\OpenStackConfig | string The platform name or Openstack config
$region string optional The region
return Scalr\Service\OpenStack\OpenStack Returns openstack instance from DI container

removeTeam() public method

public removeTeam ( $teamId )

save() public method

See also: Scalr_Model::save()
public save ( $forceInsert = false )

setPlatformConfig() public method

This operation will update client_environment_properties table or delete if value is null.
public setPlatformConfig ( array $props, boolean $encrypt = true, string $group = '' )
$props array List of properties with its values keypairs to save.
$encrypt boolean optional This value is ignored and never taken into account.
$group string Group

Property Details

$clientId public_oe property

public $clientId

$dbPropertyMap protected_oe property

protected $dbPropertyMap

$dbTableName protected_oe property

protected $dbTableName

$defaultPriority public_oe property

public $defaultPriority

$dtAdded public_oe property

public $dtAdded

$id public_oe property

public $id

$name public_oe property

public $name

$status public_oe property

public $status