{
  "$id": "https://firefox-ci-tc.services.mozilla.com/schemas/queue/v1/worker-response.json#",
  "$schema": "https://firefox-ci-tc.services.mozilla.com/schemas/common/metaschema.json#",
  "additionalProperties": false,
  "description": "Response containing information about a worker.\n",
  "properties": {
    "actions": {
      "items": {
        "additionalProperties": false,
        "description": "Actions provide a generic mechanism to expose additional features of a\nprovisioner, worker type, or worker to Taskcluster clients.\n\nAn action is comprised of metadata describing the feature it exposes,\ntogether with a webhook for triggering it.\n\nThe Taskcluster tools site, for example, retrieves actions when displaying\nprovisioners, worker types and workers. It presents the provisioner/worker\ntype/worker specific actions to the user. When the user triggers an action,\nthe web client takes the registered webhook, substitutes parameters into the\nURL (see `url`), signs the requests with the Taskcluster credentials of the\nuser operating the web interface, and issues the HTTP request.\n\nThe level to which the action relates (provisioner, worker type, worker) is\ncalled the action context. All actions, regardless of the action contexts,\nare registered against the provisioner when calling\n`queue.declareProvisioner`.\n\nThe action context is used by the web client to determine where in the web\ninterface to present the action to the user as follows:\n\n| `context`   | Tool where action is displayed |\n|-------------|--------------------------------|\n| provisioner | Provisioner Explorer           |\n| worker-type | Workers Explorer               |\n| worker      | Worker Explorer                |\n\nSee [actions docs](/docs/reference/platform/taskcluster-queue/docs/actions)\nfor more information.\n",
        "properties": {
          "context": {
            "description": "Only actions with the context `worker` are included.\n",
            "enum": [
              "worker"
            ],
            "title": "Context",
            "type": "string"
          },
          "description": {
            "description": "Description of the provisioner.\n",
            "title": "Description",
            "type": "string"
          },
          "method": {
            "description": "Method to indicate the desired action to be performed for a given resource.\n",
            "enum": [
              "POST",
              "PUT",
              "DELETE",
              "PATCH"
            ],
            "title": "Method",
            "type": "string"
          },
          "name": {
            "description": "Short names for things like logging/error messages.\n",
            "title": "Name",
            "type": "string"
          },
          "title": {
            "description": "Appropriate title for any sort of Modal prompt.\n",
            "title": "Title"
          },
          "url": {
            "description": "When an action is triggered, a request is made using the `url` and `method`.\nDepending on the `context`, the following parameters will be substituted in the url:\n\n| `context`   | Path parameters                                          |\n|-------------|----------------------------------------------------------|\n| provisioner | <provisionerId>                                          |\n| worker-type | <provisionerId>, <workerType>                            |\n| worker      | <provisionerId>, <workerType>, <workerGroup>, <workerId> |\n\n_Note: The request needs to be signed with the user's Taskcluster credentials._\n",
            "title": "URL",
            "type": "string"
          }
        },
        "required": [
          "name",
          "title",
          "context",
          "url",
          "method",
          "description"
        ],
        "title": "Worker Action",
        "type": "object"
      },
      "title": "Worker Actions",
      "type": "array",
      "uniqueItems": false
    },
    "expires": {
      "description": "Date and time after which the worker will be automatically\ndeleted by the queue.\n",
      "format": "date-time",
      "title": "Worker Expiration",
      "type": "string"
    },
    "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"
    },
    "provisionerId": {
      "$ref": "task.json#/properties/provisionerId"
    },
    "quarantineDetails": {
      "description": "This is a list of changes to the worker's quarantine status. Each entry is an object\ncontaining information about the time, clientId and reason for the change.\n",
      "items": {
        "additionalProperties": false,
        "description": "Information about when and why a worker was quarantined.\n",
        "properties": {
          "clientId": {
            "description": "The clientId of the client that made the request to quarantine the worker.\n",
            "title": "Quarantine ClientId",
            "type": "string"
          },
          "quarantineInfo": {
            "description": "Usually a reason for the quarantine.\n",
            "title": "Quarantine Info",
            "type": "string"
          },
          "quarantineUntil": {
            "description": "Value of the worker's quarantineUntil property at the moment of the quarantine.\n",
            "format": "date-time",
            "title": "Quarantine Until",
            "type": "string"
          },
          "updatedAt": {
            "description": "Time when the quarantine was updated.\n",
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "clientId",
          "updatedAt",
          "quarantineUntil",
          "quarantineInfo"
        ],
        "title": "Quarantine Details",
        "type": "object"
      },
      "title": "Worker Quarantine Details",
      "type": "array",
      "uniqueItems": true
    },
    "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"
    },
    "recentTasks": {
      "description": "List of 20 most recent tasks claimed by the worker.\n",
      "items": {
        "$ref": "task-run.json#"
      },
      "title": "Most Recent Tasks",
      "type": "array",
      "uniqueItems": false
    },
    "taskQueueId": {
      "$ref": "task.json#/properties/taskQueueId"
    },
    "workerGroup": {
      "description": "Identifier for group that worker who executes this run is a part of,\nthis identifier is mainly used for efficient routing.\n",
      "maxLength": 38,
      "minLength": 1,
      "pattern": "^([a-zA-Z0-9-_]*)$",
      "title": "Worker Group",
      "type": "string"
    },
    "workerId": {
      "description": "Identifier for worker evaluating this run within given\n`workerGroup`.\n",
      "maxLength": 38,
      "minLength": 1,
      "pattern": "^([a-zA-Z0-9-_]*)$",
      "title": "Worker Identifier",
      "type": "string"
    },
    "workerType": {
      "$ref": "task.json#/properties/workerType"
    }
  },
  "required": [
    "provisionerId",
    "workerType",
    "workerGroup",
    "workerId",
    "recentTasks",
    "expires",
    "firstClaim",
    "actions"
  ],
  "title": "Worker Response",
  "type": "object"
}