Cloud/Infrastructure/Adapter/Rackspace.php

Show: inherited
Table of Contents

Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Cloud_Infrastructure  
Subpackage
Adapter  

\Zend_Cloud_Infrastructure_Adapter_Rackspace

Package: Zend\Cloud\Infrastructure\Adapter

Rackspace servers adapter for infrastructure service

Parent(s)
\Zend_Cloud_Infrastructure_Adapter_AbstractAdapter
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Constants

Constant  RACKSPACE_USER = 'rackspace_user'

RACKSPACE constants

Constant  RACKSPACE_KEY = 'rackspace_key'
Constant  RACKSPACE_REGION = 'rackspace_region'
Constant  RACKSPACE_ZONE_USA = 'USA'
Constant  RACKSPACE_ZONE_UK = 'UK'
Constant  MONITOR_CPU_SAMPLES = 3

Properties

Propertyprotectedstring $accessKey =

Rackspace access key

Details
Type
string
Propertyprotectedstring $accessUser =

Rackspace access user

Details
Type
string
Propertyprotectedarray $adapterResult =
inherited

Store the last response from the adpter

Inherited from: \Zend_Cloud_Infrastructure_Adapter_AbstractAdapter::$$adapterResult
Propertyprotectedarray $flavors =

Flavors

Details
Type
array
Propertyprotectedarray $mapStatus = array('ACTIVE' => \Zend_Cloud_Infrastructure_Instance::STATUS_RUNNING, 'SUSPENDED' => \Zend_Cloud_Infrastructure_Instance::STATUS_STOPPED, 'BUILD' => \Zend_Cloud_Infrastructure_Instance::STATUS_REBUILD, 'REBUILD' => \Zend_Cloud_Infrastructure_Instance::STATUS_REBUILD, 'QUEUE_RESIZE' => \Zend_Cloud_Infrastructure_Instance::STATUS_PENDING, 'PREP_RESIZE' => \Zend_Cloud_Infrastructure_Instance::STATUS_PENDING, 'RESIZE' => \Zend_Cloud_Infrastructure_Instance::STATUS_REBUILD, 'VERIFY_RESIZE' => \Zend_Cloud_Infrastructure_Instance::STATUS_REBUILD, 'PASSWORD' => \Zend_Cloud_Infrastructure_Instance::STATUS_PENDING, 'RESCUE' => \Zend_Cloud_Infrastructure_Instance::STATUS_PENDING, 'REBOOT' => \Zend_Cloud_Infrastructure_Instance::STATUS_REBOOTING, 'HARD_REBOOT' => \Zend_Cloud_Infrastructure_Instance::STATUS_REBOOTING, 'SHARE_IP' => \Zend_Cloud_Infrastructure_Instance::STATUS_PENDING, 'SHARE_IP_NO_CONFIG' => \Zend_Cloud_Infrastructure_Instance::STATUS_PENDING, 'DELETE_IP' => \Zend_Cloud_Infrastructure_Instance::STATUS_PENDING, 'UNKNOWN' => \Zend_Cloud_Infrastructure_Instance::STATUS_PENDING)

Map array between Rackspace and Infrastructure status

Default valuearray('ACTIVE' => \Zend_Cloud_Infrastructure_Instance::STATUS_RUNNING, 'SUSPENDED' => \Zend_Cloud_Infrastructure_Instance::STATUS_STOPPED, 'BUILD' => \Zend_Cloud_Infrastructure_Instance::STATUS_REBUILD, 'REBUILD' => \Zend_Cloud_Infrastructure_Instance::STATUS_REBUILD, 'QUEUE_RESIZE' => \Zend_Cloud_Infrastructure_Instance::STATUS_PENDING, 'PREP_RESIZE' => \Zend_Cloud_Infrastructure_Instance::STATUS_PENDING, 'RESIZE' => \Zend_Cloud_Infrastructure_Instance::STATUS_REBUILD, 'VERIFY_RESIZE' => \Zend_Cloud_Infrastructure_Instance::STATUS_REBUILD, 'PASSWORD' => \Zend_Cloud_Infrastructure_Instance::STATUS_PENDING, 'RESCUE' => \Zend_Cloud_Infrastructure_Instance::STATUS_PENDING, 'REBOOT' => \Zend_Cloud_Infrastructure_Instance::STATUS_REBOOTING, 'HARD_REBOOT' => \Zend_Cloud_Infrastructure_Instance::STATUS_REBOOTING, 'SHARE_IP' => \Zend_Cloud_Infrastructure_Instance::STATUS_PENDING, 'SHARE_IP_NO_CONFIG' => \Zend_Cloud_Infrastructure_Instance::STATUS_PENDING, 'DELETE_IP' => \Zend_Cloud_Infrastructure_Instance::STATUS_PENDING, 'UNKNOWN' => \Zend_Cloud_Infrastructure_Instance::STATUS_PENDING)Details
Type
array
Propertyprotected\Zend_Service_Rackspace_Servers $rackspace =

Rackspace Servers Instance

Propertyprotectedstring $region =

Rackspace Region

Details
Type
string
Propertyprotectedarray $validMetrics = 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)
inherited

Valid metrics for monitor

Inherited from: \Zend_Cloud_Infrastructure_Adapter_AbstractAdapter::$$validMetrics
Default valuearray(\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)Details
Type
array
Inherited_from
\Zend_Cloud_Infrastructure_Adapter_AbstractAdapter::$$validMetrics  

Methods

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

Constructor

Parameters
Name Type Description
$options array | \Zend_Config
methodprotectedconvertAttributes(array $attr) : array | boolean

Convert the attributes of Rackspace server into attributes of Infrastructure

Parameters
Name Type Description
$attr array
Returns
Type Description
array | boolean
methodpubliccreateInstance(string $name, array $options) : \Instance | boolean

Create a new instance

Parameters
Name Type Description
$name string
$options array
Returns
Type Description
\Instance | boolean
methodpublicdeployInstance(string $id,  $params, string | array $cmd) : string | array
inherited

Run arbitrary shell script on an instance

Inherited from: \Zend_Cloud_Infrastructure_Adapter_AbstractAdapter::deployInstance()
Parameters
Name Type Description
$id string
$params
$cmd string | array
Returns
Type Description
string | array
methodpublicdestroyInstance(string $id) : boolean

Destroy an instance

Parameters
Name Type Description
$id string
Returns
Type Description
boolean
methodpublicgetAdapter() : \Zend_Service_Rackspace_Servers

Get the adapter

Returns
Type Description
\Zend_Service_Rackspace_Servers
methodpublicgetAdapterResult() : array
inherited

Get the last result of the adapter

Inherited from: \Zend_Cloud_Infrastructure_Adapter_AbstractAdapter::getAdapterResult()
Returns
Type Description
array
methodpublicgetLastHttpRequest() : string

Get last HTTP request

Returns
Type Description
string
methodpublicgetLastHttpResponse() : \Zend_Http_Response

Get the last HTTP response

Returns
Type Description
\Zend_Http_Response
methodpublicimagesInstance() : \ImageList | boolean

Return a list of all the available instance images

Returns
Type Description
\ImageList | boolean
methodpubliclistInstances() : \InstanceList | boolean

Return a list of the available instancies

Returns
Type Description
\InstanceList | boolean
methodpublicmonitorInstance(string $id, string $metric, null | array $options = null) : array | boolean

Return the system information about the $metric of an instance NOTE: it works only for Linux servers

Parameters
Name Type Description
$id string
$metric string
$options null | array
Returns
Type Description
array | boolean
methodpublicpublicDnsInstance(string $id) : string | boolean

Return the public DNS name/Ip address of the instance

Parameters
Name Type Description
$id string
Returns
Type Description
string | boolean
methodpublicrebootInstance(string $id) : boolean

Reboot an instance

Parameters
Name Type Description
$id string
Returns
Type Description
boolean
methodpublicstartInstance(string $id) : boolean

Start an instance

Parameters
Name Type Description
$id string
Returns
Type Description
boolean
methodpublicstatusInstance( $id) : string | boolean

Return the status of an instance

Parameters
Name Type Description
$id

string

Returns
Type Description
string | boolean
methodpublicstopInstance(string $id) : boolean

Stop an instance

Parameters
Name Type Description
$id string
Returns
Type Description
boolean
methodpublicwaitStatusInstance(string $id, string $status, integer $timeout = self::TIMEOUT_STATUS_CHANGE) : boolean
inherited

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

Inherited from: \Zend_Cloud_Infrastructure_Adapter_AbstractAdapter::waitStatusInstance()
Parameters
Name Type Description
$id string
$status string
$timeout integer
Returns
Type Description
boolean
methodpubliczonesInstance() : array

Return all the available zones

Returns
Type Description
array
Documentation was generated by phpDocumentor 2.0.0a8.