OpenStack Client interface. Handles the REST calls and responses.
Bases: object
Authenticate user.
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 name or id was provided then the resulting authenticated client will be scoped to that tenant and contain a service catalog of available endpoints.
With the v2.0 API, if a tenant name or ID is not provided, the authenication token returned will be ‘unscoped’ and limited in capabilities until a fully-scoped token is acquired.
If successful, sets the self.auth_ref and self.auth_token with the returned token. If not already set, will also set self.management_url from the details provided in the token.
Returns: | True if authentication was successful. |
---|---|
Raises : | AuthorizationFailure if unable to authenticate or validate the existing authorization token |
Raises : | ValueError if insufficient parameters are used. |
If keyring is used, token is retrieved from keyring instead. Authentication will only be necessary if any of the following conditions are met:
Retrieve auth_ref from keyring.
If auth_ref is found in keyring, (keyring_key, auth_ref) is returned. Otherwise, (keyring_key, None) is returned.
Returns: | (keyring_key, auth_ref) or (keyring_key, None) |
---|
Authenticate against the Identity API and get a token.
Not implemented here because auth protocols should be API version-specific.
Expected to authenticate or validate an existing authentication reference already associated with the client. Invoking this call always makes a call to the Keystone.
Returns: | raw token |
---|
Extract and process information from the new auth_ref.
Send an http request with the specified characteristics.
Wrapper around requests.request to handle tasks such as setting headers, JSON encoding/decoding, and error handling.
Store auth_ref into keyring.