From 24941142b0c8cfcec680c1dc798912d772f654bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Mon, 2 May 2022 18:27:41 +0200 Subject: [PATCH] OAPI: add `SocketIOSubscription` type for managing SocketIO rooms A client can send a `SocketIOSubscription` object with the `/subscription` event type, in order to manage the subscriptions to job-related updates. Subscribing to a job means receiving updates to its tasks. General job updates are sent to all clients anyway. This commit only contains the OpenAPI YAML change, to see if it works well to separate such commits into three parts: - OpenAPI definition change. - Regenerated code changes. - Hand-written code changes. --- pkg/api/flamenco-manager.yaml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/pkg/api/flamenco-manager.yaml b/pkg/api/flamenco-manager.yaml index 770cd19c..1362d18f 100644 --- a/pkg/api/flamenco-manager.yaml +++ b/pkg/api/flamenco-manager.yaml @@ -1056,6 +1056,32 @@ components: "priority": { type: integer, default: 50 } required: [id, updated, status, type, priority] + SocketIOSubscription: + type: object + description: > + Send by SocketIO clients as `/subscription` event type, to manage their + subscription to job updates. Clients always get job updates, but for + task updates or task logs they need to explicitly subscribe. For + simplicity, clients can only subscribe to one job (to get task updates + for that job) and one task's log at a time. + properties: + "op": { $ref: "#/components/schemas/SocketIOSubscriptionOperation" } + "type": { $ref: "#/components/schemas/SocketIOSubscriptionType" } + "uuid": + type: string + format: uuid + description: UUID of the thing to subscribe to / unsubscribe from. + required: [op, type, uuid] + + SocketIOSubscriptionOperation: + type: string + enum: [subscribe, unsubscribe] + + SocketIOSubscriptionType: + type: string + enum: [job] + description: What kind of thing to subscribe to / unsubscribe from. + securitySchemes: worker_auth: description: Username is the worker ID, password is the secret given at worker registration.