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 6354591B4F for ; Fri, 23 Dec 2022 10:59:48 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 408A123926 for ; Fri, 23 Dec 2022 10:59:18 +0100 (CET) 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 for ; Fri, 23 Dec 2022 10:59:17 +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 E3A5743F1C for ; Fri, 23 Dec 2022 10:59:16 +0100 (CET) From: Aaron Lauterer To: pve-devel@lists.proxmox.com Date: Fri, 23 Dec 2022 10:59:15 +0100 Message-Id: <20221223095915.3035857-3-a.lauterer@proxmox.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221223095915.3035857-1-a.lauterer@proxmox.com> References: <20221223095915.3035857-1-a.lauterer@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.041 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. [ceph.pm] Subject: [pve-devel] [PATCH manager v2 2/2] api: ceph: metadata: update return schema X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Dec 2022 09:59:48 -0000 This API endpoint returns a big nested schema. This patch adds a mostly complete description. For the actual service instance return schema, we include commonly used and important properties. It will usually return more. What exactly depends on the Ceph service type. Signed-off-by: Aaron Lauterer --- I might have gone overboard a bit when it comes to adding common options for each individual service type ;) I hope the placeholders are okay this way. changes: added more detailed return schemas for each service type PVE/API2/Cluster/Ceph.pm | 163 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 162 insertions(+), 1 deletion(-) diff --git a/PVE/API2/Cluster/Ceph.pm b/PVE/API2/Cluster/Ceph.pm index 387b8c3c..0b64e8ab 100644 --- a/PVE/API2/Cluster/Ceph.pm +++ b/PVE/API2/Cluster/Ceph.pm @@ -48,6 +48,33 @@ __PACKAGE__->register_method ({ } }); +my $metadata_common_props = { + hostname => { + type => "string", + description => "Hostname on which the service is running.", + }, + ceph_release => { + type => "string", + description => "Ceph release codename currently used.", + }, + ceph_version => { + type => "string", + description => "Version info currently used by the service.", + }, + ceph_version_short => { + type => "string", + description => "Short version (numerical) info currently used by the service.", + }, + mem_total_kb => { + type => "integer", + description => "Memory consumption of the service.", + }, + mem_swap_kb => { + type => "integer", + description => "Memory of the service currently in swap.", + }, +}; + __PACKAGE__->register_method ({ name => 'metadata', path => 'metadata', @@ -68,7 +95,141 @@ __PACKAGE__->register_method ({ }, }, }, - returns => { type => 'object' }, + returns => { + type => 'object', + description => "Items for each type of service containing objects for each instance.", + properties => { + mds => { + type => "object", + description => "Metadata servers configured in the cluster and their properties.", + properties => { + "{instance}" => { + type => "object", + description => "Useful properties are listed, but not the full list.", + properties => { + addr => { + type => "string", + description => "Bind addresses and ports.", + }, + name => { + type => "string", + description => "Name of the service instance.", + }, + %{$metadata_common_props}, + }, + }, + }, + }, + mgr => { + type => "object", + description => "Managers configured in the cluster and their properties.", + properties => { + "{instance}" => { + type => "object", + description => "Useful properties are listed, but not the full list.", + properties => { + addr => { + type => "string", + description => "Bind address", + }, + name => { + type => "string", + description => "Name of the service instance.", + }, + %{$metadata_common_props}, + }, + }, + }, + }, + mon => { + type => "object", + description => "Monitors configured in the cluster and their properties.", + properties => { + "{instance}" => { + type => "object", + description => "Useful properties are listed, but not the full list.", + properties => { + addrs => { + type => "string", + description => "Bind addresses and ports.", + }, + name => { + type => "string", + description => "Name of the service instance.", + }, + %{$metadata_common_props}, + }, + }, + }, + }, + node => { + type => "object", + description => "Ceph version installed on the nodes.", + properties => { + "{node}" => { + type => "object", + properties => { + buildcommit => { + type => "string", + description => "GIT commit used for the build.", + }, + version => { + type => "object", + description => "Version info.", + properties => { + str => { + type => "string", + description => "Version as single string.", + }, + parts => { + type => "array", + description => "major, minor & patch", + }, + }, + }, + }, + }, + }, + }, + osd => { + type => "array", + description => "OSDs configured in the cluster and their properties.", + properties => { + "{instance}" => { + type => "object", + description => "Useful properties are listed, but not the full list.", + properties => { + id => { + type => "integer", + description => "OSD ID.", + }, + front_addr => { + type => "string", + description => "Bind addresses and ports for frontend traffic to OSDs.", + }, + back_addr => { + type => "string", + description => "Bind addresses and ports for backend inter OSD traffic.", + }, + device_id => { + type => "string", + description => "Devices used by the OSD.", + }, + osd_data => { + type => "string", + description => "Path to the OSD data directory.", + }, + osd_objectstore => { + type => "string", + description => "OSD objectstore type.", + }, + %{$metadata_common_props}, + }, + }, + }, + }, + }, + }, code => sub { my ($param) = @_; -- 2.30.2