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 EB8F763E56 for ; Wed, 28 Oct 2020 23:04:59 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id D0A58238CB for ; Wed, 28 Oct 2020 23:04:29 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (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 B1960238C1 for ; Wed, 28 Oct 2020 23:04:25 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 7611745F3A for ; Wed, 28 Oct 2020 23:04:25 +0100 (CET) From: Thomas Lamprecht To: pbs-devel@lists.proxmox.com Date: Wed, 28 Oct 2020 23:04:18 +0100 Message-Id: <20201028220418.23124-1-t.lamprecht@proxmox.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -1.628 Adjusted score from AWL reputation of From: address HEXHASH_WORD 2.999 Multiple instances of word + hexadecimal hash KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust 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. [proxmox-backup-client.rs] Subject: [pbs-devel] applied: [PATCH backup] client: adapt to change datastroe status return schema 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: Wed, 28 Oct 2020 22:05:00 -0000 fixes commit 16f9f244cfc19f021afa193929f40441434f0349 which extended the return schema of the status API but did not adapted the client status command to that. Simply define our own tiny return schema and use that. Signed-off-by: Thomas Lamprecht --- now that I see this I think that extension of that return schema from commit 16f9f244cfc19f021afa193929f40441434f0349 was not that nice, and feels a bit thrown together. Maybe we want a pure "usage only" call and a more elaborate status like call with that information and maybe even more? pushing this out anyway for now as is to unbreak the client status command and this the PVE storage plugin src/bin/proxmox-backup-client.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/bin/proxmox-backup-client.rs b/src/bin/proxmox-backup-client.rs index 4bb05bd1..beaa935e 100644 --- a/src/bin/proxmox-backup-client.rs +++ b/src/bin/proxmox-backup-client.rs @@ -1657,7 +1657,10 @@ async fn prune_async(mut param: Value) -> Result { optional: true, }, } - } + }, + returns: { + type: StorageStatus, + }, )] /// Get repository status. async fn status(param: Value) -> Result { @@ -1671,7 +1674,7 @@ async fn status(param: Value) -> Result { let path = format!("api2/json/admin/datastore/{}/status", repo.store()); let mut result = client.get(&path, None).await?; - let mut data = result["data"].take(); + let mut data = result["data"]["storage"].take(); record_repository(&repo); @@ -1690,7 +1693,7 @@ async fn status(param: Value) -> Result { .column(ColumnConfig::new("used").renderer(render_total_percentage)) .column(ColumnConfig::new("avail").renderer(render_total_percentage)); - let schema = &proxmox_backup::api2::admin::datastore::API_RETURN_SCHEMA_STATUS; + let schema = &API_RETURN_SCHEMA_STATUS; format_and_print_result_full(&mut data, schema, &output_format, &options); -- 2.27.0