use clap::Parser;
use mogh_resolver::Resolve;
use serde::{Deserialize, Serialize};
use typeshare::typeshare;
use crate::entities::{TerminationSignal, update::Update};
use super::KomodoExecuteRequest;
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/StartContainer",
description = "Starts the container on the target server.",
request_body(content = StartContainer),
responses(
(status = 200, description = "The update", body = Update),
),
)]
pub fn start_container() {}
#[typeshare]
#[derive(
Serialize, Deserialize, Debug, Clone, PartialEq, Resolve, Parser,
)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
#[empty_traits(KomodoExecuteRequest)]
#[response(Update)]
#[error(mogh_error::Error)]
pub struct StartContainer {
pub server: String,
pub container: String,
}
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/RestartContainer",
description = "Restarts the container on the target server.",
request_body(content = RestartContainer),
responses(
(status = 200, description = "The update", body = Update),
),
)]
pub fn restart_container() {}
#[typeshare]
#[derive(
Serialize, Deserialize, Debug, Clone, PartialEq, Resolve, Parser,
)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
#[empty_traits(KomodoExecuteRequest)]
#[response(Update)]
#[error(mogh_error::Error)]
pub struct RestartContainer {
pub server: String,
pub container: String,
}
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/PauseContainer",
description = "Pauses the container on the target server.",
request_body(content = PauseContainer),
responses(
(status = 200, description = "The update", body = Update),
),
)]
pub fn pause_container() {}
#[typeshare]
#[derive(
Serialize, Deserialize, Debug, Clone, PartialEq, Resolve, Parser,
)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
#[empty_traits(KomodoExecuteRequest)]
#[response(Update)]
#[error(mogh_error::Error)]
pub struct PauseContainer {
pub server: String,
pub container: String,
}
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/UnpauseContainer",
description = "Unpauses the container on the target server.",
request_body(content = UnpauseContainer),
responses(
(status = 200, description = "The update", body = Update),
),
)]
pub fn unpause_container() {}
#[typeshare]
#[derive(
Serialize, Deserialize, Debug, Clone, PartialEq, Resolve, Parser,
)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
#[empty_traits(KomodoExecuteRequest)]
#[response(Update)]
#[error(mogh_error::Error)]
pub struct UnpauseContainer {
pub server: String,
pub container: String,
}
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/StopContainer",
description = "Stops the container on the target server.",
request_body(content = StopContainer),
responses(
(status = 200, description = "The update", body = Update),
),
)]
pub fn stop_container() {}
#[typeshare]
#[derive(
Serialize, Deserialize, Debug, Clone, PartialEq, Resolve, Parser,
)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
#[empty_traits(KomodoExecuteRequest)]
#[response(Update)]
#[error(mogh_error::Error)]
pub struct StopContainer {
pub server: String,
pub container: String,
pub signal: Option<TerminationSignal>,
pub time: Option<i32>,
}
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/DestroyContainer",
description = "Stops and destroys the container on the target server.",
request_body(content = DestroyContainer),
responses(
(status = 200, description = "The update", body = Update),
),
)]
pub fn destroy_container() {}
#[typeshare]
#[derive(
Serialize, Deserialize, Debug, Clone, PartialEq, Resolve, Parser,
)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
#[empty_traits(KomodoExecuteRequest)]
#[response(Update)]
#[error(mogh_error::Error)]
pub struct DestroyContainer {
pub server: String,
pub container: String,
pub signal: Option<TerminationSignal>,
pub time: Option<i32>,
}
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/StartAllContainers",
description = "Starts all containers on the target server.",
request_body(content = StartAllContainers),
responses(
(status = 200, description = "The update", body = Update),
),
)]
pub fn start_all_containers() {}
#[typeshare]
#[derive(
Serialize, Deserialize, Debug, Clone, PartialEq, Resolve, Parser,
)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
#[empty_traits(KomodoExecuteRequest)]
#[response(Update)]
#[error(mogh_error::Error)]
pub struct StartAllContainers {
pub server: String,
}
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/RestartAllContainers",
description = "Restarts all containers on the target server.",
request_body(content = RestartAllContainers),
responses(
(status = 200, description = "The update", body = Update),
),
)]
pub fn restart_all_containers() {}
#[typeshare]
#[derive(
Serialize, Deserialize, Debug, Clone, PartialEq, Resolve, Parser,
)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
#[empty_traits(KomodoExecuteRequest)]
#[response(Update)]
#[error(mogh_error::Error)]
pub struct RestartAllContainers {
pub server: String,
}
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/PauseAllContainers",
description = "Pauses all containers on the target server.",
request_body(content = PauseAllContainers),
responses(
(status = 200, description = "The update", body = Update),
),
)]
pub fn pause_all_containers() {}
#[typeshare]
#[derive(
Serialize, Deserialize, Debug, Clone, PartialEq, Resolve, Parser,
)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
#[empty_traits(KomodoExecuteRequest)]
#[response(Update)]
#[error(mogh_error::Error)]
pub struct PauseAllContainers {
pub server: String,
}
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/UnpauseAllContainers",
description = "Unpauses all containers on the target server.",
request_body(content = UnpauseAllContainers),
responses(
(status = 200, description = "The update", body = Update),
),
)]
pub fn unpause_all_containers() {}
#[typeshare]
#[derive(
Serialize, Deserialize, Debug, Clone, PartialEq, Resolve, Parser,
)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
#[empty_traits(KomodoExecuteRequest)]
#[response(Update)]
#[error(mogh_error::Error)]
pub struct UnpauseAllContainers {
pub server: String,
}
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/StopAllContainers",
description = "Stops all containers on the target server.",
request_body(content = StopAllContainers),
responses(
(status = 200, description = "The update", body = Update),
),
)]
pub fn stop_all_containers() {}
#[typeshare]
#[derive(
Serialize, Deserialize, Debug, Clone, PartialEq, Resolve, Parser,
)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
#[empty_traits(KomodoExecuteRequest)]
#[response(Update)]
#[error(mogh_error::Error)]
pub struct StopAllContainers {
pub server: String,
}
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/PruneContainers",
description = "Prunes the docker containers on the target server.",
request_body(content = PruneContainers),
responses(
(status = 200, description = "The update", body = Update),
),
)]
pub fn prune_containers() {}
#[typeshare]
#[derive(
Serialize, Deserialize, Debug, Clone, PartialEq, Resolve, Parser,
)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
#[empty_traits(KomodoExecuteRequest)]
#[response(Update)]
#[error(mogh_error::Error)]
pub struct PruneContainers {
pub server: String,
}
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/DeleteNetwork",
description = "Delete a docker network.",
request_body(content = DeleteNetwork),
responses(
(status = 200, description = "The update", body = Update),
),
)]
pub fn delete_network() {}
#[typeshare]
#[derive(
Serialize, Deserialize, Debug, Clone, PartialEq, Resolve, Parser,
)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
#[empty_traits(KomodoExecuteRequest)]
#[response(Update)]
#[error(mogh_error::Error)]
pub struct DeleteNetwork {
pub server: String,
pub name: String,
}
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/PruneNetworks",
description = "Prunes the docker networks on the target server.",
request_body(content = PruneNetworks),
responses(
(status = 200, description = "The update", body = Update),
),
)]
pub fn prune_networks() {}
#[typeshare]
#[derive(
Serialize, Deserialize, Debug, Clone, PartialEq, Resolve, Parser,
)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
#[empty_traits(KomodoExecuteRequest)]
#[response(Update)]
#[error(mogh_error::Error)]
pub struct PruneNetworks {
pub server: String,
}
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/DeleteImage",
description = "Delete a docker image.",
request_body(content = DeleteImage),
responses(
(status = 200, description = "The update", body = Update),
),
)]
pub fn delete_image() {}
#[typeshare]
#[derive(
Serialize, Deserialize, Debug, Clone, PartialEq, Resolve, Parser,
)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
#[empty_traits(KomodoExecuteRequest)]
#[response(Update)]
#[error(mogh_error::Error)]
pub struct DeleteImage {
pub server: String,
pub name: String,
}
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/PruneImages",
description = "Prunes the docker images on the target server.",
request_body(content = PruneImages),
responses(
(status = 200, description = "The update", body = Update),
),
)]
pub fn prune_images() {}
#[typeshare]
#[derive(
Serialize, Deserialize, Debug, Clone, PartialEq, Resolve, Parser,
)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
#[empty_traits(KomodoExecuteRequest)]
#[response(Update)]
#[error(mogh_error::Error)]
pub struct PruneImages {
pub server: String,
}
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/DeleteVolume",
description = "Delete a docker volume.",
request_body(content = DeleteVolume),
responses(
(status = 200, description = "The update", body = Update),
),
)]
pub fn delete_volume() {}
#[typeshare]
#[derive(
Serialize, Deserialize, Debug, Clone, PartialEq, Resolve, Parser,
)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
#[empty_traits(KomodoExecuteRequest)]
#[response(Update)]
#[error(mogh_error::Error)]
pub struct DeleteVolume {
pub server: String,
pub name: String,
}
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/PruneVolumes",
description = "Prunes the docker volumes on the target server.",
request_body(content = PruneVolumes),
responses(
(status = 200, description = "The update", body = Update),
),
)]
pub fn prune_volumes() {}
#[typeshare]
#[derive(
Serialize, Deserialize, Debug, Clone, PartialEq, Resolve, Parser,
)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
#[empty_traits(KomodoExecuteRequest)]
#[response(Update)]
#[error(mogh_error::Error)]
pub struct PruneVolumes {
pub server: String,
}
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/PruneDockerBuilders",
description = "Prunes the docker builders on the target server.",
request_body(content = PruneDockerBuilders),
responses(
(status = 200, description = "The update", body = Update),
),
)]
pub fn prune_docker_builders() {}
#[typeshare]
#[derive(
Serialize, Deserialize, Debug, Clone, PartialEq, Resolve, Parser,
)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
#[empty_traits(KomodoExecuteRequest)]
#[response(Update)]
#[error(mogh_error::Error)]
pub struct PruneDockerBuilders {
pub server: String,
}
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/PruneBuildx",
description = "Prunes the docker buildx cache on the target server.",
request_body(content = PruneBuildx),
responses(
(status = 200, description = "The update", body = Update),
),
)]
pub fn prune_buildx() {}
#[typeshare]
#[derive(
Serialize, Deserialize, Debug, Clone, PartialEq, Resolve, Parser,
)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
#[empty_traits(KomodoExecuteRequest)]
#[response(Update)]
#[error(mogh_error::Error)]
pub struct PruneBuildx {
pub server: String,
}
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/PruneSystem",
description = "Prunes the docker system on the target server, including volumes.",
request_body(content = PruneSystem),
responses(
(status = 200, description = "The update", body = Update),
),
)]
pub fn prune_system() {}
#[typeshare]
#[derive(
Serialize, Deserialize, Debug, Clone, PartialEq, Resolve, Parser,
)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
#[empty_traits(KomodoExecuteRequest)]
#[response(Update)]
#[error(mogh_error::Error)]
pub struct PruneSystem {
pub server: String,
}