Skip to main content

Client for the Nectar Allocation system

Project description

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.

Then call methods on its managers:

>>> nectar.allocations.list()
[<Allocation: 1 (my-cool-project)>]

>>> nectar.allocations.create("new-project",....)
<Allocation: 2 (new-project)>

Project details


Download files

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

Source Distribution

nectarallocationclient-2.1.0.tar.gz (41.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nectarallocationclient-2.1.0-py3-none-any.whl (78.2 kB view details)

Uploaded Python 3

File details

Details for the file nectarallocationclient-2.1.0.tar.gz.

File metadata

  • Download URL: nectarallocationclient-2.1.0.tar.gz
  • Upload date:
  • Size: 41.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for nectarallocationclient-2.1.0.tar.gz
Algorithm Hash digest
SHA256 485dbd158d450885d518fc04015e259d6b85d70ae9a53e626bbe2e15c6ce20e5
MD5 7f2e14b0322ccac760ad6cf7ffd9f614
BLAKE2b-256 5b9714f8f973b03ea9f51ea80c81a7af09b32c6c7270ae7fd14adb1b379188c5

See more details on using hashes here.

File details

Details for the file nectarallocationclient-2.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for nectarallocationclient-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 95b73b973406a6950d0e8af46367c9db2c2b1c650702b8287c1fca3308f3c674
MD5 d01d0c5058c5c887dc717a94f1f3936c
BLAKE2b-256 c87a31faf15c416a45b4125e7504b302fc41a5263f7bb82b058a2d911bf6d43a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page