Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add delete version api #2102

Merged
merged 1 commit into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions dozer-cli/src/cli/cloud.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 7 additions & 2 deletions dozer-cli/src/simple/cloud_orchestrator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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 {
Expand Down
8 changes: 8 additions & 0 deletions dozer-types/protos/cloud.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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;
Expand Down