{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://oms.local/schemas/conductor-manage-worker.schema.json",
  "title": "OMS conductor worker management request",
  "type": "object",
  "additionalProperties": false,
  "required": ["action", "dispatch_id", "reason", "parked_until"],
  "properties": {
    "action": { "enum": ["observe", "park", "resume", "stop"] },
    "dispatch_id": { "type": "string", "pattern": "^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$" },
    "reason": { "type": ["string", "null"], "minLength": 1, "maxLength": 512 },
    "parked_until": {
      "type": ["string", "null"],
      "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3}Z$"
    }
  }
}
