use std::borrow::Borrow;
use std::rc::Rc;
use futures;
use futures::Future;
use hyper;
use super::{configuration, put, query, Error};
pub struct UpgradeApiClient<C: hyper::client::connect::Connect> {
configuration: Rc<configuration::Configuration<C>>,
}
impl<C: hyper::client::connect::Connect> UpgradeApiClient<C> {
pub fn new(configuration: Rc<configuration::Configuration<C>>) -> UpgradeApiClient<C> {
UpgradeApiClient {
configuration: configuration,
}
}
}
pub trait UpgradeApi {
fn create_cluster_add_remaining_node(
&self,
cluster_add_remaining_node: crate::models::Empty,
) -> Box<dyn Future<Item = crate::models::Empty, Error = Error>>;
fn create_cluster_archive_item(
&self,
cluster_archive_item: crate::models::ClusterArchiveItem,
) -> Box<dyn Future<Item = crate::models::Empty, Error = Error>>;
fn create_cluster_assess_item(
&self,
cluster_assess_item: crate::models::ClusterAssessItem,
) -> Box<dyn Future<Item = crate::models::Empty, Error = Error>>;
fn create_cluster_commit_item(
&self,
cluster_commit_item: crate::models::Empty,
) -> Box<dyn Future<Item = crate::models::Empty, Error = Error>>;
fn create_cluster_firmware_assess_item(
&self,
cluster_firmware_assess_item: crate::models::Empty,
) -> Box<dyn Future<Item = crate::models::Empty, Error = Error>>;
fn create_cluster_firmware_upgrade_item(
&self,
cluster_firmware_upgrade_item: crate::models::ClusterFirmwareUpgradeItem,
) -> Box<dyn Future<Item = crate::models::Empty, Error = Error>>;
fn create_cluster_patch_abort_item(
&self,
cluster_patch_abort_item: crate::models::Empty,
) -> Box<dyn Future<Item = crate::models::Empty, Error = Error>>;
fn create_cluster_patch_patch(
&self,
cluster_patch_patch: crate::models::ClusterPatchPatch,
_override: bool,
rolling: bool,
) -> Box<dyn Future<Item = crate::models::CreateResponse, Error = Error>>;
fn create_cluster_retry_last_action_item(
&self,
cluster_retry_last_action_item: crate::models::ClusterRetryLastActionItem,
) -> Box<dyn Future<Item = crate::models::Empty, Error = Error>>;
fn create_cluster_rollback_item(
&self,
cluster_rollback_item: crate::models::Empty,
) -> Box<dyn Future<Item = crate::models::Empty, Error = Error>>;
fn create_cluster_upgrade_item(
&self,
cluster_upgrade_item: crate::models::ClusterUpgradeItem,
) -> Box<dyn Future<Item = crate::models::Empty, Error = Error>>;
fn create_hardware_start_item(
&self,
hardware_start_item: crate::models::HardwareStartItem,
) -> Box<dyn Future<Item = (), Error = Error>>;
fn create_hardware_stop_item(
&self,
hardware_stop_item: crate::models::HardwareStopItem,
) -> Box<dyn Future<Item = (), Error = Error>>;
fn delete_cluster_patch_patch(
&self,
cluster_patch_patch_id: &str,
_override: bool,
rolling: bool,
) -> Box<dyn Future<Item = (), Error = Error>>;
fn get_cluster_firmware_progress(
&self,
) -> Box<dyn Future<Item = crate::models::ClusterFirmwareProgress, Error = Error>>;
fn get_cluster_firmware_status(
&self,
devices: bool,
package: bool,
) -> Box<dyn Future<Item = crate::models::ClusterFirmwareStatus, Error = Error>>;
fn get_cluster_node(
&self,
cluster_node_id: i32,
) -> Box<dyn Future<Item = crate::models::ClusterNodes, Error = Error>>;
fn get_cluster_nodes(
&self,
) -> Box<dyn Future<Item = crate::models::ClusterNodesExtended, Error = Error>>;
fn get_cluster_patch_patch(
&self,
cluster_patch_patch_id: &str,
local: bool,
location: &str,
) -> Box<dyn Future<Item = crate::models::ClusterPatchPatches, Error = Error>>;
fn get_hardware_status(
&self,
) -> Box<dyn Future<Item = crate::models::HardwareStatus, Error = Error>>;
fn get_upgrade_cluster(
&self,
) -> Box<dyn Future<Item = crate::models::UpgradeCluster, Error = Error>>;
fn list_cluster_patch_patches(
&self,
sort: &str,
resume: &str,
limit: i32,
location: &str,
local: bool,
dir: &str,
) -> Box<dyn Future<Item = crate::models::ClusterPatchPatchesExtended, Error = Error>>;
fn update_cluster_upgrade(
&self,
cluster_upgrade: crate::models::ClusterUpgrade,
) -> Box<dyn Future<Item = (), Error = Error>>;
}
impl<C: hyper::client::connect::Connect + 'static> UpgradeApi for UpgradeApiClient<C> {
fn create_cluster_add_remaining_node(
&self,
cluster_add_remaining_node: crate::models::Empty,
) -> Box<dyn Future<Item = crate::models::Empty, Error = Error>> {
let uri_str = format!(
"{}/platform/3/upgrade/cluster/add_remaining_nodes",
self.configuration.base_path
);
query(
self.configuration.borrow(),
&uri_str,
&cluster_add_remaining_node,
hyper::Method::POST,
)
}
fn create_cluster_archive_item(
&self,
cluster_archive_item: crate::models::ClusterArchiveItem,
) -> Box<dyn Future<Item = crate::models::Empty, Error = Error>> {
let uri_str = format!(
"{}/platform/3/upgrade/cluster/archive",
self.configuration.base_path
);
query(
self.configuration.borrow(),
&uri_str,
&cluster_archive_item,
hyper::Method::POST,
)
}
fn create_cluster_assess_item(
&self,
cluster_assess_item: crate::models::ClusterAssessItem,
) -> Box<dyn Future<Item = crate::models::Empty, Error = Error>> {
let uri_str = format!(
"{}/platform/5/upgrade/cluster/assess",
self.configuration.base_path
);
query(
self.configuration.borrow(),
&uri_str,
&cluster_assess_item,
hyper::Method::POST,
)
}
fn create_cluster_commit_item(
&self,
cluster_commit_item: crate::models::Empty,
) -> Box<dyn Future<Item = crate::models::Empty, Error = Error>> {
let uri_str = format!(
"{}/platform/3/upgrade/cluster/commit",
self.configuration.base_path
);
query(
self.configuration.borrow(),
&uri_str,
&cluster_commit_item,
hyper::Method::POST,
)
}
fn create_cluster_firmware_assess_item(
&self,
cluster_firmware_assess_item: crate::models::Empty,
) -> Box<dyn Future<Item = crate::models::Empty, Error = Error>> {
let uri_str = format!(
"{}/platform/3/upgrade/cluster/firmware/assess",
self.configuration.base_path
);
query(
self.configuration.borrow(),
&uri_str,
&cluster_firmware_assess_item,
hyper::Method::POST,
)
}
fn create_cluster_firmware_upgrade_item(
&self,
cluster_firmware_upgrade_item: crate::models::ClusterFirmwareUpgradeItem,
) -> Box<dyn Future<Item = crate::models::Empty, Error = Error>> {
let uri_str = format!(
"{}/platform/3/upgrade/cluster/firmware/upgrade",
self.configuration.base_path
);
query(
self.configuration.borrow(),
&uri_str,
&cluster_firmware_upgrade_item,
hyper::Method::POST,
)
}
fn create_cluster_patch_abort_item(
&self,
cluster_patch_abort_item: crate::models::Empty,
) -> Box<dyn Future<Item = crate::models::Empty, Error = Error>> {
let uri_str = format!(
"{}/platform/3/upgrade/cluster/patch/abort",
self.configuration.base_path
);
query(
self.configuration.borrow(),
&uri_str,
&cluster_patch_abort_item,
hyper::Method::POST,
)
}
fn create_cluster_patch_patch(
&self,
cluster_patch_patch: crate::models::ClusterPatchPatch,
_override: bool,
rolling: bool,
) -> Box<dyn Future<Item = crate::models::CreateResponse, Error = Error>> {
let q = ::url::form_urlencoded::Serializer::new(String::new())
.append_pair("override", &_override.to_string())
.append_pair("rolling", &rolling.to_string())
.finish();
let uri_str = format!(
"{}/platform/3/upgrade/cluster/patch/patches?{}",
self.configuration.base_path, q
);
query(
self.configuration.borrow(),
&uri_str,
&cluster_patch_patch,
hyper::Method::POST,
)
}
fn create_cluster_retry_last_action_item(
&self,
cluster_retry_last_action_item: crate::models::ClusterRetryLastActionItem,
) -> Box<dyn Future<Item = crate::models::Empty, Error = Error>> {
let uri_str = format!(
"{}/platform/3/upgrade/cluster/retry_last_action",
self.configuration.base_path
);
query(
self.configuration.borrow(),
&uri_str,
&cluster_retry_last_action_item,
hyper::Method::POST,
)
}
fn create_cluster_rollback_item(
&self,
cluster_rollback_item: crate::models::Empty,
) -> Box<dyn Future<Item = crate::models::Empty, Error = Error>> {
let uri_str = format!(
"{}/platform/3/upgrade/cluster/rollback",
self.configuration.base_path
);
query(
self.configuration.borrow(),
&uri_str,
&cluster_rollback_item,
hyper::Method::POST,
)
}
fn create_cluster_upgrade_item(
&self,
cluster_upgrade_item: crate::models::ClusterUpgradeItem,
) -> Box<dyn Future<Item = crate::models::Empty, Error = Error>> {
let uri_str = format!(
"{}/platform/5/upgrade/cluster/upgrade",
self.configuration.base_path
);
query(
self.configuration.borrow(),
&uri_str,
&cluster_upgrade_item,
hyper::Method::POST,
)
}
fn create_hardware_start_item(
&self,
hardware_start_item: crate::models::HardwareStartItem,
) -> Box<dyn Future<Item = (), Error = Error>> {
let uri_str = format!(
"{}/platform/5/upgrade/hardware/start",
self.configuration.base_path
);
query(
self.configuration.borrow(),
&uri_str,
&hardware_start_item,
hyper::Method::POST,
)
}
fn create_hardware_stop_item(
&self,
hardware_stop_item: crate::models::HardwareStopItem,
) -> Box<dyn Future<Item = (), Error = Error>> {
let uri_str = format!(
"{}/platform/5/upgrade/hardware/stop",
self.configuration.base_path
);
query(
self.configuration.borrow(),
&uri_str,
&hardware_stop_item,
hyper::Method::POST,
)
}
fn delete_cluster_patch_patch(
&self,
cluster_patch_patch_id: &str,
_override: bool,
rolling: bool,
) -> Box<dyn Future<Item = (), Error = Error>> {
let q = ::url::form_urlencoded::Serializer::new(String::new())
.append_pair("override", &_override.to_string())
.append_pair("rolling", &rolling.to_string())
.finish();
let uri_str = format!(
"{}/platform/3/upgrade/cluster/patch/patches/{ClusterPatchPatchId}?{}",
self.configuration.base_path,
q,
ClusterPatchPatchId = cluster_patch_patch_id
);
query(
self.configuration.borrow(),
&uri_str,
&"",
hyper::Method::DELETE,
)
}
fn get_cluster_firmware_progress(
&self,
) -> Box<dyn Future<Item = crate::models::ClusterFirmwareProgress, Error = Error>> {
let uri_str = format!(
"{}/platform/3/upgrade/cluster/firmware/progress",
self.configuration.base_path
);
query(
self.configuration.borrow(),
&uri_str,
&"",
hyper::Method::GET,
)
}
fn get_cluster_firmware_status(
&self,
devices: bool,
package: bool,
) -> Box<dyn Future<Item = crate::models::ClusterFirmwareStatus, Error = Error>> {
let q = ::url::form_urlencoded::Serializer::new(String::new())
.append_pair("devices", &devices.to_string())
.append_pair("package", &package.to_string())
.finish();
let uri_str = format!(
"{}/platform/3/upgrade/cluster/firmware/status?{}",
self.configuration.base_path, q
);
query(
self.configuration.borrow(),
&uri_str,
&"",
hyper::Method::GET,
)
}
fn get_cluster_node(
&self,
cluster_node_id: i32,
) -> Box<dyn Future<Item = crate::models::ClusterNodes, Error = Error>> {
let uri_str = format!(
"{}/platform/3/upgrade/cluster/nodes/{ClusterNodeId}",
self.configuration.base_path,
ClusterNodeId = cluster_node_id
);
query(
self.configuration.borrow(),
&uri_str,
&"",
hyper::Method::GET,
)
}
fn get_cluster_nodes(
&self,
) -> Box<dyn Future<Item = crate::models::ClusterNodesExtended, Error = Error>> {
let uri_str = format!(
"{}/platform/3/upgrade/cluster/nodes",
self.configuration.base_path
);
query(
self.configuration.borrow(),
&uri_str,
&"",
hyper::Method::GET,
)
}
fn get_cluster_patch_patch(
&self,
cluster_patch_patch_id: &str,
local: bool,
location: &str,
) -> Box<dyn Future<Item = crate::models::ClusterPatchPatches, Error = Error>> {
let q = ::url::form_urlencoded::Serializer::new(String::new())
.append_pair("local", &local.to_string())
.append_pair("location", &location.to_string())
.finish();
let uri_str = format!(
"{}/platform/3/upgrade/cluster/patch/patches/{ClusterPatchPatchId}?{}",
self.configuration.base_path,
q,
ClusterPatchPatchId = cluster_patch_patch_id
);
query(
self.configuration.borrow(),
&uri_str,
&"",
hyper::Method::GET,
)
}
fn get_hardware_status(
&self,
) -> Box<dyn Future<Item = crate::models::HardwareStatus, Error = Error>> {
let uri_str = format!(
"{}/platform/5/upgrade/hardware/status",
self.configuration.base_path
);
query(
self.configuration.borrow(),
&uri_str,
&"",
hyper::Method::GET,
)
}
fn get_upgrade_cluster(
&self,
) -> Box<dyn Future<Item = crate::models::UpgradeCluster, Error = Error>> {
let uri_str = format!(
"{}/platform/4/upgrade/cluster",
self.configuration.base_path
);
query(
self.configuration.borrow(),
&uri_str,
&"",
hyper::Method::GET,
)
}
fn list_cluster_patch_patches(
&self,
sort: &str,
resume: &str,
limit: i32,
location: &str,
local: bool,
dir: &str,
) -> Box<dyn Future<Item = crate::models::ClusterPatchPatchesExtended, Error = Error>> {
let q = ::url::form_urlencoded::Serializer::new(String::new())
.append_pair("sort", &sort.to_string())
.append_pair("resume", &resume.to_string())
.append_pair("limit", &limit.to_string())
.append_pair("location", &location.to_string())
.append_pair("local", &local.to_string())
.append_pair("dir", &dir.to_string())
.finish();
let uri_str = format!(
"{}/platform/3/upgrade/cluster/patch/patches?{}",
self.configuration.base_path, q
);
query(
self.configuration.borrow(),
&uri_str,
&"",
hyper::Method::GET,
)
}
fn update_cluster_upgrade(
&self,
cluster_upgrade: crate::models::ClusterUpgrade,
) -> Box<dyn Future<Item = (), Error = Error>> {
let uri_str = format!(
"{}/platform/5/upgrade/cluster/upgrade",
self.configuration.base_path
);
put(self.configuration.borrow(), &uri_str, &cluster_upgrade)
}
}