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 F31A46F6A7 for ; Mon, 30 Aug 2021 13:15:49 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 6AFDC1A188 for ; Mon, 30 Aug 2021 13:15:19 +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 D49911A01A for ; Mon, 30 Aug 2021 13:15:11 +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 AD91E4428E for ; Mon, 30 Aug 2021 13:15:11 +0200 (CEST) From: Hannes Laimer To: pbs-devel@lists.proxmox.com Date: Mon, 30 Aug 2021 13:14:56 +0200 Message-Id: <20210830111505.38694-7-h.laimer@proxmox.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210830111505.38694-1-h.laimer@proxmox.com> References: <20210830111505.38694-1-h.laimer@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -1.444 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% ENA_SUBJ_ODD_CASE 3.2 Subject has odd case 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 Subject: [pbs-devel] [PATCH v2 proxmox-backup 06/15] api2: add 'removable' to DataStoreListItem 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: Mon, 30 Aug 2021 11:15:50 -0000 --- pbs-api-types/src/lib.rs | 7 +++++++ src/api2/admin/datastore.rs | 1 + 2 files changed, 8 insertions(+) diff --git a/pbs-api-types/src/lib.rs b/pbs-api-types/src/lib.rs index 576099eb..2965a11a 100644 --- a/pbs-api-types/src/lib.rs +++ b/pbs-api-types/src/lib.rs @@ -437,6 +437,12 @@ pub struct GroupListItem { optional: true, schema: SINGLE_LINE_COMMENT_SCHEMA, }, + removable: { + description: "The datastore is marked as removable.", + type: bool, + optional: true, + default: false, + }, }, )] #[derive(Serialize, Deserialize)] @@ -445,6 +451,7 @@ pub struct GroupListItem { pub struct DataStoreListItem { pub store: String, pub comment: Option, + pub removable: bool, } #[api( diff --git a/src/api2/admin/datastore.rs b/src/api2/admin/datastore.rs index 16559678..b236dfab 100644 --- a/src/api2/admin/datastore.rs +++ b/src/api2/admin/datastore.rs @@ -1089,6 +1089,7 @@ pub fn get_datastore_list( DataStoreListItem { store: store.clone(), comment: data["comment"].as_str().map(String::from), + removable: data["backing-device"] != Value::Null, } ); } -- 2.30.2