Skip to main content

CloudStack API Client

Project description

CloudStack Python Client
========================

Python client library for the CloudStack User API. For older versions,
see the [tags](https://github.com/terbolous/cloudstack-python-client/tags).


from https://github.com/terbolous/cloudstack-python-client


Examples
--------

List all virtual machines

```python
#!/usr/bin/python

import CloudStack

api = 'http://example.com:8080/client/api'
apikey = 'API KEY'
secret = 'API SECRET'

cloudstack = CloudStack.Client(api, apikey, secret)

vms = cloudstack.listVirtualMachines()

for vm in vms:
print "%s %s %s" % (vm['id'], vm['name'], vm['state'])
```



Asynchronous tasks

```python
#!/usr/bin/python

import CloudStack

api = 'http://example.com:8080/client/api'
apikey = 'API KEY'
secret = 'API SECRET'

cloudstack = CloudStack.Client(api, apikey, secret)

job = cloudstack.deployVirtualMachine({
'serviceofferingid': '2',
'templateid': '214',
'zoneid': '2'
})

print "VM being deployed. Job id = %s" % job['jobid']

print "All Jobs:"
jobs = cloudstack.listAsyncJobs({})
for job in jobs:
print "%s : %s, status = %s" % (job['jobid'], job['cmd'], job['jobstatus'])

```

TODO:
-----
There is a lot to do to clean up the code and make it worthy of production. This
was just a rough first pass.

=======
History
=======

Version 0.1.1
-------------
Initial version after renaming and rebuilding.
Merging a lot of forks to improve usability and hopefully stabililty.

=======
AUTHORS
=======

- Jason Hancock <jsnbyh@gmail.com>
- Kraig Amador <kamador@shopzilla.com>
- Mike Rochford <michael.rochford@thomsonreuters.com>
- Gert Kremer <gkremer@schubergphilis.com>

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for CloudStackClient, version 0.1.2
Filename, size File type Python version Upload date Hashes
Filename, size CloudStackClient-0.1.2.tar.gz (30.6 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page