Cloud/Infrastructure/Adapter/Ec2.php
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Cloud_Infrastructure
- Subpackage
- Adapter
\Zend_Cloud_Infrastructure_Adapter_Ec2
Package: Zend_Cloud_Infrastructure\Adapter















Amazon EC2 adapter for infrastructure service
- Parent(s)
- \Zend_Cloud_Infrastructure_Adapter_AbstractAdapter
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Constants
Properties


array $mapMetrics = 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 monitor metrics between Infrastructure and EC2
Default value
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')
Details- Type
- array


array $mapStatus = 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)
Map array between EC2 and Infrastructure status
Default value
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)
Details- Type
- array
Methods


__construct(array | \Zend_Config $options = array()) : void
Constructor
Parameters
Name | Type | Description |
---|---|---|
$options | array | \Zend_Config |


convertAttributes(array $attr) : array | boolean
Convert the attributes of EC2 into attributes of Infrastructure
Parameters
Returns
Name | Type | Description |
---|---|---|
$attr | array |
Type | Description |
---|---|
array | boolean |


createInstance(string $name, array $options) : \Instance | boolean
Create a new instance
Parameters
Returns
Name | Type | Description |
---|---|---|
$name | string | |
$options | array |
Type | Description |
---|---|
\Instance | boolean |


destroyInstance(string $id) : boolean
Destroy an instance
Parameters
Returns
Name | Type | Description |
---|---|---|
$id | string |
Type | Description |
---|---|
boolean |


getAdapter() : \Zend_Service_Amazon_Ec2_Instance
Get the adapter
Returns
Type | Description |
---|---|
\Zend_Service_Amazon_Ec2_Instance |


getLastHttpResponse() : \Zend_Http_Response
Get the last HTTP response
Returns
Type | Description |
---|---|
\Zend_Http_Response |


imagesInstance() : \ImageList
Return a list of all the available instance images
Returns
Type | Description |
---|---|
\ImageList |


listInstances() : \Zend_Cloud_Infrastructure_InstanceList
Return a list of the available instancies
Returns
Type | Description |
---|---|
\Zend_Cloud_Infrastructure_InstanceList |


monitorInstance(string $id, string $metric, null | array $options = null) : array
Return the system information about the $metric of an instance
Parameters
Returns
Name | Type | Description |
---|---|---|
$id | string | |
$metric | string | |
$options | null | array |
Type | Description |
---|---|
array |


publicDnsInstance(string $id) : string | boolean
Return the public DNS name of the instance
Parameters
Returns
Name | Type | Description |
---|---|---|
$id | string |
Type | Description |
---|---|
string | boolean |


rebootInstance(string $id) : boolean
Reboot an instance
Parameters
Returns
Name | Type | Description |
---|---|---|
$id | string |
Type | Description |
---|---|
boolean |


startInstance(string $id) : boolean
Start an instance
Parameters
Returns
Name | Type | Description |
---|---|---|
$id | string |
Type | Description |
---|---|
boolean |


statusInstance( $id) : string | boolean
Return the status of an instance
Parameters
Returns
Name | Type | Description |
---|---|---|
$id |
Type | Description |
---|---|
string | boolean |


stopInstance(string $id) : boolean
Stop an instance
Parameters
Returns
Name | Type | Description |
---|---|---|
$id | string |
Type | Description |
---|---|
boolean |