{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://wuinstall.com/automation/v1/report-3.1.schema.json",
  "title": "WuInstall 3.1 JSON report (schema_version 2) \u2014 source-derived website contract",
  "description": "Describes the 3.1 emitter, schema_version 2. Every field of the 3.0.4 report keeps its name and meaning; 3.1 adds fields only. A report without schema_version comes from 3.0.x: use report-3.0.4.schema.json. Validate newer releases separately.",
  "type": "object",
  "required": [
    "schema_version",
    "generated_at",
    "runtime_seconds",
    "system_info",
    "wsus",
    "updates",
    "result",
    "parameters",
    "search",
    "excluded_updates",
    "cleanup"
  ],
  "properties": {
    "schema_version": {
      "const": 2
    },
    "generated_at": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
      "description": "When the report was written, UTC"
    },
    "runtime_seconds": {
      "type": "integer"
    },
    "system_info": {
      "type": "object",
      "required": [
        "wuinstall_version",
        "windows_version",
        "ubr",
        "windows_update_agent",
        "domain",
        "username",
        "computername",
        "processor_architecture",
        "wow64",
        "is_elevated"
      ],
      "properties": {
        "wuinstall_version": {
          "type": [
            "string",
            "null"
          ]
        },
        "windows_version": {
          "type": [
            "string",
            "null"
          ]
        },
        "ubr": {
          "type": "integer"
        },
        "windows_update_agent": {
          "type": [
            "string",
            "null"
          ]
        },
        "domain": {
          "type": [
            "string",
            "null"
          ]
        },
        "username": {
          "type": [
            "string",
            "null"
          ]
        },
        "computername": {
          "type": [
            "string",
            "null"
          ]
        },
        "processor_architecture": {
          "type": [
            "string",
            "null"
          ]
        },
        "wow64": {
          "type": "boolean"
        },
        "is_elevated": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "wsus": {
      "type": [
        "string",
        "null"
      ]
    },
    "parameters": {
      "type": [
        "string",
        "null"
      ],
      "description": "The command line as in the XML report's <parameters>, credentials masked as there"
    },
    "search": {
      "type": "object",
      "required": [
        "started_at",
        "finished_at",
        "found",
        "selected",
        "max_update_count_reached"
      ],
      "properties": {
        "started_at": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
          "description": "When the search started; is_installed and is_downloaded are this search's snapshot. Null when no search ran"
        },
        "finished_at": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
          "description": "UTC, ISO 8601; null when it did not happen"
        },
        "found": {
          "type": "integer",
          "description": "Updates the search returned"
        },
        "selected": {
          "type": "integer",
          "description": "Updates the filters kept (the entries of updates)"
        },
        "max_update_count_reached": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "updates": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "title",
          "update_id",
          "kb_article_ids",
          "msrc_severity",
          "classification",
          "product",
          "is_downloaded",
          "is_installed",
          "max_download_size",
          "download_result_code",
          "installation_result_code",
          "revision",
          "download_hresult",
          "installation_hresult",
          "reboot_required"
        ],
        "properties": {
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "update_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "kb_article_ids": {
            "type": "array",
            "items": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "msrc_severity": {
            "type": [
              "string",
              "null"
            ]
          },
          "classification": {
            "type": [
              "string",
              "null"
            ]
          },
          "product": {
            "type": [
              "string",
              "null"
            ]
          },
          "is_downloaded": {
            "type": "boolean"
          },
          "is_installed": {
            "type": "boolean"
          },
          "max_download_size": {
            "type": "integer"
          },
          "download_result_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "installation_result_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "revision": {
            "type": "integer"
          },
          "download_hresult": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^0x[0-9A-F]{8}$",
            "description": "HRESULT the operation reported, e.g. 0x80240022; null when it reported none"
          },
          "installation_hresult": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^0x[0-9A-F]{8}$",
            "description": "HRESULT the operation reported, e.g. 0x80240022; null when it reported none"
          },
          "reboot_required": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      }
    },
    "excluded_updates": {
      "type": "array",
      "description": "The updates the search returned but the filters left out",
      "items": {
        "type": "object",
        "required": [
          "title",
          "update_id",
          "revision",
          "kb_article_ids",
          "excluded_by"
        ],
        "properties": {
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "update_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "revision": {
            "type": "integer"
          },
          "kb_article_ids": {
            "type": "array",
            "items": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "excluded_by": {
            "enum": [
              "match",
              "nomatch",
              "matchfile",
              "nomatchfile",
              "severity",
              "classification",
              "product",
              "notproduct",
              "isdownloaded",
              "releasedate",
              "updateSize",
              "maxTotalSize",
              "maxUpdateCount",
              "duplicate"
            ],
            "description": "The switch that left the update out (the first in the order WuInstall applies them), or duplicate for a second copy of an update the search returned twice"
          }
        },
        "additionalProperties": false
      }
    },
    "cleanup": {
      "type": "object",
      "description": "What the run cleaned up before it started",
      "required": [
        "reboot_cycle_task_removed",
        "resumed_reboot_cycle_pass",
        "restored_settings"
      ],
      "properties": {
        "reboot_cycle_task_removed": {
          "type": "boolean",
          "description": "The run deleted a reboot-cycle task of an earlier run"
        },
        "resumed_reboot_cycle_pass": {
          "type": "boolean",
          "description": "The run is a pass of a reboot cycle (/rcc)"
        },
        "restored_settings": {
          "type": "array",
          "items": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": "WSUS and proxy settings an interrupted earlier run had changed and this run put back"
        }
      },
      "additionalProperties": false
    },
    "result": {
      "type": "object",
      "required": [
        "search_result",
        "return_code",
        "return_text",
        "reboot_required",
        "stage",
        "reboot"
      ],
      "properties": {
        "search_result": {
          "type": [
            "string",
            "null"
          ]
        },
        "return_code": {
          "type": "integer"
        },
        "return_text": {
          "type": [
            "string",
            "null"
          ]
        },
        "reboot_required": {
          "type": "boolean"
        },
        "stage": {
          "enum": [
            "completed",
            "nothing_done",
            "syntax_error",
            "license_expired",
            "not_supported"
          ],
          "description": "Why the run ended: completed, nothing_done (/donothing or no action), or an early stop before anything ran"
        },
        "reboot": {
          "type": "object",
          "required": [
            "pending",
            "reboot_cycle_continues",
            "start_failed"
          ],
          "properties": {
            "pending": {
              "type": "boolean",
              "description": "WuInstall starts a restart or shutdown right after writing this report"
            },
            "reboot_cycle_continues": {
              "type": "boolean",
              "description": "A /rebootcycle pass is armed for the next boot"
            },
            "start_failed": {
              "type": "boolean",
              "description": "The restart could not be started; the report was written again with the final return code"
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}
