Fork me on GitHub

CloudStack PHP Client

PHP client library for the CloudStack User API v2.2.

This client has been generated with the CloudStack Client generator.

Initialization

$cloudstack = new CloudStackClient(
    API_ENDPOINT,
    API_KEY,
    SECRET_KEY
);

Lists

$vms = $cloudstack->listVirtualMachines();
foreach ($vms as $vm) {
    echo("{$vm->id} : {$vm->name} {$vm->state}");
}

Asynchronous tasks

$job = $cloudstack->deployVirtualMachine(1, 259, 1);
echo("VM being deployed. Job id = {$job->jobid}");

echo("All jobs :");
foreach ($cloudstack->listAsyncJobs() as $job) {
    echo("#{$job->jobid} : {$job->cmd}");
    echo("status = {$job->jobstatus}");
}
Quentin Pleplé
June 2011