{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-service-fabric/json-schema/microsoft-azure-service-fabric-service-update-description-schema.json",
  "title": "ServiceUpdateDescription",
  "description": "A ServiceUpdateDescription contains all of the information necessary to update a service.",
  "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/ServiceUpdateDescription",
  "required": [
    "ServiceKind"
  ],
  "properties": {
    "ServiceKind": {
      "$ref": "#/$defs/ServiceKind"
    },
    "Flags": {
      "type": "string",
      "description": "Flags indicating whether other properties are set. Each of the associated properties corresponds to a flag, specified below, which, if set, indicate that the property is specified.\nThis property can be a combination of those flags obtained using bitwise 'OR' operator.\nFor example, if the provided value is 6 then the flags for ReplicaRestartWaitDuration (2) and QuorumLossWaitDuration (4) are set.\n\n- None - Does not indicate any other properties are set. The value is zero.\n- TargetReplicaSetSize/InstanceCount - Indicates whether the TargetReplicaSetSize property (for Stateful services) or the InstanceCount property (for Stateless services) is set. The value is 1.\n- ReplicaRestartWaitDuration - Indicates the ReplicaRestartWaitDuration property is set. The value is  2.\n- QuorumLossWaitDuration - Indicates the QuorumLossWaitDuration property is set. The value is 4.\n- StandByReplicaKeepDuration - Indicates the StandByReplicaKeepDuration property is set. The value is 8.\n- MinReplicaSetSize - Indicates the MinReplicaSetSize property is set. The value is 16.\n- PlacementConstraints - Indicates the PlacementConstraints property is set. The value is 32.\n- PlacementPolicyList - Indicates the ServicePlacementPolicies property is set. The value is 64.\n- Correlation - Indicates the CorrelationScheme property is set. The value is 128.\n- Metrics - Indicates the ServiceLoadMetrics property is set. The value is 256.\n- DefaultMoveCost - Indicates the DefaultMoveCost property is set. The value is 512.\n- ScalingPolicy - Indicates the ScalingPolicies property is set. The value is 1024.\n- ServicePlacementTimeLimit - Indicates the ServicePlacementTimeLimit property is set. The value is 2048.\n- MinInstanceCount - Indicates the MinInstanceCount property is set. The value is 4096.\n- MinInstancePercentage - Indicates the MinInstancePercentage property is set. The value is 8192.\n- InstanceCloseDelayDuration - Indicates the InstanceCloseDelayDuration property is set. The value is 16384.\n- InstanceRestartWaitDuration - Indicates the InstanceCloseDelayDuration property is set. The value is 32768.\n- DropSourceReplicaOnMove - Indicates the DropSourceReplicaOnMove property is set. The value is 65536.\n- ServiceDnsName - Indicates the ServiceDnsName property is set. The value is 131072.\n- TagsForPlacement - Indicates the TagsForPlacement property is set. The value is 1048576.\n- TagsForRunning - Indicates the TagsForRunning property is set. The value is 2097152."
    },
    "PlacementConstraints": {
      "type": "string",
      "description": "The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is blue specify the following: \"NodeColor == blue)\"."
    },
    "CorrelationScheme": {
      "$ref": "#/$defs/CorrelationSchemeList"
    },
    "LoadMetrics": {
      "$ref": "#/$defs/ServiceLoadMetricsList"
    },
    "ServicePlacementPolicies": {
      "$ref": "#/$defs/ServicePlacementPoliciesList"
    },
    "DefaultMoveCost": {
      "$ref": "#/$defs/MoveCost"
    },
    "ScalingPolicies": {
      "$ref": "#/$defs/ScalingPolicyDescriptionList"
    },
    "ServiceDnsName": {
      "type": "string",
      "description": "The DNS name of the service."
    },
    "TagsForPlacement": {
      "$ref": "#/$defs/NodeTagsDescription"
    },
    "TagsForRunning": {
      "$ref": "#/$defs/NodeTagsDescription"
    }
  },
  "$defs": {
    "CorrelationSchemeList": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ServiceCorrelationDescription"
      },
      "description": "A list that describes the correlation of the service with other services."
    },
    "MoveCost": {
      "type": "string",
      "description": "Specifies the move cost for the service.",
      "enum": [
        "Zero",
        "Low",
        "Medium",
        "High",
        "VeryHigh"
      ],
      "x-ms-enum": {
        "name": "MoveCost",
        "modelAsString": true,
        "values": [
          {
            "value": "Zero",
            "description": "Zero move cost. This value is zero."
          },
          {
            "value": "Low",
            "description": "Specifies the move cost of the service as Low. The value is 1."
          },
          {
            "value": "Medium",
            "description": "Specifies the move cost of the service as Medium. The value is 2."
          },
          {
            "value": "High",
            "description": "Specifies the move cost of the service as High. The value is 3."
          },
          {
            "value": "VeryHigh",
            "description": "Specifies the move cost of the service as VeryHigh. The value is 4."
          }
        ]
      }
    },
    "NodeTagsDescription": {
      "description": "Describes the tags required for placement or running of the service.",
      "required": [
        "Count",
        "Tags"
      ],
      "properties": {
        "Count": {
          "type": "integer",
          "description": "The number of tags."
        },
        "Tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Array of size specified by the ‘Count’ parameter, for the placement tags of the service."
        }
      }
    },
    "ScalingMechanismDescription": {
      "description": "Describes the mechanism for performing a scaling operation.",
      "required": [
        "Kind"
      ],
      "properties": {
        "Kind": {
          "$ref": "#/$defs/ScalingMechanismKind"
        }
      }
    },
    "ScalingMechanismKind": {
      "type": "string",
      "description": "Enumerates the ways that a service can be scaled.",
      "enum": [
        "Invalid",
        "PartitionInstanceCount",
        "AddRemoveIncrementalNamedPartition"
      ],
      "x-ms-enum": {
        "name": "ScalingMechanismKind",
        "modelAsString": true,
        "values": [
          {
            "value": "Invalid",
            "description": "Indicates the scaling mechanism is invalid. All Service Fabric enumerations have the invalid type. The value is zero."
          },
          {
            "value": "PartitionInstanceCount",
            "description": "Indicates a mechanism for scaling where new instances are added or removed from a partition. The value is 1."
          },
          {
            "value": "AddRemoveIncrementalNamedPartition",
            "description": "Indicates a mechanism for scaling where new named partitions are added or removed from a service. The value is 2."
          }
        ]
      }
    },
    "ScalingPolicyDescription": {
      "description": "Describes how the scaling should be performed",
      "required": [
        "ScalingTrigger",
        "ScalingMechanism"
      ],
      "properties": {
        "ScalingTrigger": {
          "$ref": "#/$defs/ScalingTriggerDescription"
        },
        "ScalingMechanism": {
          "$ref": "#/$defs/ScalingMechanismDescription"
        }
      }
    },
    "ScalingPolicyDescriptionList": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ScalingPolicyDescription"
      },
      "description": "A list that describes the scaling policies."
    },
    "ScalingTriggerDescription": {
      "description": "Describes the trigger for performing a scaling operation.",
      "required": [
        "Kind"
      ],
      "properties": {
        "Kind": {
          "$ref": "#/$defs/ScalingTriggerKind"
        }
      }
    },
    "ScalingTriggerKind": {
      "type": "string",
      "description": "Enumerates the ways that a service can be scaled.",
      "enum": [
        "Invalid",
        "AveragePartitionLoad",
        "AverageServiceLoad"
      ],
      "x-ms-enum": {
        "name": "ScalingTriggerKind",
        "modelAsString": true,
        "values": [
          {
            "value": "Invalid",
            "description": "Indicates the scaling trigger is invalid. All Service Fabric enumerations have the invalid type. The value is zero."
          },
          {
            "value": "AveragePartitionLoad",
            "description": "Indicates a trigger where scaling decisions are made based on average load of a partition. The value is 1."
          },
          {
            "value": "AverageServiceLoad",
            "description": "Indicates a trigger where scaling decisions are made based on average load of a service. The value is 2."
          }
        ]
      }
    },
    "ServiceCorrelationDescription": {
      "description": "Creates a particular correlation between services.",
      "required": [
        "Scheme",
        "ServiceName"
      ],
      "properties": {
        "Scheme": {
          "$ref": "#/$defs/ServiceCorrelationScheme"
        },
        "ServiceName": {
          "$ref": "#/$defs/ServiceName"
        }
      }
    },
    "ServiceCorrelationScheme": {
      "type": "string",
      "description": "The service correlation scheme.",
      "enum": [
        "Invalid",
        "Affinity",
        "AlignedAffinity",
        "NonAlignedAffinity"
      ],
      "x-ms-enum": {
        "name": "ServiceCorrelationScheme",
        "modelAsString": true,
        "values": [
          {
            "value": "Invalid",
            "description": "An invalid correlation scheme. Cannot be used. The value is zero."
          },
          {
            "value": "Affinity",
            "description": "Indicates that this service has an affinity relationship with another service. Provided for backwards compatibility, consider preferring the Aligned or NonAlignedAffinity options. The value is 1."
          },
          {
            "value": "AlignedAffinity",
            "description": "Aligned affinity ensures that the primaries of the partitions of the affinitized services are collocated on the same nodes. This is the default and is the same as selecting the Affinity scheme. The value is 2."
          },
          {
            "value": "NonAlignedAffinity",
            "description": "Non-Aligned affinity guarantees that all replicas of each service will be placed on the same nodes. Unlike Aligned Affinity, this does not guarantee that replicas of particular role will be collocated. The value is 3."
          }
        ]
      }
    },
    "ServiceKind": {
      "type": "string",
      "description": "The kind of service (Stateless or Stateful).",
      "enum": [
        "Invalid",
        "Stateless",
        "Stateful"
      ],
      "x-ms-enum": {
        "name": "ServiceKind",
        "modelAsString": true,
        "values": [
          {
            "value": "Invalid",
            "description": "Indicates the service kind is invalid. All Service Fabric enumerations have the invalid type. The value is zero."
          },
          {
            "value": "Stateless",
            "description": "Does not use Service Fabric to make its state highly available or reliable. The value is 1."
          },
          {
            "value": "Stateful",
            "description": "Uses Service Fabric to make its state or part of its state highly available and reliable. The value is 2."
          }
        ]
      }
    },
    "ServiceLoadMetricDescription": {
      "description": "Specifies a metric to load balance a service during runtime.",
      "required": [
        "Name"
      ],
      "properties": {
        "Name": {
          "type": "string",
          "description": "The name of the metric. If the service chooses to report load during runtime, the load metric name should match the name that is specified in Name exactly. Note that metric names are case-sensitive."
        },
        "Weight": {
          "$ref": "#/$defs/ServiceLoadMetricWeight"
        },
        "PrimaryDefaultLoad": {
          "type": "integer",
          "description": "Used only for Stateful services. The default amount of load, as a number, that this service creates for this metric when it is a Primary replica."
        },
        "SecondaryDefaultLoad": {
          "type": "integer",
          "description": "Used only for Stateful services. The default amount of load, as a number, that this service creates for this metric when it is a Secondary replica."
        },
        "AuxiliaryDefaultLoad": {
          "type": "integer",
          "description": "Used only for Stateful services. The default amount of load, as a number, that this service creates for this metric when it is an Auxiliary replica."
        },
        "DefaultLoad": {
          "type": "integer",
          "description": "Used only for Stateless services. The default amount of load, as a number, that this service creates for this metric."
        }
      }
    },
    "ServiceLoadMetricWeight": {
      "type": "string",
      "description": "Determines the metric weight relative to the other metrics that are configured for this service. During runtime, if two metrics end up in conflict, the Cluster Resource Manager prefers the metric with the higher weight.",
      "enum": [
        "Zero",
        "Low",
        "Medium",
        "High"
      ],
      "x-ms-enum": {
        "name": "ServiceLoadMetricWeight",
        "modelAsString": true,
        "values": [
          {
            "value": "Zero",
            "description": "Disables resource balancing for this metric. This value is zero."
          },
          {
            "value": "Low",
            "description": "Specifies the metric weight of the service load as Low. The value is 1."
          },
          {
            "value": "Medium",
            "description": "Specifies the metric weight of the service load as Medium. The value is 2."
          },
          {
            "value": "High",
            "description": "Specifies the metric weight of the service load as High. The value is 3."
          }
        ]
      }
    },
    "ServiceLoadMetricsList": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ServiceLoadMetricDescription"
      },
      "description": "The service load metrics is given as an array of ServiceLoadMetricDescription objects."
    },
    "ServiceName": {
      "type": "string",
      "description": "The full name of the service with 'fabric:' URI scheme."
    },
    "ServicePlacementPoliciesList": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ServicePlacementPolicyDescription"
      },
      "description": "A list that describes the correlation of the service with other services."
    },
    "ServicePlacementPolicyDescription": {
      "description": "Describes the policy to be used for placement of a Service Fabric service.",
      "required": [
        "Type"
      ],
      "properties": {
        "Type": {
          "$ref": "#/$defs/ServicePlacementPolicyType"
        }
      }
    },
    "ServicePlacementPolicyType": {
      "type": "string",
      "description": "The type of placement policy for a service fabric service. Following are the possible values.",
      "enum": [
        "Invalid",
        "InvalidDomain",
        "RequireDomain",
        "PreferPrimaryDomain",
        "RequireDomainDistribution",
        "NonPartiallyPlaceService",
        "AllowMultipleStatelessInstancesOnNode"
      ],
      "x-ms-enum": {
        "name": "ServicePlacementPolicyType",
        "modelAsString": true,
        "values": [
          {
            "value": "Invalid",
            "description": "Indicates the type of the placement policy is invalid. All Service Fabric enumerations have the invalid type. The value is zero."
          },
          {
            "value": "InvalidDomain",
            "description": "Indicates that the ServicePlacementPolicyDescription is of type ServicePlacementInvalidDomainPolicyDescription, which indicates that a particular fault or upgrade domain cannot be used for placement of this service. The value is 1."
          },
          {
            "value": "RequireDomain",
            "description": "Indicates that the ServicePlacementPolicyDescription is of type ServicePlacementRequireDomainDistributionPolicyDescription indicating that the replicas of the service must be placed in a specific domain. The value is 2."
          },
          {
            "value": "PreferPrimaryDomain",
            "description": "Indicates that the ServicePlacementPolicyDescription is of type ServicePlacementPreferPrimaryDomainPolicyDescription, which indicates that if possible the Primary replica for the partitions of the service should be located in a particular domain as an optimization. The value is 3."
          },
          {
            "value": "RequireDomainDistribution",
            "description": "Indicates that the ServicePlacementPolicyDescription is of type ServicePlacementRequireDomainDistributionPolicyDescription, indicating that the system will disallow placement of any two replicas from the same partition in the same domain at any time. The value is 4."
          },
          {
            "value": "NonPartiallyPlaceService",
            "description": "Indicates that the ServicePlacementPolicyDescription is of type ServicePlacementNonPartiallyPlaceServicePolicyDescription, which indicates that if possible all replicas of a particular partition of the service should be placed atomically. The value is 5."
          },
          {
            "value": "AllowMultipleStatelessInstancesOnNode",
            "description": "Indicates that the ServicePlacementPolicyDescription is of type ServicePlacementAllowMultipleStatelessInstancesOnNodePolicyDescription, which indicates that multiple stateless instances of a particular partition of the service can be placed on a node. The value is 6."
          }
        ]
      }
    }
  }
}