{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-kubernetes-service/json-schema/microsoft-azure-kubernetes-service-fleet-update-strategy-schema.json",
  "title": "FleetUpdateStrategy",
  "description": "Defines a multi-stage process to perform update operations across members of a Fleet.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_superseded/microsoft-azure-kubernetes-service-fleetupdatestrategies-api-openapi.yml#/components/schemas/FleetUpdateStrategy",
  "type": "object",
  "properties": {
    "properties": {
      "$ref": "#/$defs/FleetUpdateStrategyProperties",
      "description": "The resource-specific properties for this resource.",
      "x-ms-client-flatten": true
    },
    "eTag": {
      "type": "string",
      "description": "If eTag is provided in the response body, it may also be provided as a header per the normal etag convention.  Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.",
      "readOnly": true
    }
  },
  "allOf": [
    {
      "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ProxyResource"
    }
  ],
  "$defs": {
    "DayOfWeek": {
      "type": "string",
      "description": "The days of a week.",
      "enum": [
        "Monday",
        "Tuesday",
        "Wednesday",
        "Thursday",
        "Friday",
        "Saturday",
        "Sunday"
      ],
      "x-ms-enum": {
        "name": "DayOfWeek",
        "modelAsString": true,
        "values": [
          {
            "name": "Monday",
            "value": "Monday",
            "description": "The day Monday."
          },
          {
            "name": "Tuesday",
            "value": "Tuesday",
            "description": "The day Tuesday."
          },
          {
            "name": "Wednesday",
            "value": "Wednesday",
            "description": "The day Wednesday."
          },
          {
            "name": "Thursday",
            "value": "Thursday",
            "description": "The day Thursday."
          },
          {
            "name": "Friday",
            "value": "Friday",
            "description": "The day Friday."
          },
          {
            "name": "Saturday",
            "value": "Saturday",
            "description": "The day Saturday."
          },
          {
            "name": "Sunday",
            "value": "Sunday",
            "description": "The day Sunday."
          }
        ]
      }
    },
    "FleetUpdateStrategyProperties": {
      "type": "object",
      "description": "The properties of the UpdateStrategy.",
      "properties": {
        "provisioningState": {
          "$ref": "#/$defs/FleetUpdateStrategyProvisioningState",
          "description": "The provisioning state of the UpdateStrategy resource.",
          "readOnly": true
        },
        "strategy": {
          "$ref": "#/$defs/UpdateRunStrategy",
          "description": "Defines the update sequence of the clusters.",
          "x-ms-mutability": [
            "read",
            "update",
            "create"
          ]
        }
      },
      "required": [
        "strategy"
      ]
    },
    "FleetUpdateStrategyProvisioningState": {
      "type": "string",
      "description": "The provisioning state of the UpdateStrategy resource.",
      "enum": [
        "Succeeded",
        "Failed",
        "Canceled"
      ],
      "x-ms-enum": {
        "name": "FleetUpdateStrategyProvisioningState",
        "modelAsString": true,
        "values": [
          {
            "name": "Succeeded",
            "value": "Succeeded",
            "description": "Resource has been created."
          },
          {
            "name": "Failed",
            "value": "Failed",
            "description": "Resource creation failed."
          },
          {
            "name": "Canceled",
            "value": "Canceled",
            "description": "Resource creation was canceled."
          }
        ]
      },
      "readOnly": true
    },
    "GateConfiguration": {
      "type": "object",
      "description": "GateConfiguration is used to define where Gates should be placed within the Update Run.",
      "properties": {
        "displayName": {
          "type": "string",
          "description": "The human-readable display name of the Gate.",
          "minLength": 1,
          "maxLength": 100
        },
        "type": {
          "$ref": "#/$defs/GateType",
          "description": "The type of the Gate determines how it is completed."
        },
        "scheduledStartConfiguration": {
          "$ref": "#/$defs/ScheduledStartConfiguration",
          "description": "Scheduled start configuration for gates of type ScheduledStart."
        }
      },
      "required": [
        "type"
      ]
    },
    "GateType": {
      "type": "string",
      "description": "The type of the Gate determines how it is completed.",
      "enum": [
        "Approval",
        "ScheduledStart"
      ],
      "x-ms-enum": {
        "name": "GateType",
        "modelAsString": true,
        "values": [
          {
            "name": "Approval",
            "value": "Approval",
            "description": "An approval gate is completed by setting its state to be Completed."
          },
          {
            "name": "ScheduledStart",
            "value": "ScheduledStart",
            "description": "A scheduled start gate is automatically completed when the scheduled time is reached."
          }
        ]
      }
    },
    "MemberSelector": {
      "type": "object",
      "description": "Select members of a fleet.",
      "properties": {
        "byLabel": {
          "type": "string",
          "description": "Kubernetes-style label selector for selecting Fleet members, e.g. `env=production`.",
          "maxLength": 512,
          "x-ms-mutability": [
            "read",
            "create"
          ]
        }
      },
      "required": [
        "byLabel"
      ]
    },
    "ScheduledStartConfiguration": {
      "type": "object",
      "description": "Configuration for ScheduledStart gate",
      "properties": {
        "startDay": {
          "$ref": "#/$defs/DayOfWeek",
          "description": "The day of the week when the scheduled start occurs.",
          "x-ms-mutability": [
            "read",
            "create"
          ]
        },
        "startTime": {
          "type": "string",
          "description": "The local time of day when the scheduled start occurs in 24-hour (HH:mm) format.",
          "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$",
          "x-ms-mutability": [
            "read",
            "create"
          ]
        },
        "utcOffset": {
          "type": "string",
          "description": "The UTC offset for the scheduled time in HH:mm format, -14:00 to +14:00",
          "pattern": "^[+-]((0[0-9]|1[0-3]):[0-5][0-9]|14:00)$",
          "x-ms-mutability": [
            "read",
            "create"
          ]
        }
      },
      "required": [
        "startDay",
        "startTime",
        "utcOffset"
      ]
    },
    "UpdateGroup": {
      "type": "object",
      "description": "A group to be updated.",
      "properties": {
        "name": {
          "type": "string",
          "description": "Name of the group.\nIt must match a group name of an existing fleet member.",
          "minLength": 1,
          "maxLength": 50,
          "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$"
        },
        "maxConcurrency": {
          "type": "string",
          "description": "The max number of upgrades that can run concurrently in this specific group.\nActs as a ceiling (and not a quota) for the number of concurrent upgrades within the group you want to tolerate at a time.\nActual concurrency may be lower depending on stage-level concurrency limits or individual member conditions.\nGroup maxConcurrency has a min value of \"1\". The max value is min(number of clusters in the group, the stage maxConcurrency).\nIf no value is provided, defaults to 1.\nAccepts either:\n    • A fixed count, e.g. \"3\"\n    • A percentage, e.g. \"25%\" (range 1–100). Percentage is of the number of clusters in the group. \n      Fractional results are rounded down. A minimum of 1 upgrade is enforced.\nExamples:\n    • \"3\" --> up to 3 members from this group upgrade at once.\n    • \"100%\" --> “all at once”, up to all members for this group upgrade at the same time.\n    • \"25%\" --> up to 25% of the members in the group will be upgraded at the same time.",
          "pattern": "^(?:([1-9]\\d*)|([1-9]\\d?|100)%)$"
        },
        "memberSelector": {
          "$ref": "#/$defs/MemberSelector",
          "description": "Select the members of the group.\n  * If specified, label-based selection will override group name based selection,\n    and Name is only used as an identifier.\n  * If not specified, group name based selection will be used, and Name must match a\n    group name of an existing fleet member.",
          "x-ms-mutability": [
            "read",
            "create"
          ]
        },
        "beforeGates": {
          "type": "array",
          "description": "A list of Gates that will be created before this Group is executed.",
          "items": {
            "$ref": "#/$defs/GateConfiguration"
          },
          "x-ms-identifiers": []
        },
        "afterGates": {
          "type": "array",
          "description": "A list of Gates that will be created after this Group is executed.",
          "items": {
            "$ref": "#/$defs/GateConfiguration"
          },
          "x-ms-identifiers": []
        }
      },
      "required": [
        "name"
      ]
    },
    "UpdateRunStrategy": {
      "type": "object",
      "description": "Defines the update sequence of the clusters via stages and groups.\n\nStages within a run are executed sequentially one after another.\nGroups within a stage are executed in parallel.\nMember clusters within a group are updated sequentially one after another.\n\nA valid strategy contains no duplicate groups within or across stages.",
      "properties": {
        "stages": {
          "type": "array",
          "description": "The list of stages that compose this update run. Min size: 1.",
          "items": {
            "$ref": "#/$defs/UpdateStage"
          },
          "x-ms-identifiers": [
            "name"
          ]
        }
      },
      "required": [
        "stages"
      ]
    },
    "UpdateStage": {
      "type": "object",
      "description": "Defines a stage which contains the groups to update and the steps to take (e.g., wait for a time period) before starting the next stage.",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the stage. Must be unique within the UpdateRun.",
          "minLength": 1,
          "maxLength": 50,
          "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$"
        },
        "groups": {
          "type": "array",
          "description": "Defines the groups to be executed in parallel in this stage. Duplicate groups are not allowed. Min size: 1.",
          "items": {
            "$ref": "#/$defs/UpdateGroup"
          },
          "x-ms-identifiers": [
            "name"
          ]
        },
        "memberSelector": {
          "$ref": "#/$defs/MemberSelector",
          "description": "Select the members of the stage.\n  * If specified without UpdateGroup, one implicit group containing the selected members will be created.\n  * If specified with UpdateGroup, members will be pre-filtered before group-level selection logic is applied.\n  * If not specified, group-level selection logic will be used.",
          "x-ms-mutability": [
            "read",
            "create"
          ]
        },
        "afterStageWaitInSeconds": {
          "type": "integer",
          "format": "int32",
          "description": "The time in seconds to wait at the end of this stage before starting the next one. Defaults to 0 seconds if unspecified."
        },
        "maxConcurrency": {
          "type": "string",
          "description": "The max number of upgrades that can run concurrently across all groups in this stage.\nActs as a ceiling (and not a quota) for the number of concurrent upgrades within the stage you want to tolerate at a time.\nActual concurrency may be lower depending on group-level concurrency limits or individual member conditions.\nStage maxConcurrency has a min value of \"1\".\nAccepts either:\n    • A fixed count, e.g., \"3\"\n    • A percentage, e.g., \"25%\" (range 1–100). Percentage is of the total number of clusters across all groups in the stage.\n      Fractional results are rounded down. A minimum of 1 upgrade is enforced.\nExamples:\n    • \"3\"     --> up to 3 clusters from this stage upgrade at once (across all groups).\n    • \"100%\"  --> “all at once”; up to all clusters in this stage upgrade at the same time.\n    • \"25%\"   --> up to 25% of the stage’s total clusters upgrade at the same time.",
          "pattern": "^(?:([1-9]\\d*)|([1-9]\\d?|100)%)$"
        },
        "beforeGates": {
          "type": "array",
          "description": "A list of Gates that will be created before this Stage is executed.",
          "items": {
            "$ref": "#/$defs/GateConfiguration"
          },
          "x-ms-identifiers": []
        },
        "afterGates": {
          "type": "array",
          "description": "A list of Gates that will be created after this Stage is executed.",
          "items": {
            "$ref": "#/$defs/GateConfiguration"
          },
          "x-ms-identifiers": []
        }
      },
      "required": [
        "name"
      ]
    }
  }
}