Struct openstack::session::Session
[−]
[src]
pub struct Session { /* 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 Session
[src]
fn new<Auth: AuthMethod + 'static>(auth_method: Auth) -> Session
[src]
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_endpoint_interface<S>(self, endpoint_interface: S) -> Session where
S: Into<String>,
[src]
S: Into<String>,
Convert this session into one using the given endpoint interface.
Negotiated API versions are kept in the new object.
fn auth_method(&self) -> &AuthMethod
[src]
Get a reference to the authentication method in use.
fn api_version<Srv: ServiceType>(&self) -> Option<ApiVersion>
[src]
Get an API version used for given service.
fn get_service_info<Srv>(&self) -> Result<ServiceInfo> where
Srv: ServiceType,
[src]
Srv: ServiceType,
Get service info for the given service.
fn get_endpoint<Srv: ServiceType>(&self, path: &[&str]) -> Result<Url>
[src]
Construct and endpoint for the given service from the path.
fn request<Srv: ServiceType>(
&self,
method: Method,
path: &[&str]
) -> Result<RequestBuilder>
[src]
&self,
method: Method,
path: &[&str]
) -> Result<RequestBuilder>
Make an HTTP request to the given service.
fn negotiate_api_version<Srv>(
&mut self,
requested: ApiVersionRequest
) -> Result<ApiVersion> where
Srv: ServiceType + ApiVersioning,
[src]
&mut self,
requested: ApiVersionRequest
) -> Result<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 Debug for Session
[src]
impl Clone for Session
[src]
fn clone(&self) -> Session
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more