keystoneauth1.loading.adapter module¶
- class keystoneauth1.loading.adapter.Adapter
Bases:
_BaseLoader[Adapter]- __abstractmethods__ = frozenset({})
- __annotate_func__ = None
- __annotations_cache__ = {}
- __doc__ = None
- __firstlineno__ = 34
- __module__ = 'keystoneauth1.loading.adapter'
- __orig_bases__ = (keystoneauth1.loading.base._BaseLoader[keystoneauth1.adapter.Adapter],)
- __parameters__ = ()
- __static_attributes__ = ()
- _abc_impl = <_abc._abc_data object>
- static get_conf_options(include_deprecated: bool = True, deprecated_opts: dict[str, list[cfg.DeprecatedOpt]] | None = None) list[cfg.Opt]
Get oslo_config options that are needed for a
Adapter.These may be useful without being registered for config file generation or to manipulate the options before registering them yourself.
The options that are set are:
- service_type:
The default service_type for URL discovery.
- service_name:
The default service_name for URL discovery.
- valid_interfaces:
List of acceptable interfaces for URL discovery. Can be a list of any of ‘public’, ‘internal’ or ‘admin’.
- region_name:
The default region_name for URL discovery.
- endpoint_override:
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.
- 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’.
- 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.
- connect_retries:
The maximum number of retries that should be attempted for connection errors.
- connect_retry_delay:
Delay (in seconds) between two retries for connection errors. If not set, exponential retry starting with 0.5 seconds up to a maximum of 60 seconds is used.
- status_code_retries:
The maximum number of retries that should be attempted for retriable HTTP status codes.
- status_code_retry_delay:
Delay (in seconds) between two retries for retriable status codes. If not set, exponential retry starting with 0.5 seconds up to a maximum of 60 seconds is used.
- retriable_status_codes:
List of retriable HTTP status codes that should be retried. If not set default to [503].
Additionally, the following options are registered if
include_deprecatedis set toTrue(default).- interface:
The default interface for URL discovery.
- Parameters:
include_deprecated – If True (the default, for backward compatibility), deprecated options are included in the result. If False, they are excluded.
deprecated_opts –
Deprecated options that should be included in the definition of new options. This should be a dict from the name of the new option to a list of oslo.DeprecatedOpts that correspond to the new option. (optional)
For example, to support the
api_endpointoption pointing to the newendpoint_overrideoption name:old_opt = oslo_cfg.DeprecatedOpt('api_endpoint', 'old_group') deprecated_opts = {'endpoint_override': [old_opt]}
- Returns:
A list of oslo_config options.
- get_options() list[opts.Opt]
Return the list of parameters associated with the auth plugin.
This list may be used to generate CLI or config arguments.
- Returns:
A list of Param objects describing available plugin parameters.
- load_from_conf_options(conf: cfg.ConfigOpts, group: str | cfg.OptGroup, **kwargs: Any) Adapter
Create an Adapter object from an oslo_config object.
The options must have been previously registered with register_conf_options.
- Parameters:
conf – config object to register with.
group – The ini group to register options in.
kwargs – Additional parameters to pass to Adapter construction.
- Returns:
A new Adapter object.
- property plugin_class: type[Adapter]
- classmethod register_conf_options(conf: cfg.ConfigOpts, group: str | cfg.OptGroup, include_deprecated: bool = True, deprecated_opts: dict[str, list[cfg.DeprecatedOpt]] | None = None) list[cfg.Opt]
Register the oslo_config options that are needed for an Adapter.
- The options that are set are:
- service_type:
The default service_type for URL discovery.
- service_name:
The default service_name for URL discovery.
- interface:
The default interface for URL discovery. (deprecated)
- valid_interfaces:
List of acceptable interfaces for URL discovery. Can be a list of any of ‘public’, ‘internal’ or ‘admin’.
- region_name:
The default region_name for URL discovery.
- endpoint_override:
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.
- 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’.
- 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.
- connect_retries:
The maximum number of retries that should be attempted for connection errors.
- status_code_retries:
The maximum number of retries that should be attempted for retriable HTTP status codes.
- Parameters:
conf – config object to register with.
group – The ini group to register options in.
include_deprecated – If True (the default, for backward compatibility), deprecated options are registered. If False, they are excluded.
deprecated_opts –
Deprecated options that should be included in the definition of new options. This should be a dict from the name of the new option to a list of oslo.DeprecatedOpts that correspond to the new option. (optional)
For example, to support the
api_endpointoption pointing to the newendpoint_overrideoption name:old_opt = oslo_cfg.DeprecatedOpt('api_endpoint', 'old_group') deprecated_opts = {'endpoint_override': [old_opt]}
- Returns:
The list of options that was registered.
- class keystoneauth1.loading.adapter.Any(*args, **kwargs)
Bases:
objectSpecial type indicating an unconstrained type.
Any is assignable to every type.
Any assumed to have all methods and attributes.
All values are assignable to Any.
Note that all the above statements are true from the point of view of static type checkers. At runtime, Any cannot be used with instance checks.
- __annotations_cache__ = {}
- __dict__ = mappingproxy({'__module__': 'typing', '__firstlineno__': 588, '__doc__': 'Special type indicating an unconstrained type.\n\n- Any is assignable to every type.\n- Any assumed to have all methods and attributes.\n- All values are assignable to Any.\n\nNote that all the above statements are true from the point of view of\nstatic type checkers. At runtime, Any cannot be used with instance\nchecks.\n', '__new__': <staticmethod(<function Any.__new__>)>, '__static_attributes__': (), '__dict__': <attribute '__dict__' of 'Any' objects>, '__weakref__': <attribute '__weakref__' of 'Any' objects>, '__annotations_cache__': {}})
- __doc__ = 'Special type indicating an unconstrained type.\n\n- Any is assignable to every type.\n- Any assumed to have all methods and attributes.\n- All values are assignable to Any.\n\nNote that all the above statements are true from the point of view of\nstatic type checkers. At runtime, Any cannot be used with instance\nchecks.\n'
- __firstlineno__ = 588
- __module__ = 'typing'
- static __new__(cls, *args, **kwargs)
- __static_attributes__ = ()
- __weakref__
list of weak references to the object
- keystoneauth1.loading.adapter.get_conf_options(include_deprecated: bool = True, deprecated_opts: dict[str, list[cfg.DeprecatedOpt]] | None = None) list[cfg.Opt]
- keystoneauth1.loading.adapter.load_from_conf_options(conf: cfg.ConfigOpts, group: str | cfg.OptGroup, **kwargs: Any) Adapter
- keystoneauth1.loading.adapter.process_conf_options(confgrp: cfg.ConfigOpts.GroupAttr, kwargs: dict[str, Any]) None
Set Adapter constructor kwargs based on conf options.
- Parameters:
confgrp – Config object group containing options to inspect.
kwargs – Keyword arguments suitable for the constructor of keystoneauth1.adapter.Adapter. Will be modified by this method. Values already set remain unaffected.
- Raises:
TypeError – If invalid conf option values or combinations are found.
- keystoneauth1.loading.adapter.register_argparse_arguments(parser: ArgumentParser, service_type: str | None = None) None
- keystoneauth1.loading.adapter.register_conf_options(conf: cfg.ConfigOpts, group: str | cfg.OptGroup, include_deprecated: bool = True, deprecated_opts: dict[str, list[cfg.DeprecatedOpt]] | None = None) list[cfg.Opt]
- keystoneauth1.loading.adapter.register_service_argparse_arguments(parser: ArgumentParser, service_type: str) None