Skip to content

Commit 361128b

Browse files
feat(cloud): add available-versions command for Essentials databases (#485)
Adds the 'cloud fixed-database available-versions' command to get available Redis upgrade versions for Essentials (fixed) databases. The library method already existed, this adds the CLI command. Closes #466
1 parent 4343560 commit 361128b

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

crates/redisctl/src/cli/cloud.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,12 @@ pub enum CloudFixedDatabaseCommands {
650650
#[arg(long)]
651651
key: String,
652652
},
653+
/// Get available Redis versions for upgrade
654+
#[command(name = "available-versions")]
655+
AvailableVersions {
656+
/// Database ID (format: subscription_id:database_id)
657+
id: String,
658+
},
653659
}
654660

655661
/// Cloud Fixed Subscription Commands

crates/redisctl/src/commands/cloud/fixed_database.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,5 +400,17 @@ pub async fn handle_fixed_database_command(
400400
eprintln!("Tag '{}' deleted successfully", key);
401401
Ok(())
402402
}
403+
CloudFixedDatabaseCommands::AvailableVersions { id } => {
404+
let (subscription_id, database_id) = parse_fixed_database_id(id)?;
405+
406+
let json_response = handler
407+
.get_available_target_versions(subscription_id, database_id)
408+
.await
409+
.context("Failed to get available versions")?;
410+
411+
let data = handle_output(json_response, output_format, query)?;
412+
print_formatted_output(data, output_format)?;
413+
Ok(())
414+
}
403415
}
404416
}

0 commit comments

Comments
 (0)