{
  "$id": "https://firefox-ci-tc.services.mozilla.com/schemas/worker-manager/v1/list-workers-response.json#",
  "$schema": "https://firefox-ci-tc.services.mozilla.com/schemas/common/metaschema.json#",
  "additionalProperties": false,
  "description": "Response from a `listWorkers` request.\n",
  "properties": {
    "continuationToken": {
      "description": "Opaque `continuationToken` to be given as query-string option to get the\nnext set of workers in the worker-type.\nThis property is only present if another request is necessary to fetch all\nresults. In practice the next request with a `continuationToken` may not\nreturn additional results, but it can. Thus, you can only be sure to have\nall the results if you've called `listWorkerTypes` with `continuationToken`\nuntil you get a result without a `continuationToken`.\n",
      "title": "Continuation Token",
      "type": "string"
    },
    "workers": {
      "description": "List of workers in this worker-type.\n",
      "items": {
        "additionalProperties": false,
        "properties": {
          "capacity": {
            "description": "Number of tasks this worker can handle at once. A worker capacity of 0 means\nthe worker is not managed by worker manager and is only known to the queue, the\ntrue capacity is not known.\n",
            "minimum": 0,
            "title": "Worker Capacity",
            "type": "integer"
          },
          "firstClaim": {
            "description": "Date of the first time this worker claimed a task.\n",
            "format": "date-time",
            "title": "First task claimed",
            "type": "string"
          },
          "lastDateActive": {
            "description": "Date of the last time this worker was seen active. Updated each time a worker calls\n`queue.claimWork`, `queue.reclaimTask`, and `queue.declareWorker` for this task queue.\n`lastDateActive` is updated every half hour but may be off by up-to half an hour.\nNonetheless, `lastDateActive` is a good indicator of when the worker was last seen active.\nThis defaults to null in the database, and is set to the current time when the worker\nis first seen.\n",
            "format": "date-time",
            "title": "Worker Last Date Active",
            "type": "string"
          },
          "latestTask": {
            "$ref": "task-run.json#",
            "description": "The most recent claimed task\n",
            "title": "Most Recent Task"
          },
          "launchConfigId": {
            "description": "The ID of the launch configuration. Must be unique forever within the worker pool.\nAny change to the launch configuration (except `workerManager` fields) must use a new ID\nto ensure proper tracking of configuration metrics.\nIf not provided, worker-manager will generate a unique ID.\nMust be between 1 and 38 characters long and contain only alphanumeric\ncharacters, dashes, and underscores.\n",
            "maxLength": 38,
            "minLength": 1,
            "pattern": "^([a-zA-Z0-9-_]*)$",
            "title": "Launch Configuration ID",
            "type": "string"
          },
          "providerId": {
            "description": "The provider that had started the worker and responsible for managing it.\nCan be different from the provider that's currently in the worker pool config.\nA providerId of \"none\" is used when the worker is not managed by worker manager.\n",
            "maxLength": 38,
            "minLength": 1,
            "pattern": "^([a-zA-Z0-9-_]*)$",
            "title": "Provider",
            "type": "string"
          },
          "quarantineUntil": {
            "description": "Quarantining a worker allows the machine to remain alive but not accept jobs.\nOnce the quarantineUntil time has elapsed, the worker resumes accepting jobs.\nNote that a quarantine can be lifted by setting `quarantineUntil` to the present time (or\nsomewhere in the past).\n",
            "format": "date-time",
            "title": "Worker Quarantine",
            "type": "string"
          },
          "state": {
            "description": "A string specifying the state this worker is in so far as worker-manager knows.\nA \"requested\" worker is in the process of starting up, and if successful will enter\nthe \"running\" state once it has registered with the `registerWorker` API method.  A\n\"stopping\" worker is in the process of shutting down and deleting resources, while\na \"stopped\" worker is completely stopped.  Stopped workers are kept for historical\npurposes and are purged when they expire.  Note that some providers transition workers\ndirectly from \"running\" to \"stopped\".\nAn \"standalone\" worker is a worker that is not managed by worker-manager, these workers\nare only known by the queue.\n",
            "enum": [
              "requested",
              "running",
              "stopping",
              "stopped",
              "standalone"
            ],
            "title": "State",
            "type": "string"
          },
          "workerGroup": {
            "description": "Identifier for the worker group containing this worker.\n",
            "maxLength": 38,
            "minLength": 1,
            "pattern": "^([a-zA-Z0-9-_]*)$",
            "type": "string"
          },
          "workerId": {
            "description": "Identifier for this worker (unique within this worker group).\n",
            "maxLength": 38,
            "minLength": 1,
            "pattern": "^([a-zA-Z0-9-_]*)$",
            "type": "string"
          },
          "workerPoolId": {
            "$ref": "task.json#/properties/workerPoolId"
          }
        },
        "required": [
          "workerGroup",
          "workerId"
        ],
        "title": "Worker",
        "type": "object"
      },
      "title": "Workers from a WorkerType",
      "type": "array",
      "uniqueItems": true
    }
  },
  "required": [
    "workers"
  ],
  "title": "List Workers Response",
  "type": "object"
}