use clap::Parser;
use mogh_resolver::Resolve;
use serde::{Deserialize, Serialize};
use typeshare::typeshare;
use crate::entities::{TerminationSignal, update::Update};
use super::{BatchExecutionResponse, KomodoExecuteRequest};
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/Deploy",
description = "Deploys the container / swarm service for the target Deployment.",
request_body(content = Deploy),
responses(
(status = 200, description = "The update", body = Update),
),
)]
pub fn deploy() {}
#[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 Deploy {
pub deployment: String,
pub stop_signal: Option<TerminationSignal>,
pub stop_time: Option<i32>,
}
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/BatchDeploy",
description = "Deploys multiple Deployments in parallel that match pattern.",
request_body(content = BatchDeploy),
responses(
(status = 200, description = "The batch execution response", body = BatchExecutionResponse),
),
)]
pub fn batch_deploy() {}
#[typeshare]
#[derive(
Serialize, Deserialize, Debug, Clone, PartialEq, Resolve, Parser,
)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
#[empty_traits(KomodoExecuteRequest)]
#[response(BatchExecutionResponse)]
#[error(mogh_error::Error)]
pub struct BatchDeploy {
pub pattern: String,
}
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/PullDeployment",
description = "Pulls the image for the target deployment.",
request_body(content = PullDeployment),
responses(
(status = 200, description = "The update", body = Update),
),
)]
pub fn pull_deployment() {}
#[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 PullDeployment {
pub deployment: String,
}
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/StartDeployment",
description = "Starts the container for the target deployment.",
request_body(content = StartDeployment),
responses(
(status = 200, description = "The update", body = Update),
),
)]
pub fn start_deployment() {}
#[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 StartDeployment {
pub deployment: String,
}
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/RestartDeployment",
description = "Restarts the container for the target deployment.",
request_body(content = RestartDeployment),
responses(
(status = 200, description = "The update", body = Update),
),
)]
pub fn restart_deployment() {}
#[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 RestartDeployment {
pub deployment: String,
}
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/PauseDeployment",
description = "Pauses the container for the target deployment.",
request_body(content = PauseDeployment),
responses(
(status = 200, description = "The update", body = Update),
),
)]
pub fn pause_deployment() {}
#[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 PauseDeployment {
pub deployment: String,
}
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/UnpauseDeployment",
description = "Unpauses the container for the target deployment.",
request_body(content = UnpauseDeployment),
responses(
(status = 200, description = "The update", body = Update),
),
)]
pub fn unpause_deployment() {}
#[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 UnpauseDeployment {
pub deployment: String,
}
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/StopDeployment",
description = "Stops the container for the target deployment.",
request_body(content = StopDeployment),
responses(
(status = 200, description = "The update", body = Update),
),
)]
pub fn stop_deployment() {}
#[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 StopDeployment {
pub deployment: String,
pub signal: Option<TerminationSignal>,
pub time: Option<i32>,
}
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/DestroyDeployment",
description = "Destroys the container for the target deployment.",
request_body(content = DestroyDeployment),
responses(
(status = 200, description = "The update", body = Update),
),
)]
pub fn destroy_deployment() {}
#[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 DestroyDeployment {
pub deployment: String,
pub signal: Option<TerminationSignal>,
pub time: Option<i32>,
}
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/BatchDestroyDeployment",
description = "Destroys multiple Deployments in parallel that match pattern.",
request_body(content = BatchDestroyDeployment),
responses(
(status = 200, description = "The batch execution response", body = BatchExecutionResponse),
),
)]
pub fn batch_destroy_deployment() {}
#[typeshare]
#[derive(
Serialize, Deserialize, Debug, Clone, PartialEq, Resolve, Parser,
)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
#[empty_traits(KomodoExecuteRequest)]
#[response(BatchExecutionResponse)]
#[error(mogh_error::Error)]
pub struct BatchDestroyDeployment {
pub pattern: String,
}