keystoneauth1.loading.session module

class keystoneauth1.loading.session.Session

Bases: keystoneauth1.loading.base._BaseLoader[keystoneauth1.session.Session]

__abstractmethods__ = frozenset({})
__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: Optional[dict] = None) → list

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

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: argparse.Namespace, **kwargs: Any) → keystoneauth1.session.Session
load_from_conf_options(conf: cfg.ConfigOpts, group: str, **kwargs: Any) → keystoneauth1.session.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: Optional[Union[bool, str]] = None, cacert: Optional[str] = None, cert: Optional[str] = None, key: Optional[str] = None, **kwargs: Any) → keystoneauth1.session.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
register_argparse_arguments(parser: argparse.ArgumentParser) → None
register_conf_options(conf: cfg.ConfigOpts, group: str, deprecated_opts: Optional[dict] = None) → list

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: Optional[str]) → Optional[float]
keystoneauth1.loading.session.get_conf_options(deprecated_opts: Optional[dict] = None) → list
keystoneauth1.loading.session.load_from_argparse_arguments(namespace: argparse.Namespace, **kwargs: Any) → keystoneauth1.session.Session
keystoneauth1.loading.session.load_from_conf_options(conf: cfg.ConfigOpts, group: str, **kwargs: Any) → keystoneauth1.session.Session
keystoneauth1.loading.session.register_argparse_arguments(parser: argparse.ArgumentParser) → None
keystoneauth1.loading.session.register_conf_options(conf: cfg.ConfigOpts, group: str, deprecated_opts: Optional[dict] = None) → list