From 0c7bf3bf3b89ff7d77d99ba5a87f8651b7019c1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Thu, 29 Feb 2024 20:27:44 +0100 Subject: [PATCH] OAPI: add farm status service Add an OpenAPI operation to fetch the overall farm status from the Manager. --- pkg/api/flamenco-openapi.yaml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/pkg/api/flamenco-openapi.yaml b/pkg/api/flamenco-openapi.yaml index a3f73671..253a841a 100644 --- a/pkg/api/flamenco-openapi.yaml +++ b/pkg/api/flamenco-openapi.yaml @@ -191,6 +191,20 @@ paths: application/json: schema: { $ref: "#/components/schemas/SharedStorageLocation" } + /api/v3/status: + summary: Report the status of the Flamenco farm. + get: + summary: Get the status of this Flamenco farm. + operationId: getFarmStatus + tags: [meta] + responses: + "200": + description: normal response + content: + application/json: + schema: + $ref: "#/components/schemas/FarmStatusReport" + ## Worker /api/v3/worker/register-worker: @@ -1384,6 +1398,26 @@ components: name: Your Manager git: v3.2-76-gdd34d538 + FarmStatusReport: + type: object + properties: + "status": + $ref: "#/components/schemas/FarmStatus" + required: [status] + example: + status: idle + + FarmStatus: + type: string + enum: + - "active" # Actively working on jobs. + - "idle" # Farm could be active, but has no work to do. + - "waiting" # Work has been queued, but all workers are asleep. + - "asleep" # Farm is idle, and all workers are asleep. + - "inoperative" # Cannot work: no workers, or all are offline/error. + - "unknown" # Unexpected configuration of worker and job statuses. + - "starting" # Farm is starting up. + ManagerConfiguration: type: object properties: