1stel / cloudstack-php-client
Client PHP library for the CloudStack API
Installs: 409
Dependents: 2
Suggesters: 0
Security: 0
Stars: 1
Watchers: 4
Forks: 25
pkg:composer/1stel/cloudstack-php-client
Requires
- php: >=5.5.9
Requires (Dev)
- ext-curl: *
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>");
}