OAPI: add operation to fetch all workers

This introduces a new tag `worker-mgt` for worker management operations.
These are used by the web interface to display & manage workers.
This commit is contained in:
Sybren A. Stüvel 2022-05-30 17:07:33 +02:00
parent 723855a9d5
commit 311887bff7

View File

@ -249,6 +249,20 @@ paths:
schema:
$ref: "#/components/schemas/Error"
# Worker Management
/api/worker-mgt/workers:
summary: Obtain list of Workers known to the Manager.
get:
operationId: fetchWorkers
summary: Get list of workers.
tags: [worker-mgt]
responses:
"200":
description: Known workers
content:
application/json:
schema: { $ref: "#/components/schemas/WorkerList" }
## Jobs
/api/jobs/types:
@ -656,6 +670,8 @@ tags:
description: Job & task queries, submission, and management.
- name: worker
description: API for Flamenco Workers to communicate with Flamenco Manager.
- name: worker-mgt
description: Worker Management API, for the web interface to query and control Workers.
- name: shaman
description: Shaman API, for file uploading & creating job checkouts.
@ -1341,6 +1357,36 @@ components:
enum: [job, tasklog]
description: What kind of thing to subscribe to / unsubscribe from.
# Worker Management
WorkerList:
type: object
description: List of workers.
properties:
"workers":
type: array
items: { $ref: "#/components/schemas/WorkerSummary" }
required: [workers]
WorkerSummary:
type: object
description: Basic information about a Worker.
properties:
"id": { type: string, format: uuid }
"nickname": { type: string }
"status": { $ref: "#/components/schemas/WorkerStatus" }
"status_requested": { $ref: "#/components/schemas/WorkerStatus" }
# These will be implemented soon:
# "task_id":
# type: string
# format: uuid
# description: The worker's current/last-worked-on task.
# "last_seen":
# type: string
# format: date-time
# description: Last time this worker was seen by the Manager.
required: [id, nickname, status]
securitySchemes:
worker_auth:
description: Username is the worker ID, password is the secret given at worker registration.