pub struct CloudConfig {
pub auth: Option<Auth>,
pub auth_type: Option<String>,
pub auth_methods: Option<Vec<String>>,
pub profile: Option<String>,
pub interface: Option<String>,
pub region_name: Option<String>,
pub name: Option<String>,
pub cacert: Option<String>,
pub verify: Option<bool>,
pub options: HashMap<String, Value>,
}Expand description
Configuration object representing a single connection to the concrete cloud.
Connection to the cloud uses this object.
Fields§
§auth: Option<Auth>Authorization data.
auth_type: Option<String>Authorization type. While it can be enum it would make hard to extend SDK with custom implementations.
auth_methods: Option<Vec<String>>Authorization methods (in the case when auth_type = multifactor).
profile: Option<String>Vendor Profile (by name from clouds-public.yaml or TBD: URL).
interface: Option<String>Interface name to be used for endpoints selection.
region_name: Option<String>Region name.
name: Option<String>Alternative connection name which is may be used to provide some meaningful name when
CloudConfig is constructed directly without clouds.yaml file.
cacert: Option<String>Custom CA Certificate.
verify: Option<bool>Verify SSL Certificates.
options: HashMap<String, Value>All other options.
Implementations§
Source§impl CloudConfig
CloudConfig struct implementation.
impl CloudConfig
CloudConfig struct implementation.
Sourcepub fn from_env() -> Result<Self, ConfigError>
pub fn from_env() -> Result<Self, ConfigError>
Construct CloudConfig from environment variables.
Historically keystoneauth python library parses relevant environment variables.
OpenStackSDK attempts to structure the cloud configuration introducing an explicit “auth”
object holding the authentication data. Pretty unfortunately this structure gets very
broken: OS_USER_ID is placed under the auth, OS_AUTH_URL is the auth_url under the
auth, OS_AUTH_TYPE is auth_type on the config level and so on.
To keep this still manageable without keeping at full mapping, this function parses
environment variables with the OS_ prefix into the CloudConfig but uses
auth property separately populated out of all environment variables
with the same OS_ prefix.
Sourcepub fn update(&mut self, update: &CloudConfig)
pub fn update(&mut self, update: &CloudConfig)
Update unset CloudConfig with values from the update var.
Trait Implementations§
Source§impl Clone for CloudConfig
impl Clone for CloudConfig
Source§fn clone(&self) -> CloudConfig
fn clone(&self) -> CloudConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CloudConfig
impl Debug for CloudConfig
Source§impl Default for CloudConfig
impl Default for CloudConfig
Source§fn default() -> CloudConfig
fn default() -> CloudConfig
Source§impl<'de> Deserialize<'de> for CloudConfig
impl<'de> Deserialize<'de> for CloudConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl TryFrom<&CloudConfig> for AuthTokenScope
Build AuthTokenScope data from CloudConfig
impl TryFrom<&CloudConfig> for AuthTokenScope
Build AuthTokenScope data from CloudConfig
Source§type Error = AuthTokenScopeError
type Error = AuthTokenScopeError
Auto Trait Implementations§
impl Freeze for CloudConfig
impl RefUnwindSafe for CloudConfig
impl Send for CloudConfig
impl Sync for CloudConfig
impl Unpin for CloudConfig
impl UnwindSafe for CloudConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more