isilon/apis/
upgrade_cluster_api.rs

1/*
2 * Isilon SDK
3 *
4 * Isilon SDK - Language bindings for the OneFS API
5 *
6 * OpenAPI spec version: 5
7 * Contact: sdk@isilon.com
8 * Generated by: https://github.com/swagger-api/swagger-codegen.git
9 */
10
11use std::borrow::Borrow;
12use std::rc::Rc;
13
14use futures;
15use futures::Future;
16use hyper;
17
18use super::{configuration, query, Error};
19
20pub struct UpgradeClusterApiClient<C: hyper::client::connect::Connect> {
21    configuration: Rc<configuration::Configuration<C>>,
22}
23
24impl<C: hyper::client::connect::Connect> UpgradeClusterApiClient<C> {
25    pub fn new(configuration: Rc<configuration::Configuration<C>>) -> UpgradeClusterApiClient<C> {
26        UpgradeClusterApiClient {
27            configuration: configuration,
28        }
29    }
30}
31
32pub trait UpgradeClusterApi {
33    fn create_nodes_node_patch_sync_item(
34        &self,
35        nodes_node_patch_sync_item: crate::models::Empty,
36        lnn: i32,
37    ) -> Box<dyn Future<Item = crate::models::Empty, Error = Error>>;
38    fn get_nodes_node_firmware_status(
39        &self,
40        lnn: i32,
41        devices: bool,
42        package: bool,
43    ) -> Box<dyn Future<Item = crate::models::NodesNodeFirmwareStatus, Error = Error>>;
44}
45
46impl<C: hyper::client::connect::Connect + 'static> UpgradeClusterApi
47    for UpgradeClusterApiClient<C>
48{
49    fn create_nodes_node_patch_sync_item(
50        &self,
51        nodes_node_patch_sync_item: crate::models::Empty,
52        lnn: i32,
53    ) -> Box<dyn Future<Item = crate::models::Empty, Error = Error>> {
54        let uri_str = format!(
55            "{}/platform/4/upgrade/cluster/nodes/{Lnn}/patch/sync",
56            self.configuration.base_path,
57            Lnn = lnn
58        );
59        query(
60            self.configuration.borrow(),
61            &uri_str,
62            &nodes_node_patch_sync_item,
63            hyper::Method::POST,
64        )
65    }
66
67    fn get_nodes_node_firmware_status(
68        &self,
69        lnn: i32,
70        devices: bool,
71        package: bool,
72    ) -> Box<dyn Future<Item = crate::models::NodesNodeFirmwareStatus, Error = Error>> {
73        let q = ::url::form_urlencoded::Serializer::new(String::new())
74            .append_pair("devices", &devices.to_string())
75            .append_pair("package", &package.to_string())
76            .finish();
77        let uri_str = format!(
78            "{}/platform/3/upgrade/cluster/nodes/{Lnn}/firmware/status?{}",
79            self.configuration.base_path,
80            q,
81            Lnn = lnn
82        );
83        query(
84            self.configuration.borrow(),
85            &uri_str,
86            &"",
87            hyper::Method::GET,
88        )
89    }
90}