Amazon EC2 adapter for infrastructure service

package Zend_Cloud_Infrastructure
subpackage Adapter
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License
inherited_from \Zend_Cloud_Infrastructure_Adapter_AbstractAdapter

 Methods

Constructor

__construct(array|\Zend_Config $options = array()) : void

Parameters

$options

array\Zend_Config

Create a new instance

createInstance(string $name, array $options) : \Instance | boolean

Parameters

$name

string

$options

array

Returns

\Instanceboolean

Run arbitrary shell script on an instance

deployInstance(string $id, $params, string|array $cmd) : string | array
Inherited
inherited_from \Zend_Cloud_Infrastructure_Adapter::deployInstance()

Parameters

$id

string

$params

$cmd

stringarray

Returns

stringarray

Destroy an instance

destroyInstance(string $id) : boolean

Parameters

$id

string

Returns

boolean

Get the adapter

getAdapter() : \Zend_Service_Amazon_Ec2_Instance

Returns

\Zend_Service_Amazon_Ec2_Instance

Get the last result of the adapter

getAdapterResult() : array
Inherited
inherited_from \Zend_Cloud_Infrastructure_Adapter::getAdapterResult()

Returns

array

Get last HTTP request

getLastHttpRequest() : string

Returns

string

Get the last HTTP response

getLastHttpResponse() : \Zend_Http_Response

Returns

\Zend_Http_Response

Return a list of all the available instance images

imagesInstance() : \ImageList

Returns

\ImageList

Return a list of the available instancies

listInstances() : \Zend_Cloud_Infrastructure_InstanceList

Returns

\Zend_Cloud_Infrastructure_InstanceList

Return the system information about the $metric of an instance

monitorInstance(string $id, string $metric, null|array $options = null) : array

Parameters

$id

string

$metric

string

$options

nullarray

Returns

array

Return the public DNS name of the instance

publicDnsInstance(string $id) : string | boolean

Parameters

$id

string

Returns

stringboolean

Reboot an instance

rebootInstance(string $id) : boolean

Parameters

$id

string

Returns

boolean

Start an instance

startInstance(string $id) : boolean

Parameters

$id

string

Returns

boolean

Return the status of an instance

statusInstance($id) : string | boolean

Parameters

$id

Returns

stringboolean

Stop an instance

stopInstance(string $id) : boolean

Parameters

$id

string

Returns

boolean

Wait for status $status with a timeout of $timeout seconds

waitStatusInstance(string $id, string $status, integer $timeout = self::TIMEOUT_STATUS_CHANGE) : boolean
Inherited
inherited_from \Zend_Cloud_Infrastructure_Adapter::waitStatusInstance()

Parameters

$id

string

$status

string

$timeout

integer

Returns

boolean

Return all the available zones

zonesInstance() : array

Returns

array

Convert the attributes of EC2 into attributes of Infrastructure

convertAttributes(array $attr) : array | boolean

Parameters

$attr

array

Returns

arrayboolean

 Properties

 

AWS Access Key

$accessKey : string

Default

 

AWS Access Secret

$accessSecret : string

Default

 

Store the last response from the adpter

$adapterResult : array

Default

 

Ec2 Instance

$ec2 : \Ec2Instance

Default

 

Ec2 Image

$ec2Image : \Ec2Image

Default

 

Ec2 Monitor

$ec2Monitor : \Ec2Monitor

Default

 

Ec2 Zone

$ec2Zone : \Ec2Zone

Default

 

Map monitor metrics between Infrastructure and EC2

$mapMetrics : array

Default

array(\Zend_Cloud_Infrastructure_Instance::MONITOR_CPU => 'CPUUtilization', \Zend_Cloud_Infrastructure_Instance::MONITOR_DISK_READ => 'DiskReadBytes', \Zend_Cloud_Infrastructure_Instance::MONITOR_DISK_WRITE => 'DiskWriteBytes', \Zend_Cloud_Infrastructure_Instance::MONITOR_NETWORK_IN => 'NetworkIn', \Zend_Cloud_Infrastructure_Instance::MONITOR_NETWORK_OUT => 'NetworkOut')
 

Map array between EC2 and Infrastructure status

$mapStatus : array

Default

array('running' => \Zend_Cloud_Infrastructure_Instance::STATUS_RUNNING, 'terminated' => \Zend_Cloud_Infrastructure_Instance::STATUS_TERMINATED, 'pending' => \Zend_Cloud_Infrastructure_Instance::STATUS_PENDING, 'shutting-down' => \Zend_Cloud_Infrastructure_Instance::STATUS_SHUTTING_DOWN, 'stopping' => \Zend_Cloud_Infrastructure_Instance::STATUS_PENDING, 'stopped' => \Zend_Cloud_Infrastructure_Instance::STATUS_STOPPED, 'rebooting' => \Zend_Cloud_Infrastructure_Instance::STATUS_REBOOTING)
 

Region zone

$region : string

Default

 

Valid metrics for monitor

$validMetrics : array

Default

array(\Zend_Cloud_Infrastructure_Instance::MONITOR_CPU, \Zend_Cloud_Infrastructure_Instance::MONITOR_RAM, \Zend_Cloud_Infrastructure_Instance::MONITOR_DISK, \Zend_Cloud_Infrastructure_Instance::MONITOR_DISK_READ, \Zend_Cloud_Infrastructure_Instance::MONITOR_DISK_WRITE, \Zend_Cloud_Infrastructure_Instance::MONITOR_NETWORK_IN, \Zend_Cloud_Infrastructure_Instance::MONITOR_NETWORK_OUT)

 Constants

 

AWS constants

AWS_ACCESS_KEY = 'aws_accesskey' 
 

AWS_REGION

AWS_REGION = 'aws_region' 
 

AWS_SECRET_KEY

AWS_SECRET_KEY = 'aws_secretkey' 
 

AWS_SECURITY_GROUP

AWS_SECURITY_GROUP = 'securityGroup'