PHP Class Scalr\Service\Aws

Since: 18.09.2012
Author: Vitaliy Demidov ([email protected])
Datei anzeigen Open project: scalr/scalr Class Usage Examples

Public Properties

Property Type Description
$queriesQuantity integer The quantity of the processed queries to the AWS API

Protected Properties

Property Type Description
$container Scalr\DependencyInjection\Container

Public Methods

Method Description
__construct ( string $accessKeyId, string $secretAccessKey, string $region = null, string $certificate = null, string $privateKey = null ) Constructor
__get ( string $name ) : mixed | null Magic getter
describeRegions ( ) : Scalr\Service\Aws\Ec2\DataType\RegionInfoList DescribeRegions action
getAccessKeyId ( ) : string Gets Access Key Id
getAccountNumber ( ) : string Retrieves AWS Account Number
getAvailableRegions ( boolean $ignoreCache = false ) : array Gets available regions
getAvailableServiceInterfaces ( ) : array Gets implemented web service interfaces
getCertificate ( ) : string Get x.509 certificate
getCloudLocations ( ) : array Gets defined AWS cloud locations
getCloudLocationsZoneIds ( ) : array Gets defined AWS cloud locations hosted zone ids
getContainer ( ) : Container Gets container
getDebug ( ) : boolean Gets debug flag value
getEntityManager ( ) : Scalr\Service\Aws\EntityManager Gets an AWS Entity Manager
getEnvironment ( ) : Scalr_Environment Gets an Scalr Environment object which is associated with the AWS client instance
getEventObserver ( ) : Scalr\Service\Aws\Plugin\EventObserver Gets an AWS client event observer
getMd5Base64Digest ( string $string ) : string Calculates an MD5.Base64digest for the given string.
getMd5Base64DigestFile ( string $file ) : string Calculates an MD5.Base64digest for the given file.
getPresignedUrl ( string $service, string $action, string $destRegion, string $objectId ) Gets presigned url signed with aws4 version signing algorithm
getPrivateKey ( ) : string Get private key
getProxy ( ) : array | boolean Gets proxy configuration
getReflectionClass ( ) : ReflectionClass Gets reflection class of Aws
getRegion ( ) : string Gets region
getSecretAccessKey ( ) : string Gets Secret Access Key
getUserArn ( ) : string Retrieves AWS user arn
getUsername ( ) : string Retrieves AWS username
isValidRegion ( string $region ) : boolean Checks whether provided region is valid.
resetDebug ( ) : Aws Resets debug
setDebug ( boolean $debug = true ) : Aws Sets debug flag
setEnvironment ( Scalr_Environment $environment = null ) : Aws Sets an Scalr environment object which is associated with the AWS client instance
setEventObserver ( Scalr\Service\Aws\Plugin\EventObserver $eventObserver = null ) : Aws Sets an AWS client event observer object associated with this instance
setProxy ( string $host, integer $port = 3128, string $user = null, string $pass = null, integer $type, integer $authType = 1 ) Set proxy configuration to connect to AWS services
validateCertificateAndPrivateKey ( ) : boolean Validates certificate and privatekey making AWS SOAP request

Method Details

__construct() public method

Constructor
public __construct ( string $accessKeyId, string $secretAccessKey, string $region = null, string $certificate = null, string $privateKey = null )
$accessKeyId string AWS access key id
$secretAccessKey string AWS secret access key
$region string optional An AWS region. (Aws::REGION_US_EAST_1)
$certificate string optional AWS x.509 certificate (It's used only for Soap API)
$privateKey string optional Private Key (It's used only for Soap API)

__get() public method

Magic getter
public __get ( string $name ) : mixed | null
$name string
return mixed | null

describeRegions() public method

DescribeRegions action
public describeRegions ( ) : Scalr\Service\Aws\Ec2\DataType\RegionInfoList
return Scalr\Service\Aws\Ec2\DataType\RegionInfoList Returns the list of the RegionInfoData objects on success

getAccessKeyId() public method

Gets Access Key Id
public getAccessKeyId ( ) : string
return string Returns Access Key Id

getAccountNumber() public method

Retrieves AWS Account Number
public getAccountNumber ( ) : string
return string Returns AWS Account number for current user

getAvailableRegions() public method

Gets available regions
public getAvailableRegions ( boolean $ignoreCache = false ) : array
$ignoreCache boolean optional If true it will ignore cache
return array Returns list of available regions

getAvailableServiceInterfaces() public method

Gets implemented web service interfaces
public getAvailableServiceInterfaces ( ) : array
return array Returns Returns the list of available (implemented) web service interfaces

getCertificate() public method

Get x.509 certificate
public getCertificate ( ) : string
return string Returns x.509 certificate

getCloudLocations() public static method

Gets defined AWS cloud locations
public static getCloudLocations ( ) : array
return array

getCloudLocationsZoneIds() public static method

Gets defined AWS cloud locations hosted zone ids
public static getCloudLocationsZoneIds ( ) : array
return array

getContainer() public method

Gets container
public getContainer ( ) : Container
return Scalr\DependencyInjection\Container

getDebug() public method

Gets debug flag value
public getDebug ( ) : boolean
return boolean Returns true if debug is enabled.

getEntityManager() public method

This manager helps manipulate with retrieved from AWS objects. These object are stored in the cache.
public getEntityManager ( ) : Scalr\Service\Aws\EntityManager
return Scalr\Service\Aws\EntityManager Returns an AWS Entity Manager object.

getEnvironment() public method

Gets an Scalr Environment object which is associated with the AWS client instance
public getEnvironment ( ) : Scalr_Environment
return Scalr_Environment Returns Scalr Environment object

getEventObserver() public method

Gets an AWS client event observer
public getEventObserver ( ) : Scalr\Service\Aws\Plugin\EventObserver
return Scalr\Service\Aws\Plugin\EventObserver Returns AWS client event observer

getMd5Base64Digest() public static method

Calculates an MD5.Base64digest for the given string.
public static getMd5Base64Digest ( string $string ) : string
$string string A string which should digest be calculated for.
return string Returns MD5 Base64 digest

getMd5Base64DigestFile() public static method

Calculates an MD5.Base64digest for the given file.
public static getMd5Base64DigestFile ( string $file ) : string
$file string A file path which should digest be calculated for.
return string Returns MD5 Base64 digest

getPresignedUrl() public method

Gets presigned url signed with aws4 version signing algorithm
public getPresignedUrl ( string $service, string $action, string $destRegion, string $objectId )
$service string Service name (ec2, s3)
$action string Action name (CopySnapshot)
$destRegion string Destination region
$objectId string Id of the snapshot, image , etc

getPrivateKey() public method

Get private key
public getPrivateKey ( ) : string
return string Returns private key from certificate

getProxy() public method

Gets proxy configuration
public getProxy ( ) : array | boolean
return array | boolean

getReflectionClass() public static method

Gets reflection class of Aws
public static getReflectionClass ( ) : ReflectionClass
return ReflectionClass Returns reflection class of Aws

getRegion() public method

Gets region
public getRegion ( ) : string
return string Returns region that has been provided for instance

getSecretAccessKey() public method

Gets Secret Access Key
public getSecretAccessKey ( ) : string
return string Returns Secret Access Key

getUserArn() public method

Retrieves AWS user arn
public getUserArn ( ) : string
return string Returns AWS user arn

getUsername() public method

Retrieves AWS username
public getUsername ( ) : string
return string Returns AWS username

isValidRegion() public method

Checks whether provided region is valid.
public isValidRegion ( string $region ) : boolean
$region string AWS region (Aws::REGION_US_EAST_1)
return boolean Returns boolean true if region is valid or false otherwise.

resetDebug() public method

Resets debug
public resetDebug ( ) : Aws
return Aws

setDebug() public method

Sets debug flag
public setDebug ( boolean $debug = true ) : Aws
$debug boolean optional If true it will enable debug mode
return Aws

setEnvironment() public method

Sets an Scalr environment object which is associated with the AWS client instance
public setEnvironment ( Scalr_Environment $environment = null ) : Aws
$environment Scalr_Environment An environment object
return Aws

setEventObserver() public method

Sets an AWS client event observer object associated with this instance
public setEventObserver ( Scalr\Service\Aws\Plugin\EventObserver $eventObserver = null ) : Aws
$eventObserver Scalr\Service\Aws\Plugin\EventObserver The event observer
return Aws

setProxy() public method

Set proxy configuration to connect to AWS services
public setProxy ( string $host, integer $port = 3128, string $user = null, string $pass = null, integer $type, integer $authType = 1 )
$host string
$port integer
$user string
$pass string
$type integer Allowed values 4 - SOCKS4, 5 - SOCKS5, 0 - HTTP
$authType integer Allowed authtypes: 1 - Basic, Digest - 2, GSSNeg - 4, NTLM - 8, any - -1

validateCertificateAndPrivateKey() public method

Validates certificate and privatekey making AWS SOAP request
public validateCertificateAndPrivateKey ( ) : boolean
return boolean Returns true on success or throws an exception

Property Details

$container protected_oe property

protected Container,Scalr\DependencyInjection $container
return Scalr\DependencyInjection\Container

$queriesQuantity public_oe property

The quantity of the processed queries to the AWS API
public int $queriesQuantity
return integer