From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <a.lauterer@proxmox.com>
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 BD1269171F
 for <pve-devel@lists.proxmox.com>; Wed, 21 Dec 2022 14:30:58 +0100 (CET)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
 by firstgate.proxmox.com (Proxmox) with ESMTP id 9848E8227
 for <pve-devel@lists.proxmox.com>; Wed, 21 Dec 2022 14:30:28 +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 <pve-devel@lists.proxmox.com>; Wed, 21 Dec 2022 14:30:27 +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 9D0EC44E99
 for <pve-devel@lists.proxmox.com>; Wed, 21 Dec 2022 14:30:27 +0100 (CET)
From: Aaron Lauterer <a.lauterer@proxmox.com>
To: pve-devel@lists.proxmox.com
Date: Wed, 21 Dec 2022 14:30:26 +0100
Message-Id: <20221221133026.4155850-4-a.lauterer@proxmox.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20221221133026.4155850-1-a.lauterer@proxmox.com>
References: <20221221133026.4155850-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. [osd.pm, ceph.pm, mon.pm]
Subject: [pve-devel] [PATCH manager 3/3] api: ceph: update return value
 definitions
X-BeenThere: pve-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/>
List-Post: <mailto:pve-devel@lists.proxmox.com>
List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe>
X-List-Received-Date: Wed, 21 Dec 2022 13:30:58 -0000

to have at either a more accurate description or some description at
all. For objects returning a lot of data, for example individual Ceph
services, a full description has been omitted as I think that this would
be a bit much.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
---
 PVE/API2/Ceph.pm         |  7 ++++++-
 PVE/API2/Ceph/MON.pm     | 14 +++++++++++---
 PVE/API2/Ceph/OSD.pm     | 13 +++++++++++++
 PVE/API2/Cluster/Ceph.pm | 23 ++++++++++++++++++++++-
 4 files changed, 52 insertions(+), 5 deletions(-)

diff --git a/PVE/API2/Ceph.pm b/PVE/API2/Ceph.pm
index 55220324..cc8720b2 100644
--- a/PVE/API2/Ceph.pm
+++ b/PVE/API2/Ceph.pm
@@ -622,7 +622,12 @@ __PACKAGE__->register_method ({
 	type => 'array',
 	items => {
 	    type => "object",
-	    properties => {},
+	    properties => {
+		name => {
+		    description => "Name of the CRUSH rule.",
+		    type => "string",
+		}
+	    },
 	},
 	links => [ { rel => 'child', href => "{name}" } ],
     },
diff --git a/PVE/API2/Ceph/MON.pm b/PVE/API2/Ceph/MON.pm
index 5771bb46..b452045c 100644
--- a/PVE/API2/Ceph/MON.pm
+++ b/PVE/API2/Ceph/MON.pm
@@ -212,9 +212,17 @@ __PACKAGE__->register_method ({
 	items => {
 	    type => "object",
 	    properties => {
-		name => { type => 'string' },
-		addr => { type => 'string', optional => 1 },
-		host => { type => 'string', optional => 1 },
+		name		    => { type => 'string' },
+		addr		    => { type => 'string', optional => 1 },
+		host		    => { type => 'boolean', optional => 1 },
+		direxists	    => { type => 'string', optional => 1 },
+		quorum		    => { type => 'boolean', optional => 1 },
+		host		    => { type => 'string', optional => 1 },
+		rank		    => { type => 'integer', optional => 1 },
+		service		    => { type => 'integer', optional => 1 },
+		state		    => { type => 'string', optional => 1 },
+		ceph_version	    => { type => 'string', optional => 1 },
+		ceph_version_short  => { type => 'string', optional => 1 },
 	    },
 	},
 	links => [ { rel => 'child', href => "{name}" } ],
diff --git a/PVE/API2/Ceph/OSD.pm b/PVE/API2/Ceph/OSD.pm
index 93433b3a..ce1281d9 100644
--- a/PVE/API2/Ceph/OSD.pm
+++ b/PVE/API2/Ceph/OSD.pm
@@ -88,6 +88,19 @@ __PACKAGE__->register_method ({
     # fixme: return a list instead of extjs tree format ?
     returns => {
 	type => "object",
+	items => {
+	    type => "object",
+	    properties => {
+		flags => { type => "string" },
+		root => {
+		    type => "object",
+		    description => "extjs formatted grid tree",
+		},
+	    },
+	},
+
+
+	}
     },
     code => sub {
 	my ($param) = @_;
diff --git a/PVE/API2/Cluster/Ceph.pm b/PVE/API2/Cluster/Ceph.pm
index 7f825003..49f84b24 100644
--- a/PVE/API2/Cluster/Ceph.pm
+++ b/PVE/API2/Cluster/Ceph.pm
@@ -68,7 +68,20 @@ __PACKAGE__->register_method ({
 	    },
 	},
     },
-    returns => { type => 'object' },
+    returns => {
+	type => 'object'
+	description => "Items for each type of service containing objects for each instance.",
+	items => {
+	    type => "object",
+	    properties => {
+		mds => { type => "object" },
+		mgr => { type => "object" },
+		mon => { type => "object" },
+		node => { type => "object" },
+		osd => { type => "object" },
+	    }
+	},
+    },
     code => sub {
 	my ($param) = @_;
 
@@ -181,6 +194,14 @@ __PACKAGE__->register_method ({
 		    description => "Flag name.",
 		    type => 'string', enum => $possible_flags_list,
 		},
+		description => {
+		    description => "Flag description.",
+		    type => 'string',
+		},
+		value => {
+		    description => "Flag value.",
+		    type => 'boolean',
+		},
 	    },
 	},
 	links => [ { rel => 'child', href => "{name}" } ],
-- 
2.30.2