Struct openstack::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 service_headers<Srv: ServiceType>(&self) -> Headers
[src]
Get a copy of headers to send for given service.
Currently only includes API version headers.
fn get_service_info<Srv>(
&self,
endpoint_interface: Option<String>
) -> ApiResult<ServiceInfo> where
Srv: ServiceType,
[src]
&self,
endpoint_interface: Option<String>
) -> ApiResult<ServiceInfo> where
Srv: ServiceType,
Get service info for the given service.
If endpoint interface is not provided, the default for this session is used.
fn negotiate_api_version<Srv>(
&mut self,
requested: ApiVersionRequest
) -> ApiResult<ApiVersion> where
Srv: ServiceType + ApiVersioning,
[src]
&mut self,
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.
fn request<U>(&self, method: Method, url: U) -> ApiResult<RequestBuilder> where
U: IntoUrl,
[src]
U: IntoUrl,
Prepare an HTTP request with authentication.