From: Fabian Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH v4 manager 1/4] cluster resources: include content type for storages
Date: Wed, 18 Nov 2020 11:04:17 +0100 [thread overview]
Message-ID: <20201118100420.21167-2-f.ebner@proxmox.com> (raw)
In-Reply-To: <20201118100420.21167-1-f.ebner@proxmox.com>
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---
New in v4
PVE/API2/Cluster.pm | 6 ++++++
PVE/API2Tools.pm | 4 ++++
2 files changed, 10 insertions(+)
diff --git a/PVE/API2/Cluster.pm b/PVE/API2/Cluster.pm
index e768cbc6..8eb913b6 100644
--- a/PVE/API2/Cluster.pm
+++ b/PVE/API2/Cluster.pm
@@ -282,6 +282,12 @@ __PACKAGE__->register_method({
optional => 1,
renderer => 'bytes',
},
+ content => {
+ description => "Allowed storage content types (when type == storage).",
+ type => 'string',
+ format => 'pve-storage-content-list',
+ optional => 1,
+ },
},
},
},
diff --git a/PVE/API2Tools.pm b/PVE/API2Tools.pm
index b90c5488..3e2626ae 100644
--- a/PVE/API2Tools.pm
+++ b/PVE/API2Tools.pm
@@ -14,6 +14,7 @@ use Digest::MD5 qw(md5_hex);
use URI;
use URI::Escape;
use PVE::SafeSyslog;
+use PVE::Storage::Plugin;
my $hwaddress;
@@ -120,6 +121,8 @@ sub extract_vm_stats {
sub extract_storage_stats {
my ($storeid, $scfg, $node, $rrd) = @_;
+ my $content = PVE::Storage::Plugin::content_hash_to_string($scfg->{content});
+
my $entry = {
id => "storage/$node/$storeid",
storage => $storeid,
@@ -127,6 +130,7 @@ sub extract_storage_stats {
type => 'storage',
status => 'unknown',
shared => $scfg->{shared} || 0,
+ content => $content,
};
if (my $d = $rrd->{"pve2-storage/$node/$storeid"}) {
--
2.20.1
next prev parent reply other threads:[~2020-11-18 10:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-18 10:04 [pve-devel] [PATCH-SERIES v4 manager] split up content view/add prune window Fabian Ebner
2020-11-18 10:04 ` Fabian Ebner [this message]
2020-11-18 10:04 ` [pve-devel] [PATCH v4 manager 2/4] ui: storage: get content types from resources Fabian Ebner
2020-11-18 10:04 ` [pve-devel] [PATCH v4 manager 3/4] ui: make remaining content views not stateful Fabian Ebner
2020-11-18 10:04 ` [pve-devel] [PATCH v4 manager 4/4] ui: storage backup view: add prune window Fabian Ebner
2020-11-23 6:08 ` Thomas Lamprecht
2020-11-23 6:09 ` [pve-devel] partially-applied: [PATCH-SERIES v4 manager] split up content view/add " Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201118100420.21167-2-f.ebner@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal