diff --git a/pbs-api-types/src/jobs.rs b/pbs-api-types/src/jobs.rs index 601d86f9..2a7e201b 100644 --- a/pbs-api-types/src/jobs.rs +++ b/pbs-api-types/src/jobs.rs @@ -247,7 +247,7 @@ pub struct VerificationJobStatus { optional: true, type: Userid, }, - groups: { + "group-filter": { schema: GROUP_FILTER_LIST_SCHEMA, optional: true, }, @@ -270,7 +270,7 @@ pub struct TapeBackupJobSetup { #[serde(skip_serializing_if="Option::is_none")] pub notify_user: Option, #[serde(skip_serializing_if="Option::is_none")] - pub groups: Option>, + pub group_filter: Option>, } #[api( @@ -409,7 +409,7 @@ pub const GROUP_FILTER_LIST_SCHEMA: Schema = ArraySchema::new("List of group fil optional: true, schema: SYNC_SCHEDULE_SCHEMA, }, - groups: { + "group-filter": { schema: GROUP_FILTER_LIST_SCHEMA, optional: true, }, @@ -433,7 +433,7 @@ pub struct SyncJobConfig { #[serde(skip_serializing_if="Option::is_none")] pub schedule: Option, #[serde(skip_serializing_if="Option::is_none")] - pub groups: Option>, + pub group_filter: Option>, } #[api( diff --git a/src/api2/config/sync.rs b/src/api2/config/sync.rs index 890221e6..2028d038 100644 --- a/src/api2/config/sync.rs +++ b/src/api2/config/sync.rs @@ -192,8 +192,8 @@ pub enum DeletableProperty { schedule, /// Delete the remove-vanished flag. remove_vanished, - /// Delete the groups property. - groups, + /// Delete the group_filter property. + group_filter, } #[api( @@ -256,7 +256,7 @@ pub fn update_sync_job( DeletableProperty::comment => { data.comment = None; }, DeletableProperty::schedule => { data.schedule = None; }, DeletableProperty::remove_vanished => { data.remove_vanished = None; }, - DeletableProperty::groups => { data.groups = None; }, + DeletableProperty::group_filter => { data.group_filter = None; }, } } } @@ -274,7 +274,7 @@ pub fn update_sync_job( if let Some(remote) = update.remote { data.remote = remote; } if let Some(remote_store) = update.remote_store { data.remote_store = remote_store; } if let Some(owner) = update.owner { data.owner = Some(owner); } - if let Some(groups) = update.groups { data.groups = Some(groups); } + if let Some(group_filter) = update.group_filter { data.group_filter = Some(group_filter); } let schedule_changed = data.schedule != update.schedule; if update.schedule.is_some() { data.schedule = update.schedule; } @@ -394,7 +394,7 @@ acl:1:/remote/remote1/remotestore1:write@pbs:RemoteSyncOperator owner: Some(write_auth_id.clone()), comment: None, remove_vanished: None, - groups: None, + group_filter: None, schedule: None, }; diff --git a/src/api2/config/tape_backup_job.rs b/src/api2/config/tape_backup_job.rs index 84dda075..3be80f6a 100644 --- a/src/api2/config/tape_backup_job.rs +++ b/src/api2/config/tape_backup_job.rs @@ -133,8 +133,8 @@ pub enum DeletableProperty { LatestOnly, /// Delete the 'notify-user' property NotifyUser, - /// Delete the 'groups' property - Groups, + /// Delete the 'group_filter' property + GroupFilter, } #[api( @@ -193,7 +193,7 @@ pub fn update_tape_backup_job( DeletableProperty::NotifyUser => { data.setup.notify_user = None; }, DeletableProperty::Schedule => { data.schedule = None; }, DeletableProperty::Comment => { data.comment = None; }, - DeletableProperty::Groups => { data.setup.groups = None; }, + DeletableProperty::GroupFilter => { data.setup.group_filter = None; }, } } } @@ -206,7 +206,7 @@ pub fn update_tape_backup_job( if update.setup.export_media_set.is_some() { data.setup.export_media_set = update.setup.export_media_set; } if update.setup.latest_only.is_some() { data.setup.latest_only = update.setup.latest_only; } if update.setup.notify_user.is_some() { data.setup.notify_user = update.setup.notify_user; } - if update.setup.groups.is_some() { data.setup.groups = update.setup.groups; } + if update.setup.group_filter.is_some() { data.setup.group_filter = update.setup.group_filter; } let schedule_changed = data.schedule != update.schedule; if update.schedule.is_some() { data.schedule = update.schedule; } diff --git a/src/api2/pull.rs b/src/api2/pull.rs index acbd2884..30ee5fe5 100644 --- a/src/api2/pull.rs +++ b/src/api2/pull.rs @@ -50,7 +50,7 @@ impl TryFrom<&SyncJobConfig> for PullParameters { &sync_job.remote_store, sync_job.owner.as_ref().unwrap_or_else(|| Authid::root_auth_id()).clone(), sync_job.remove_vanished, - sync_job.groups.clone(), + sync_job.group_filter.clone(), ) } } @@ -152,7 +152,7 @@ pub fn do_sync_job( schema: REMOVE_VANISHED_BACKUPS_SCHEMA, optional: true, }, - "groups": { + "group-filter": { schema: GROUP_FILTER_LIST_SCHEMA, optional: true, }, @@ -173,7 +173,7 @@ async fn pull ( remote: String, remote_store: String, remove_vanished: Option, - groups: Option>, + group_filter: Option>, _info: &ApiMethod, rpcenv: &mut dyn RpcEnvironment, ) -> Result { @@ -189,7 +189,7 @@ async fn pull ( &remote_store, auth_id.clone(), remove_vanished, - groups, + group_filter, )?; let client = pull_params.client().await?; diff --git a/src/api2/tape/backup.rs b/src/api2/tape/backup.rs index 1d775459..008b0732 100644 --- a/src/api2/tape/backup.rs +++ b/src/api2/tape/backup.rs @@ -437,7 +437,7 @@ fn backup_worker( group_list.sort_unstable(); - let (group_list, group_count) = if let Some(group_filters) = &setup.groups { + let (group_list, group_count) = if let Some(group_filters) = &setup.group_filter { let filter_fn = |group: &BackupGroup, group_filters: &[GroupFilter]| { group_filters.iter().any(|filter| group.matches(filter)) }; diff --git a/src/bin/proxmox-backup-manager.rs b/src/bin/proxmox-backup-manager.rs index 00e02b3f..eea262c5 100644 --- a/src/bin/proxmox-backup-manager.rs +++ b/src/bin/proxmox-backup-manager.rs @@ -240,7 +240,7 @@ fn task_mgmt_cli() -> CommandLineInterface { schema: REMOVE_VANISHED_BACKUPS_SCHEMA, optional: true, }, - "groups": { + "group-filter": { schema: GROUP_FILTER_LIST_SCHEMA, optional: true, }, @@ -257,7 +257,7 @@ async fn pull_datastore( remote_store: String, local_store: String, remove_vanished: Option, - groups: Option>, + group_filter: Option>, param: Value, ) -> Result { @@ -271,8 +271,8 @@ async fn pull_datastore( "remote-store": remote_store, }); - if groups.is_some() { - args["groups"] = json!(groups); + if group_filter.is_some() { + args["group-filter"] = json!(group_filter); } if let Some(remove_vanished) = remove_vanished { @@ -400,7 +400,7 @@ async fn run() -> Result<(), Error> { .completion_cb("local-store", pbs_config::datastore::complete_datastore_name) .completion_cb("remote", pbs_config::remote::complete_remote_name) .completion_cb("remote-store", complete_remote_datastore_name) - .completion_cb("groups", complete_remote_datastore_group_filter) + .completion_cb("group_filter", complete_remote_datastore_group_filter) ) .insert( "verify",