keystoneauth1.loading.adapter module¶
- class keystoneauth1.loading.adapter.Adapter¶
Bases:
_BaseLoader
[Adapter
]- __abstractmethods__ = frozenset({})¶
- __annotations__ = {}¶
- __doc__ = None¶
- __firstlineno__ = 35¶
- __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.
- 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.
- Parameters:
include_deprecated – If True (the default, for backward compatibility), deprecated options are included in the result. If False, they are excluded.
deprecated_opts (dict) –
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_endpoint
option pointing to the newendpoint_override
option 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.
- Return type:
list
- load_from_conf_options(conf: cfg.ConfigOpts, group: str, **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 (oslo_config.Cfg) – config object to register with.
group (string) – The ini group to register options in.
kwargs (dict) – Additional parameters to pass to Adapter construction.
- Returns:
A new Adapter object.
- Return type:
- register_conf_options(conf: cfg.ConfigOpts, group: str, 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 (oslo_config.Cfg) – config object to register with.
group (string) – 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 (dict) –
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_endpoint
option pointing to the newendpoint_override
option name:old_opt = oslo_cfg.DeprecatedOpt('api_endpoint', 'old_group') deprecated_opts = {'endpoint_override': [old_opt]}
- Returns:
The list of options that was registered.
- 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, **kwargs: Any) Adapter ¶
- keystoneauth1.loading.adapter.process_conf_options(confgrp: cfg.OptGroup, kwargs: dict[str, Any]) None ¶
Set Adapter constructor kwargs based on conf options.
- Parameters:
confgrp (oslo_config.cfg.OptGroup) – Config object group containing options to inspect.
kwargs (dict) – 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, 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 ¶