PHP Class Scalr_Environment

Following phpdocumentor comments have been derived from Scalr\DependencyInjection class:
Inheritance: extends Scalr_Model
Afficher le fichier Open project: scalr/scalr Class Usage Examples

Méthodes publiques

Свойство Type Description
$clientId
$defaultPriority
$dtAdded
$id
$name
$status

Protected Properties

Свойство Type Description
$dbPropertyMap
$dbTableName

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode Description
decryptValue ( $value )
encryptValue ( $value )

Private Methods

Méthode 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 méthode

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

__get() public méthode

public __get ( string $id ) : mixed
$id string serviceid
Résultat mixed

addTeam() public méthode

public addTeam ( $teamId )

applyGlobalVarsToValue() public méthode

public applyGlobalVarsToValue ( $value )

aws() public méthode

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
Résultat Scalr\Service\Aws Returns Aws instance

azure() public méthode

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

clearTeams() public méthode

public clearTeams ( )

cloudCredentialsList() public méthode

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
Résultat Scalr\Model\Entity\CloudCredentials[]

cloudstack() public méthode

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
Résultat Scalr\Service\CloudStack\CloudStack Returns cloudstack instance from DI container

create() public méthode

public create ( $name, $clientId )

decryptValue() protected méthode

protected decryptValue ( $value )

delete() public méthode

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

enablePlatform() public méthode

public enablePlatform ( $platform, $enabled = true )

encryptValue() protected méthode

protected encryptValue ( $value )

get() public méthode

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

getAccountId() public méthode

Gets identifier of the Account
public getAccountId ( ) : integer
Résultat integer Returns identifier of the Account

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

getEnabledPlatforms() public méthode

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

getFarmsCount() public méthode

public getFarmsCount ( )

getFullConfiguration() public méthode

Gets client_environment_properties
public getFullConfiguration ( ) : array
Résultat array Returns all config entries

getLocations() public méthode

public getLocations ( )

getPlatformConfigValue() public méthode

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.
Résultat mixed Returns config value on success or NULL if value does not exist.

getRunningServersCount() public méthode

getTeams() public méthode

public getTeams ( )

init() public static méthode

Init
public static init ( string $className = null ) : Scalr_Environment
$className string
Résultat Scalr_Environment

isPlatformEnabled() public méthode

public isPlatformEnabled ( $platform )

keychain() public méthode

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

loadDefault() public méthode

public loadDefault ( $clientId )

openstack() public méthode

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
Résultat Scalr\Service\OpenStack\OpenStack Returns openstack instance from DI container

removeTeam() public méthode

public removeTeam ( $teamId )

save() public méthode

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

setPlatformConfig() public méthode

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