API Reference¶
- class os_client_config.OpenStackConfig(config_files: list[str] | None = None, vendor_files: list[str] | None = None, override_defaults: dict[str, Any] | None = None, force_ipv4: bool | None = None, envvar_prefix: str | None = None, secure_files: list[str] | None = None, pw_func: _PasswordCallback | None = None, session_constructor: type[Session] | None = None, app_name: str | None = None, app_version: str | None = None, load_yaml_config: bool = True, load_envvars: bool = True, statsd_host: str | None = None, statsd_port: str | None = None, statsd_prefix: str | None = None, influxdb_config: dict[str, Any] | None = None)¶
- auth_config_hook(config)¶
Allow examination of config values before loading auth plugin
OpenStackClient will override this to perform additional checks on auth_type.
- get_extra_config(key, defaults=None)¶
Fetch an arbitrary extra chunk of config, laying in defaults.
- Parameters:
key (string) – name of the config section to fetch
defaults (dict) – (optional) default values to merge under the found config
- get_one(cloud: str | None = None, validate: bool = True, argparse: Namespace | None = None, **kwargs: Any) CloudRegion ¶
Retrieve a single CloudRegion and merge additional options
- Parameters:
cloud (string) – The name of the configuration to load from clouds.yaml
validate (boolean) – Validate the config. Setting this to False causes no auth plugin to be created. It’s really only useful for testing.
argparse (Namespace) – An argparse Namespace object; allows direct passing in of argparse options to be added to the cloud config. Values of None and ‘’ will be removed.
region_name – Name of the region of the cloud.
kwargs – Additional configuration options
- Returns:
openstack.config.cloud_region.CloudRegion
- Raises:
keystoneauth1.exceptions.MissingRequiredOptions on missing required auth parameters
- get_one_cloud(cloud: str | None = None, validate: bool = True, argparse: Namespace | None = None, **kwargs: Any) CloudRegion ¶
Retrieve a single CloudRegion and merge additional options
- Parameters:
cloud (string) – The name of the configuration to load from clouds.yaml
validate (boolean) – Validate the config. Setting this to False causes no auth plugin to be created. It’s really only useful for testing.
argparse (Namespace) – An argparse Namespace object; allows direct passing in of argparse options to be added to the cloud config. Values of None and ‘’ will be removed.
region_name – Name of the region of the cloud.
kwargs – Additional configuration options
- Returns:
openstack.config.cloud_region.CloudRegion
- Raises:
keystoneauth1.exceptions.MissingRequiredOptions on missing required auth parameters
- get_one_cloud_osc(cloud=None, validate=True, argparse=None, **kwargs)¶
Retrieve a single CloudRegion and merge additional options
- Parameters:
cloud (string) – The name of the configuration to load from clouds.yaml
validate (boolean) – Validate the config. Setting this to False causes no auth plugin to be created. It’s really only useful for testing.
argparse (Namespace) – An argparse Namespace object; allows direct passing in of argparse options to be added to the cloud config. Values of None and ‘’ will be removed.
region_name – Name of the region of the cloud.
kwargs – Additional configuration options
- Raises:
keystoneauth1.exceptions.MissingRequiredOptions on missing required auth parameters
- magic_fixes(config)¶
Perform the set of magic argument fixups
- option_prompt(config, p_opt)¶
Prompt user for option that requires a value
- register_argparse_arguments(parser, argv, service_keys=None)¶
Register all of the common argparse options needed.
Given an argparse parser, register the keystoneauth Session arguments, the keystoneauth Auth Plugin Options and os-cloud. Also, peek in the argv to see if all of the auth plugin options should be registered or merely the ones already configured.
- Parameters:
argparse.ArgumentParser – parser to attach argparse options to
argv – the arguments provided to the application
service_keys (string) – Service or list of services this argparse should be specialized for, if known. The first item in the list will be used as the default value for service_type (optional)
:raises exceptions.ConfigException if an invalid auth-type is requested
- static set_one_cloud(config_file, cloud, set_config=None)¶
Set a single cloud configuration.
- Parameters:
config_file (string) – The path to the config file to edit. If this file does not exist it will be created.
cloud (string) – The name of the configuration to save to clouds.yaml
set_config (dict) – Configuration options to be set