Cloud/Infrastructure/Adapter/Ec2.php

Show: PublicProtectedPrivateinherited
Table of Contents
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

>VConstant  AWS_ACCESS_KEY = 'aws_accesskey'
AWS constants
>VConstant  AWS_SECRET_KEY = 'aws_secretkey'
>VConstant  AWS_REGION = 'aws_region'
>VConstant  AWS_SECURITY_GROUP = 'securityGroup'

Properties

>VPropertyprotectedstring $accessKey
AWS Access Key
Details
Type
string
>VPropertyprotectedstring $accessSecret
AWS Access Secret
Details
Type
string
>VPropertyprotected\Ec2Instance $ec2
Ec2 Instance
Details
Type
\Ec2Instance
>VPropertyprotected\Ec2Image $ec2Image
Ec2 Image
Details
Type
\Ec2Image
>VPropertyprotected\Ec2Monitor $ec2Monitor
Ec2 Monitor
Details
Type
\Ec2Monitor
>VPropertyprotected\Ec2Zone $ec2Zone
Ec2 Zone
Details
Type
\Ec2Zone
>VPropertyprotectedarray $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 valuearray(\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
>VPropertyprotectedarray $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 valuearray('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
>VPropertyprotectedstring $region
Region zone
Details
Type
string

Methods

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

Constructor

Parameters
NameTypeDescription
$optionsarray | \Zend_Config
methodprivateconvertAttributes(array $attr) : array | boolean

Convert the attributes of EC2 into attributes of Infrastructure

Parameters
NameTypeDescription
$attrarray
Returns
TypeDescription
array | boolean
methodpubliccreateInstance(string $name, array $options) : \Instance | boolean

Create a new instance

Parameters
NameTypeDescription
$namestring
$optionsarray
Returns
TypeDescription
\Instance | boolean
methodpublicdestroyInstance(string $id) : boolean

Destroy an instance

Parameters
NameTypeDescription
$idstring
Returns
TypeDescription
boolean
methodpublicgetAdapter() : \Zend_Service_Amazon_Ec2_Instance

Get the adapter

Returns
TypeDescription
\Zend_Service_Amazon_Ec2_Instance
methodpublicgetLastHttpRequest() : string

Get last HTTP request

Returns
TypeDescription
string
methodpublicgetLastHttpResponse() : \Zend_Http_Response

Get the last HTTP response

Returns
TypeDescription
\Zend_Http_Response
methodpublicimagesInstance() : \ImageList

Return a list of all the available instance images

Returns
TypeDescription
\ImageList
methodpubliclistInstances() : \Zend_Cloud_Infrastructure_InstanceList

Return a list of the available instancies

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

Return the system information about the $metric of an instance

Parameters
NameTypeDescription
$idstring
$metricstring
$optionsnull | array
Returns
TypeDescription
array
methodpublicpublicDnsInstance(string $id) : string | boolean

Return the public DNS name of the instance

Parameters
NameTypeDescription
$idstring
Returns
TypeDescription
string | boolean
methodpublicrebootInstance(string $id) : boolean

Reboot an instance

Parameters
NameTypeDescription
$idstring
Returns
TypeDescription
boolean
methodpublicstartInstance(string $id) : boolean

Start an instance

Parameters
NameTypeDescription
$idstring
Returns
TypeDescription
boolean
methodpublicstatusInstance( $id) : string | boolean

Return the status of an instance

Parameters
NameTypeDescription
$id
Returns
TypeDescription
string | boolean
methodpublicstopInstance(string $id) : boolean

Stop an instance

Parameters
NameTypeDescription
$idstring
Returns
TypeDescription
boolean
methodpubliczonesInstance() : array

Return all the available zones

Returns
TypeDescription
array
Documentation was generated by phpDocumentor 2.2.0 .