From 78b09aa305470e129976cdb37b762cb49709b1be Mon Sep 17 00:00:00 2001 From: Josh Priddle Date: Thu, 26 Feb 2026 12:18:22 -0500 Subject: [PATCH 1/2] Add backup download scope --- src/cli.rs | 3 +++ src/commands/backup.rs | 18 +++++++++++++++--- src/main.rs | 3 ++- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/cli.rs b/src/cli.rs index 68a2c71..3cf85ad 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -989,6 +989,9 @@ pub enum BackupCommands { Create { /// Site ID site_id: String, + /// Backup scope (full, database, files) + #[arg(long, default_value = "full")] + scope: String, /// Backup description #[arg(long)] description: Option, diff --git a/src/commands/backup.rs b/src/commands/backup.rs index 0d4dbc9..91f0137 100644 --- a/src/commands/backup.rs +++ b/src/commands/backup.rs @@ -16,6 +16,7 @@ struct PaginationQuery { #[derive(Debug, Serialize)] struct CreateBackupRequest { r#type: String, + scope: String, #[serde(skip_serializing_if = "Option::is_none")] description: Option, } @@ -51,6 +52,7 @@ pub fn list( vec![ b["id"].as_str().unwrap_or("-").to_string(), b["type"].as_str().unwrap_or("-").to_string(), + b["scope"].as_str().unwrap_or("-").to_string(), b["status"].as_str().unwrap_or("-").to_string(), format_option(&b["description"].as_str().map(String::from)), format_option(&b["created_at"].as_str().map(String::from)), @@ -58,7 +60,7 @@ pub fn list( }) .collect(); - print_table(vec!["ID", "Type", "Status", "Description", "Created"], rows); + print_table(vec!["ID", "Type", "Scope", "Status", "Description", "Created"], rows); if let Some((current, last, total)) = extract_pagination(&response) { print_pagination(current, last, total); @@ -88,6 +90,10 @@ pub fn show( print_key_value(vec![ ("ID", backup["id"].as_str().unwrap_or("-").to_string()), ("Type", backup["type"].as_str().unwrap_or("-").to_string()), + ( + "Scope", + backup["scope"].as_str().unwrap_or("-").to_string(), + ), ( "Status", backup["status"].as_str().unwrap_or("-").to_string(), @@ -97,8 +103,12 @@ pub fn show( format_option(&backup["description"].as_str().map(String::from)), ), ( - "Snapshot ID", - format_option(&backup["snapshot_id"].as_str().map(String::from)), + "File Snapshot ID", + format_option(&backup["file_snapshot_id"].as_str().map(String::from)), + ), + ( + "Database Snapshot ID", + format_option(&backup["database_snapshot_id"].as_str().map(String::from)), ), ( "Started At", @@ -124,11 +134,13 @@ pub fn show( pub fn create( client: &ApiClient, site_id: &str, + scope: &str, description: Option, format: OutputFormat, ) -> Result<(), ApiError> { let body = CreateBackupRequest { r#type: "manual".to_string(), + scope: scope.to_string(), description, }; diff --git a/src/main.rs b/src/main.rs index 0776207..40c6512 100644 --- a/src/main.rs +++ b/src/main.rs @@ -631,8 +631,9 @@ fn run_backup(command: BackupCommands, format: OutputFormat) -> Result<(), ApiEr } BackupCommands::Create { site_id, + scope, description, - } => backup::create(&client, &site_id, description, format), + } => backup::create(&client, &site_id, &scope, description, format), } } From 8887cb7bc71c8bd365736f6e85f1e4018faed213 Mon Sep 17 00:00:00 2001 From: Josh Priddle Date: Thu, 26 Feb 2026 12:23:25 -0500 Subject: [PATCH 2/2] fixup --- src/commands/backup.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/commands/backup.rs b/src/commands/backup.rs index 91f0137..dd66a0c 100644 --- a/src/commands/backup.rs +++ b/src/commands/backup.rs @@ -60,7 +60,10 @@ pub fn list( }) .collect(); - print_table(vec!["ID", "Type", "Scope", "Status", "Description", "Created"], rows); + print_table( + vec!["ID", "Type", "Scope", "Status", "Description", "Created"], + rows, + ); if let Some((current, last, total)) = extract_pagination(&response) { print_pagination(current, last, total); @@ -90,10 +93,7 @@ pub fn show( print_key_value(vec![ ("ID", backup["id"].as_str().unwrap_or("-").to_string()), ("Type", backup["type"].as_str().unwrap_or("-").to_string()), - ( - "Scope", - backup["scope"].as_str().unwrap_or("-").to_string(), - ), + ("Scope", backup["scope"].as_str().unwrap_or("-").to_string()), ( "Status", backup["status"].as_str().unwrap_or("-").to_string(),