The keystoneclient Python API

class keystoneclient.v2_0.client.Client(endpoint=None, **kwargs)

Client for the OpenStack Keystone v2.0 API.

Parameters:
  • username (string) – Username for authentication. (optional)
  • password (string) – Password for authentication. (optional)
  • token (string) – Token for authentication. (optional)
  • tenant_name (string) – Tenant id. (optional)
  • tenant_id (string) – Tenant name. (optional)
  • auth_url (string) – Keystone service endpoint for authorization.
  • region_name (string) – Name of a region to select when choosing an endpoint from the service catalog.
  • endpoint (string) – A user-supplied endpoint URL for the keystone service. Lazy-authentication is possible for API service calls if endpoint is set at instantiation.(optional)
  • timeout (integer) – Allows customization of the timeout for client http requests. (optional)

Example:

>>> from keystoneclient.v2_0 import client
>>> keystone = client.Client(username=USER,
                             password=PASS,
                             tenant_name=TENANT_NAME,
                             auth_url=KEYSTONE_URL)
>>> keystone.tenants.list()
...
>>> user = keystone.users.get(USER_ID)
>>> user.delete()
authenticate()

Authenticate against the Keystone API.

Uses the data provided at instantiation to authenticate against the Keystone server. This may use either a username and password or token for authentication. If a tenant id was provided then the resulting authenticated client will be scoped to that tenant and contain a service catalog of available endpoints.

Returns True if authentication was successful.

For more information, see the reference documentation:

Previous topic

Python bindings to the OpenStack Keystone API

Next topic

API Reference

This Page