From c9fb9600a4e9aaf4999ca4fa35f49b06f22c1c2b Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Thu, 26 Dec 2019 18:42:56 -0500 Subject: [PATCH] Fix two small bugs and regen docs --- client-api/pvc-api.py | 16 +++++----- docs/manuals/swagger.json | 67 ++++++++++++++++++++++++++++++--------- 2 files changed, 60 insertions(+), 23 deletions(-) diff --git a/client-api/pvc-api.py b/client-api/pvc-api.py index c9ff3fe4..abbb7f4a 100755 --- a/client-api/pvc-api.py +++ b/client-api/pvc-api.py @@ -784,7 +784,7 @@ class API_VM_Root(Resource): @RequestParser([ { 'name': 'limit' }, { 'name': 'node' }, - { 'name': 'selector', 'choices': ('mem', 'vcpu', 'load', 'vms'), 'helptext': "A valid selector must be specified" }, + { 'name': 'selector', 'choices': ('mem', 'vcpus', 'load', 'vms'), 'helptext': "A valid selector must be specified" }, { 'name': 'autostart' }, { 'name': 'xml', 'required': True, 'helptext': "A Libvirt XML document must be specified" }, ]) @@ -819,7 +819,7 @@ class API_VM_Root(Resource): default: mem enum: - mem - - vcpu + - vcpus - load - vms - in: query @@ -1309,6 +1309,12 @@ class API_VM_Console(Resource): --- tags: - vm + parameters: + - in: query + name: lines + type: integer + required: false + description: The number of lines to retrieve responses: 200: description: OK @@ -1322,12 +1328,6 @@ class API_VM_Console(Resource): data: type: string description: The recent console log text - parameters: - - in: query - name: lines - type: integer - required: false - description: The number of lines to retrieve 404: description: Not found schema: diff --git a/docs/manuals/swagger.json b/docs/manuals/swagger.json index ff982994..8d3f75e7 100644 --- a/docs/manuals/swagger.json +++ b/docs/manuals/swagger.json @@ -58,6 +58,19 @@ }, "type": "object" }, + "VMLog": { + "properties": { + "data": { + "description": "The recent console log text", + "type": "string" + }, + "name": { + "description": "The name of the VM", + "type": "string" + } + }, + "type": "object" + }, "VMMetadata": { "properties": { "name": { @@ -925,20 +938,6 @@ ] } }, - "/api/v1/doc": { - "get": { - "description": "", - "responses": { - "200": { - "description": "OK" - } - }, - "summary": "Provide the Swagger API documentation", - "tags": [ - "root" - ] - } - }, "/api/v1/initialize": { "post": { "description": "Note: Normally used only once during cluster bootstrap; checks for the existence of the \"/primary_node\" key before proceeding and returns 400 if found", @@ -1946,6 +1945,12 @@ "name": "action", "required": true, "type": "string" + }, + { + "description": "Whether to block waiting for the full flush/ready state", + "in": "query", + "name": "wait", + "type": "boolean" } ], "responses": { @@ -4337,7 +4342,7 @@ "description": "The selector used to determine candidate nodes during migration", "enum": [ "mem", - "vcpu", + "vcpus", "load", "vms" ], @@ -4534,6 +4539,38 @@ ] } }, + "/api/v1/vm/{vm}/console": { + "get": { + "description": "", + "parameters": [ + { + "description": "The number of lines to retrieve", + "in": "query", + "name": "lines", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/VMLog" + } + }, + "404": { + "description": "Not found", + "schema": { + "$ref": "#/definitions/Message" + } + } + }, + "summary": "Return the recent console log of {vm}", + "tags": [ + "vm" + ] + } + }, "/api/v1/vm/{vm}/locks": { "post": { "description": "",