{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-service-fabric/json-schema/microsoft-azure-service-fabric-chaos-parameters-schema.json",
  "title": "ChaosParameters",
  "description": "Defines all the parameters to configure a Chaos run.",
  "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/ChaosParameters",
  "properties": {
    "TimeToRunInSeconds": {
      "type": "string",
      "description": "Total time (in seconds) for which Chaos will run before automatically stopping. The maximum allowed value is 4,294,967,295 (System.UInt32.MaxValue).",
      "default": "4294967295"
    },
    "MaxClusterStabilizationTimeoutInSeconds": {
      "type": "integer",
      "format": "int64",
      "description": "The maximum amount of time to wait for all cluster entities to become stable and healthy. Chaos executes in iterations and at the start of each iteration it validates the health of cluster entities.\nDuring validation if a cluster entity is not stable and healthy within MaxClusterStabilizationTimeoutInSeconds, Chaos generates a validation failed event.",
      "default": 60,
      "minimum": 0,
      "maximum": 4294967295
    },
    "MaxConcurrentFaults": {
      "type": "integer",
      "format": "int64",
      "description": "MaxConcurrentFaults is the maximum number of concurrent faults induced per iteration.\nChaos executes in iterations and two consecutive iterations are separated by a validation phase.\nThe higher the concurrency, the more aggressive the injection of faults, leading to inducing more complex series of states to uncover bugs.\nThe recommendation is to start with a value of 2 or 3 and to exercise caution while moving up.",
      "default": 1,
      "minimum": 0,
      "maximum": 4294967295
    },
    "EnableMoveReplicaFaults": {
      "type": "boolean",
      "description": "Enables or disables the move primary and move secondary faults.",
      "default": true
    },
    "WaitTimeBetweenFaultsInSeconds": {
      "type": "integer",
      "format": "int64",
      "description": "Wait time (in seconds) between consecutive faults within a single iteration.\nThe larger the value, the lower the overlapping between faults and the simpler the sequence of state transitions that the cluster goes through.\nThe recommendation is to start with a value between 1 and 5 and exercise caution while moving up.",
      "default": 20,
      "minimum": 0,
      "maximum": 4294967295
    },
    "WaitTimeBetweenIterationsInSeconds": {
      "type": "integer",
      "format": "int64",
      "description": "Time-separation (in seconds) between two consecutive iterations of Chaos.\nThe larger the value, the lower the fault injection rate.",
      "default": 30,
      "minimum": 0,
      "maximum": 4294967295
    },
    "ClusterHealthPolicy": {
      "$ref": "#/$defs/ClusterHealthPolicy"
    },
    "Context": {
      "$ref": "#/$defs/ChaosContext"
    },
    "ChaosTargetFilter": {
      "$ref": "#/$defs/ChaosTargetFilter"
    }
  },
  "$defs": {
    "ApplicationName": {
      "type": "string",
      "description": "The name of the application, including the 'fabric:' URI scheme."
    },
    "ApplicationTypeHealthPolicyMap": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ApplicationTypeHealthPolicyMapItem"
      },
      "description": "Defines a map with max percentage unhealthy applications for specific application types.\nEach entry specifies as key the application type name and as value an integer that represents the MaxPercentUnhealthyApplications percentage used to evaluate the applications of the specified application type.\n\nThe application type health policy map can be used during cluster health evaluation to describe special application types.\nThe application types included in the map are evaluated against the percentage specified in the map, and not with the global MaxPercentUnhealthyApplications defined in the cluster health policy.\nThe applications of application types specified in the map are not counted against the global pool of applications.\nFor example, if some applications of a type are critical, the cluster administrator can add an entry to the map for that application type\nand assign it a value of 0% (that is, do not tolerate any failures).\nAll other applications can be evaluated with MaxPercentUnhealthyApplications set to 20% to tolerate some failures out of the thousands of application instances.\nThe application type health policy map is used only if the cluster manifest enables application type health evaluation using the configuration entry for HealthManager/EnableApplicationTypeHealthEvaluation."
    },
    "ApplicationTypeHealthPolicyMapItem": {
      "description": "Defines an item in ApplicationTypeHealthPolicyMap.",
      "required": [
        "Key",
        "Value"
      ],
      "properties": {
        "Key": {
          "type": "string",
          "description": "The key of the application type health policy map item. This is the name of the application type."
        },
        "Value": {
          "type": "integer",
          "description": "The value of the application type health policy map item.\nThe max percent unhealthy applications allowed for the application type. Must be between zero and 100."
        }
      }
    },
    "ChaosContext": {
      "description": "Describes a map, which is a collection of (string, string) type key-value pairs. The map can be used to record information about\nthe Chaos run. There cannot be more than 100 such pairs and each string (key or value) can be at most 4095 characters long.\nThis map is set by the starter of the Chaos run to optionally store the context about the specific run.",
      "properties": {
        "Map": {
          "$ref": "#/$defs/ChaosContextMap"
        }
      }
    },
    "ChaosContextMap": {
      "additionalProperties": {
        "type": "string"
      },
      "description": "Describes a map that contains a collection of ChaosContextMapItem's."
    },
    "ChaosTargetFilter": {
      "description": "Defines all filters for targeted Chaos faults, for example, faulting only certain node types or faulting only certain applications.\nIf ChaosTargetFilter is not used, Chaos faults all cluster entities. If ChaosTargetFilter is used, Chaos faults only the entities that meet the ChaosTargetFilter\nspecification. NodeTypeInclusionList and ApplicationInclusionList allow a union semantics only. It is not possible to specify an intersection\nof NodeTypeInclusionList and ApplicationInclusionList. For example, it is not possible to specify \"fault this application only when it is on that node type.\"\nOnce an entity is included in either NodeTypeInclusionList or ApplicationInclusionList, that entity cannot be excluded using ChaosTargetFilter. Even if\napplicationX does not appear in ApplicationInclusionList, in some Chaos iteration applicationX can be faulted because it happens to be on a node of nodeTypeY that is included\nin NodeTypeInclusionList. If both NodeTypeInclusionList and ApplicationInclusionList are null or empty, an ArgumentException is thrown.",
      "properties": {
        "NodeTypeInclusionList": {
          "type": "array",
          "description": "A list of node types to include in Chaos faults.\nAll types of faults (restart node, restart code package, remove replica, restart replica, move primary, and move secondary) are enabled for the nodes of these node types.\nIf a node type (say NodeTypeX) does not appear in the NodeTypeInclusionList, then node level faults (like NodeRestart) will never be enabled for the nodes of\nNodeTypeX, but code package and replica faults can still be enabled for NodeTypeX if an application in the ApplicationInclusionList.\nhappens to reside on a node of NodeTypeX.\nAt most 100 node type names can be included in this list, to increase this number, a config upgrade is required for MaxNumberOfNodeTypesInChaosEntityFilter configuration.",
          "items": {
            "$ref": "#/$defs/NodeType"
          }
        },
        "ApplicationInclusionList": {
          "type": "array",
          "description": "A list of application URIs to include in Chaos faults.\nAll replicas belonging to services of these applications are amenable to replica faults (restart replica, remove replica, move primary, and move secondary) by Chaos.\nChaos may restart a code package only if the code package hosts replicas of these applications only.\nIf an application does not appear in this list, it can still be faulted in some Chaos iteration if the application ends up on a node of a node type that is included in NodeTypeInclusionList.\nHowever, if applicationX is tied to nodeTypeY through placement constraints and applicationX is absent from ApplicationInclusionList and nodeTypeY is absent from NodeTypeInclusionList, then applicationX will never be faulted.\nAt most 1000 application names can be included in this list, to increase this number, a config upgrade is required for MaxNumberOfApplicationsInChaosEntityFilter configuration.",
          "items": {
            "$ref": "#/$defs/ApplicationName"
          }
        }
      }
    },
    "ClusterHealthPolicy": {
      "description": "Defines a health policy used to evaluate the health of the cluster or of a cluster node.",
      "properties": {
        "ConsiderWarningAsError": {
          "type": "boolean",
          "description": "Indicates whether warnings are treated with the same severity as errors.",
          "default": false
        },
        "MaxPercentUnhealthyNodes": {
          "type": "integer",
          "description": "The maximum allowed percentage of unhealthy nodes before reporting an error. For example, to allow 10% of nodes to be unhealthy, this value would be 10.\n\nThe percentage represents the maximum tolerated percentage of nodes that can be unhealthy before the cluster is considered in error.\nIf the percentage is respected but there is at least one unhealthy node, the health is evaluated as Warning.\nThe percentage is calculated by dividing the number of unhealthy nodes over the total number of nodes in the cluster.\nThe computation rounds up to tolerate one failure on small numbers of nodes. Default percentage is zero.\n\nIn large clusters, some nodes will always be down or out for repairs, so this percentage should be configured to tolerate that.",
          "default": 0
        },
        "MaxPercentUnhealthyApplications": {
          "type": "integer",
          "description": "The maximum allowed percentage of unhealthy applications before reporting an error. For example, to allow 10% of applications to be unhealthy, this value would be 10.\n\nThe percentage represents the maximum tolerated percentage of applications that can be unhealthy before the cluster is considered in error.\nIf the percentage is respected but there is at least one unhealthy application, the health is evaluated as Warning.\nThis is calculated by dividing the number of unhealthy applications over the total number of application instances in the cluster, excluding applications of application types that are included in the ApplicationTypeHealthPolicyMap.\nThe computation rounds up to tolerate one failure on small numbers of applications. Default percentage is zero.",
          "default": 0
        },
        "ApplicationTypeHealthPolicyMap": {
          "$ref": "#/$defs/ApplicationTypeHealthPolicyMap"
        },
        "NodeTypeHealthPolicyMap": {
          "$ref": "#/$defs/NodeTypeHealthPolicyMap"
        }
      }
    },
    "NodeType": {
      "type": "string",
      "description": "The type name of a Service Fabric node.\nRefer to the article [The relationship between Service Fabric node types and Virtual Machine Scale Sets](https://docs.microsoft.com/azure/service-fabric/service-fabric-cluster-nodetypes) for more details."
    },
    "NodeTypeHealthPolicyMap": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/NodeTypeHealthPolicyMapItem"
      },
      "description": "Defines a map with max percentage unhealthy nodes for specific node types.\nEach entry specifies as key the node type name and as value an integer that represents the MaxPercentUnhealthyNodes percentage used to evaluate the nodes of the specified node type.\n\nThe node type health policy map can be used during cluster health evaluation to describe special node types. \nThey are evaluated against the percentages associated with their node type name in the map. \nSetting this has no impact on the global pool of nodes used for MaxPercentUnhealthyNodes. \nThe node type health policy map is used only if the cluster manifest enables node type health evaluation using the configuration entry for HealthManager/EnableNodeTypeHealthEvaluation.\n\nFor example, given a cluster with many nodes of different types, with important work hosted on node type \"SpecialNodeType\" that should not tolerate any nodes down. \nYou can specify global MaxPercentUnhealthyNodes to 20% to tolerate some failures for all nodes, but for the node type \"SpecialNodeType\", set the MaxPercentUnhealthyNodes to 0 by \nsetting the value in the key value pair in NodeTypeHealthPolicyMapItem. The key is the node type name. \nThis way, as long as no nodes of type \"SpecialNodeType\" are in Error state, \neven if some of the many nodes in the global pool are in Error state, but below the global unhealthy percentage, the cluster would be evaluated to Warning. \nA Warning health state does not impact cluster upgrade or other monitoring triggered by Error health state. \nBut even one node of type SpecialNodeType in Error would make cluster unhealthy (in Error rather than Warning/Ok), which triggers rollback or pauses the cluster upgrade, depending on the upgrade configuration. \n\nConversely, setting the global MaxPercentUnhealthyNodes to 0, and setting SpecialNodeType's max percent unhealthy nodes to 100, \nwith one node of type SpecialNodeType in Error state would still put the cluster in an Error state, since the global restriction is more strict in this case."
    },
    "NodeTypeHealthPolicyMapItem": {
      "description": "Defines an item in NodeTypeHealthPolicyMap.",
      "required": [
        "Key",
        "Value"
      ],
      "properties": {
        "Key": {
          "type": "string",
          "description": "The key of the node type health policy map item. This is the name of the node type."
        },
        "Value": {
          "type": "integer",
          "description": "The value of the node type health policy map item.\nIf the percentage is respected but there is at least one unhealthy node in the node type, the health is evaluated as Warning. \nThe percentage is calculated by dividing the number of unhealthy nodes over the total number of nodes in the node type. \nThe computation rounds up to tolerate one failure on small numbers of nodes.\nThe max percent unhealthy nodes allowed for the node type. Must be between zero and 100."
        }
      }
    }
  }
}