mirror of
https://github.com/moghtech/komodo.git
synced 2026-04-28 03:38:55 -05:00
setup some more deployment reqs
This commit is contained in:
@@ -3,7 +3,7 @@ use async_trait::async_trait;
|
||||
use monitor_types::{
|
||||
all_logs_success,
|
||||
entities::{
|
||||
deployment::{Deployment, DeploymentImage, DockerContainerState},
|
||||
deployment::{Deployment, DeploymentImage, DockerContainerState, DockerContainerStats},
|
||||
server::ServerStatus,
|
||||
update::{Log, Update, UpdateStatus, UpdateTarget},
|
||||
Operation, PermissionLevel, Version,
|
||||
@@ -60,6 +60,39 @@ impl Resolve<ListDeployments, RequestUser> for State {
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl Resolve<GetLog, RequestUser> for State {
|
||||
async fn resolve(
|
||||
&self,
|
||||
GetLog { deployment_id }: GetLog,
|
||||
user: RequestUser,
|
||||
) -> anyhow::Result<Log> {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl Resolve<GetDeployedVersion, RequestUser> for State {
|
||||
async fn resolve(
|
||||
&self,
|
||||
GetDeployedVersion { deployment_id }: GetDeployedVersion,
|
||||
user: RequestUser,
|
||||
) -> anyhow::Result<GetDeployedVersionResponse> {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl Resolve<GetDeploymentStats, RequestUser> for State {
|
||||
async fn resolve(
|
||||
&self,
|
||||
GetDeploymentStats { id }: GetDeploymentStats,
|
||||
user: RequestUser,
|
||||
) -> anyhow::Result<DockerContainerStats> {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl Resolve<CreateDeployment, RequestUser> for State {
|
||||
async fn resolve(
|
||||
|
||||
@@ -6,8 +6,8 @@ use typeshare::typeshare;
|
||||
|
||||
use crate::{
|
||||
entities::{
|
||||
deployment::{Deployment, PartialDeploymentConfig, TerminationSignal},
|
||||
update::Update,
|
||||
deployment::{Deployment, PartialDeploymentConfig, TerminationSignal, DockerContainerStats},
|
||||
update::{Update, Log},
|
||||
},
|
||||
MongoDocument,
|
||||
};
|
||||
@@ -30,6 +30,39 @@ pub struct ListDeployments {
|
||||
|
||||
//
|
||||
|
||||
#[typeshare]
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, Request)]
|
||||
#[response(Log)]
|
||||
pub struct GetLog {
|
||||
pub deployment_id: String,
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
#[typeshare]
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, Request)]
|
||||
#[response(GetDeployedVersionResponse)]
|
||||
pub struct GetDeployedVersion {
|
||||
pub deployment_id: String,
|
||||
}
|
||||
|
||||
#[typeshare]
|
||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||
pub struct GetDeployedVersionResponse {
|
||||
pub version: String,
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
#[typeshare]
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, Request)]
|
||||
#[response(DockerContainerStats)]
|
||||
pub struct GetDeploymentStats {
|
||||
pub id: String,
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
#[typeshare]
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, Request)]
|
||||
#[response(Deployment)]
|
||||
@@ -77,6 +110,8 @@ pub struct RenameDeployment {
|
||||
pub name: String,
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
#[typeshare]
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, Request)]
|
||||
#[response(Update)]
|
||||
|
||||
Reference in New Issue
Block a user