From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 82F656A79C for ; Fri, 17 Sep 2021 13:56:17 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 76E842F2BF for ; Fri, 17 Sep 2021 13:56:17 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id F3C6E2F27E for ; Fri, 17 Sep 2021 13:56:14 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 5CA8F44936 for ; Fri, 17 Sep 2021 13:56:11 +0200 (CEST) From: Dominik Csapak To: pbs-devel@lists.proxmox.com Date: Fri, 17 Sep 2021 13:56:00 +0200 Message-Id: <20210917115607.135162-1-d.csapak@proxmox.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.380 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [verify.rs, backup.rs, api.rs, sync.rs, mod.rs, pull.rs, proxmox-backup-proxy.rs, inspect.rs, main.rs, recover.rs, proxmox-backup-debug.rs, user.rs, datastore.rs] Subject: [pbs-devel] [PATCH proxmox-backup v3 0/7] add 'proxmox-backup-debug api' commands X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 11:56:17 -0000 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 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 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