{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-virtual-machines/json-schema/microsoft-azure-virtual-machines-virtual-machine-scale-set-list-osupgrade-history-schema.json",
  "title": "VirtualMachineScaleSetListOSUpgradeHistory",
  "description": "List of Virtual Machine Scale Set OS Upgrade History operation response.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-azure-virtual-machines-virtualmachinescalesets-api-openapi.yml#/components/schemas/VirtualMachineScaleSetListOSUpgradeHistory",
  "type": "object",
  "properties": {
    "value": {
      "type": "array",
      "description": "The list of OS upgrades performed on the virtual machine scale set.",
      "items": {
        "$ref": "#/$defs/UpgradeOperationHistoricalStatusInfo"
      },
      "x-ms-identifiers": [
        "location",
        "type"
      ]
    },
    "nextLink": {
      "type": "string",
      "format": "uri",
      "description": "The uri to fetch the next page of OS Upgrade History. Call ListNext() with this to fetch the next page of history of upgrades."
    }
  },
  "required": [
    "value"
  ],
  "$defs": {
    "ApiError": {
      "type": "object",
      "properties": {
        "details": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ApiErrorBase"
          },
          "x-ms-identifiers": [
            "message",
            "target"
          ],
          "description": "The Api error details"
        },
        "innererror": {
          "$ref": "#/$defs/InnerError",
          "description": "The Api inner error"
        },
        "code": {
          "type": "string",
          "description": "The error code."
        },
        "target": {
          "type": "string",
          "description": "The target of the particular error."
        },
        "message": {
          "type": "string",
          "description": "The error message."
        }
      },
      "description": "Api error."
    },
    "ApiErrorBase": {
      "type": "object",
      "description": "Referenced by this document but never defined in it. API Evangelist added this empty placeholder so the document resolves; the shape is unknown and is NOT a claim about the API.",
      "x-ae-placeholder": true
    },
    "ImageReference": {
      "type": "object",
      "description": "Specifies information about the image to use. You can specify information about platform images, marketplace images, or virtual machine images. This element is required when you want to use a platform image, marketplace image, or virtual machine image, but is not used in other creation operations. NOTE: Image reference publisher and offer can only be set when you create the scale set.",
      "properties": {
        "publisher": {
          "type": "string",
          "description": "The image publisher."
        },
        "offer": {
          "type": "string",
          "description": "Specifies the offer of the platform image or marketplace image used to create the virtual machine."
        },
        "sku": {
          "type": "string",
          "description": "The image SKU."
        },
        "version": {
          "type": "string",
          "description": "Specifies the version of the platform image or marketplace image used to create the virtual machine. The allowed formats are Major.Minor.Build or 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' to use the latest version of an image available at deploy time. Even if you use 'latest', the VM image will not automatically update after deploy time even if a new version becomes available. Please do not use field 'version' for gallery image deployment, gallery image should always use 'id' field for deployment, to use 'latest' version of gallery image, just set '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}' in the 'id' field without version input."
        },
        "exactVersion": {
          "type": "string",
          "description": "Specifies in decimal numbers, the version of platform image or marketplace image used to create the virtual machine. This readonly field differs from 'version', only if the value specified in 'version' field is 'latest'.",
          "readOnly": true
        },
        "sharedGalleryImageId": {
          "type": "string",
          "description": "Specified the shared gallery image unique id for vm deployment. This can be fetched from shared gallery image GET call."
        },
        "communityGalleryImageId": {
          "type": "string",
          "description": "Specified the community gallery image unique id for vm deployment. This can be fetched from community gallery image GET call."
        }
      },
      "allOf": [
        {
          "$ref": "#/$defs/SubResource"
        }
      ]
    },
    "InnerError": {
      "type": "object",
      "description": "Referenced by this document but never defined in it. API Evangelist added this empty placeholder so the document resolves; the shape is unknown and is NOT a claim about the API.",
      "x-ae-placeholder": true
    },
    "RollbackStatusInfo": {
      "type": "object",
      "description": "Information about rollback on failed VM instances after a OS Upgrade operation.",
      "properties": {
        "successfullyRolledbackInstanceCount": {
          "type": "integer",
          "format": "int32",
          "description": "The number of instances which have been successfully rolled back.",
          "readOnly": true
        },
        "failedRolledbackInstanceCount": {
          "type": "integer",
          "format": "int32",
          "description": "The number of instances which failed to rollback.",
          "readOnly": true
        },
        "rollbackError": {
          "$ref": "#/$defs/ApiError",
          "description": "Error details if OS rollback failed.",
          "readOnly": true
        }
      }
    },
    "RollingUpgradeProgressInfo": {
      "type": "object",
      "description": "Information about the number of virtual machine instances in each upgrade state.",
      "properties": {
        "successfulInstanceCount": {
          "type": "integer",
          "format": "int32",
          "description": "The number of instances that have been successfully upgraded.",
          "readOnly": true
        },
        "failedInstanceCount": {
          "type": "integer",
          "format": "int32",
          "description": "The number of instances that have failed to be upgraded successfully.",
          "readOnly": true
        },
        "inProgressInstanceCount": {
          "type": "integer",
          "format": "int32",
          "description": "The number of instances that are currently being upgraded.",
          "readOnly": true
        },
        "pendingInstanceCount": {
          "type": "integer",
          "format": "int32",
          "description": "The number of instances that have not yet begun to be upgraded.",
          "readOnly": true
        }
      }
    },
    "SubResource": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Resource Id"
        }
      }
    },
    "UpgradeOperationHistoricalStatusInfo": {
      "type": "object",
      "description": "Virtual Machine Scale Set OS Upgrade History operation response.",
      "properties": {
        "properties": {
          "$ref": "#/$defs/UpgradeOperationHistoricalStatusInfoProperties",
          "description": "Information about the properties of the upgrade operation.",
          "readOnly": true
        },
        "type": {
          "type": "string",
          "description": "Resource type",
          "readOnly": true
        },
        "location": {
          "type": "string",
          "description": "Resource location",
          "readOnly": true
        }
      }
    },
    "UpgradeOperationHistoricalStatusInfoProperties": {
      "type": "object",
      "description": "Describes each OS upgrade on the Virtual Machine Scale Set.",
      "properties": {
        "runningStatus": {
          "$ref": "#/$defs/UpgradeOperationHistoryStatus",
          "description": "Information about the overall status of the upgrade operation.",
          "readOnly": true
        },
        "progress": {
          "$ref": "#/$defs/RollingUpgradeProgressInfo",
          "description": "Counts of the VMs in each state.",
          "readOnly": true
        },
        "error": {
          "$ref": "#/$defs/ApiError",
          "description": "Error Details for this upgrade if there are any.",
          "readOnly": true
        },
        "startedBy": {
          "$ref": "#/$defs/UpgradeOperationInvoker",
          "description": "Invoker of the Upgrade Operation",
          "readOnly": true
        },
        "targetImageReference": {
          "$ref": "#/$defs/ImageReference",
          "description": "Image Reference details",
          "readOnly": true
        },
        "rollbackInfo": {
          "$ref": "#/$defs/RollbackStatusInfo",
          "description": "Information about OS rollback if performed",
          "readOnly": true
        }
      }
    },
    "UpgradeOperationHistoryStatus": {
      "type": "object",
      "description": "Information about the current running state of the overall upgrade.",
      "properties": {
        "code": {
          "$ref": "#/$defs/UpgradeState",
          "description": "Code indicating the current status of the upgrade.",
          "readOnly": true
        },
        "startTime": {
          "type": "string",
          "format": "date-time",
          "description": "Start time of the upgrade.",
          "readOnly": true
        },
        "endTime": {
          "type": "string",
          "format": "date-time",
          "description": "End time of the upgrade.",
          "readOnly": true
        }
      }
    },
    "UpgradeOperationInvoker": {
      "type": "string",
      "description": "Invoker of the Upgrade Operation",
      "enum": [
        "Unknown",
        "User",
        "Platform"
      ],
      "x-ms-enum": {
        "name": "UpgradeOperationInvoker",
        "modelAsString": false
      }
    },
    "UpgradeState": {
      "type": "string",
      "description": "Code indicating the current status of the upgrade.",
      "enum": [
        "RollingForward",
        "RollingBack",
        "Cancelled",
        "Completed",
        "Faulted"
      ],
      "x-ms-enum": {
        "name": "UpgradeState",
        "modelAsString": false
      }
    }
  }
}