]> git.proxmox.com Git - pve-ha-manager.git/commitdiff
api: fix/add return description for status endpoint
authorFiona Ebner <f.ebner@proxmox.com>
Wed, 31 May 2023 08:12:46 +0000 (10:12 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 7 Jun 2023 15:40:48 +0000 (17:40 +0200)
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

index 201e17e91b1f09da9149975882c5863be9487ede..dc21049f0f257ce3ee52dcc1db46deacc615587c 100644 (file)
@@ -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) = @_;