openstack_sdk

Module config

Source
Expand description

Module to handle OpenStack config

let cfg = openstack_sdk::config::ConfigFile::new().unwrap();
let profile = cfg
    .get_cloud_config("devstack")
    .expect("Cloud devstack not found");

It is possible to create a config by passing paths to a builder.

let cfg = openstack_sdk::config::ConfigFile::builder()
    .add_source("c1.yaml")
    .expect("Failed to load 'c1.yaml'")
    .add_source("s2.yaml")
    .expect("Failed to load 's2.yaml'")
    .build();

It is also possible to create a config with ConfigFile::new_with_user_specified_configs. This is similar to what the python OpenStackSDK does.

let cfg = openstack_sdk::config::ConfigFile::new_with_user_specified_configs(
    Some("c1.yaml"),
    Some("s2.yaml"),
).expect("Failed to load the configuration files");

Structs§

Enums§

Functions§