* [pve-devel] [PATCH manager v2 1/2] api: ceph: update return schemas
2022-12-23 9:59 [pve-devel] [PATCH manager v2 0/2] Ceph API update return schemas Aaron Lauterer
@ 2022-12-23 9:59 ` Aaron Lauterer
2022-12-23 9:59 ` [pve-devel] [PATCH manager v2 2/2] api: ceph: metadata: update return schema Aaron Lauterer
2023-01-16 15:35 ` [pve-devel] applied-series: [PATCH manager v2 0/2] Ceph API update return schemas Thomas Lamprecht
2 siblings, 0 replies; 4+ messages in thread
From: Aaron Lauterer @ 2022-12-23 9:59 UTC (permalink / raw)
To: pve-devel
to include a more complete description of the returned data.
Sort properties in alphabetical order if the list is longer.
Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
---
changes:
- split patch 3/3 from the previous series. This patch contains
the smaller changes
- formatting has been reversed
- phrasing for osd tree reworded
PVE/API2/Ceph.pm | 7 ++++++-
PVE/API2/Ceph/MON.pm | 11 +++++++++--
PVE/API2/Ceph/OSD.pm | 10 ++++++++++
PVE/API2/Cluster/Ceph.pm | 8 ++++++++
4 files changed, 33 insertions(+), 3 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..7f252875 100644
--- a/PVE/API2/Ceph/MON.pm
+++ b/PVE/API2/Ceph/MON.pm
@@ -212,9 +212,16 @@ __PACKAGE__->register_method ({
items => {
type => "object",
properties => {
- name => { type => 'string' },
addr => { type => 'string', optional => 1 },
- host => { type => 'string', optional => 1 },
+ ceph_version => { type => 'string', optional => 1 },
+ ceph_version_short => { type => 'string', optional => 1 },
+ direxists => { type => 'string', optional => 1 },
+ host => { type => 'boolean', optional => 1 },
+ name => { type => 'string' },
+ quorum => { type => 'boolean', optional => 1 },
+ rank => { type => 'integer', optional => 1 },
+ service => { type => 'integer', optional => 1 },
+ state => { 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..18195743 100644
--- a/PVE/API2/Ceph/OSD.pm
+++ b/PVE/API2/Ceph/OSD.pm
@@ -88,6 +88,16 @@ __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 => "Tree with OSDs in the CRUSH map structure.",
+ },
+ },
+ },
},
code => sub {
my ($param) = @_;
diff --git a/PVE/API2/Cluster/Ceph.pm b/PVE/API2/Cluster/Ceph.pm
index 7f825003..387b8c3c 100644
--- a/PVE/API2/Cluster/Ceph.pm
+++ b/PVE/API2/Cluster/Ceph.pm
@@ -181,6 +181,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
^ permalink raw reply [flat|nested] 4+ messages in thread
* [pve-devel] [PATCH manager v2 2/2] api: ceph: metadata: update return schema
2022-12-23 9:59 [pve-devel] [PATCH manager v2 0/2] Ceph API update return schemas Aaron Lauterer
2022-12-23 9:59 ` [pve-devel] [PATCH manager v2 1/2] api: ceph: " Aaron Lauterer
@ 2022-12-23 9:59 ` Aaron Lauterer
2023-01-16 15:35 ` [pve-devel] applied-series: [PATCH manager v2 0/2] Ceph API update return schemas Thomas Lamprecht
2 siblings, 0 replies; 4+ messages in thread
From: Aaron Lauterer @ 2022-12-23 9:59 UTC (permalink / raw)
To: pve-devel
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 <a.lauterer@proxmox.com>
---
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
^ permalink raw reply [flat|nested] 4+ messages in thread