{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-virtual-machines/json-schema/microsoft-azure-virtual-machines-rolling-upgrade-status-info-schema.json",
  "title": "RollingUpgradeStatusInfo",
  "description": "The status of the latest virtual machine scale set rolling upgrade.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-azure-virtual-machines-virtualmachinescalesetrollingupgrades-api-openapi.yml#/components/schemas/RollingUpgradeStatusInfo",
  "type": "object",
  "properties": {
    "properties": {
      "$ref": "#/$defs/RollingUpgradeStatusInfoProperties",
      "description": "The status of the latest virtual machine scale set rolling upgrade.",
      "x-ms-client-flatten": true
    }
  },
  "allOf": [
    {
      "$ref": "#/$defs/TrackedResource"
    }
  ],
  "$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
    },
    "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
    },
    "Resource": {
      "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
    },
    "RollingUpgradeActionType": {
      "type": "string",
      "description": "The last action performed on the rolling upgrade.",
      "enum": [
        "Start",
        "Cancel"
      ],
      "x-ms-enum": {
        "name": "RollingUpgradeActionType",
        "modelAsString": false
      }
    },
    "RollingUpgradePolicy": {
      "type": "object",
      "description": "The configuration parameters used while performing a rolling upgrade.",
      "properties": {
        "maxBatchInstancePercent": {
          "type": "integer",
          "format": "int32",
          "description": "The maximum percent of total virtual machine instances that will be upgraded simultaneously by the rolling upgrade in one batch. As this is a maximum, unhealthy instances in previous or future batches can cause the percentage of instances in a batch to decrease to ensure higher reliability. The default value for this parameter is 20%.",
          "minimum": 5,
          "maximum": 100
        },
        "maxUnhealthyInstancePercent": {
          "type": "integer",
          "format": "int32",
          "description": "The maximum percentage of the total virtual machine instances in the scale set that can be simultaneously unhealthy, either as a result of being upgraded, or by being found in an unhealthy state by the virtual machine health checks before the rolling upgrade aborts. This constraint will be checked prior to starting any batch. The default value for this parameter is 20%.",
          "minimum": 5,
          "maximum": 100
        },
        "maxUnhealthyUpgradedInstancePercent": {
          "type": "integer",
          "format": "int32",
          "description": "The maximum percentage of upgraded virtual machine instances that can be found to be in an unhealthy state. This check will happen after each batch is upgraded. If this percentage is ever exceeded, the rolling update aborts. The default value for this parameter is 20%.",
          "maximum": 100
        },
        "pauseTimeBetweenBatches": {
          "type": "string",
          "description": "The wait time between completing the update for all virtual machines in one batch and starting the next batch. The time duration should be specified in ISO 8601 format. The default value is 0 seconds (PT0S)."
        },
        "enableCrossZoneUpgrade": {
          "type": "boolean",
          "description": "Allow VMSS to ignore AZ boundaries when constructing upgrade batches. Take into consideration the Update Domain and maxBatchInstancePercent to determine the batch size."
        },
        "prioritizeUnhealthyInstances": {
          "type": "boolean",
          "description": "Upgrade all unhealthy instances in a scale set before any healthy instances."
        },
        "rollbackFailedInstancesOnPolicyBreach": {
          "type": "boolean",
          "description": "Rollback failed instances to previous model if the Rolling Upgrade policy is violated."
        },
        "maxSurge": {
          "type": "boolean",
          "description": "Create new virtual machines to upgrade the scale set, rather than updating the existing virtual machines. Existing virtual machines will be deleted once the new virtual machines are created for each batch."
        }
      }
    },
    "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
        }
      }
    },
    "RollingUpgradeRunningStatus": {
      "type": "object",
      "description": "Information about the current running state of the overall upgrade.",
      "properties": {
        "code": {
          "$ref": "#/$defs/RollingUpgradeStatusCode",
          "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
        },
        "lastAction": {
          "$ref": "#/$defs/RollingUpgradeActionType",
          "description": "The last action performed on the rolling upgrade.",
          "readOnly": true
        },
        "lastActionTime": {
          "type": "string",
          "format": "date-time",
          "description": "Last action time of the upgrade.",
          "readOnly": true
        }
      }
    },
    "RollingUpgradeStatusCode": {
      "type": "string",
      "description": "Code indicating the current status of the upgrade.",
      "enum": [
        "RollingForward",
        "RollingBack",
        "Cancelled",
        "Completed",
        "Faulted"
      ],
      "x-ms-enum": {
        "name": "RollingUpgradeStatusCode",
        "modelAsString": false
      }
    },
    "RollingUpgradeStatusInfoProperties": {
      "type": "object",
      "description": "The status of the latest virtual machine scale set rolling upgrade.",
      "properties": {
        "policy": {
          "$ref": "#/$defs/RollingUpgradePolicy",
          "description": "The rolling upgrade policies applied for this upgrade.",
          "readOnly": true
        },
        "runningStatus": {
          "$ref": "#/$defs/RollingUpgradeRunningStatus",
          "description": "Information about the current running state of the overall upgrade.",
          "readOnly": true
        },
        "progress": {
          "$ref": "#/$defs/RollingUpgradeProgressInfo",
          "description": "Information about the number of virtual machine instances in each upgrade state.",
          "readOnly": true
        },
        "error": {
          "$ref": "#/$defs/ApiError",
          "description": "Error details for this upgrade, if there are any.",
          "readOnly": true
        }
      }
    },
    "TrackedResource": {
      "type": "object",
      "title": "Tracked Resource",
      "description": "The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'",
      "properties": {
        "tags": {
          "type": "object",
          "description": "Resource tags.",
          "additionalProperties": {
            "type": "string"
          },
          "x-ms-mutability": [
            "read",
            "create",
            "update"
          ]
        },
        "location": {
          "type": "string",
          "description": "The geo-location where the resource lives",
          "x-ms-mutability": [
            "read",
            "create"
          ]
        }
      },
      "required": [
        "location"
      ],
      "allOf": [
        {
          "$ref": "#/$defs/Resource"
        }
      ]
    }
  }
}