diff --git a/dozer-cli/src/cli/cloud.rs b/dozer-cli/src/cli/cloud.rs index a9bce50e12..3457d47430 100644 --- a/dozer-cli/src/cli/cloud.rs +++ b/dozer-cli/src/cli/cloud.rs @@ -138,6 +138,11 @@ pub enum VersionCommand { /// The version to set as current version: u32, }, + /// Deletes a version + /// + /// This will delete any resources related to the version, including any + /// aliases pointing to this version. + Delete { version: u32 }, /// Creates or updates an alias to point at the given version Alias { alias: String, version: u32 }, /// Remove alias diff --git a/dozer-cli/src/simple/cloud_orchestrator.rs b/dozer-cli/src/simple/cloud_orchestrator.rs index 55f6254899..2cf54c337a 100644 --- a/dozer-cli/src/simple/cloud_orchestrator.rs +++ b/dozer-cli/src/simple/cloud_orchestrator.rs @@ -24,8 +24,8 @@ use dozer_types::grpc_types::cloud::{ ListSecretsRequest, LogMessageRequest, UpdateSecretRequest, }; use dozer_types::grpc_types::cloud::{ - CreateAppRequest, DeploymentInfo, DeploymentStatus, File, GetAppRequest, ListDeploymentRequest, - RmAliasRequest, SetAliasRequest, SetCurrentVersionRequest, + CreateAppRequest, DeleteVersionRequest, DeploymentInfo, DeploymentStatus, File, GetAppRequest, + ListDeploymentRequest, RmAliasRequest, SetAliasRequest, SetCurrentVersionRequest, }; use dozer_types::log::info; use dozer_types::prettytable::{row, table}; @@ -499,6 +499,11 @@ impl SimpleOrchestrator { .set_current_version(SetCurrentVersionRequest { app_id, version }) .await?; } + VersionCommand::Delete { version } => { + client + .delete_version(DeleteVersionRequest { app_id, version }) + .await?; + } VersionCommand::Alias { alias, version } => { client .set_alias(SetAliasRequest { diff --git a/dozer-types/protos/cloud.proto b/dozer-types/protos/cloud.proto index e699458899..0ff361357e 100644 --- a/dozer-types/protos/cloud.proto +++ b/dozer-types/protos/cloud.proto @@ -29,6 +29,7 @@ service DozerCloud { rpc set_alias(SetAliasRequest) returns (SetAliasResponse); rpc rm_alias(RmAliasRequest) returns (RmAliasResponse); rpc set_current_version(SetCurrentVersionRequest) returns (SetCurrentVersionResponse); + rpc delete_version(DeleteVersionRequest) returns (DeleteVersionResponse); rpc list_files(ListFilesRequest) returns (ListFilesResponse); rpc get_configuration(GetConfigurationRequest) returns (GetConfigurationResponse); @@ -210,6 +211,13 @@ message SetCurrentVersionRequest { message SetCurrentVersionResponse {} +message DeleteVersionRequest { + string app_id = 1; + uint32 version = 2; +} + +message DeleteVersionResponse {} + message SetAliasRequest { string app_id = 1; uint32 version = 2;