========================================
The `nectarallocationclient` Python API
========================================
A client for the Nectar Allocation API.
Usage
-----
First create a client instance using the keystoneauth session API::
>>> from keystoneauth1 import loading
>>> from keystoneauth1 import session
>>> from nectarallocationclient import client
>>> loader = loading.get_plugin_loader('password')
>>> auth = loader.load_from_options(auth_url=AUTH_URL,
... username=USERNAME,
... password=PASSWORD,
... project_name=PROJECT_NAME,
... user_domain_id='default',
... project_domain_id='default'
)
>>> sess = session.Session(auth=auth)
>>> nectar = client.Client(VERSION, session=sess)
Here ``VERSION`` can currently only be ``1``.
If you have PROJECT_ID instead of a PROJECT_NAME, use the project_id
parameter. Similarly, if your cloud uses keystone v3 and you have a DOMAIN_NAME
or DOMAIN_ID, provide it as `user_domain_(name|id)` and if you are using a
PROJECT_NAME also provide the domain information as `project_domain_(name|id)`.
nectarallocationclient adds 'python-nectarallocationclient' and its version to
the user-agent string that keystoneauth produces. If you are creating an
application using nectarallocationclient and want to register a name and
version in the user-agent string, pass those to the Session::
>>> sess = session.Session(
... auth=auth, app_name'nodepool', app_version'1.2.3')
If you are making a library that consumes nectarallocationclient but is not an
end-user application, you can append a (name, version) tuple to the session's
`additional_user_agent` property::
>>> sess = session.Session(auth=auth)
>>> sess.additional_user_agent.append(('shade', '1.2.3'))
For more information on this keystoneauth API, see `Using Sessions`_.
.. _Using Sessions: https://docs.openstack.org/keystoneauth/latest/using-sessions.html
Then call methods on its managers::
>>> nectar.allocations.list()
[<Allocation: 1 (my-cool-project)>]
>>> nectar.allocations.create("new-project",....)
<Allocation: 2 (new-project)>
Raw data
{
"_id": null,
"home_page": "https://github.com/NeCTAR-RC/python-nectarallocationclient",
"name": "nectarallocationclient",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "nectarallocation",
"author": "ARDC Nectar Cloud Services",
"author_email": "coreservices@ardc.edu.au",
"download_url": "https://files.pythonhosted.org/packages/1f/5f/4042873640c846bc2cf0c9f1131d185b3e0541ffffddf86e855c248ab9f9/nectarallocationclient-2.0.0.tar.gz",
"platform": null,
"description": "========================================\n The `nectarallocationclient` Python API\n========================================\n\nA client for the Nectar Allocation API.\n\n\nUsage\n-----\n\nFirst create a client instance using the keystoneauth session API::\n\n >>> from keystoneauth1 import loading\n >>> from keystoneauth1 import session\n >>> from nectarallocationclient import client\n >>> loader = loading.get_plugin_loader('password')\n >>> auth = loader.load_from_options(auth_url=AUTH_URL,\n ... username=USERNAME,\n ... password=PASSWORD,\n ... project_name=PROJECT_NAME,\n ... user_domain_id='default',\n ... project_domain_id='default'\n )\n >>> sess = session.Session(auth=auth)\n >>> nectar = client.Client(VERSION, session=sess)\n\nHere ``VERSION`` can currently only be ``1``.\n\nIf you have PROJECT_ID instead of a PROJECT_NAME, use the project_id\nparameter. Similarly, if your cloud uses keystone v3 and you have a DOMAIN_NAME\nor DOMAIN_ID, provide it as `user_domain_(name|id)` and if you are using a\nPROJECT_NAME also provide the domain information as `project_domain_(name|id)`.\n\nnectarallocationclient adds 'python-nectarallocationclient' and its version to\nthe user-agent string that keystoneauth produces. If you are creating an\napplication using nectarallocationclient and want to register a name and\nversion in the user-agent string, pass those to the Session::\n\n >>> sess = session.Session(\n ... auth=auth, app_name'nodepool', app_version'1.2.3')\n\nIf you are making a library that consumes nectarallocationclient but is not an\nend-user application, you can append a (name, version) tuple to the session's\n`additional_user_agent` property::\n\n >>> sess = session.Session(auth=auth)\n >>> sess.additional_user_agent.append(('shade', '1.2.3'))\n\nFor more information on this keystoneauth API, see `Using Sessions`_.\n\n.. _Using Sessions: https://docs.openstack.org/keystoneauth/latest/using-sessions.html\n\n\nThen call methods on its managers::\n\n >>> nectar.allocations.list()\n [<Allocation: 1 (my-cool-project)>]\n\n >>> nectar.allocations.create(\"new-project\",....)\n <Allocation: 2 (new-project)>\n\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "Client for the Nectar Allocation system",
"version": "2.0.0",
"project_urls": {
"Homepage": "https://github.com/NeCTAR-RC/python-nectarallocationclient"
},
"split_keywords": [
"nectarallocation"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "19435ffe56c7a4fda12971b609949ba893d1f4e714b8480def6601b6e0b2aea3",
"md5": "0e477d09696a327d82415d1d6040626d",
"sha256": "ee355e5fe29729bd5e3472bed2d7f47ccdf244a65880713a62896046cb65123c"
},
"downloads": -1,
"filename": "nectarallocationclient-2.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0e477d09696a327d82415d1d6040626d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 58545,
"upload_time": "2024-10-08T03:40:42",
"upload_time_iso_8601": "2024-10-08T03:40:42.333085Z",
"url": "https://files.pythonhosted.org/packages/19/43/5ffe56c7a4fda12971b609949ba893d1f4e714b8480def6601b6e0b2aea3/nectarallocationclient-2.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1f5f4042873640c846bc2cf0c9f1131d185b3e0541ffffddf86e855c248ab9f9",
"md5": "74aad1e1606eac5dc9507c9cee5353f3",
"sha256": "876f17997a7b0858c9e83c7e2aacc4bb60b2c943fc32d754daedf0db7dd5b3ee"
},
"downloads": -1,
"filename": "nectarallocationclient-2.0.0.tar.gz",
"has_sig": false,
"md5_digest": "74aad1e1606eac5dc9507c9cee5353f3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 32732,
"upload_time": "2024-10-08T03:40:44",
"upload_time_iso_8601": "2024-10-08T03:40:44.241531Z",
"url": "https://files.pythonhosted.org/packages/1f/5f/4042873640c846bc2cf0c9f1131d185b3e0541ffffddf86e855c248ab9f9/nectarallocationclient-2.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-08 03:40:44",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "NeCTAR-RC",
"github_project": "python-nectarallocationclient",
"travis_ci": false,
"coveralls": true,
"github_actions": false,
"requirements": [
{
"name": "oslo.utils",
"specs": []
},
{
"name": "requests",
"specs": []
},
{
"name": "keystoneauth1",
"specs": []
},
{
"name": "osc-lib",
"specs": []
},
{
"name": "pbr",
"specs": []
}
],
"tox": true,
"lcname": "nectarallocationclient"
}