1stel/cloudstack-php-client

This package is abandoned and no longer maintained. No replacement package was suggested.
There is no license information available for the latest version (v3.0.2) of this package.

Client PHP library for the CloudStack API

v3.0.2 2016-12-12 17:28 UTC

This package is not auto-updated.

Last update: 2023-01-07 09:28:52 UTC


README

PHP client library for the CloudStack User API v3.0.0. For older versions, see the tags.

Examples

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

Asynchronous tasks

$job = $cloudstack->deployVirtualMachine(array(
    'serviceofferingid' => 1,
    'templateid'        => 259,
    'zoneid'            => 1
));
echo("VM being deployed. Job id = {$job->jobid}<br>");

echo("All jobs :<br>");
foreach ($cloudstack->listAsyncJobs() as $job) {
    echo("{$job->jobid} : {$job->cmd}, status = {$job->jobstatus}<br>");
}