use std::borrow::Borrow;
#[allow(unused_imports)]
use std::option::Option;
use std::pin::Pin;
use std::rc::Rc;
use futures::Future;
use hyper;
use hyper_util::client::legacy::connect::Connect;
use super::request as __internal_request;
use super::{configuration, Error};
use crate::models;
pub struct ContainersApiClient<C: Connect>
where
C: Clone + std::marker::Send + Sync + 'static,
{
configuration: Rc<configuration::Configuration<C>>,
}
impl<C: Connect> ContainersApiClient<C>
where
C: Clone + std::marker::Send + Sync,
{
pub fn new(configuration: Rc<configuration::Configuration<C>>) -> ContainersApiClient<C> {
ContainersApiClient { configuration }
}
}
pub trait ContainersApi {
fn container_attach_libpod(
&self,
name: &str,
detach_keys: Option<&str>,
logs: Option<bool>,
stream: Option<bool>,
stdout: Option<bool>,
stderr: Option<bool>,
stdin: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>;
fn container_changes_libpod(
&self,
name: &str,
parent: Option<&str>,
diff_type: Option<&str>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>;
fn container_checkpoint_libpod(
&self,
name: &str,
keep: Option<bool>,
leave_running: Option<bool>,
tcp_established: Option<bool>,
export: Option<bool>,
ignore_root_fs: Option<bool>,
ignore_volumes: Option<bool>,
pre_checkpoint: Option<bool>,
with_previous: Option<bool>,
file_locks: Option<bool>,
print_stats: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>;
fn container_create_libpod(
&self,
create: models::SpecGenerator,
) -> Pin<Box<dyn Future<Output = Result<models::ContainerCreateResponse, Error>>>>;
fn container_delete_libpod(
&self,
name: &str,
depend: Option<bool>,
force: Option<bool>,
ignore: Option<bool>,
timeout: Option<i32>,
v: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<Vec<models::LibpodContainersRmReport>, Error>>>>;
fn container_exists_libpod(
&self,
name: &str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>;
fn container_export_libpod(
&self,
name: &str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>;
fn container_healthcheck_libpod(
&self,
name: &str,
) -> Pin<Box<dyn Future<Output = Result<models::HealthCheckResults, Error>>>>;
fn container_init_libpod(&self, name: &str)
-> Pin<Box<dyn Future<Output = Result<(), Error>>>>;
fn container_inspect_libpod(
&self,
name: &str,
size: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<models::InspectContainerData, Error>>>>;
fn container_kill_libpod(
&self,
name: &str,
signal: Option<&str>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>;
fn container_list_libpod(
&self,
all: Option<bool>,
limit: Option<i32>,
namespace: Option<bool>,
pod: Option<bool>,
size: Option<bool>,
sync: Option<bool>,
filters: Option<&str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<models::ListContainer>, Error>>>>;
fn container_logs_libpod(
&self,
name: &str,
follow: Option<bool>,
stdout: Option<bool>,
stderr: Option<bool>,
since: Option<&str>,
until: Option<&str>,
timestamps: Option<bool>,
tail: Option<&str>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>;
fn container_mount_libpod(
&self,
name: &str,
) -> Pin<Box<dyn Future<Output = Result<String, Error>>>>;
fn container_pause_libpod(
&self,
name: &str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>;
fn container_prune_libpod(
&self,
filters: Option<&str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<models::ContainersPruneReportLibpod>, Error>>>>;
fn container_rename_libpod(
&self,
name: &str,
name2: &str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>;
fn container_resize_libpod(
&self,
name: &str,
h: Option<i32>,
w: Option<i32>,
) -> Pin<Box<dyn Future<Output = Result<serde_json::Value, Error>>>>;
fn container_restart_libpod(
&self,
name: &str,
t: Option<i32>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>;
fn container_restore_libpod(
&self,
name: &str,
name2: Option<&str>,
keep: Option<bool>,
tcp_established: Option<bool>,
import: Option<bool>,
ignore_root_fs: Option<bool>,
ignore_volumes: Option<bool>,
ignore_static_ip: Option<bool>,
ignore_static_mac: Option<bool>,
file_locks: Option<bool>,
print_stats: Option<bool>,
pod: Option<&str>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>;
fn container_show_mounted_libpod(
&self,
) -> Pin<Box<dyn Future<Output = Result<std::collections::HashMap<String, String>, Error>>>>;
fn container_start_libpod(
&self,
name: &str,
detach_keys: Option<&str>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>;
fn container_stats_libpod(
&self,
name: &str,
stream: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>;
fn container_stop_libpod(
&self,
name: &str,
timeout: Option<i32>,
ignore: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>;
fn container_top_libpod(
&self,
name: &str,
stream: Option<bool>,
delay: Option<i32>,
ps_args: Option<Vec<String>>,
) -> Pin<Box<dyn Future<Output = Result<models::ContainerTopOkBody, Error>>>>;
fn container_unmount_libpod(
&self,
name: &str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>;
fn container_unpause_libpod(
&self,
name: &str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>;
fn container_update_libpod(
&self,
name: &str,
restart_policy: Option<&str>,
restart_retries: Option<i32>,
config: Option<models::UpdateEntities>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>;
fn container_wait_libpod(
&self,
name: &str,
condition: Option<Vec<String>>,
interval: Option<&str>,
) -> Pin<Box<dyn Future<Output = Result<i32, Error>>>>;
fn containers_stats_all_libpod(
&self,
containers: Option<Vec<String>>,
stream: Option<bool>,
interval: Option<i32>,
) -> Pin<Box<dyn Future<Output = Result<models::ContainerStats, Error>>>>;
fn generate_kube_libpod(
&self,
names: Vec<String>,
service: Option<bool>,
r#type: Option<&str>,
replicas: Option<i32>,
no_trunc: Option<bool>,
podman_only: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<std::path::PathBuf, Error>>>>;
fn generate_systemd_libpod(
&self,
name: &str,
use_name: Option<bool>,
new: Option<bool>,
no_header: Option<bool>,
start_timeout: Option<i32>,
stop_timeout: Option<i32>,
restart_policy: Option<&str>,
container_prefix: Option<&str>,
pod_prefix: Option<&str>,
separator: Option<&str>,
restart_sec: Option<i32>,
wants: Option<Vec<String>>,
after: Option<Vec<String>>,
requires: Option<Vec<String>>,
additional_env_variables: Option<Vec<String>>,
) -> Pin<Box<dyn Future<Output = Result<std::collections::HashMap<String, String>, Error>>>>;
fn image_commit_libpod(
&self,
container: &str,
author: Option<&str>,
changes: Option<Vec<String>>,
comment: Option<&str>,
format: Option<&str>,
pause: Option<bool>,
squash: Option<bool>,
repo: Option<&str>,
stream: Option<bool>,
tag: Option<&str>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>;
fn kube_apply_libpod(
&self,
ca_cert_file: Option<&str>,
kube_config: Option<&str>,
namespace: Option<&str>,
service: Option<bool>,
file: Option<&str>,
request: Option<&str>,
) -> Pin<Box<dyn Future<Output = Result<std::path::PathBuf, Error>>>>;
fn play_kube_down_libpod(
&self,
force: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<models::PlayKubeReport, Error>>>>;
fn play_kube_libpod(
&self,
annotations: Option<&str>,
log_driver: Option<&str>,
log_options: Option<Vec<String>>,
network: Option<Vec<String>>,
no_hosts: Option<bool>,
no_trunc: Option<bool>,
publish_ports: Option<Vec<String>>,
publish_all_ports: Option<bool>,
replace: Option<bool>,
service_container: Option<bool>,
start: Option<bool>,
static_ips: Option<Vec<String>>,
static_macs: Option<Vec<String>>,
tls_verify: Option<bool>,
userns: Option<&str>,
wait: Option<bool>,
request: Option<&str>,
) -> Pin<Box<dyn Future<Output = Result<models::PlayKubeReport, Error>>>>;
fn put_container_archive_libpod(
&self,
name: &str,
path: &str,
pause: Option<bool>,
request: Option<&str>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>;
}
impl<C: Connect> ContainersApi for ContainersApiClient<C>
where
C: Clone + std::marker::Send + Sync,
{
#[allow(unused_mut)]
fn container_attach_libpod(
&self,
name: &str,
detach_keys: Option<&str>,
logs: Option<bool>,
stream: Option<bool>,
stdout: Option<bool>,
stderr: Option<bool>,
stdin: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>>>> {
let mut req = __internal_request::Request::new(
hyper::Method::POST,
"/libpod/containers/{name}/attach".to_string(),
);
if let Some(ref s) = detach_keys {
let query_value = s.to_string();
req = req.with_query_param("detachKeys".to_string(), query_value);
}
if let Some(ref s) = logs {
let query_value = s.to_string();
req = req.with_query_param("logs".to_string(), query_value);
}
if let Some(ref s) = stream {
let query_value = s.to_string();
req = req.with_query_param("stream".to_string(), query_value);
}
if let Some(ref s) = stdout {
let query_value = s.to_string();
req = req.with_query_param("stdout".to_string(), query_value);
}
if let Some(ref s) = stderr {
let query_value = s.to_string();
req = req.with_query_param("stderr".to_string(), query_value);
}
if let Some(ref s) = stdin {
let query_value = s.to_string();
req = req.with_query_param("stdin".to_string(), query_value);
}
req = req.with_path_param("name".to_string(), name.to_string());
req = req.returns_nothing();
req.execute(self.configuration.borrow())
}
#[allow(unused_mut)]
fn container_changes_libpod(
&self,
name: &str,
parent: Option<&str>,
diff_type: Option<&str>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>>>> {
let mut req = __internal_request::Request::new(
hyper::Method::GET,
"/libpod/containers/{name}/changes".to_string(),
);
if let Some(ref s) = parent {
let query_value = s.to_string();
req = req.with_query_param("parent".to_string(), query_value);
}
if let Some(ref s) = diff_type {
let query_value = s.to_string();
req = req.with_query_param("diffType".to_string(), query_value);
}
req = req.with_path_param("name".to_string(), name.to_string());
req = req.returns_nothing();
req.execute(self.configuration.borrow())
}
#[allow(unused_mut)]
fn container_checkpoint_libpod(
&self,
name: &str,
keep: Option<bool>,
leave_running: Option<bool>,
tcp_established: Option<bool>,
export: Option<bool>,
ignore_root_fs: Option<bool>,
ignore_volumes: Option<bool>,
pre_checkpoint: Option<bool>,
with_previous: Option<bool>,
file_locks: Option<bool>,
print_stats: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>>>> {
let mut req = __internal_request::Request::new(
hyper::Method::POST,
"/libpod/containers/{name}/checkpoint".to_string(),
);
if let Some(ref s) = keep {
let query_value = s.to_string();
req = req.with_query_param("keep".to_string(), query_value);
}
if let Some(ref s) = leave_running {
let query_value = s.to_string();
req = req.with_query_param("leaveRunning".to_string(), query_value);
}
if let Some(ref s) = tcp_established {
let query_value = s.to_string();
req = req.with_query_param("tcpEstablished".to_string(), query_value);
}
if let Some(ref s) = export {
let query_value = s.to_string();
req = req.with_query_param("export".to_string(), query_value);
}
if let Some(ref s) = ignore_root_fs {
let query_value = s.to_string();
req = req.with_query_param("ignoreRootFS".to_string(), query_value);
}
if let Some(ref s) = ignore_volumes {
let query_value = s.to_string();
req = req.with_query_param("ignoreVolumes".to_string(), query_value);
}
if let Some(ref s) = pre_checkpoint {
let query_value = s.to_string();
req = req.with_query_param("preCheckpoint".to_string(), query_value);
}
if let Some(ref s) = with_previous {
let query_value = s.to_string();
req = req.with_query_param("withPrevious".to_string(), query_value);
}
if let Some(ref s) = file_locks {
let query_value = s.to_string();
req = req.with_query_param("fileLocks".to_string(), query_value);
}
if let Some(ref s) = print_stats {
let query_value = s.to_string();
req = req.with_query_param("printStats".to_string(), query_value);
}
req = req.with_path_param("name".to_string(), name.to_string());
req = req.returns_nothing();
req.execute(self.configuration.borrow())
}
#[allow(unused_mut)]
fn container_create_libpod(
&self,
create: models::SpecGenerator,
) -> Pin<Box<dyn Future<Output = Result<models::ContainerCreateResponse, Error>>>> {
let mut req = __internal_request::Request::new(
hyper::Method::POST,
"/libpod/containers/create".to_string(),
);
req = req.with_body_param(create);
req.execute(self.configuration.borrow())
}
#[allow(unused_mut)]
fn container_delete_libpod(
&self,
name: &str,
depend: Option<bool>,
force: Option<bool>,
ignore: Option<bool>,
timeout: Option<i32>,
v: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<Vec<models::LibpodContainersRmReport>, Error>>>> {
let mut req = __internal_request::Request::new(
hyper::Method::DELETE,
"/libpod/containers/{name}".to_string(),
);
if let Some(ref s) = depend {
let query_value = s.to_string();
req = req.with_query_param("depend".to_string(), query_value);
}
if let Some(ref s) = force {
let query_value = s.to_string();
req = req.with_query_param("force".to_string(), query_value);
}
if let Some(ref s) = ignore {
let query_value = s.to_string();
req = req.with_query_param("ignore".to_string(), query_value);
}
if let Some(ref s) = timeout {
let query_value = s.to_string();
req = req.with_query_param("timeout".to_string(), query_value);
}
if let Some(ref s) = v {
let query_value = s.to_string();
req = req.with_query_param("v".to_string(), query_value);
}
req = req.with_path_param("name".to_string(), name.to_string());
req.execute(self.configuration.borrow())
}
#[allow(unused_mut)]
fn container_exists_libpod(
&self,
name: &str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>>>> {
let mut req = __internal_request::Request::new(
hyper::Method::GET,
"/libpod/containers/{name}/exists".to_string(),
);
req = req.with_path_param("name".to_string(), name.to_string());
req = req.returns_nothing();
req.execute(self.configuration.borrow())
}
#[allow(unused_mut)]
fn container_export_libpod(
&self,
name: &str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>>>> {
let mut req = __internal_request::Request::new(
hyper::Method::GET,
"/libpod/containers/{name}/export".to_string(),
);
req = req.with_path_param("name".to_string(), name.to_string());
req = req.returns_nothing();
req.execute(self.configuration.borrow())
}
#[allow(unused_mut)]
fn container_healthcheck_libpod(
&self,
name: &str,
) -> Pin<Box<dyn Future<Output = Result<models::HealthCheckResults, Error>>>> {
let mut req = __internal_request::Request::new(
hyper::Method::GET,
"/libpod/containers/{name}/healthcheck".to_string(),
);
req = req.with_path_param("name".to_string(), name.to_string());
req.execute(self.configuration.borrow())
}
#[allow(unused_mut)]
fn container_init_libpod(
&self,
name: &str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>>>> {
let mut req = __internal_request::Request::new(
hyper::Method::POST,
"/libpod/containers/{name}/init".to_string(),
);
req = req.with_path_param("name".to_string(), name.to_string());
req = req.returns_nothing();
req.execute(self.configuration.borrow())
}
#[allow(unused_mut)]
fn container_inspect_libpod(
&self,
name: &str,
size: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<models::InspectContainerData, Error>>>> {
let mut req = __internal_request::Request::new(
hyper::Method::GET,
"/libpod/containers/{name}/json".to_string(),
);
if let Some(ref s) = size {
let query_value = s.to_string();
req = req.with_query_param("size".to_string(), query_value);
}
req = req.with_path_param("name".to_string(), name.to_string());
req.execute(self.configuration.borrow())
}
#[allow(unused_mut)]
fn container_kill_libpod(
&self,
name: &str,
signal: Option<&str>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>>>> {
let mut req = __internal_request::Request::new(
hyper::Method::POST,
"/libpod/containers/{name}/kill".to_string(),
);
if let Some(ref s) = signal {
let query_value = s.to_string();
req = req.with_query_param("signal".to_string(), query_value);
}
req = req.with_path_param("name".to_string(), name.to_string());
req = req.returns_nothing();
req.execute(self.configuration.borrow())
}
#[allow(unused_mut)]
fn container_list_libpod(
&self,
all: Option<bool>,
limit: Option<i32>,
namespace: Option<bool>,
pod: Option<bool>,
size: Option<bool>,
sync: Option<bool>,
filters: Option<&str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<models::ListContainer>, Error>>>> {
let mut req = __internal_request::Request::new(
hyper::Method::GET,
"/libpod/containers/json".to_string(),
);
if let Some(ref s) = all {
let query_value = s.to_string();
req = req.with_query_param("all".to_string(), query_value);
}
if let Some(ref s) = limit {
let query_value = s.to_string();
req = req.with_query_param("limit".to_string(), query_value);
}
if let Some(ref s) = namespace {
let query_value = s.to_string();
req = req.with_query_param("namespace".to_string(), query_value);
}
if let Some(ref s) = pod {
let query_value = s.to_string();
req = req.with_query_param("pod".to_string(), query_value);
}
if let Some(ref s) = size {
let query_value = s.to_string();
req = req.with_query_param("size".to_string(), query_value);
}
if let Some(ref s) = sync {
let query_value = s.to_string();
req = req.with_query_param("sync".to_string(), query_value);
}
if let Some(ref s) = filters {
let query_value = s.to_string();
req = req.with_query_param("filters".to_string(), query_value);
}
req.execute(self.configuration.borrow())
}
#[allow(unused_mut)]
fn container_logs_libpod(
&self,
name: &str,
follow: Option<bool>,
stdout: Option<bool>,
stderr: Option<bool>,
since: Option<&str>,
until: Option<&str>,
timestamps: Option<bool>,
tail: Option<&str>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>>>> {
let mut req = __internal_request::Request::new(
hyper::Method::GET,
"/libpod/containers/{name}/logs".to_string(),
);
if let Some(ref s) = follow {
let query_value = s.to_string();
req = req.with_query_param("follow".to_string(), query_value);
}
if let Some(ref s) = stdout {
let query_value = s.to_string();
req = req.with_query_param("stdout".to_string(), query_value);
}
if let Some(ref s) = stderr {
let query_value = s.to_string();
req = req.with_query_param("stderr".to_string(), query_value);
}
if let Some(ref s) = since {
let query_value = s.to_string();
req = req.with_query_param("since".to_string(), query_value);
}
if let Some(ref s) = until {
let query_value = s.to_string();
req = req.with_query_param("until".to_string(), query_value);
}
if let Some(ref s) = timestamps {
let query_value = s.to_string();
req = req.with_query_param("timestamps".to_string(), query_value);
}
if let Some(ref s) = tail {
let query_value = s.to_string();
req = req.with_query_param("tail".to_string(), query_value);
}
req = req.with_path_param("name".to_string(), name.to_string());
req = req.returns_nothing();
req.execute(self.configuration.borrow())
}
#[allow(unused_mut)]
fn container_mount_libpod(
&self,
name: &str,
) -> Pin<Box<dyn Future<Output = Result<String, Error>>>> {
let mut req = __internal_request::Request::new(
hyper::Method::POST,
"/libpod/containers/{name}/mount".to_string(),
);
req = req.with_path_param("name".to_string(), name.to_string());
req.execute(self.configuration.borrow())
}
#[allow(unused_mut)]
fn container_pause_libpod(
&self,
name: &str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>>>> {
let mut req = __internal_request::Request::new(
hyper::Method::POST,
"/libpod/containers/{name}/pause".to_string(),
);
req = req.with_path_param("name".to_string(), name.to_string());
req = req.returns_nothing();
req.execute(self.configuration.borrow())
}
#[allow(unused_mut)]
fn container_prune_libpod(
&self,
filters: Option<&str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<models::ContainersPruneReportLibpod>, Error>>>>
{
let mut req = __internal_request::Request::new(
hyper::Method::POST,
"/libpod/containers/prune".to_string(),
);
if let Some(ref s) = filters {
let query_value = s.to_string();
req = req.with_query_param("filters".to_string(), query_value);
}
req.execute(self.configuration.borrow())
}
#[allow(unused_mut)]
fn container_rename_libpod(
&self,
name: &str,
name2: &str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>>>> {
let mut req = __internal_request::Request::new(
hyper::Method::POST,
"/libpod/containers/{name}/rename".to_string(),
);
req = req.with_query_param("name".to_string(), name2.to_string());
req = req.with_path_param("name".to_string(), name.to_string());
req = req.returns_nothing();
req.execute(self.configuration.borrow())
}
#[allow(unused_mut)]
fn container_resize_libpod(
&self,
name: &str,
h: Option<i32>,
w: Option<i32>,
) -> Pin<Box<dyn Future<Output = Result<serde_json::Value, Error>>>> {
let mut req = __internal_request::Request::new(
hyper::Method::POST,
"/libpod/containers/{name}/resize".to_string(),
);
if let Some(ref s) = h {
let query_value = s.to_string();
req = req.with_query_param("h".to_string(), query_value);
}
if let Some(ref s) = w {
let query_value = s.to_string();
req = req.with_query_param("w".to_string(), query_value);
}
req = req.with_path_param("name".to_string(), name.to_string());
req.execute(self.configuration.borrow())
}
#[allow(unused_mut)]
fn container_restart_libpod(
&self,
name: &str,
t: Option<i32>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>>>> {
let mut req = __internal_request::Request::new(
hyper::Method::POST,
"/libpod/containers/{name}/restart".to_string(),
);
if let Some(ref s) = t {
let query_value = s.to_string();
req = req.with_query_param("t".to_string(), query_value);
}
req = req.with_path_param("name".to_string(), name.to_string());
req = req.returns_nothing();
req.execute(self.configuration.borrow())
}
#[allow(unused_mut)]
fn container_restore_libpod(
&self,
name: &str,
name2: Option<&str>,
keep: Option<bool>,
tcp_established: Option<bool>,
import: Option<bool>,
ignore_root_fs: Option<bool>,
ignore_volumes: Option<bool>,
ignore_static_ip: Option<bool>,
ignore_static_mac: Option<bool>,
file_locks: Option<bool>,
print_stats: Option<bool>,
pod: Option<&str>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>>>> {
let mut req = __internal_request::Request::new(
hyper::Method::POST,
"/libpod/containers/{name}/restore".to_string(),
);
if let Some(ref s) = name2 {
let query_value = s.to_string();
req = req.with_query_param("name".to_string(), query_value);
}
if let Some(ref s) = keep {
let query_value = s.to_string();
req = req.with_query_param("keep".to_string(), query_value);
}
if let Some(ref s) = tcp_established {
let query_value = s.to_string();
req = req.with_query_param("tcpEstablished".to_string(), query_value);
}
if let Some(ref s) = import {
let query_value = s.to_string();
req = req.with_query_param("import".to_string(), query_value);
}
if let Some(ref s) = ignore_root_fs {
let query_value = s.to_string();
req = req.with_query_param("ignoreRootFS".to_string(), query_value);
}
if let Some(ref s) = ignore_volumes {
let query_value = s.to_string();
req = req.with_query_param("ignoreVolumes".to_string(), query_value);
}
if let Some(ref s) = ignore_static_ip {
let query_value = s.to_string();
req = req.with_query_param("ignoreStaticIP".to_string(), query_value);
}
if let Some(ref s) = ignore_static_mac {
let query_value = s.to_string();
req = req.with_query_param("ignoreStaticMAC".to_string(), query_value);
}
if let Some(ref s) = file_locks {
let query_value = s.to_string();
req = req.with_query_param("fileLocks".to_string(), query_value);
}
if let Some(ref s) = print_stats {
let query_value = s.to_string();
req = req.with_query_param("printStats".to_string(), query_value);
}
if let Some(ref s) = pod {
let query_value = s.to_string();
req = req.with_query_param("pod".to_string(), query_value);
}
req = req.with_path_param("name".to_string(), name.to_string());
req = req.returns_nothing();
req.execute(self.configuration.borrow())
}
#[allow(unused_mut)]
fn container_show_mounted_libpod(
&self,
) -> Pin<Box<dyn Future<Output = Result<std::collections::HashMap<String, String>, Error>>>>
{
let mut req = __internal_request::Request::new(
hyper::Method::GET,
"/libpod/containers/showmounted".to_string(),
);
req.execute(self.configuration.borrow())
}
#[allow(unused_mut)]
fn container_start_libpod(
&self,
name: &str,
detach_keys: Option<&str>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>>>> {
let mut req = __internal_request::Request::new(
hyper::Method::POST,
"/libpod/containers/{name}/start".to_string(),
);
if let Some(ref s) = detach_keys {
let query_value = s.to_string();
req = req.with_query_param("detachKeys".to_string(), query_value);
}
req = req.with_path_param("name".to_string(), name.to_string());
req = req.returns_nothing();
req.execute(self.configuration.borrow())
}
#[allow(unused_mut)]
fn container_stats_libpod(
&self,
name: &str,
stream: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>>>> {
let mut req = __internal_request::Request::new(
hyper::Method::GET,
"/libpod/containers/{name}/stats".to_string(),
);
if let Some(ref s) = stream {
let query_value = s.to_string();
req = req.with_query_param("stream".to_string(), query_value);
}
req = req.with_path_param("name".to_string(), name.to_string());
req = req.returns_nothing();
req.execute(self.configuration.borrow())
}
#[allow(unused_mut)]
fn container_stop_libpod(
&self,
name: &str,
timeout: Option<i32>,
ignore: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>>>> {
let mut req = __internal_request::Request::new(
hyper::Method::POST,
"/libpod/containers/{name}/stop".to_string(),
);
if let Some(ref s) = timeout {
let query_value = s.to_string();
req = req.with_query_param("timeout".to_string(), query_value);
}
if let Some(ref s) = ignore {
let query_value = s.to_string();
req = req.with_query_param("Ignore".to_string(), query_value);
}
req = req.with_path_param("name".to_string(), name.to_string());
req = req.returns_nothing();
req.execute(self.configuration.borrow())
}
#[allow(unused_mut)]
fn container_top_libpod(
&self,
name: &str,
stream: Option<bool>,
delay: Option<i32>,
ps_args: Option<Vec<String>>,
) -> Pin<Box<dyn Future<Output = Result<models::ContainerTopOkBody, Error>>>> {
let mut req = __internal_request::Request::new(
hyper::Method::GET,
"/libpod/containers/{name}/top".to_string(),
);
if let Some(ref s) = stream {
let query_value = s.to_string();
req = req.with_query_param("stream".to_string(), query_value);
}
if let Some(ref s) = delay {
let query_value = s.to_string();
req = req.with_query_param("delay".to_string(), query_value);
}
if let Some(ref s) = ps_args {
let query_value = s
.iter()
.map(|s| s.to_string())
.collect::<Vec<String>>()
.join(",");
req = req.with_query_param("ps_args".to_string(), query_value);
}
req = req.with_path_param("name".to_string(), name.to_string());
req.execute(self.configuration.borrow())
}
#[allow(unused_mut)]
fn container_unmount_libpod(
&self,
name: &str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>>>> {
let mut req = __internal_request::Request::new(
hyper::Method::POST,
"/libpod/containers/{name}/unmount".to_string(),
);
req = req.with_path_param("name".to_string(), name.to_string());
req = req.returns_nothing();
req.execute(self.configuration.borrow())
}
#[allow(unused_mut)]
fn container_unpause_libpod(
&self,
name: &str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>>>> {
let mut req = __internal_request::Request::new(
hyper::Method::POST,
"/libpod/containers/{name}/unpause".to_string(),
);
req = req.with_path_param("name".to_string(), name.to_string());
req = req.returns_nothing();
req.execute(self.configuration.borrow())
}
#[allow(unused_mut)]
fn container_update_libpod(
&self,
name: &str,
restart_policy: Option<&str>,
restart_retries: Option<i32>,
config: Option<models::UpdateEntities>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>>>> {
let mut req = __internal_request::Request::new(
hyper::Method::POST,
"/libpod/containers/{name}/update".to_string(),
);
if let Some(ref s) = restart_policy {
let query_value = s.to_string();
req = req.with_query_param("restartPolicy".to_string(), query_value);
}
if let Some(ref s) = restart_retries {
let query_value = s.to_string();
req = req.with_query_param("restartRetries".to_string(), query_value);
}
req = req.with_path_param("name".to_string(), name.to_string());
req = req.with_body_param(config);
req = req.returns_nothing();
req.execute(self.configuration.borrow())
}
#[allow(unused_mut)]
fn container_wait_libpod(
&self,
name: &str,
condition: Option<Vec<String>>,
interval: Option<&str>,
) -> Pin<Box<dyn Future<Output = Result<i32, Error>>>> {
let mut req = __internal_request::Request::new(
hyper::Method::POST,
"/libpod/containers/{name}/wait".to_string(),
);
if let Some(ref s) = condition {
let query_value = s
.iter()
.map(|s| s.to_string())
.collect::<Vec<String>>()
.join(",");
req = req.with_query_param("condition".to_string(), query_value);
}
if let Some(ref s) = interval {
let query_value = s.to_string();
req = req.with_query_param("interval".to_string(), query_value);
}
req = req.with_path_param("name".to_string(), name.to_string());
req.execute(self.configuration.borrow())
}
#[allow(unused_mut)]
fn containers_stats_all_libpod(
&self,
containers: Option<Vec<String>>,
stream: Option<bool>,
interval: Option<i32>,
) -> Pin<Box<dyn Future<Output = Result<models::ContainerStats, Error>>>> {
let mut req = __internal_request::Request::new(
hyper::Method::GET,
"/libpod/containers/stats".to_string(),
);
if let Some(ref s) = containers {
let query_value = s
.iter()
.map(|s| s.to_string())
.collect::<Vec<String>>()
.join(",");
req = req.with_query_param("containers".to_string(), query_value);
}
if let Some(ref s) = stream {
let query_value = s.to_string();
req = req.with_query_param("stream".to_string(), query_value);
}
if let Some(ref s) = interval {
let query_value = s.to_string();
req = req.with_query_param("interval".to_string(), query_value);
}
req.execute(self.configuration.borrow())
}
#[allow(unused_mut)]
fn generate_kube_libpod(
&self,
names: Vec<String>,
service: Option<bool>,
r#type: Option<&str>,
replicas: Option<i32>,
no_trunc: Option<bool>,
podman_only: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<std::path::PathBuf, Error>>>> {
let mut req = __internal_request::Request::new(
hyper::Method::GET,
"/libpod/generate/kube".to_string(),
);
req = req.with_query_param("names".to_string(), names.join(",").to_string());
if let Some(ref s) = service {
let query_value = s.to_string();
req = req.with_query_param("service".to_string(), query_value);
}
if let Some(ref s) = r#type {
let query_value = s.to_string();
req = req.with_query_param("type".to_string(), query_value);
}
if let Some(ref s) = replicas {
let query_value = s.to_string();
req = req.with_query_param("replicas".to_string(), query_value);
}
if let Some(ref s) = no_trunc {
let query_value = s.to_string();
req = req.with_query_param("noTrunc".to_string(), query_value);
}
if let Some(ref s) = podman_only {
let query_value = s.to_string();
req = req.with_query_param("podmanOnly".to_string(), query_value);
}
req.execute(self.configuration.borrow())
}
#[allow(unused_mut)]
fn generate_systemd_libpod(
&self,
name: &str,
use_name: Option<bool>,
new: Option<bool>,
no_header: Option<bool>,
start_timeout: Option<i32>,
stop_timeout: Option<i32>,
restart_policy: Option<&str>,
container_prefix: Option<&str>,
pod_prefix: Option<&str>,
separator: Option<&str>,
restart_sec: Option<i32>,
wants: Option<Vec<String>>,
after: Option<Vec<String>>,
requires: Option<Vec<String>>,
additional_env_variables: Option<Vec<String>>,
) -> Pin<Box<dyn Future<Output = Result<std::collections::HashMap<String, String>, Error>>>>
{
let mut req = __internal_request::Request::new(
hyper::Method::GET,
"/libpod/generate/{name}/systemd".to_string(),
);
if let Some(ref s) = use_name {
let query_value = s.to_string();
req = req.with_query_param("useName".to_string(), query_value);
}
if let Some(ref s) = new {
let query_value = s.to_string();
req = req.with_query_param("new".to_string(), query_value);
}
if let Some(ref s) = no_header {
let query_value = s.to_string();
req = req.with_query_param("noHeader".to_string(), query_value);
}
if let Some(ref s) = start_timeout {
let query_value = s.to_string();
req = req.with_query_param("startTimeout".to_string(), query_value);
}
if let Some(ref s) = stop_timeout {
let query_value = s.to_string();
req = req.with_query_param("stopTimeout".to_string(), query_value);
}
if let Some(ref s) = restart_policy {
let query_value = s.to_string();
req = req.with_query_param("restartPolicy".to_string(), query_value);
}
if let Some(ref s) = container_prefix {
let query_value = s.to_string();
req = req.with_query_param("containerPrefix".to_string(), query_value);
}
if let Some(ref s) = pod_prefix {
let query_value = s.to_string();
req = req.with_query_param("podPrefix".to_string(), query_value);
}
if let Some(ref s) = separator {
let query_value = s.to_string();
req = req.with_query_param("separator".to_string(), query_value);
}
if let Some(ref s) = restart_sec {
let query_value = s.to_string();
req = req.with_query_param("restartSec".to_string(), query_value);
}
if let Some(ref s) = wants {
let query_value = s
.iter()
.map(|s| s.to_string())
.collect::<Vec<String>>()
.join(",");
req = req.with_query_param("wants".to_string(), query_value);
}
if let Some(ref s) = after {
let query_value = s
.iter()
.map(|s| s.to_string())
.collect::<Vec<String>>()
.join(",");
req = req.with_query_param("after".to_string(), query_value);
}
if let Some(ref s) = requires {
let query_value = s
.iter()
.map(|s| s.to_string())
.collect::<Vec<String>>()
.join(",");
req = req.with_query_param("requires".to_string(), query_value);
}
if let Some(ref s) = additional_env_variables {
let query_value = s
.iter()
.map(|s| s.to_string())
.collect::<Vec<String>>()
.join(",");
req = req.with_query_param("additionalEnvVariables".to_string(), query_value);
}
req = req.with_path_param("name".to_string(), name.to_string());
req.execute(self.configuration.borrow())
}
#[allow(unused_mut)]
fn image_commit_libpod(
&self,
container: &str,
author: Option<&str>,
changes: Option<Vec<String>>,
comment: Option<&str>,
format: Option<&str>,
pause: Option<bool>,
squash: Option<bool>,
repo: Option<&str>,
stream: Option<bool>,
tag: Option<&str>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>>>> {
let mut req =
__internal_request::Request::new(hyper::Method::POST, "/libpod/commit".to_string());
req = req.with_query_param("container".to_string(), container.to_string());
if let Some(ref s) = author {
let query_value = s.to_string();
req = req.with_query_param("author".to_string(), query_value);
}
if let Some(ref s) = changes {
let query_value = s
.iter()
.map(|s| s.to_string())
.collect::<Vec<String>>()
.join(",");
req = req.with_query_param("changes".to_string(), query_value);
}
if let Some(ref s) = comment {
let query_value = s.to_string();
req = req.with_query_param("comment".to_string(), query_value);
}
if let Some(ref s) = format {
let query_value = s.to_string();
req = req.with_query_param("format".to_string(), query_value);
}
if let Some(ref s) = pause {
let query_value = s.to_string();
req = req.with_query_param("pause".to_string(), query_value);
}
if let Some(ref s) = squash {
let query_value = s.to_string();
req = req.with_query_param("squash".to_string(), query_value);
}
if let Some(ref s) = repo {
let query_value = s.to_string();
req = req.with_query_param("repo".to_string(), query_value);
}
if let Some(ref s) = stream {
let query_value = s.to_string();
req = req.with_query_param("stream".to_string(), query_value);
}
if let Some(ref s) = tag {
let query_value = s.to_string();
req = req.with_query_param("tag".to_string(), query_value);
}
req = req.returns_nothing();
req.execute(self.configuration.borrow())
}
#[allow(unused_mut)]
fn kube_apply_libpod(
&self,
ca_cert_file: Option<&str>,
kube_config: Option<&str>,
namespace: Option<&str>,
service: Option<bool>,
file: Option<&str>,
request: Option<&str>,
) -> Pin<Box<dyn Future<Output = Result<std::path::PathBuf, Error>>>> {
let mut req =
__internal_request::Request::new(hyper::Method::POST, "/libpod/kube/apply".to_string());
if let Some(ref s) = ca_cert_file {
let query_value = s.to_string();
req = req.with_query_param("caCertFile".to_string(), query_value);
}
if let Some(ref s) = kube_config {
let query_value = s.to_string();
req = req.with_query_param("kubeConfig".to_string(), query_value);
}
if let Some(ref s) = namespace {
let query_value = s.to_string();
req = req.with_query_param("namespace".to_string(), query_value);
}
if let Some(ref s) = service {
let query_value = s.to_string();
req = req.with_query_param("service".to_string(), query_value);
}
if let Some(ref s) = file {
let query_value = s.to_string();
req = req.with_query_param("file".to_string(), query_value);
}
req = req.with_body_param(request);
req.execute(self.configuration.borrow())
}
#[allow(unused_mut)]
fn play_kube_down_libpod(
&self,
force: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<models::PlayKubeReport, Error>>>> {
let mut req = __internal_request::Request::new(
hyper::Method::DELETE,
"/libpod/play/kube".to_string(),
);
if let Some(ref s) = force {
let query_value = s.to_string();
req = req.with_query_param("force".to_string(), query_value);
}
req.execute(self.configuration.borrow())
}
#[allow(unused_mut)]
fn play_kube_libpod(
&self,
annotations: Option<&str>,
log_driver: Option<&str>,
log_options: Option<Vec<String>>,
network: Option<Vec<String>>,
no_hosts: Option<bool>,
no_trunc: Option<bool>,
publish_ports: Option<Vec<String>>,
publish_all_ports: Option<bool>,
replace: Option<bool>,
service_container: Option<bool>,
start: Option<bool>,
static_ips: Option<Vec<String>>,
static_macs: Option<Vec<String>>,
tls_verify: Option<bool>,
userns: Option<&str>,
wait: Option<bool>,
request: Option<&str>,
) -> Pin<Box<dyn Future<Output = Result<models::PlayKubeReport, Error>>>> {
let mut req =
__internal_request::Request::new(hyper::Method::POST, "/libpod/play/kube".to_string());
if let Some(ref s) = annotations {
let query_value = s.to_string();
req = req.with_query_param("annotations".to_string(), query_value);
}
if let Some(ref s) = log_driver {
let query_value = s.to_string();
req = req.with_query_param("logDriver".to_string(), query_value);
}
if let Some(ref s) = log_options {
let query_value = s
.iter()
.map(|s| s.to_string())
.collect::<Vec<String>>()
.join(",");
req = req.with_query_param("logOptions".to_string(), query_value);
}
if let Some(ref s) = network {
let query_value = s
.iter()
.map(|s| s.to_string())
.collect::<Vec<String>>()
.join(",");
req = req.with_query_param("network".to_string(), query_value);
}
if let Some(ref s) = no_hosts {
let query_value = s.to_string();
req = req.with_query_param("noHosts".to_string(), query_value);
}
if let Some(ref s) = no_trunc {
let query_value = s.to_string();
req = req.with_query_param("noTrunc".to_string(), query_value);
}
if let Some(ref s) = publish_ports {
let query_value = s
.iter()
.map(|s| s.to_string())
.collect::<Vec<String>>()
.join(",");
req = req.with_query_param("publishPorts".to_string(), query_value);
}
if let Some(ref s) = publish_all_ports {
let query_value = s.to_string();
req = req.with_query_param("publishAllPorts".to_string(), query_value);
}
if let Some(ref s) = replace {
let query_value = s.to_string();
req = req.with_query_param("replace".to_string(), query_value);
}
if let Some(ref s) = service_container {
let query_value = s.to_string();
req = req.with_query_param("serviceContainer".to_string(), query_value);
}
if let Some(ref s) = start {
let query_value = s.to_string();
req = req.with_query_param("start".to_string(), query_value);
}
if let Some(ref s) = static_ips {
let query_value = s
.iter()
.map(|s| s.to_string())
.collect::<Vec<String>>()
.join(",");
req = req.with_query_param("staticIPs".to_string(), query_value);
}
if let Some(ref s) = static_macs {
let query_value = s
.iter()
.map(|s| s.to_string())
.collect::<Vec<String>>()
.join(",");
req = req.with_query_param("staticMACs".to_string(), query_value);
}
if let Some(ref s) = tls_verify {
let query_value = s.to_string();
req = req.with_query_param("tlsVerify".to_string(), query_value);
}
if let Some(ref s) = userns {
let query_value = s.to_string();
req = req.with_query_param("userns".to_string(), query_value);
}
if let Some(ref s) = wait {
let query_value = s.to_string();
req = req.with_query_param("wait".to_string(), query_value);
}
req = req.with_body_param(request);
req.execute(self.configuration.borrow())
}
#[allow(unused_mut)]
fn put_container_archive_libpod(
&self,
name: &str,
path: &str,
pause: Option<bool>,
request: Option<&str>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>>>> {
let mut req = __internal_request::Request::new(
hyper::Method::PUT,
"/libpod/containers/{name}/archive".to_string(),
);
req = req.with_query_param("path".to_string(), path.to_string());
if let Some(ref s) = pause {
let query_value = s.to_string();
req = req.with_query_param("pause".to_string(), query_value);
}
req = req.with_path_param("name".to_string(), name.to_string());
req = req.with_body_param(request);
req = req.returns_nothing();
req.execute(self.configuration.borrow())
}
}