[pbs-devel] [PATCH proxmox-backup 3/6] cli: manager: sync: add 'sync-direction' parameter to list
Dominik Csapak
d.csapak at proxmox.com
Mon Nov 25 12:15:34 CET 2024
so one can list pull and push jobs
Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
not really happy with this, ideally we would also allow 'all' here, but
then we'd have to show the type in the return value too, which is not
really possible with the 'SyncJobConfig' type (as that get's
deserialized) where the direction is part of the config section type
alternatively we could here switch to the '/admin/sync' api from the
'/config/sync' api which does contain the sync-direction (and also
the status). then it'd be easy to show all types
src/bin/proxmox_backup_manager/sync.rs | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/bin/proxmox_backup_manager/sync.rs b/src/bin/proxmox_backup_manager/sync.rs
index 005cce6f3..b08bfb58b 100644
--- a/src/bin/proxmox_backup_manager/sync.rs
+++ b/src/bin/proxmox_backup_manager/sync.rs
@@ -4,7 +4,7 @@ use serde_json::Value;
use proxmox_router::{cli::*, ApiHandler, RpcEnvironment};
use proxmox_schema::api;
-use pbs_api_types::JOB_ID_SCHEMA;
+use pbs_api_types::{SyncDirection, JOB_ID_SCHEMA};
use proxmox_backup::api2;
@@ -20,6 +20,10 @@ fn render_group_filter(value: &Value, _record: &Value) -> Result<String, Error>
#[api(
input: {
properties: {
+ "sync-direction": {
+ type: SyncDirection,
+ optional: true,
+ },
"output-format": {
schema: OUTPUT_FORMAT,
optional: true,
--
2.39.5
More information about the pbs-devel
mailing list