forked from github-starred/komodo
consolidate periphery docker apis into single mod
This commit is contained in:
@@ -334,7 +334,7 @@ pub async fn pull_deployment_inner(
|
|||||||
let res = async {
|
let res = async {
|
||||||
let log = match periphery_client(server)
|
let log = match periphery_client(server)
|
||||||
.await?
|
.await?
|
||||||
.request(api::image::PullImage {
|
.request(api::docker::PullImage {
|
||||||
name: image,
|
name: image,
|
||||||
account,
|
account,
|
||||||
token,
|
token,
|
||||||
|
|||||||
@@ -694,7 +694,7 @@ impl Resolve<ExecuteArgs> for DeleteNetwork {
|
|||||||
let periphery = periphery_client(&server).await?;
|
let periphery = periphery_client(&server).await?;
|
||||||
|
|
||||||
let log = match periphery
|
let log = match periphery
|
||||||
.request(api::network::DeleteNetwork {
|
.request(api::docker::DeleteNetwork {
|
||||||
name: self.name.clone(),
|
name: self.name.clone(),
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
@@ -756,7 +756,7 @@ impl Resolve<ExecuteArgs> for PruneNetworks {
|
|||||||
let periphery = periphery_client(&server).await?;
|
let periphery = periphery_client(&server).await?;
|
||||||
|
|
||||||
let log = match periphery
|
let log = match periphery
|
||||||
.request(api::network::PruneNetworks {})
|
.request(api::docker::PruneNetworks {})
|
||||||
.await
|
.await
|
||||||
.context(format!(
|
.context(format!(
|
||||||
"failed to prune networks on server {}",
|
"failed to prune networks on server {}",
|
||||||
@@ -799,7 +799,7 @@ impl Resolve<ExecuteArgs> for DeleteImage {
|
|||||||
let periphery = periphery_client(&server).await?;
|
let periphery = periphery_client(&server).await?;
|
||||||
|
|
||||||
let log = match periphery
|
let log = match periphery
|
||||||
.request(api::image::DeleteImage {
|
.request(api::docker::DeleteImage {
|
||||||
name: self.name.clone(),
|
name: self.name.clone(),
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
@@ -858,7 +858,7 @@ impl Resolve<ExecuteArgs> for PruneImages {
|
|||||||
let periphery = periphery_client(&server).await?;
|
let periphery = periphery_client(&server).await?;
|
||||||
|
|
||||||
let log =
|
let log =
|
||||||
match periphery.request(api::image::PruneImages {}).await {
|
match periphery.request(api::docker::PruneImages {}).await {
|
||||||
Ok(log) => log,
|
Ok(log) => log,
|
||||||
Err(e) => Log::error(
|
Err(e) => Log::error(
|
||||||
"prune images",
|
"prune images",
|
||||||
@@ -899,7 +899,7 @@ impl Resolve<ExecuteArgs> for DeleteVolume {
|
|||||||
let periphery = periphery_client(&server).await?;
|
let periphery = periphery_client(&server).await?;
|
||||||
|
|
||||||
let log = match periphery
|
let log = match periphery
|
||||||
.request(api::volume::DeleteVolume {
|
.request(api::docker::DeleteVolume {
|
||||||
name: self.name.clone(),
|
name: self.name.clone(),
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
@@ -961,7 +961,7 @@ impl Resolve<ExecuteArgs> for PruneVolumes {
|
|||||||
let periphery = periphery_client(&server).await?;
|
let periphery = periphery_client(&server).await?;
|
||||||
|
|
||||||
let log =
|
let log =
|
||||||
match periphery.request(api::volume::PruneVolumes {}).await {
|
match periphery.request(api::docker::PruneVolumes {}).await {
|
||||||
Ok(log) => log,
|
Ok(log) => log,
|
||||||
Err(e) => Log::error(
|
Err(e) => Log::error(
|
||||||
"prune volumes",
|
"prune volumes",
|
||||||
|
|||||||
@@ -39,9 +39,9 @@ use komodo_client::{
|
|||||||
use periphery_client::api::{
|
use periphery_client::api::{
|
||||||
self as periphery,
|
self as periphery,
|
||||||
container::InspectContainer,
|
container::InspectContainer,
|
||||||
image::{ImageHistory, InspectImage},
|
docker::{
|
||||||
network::InspectNetwork,
|
ImageHistory, InspectImage, InspectNetwork, InspectVolume,
|
||||||
volume::InspectVolume,
|
},
|
||||||
};
|
};
|
||||||
use reqwest::StatusCode;
|
use reqwest::StatusCode;
|
||||||
use resolver_api::Resolve;
|
use resolver_api::Resolve;
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ impl Resolve<WriteArgs> for CreateNetwork {
|
|||||||
update.id = add_update(update.clone()).await?;
|
update.id = add_update(update.clone()).await?;
|
||||||
|
|
||||||
match periphery
|
match periphery
|
||||||
.request(api::network::CreateNetwork {
|
.request(api::docker::CreateNetwork {
|
||||||
name: to_docker_compatible_name(&self.name),
|
name: to_docker_compatible_name(&self.name),
|
||||||
driver: None,
|
driver: None,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ use async_timing_util::{
|
|||||||
};
|
};
|
||||||
use database::mungos::{find::find_collect, mongodb::bson::doc};
|
use database::mungos::{find::find_collect, mongodb::bson::doc};
|
||||||
use futures::{StreamExt, stream::FuturesUnordered};
|
use futures::{StreamExt, stream::FuturesUnordered};
|
||||||
use periphery_client::api::image::PruneImages;
|
use periphery_client::api::docker::PruneImages;
|
||||||
|
|
||||||
use crate::{config::core_config, state::db_client};
|
use crate::{config::core_config, state::db_client};
|
||||||
|
|
||||||
|
|||||||
@@ -4,16 +4,22 @@ use cache::TimeoutCache;
|
|||||||
use command::run_komodo_command;
|
use command::run_komodo_command;
|
||||||
use komodo_client::entities::{
|
use komodo_client::entities::{
|
||||||
deployment::extract_registry_domain,
|
deployment::extract_registry_domain,
|
||||||
docker::image::{Image, ImageHistoryResponseItem},
|
docker::{
|
||||||
|
image::{Image, ImageHistoryResponseItem},
|
||||||
|
network::Network,
|
||||||
|
volume::Volume,
|
||||||
|
},
|
||||||
komodo_timestamp,
|
komodo_timestamp,
|
||||||
update::Log,
|
update::Log,
|
||||||
};
|
};
|
||||||
use periphery_client::api::image::*;
|
use periphery_client::api::docker::*;
|
||||||
use resolver_api::Resolve;
|
use resolver_api::Resolve;
|
||||||
|
|
||||||
use crate::docker::{docker_client, docker_login};
|
use crate::docker::{docker_client, docker_login};
|
||||||
|
|
||||||
//
|
// =====
|
||||||
|
// IMAGE
|
||||||
|
// =====
|
||||||
|
|
||||||
impl Resolve<super::Args> for InspectImage {
|
impl Resolve<super::Args> for InspectImage {
|
||||||
#[instrument(name = "InspectImage", level = "debug")]
|
#[instrument(name = "InspectImage", level = "debug")]
|
||||||
@@ -111,3 +117,80 @@ impl Resolve<super::Args> for PruneImages {
|
|||||||
Ok(run_komodo_command("Prune Images", None, command).await)
|
Ok(run_komodo_command("Prune Images", None, command).await)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// =======
|
||||||
|
// NETWORK
|
||||||
|
// =======
|
||||||
|
|
||||||
|
impl Resolve<super::Args> for InspectNetwork {
|
||||||
|
#[instrument(name = "InspectNetwork", level = "debug")]
|
||||||
|
async fn resolve(self, _: &super::Args) -> serror::Result<Network> {
|
||||||
|
Ok(docker_client().inspect_network(&self.name).await?)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
|
||||||
|
impl Resolve<super::Args> for CreateNetwork {
|
||||||
|
#[instrument(name = "CreateNetwork", skip(self))]
|
||||||
|
async fn resolve(self, _: &super::Args) -> serror::Result<Log> {
|
||||||
|
let CreateNetwork { name, driver } = self;
|
||||||
|
let driver = match driver {
|
||||||
|
Some(driver) => format!(" -d {driver}"),
|
||||||
|
None => String::new(),
|
||||||
|
};
|
||||||
|
let command = format!("docker network create{driver} {name}");
|
||||||
|
Ok(run_komodo_command("Create Network", None, command).await)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
|
||||||
|
impl Resolve<super::Args> for DeleteNetwork {
|
||||||
|
#[instrument(name = "DeleteNetwork", skip(self))]
|
||||||
|
async fn resolve(self, _: &super::Args) -> serror::Result<Log> {
|
||||||
|
let command = format!("docker network rm {}", self.name);
|
||||||
|
Ok(run_komodo_command("Delete Network", None, command).await)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
|
||||||
|
impl Resolve<super::Args> for PruneNetworks {
|
||||||
|
#[instrument(name = "PruneNetworks", skip(self))]
|
||||||
|
async fn resolve(self, _: &super::Args) -> serror::Result<Log> {
|
||||||
|
let command = String::from("docker network prune -f");
|
||||||
|
Ok(run_komodo_command("Prune Networks", None, command).await)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ======
|
||||||
|
// VOLUME
|
||||||
|
// ======
|
||||||
|
|
||||||
|
impl Resolve<super::Args> for InspectVolume {
|
||||||
|
#[instrument(name = "InspectVolume", level = "debug")]
|
||||||
|
async fn resolve(self, _: &super::Args) -> serror::Result<Volume> {
|
||||||
|
Ok(docker_client().inspect_volume(&self.name).await?)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
|
||||||
|
impl Resolve<super::Args> for DeleteVolume {
|
||||||
|
#[instrument(name = "DeleteVolume")]
|
||||||
|
async fn resolve(self, _: &super::Args) -> serror::Result<Log> {
|
||||||
|
let command = format!("docker volume rm {}", self.name);
|
||||||
|
Ok(run_komodo_command("Delete Volume", None, command).await)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
|
||||||
|
impl Resolve<super::Args> for PruneVolumes {
|
||||||
|
#[instrument(name = "PruneVolumes")]
|
||||||
|
async fn resolve(self, _: &super::Args) -> serror::Result<Log> {
|
||||||
|
let command = String::from("docker volume prune -a -f");
|
||||||
|
Ok(run_komodo_command("Prune Volumes", None, command).await)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,8 +8,8 @@ use komodo_client::entities::{
|
|||||||
update::Log,
|
update::Log,
|
||||||
};
|
};
|
||||||
use periphery_client::api::{
|
use periphery_client::api::{
|
||||||
build::*, compose::*, container::*, git::*, image::*, network::*,
|
build::*, compose::*, container::*, docker::*, git::*, stats::*,
|
||||||
stats::*, terminal::*, volume::*, *,
|
terminal::*, *,
|
||||||
};
|
};
|
||||||
use resolver_api::Resolve;
|
use resolver_api::Resolve;
|
||||||
use response::JsonBytes;
|
use response::JsonBytes;
|
||||||
@@ -28,10 +28,8 @@ mod build;
|
|||||||
mod compose;
|
mod compose;
|
||||||
mod container;
|
mod container;
|
||||||
mod deploy;
|
mod deploy;
|
||||||
|
mod docker;
|
||||||
mod git;
|
mod git;
|
||||||
mod image;
|
|
||||||
mod network;
|
|
||||||
mod volume;
|
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Args {
|
pub struct Args {
|
||||||
|
|||||||
@@ -1,52 +0,0 @@
|
|||||||
use command::run_komodo_command;
|
|
||||||
use komodo_client::entities::{
|
|
||||||
docker::network::Network, update::Log,
|
|
||||||
};
|
|
||||||
use periphery_client::api::network::*;
|
|
||||||
use resolver_api::Resolve;
|
|
||||||
|
|
||||||
use crate::docker::docker_client;
|
|
||||||
|
|
||||||
//
|
|
||||||
|
|
||||||
impl Resolve<super::Args> for InspectNetwork {
|
|
||||||
#[instrument(name = "InspectNetwork", level = "debug")]
|
|
||||||
async fn resolve(self, _: &super::Args) -> serror::Result<Network> {
|
|
||||||
Ok(docker_client().inspect_network(&self.name).await?)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
|
|
||||||
impl Resolve<super::Args> for CreateNetwork {
|
|
||||||
#[instrument(name = "CreateNetwork", skip(self))]
|
|
||||||
async fn resolve(self, _: &super::Args) -> serror::Result<Log> {
|
|
||||||
let CreateNetwork { name, driver } = self;
|
|
||||||
let driver = match driver {
|
|
||||||
Some(driver) => format!(" -d {driver}"),
|
|
||||||
None => String::new(),
|
|
||||||
};
|
|
||||||
let command = format!("docker network create{driver} {name}");
|
|
||||||
Ok(run_komodo_command("Create Network", None, command).await)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
|
|
||||||
impl Resolve<super::Args> for DeleteNetwork {
|
|
||||||
#[instrument(name = "DeleteNetwork", skip(self))]
|
|
||||||
async fn resolve(self, _: &super::Args) -> serror::Result<Log> {
|
|
||||||
let command = format!("docker network rm {}", self.name);
|
|
||||||
Ok(run_komodo_command("Delete Network", None, command).await)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
|
|
||||||
impl Resolve<super::Args> for PruneNetworks {
|
|
||||||
#[instrument(name = "PruneNetworks", skip(self))]
|
|
||||||
async fn resolve(self, _: &super::Args) -> serror::Result<Log> {
|
|
||||||
let command = String::from("docker network prune -f");
|
|
||||||
Ok(run_komodo_command("Prune Networks", None, command).await)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
use command::run_komodo_command;
|
|
||||||
use komodo_client::entities::{docker::volume::Volume, update::Log};
|
|
||||||
use periphery_client::api::volume::*;
|
|
||||||
use resolver_api::Resolve;
|
|
||||||
|
|
||||||
use crate::docker::docker_client;
|
|
||||||
|
|
||||||
//
|
|
||||||
|
|
||||||
impl Resolve<super::Args> for InspectVolume {
|
|
||||||
#[instrument(name = "InspectVolume", level = "debug")]
|
|
||||||
async fn resolve(self, _: &super::Args) -> serror::Result<Volume> {
|
|
||||||
Ok(docker_client().inspect_volume(&self.name).await?)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
|
|
||||||
impl Resolve<super::Args> for DeleteVolume {
|
|
||||||
#[instrument(name = "DeleteVolume")]
|
|
||||||
async fn resolve(self, _: &super::Args) -> serror::Result<Log> {
|
|
||||||
let command = format!("docker volume rm {}", self.name);
|
|
||||||
Ok(run_komodo_command("Delete Volume", None, command).await)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
|
|
||||||
impl Resolve<super::Args> for PruneVolumes {
|
|
||||||
#[instrument(name = "PruneVolumes")]
|
|
||||||
async fn resolve(self, _: &super::Args) -> serror::Result<Log> {
|
|
||||||
let command = String::from("docker volume prune -a -f");
|
|
||||||
Ok(run_komodo_command("Prune Volumes", None, command).await)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
126
client/periphery/rs/src/api/docker.rs
Normal file
126
client/periphery/rs/src/api/docker.rs
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
use komodo_client::entities::{
|
||||||
|
docker::{
|
||||||
|
image::{Image, ImageHistoryResponseItem},
|
||||||
|
network::Network, volume::Volume,
|
||||||
|
},
|
||||||
|
update::Log,
|
||||||
|
};
|
||||||
|
use resolver_api::Resolve;
|
||||||
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
// =====
|
||||||
|
// IMAGE
|
||||||
|
// =====
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Serialize, Deserialize, Resolve)]
|
||||||
|
#[response(Image)]
|
||||||
|
#[error(serror::Error)]
|
||||||
|
pub struct InspectImage {
|
||||||
|
pub name: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Serialize, Deserialize, Resolve)]
|
||||||
|
#[response(Vec<ImageHistoryResponseItem>)]
|
||||||
|
#[error(serror::Error)]
|
||||||
|
pub struct ImageHistory {
|
||||||
|
pub name: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Serialize, Deserialize, Resolve)]
|
||||||
|
#[response(Log)]
|
||||||
|
#[error(serror::Error)]
|
||||||
|
pub struct PullImage {
|
||||||
|
/// The name of the image.
|
||||||
|
pub name: String,
|
||||||
|
/// Optional account to use to pull the image
|
||||||
|
pub account: Option<String>,
|
||||||
|
/// Override registry token for account with one sent from core.
|
||||||
|
pub token: Option<String>,
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
|
||||||
|
#[derive(Serialize, Deserialize, Debug, Clone, Resolve)]
|
||||||
|
#[response(Log)]
|
||||||
|
#[error(serror::Error)]
|
||||||
|
pub struct DeleteImage {
|
||||||
|
/// Id or name
|
||||||
|
pub name: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
|
||||||
|
#[derive(Serialize, Deserialize, Debug, Clone, Resolve)]
|
||||||
|
#[response(Log)]
|
||||||
|
#[error(serror::Error)]
|
||||||
|
pub struct PruneImages {}
|
||||||
|
|
||||||
|
// =======
|
||||||
|
// NETWORK
|
||||||
|
// =======
|
||||||
|
|
||||||
|
#[derive(Serialize, Deserialize, Debug, Clone, Resolve)]
|
||||||
|
#[response(Network)]
|
||||||
|
#[error(serror::Error)]
|
||||||
|
pub struct InspectNetwork {
|
||||||
|
pub name: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
|
||||||
|
#[derive(Serialize, Deserialize, Debug, Clone, Resolve)]
|
||||||
|
#[response(Log)]
|
||||||
|
#[error(serror::Error)]
|
||||||
|
pub struct CreateNetwork {
|
||||||
|
pub name: String,
|
||||||
|
pub driver: Option<String>,
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
|
||||||
|
#[derive(Serialize, Deserialize, Debug, Clone, Resolve)]
|
||||||
|
#[response(Log)]
|
||||||
|
#[error(serror::Error)]
|
||||||
|
pub struct DeleteNetwork {
|
||||||
|
/// Id or name
|
||||||
|
pub name: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
|
||||||
|
#[derive(Serialize, Deserialize, Debug, Clone, Resolve)]
|
||||||
|
#[response(Log)]
|
||||||
|
#[error(serror::Error)]
|
||||||
|
pub struct PruneNetworks {}
|
||||||
|
|
||||||
|
// ======
|
||||||
|
// VOLUME
|
||||||
|
// ======
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Serialize, Deserialize, Resolve)]
|
||||||
|
#[response(Volume)]
|
||||||
|
#[error(serror::Error)]
|
||||||
|
pub struct InspectVolume {
|
||||||
|
pub name: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
|
||||||
|
#[derive(Serialize, Deserialize, Debug, Clone, Resolve)]
|
||||||
|
#[response(Log)]
|
||||||
|
#[error(serror::Error)]
|
||||||
|
pub struct DeleteVolume {
|
||||||
|
/// Id or name
|
||||||
|
pub name: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
|
||||||
|
#[derive(Serialize, Deserialize, Debug, Clone, Resolve)]
|
||||||
|
#[response(Log)]
|
||||||
|
#[error(serror::Error)]
|
||||||
|
pub struct PruneVolumes {}
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
use komodo_client::entities::{
|
|
||||||
docker::image::{Image, ImageHistoryResponseItem},
|
|
||||||
update::Log,
|
|
||||||
};
|
|
||||||
use resolver_api::Resolve;
|
|
||||||
use serde::{Deserialize, Serialize};
|
|
||||||
|
|
||||||
//
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize, Resolve)]
|
|
||||||
#[response(Image)]
|
|
||||||
#[error(serror::Error)]
|
|
||||||
pub struct InspectImage {
|
|
||||||
pub name: String,
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize, Resolve)]
|
|
||||||
#[response(Vec<ImageHistoryResponseItem>)]
|
|
||||||
#[error(serror::Error)]
|
|
||||||
pub struct ImageHistory {
|
|
||||||
pub name: String,
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize, Resolve)]
|
|
||||||
#[response(Log)]
|
|
||||||
#[error(serror::Error)]
|
|
||||||
pub struct PullImage {
|
|
||||||
/// The name of the image.
|
|
||||||
pub name: String,
|
|
||||||
/// Optional account to use to pull the image
|
|
||||||
pub account: Option<String>,
|
|
||||||
/// Override registry token for account with one sent from core.
|
|
||||||
pub token: Option<String>,
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone, Resolve)]
|
|
||||||
#[response(Log)]
|
|
||||||
#[error(serror::Error)]
|
|
||||||
pub struct DeleteImage {
|
|
||||||
/// Id or name
|
|
||||||
pub name: String,
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone, Resolve)]
|
|
||||||
#[response(Log)]
|
|
||||||
#[error(serror::Error)]
|
|
||||||
pub struct PruneImages {}
|
|
||||||
0
client/periphery/rs/src/api/keys.rs
Normal file
0
client/periphery/rs/src/api/keys.rs
Normal file
@@ -15,12 +15,11 @@ use serde::{Deserialize, Serialize};
|
|||||||
pub mod build;
|
pub mod build;
|
||||||
pub mod compose;
|
pub mod compose;
|
||||||
pub mod container;
|
pub mod container;
|
||||||
|
pub mod docker;
|
||||||
pub mod git;
|
pub mod git;
|
||||||
pub mod image;
|
pub mod keys;
|
||||||
pub mod network;
|
|
||||||
pub mod stats;
|
pub mod stats;
|
||||||
pub mod terminal;
|
pub mod terminal;
|
||||||
pub mod volume;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|||||||
@@ -1,41 +0,0 @@
|
|||||||
use komodo_client::entities::{
|
|
||||||
docker::network::Network, update::Log,
|
|
||||||
};
|
|
||||||
use resolver_api::Resolve;
|
|
||||||
use serde::{Deserialize, Serialize};
|
|
||||||
|
|
||||||
//
|
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone, Resolve)]
|
|
||||||
#[response(Network)]
|
|
||||||
#[error(serror::Error)]
|
|
||||||
pub struct InspectNetwork {
|
|
||||||
pub name: String,
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone, Resolve)]
|
|
||||||
#[response(Log)]
|
|
||||||
#[error(serror::Error)]
|
|
||||||
pub struct CreateNetwork {
|
|
||||||
pub name: String,
|
|
||||||
pub driver: Option<String>,
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone, Resolve)]
|
|
||||||
#[response(Log)]
|
|
||||||
#[error(serror::Error)]
|
|
||||||
pub struct DeleteNetwork {
|
|
||||||
/// Id or name
|
|
||||||
pub name: String,
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone, Resolve)]
|
|
||||||
#[response(Log)]
|
|
||||||
#[error(serror::Error)]
|
|
||||||
pub struct PruneNetworks {}
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
use komodo_client::entities::{docker::volume::Volume, update::Log};
|
|
||||||
use resolver_api::Resolve;
|
|
||||||
use serde::{Deserialize, Serialize};
|
|
||||||
|
|
||||||
//
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize, Resolve)]
|
|
||||||
#[response(Volume)]
|
|
||||||
#[error(serror::Error)]
|
|
||||||
pub struct InspectVolume {
|
|
||||||
pub name: String,
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone, Resolve)]
|
|
||||||
#[response(Log)]
|
|
||||||
#[error(serror::Error)]
|
|
||||||
pub struct DeleteVolume {
|
|
||||||
/// Id or name
|
|
||||||
pub name: String,
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone, Resolve)]
|
|
||||||
#[response(Log)]
|
|
||||||
#[error(serror::Error)]
|
|
||||||
pub struct PruneVolumes {}
|
|
||||||
Reference in New Issue
Block a user