[pbs-devel] [PATCH proxmox-backup v4 0/7] add 'proxmox-backup-debug api' commands

Dominik Csapak d.csapak at proxmox.com
Tue Sep 21 12:11:11 CEST 2021


this series is a successor to my previous 'pbs-shell' series [0]
code wise its mostly the same but now a subcommand of 'proxmox-backup-debug'

changes from v3:
* rebase on master (use normalize_path_uri from proxmox_rest_server)
* fix worker task log output (upid was not wrapped in {data:upid})

changes from v2:
* now subcommand api of proxmox-backup-debug
* use http api on localhost by default
* add PROXMOX_DEBUG_API_CODE env variable to execute code directly
* use a macro for the completion helper calls
* combine get/post/put/delete requests into one and use 'fixed_param'
* drop priviliges to the backup user when executing 'non-protected' api
  calls directly

changes from v1:
* rebase on master
* rename 'path' parameter to 'api-path' since it clashed with some
  api calls that had a 'path variable'
* better handle workers:
  we must always wait for the local workers and do not need to
  print their logs, since most workers print to stdout if the
  rpcenv type is CLI. Also catch Ctrl+C and try to abort the worker

0: https://lists.proxmox.com/pipermail/pbs-devel/2021-September/003974.html

Dominik Csapak (7):
  server: refactor abort_local_worker
  move proxmox-backup-debug back to main crate
  proxmox-backup-debug: add 'api' subcommands
  api2: add missing token list match_all property
  api2: make some workers log on CLI
  docs: add proxmox-backup-debug to the list of command line tools
  docs: proxmox-backup-debug: add info about the 'api' subcommand

 Cargo.toml                                    |   1 -
 Makefile                                      |   2 -
 debian/proxmox-backup-debug.bash-completion   |   1 -
 debian/proxmox-backup-server.bash-completion  |   1 +
 docs/command-line-tools.rst                   |   4 +
 docs/proxmox-backup-debug/description.rst     |  11 +
 proxmox-backup-debug/Cargo.toml               |  18 -
 proxmox-backup-debug/src/main.rs              |  13 -
 src/api2/access/user.rs                       |  66 ++-
 src/api2/admin/datastore.rs                   |   4 +-
 src/api2/admin/sync.rs                        |   6 +-
 src/api2/admin/verify.rs                      |   5 +-
 src/api2/config/datastore.rs                  |   5 +-
 src/api2/pull.rs                              |   3 +-
 src/api2/tape/backup.rs                       |   7 +-
 src/bin/proxmox-backup-debug.rs               |  24 +
 src/bin/proxmox-backup-proxy.rs               |   6 +-
 src/bin/proxmox_backup_debug/api.rs           | 503 ++++++++++++++++++
 .../bin/proxmox_backup_debug}/inspect.rs      |   0
 src/bin/proxmox_backup_debug/mod.rs           |   3 +
 .../bin/proxmox_backup_debug}/recover.rs      |   0
 src/bin/proxmox_backup_manager/user.rs        |   6 +-
 src/server/verify_job.rs                      |   3 +-
 src/server/worker_task.rs                     |  12 +-
 24 files changed, 627 insertions(+), 77 deletions(-)
 delete mode 100644 debian/proxmox-backup-debug.bash-completion
 delete mode 100644 proxmox-backup-debug/Cargo.toml
 delete mode 100644 proxmox-backup-debug/src/main.rs
 create mode 100644 src/bin/proxmox-backup-debug.rs
 create mode 100644 src/bin/proxmox_backup_debug/api.rs
 rename {proxmox-backup-debug/src => src/bin/proxmox_backup_debug}/inspect.rs (100%)
 create mode 100644 src/bin/proxmox_backup_debug/mod.rs
 rename {proxmox-backup-debug/src => src/bin/proxmox_backup_debug}/recover.rs (100%)

-- 
2.30.2






More information about the pbs-devel mailing list