keystoneauth1.adapter.
Adapter
(session, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None)¶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.
Parameters: |
|
---|
client_name
= None¶client_version
= None¶delete
(url, **kwargs)¶get
(url, **kwargs)¶get_all_version_data
(interface='public', region_name=None)¶Get data about all versions of a service.
Parameters: |
|
---|---|
Returns: | A dictionary keyed by region_name with values containing
dictionaries keyed by interface with values being a list of
|
get_api_major_version
(auth=None, **kwargs)¶Get the major API version as provided by the auth plugin.
Parameters: | auth (keystoneauth1.plugin.BaseAuthPlugin) – The auth plugin to use for token. Overrides the plugin on the session. (optional) |
---|---|
Raises: | keystoneauth1.exceptions.auth_plugins.MissingAuthPlugin – if a plugin is not available. |
Returns: | The major version of the API of the service discovered. |
Return type: | tuple or None |
get_endpoint
(auth=None, **kwargs)¶Get an endpoint as provided by the auth plugin.
Parameters: | auth (keystoneauth1.plugin.BaseAuthPlugin) – The auth plugin to use for token. Overrides the plugin on the session. (optional) |
---|---|
Raises: | keystoneauth1.exceptions.auth_plugins.MissingAuthPlugin – if a plugin is not available. |
Returns: | An endpoint if available or None. |
Return type: | str |
get_endpoint_data
(auth=None)¶Get the endpoint data for this Adapter’s endpoint.
Parameters: | auth (keystoneauth1.plugin.BaseAuthPlugin) – The auth plugin to use for token. Overrides the plugin on the session. (optional) |
---|---|
Raises: |
|
Returns: | Endpoint data if available or None. |
Return type: |
get_project_id
(auth=None)¶Return the authenticated project_id as provided by the auth plugin.
Parameters: | auth (keystoneauth1.plugin.BaseAuthPlugin) – The auth plugin to use for token. Overrides the plugin on the session. (optional) |
---|---|
Raises: |
|
Returns: | Current project_id or None if not supported by plugin. |
Return type: |
|
get_token
(auth=None)¶Return a token as provided by the auth plugin.
Parameters: | auth (keystoneauth1.plugin.BaseAuthPlugin) – The auth plugin to use for token. Overrides the plugin on the session. (optional) |
---|---|
Raises: | keystoneauth1.exceptions.auth.AuthorizationFailure – if a new token fetch fails. |
Returns: | A valid token. |
Return type: | str |
get_user_id
(auth=None)¶Return the authenticated user_id as provided by the auth plugin.
Parameters: | auth (keystoneauth1.plugin.BaseAuthPlugin) – The auth plugin to use for token. Overrides the plugin on the session. (optional) |
---|---|
Raises: |
|
Returns: | Current user_id or None if not supported by plugin. |
Return type: |
|
head
(url, **kwargs)¶invalidate
(auth=None)¶Invalidate an authentication plugin.
patch
(url, **kwargs)¶post
(url, **kwargs)¶put
(url, **kwargs)¶register_argparse_arguments
(parser, service_type=None)¶Attach arguments to a given argparse Parser for Adapters.
Parameters: |
|
---|
register_service_argparse_arguments
(parser, service_type)¶Attach arguments to a given argparse Parser for Adapters.
Parameters: |
|
---|
request
(url, method, **kwargs)¶keystoneauth1.adapter.
LegacyJsonAdapter
(session, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None)¶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.
request
(*args, **kwargs)¶keystoneauth1.adapter.
register_adapter_argparse_arguments
(*args, **kwargs)¶keystoneauth1.adapter.
register_service_adapter_argparse_arguments
(*args, **kwargs)¶Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.