-
-
createInstance
(
string $name, array $options
)
-
Create an instance.
The return value is an instance of Zend_Cloud_Infrastructure_Instance.
In case of error the return is false.
$name is the name of the instance to create
$options is the array contains the specific parameter for the cloud adapter.
For more info read the Chapter of Zend_Cloud_Infrastructure_Adapter.
-
-
deployInstance
(
string $id, array $param, string|array $cmd
)
-
Run arbitrary shell scripts on an instance.
Return a string or an array contains all the standard output (errors included) of the scripts executed in the instance.
Note: Requirement
In order to use the deployInstance method you have to install the SSH2 extension (ext/ssh2) of PHP.
The SSH2 extensions can be used to connect only to Gnu/Linux instances (servers).
For more info about the SSH2 extension, » click here.
$id is the ID of the instance
$param is an array contains the username and the password to be used for the SSH connection.
The username and the password must be specified using the following constants key of the Zend_Cloud_Infrastructure_Instance:
SSH_USERNAME, SSH_PASSWORD.
$cmd is a string (or an array) contains the commands line to be executed in the instance.
-
-
destroyInstance
(
string $id
)
-
Destroy an instance.
Return true in case of success, false in case of error.
$id is the ID of the instance
-
-
getAdapter
(
)
-
Return the adapter object.
-
-
getAdapterResult
(
)
-
Return the original adapter result.
-
-
getLastHttpRequest
(
)
-
Return the last HTTP Request of the adapter.
-
-
getLastHttpResponse
(
)
-
Return the last HTTP Response of the adapter.
-
-
imagesInstance
(
)
-
Return all the available images to use for an instance.
The return value is an instance of Zend_Cloud_Infrastructure_ImageList
-
-
listInstances
(
)
-
Return the list of of the available instances.
The return is an instance of Zend_Cloud_Infrastructure_InstanceList.
-
-
monitorInstance
(
string $id,string $metric,array $options=null
)
-
Monitor an instance. Return the system information about the metric of an instance.
The return value is an array that contains samples of values, timestamp and the elaboration of the average value.
$id is the ID of the instance;
$metric is the metric to be monitored. The allowed metrics are reported as contants of the
Zend_Cloud_Infrastructure_Instance class: MONITOR_CPU, MONITOR_RAM,
MONITOR_NETWORK_IN, MONITOR_NETWORK_OUT, MONITOR_DISK, MONITOR_DISK_WRITE, MONITOR_DISK_READ.
$options is the optional array contains the adapter specific options.
-
-
publicDnsInstance
(
string $id
)
-
Return the public DNS name or the IP address of the instance. The return value is a string.
In case of error the return is false.
$id is the ID of the instance
-
-
rebootInstance
(
string $id
)
-
Reboot an instance.
Return true in case of success, false in case of error.
$id is the ID of the instance
-
-
startInstance
(
string $id
)
-
Start an instance.
Return true in case of success, false in case of error.
$id is the ID of the instance
-
-
statusInstance
(
string $id
)
-
Get the status of an instance. The return value is a string.
The available status are reported in the following constants of the class Zend_Cloud_Infrastructure_Instance:
STATUS_STOPPED, STATUS_RUNNING, STATUS_SHUTTING_DOWN, STATUS_REBOOTING,
STATUS_TERMINATED, STATUS_PENDING, STATUS_REBUILD.
In case of error the return is false.
$id is the ID of the instance
-
-
stopInstance
(
string $id
)
-
Stop an instance.
Return true in case of success, false in case of error.
$id is the ID of the instance
-
-
waitStatusInstance
(
string $id, string $status,integer $timeout=30
)
-
Wait the status change of an instance for a maximum time of n seconds.
Return true if the status changes as expected, false if not.
$id is the ID of the instance;
$status is the status to wait for;
$timeout is the maximum time, in seconds, to wait for the status change. This parametr is optional and the default value is 30 seconds.
-
-
zonesInstance
(
)
-
Return all the available zones for an instance.
The return value is an array.