This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Abiquo API Python Client

Project Description
# Abiquo API Python Client

[![Build Status](](

This is a Python client for the Abiquo API. It allows to consume the API
in a dynamic way and to navigate its resources using its built-in linking

The project depends on [requests](
and optionally on [requests_oauthlib](,
if you prefer to use OAuth instead of Basic Authentication.

## Installation

You can easily install the module with:

pip install abiquo-api

## Usage

Using the client is pretty straightforward. Here are some examples:

### Using HTTP Basic Authentication

This example shows how to get the list of existing datacenters and how to
navigate its links to create a rack in each of them:

import json
from abiquo.client import Abiquo

api = Abiquo(API_URL, auth=(username, password))
code, datacenters = api.admin.datacenters.get(

print "Response code is: %s" % code
for dc in datacenters:
print "Creating rack in datacenter %s [%s]" % (, dc.location)
code, rack = datacenter.follow('racks').post(
data=json.dumps({'name': 'New rack'}),
print "Response code is: %s" % code
print "Created Rack: %s" %

Note that you don't need to care about pagination, the client handles it internally for you.

### Using OAuth

To use OAuth first you have to register your client application in the Abiquo API. To do that, you can
use the `` script as follows, and it will register the application and generate the access

$ python
Abiquo API endpoint: http://localhost/api
Username or OpenID access_token (prefixed with "openid:"): your-username
Password: your-password
Application name: My Cool App

App key: 54e00f27-6995-40e8-aefe-75f76f514d89
App secret: eayP6ll3G02ypBhQBmg0398HYBldkf3B5Jqti73Z
Access token: c9c9bd44-6812-4ddf-b39d-a27f86bf03da
Access token secret: MifYOffkoPkhk33ZTiGOYnIg8irRjw7BlUCR2GUh7IQKv4omfENlMi/tr+gUdt5L8eRCSYKFQVhI4Npga6mXIVl1tCMHqTldYfqUJZdHr0c=

If your Abiquo platform uses OpenID, then you can register your application using the Access Token as follows:

$ python
Abiquo API endpoint: http://localhost/api
Username or OpenID access_token (prefixed with "openid:"): openid:bac4564c-4522-450e-985b-5f880f02a3dd
Application name: My Cool App

App key: 685df603-cb51-4ffa-bd7e-8b0235f5ac70
App secret: HtoICXYr2WENp5D1g7UjbifNizTFh1I3AW3ylEjm
Access token: b1b2856e-5098-4a54-ae3c-d99b739f6770
Access token secret: pBioSC7SNv/0lPRQWBiOr9uSXf8bIs6D2jVVAy2WkBq3Vr37efMKv3mTugk9+TlTAtrWPsPoPdHDGjEtbb5PBHKb2JKWUC9y+OZ44I4v9kk=

Once you have the tokens, you just have to create the authentication object and pass it to the
Abiquo client as follows:

from requests_oauthlib import OAuth1
from abiquo.client import Abiquo

APP_KEY = '54e00f27-6995-40e8-aefe-75f76f514d89'
APP_SECRET = 'eayP6ll3G02ypBhQBmg0398HYBldkf3B5Jqti73Z'
ACCESS_TOKEN = 'c9c9bd44-6812-4ddf-b39d-a27f86bf03da'
ACCESS_TOKEN_SECRET = 'MifYOffkoPkhk33ZTiGOYnIg8irRjw7BlUCR2GUh7IQKv4omfENlMi/tr+gUdt5L8eRCSYKFQVhI4Npga6mXIVl1tCMHqTldYfqUJZdHr0c='


api = Abiquo(API_URL, auth=oauth)

And that's it! Now you can use the Abiquo client as shown in the Basic Authentication examples.

## Running the tests

You can run the unit tests as follows:

pip install requests requests_oauthlib httpretty
python -m unittest discover -v

## Contributing

This project is still in an early development stage and is still incomplete. All
contributions are welcome, so feel free to [raise a pull request](

## License

The Abiquo API Java Client is licensed under the Apache License version 2. For
further details, see the [LICENSE](LICENSE) file.
Release History

Release History

This version
History Node


History Node


History Node


History Node


History Node


Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
abiquo-api-0.1.11.tar.gz (5.4 kB) Copy SHA256 Checksum SHA256 Source Apr 6, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting