Skip to content

Commit 43bca3f

Browse files
committed
add schedule backup group support
1 parent d8240e6 commit 43bca3f

3 files changed

Lines changed: 9 additions & 1 deletion

File tree

application/src/remote/backups.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ pub async fn create_backup(
266266
server: uuid::Uuid,
267267
schedule: Option<uuid::Uuid>,
268268
name: Option<&str>,
269+
backup_group: Option<uuid::Uuid>,
269270
ignored_files: &[impl Serialize + AsRef<str>],
270271
) -> Result<(BackupAdapter, uuid::Uuid), anyhow::Error> {
271272
let response: Response = super::into_json(
@@ -275,6 +276,7 @@ pub async fn create_backup(
275276
.json(&json!({
276277
"schedule_uuid": schedule,
277278
"name": name,
279+
"backup_group_uuid": backup_group,
278280
"ignored_files": ignored_files,
279281
}))
280282
.send()

application/src/remote/client.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,11 +374,13 @@ impl Client {
374374
server: uuid::Uuid,
375375
schedule: Option<uuid::Uuid>,
376376
name: Option<&str>,
377+
backup_group: Option<uuid::Uuid>,
377378
ignored_files: &[impl Serialize + Debug + AsRef<str>],
378379
) -> Result<(BackupAdapter, uuid::Uuid), anyhow::Error> {
379380
tracing::info!("creating backup");
380381

381-
super::backups::create_backup(self, server, schedule, name, ignored_files).await
382+
super::backups::create_backup(self, server, schedule, name, backup_group, ignored_files)
383+
.await
382384
}
383385

384386
#[tracing::instrument(skip(self))]

application/src/server/schedule/actions.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ pub enum ScheduleAction {
9898
foreground: bool,
9999

100100
name: Option<ScheduleDynamicParameter>,
101+
#[serde(default)]
102+
backup_group_uuid: Option<uuid::Uuid>,
101103
ignored_files: Vec<compact_str::CompactString>,
102104
},
103105
RestoreBackup {
@@ -574,6 +576,7 @@ impl ScheduleAction {
574576
ScheduleAction::CreateBackup {
575577
foreground,
576578
name,
579+
backup_group_uuid,
577580
ignored_files,
578581
..
579582
} => {
@@ -594,6 +597,7 @@ impl ScheduleAction {
594597
server.uuid,
595598
Some(execution_context.schedule_uuid),
596599
name,
600+
*backup_group_uuid,
597601
ignored_files,
598602
)
599603
.await

0 commit comments

Comments
 (0)