Bases: object
An instance of a session with local variables.
A session is a global object that is shared around amongst many clients. It therefore contains state that is relevant to everyone. There is a lot of state such as the service type and region_name that are only relevant to a particular client that is using the session. An adapter provides a wrapper of client local data around the global session object.
version, min_version, max_version and default_microversion can all be given either as a string or a tuple.
session (keystoneauth1.session.Session) – The session object to wrap.
service_type (str) – The default service_type for URL discovery.
service_name (str) – The default service_name for URL discovery.
interface (str) – The default interface for URL discovery.
region_name (str) – The default region_name for URL discovery.
endpoint_override (str) – Always use this endpoint URL for requests for this client.
version – The minimum version restricted to a given Major API. Mutually exclusive with min_version and max_version. (optional)
auth (keystoneauth1.plugin.BaseAuthPlugin) – An auth plugin to use instead of the session one.
user_agent (str) – The User-Agent string to set.
connect_retries (int) – The maximum number of retries that should be attempted for connection errors. Default None - use session default which is don’t retry.
logger (logging.Logger) – A logging object to use for requests that pass through this adapter.
allow (dict) – Extra filters to pass when discovering API versions. (optional)
additional_headers (dict) – Additional headers that should be attached to every request passing through the adapter. Headers of the same name specified per request will take priority.
client_name (str) – The name of the client that created the adapter. This will be used to create the user_agent.
client_version (str) – The version of the client that created the adapter. This will be used to create the user_agent.
allow_version_hack (bool) – Allow keystoneauth to hack up catalog URLS to support older schemes. (optional, default True)
global_request_id (str) – A global_request_id (in the form of req-$uuid
) that will be
passed on all requests. Enables cross project request id tracking.
min_version – The minimum major version of a given API, intended to be used as the lower bound of a range with max_version. Mutually exclusive with version. If min_version is given with no max_version it is as if max version is ‘latest’. (optional)
max_version – The maximum major version of a given API, intended to be used as the upper bound of a range with min_version. Mutually exclusive with version. (optional)
default_microversion – The default microversion value to send with API requests. While microversions are a per-request feature, a user may know they want to default to sending a specific value. (optional)
status_code_retries (int) – The maximum number of retries that should be attempted for retriable HTTP status codes (optional, defaults to 0 - never retry).
retriable_status_codes (list) – List of HTTP status codes that should be retried (optional, defaults to HTTP 503, has no effect when status_code_retries is 0).
raise_exc (bool) – If True, requests returning failing HTTP responses will raise an exception; if False, the response is returned. This can be overridden on a per-request basis via the kwarg of the same name.
rate_limit (float) – A client-side rate limit to impose on requests made through this adapter in requests per second. For instance, a rate_limit of 2 means to allow no more than 2 requests per second, and a rate_limit of 0.5 means to allow no more than 1 request every two seconds. (optional, defaults to None, which means no rate limiting will be applied).
concurrency (int) – How many simultaneous http requests this Adapter can be used for. (optional, defaults to None, which means no limit).
connect_retry_delay (float) – Delay (in seconds) between two connect retries (if enabled). By default exponential retry starting with 0.5 seconds up to a maximum of 60 seconds is used.
status_code_retry_delay (float) – Delay (in seconds) between two status code retries (if enabled). By default exponential retry starting with 0.5 seconds up to a maximum of 60 seconds is used.
Get data about all versions of a service.
interface – Type of endpoint to get version data for. Can be a single value or a list of values. A value of None indicates that all interfaces should be queried. (optional, defaults to public)
region_name (string) – Region of endpoints to get version data for. A valueof None indicates that all regions should be queried. (optional, defaults to None)
A dictionary keyed by region_name with values containing
dictionaries keyed by interface with values being a list of
VersionData
.
Get the major API version as provided by the auth plugin.
auth (keystoneauth1.plugin.BaseAuthPlugin) – The auth plugin to use for token. Overrides the plugin on the session. (optional)
keystoneauth1.exceptions.auth_plugins.MissingAuthPlugin – if a plugin is not available.
The major version of the API of the service discovered.
tuple or None
Get an endpoint as provided by the auth plugin.
auth (keystoneauth1.plugin.BaseAuthPlugin) – The auth plugin to use for token. Overrides the plugin on the session. (optional)
keystoneauth1.exceptions.auth_plugins.MissingAuthPlugin – if a plugin is not available.
An endpoint if available or None.
str
Get the endpoint data for this Adapter’s endpoint.
auth (keystoneauth1.plugin.BaseAuthPlugin) – The auth plugin to use for token. Overrides the plugin on the session. (optional)
keystoneauth1.exceptions.auth_plugins.MissingAuthPlugin – if a plugin is not available.
TypeError – If arguments are invalid
Endpoint data if available or None.
Return the authenticated project_id as provided by the auth plugin.
auth (keystoneauth1.plugin.BaseAuthPlugin) – The auth plugin to use for token. Overrides the plugin on the session. (optional)
keystoneauth1.exceptions.auth.AuthorizationFailure – if a new token fetch fails.
keystoneauth1.exceptions.auth_plugins.MissingAuthPlugin – if a plugin is not available.
Current project_id or None if not supported by plugin.
str
Return a token as provided by the auth plugin.
auth (keystoneauth1.plugin.BaseAuthPlugin) – The auth plugin to use for token. Overrides the plugin on the session. (optional)
keystoneauth1.exceptions.auth.AuthorizationFailure – if a new token fetch fails.
A valid token.
str
Return the authenticated user_id as provided by the auth plugin.
auth (keystoneauth1.plugin.BaseAuthPlugin) – The auth plugin to use for token. Overrides the plugin on the session. (optional)
keystoneauth1.exceptions.auth.AuthorizationFailure – if a new token fetch fails.
keystoneauth1.exceptions.auth_plugins.MissingAuthPlugin – if a plugin is not available.
Current user_id or None if not supported by plugin.
str
Invalidate an authentication plugin.
Attach arguments to a given argparse Parser for Adapters.
parser (argparse.ArgumentParser) – The argparse parser to attach options to.
service_type (str) – Default service_type value. (optional)
Attach arguments to a given argparse Parser for Adapters.
parser (argparse.ArgumentParser) – The argparse parser to attach options to.
service_type (str) – Name of a service to generate additional arguments for.
Bases: keystoneauth1.adapter.Adapter
Make something that looks like an old HTTPClient.
A common case when using an adapter is that we want an interface similar to the HTTPClients of old which returned the body as JSON as well.
You probably don’t want this if you are starting from scratch.
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.