From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH ha-manager] api: fix/add return description for status endpoint
Date: Wed, 31 May 2023 10:12:46 +0200 [thread overview]
Message-ID: <20230531081246.39012-1-f.ebner@proxmox.com> (raw)
The fact that no 'items' was specified made the api-viewer throw a
JavaScript exception: retinf.items is undefined
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
src/PVE/API2/HA/Status.pm | 65 ++++++++++++++++++++++++++++++++++++++-
1 file changed, 64 insertions(+), 1 deletion(-)
diff --git a/src/PVE/API2/HA/Status.pm b/src/PVE/API2/HA/Status.pm
index 201e17e..dc21049 100644
--- a/src/PVE/API2/HA/Status.pm
+++ b/src/PVE/API2/HA/Status.pm
@@ -71,7 +71,70 @@ __PACKAGE__->register_method ({
additionalProperties => 0,
properties => {},
},
- returns => { type => 'array' },
+ returns => {
+ type => 'array',
+ items => {
+ type => 'object',
+ properties => {
+ id => {
+ description => "Status entry ID (quorum, master, lrm:<node>, service:<sid>).",
+ type => "string",
+ },
+ node => {
+ description => "Node associated to status entry.",
+ type => "string",
+ },
+ status => {
+ description => "Status of the entry (value depends on type).",
+ type => "string",
+ },
+ type => {
+ description => "Type of status entry.",
+ enum => ["quorum", "master", "lrm", "service"],
+ },
+ quorate => {
+ description => "For type 'quorum'. Whether the cluster is quorate or not.",
+ type => "boolean",
+ optional => 1,
+ },
+ timestamp => {
+ description => "For type 'lrm','master'. Timestamp of the status information.",
+ type => "integer",
+ optional => 1,
+ },
+ crm_state => {
+ description => "For type 'service'. Service state as seen by the CRM.",
+ type => "string",
+ optional => 1,
+ },
+ max_relocate => {
+ description => "For type 'service'.",
+ type => "integer",
+ optional => 1,
+ },
+ max_restart => {
+ description => "For type 'service'.",
+ type => "integer",
+ optional => 1,
+ },
+ request_state => {
+ description => "For type 'service'. Requested service state.",
+ type => "string",
+ optional => 1,
+ },
+ sid => {
+ description => "For type 'service'. Service ID.",
+ type => "string",
+ optional => 1,
+ },
+ state => {
+ description => "For type 'service'. Verbose service state.",
+ type => "string",
+ optional => 1,
+ },
+ },
+ },
+ },
code => sub {
my ($param) = @_;
--
2.39.2
next reply other threads:[~2023-05-31 8:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-31 8:12 Fiona Ebner [this message]
2023-06-07 15:41 ` [pve-devel] applied: " 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=20230531081246.39012-1-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.