Struct openstack::Session
[−]
[src]
pub struct Session<Auth: AuthMethod> { /* fields omitted */ }
An OpenStack API session.
The session object serves as a wrapper around an HTTP(s) client, handling authentication, accessing the service catalog and token refresh.
The session object also owns region and endpoint interface to use.
Finally, the session object is responsible for API version negotiation.
Methods
impl<'a, Auth: AuthMethod + 'a> Session<Auth>[src]
fn new(auth_method: Auth) -> Session<Auth>
Create a new session with a given authentication plugin.
The resulting session will use the default endpoint interface (usually, public) and the first available region.
fn with_region<S: Into<String>>(self, region: S) -> Session<Auth>
Convert this session into one using the given region.
Negotiated API versions are reset to their default values.
fn with_endpoint_interface<S: Into<String>>(self,
endpoint_interface: S)
-> Session<Auth>
endpoint_interface: S)
-> Session<Auth>
Convert this session into one using the given endpoint interface.
Negotiated API versions are kept in the new object.
fn auth_token(&self) -> ApiResult<Auth::TokenType>
Get a clone of the authentication token.
fn auth_method(&self) -> &Auth
Get a reference to the authentication method in use.
fn api_version<Srv: ServiceType>(&self) -> Option<ApiVersion>
Get an API version used for given service.
fn service_headers<Srv: ServiceType>(&self) -> Headers
Get a copy of headers to send for given service.
Currently only includes API version headers.
fn raw_request<U: IntoUrl>(&'a self,
method: Method,
url: U)
-> AuthenticatedRequestBuilder<'a, Auth>
method: Method,
url: U)
-> AuthenticatedRequestBuilder<'a, Auth>
A wrapper for HTTP request.
fn get_service_info<Srv>(&self) -> ApiResult<ServiceInfo> where Srv: ServiceType
Get service info for the given service.
fn negotiate_api_version<Srv>(&mut self,
requested: ApiVersionRequest)
-> ApiResult<ApiVersion> where Srv: ServiceType + ApiVersioning
requested: ApiVersionRequest)
-> ApiResult<ApiVersion> where Srv: ServiceType + ApiVersioning
Negotiate an API version with the service.
Negotiation is based on version information returned from the root endpoint. If no minimum version is returned, the current version is assumed to be the only supported version.
The resulting API version is cached for this session.
Trait Implementations
impl<Auth: Debug + AuthMethod> Debug for Session<Auth> where Auth::TokenType: Debug[src]
impl<Auth: AuthMethod + Clone> Clone for Session<Auth>[src]
fn clone(&self) -> Session<Auth>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0
Performs copy-assignment from source. Read more