Project: CloudStack PHP Client

🦖 This post was published in 2011 and is most likely outdated.

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

See project on github

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}");
}

Comments