Struct openstack::Cloud [] [src]

pub struct Cloud { /* fields omitted */ }

OpenStack cloud API.

Provides high-level API for working with OpenStack clouds.

Methods

impl Cloud
[src]

[src]

Create a new cloud object with a given authentication plugin.

See (auth module)[auth/index.html) for details on how to authenticate against OpenStack clouds.

Example

use openstack;

let auth = openstack::auth::from_env().expect("Unable to authenticate");
let os = openstack::Cloud::new(auth);

[src]

Create a new cloud object with a given session.

This constructor can be used to modify Session parameters before using it in the Cloud object. This is an advanced feature and should generally be avoided.

Example

use openstack;

let auth = openstack::auth::from_env().expect("Unable to authenticate");
let session = openstack::session::Session::new(auth);
let os = openstack::Cloud::new_with_session(session);

[src]

Convert this cloud into one using the given endpoint interface.

[src]

Session used with this Cloud object.

[src]

Extract the Session object, destroying this Cloud.

[src]

Find a server by its ID.

Example

use openstack;

let auth = openstack::auth::from_env().expect("Unable to authenticate");
let os = openstack::Cloud::new(auth);
let server = os.get_server_by_id("8a1c355b-2e1e-440a-8aa8-f272df72bc32")
    .expect("Unable to get a server");

[src]

Build a query against server list.

The returned object is a builder that should be used to construct the query. The results can be received with a fetch call.

Example

Sorting servers by access_ip_v4 and getting first 5 results:

use openstack;

let auth = openstack::auth::from_env().expect("Unable to authenticate");
let os = openstack::Cloud::new(auth);
let sorting = openstack::compute::ServerSortKey::AccessIpv4;
let server_list = os.find_servers()
    .sort_by(openstack::Sort::Asc(sorting)).with_limit(5)
    .fetch().expect("Unable to fetch servers");

[src]

List all servers.

This call can yield a lot of results, use the find_servers call to limit the number of servers to receive.

Example

use openstack;

let auth = openstack::auth::from_env().expect("Unable to authenticate");
let os = openstack::Cloud::new(auth);
let server_list = os.list_servers().expect("Unable to fetch servers");

Trait Implementations

impl Debug for Cloud
[src]

[src]

Formats the value using the given formatter.

impl Clone for Cloud
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl From<Session> for Cloud
[src]

[src]

Performs the conversion.