{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-service-fabric/json-schema/microsoft-azure-service-fabric-cluster-configuration-upgrade-description-schema.json",
  "title": "ClusterConfigurationUpgradeDescription",
  "description": "Describes the parameters for a standalone cluster configuration upgrade.",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-azure-service-fabric-client-api-openapi.yml#/components/schemas/ClusterConfigurationUpgradeDescription",
  "properties": {
    "ClusterConfig": {
      "type": "string",
      "description": "The cluster configuration as a JSON string. For example, [this file](https://github.com/Azure-Samples/service-fabric-dotnet-standalone-cluster-configuration/blob/master/Samples/ClusterConfig.Unsecure.DevCluster.json) contains JSON describing the [nodes and other properties of the cluster](https://docs.microsoft.com/azure/service-fabric/service-fabric-cluster-manifest)."
    },
    "HealthCheckRetryTimeout": {
      "type": "string",
      "format": "duration",
      "description": "The length of time between attempts to perform health checks if the application or cluster is not healthy.",
      "default": "PT0H0M0S"
    },
    "HealthCheckWaitDurationInSeconds": {
      "type": "string",
      "format": "duration",
      "description": "The length of time to wait after completing an upgrade domain before starting the health checks process.",
      "default": "PT0H0M0S"
    },
    "HealthCheckStableDurationInSeconds": {
      "type": "string",
      "format": "duration",
      "description": "The length of time that the application or cluster must remain healthy before the upgrade proceeds to the next upgrade domain.",
      "default": "PT0H0M0S"
    },
    "UpgradeDomainTimeoutInSeconds": {
      "type": "string",
      "format": "duration",
      "description": "The timeout for the upgrade domain.",
      "default": "PT0H0M0S"
    },
    "UpgradeTimeoutInSeconds": {
      "type": "string",
      "format": "duration",
      "description": "The upgrade timeout.",
      "default": "PT0H0M0S"
    },
    "MaxPercentUnhealthyApplications": {
      "type": "integer",
      "description": "The maximum allowed percentage of unhealthy applications during the upgrade. Allowed values are integer values from zero to 100.",
      "default": 0
    },
    "MaxPercentUnhealthyNodes": {
      "type": "integer",
      "description": "The maximum allowed percentage of unhealthy nodes during the upgrade. Allowed values are integer values from zero to 100.",
      "default": 0
    },
    "MaxPercentDeltaUnhealthyNodes": {
      "type": "integer",
      "description": "The maximum allowed percentage of delta health degradation during the upgrade. Allowed values are integer values from zero to 100.",
      "default": 0
    },
    "MaxPercentUpgradeDomainDeltaUnhealthyNodes": {
      "type": "integer",
      "description": "The maximum allowed percentage of upgrade domain delta health degradation during the upgrade. Allowed values are integer values from zero to 100.",
      "default": 0
    },
    "ApplicationHealthPolicies": {
      "$ref": "#/$defs/ApplicationHealthPolicies"
    }
  },
  "required": [
    "ClusterConfig"
  ],
  "$defs": {
    "ApplicationHealthPolicies": {
      "description": "Defines the application health policy map used to evaluate the health of an application or one of its children entities.",
      "properties": {
        "ApplicationHealthPolicyMap": {
          "$ref": "#/$defs/ApplicationHealthPolicyMap"
        }
      }
    },
    "ApplicationHealthPolicy": {
      "description": "Defines a health policy used to evaluate the health of an application or one of its children entities.",
      "properties": {
        "ConsiderWarningAsError": {
          "type": "boolean",
          "description": "Indicates whether warnings are treated with the same severity as errors.",
          "default": false
        },
        "MaxPercentUnhealthyDeployedApplications": {
          "type": "integer",
          "description": "The maximum allowed percentage of unhealthy deployed applications. Allowed values are Byte values from zero to 100.\nThe percentage represents the maximum tolerated percentage of deployed applications that can be unhealthy before the application is considered in error.\nThis is calculated by dividing the number of unhealthy deployed applications over the number of nodes where the application is currently deployed on in the cluster.\nThe computation rounds up to tolerate one failure on small numbers of nodes. Default percentage is zero.",
          "default": 0
        },
        "DefaultServiceTypeHealthPolicy": {
          "$ref": "#/$defs/ServiceTypeHealthPolicy"
        },
        "ServiceTypeHealthPolicyMap": {
          "$ref": "#/$defs/ServiceTypeHealthPolicyMap"
        }
      }
    },
    "ApplicationHealthPolicyMap": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ApplicationHealthPolicyMapItem"
      },
      "description": "Defines a map that contains specific application health policies for different applications.\nEach entry specifies as key the application name and as value an ApplicationHealthPolicy used to evaluate the application health.\nIf an application is not specified in the map, the application health evaluation uses the ApplicationHealthPolicy found in its application manifest or the default application health policy (if no health policy is defined in the manifest).\nThe map is empty by default."
    },
    "ApplicationHealthPolicyMapItem": {
      "description": "Defines an item in ApplicationHealthPolicyMap.",
      "required": [
        "Key",
        "Value"
      ],
      "properties": {
        "Key": {
          "$ref": "#/$defs/ApplicationName"
        },
        "Value": {
          "$ref": "#/$defs/ApplicationHealthPolicy"
        }
      }
    },
    "ApplicationName": {
      "type": "string",
      "description": "The name of the application, including the 'fabric:' URI scheme."
    },
    "ServiceTypeHealthPolicy": {
      "description": "Represents the health policy used to evaluate the health of services belonging to a service type.",
      "properties": {
        "MaxPercentUnhealthyPartitionsPerService": {
          "type": "integer",
          "description": "The maximum allowed percentage of unhealthy partitions per service. Allowed values are Byte values from zero to 100\n\nThe percentage represents the maximum tolerated percentage of partitions that can be unhealthy before the service is considered in error.\nIf the percentage is respected but there is at least one unhealthy partition, the health is evaluated as Warning.\nThe percentage is calculated by dividing the number of unhealthy partitions over the total number of partitions in the service.\nThe computation rounds up to tolerate one failure on small numbers of partitions. Default percentage is zero.",
          "default": 0
        },
        "MaxPercentUnhealthyReplicasPerPartition": {
          "type": "integer",
          "description": "The maximum allowed percentage of unhealthy replicas per partition. Allowed values are Byte values from zero to 100.\n\nThe percentage represents the maximum tolerated percentage of replicas that can be unhealthy before the partition is considered in error.\nIf the percentage is respected but there is at least one unhealthy replica, the health is evaluated as Warning.\nThe percentage is calculated by dividing the number of unhealthy replicas over the total number of replicas in the partition.\nThe computation rounds up to tolerate one failure on small numbers of replicas. Default percentage is zero.",
          "default": 0
        },
        "MaxPercentUnhealthyServices": {
          "type": "integer",
          "description": "The maximum allowed percentage of unhealthy services. Allowed values are Byte values from zero to 100.\n\nThe percentage represents the maximum tolerated percentage of services that can be unhealthy before the application is considered in error.\nIf the percentage is respected but there is at least one unhealthy service, the health is evaluated as Warning.\nThis is calculated by dividing the number of unhealthy services of the specific service type over the total number of services of the specific service type.\nThe computation rounds up to tolerate one failure on small numbers of services. Default percentage is zero.",
          "default": 0
        }
      }
    },
    "ServiceTypeHealthPolicyMap": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ServiceTypeHealthPolicyMapItem"
      },
      "description": "Defines a ServiceTypeHealthPolicy per service type name.\n\nThe entries in the map replace the default service type health policy for each specified service type. For example, in an application that contains both a stateless gateway service type and a stateful engine service type, the health policies for the stateless and stateful services can be configured differently. With policy per service type, there's more granular control of the health of the service.\n\nIf no policy is specified for a service type name, the DefaultServiceTypeHealthPolicy is used for evaluation."
    },
    "ServiceTypeHealthPolicyMapItem": {
      "description": "Defines an item in ServiceTypeHealthPolicyMap.",
      "required": [
        "Key",
        "Value"
      ],
      "properties": {
        "Key": {
          "type": "string",
          "description": "The key of the service type health policy map item. This is the name of the service type."
        },
        "Value": {
          "$ref": "#/$defs/ServiceTypeHealthPolicy"
        }
      }
    }
  }
}