Instance of an infrastructure service

package Zend_Cloud
subpackage Infrastructure
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License

 Methods

Constructor

__construct(\Adapter $adapter, array $data = null) : void

Parameters

$adapter

\Adapter

$data

array

Run arbitrary shell script on the instance

deploy($params, string|array $cmd) : string | array

Parameters

$params

$cmd

stringarray

Returns

stringarray

Destroy the instance

destroy() : boolean

Returns

boolean

Get Attribute with a specific key

getAttribute($key) : \misc | false

Parameters

$key

Returns

\miscfalse

Get all the attributes

getAttributes() : array

Returns

array

Get the instance's CPU

getCpu() : string

Returns

string

Get the instance's id

getId() : string

Returns

string

Get the instance's image id

getImageId() : string

Returns

string

Get the instance's launch time

getLaunchTime() : string

Returns

string

Get the instance's name

getName() : string

Returns

string

Get the public DNS of the instance

getPublicDns() : string

Returns

string

Get the instance's RAM size

getRamSize() : string

Returns

string

Get the status of the instance

getStatus() : string | boolean

Returns

stringboolean

Get the instance's storage size

getStorageSize() : string

Returns

string

Get the instance's zone

getZone() : string

Returns

string

Return the system informations about the $metric of an instance

monitor(string $metric, null|array $options = null) : array | boolean

Parameters

$metric

string

$options

nullarray

Returns

arrayboolean

Reboot the instance

reboot() : boolean

Returns

boolean

Start the instance

start() : boolean

Returns

boolean

Stop the instance

stop() : boolean

Returns

boolean

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

waitStatus(string $status, integer $timeout = \Adapter::TIMEOUT_STATUS_CHANGE) : boolean

Parameters

$status

string

$timeout

integer

Returns

boolean

 Properties

 

$adapter

$adapter : \Zend_Cloud_Infrastructure_Adapter

Default

 

Attributes required for an instance

$attributeRequired : array

Default

array(self::INSTANCE_ID, self::INSTANCE_STATUS, self::INSTANCE_IMAGEID, self::INSTANCE_ZONE)
 

Instance's attribute

$attributes : array

Default

 Constants

 

INSTANCE_CPU

INSTANCE_CPU = 'cpu' 
 

INSTANCE_ID

INSTANCE_ID = 'id' 
 

INSTANCE_IMAGEID

INSTANCE_IMAGEID = 'imageId' 
 

INSTANCE_LAUNCHTIME

INSTANCE_LAUNCHTIME = 'launchTime' 
 

INSTANCE_NAME

INSTANCE_NAME = 'name' 
 

INSTANCE_PUBLICDNS

INSTANCE_PUBLICDNS = 'publicDns' 
 

INSTANCE_RAM

INSTANCE_RAM = 'ram' 
 

INSTANCE_STATUS

INSTANCE_STATUS = 'status' 
 

INSTANCE_STORAGE

INSTANCE_STORAGE = 'storageSize' 
 

INSTANCE_ZONE

INSTANCE_ZONE = 'zone' 
 

MONITOR_CPU

MONITOR_CPU = 'CpuUsage' 
 

MONITOR_DISK

MONITOR_DISK = 'DiskUsage' 
 

MONITOR_DISK_READ

MONITOR_DISK_READ = 'DiskRead' 
 

MONITOR_DISK_WRITE

MONITOR_DISK_WRITE = 'DiskWrite' 
 

MONITOR_END_TIME

MONITOR_END_TIME = 'EndTime' 
 

MONITOR_NETWORK_IN

MONITOR_NETWORK_IN = 'NetworkIn' 
 

MONITOR_NETWORK_OUT

MONITOR_NETWORK_OUT = 'NetworkOut' 
 

MONITOR_RAM

MONITOR_RAM = 'RamUsage' 
 

MONITOR_START_TIME

MONITOR_START_TIME = 'StartTime' 
 

SSH_PASSPHRASE

SSH_PASSPHRASE = 'passphrase' 
 

SSH_PASSWORD

SSH_PASSWORD = 'password' 
 

SSH_PRIVATE_KEY

SSH_PRIVATE_KEY = 'privateKey' 
 

SSH_PUBLIC_KEY

SSH_PUBLIC_KEY = 'publicKey' 
 

SSH_USERNAME

SSH_USERNAME = 'username' 
 

STATUS_PENDING

STATUS_PENDING = 'pending' 
 

STATUS_REBOOTING

STATUS_REBOOTING = 'rebooting' 
 

STATUS_REBUILD

STATUS_REBUILD = 'rebuild' 
 

STATUS_RUNNING

STATUS_RUNNING = 'running' 
 

STATUS_SHUTTING_DOWN

STATUS_SHUTTING_DOWN = 'shutting-down' 
 

STATUS_STOPPED

STATUS_STOPPED = 'stopped' 
 

STATUS_TERMINATED

STATUS_TERMINATED = 'terminated'