Zend Framework  1.12
Public Member Functions | Public Attributes | Protected Attributes | List of all members
Zend_Cloud_Infrastructure_Instance Class Reference

Public Member Functions

 __construct ($adapter, $data=null)
 Constructor.
 
 getAttribute ($key)
 Get Attribute with a specific key.
 
 getAttributes ()
 Get all the attributes.
 
 getId ()
 Get the instance's id.
 
 getImageId ()
 Get the instance's image id.
 
 getName ()
 Get the instance's name.
 
 getStatus ()
 Get the status of the instance.
 
 waitStatus ($status, $timeout=Adapter::TIMEOUT_STATUS_CHANGE)
 Wait for status $status with a timeout of $timeout seconds.
 
 getPublicDns ()
 Get the public DNS of the instance.
 
 getCpu ()
 Get the instance's CPU.
 
 getRamSize ()
 Get the instance's RAM size.
 
 getStorageSize ()
 Get the instance's storage size.
 
 getZone ()
 Get the instance's zone.
 
 getLaunchTime ()
 Get the instance's launch time.
 
 reboot ()
 Reboot the instance.
 
 stop ()
 Stop the instance.
 
 start ()
 Start the instance.
 
 destroy ()
 Destroy the instance.
 
 monitor ($metric, $options=null)
 Return the system informations about the $metric of an instance.
 
 deploy ($params, $cmd)
 Run arbitrary shell script on the instance.
 

Public Attributes

const STATUS_RUNNING = 'running'
 
const STATUS_STOPPED = 'stopped'
 
const STATUS_SHUTTING_DOWN = 'shutting-down'
 
const STATUS_REBOOTING = 'rebooting'
 
const STATUS_TERMINATED = 'terminated'
 
const STATUS_PENDING = 'pending'
 
const STATUS_REBUILD = 'rebuild'
 
const INSTANCE_ID = 'id'
 
const INSTANCE_IMAGEID = 'imageId'
 
const INSTANCE_NAME = 'name'
 
const INSTANCE_STATUS = 'status'
 
const INSTANCE_PUBLICDNS = 'publicDns'
 
const INSTANCE_CPU = 'cpu'
 
const INSTANCE_RAM = 'ram'
 
const INSTANCE_STORAGE = 'storageSize'
 
const INSTANCE_ZONE = 'zone'
 
const INSTANCE_LAUNCHTIME = 'launchTime'
 
const MONITOR_CPU = 'CpuUsage'
 
const MONITOR_RAM = 'RamUsage'
 
const MONITOR_NETWORK_IN = 'NetworkIn'
 
const MONITOR_NETWORK_OUT = 'NetworkOut'
 
const MONITOR_DISK = 'DiskUsage'
 
const MONITOR_DISK_WRITE = 'DiskWrite'
 
const MONITOR_DISK_READ = 'DiskRead'
 
const MONITOR_START_TIME = 'StartTime'
 
const MONITOR_END_TIME = 'EndTime'
 
const SSH_USERNAME = 'username'
 
const SSH_PASSWORD = 'password'
 
const SSH_PRIVATE_KEY = 'privateKey'
 
const SSH_PUBLIC_KEY = 'publicKey'
 
const SSH_PASSPHRASE = 'passphrase'
 

Protected Attributes

 $adapter
 
 $attributes
 
 $attributeRequired
 

Constructor & Destructor Documentation

__construct (   $adapter,
  $data = null 
)

Constructor.

Parameters
Adapter$adapter
array$data
Returns
void

Member Function Documentation

deploy (   $params,
  $cmd 
)

Run arbitrary shell script on the instance.

Parameters
array$param
string | array$cmd
Returns
string|array
destroy ( )

Destroy the instance.

Returns
boolean
getAttribute (   $key)

Get Attribute with a specific key.

Parameters
array$data
Returns
misc|false
getAttributes ( )

Get all the attributes.

Returns
array
getCpu ( )

Get the instance's CPU.

Returns
string
getId ( )

Get the instance's id.

Returns
string
getImageId ( )

Get the instance's image id.

Returns
string
getLaunchTime ( )

Get the instance's launch time.

Returns
string
getName ( )

Get the instance's name.

Returns
string
getPublicDns ( )

Get the public DNS of the instance.

Returns
string
getRamSize ( )

Get the instance's RAM size.

Returns
string
getStatus ( )

Get the status of the instance.

Returns
string|boolean
getStorageSize ( )

Get the instance's storage size.

Returns
string
getZone ( )

Get the instance's zone.

Returns
string
monitor (   $metric,
  $options = null 
)

Return the system informations about the $metric of an instance.

Parameters
string$metric
null | array$options
Returns
array|boolean
reboot ( )

Reboot the instance.

Returns
boolean
start ( )

Start the instance.

Returns
boolean
stop ( )

Stop the instance.

Returns
boolean
waitStatus (   $status,
  $timeout = Adapter::TIMEOUT_STATUS_CHANGE 
)

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

Parameters
string$status
integer$timeout
Returns
boolean

Member Data Documentation

$adapter
protected
$attributeRequired
protected
Initial value:
= array(
self::INSTANCE_ID,
self::INSTANCE_STATUS,
self::INSTANCE_IMAGEID,
self::INSTANCE_ZONE
)
$attributes
protected
const INSTANCE_CPU = 'cpu'
const INSTANCE_ID = 'id'
const INSTANCE_IMAGEID = 'imageId'
const INSTANCE_LAUNCHTIME = 'launchTime'
const INSTANCE_NAME = 'name'
const INSTANCE_PUBLICDNS = 'publicDns'
const INSTANCE_RAM = 'ram'
const INSTANCE_STATUS = 'status'
const INSTANCE_STORAGE = 'storageSize'
const INSTANCE_ZONE = 'zone'
const MONITOR_CPU = 'CpuUsage'
const MONITOR_DISK = 'DiskUsage'
const MONITOR_DISK_READ = 'DiskRead'
const MONITOR_DISK_WRITE = 'DiskWrite'
const MONITOR_END_TIME = 'EndTime'
const MONITOR_NETWORK_IN = 'NetworkIn'
const MONITOR_NETWORK_OUT = 'NetworkOut'
const MONITOR_RAM = 'RamUsage'
const MONITOR_START_TIME = 'StartTime'
const SSH_PASSPHRASE = 'passphrase'
const SSH_PASSWORD = 'password'
const SSH_PRIVATE_KEY = 'privateKey'
const SSH_PUBLIC_KEY = 'publicKey'
const SSH_USERNAME = 'username'
const STATUS_PENDING = 'pending'
const STATUS_REBOOTING = 'rebooting'
const STATUS_REBUILD = 'rebuild'
const STATUS_RUNNING = 'running'
const STATUS_SHUTTING_DOWN = 'shutting-down'
const STATUS_STOPPED = 'stopped'
const STATUS_TERMINATED = 'terminated'