{ "info": { "author": "Abiquo", "author_email": "developers@abiquo.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Intended Audience :: System Administrators", "License :: OSI Approved :: Apache Software License", "Operating System :: MacOS :: MacOS X", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Utilities" ], "description": "# Abiquo API Python Client\n\n[![Build Status](https://travis-ci.org/abiquo/api-python-client.svg?branch=master)](https://travis-ci.org/abiquo/api-python-client)\n\nThis is a Python client for the Abiquo API. It allows to consume the API\nin a dynamic way and to navigate its resources using its built-in linking\nfeatures.\n\nThe project depends on [requests](http://docs.python-requests.org/en/latest/)\nand optionally on [requests_oauthlib](https://requests-oauthlib.readthedocs.org/en/latest/),\nif you prefer to use OAuth instead of Basic Authentication.\n\n## Installation\n\nYou can easily install the module with:\n\n```bash\npip install abiquo-api\n```\n\n## Usage\n\nUsing the client is pretty straightforward. Here are some examples:\n\n### Using HTTP Basic Authentication\n\nThis example shows how to get the list of existing datacenters and how to\nnavigate its links to create a rack in each of them:\n\n```python\nimport json\nfrom abiquo.client import Abiquo\nfrom abiquo.client import check_response\n\napi = Abiquo(API_URL, auth=(username, password))\ncode, datacenters = api.admin.datacenters.get(\n headers={'Accept':'application/vnd.abiquo.datacenters+json'})\n\nprint \"Response code is: %s\" % code\nfor dc in datacenters:\n print \"Creating rack in datacenter %s [%s]\" % (dc.name, dc.location)\n code, rack = dc.follow('racks').post(\n data=json.dumps({'name': 'New rack'}),\n headers={'accept':'application/vnd.abiquo.rack+json',\n 'content-type':'application/vnd.abiquo.rack+json'})\n check_response(201, code, rack)\n print \"Response code is: %s\" % code\n print \"Created Rack: %s\" % rack.name\n```\n\nNote that you don't need to care about pagination, the client handles it internally for you.\n\n### Using an OpenID Bearer access token\n\nIf your platform uses OpenID and you have a Bearer access token, you can configure the client\nas follows:\n\n```python\nimport json\nfrom abiquo.client import Abiquo\nfrom abiquo.auth import BearerTokenAuth \n\napi = Abiquo(API_URL, auth=BearerTokenAuth(token))\n```\n\n### Using OAuth\n\nTo use OAuth first you have to register your client application in the Abiquo API. To do that, you can\nuse the `register.py` script as follows, and it will register the application and generate the access\ntokens:\n\n```bash\n$ python register.py \nAbiquo API endpoint: http://localhost/api\nUsername or OpenID access_token (prefixed with \"openid:\"): your-username\nPassword: your-password\nApplication name: My Cool App\n\nApp key: 54e00f27-6995-40e8-aefe-75f76f514d89\nApp secret: eayP6ll3G02ypBhQBmg0398HYBldkf3B5Jqti73Z\nAccess token: c9c9bd44-6812-4ddf-b39d-a27f86bf03da\nAccess token secret: MifYOffkoPkhk33ZTiGOYnIg8irRjw7BlUCR2GUh7IQKv4omfENlMi/tr+gUdt5L8eRCSYKFQVhI4Npga6mXIVl1tCMHqTldYfqUJZdHr0c=\n```\n\nIf your Abiquo platform uses OpenID, then you can register your application using the Access Token as follows:\n\n```bash\n$ python register.py \nAbiquo API endpoint: http://localhost/api \nUsername or OpenID access_token (prefixed with \"openid:\"): openid:bac4564c-4522-450e-985b-5f880f02a3dd\nApplication name: My Cool App\n\nApp key: 685df603-cb51-4ffa-bd7e-8b0235f5ac70\nApp secret: HtoICXYr2WENp5D1g7UjbifNizTFh1I3AW3ylEjm\nAccess token: b1b2856e-5098-4a54-ae3c-d99b739f6770\nAccess token secret: pBioSC7SNv/0lPRQWBiOr9uSXf8bIs6D2jVVAy2WkBq3Vr37efMKv3mTugk9+TlTAtrWPsPoPdHDGjEtbb5PBHKb2JKWUC9y+OZ44I4v9kk=\n```\n\nOnce you have the tokens, you just have to create the authentication object and pass it to the\nAbiquo client as follows:\n\n```python\nfrom requests_oauthlib import OAuth1\nfrom abiquo.client import Abiquo\n\nAPP_KEY = '54e00f27-6995-40e8-aefe-75f76f514d89'\nAPP_SECRET = 'eayP6ll3G02ypBhQBmg0398HYBldkf3B5Jqti73Z'\nACCESS_TOKEN = 'c9c9bd44-6812-4ddf-b39d-a27f86bf03da'\nACCESS_TOKEN_SECRET = 'MifYOffkoPkhk33ZTiGOYnIg8irRjw7BlUCR2GUh7IQKv4omfENlMi/tr+gUdt5L8eRCSYKFQVhI4Npga6mXIVl1tCMHqTldYfqUJZdHr0c='\n\noauth=OAuth1(APP_KEY,\n client_secret=APP_SECRET,\n resource_owner_key=ACCESS_TOKEN,\n resource_owner_secret=ACCESS_TOKEN_SECRET)\n\napi = Abiquo(API_URL, auth=oauth)\n```\n\nAnd that's it! Now you can use the Abiquo client as shown in the Basic Authentication examples.\n\n## Running the tests\n\nYou can run the unit tests as follows:\n\n```bash\npip install requests requests_oauthlib httpretty\npython -m unittest discover -v\n```\n\n## Contributing\n\nThis project is still in an early development stage and is still incomplete. All\ncontributions are welcome, so feel free to [raise a pull request](https://help.github.com/articles/using-pull-requests/).\n\n## License\n\nThe Abiquo API Java Client is licensed under the Apache License version 2. For\nfurther details, see the [LICENSE](LICENSE) file.", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/abiquo/api-python-client", "keywords": "abiquo api rest", "license": "Apache License 2.0", "maintainer": "", "maintainer_email": "", "name": "abiquo-api", "package_url": "https://pypi.org/project/abiquo-api/", "platform": "", "project_url": "https://pypi.org/project/abiquo-api/", "project_urls": { "Homepage": "https://github.com/abiquo/api-python-client" }, "release_url": "https://pypi.org/project/abiquo-api/0.1.14/", "requires_dist": null, "requires_python": "", "summary": "Abiquo API Python Client", "version": "0.1.14" }, "last_serial": 4599440, "releases": { "0.1.10": [ { "comment_text": "", "digests": { "md5": "ca64f089888cdb557d2650f35c2bbd22", "sha256": "11291b9dae91dd0a5605bf5f4ba8bd30482a2c4afb2f326e79a0e0939cfe9a58" }, "downloads": -1, "filename": "abiquo-api-0.1.10.tar.gz", "has_sig": false, "md5_digest": "ca64f089888cdb557d2650f35c2bbd22", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5118, "upload_time": "2017-03-31T08:39:10", "url": "https://files.pythonhosted.org/packages/ed/7b/1c78d452e83799ef75e2213b1b47da134f74f3384875e743bd242b6f2831/abiquo-api-0.1.10.tar.gz" } ], "0.1.11": [ { "comment_text": "", "digests": { "md5": "7eb69211aea9e0f1a46b6e9fd15ba1f6", "sha256": "43955ead74f85bce94ddf9b28959590dbd20daf81fe3a358d122767810346d8b" }, "downloads": -1, "filename": "abiquo-api-0.1.11.tar.gz", "has_sig": false, "md5_digest": "7eb69211aea9e0f1a46b6e9fd15ba1f6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5425, "upload_time": "2017-04-06T09:14:44", "url": "https://files.pythonhosted.org/packages/e9/2f/4babe2c4e0ca8b7a19cc135738402ef0809d9b61aaa585551c34a838b123/abiquo-api-0.1.11.tar.gz" } ], "0.1.12": [ { "comment_text": "", "digests": { "md5": "13703af5877de0b92174e9d0ac5ba2f4", "sha256": "65c37bb09e2c663c683d19ece7c91429d47793a4dc3baabc52dd8b1976614799" }, "downloads": -1, "filename": "abiquo-api-0.1.12.tar.gz", "has_sig": false, "md5_digest": "13703af5877de0b92174e9d0ac5ba2f4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5859, "upload_time": "2017-11-30T13:49:56", "url": "https://files.pythonhosted.org/packages/e2/42/bf1b6cea5ed3a6ebdf2a5986f9a8ba87f3ac996dd039fe07494446347321/abiquo-api-0.1.12.tar.gz" } ], "0.1.13": [ { "comment_text": "", "digests": { "md5": "66e1735d3d8d73caac47cc128d47dc93", "sha256": "349e72fcbfb2c19cc6ff015205171c0ae58282162ee09b0a04ca630075f46df5" }, "downloads": -1, "filename": "abiquo-api-0.1.13.tar.gz", "has_sig": false, "md5_digest": "66e1735d3d8d73caac47cc128d47dc93", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5851, "upload_time": "2018-02-19T15:52:27", "url": "https://files.pythonhosted.org/packages/d7/0a/4246e1fdf73b6ce9297299c3adb1fe2b6b3a411fe504084c1b505a320c94/abiquo-api-0.1.13.tar.gz" } ], "0.1.14": [ { "comment_text": "", "digests": { "md5": "775d2d25ec25760d5e187907fa34f415", "sha256": "d55a6ad8b8b30de5903fc84002cdac85270387e8447e7d69901a127488864dc2" }, "downloads": -1, "filename": "abiquo-api-0.1.14.tar.gz", "has_sig": false, "md5_digest": "775d2d25ec25760d5e187907fa34f415", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5922, "upload_time": "2018-12-14T13:57:18", "url": "https://files.pythonhosted.org/packages/85/04/24a834497832f90304b01b1152ec202c7cf57cbaeaf0255f07bf379a29c5/abiquo-api-0.1.14.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "653b3ca46e81a0575bd79d17d8588fb1", "sha256": "f39d9d78530cdeff05a4d8471dbad75e6906c9edb879e432f2c783878825b0eb" }, "downloads": -1, "filename": "abiquo_api-0.1.7-py2.7.egg", "has_sig": true, "md5_digest": "653b3ca46e81a0575bd79d17d8588fb1", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 7513, "upload_time": "2015-03-02T14:24:08", "url": "https://files.pythonhosted.org/packages/cd/93/ac00bf679ea011580e8c7186ffd9ab2eae166a03fceed8cf082e4611b327/abiquo_api-0.1.7-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "607a90b61983a9343d62d0832d2bb7c3", "sha256": "686ee3ddebe0a4d775ed4ef661138b915d7cf70f94fd36d6f30afde425d0f3c8" }, "downloads": -1, "filename": "abiquo-api-0.1.7.tar.gz", "has_sig": true, "md5_digest": "607a90b61983a9343d62d0832d2bb7c3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4843, "upload_time": "2015-03-02T14:23:56", "url": "https://files.pythonhosted.org/packages/16/a9/869439fc9e2b801744cde021a9884d5232bf77a6a014e270554c2fde75db/abiquo-api-0.1.7.tar.gz" } ], "0.1.8": [ { "comment_text": "", "digests": { "md5": "a7a5bf5992a92272052816f8bf78873f", "sha256": "332ed1b6e6094879563b312acf8ab091a5815285b29ece06b134ddea132f237c" }, "downloads": -1, "filename": "abiquo-api-0.1.8.tar.gz", "has_sig": false, "md5_digest": "a7a5bf5992a92272052816f8bf78873f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4702, "upload_time": "2016-11-04T09:08:29", "url": "https://files.pythonhosted.org/packages/21/b7/d2a278add43208376b457199a8400838f4b9273d1f5afb99a284ad73e545/abiquo-api-0.1.8.tar.gz" } ], "0.1.9": [ { "comment_text": "", "digests": { "md5": "3d12e5a8d3e2cbca4de05f213b622ec3", "sha256": "f83cca78cf5bcd44c183a26b324b839a609000d55aae74a8ffad5e08ece61fc7" }, "downloads": -1, "filename": "abiquo-api-0.1.9.tar.gz", "has_sig": false, "md5_digest": "3d12e5a8d3e2cbca4de05f213b622ec3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5099, "upload_time": "2017-03-21T10:21:09", "url": "https://files.pythonhosted.org/packages/73/4c/71fd39a2b3811c53270128c9eaa649a5dc509106ad798fc74e39d9756e39/abiquo-api-0.1.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "775d2d25ec25760d5e187907fa34f415", "sha256": "d55a6ad8b8b30de5903fc84002cdac85270387e8447e7d69901a127488864dc2" }, "downloads": -1, "filename": "abiquo-api-0.1.14.tar.gz", "has_sig": false, "md5_digest": "775d2d25ec25760d5e187907fa34f415", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5922, "upload_time": "2018-12-14T13:57:18", "url": "https://files.pythonhosted.org/packages/85/04/24a834497832f90304b01b1152ec202c7cf57cbaeaf0255f07bf379a29c5/abiquo-api-0.1.14.tar.gz" } ] }