{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/palo-alto-networks/main/json-schema/palo-alto-networks-job-status-schema.json",
  "title": "job_status",
  "x-generated": "2026-10-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/palo-alto-networks-jobs-api-openapi.yml#/components/schemas/job_status",
  "type": "object",
  "required": [
    "jobId",
    "progress",
    "state",
    "request",
    "results"
  ],
  "properties": {
    "jobId": {
      "type": "string",
      "format": "uuid",
      "description": "Unique identifier for the job."
    },
    "progress": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100,
      "description": "Job completion percentage."
    },
    "state": {
      "type": "string",
      "description": "Current state of the job.",
      "enum": [
        "pending",
        "in_progress",
        "complete",
        "failed"
      ]
    },
    "request": {
      "type": "object",
      "description": "The original request that initiated the job.",
      "required": [
        "command",
        "devices"
      ],
      "properties": {
        "command": {
          "type": "string",
          "description": "The command that was executed."
        },
        "devices": {
          "type": "array",
          "description": "List of device serial numbers for which the command was executed.",
          "items": {
            "type": "string",
            "pattern": "^[0-9]{14,15}$"
          }
        }
      }
    },
    "results": {
      "type": "array",
      "description": "Array of results from each device. The structure of the result data varies based on the job type.",
      "items": {
        "$ref": "#/$defs/job_result"
      }
    }
  },
  "$defs": {
    "job_result": {
      "type": "object",
      "required": [
        "device",
        "state",
        "created_ts",
        "updated_ts",
        "details"
      ],
      "properties": {
        "device": {
          "type": "string",
          "pattern": "^[0-9]{14,15}$",
          "description": "The serial number of the device."
        },
        "state": {
          "type": "string",
          "description": "The state of the job for this specific device.",
          "enum": [
            "pending",
            "in_progress",
            "complete",
            "failed"
          ]
        },
        "created_ts": {
          "type": "string",
          "description": "Timestamp when the job was created."
        },
        "updated_ts": {
          "type": "string",
          "description": "Timestamp when the job was last updated."
        },
        "details": {
          "type": "object",
          "description": "Detailed results from the command execution. The structure varies based on the command type.",
          "required": [
            "msg",
            "result"
          ],
          "properties": {
            "msg": {
              "type": "string",
              "description": "Status message from the command execution."
            },
            "result": {
              "type": "object",
              "description": "The actual result data from the command. Structure varies by command type and may contain routing tables, device information, or other operational data.",
              "additionalProperties": true
            }
          }
        }
      }
    }
  }
}