keystoneauth1.loading.session module

class keystoneauth1.loading.session.Session

Bases: _BaseLoader[Session]

__abstractmethods__ = frozenset({})
__annotations__ = {}
__doc__ = None
__module__ = 'keystoneauth1.loading.session'
__orig_bases__ = (keystoneauth1.loading.base._BaseLoader[keystoneauth1.session.Session],)
__parameters__ = ()
_abc_impl = <_abc._abc_data object>
get_conf_options(deprecated_opts: Dict[str, List[cfg.DeprecatedOpt]] | None = None) List[cfg.Opt]

Get oslo_config options that are needed for a Session.

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:
cafile:

The certificate authority filename.

certfile:

The client certificate file to present.

keyfile:

The key for the client certificate.

insecure:

Whether to ignore SSL verification.

timeout:

The max time to wait for HTTP connections.

collect-timing:

Whether to collect API timing information.

split-loggers:

Whether to log requests to multiple loggers.

Parameters:

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 ca_file option pointing to the new cafile option name:

old_opt = oslo_cfg.DeprecatedOpt('ca_file', 'old_group')
deprecated_opts = {'cafile': [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_argparse_arguments(namespace: Namespace, **kwargs: Any) Session
load_from_conf_options(conf: cfg.ConfigOpts, group: str, **kwargs: Any) Session

Create a session 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 session construction.

Returns:

A new session object.

Return type:

Session

load_from_options(insecure: bool = False, verify: bool | str | None = None, cacert: str | None = None, cert: str | None = None, key: str | None = None, **kwargs: Any) Session

Create a session with individual certificate parameters.

Some parameters used to create a session don’t lend themselves to be loaded from config/CLI etc. Create a session by converting those parameters into session __init__ parameters.

property plugin_class: Type[Session]
register_argparse_arguments(parser: ArgumentParser) None
register_conf_options(conf: cfg.ConfigOpts, group: str, deprecated_opts: Dict[str, List[cfg.DeprecatedOpt]] | None = None) List[cfg.Opt]

Register the oslo_config options that are needed for a session.

The options that are set are:
cafile:

The certificate authority filename.

certfile:

The client certificate file to present.

keyfile:

The key for the client certificate.

insecure:

Whether to ignore SSL verification.

timeout:

The max time to wait for HTTP connections.

collect-timing:

Whether to collect API timing information.

split-loggers:

Whether to log requests to multiple loggers.

Parameters:
  • conf (oslo_config.Cfg) – config object to register with.

  • group (string) – The ini group to register options in.

  • 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 ca_file option pointing to the new cafile option name:

    old_opt = oslo_cfg.DeprecatedOpt('ca_file', 'old_group')
    deprecated_opts = {'cafile': [old_opt]}
    

Returns:

The list of options that was registered.

keystoneauth1.loading.session._positive_non_zero_float(argument_value: str | None) float | None
keystoneauth1.loading.session.get_conf_options(deprecated_opts: Dict[str, List[cfg.DeprecatedOpt]] | None = None) List[cfg.Opt]
keystoneauth1.loading.session.load_from_argparse_arguments(namespace: Namespace, **kwargs: Any) Session
keystoneauth1.loading.session.load_from_conf_options(conf: cfg.ConfigOpts, group: str, **kwargs: Any) Session
keystoneauth1.loading.session.register_argparse_arguments(parser: ArgumentParser) None
keystoneauth1.loading.session.register_conf_options(conf: cfg.ConfigOpts, group: str, deprecated_opts: Dict[str, List[cfg.DeprecatedOpt]] | None = None) List[cfg.Opt]