From fc10f7524ebace1e7cc5ca87962b8465cfa5524c Mon Sep 17 00:00:00 2001 From: Matej Dujava Date: Thu, 21 Dec 2023 14:33:52 +0100 Subject: [PATCH] Add first few methods into openapi definition Resolves: #193 --- .../labcontroller-proxy-openapi.yaml | 138 ++++++++++++++++++ documentation/server-openapi.yaml | 24 +++ 2 files changed, 162 insertions(+) create mode 100644 documentation/labcontroller-proxy-openapi.yaml create mode 100644 documentation/server-openapi.yaml diff --git a/documentation/labcontroller-proxy-openapi.yaml b/documentation/labcontroller-proxy-openapi.yaml new file mode 100644 index 000000000..85017520e --- /dev/null +++ b/documentation/labcontroller-proxy-openapi.yaml @@ -0,0 +1,138 @@ +openapi: 3.0.3 +info: + title: Beaker new-gen - Lab Controller + description: This spec showcases a proposal to new REST api for beaker-LC. + version: "29.0-dev" +paths: + /recipes/{recipe_id}/tasks/{task_id}/results/{result_id}/logs/: + parameters: + - in: path + name: recipe_id + schema: + type: integer + required: true + description: recipe ID + - in: path + name: task_id + schema: + type: integer + required: true + description: recipe ID + - in: path + name: result_id + schema: + type: integer + required: true + description: recipe ID + get: + summary: Get existing log names for specific taskrun + responses: + '200': + description: OK + content: + text/plain: + example: "/var/logs/messages\n/root/ks_original" + '404': + description: "is not a valid RecipeTaskResult" + + /recipes/{recipe_id}/tasks/{task_id}/results/{result_id}/logs/{path}: + parameters: + - in: path + name: recipe_id + schema: + type: integer + required: true + description: recipe ID + - in: path + name: task_id + schema: + type: integer + required: true + description: recipe ID + - in: path + name: result_id + schema: + type: integer + required: true + description: recipe ID + - in: path + name: path + schema: + type: string + required: true + description: recipe ID + get: + summary: Get log of specific taskrun + responses: + '200': + description: OK + content: + text/plain: + example: "Log line no. 1\nLog line no. 2" + put: + summary: Upload log for specific taskrun + responses: + '204': + description: OK + '409': + description: Cannot register file for finished ... + '403': + description: Too many ... + + /power/{fqdn}/: + put: + summary: Set power to SUT + description: Hit this enpoint to check connection to LC + parameters: + - in: path + name: fqdn + schema: + type: string + required: true + description: fqdn of system under test to set power to + requestBody: + content: + application/json: + schema: + type: object + properties: + action: + type: string + anyOf: + - const: "on" + - const: "off" + - const: "reboot" + application/x-www-form-urlencoded: + schema: + type: object + properties: + action: + type: string + anyOf: + - const: "on" + - const: "off" + - const: "reboot" + responses: + '204': + description: OK + content: + text/plain: + example: "We are healthy!" + + /healthz: + head: + summary: Test + description: Test Description + operationId: nameLength + responses: + '200': + description: OK + get: + summary: ping + description: Hit this enpoint to check connection to LC + responses: + '200': + description: OK + content: + text/plain: + example: "We are healthy!" diff --git a/documentation/server-openapi.yaml b/documentation/server-openapi.yaml new file mode 100644 index 000000000..2d05098d0 --- /dev/null +++ b/documentation/server-openapi.yaml @@ -0,0 +1,24 @@ +openapi: 3.0.3 +info: + title: Beaker new-gen - Server + description: This spec showcases a proposal to new REST api for beaker-server. + version: "29.0-dev" +paths: + /healthz: + head: + summary: Test + description: Test Description + operationId: nameLength + responses: + '200': + description: OK + get: + summary: ping + description: Hit this enpoint to check connection to beaker server + responses: + '200': + description: OK + content: + text/plain: + example: "We are healthy!" +