From 99bf0a67a7b51d616ae79d810fc976d6506a658d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Thu, 11 Aug 2022 16:50:05 -0700 Subject: [PATCH] OAPI: add operation to delete workers This will remove a worker by soft-deletion. Any task still assigned to the worker will be requeued. Note that this removal should only happen when the worker is offline, or it will cause errors on the worker as its credentials will not be accepted any more. --- pkg/api/flamenco-openapi.yaml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/pkg/api/flamenco-openapi.yaml b/pkg/api/flamenco-openapi.yaml index 43bf77a3..34bba913 100644 --- a/pkg/api/flamenco-openapi.yaml +++ b/pkg/api/flamenco-openapi.yaml @@ -461,6 +461,27 @@ paths: content: application/json: schema: { $ref: "#/components/schemas/Worker" } + delete: + operationId: deleteWorker + summary: > + Remove the given worker. It is recommended to only call this function + when the worker is in `offline` state. If the worker is still running, + stop it first. Any task still assigned to the worker will be requeued. + tags: [worker-mgt] + parameters: + - name: worker_id + in: path + required: true + schema: { type: string, format: uuid } + responses: + "204": + description: Normal response, worker has been deleted + default: + description: Unexpected error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" /api/v3/worker-mgt/workers/{worker_id}/setstatus: summary: Request a status change for the given worker. @@ -1936,6 +1957,10 @@ components: "status_change": $ref: "#/components/schemas/WorkerStatusChangeRequest" "version": { type: string } + "deleted_at": + type: string + format: date-time + description: This is only set when the worker was deleted. required: [id, name, updated, status, version] SocketIOSubscription: