diff --git a/specification/containerservice/Fleet.Management/examples/2025-04-01-preview/Gates_Get.json b/specification/containerservice/Fleet.Management/examples/2025-04-01-preview/Gates_Get.json new file mode 100644 index 000000000000..e1ce10435cea --- /dev/null +++ b/specification/containerservice/Fleet.Management/examples/2025-04-01-preview/Gates_Get.json @@ -0,0 +1,51 @@ +{ + "operationId": "Gates_Get", + "title": "Gets a Gate resource.", + "parameters": { + "api-version": "2025-04-01-preview", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "rg1", + "fleetName": "fleet1", + "gateName": "12345678-910a-bcde-f000-000000000000" + }, + "responses": { + "200": { + "headers": { + "ETag": "kd30rkdfo49=" + }, + "body": { + "id": "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/fleets/fleet-1/gates/12345678-910a-bcde-f000-000000000000", + "name": "12345678-910a-bcde-f000-000000000000", + "type": "Microsoft.ContainerService/fleets/gates", + "location": "East US", + "systemData": { + "createdBy": "someUser", + "createdByType": "User", + "createdAt": "2022-03-23T05:40:40.657Z", + "lastModifiedBy": "someOtherUser", + "lastModifiedByType": "User", + "lastModifiedAt": "2022-03-23T05:40:40.657Z" + }, + "eTag": "kd30rkdfo49=", + "properties": { + "provisioningState": "Succeeded", + "displayName": "Perform health checks after Group 1", + "target": { + "id": "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/fleets/fleet-1/updateRuns/run1", + "type": "UpdateRun", + "properties": { + "updateRun": { + "name": "run1", + "stage": "stage1", + "group": "group1", + "timing": "After" + } + } + }, + "gateType": "Approval", + "state": "Pending" + } + } + } + } +} diff --git a/specification/containerservice/Fleet.Management/examples/2025-04-01-preview/Gates_ListByFleet.json b/specification/containerservice/Fleet.Management/examples/2025-04-01-preview/Gates_ListByFleet.json new file mode 100644 index 000000000000..4ddffe8f1f6a --- /dev/null +++ b/specification/containerservice/Fleet.Management/examples/2025-04-01-preview/Gates_ListByFleet.json @@ -0,0 +1,52 @@ +{ + "operationId": "Gates_ListByFleet", + "title": "Lists the Gates of a Fleet.", + "parameters": { + "api-version": "2025-04-01-preview", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "rg1", + "fleetName": "fleet1" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/fleets/fleet-1/gates/12345678-910a-bcde-f000-000000000000", + "name": "12345678-910a-bcde-f000-000000000000", + "type": "Microsoft.ContainerService/fleets/gates", + "location": "East US", + "systemData": { + "createdBy": "someUser", + "createdByType": "User", + "createdAt": "2022-03-23T05:40:40.657Z", + "lastModifiedBy": "someOtherUser", + "lastModifiedByType": "User", + "lastModifiedAt": "2022-03-23T05:40:40.657Z" + }, + "eTag": "kd30rkdfo49=", + "properties": { + "provisioningState": "Succeeded", + "displayName": "Perform health checks after Group 1", + "target": { + "id": "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/fleets/fleet-1/updateRuns/run1", + "type": "UpdateRun", + "properties": { + "updateRun": { + "name": "run1", + "stage": "stage1", + "group": "group1", + "timing": "After" + } + } + }, + "gateType": "Approval", + "state": "Pending" + } + } + ], + "nextLink": null + } + } + } +} diff --git a/specification/containerservice/Fleet.Management/examples/2025-04-01-preview/Gates_Update.json b/specification/containerservice/Fleet.Management/examples/2025-04-01-preview/Gates_Update.json new file mode 100644 index 000000000000..e24dda9b8fe9 --- /dev/null +++ b/specification/containerservice/Fleet.Management/examples/2025-04-01-preview/Gates_Update.json @@ -0,0 +1,63 @@ +{ + "operationId": "Gates_Update", + "title": "Updates a Gate resource.", + "parameters": { + "api-version": "2025-04-01-preview", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "rg1", + "fleetName": "fleet1", + "gateName": "12345678-910a-bcde-f000-000000000000", + "properties": { + "location": "East US", + "properties": { + "state": "Completed" + } + } + }, + "responses": { + "200": { + "headers": { + "ETag": "23ujdflewrj3=" + }, + "body": { + "id": "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/fleets/fleet-1/gates/12345678-910a-bcde-f000-000000000000", + "name": "12345678-910a-bcde-f000-000000000000", + "type": "Microsoft.ContainerService/fleets/gates", + "location": "East US", + "systemData": { + "createdBy": "someUser", + "createdByType": "User", + "createdAt": "2022-03-23T05:40:40.657Z", + "lastModifiedBy": "someOtherUser", + "lastModifiedByType": "User", + "lastModifiedAt": "2022-03-23T05:40:40.657Z" + }, + "eTag": "kd30rkdfo49=", + "properties": { + "provisioningState": "Succeeded", + "displayName": "Perform health checks after Group 1", + "target": { + "id": "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/fleets/fleet-1/updateRuns/run1", + "type": "UpdateRun", + "properties": { + "updateRun": { + "name": "run1", + "stage": "stage1", + "group": "group1", + "timing": "After" + } + } + }, + "gateType": "Approval", + "state": "Completed" + } + } + }, + "202": { + "headers": { + "Retry-After": "20", + "Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerService/locations/eastus/operations/00000000-0000-0000-0000-000000000000?api-version=2022-02-01" + } + } + } +} diff --git a/specification/containerservice/Fleet.Management/examples/2025-04-01-preview/UpdateRuns_CreateOrUpdate.json b/specification/containerservice/Fleet.Management/examples/2025-04-01-preview/UpdateRuns_CreateOrUpdate.json index 06d90ae11d8e..6fca66afb217 100644 --- a/specification/containerservice/Fleet.Management/examples/2025-04-01-preview/UpdateRuns_CreateOrUpdate.json +++ b/specification/containerservice/Fleet.Management/examples/2025-04-01-preview/UpdateRuns_CreateOrUpdate.json @@ -16,7 +16,31 @@ "name": "stage1", "groups": [ { - "name": "group-a" + "name": "group-a", + "beforeGates": [ + { + "displayName": "gate before group-a", + "type": "Approval" + } + ], + "afterGates": [ + { + "displayName": "gate after group-a", + "type": "Approval" + } + ] + } + ], + "beforeGates": [ + { + "displayName": "gate before stage1", + "type": "Approval" + } + ], + "afterGates": [ + { + "displayName": "gate after stage1", + "type": "Approval" } ], "afterStageWaitInSeconds": 3600 @@ -58,7 +82,31 @@ "name": "stage1", "groups": [ { - "name": "group-a" + "name": "group-a", + "beforeGates": [ + { + "displayName": "gate before group-a", + "type": "Approval" + } + ], + "afterGates": [ + { + "displayName": "gate after group-a", + "type": "Approval" + } + ] + } + ], + "beforeGates": [ + { + "displayName": "gate before stage1", + "type": "Approval" + } + ], + "afterGates": [ + { + "displayName": "gate after stage1", + "type": "Approval" } ], "afterStageWaitInSeconds": 3600 @@ -76,12 +124,12 @@ }, "status": { "status": { - "state": "NotStarted" + "state": "Pending" }, "stages": [ { "status": { - "state": "NotStarted" + "state": "Pending" }, "name": "stage1", "groups": [ @@ -98,9 +146,42 @@ "name": "member-one", "clusterResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myClusters/providers/Microsoft.ContainerService/managedClusters/myCluster" } + ], + "beforeGates": [ + { + "displayName": "gate before group-a", + "status": { + "state": "NotStarted" + } + } + ], + "afterGates": [ + { + "displayName": "gate after group-a", + "status": { + "state": "NotStarted" + } + } ] } ], + "beforeGates": [ + { + "displayName": "gate before stage1", + "gateId": "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/fleets/fleet-1/gates/12345678-910a-bcde-f000-000000000000", + "status": { + "state": "Pending" + } + } + ], + "afterGates": [ + { + "displayName": "gate after stage1", + "status": { + "state": "NotStarted" + } + } + ], "afterStageWaitStatus": { "status": { "state": "NotStarted" @@ -136,7 +217,31 @@ "name": "stage1", "groups": [ { - "name": "group-a" + "name": "group-a", + "beforeGates": [ + { + "displayName": "gate before group-a", + "type": "Approval" + } + ], + "afterGates": [ + { + "displayName": "gate after group-a", + "type": "Approval" + } + ] + } + ], + "beforeGates": [ + { + "displayName": "gate before stage1", + "type": "Approval" + } + ], + "afterGates": [ + { + "displayName": "gate after stage1", + "type": "Approval" } ], "afterStageWaitInSeconds": 3600 @@ -154,12 +259,12 @@ }, "status": { "status": { - "state": "NotStarted" + "state": "Pending" }, "stages": [ { "status": { - "state": "NotStarted" + "state": "Pending" }, "name": "stage1", "groups": [ @@ -176,9 +281,42 @@ "name": "member-one", "clusterResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myClusters/providers/Microsoft.ContainerService/managedClusters/myCluster" } + ], + "beforeGates": [ + { + "displayName": "gate before group-a", + "status": { + "state": "NotStarted" + } + } + ], + "afterGates": [ + { + "displayName": "gate after group-a", + "status": { + "state": "NotStarted" + } + } ] } ], + "beforeGates": [ + { + "displayName": "gate before stage1", + "gateId": "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/fleets/fleet-1/gates/12345678-910a-bcde-f000-000000000000", + "status": { + "state": "Pending" + } + } + ], + "afterGates": [ + { + "displayName": "gate after stage1", + "status": { + "state": "NotStarted" + } + } + ], "afterStageWaitStatus": { "status": { "state": "NotStarted" diff --git a/specification/containerservice/Fleet.Management/examples/2025-04-01-preview/UpdateRuns_Get.json b/specification/containerservice/Fleet.Management/examples/2025-04-01-preview/UpdateRuns_Get.json index 3abfd89ed1db..4a7b37feb883 100644 --- a/specification/containerservice/Fleet.Management/examples/2025-04-01-preview/UpdateRuns_Get.json +++ b/specification/containerservice/Fleet.Management/examples/2025-04-01-preview/UpdateRuns_Get.json @@ -30,7 +30,31 @@ "name": "stage1", "groups": [ { - "name": "group-a" + "name": "group-a", + "beforeGates": [ + { + "displayName": "gate before group-a", + "type": "Approval" + } + ], + "afterGates": [ + { + "displayName": "gate after group-a", + "type": "Approval" + } + ] + } + ], + "beforeGates": [ + { + "displayName": "gate before stage1", + "type": "Approval" + } + ], + "afterGates": [ + { + "displayName": "gate after stage1", + "type": "Approval" } ], "afterStageWaitInSeconds": 3600 @@ -48,12 +72,12 @@ }, "status": { "status": { - "state": "NotStarted" + "state": "Pending" }, "stages": [ { "status": { - "state": "NotStarted" + "state": "Pending" }, "name": "stage1", "groups": [ @@ -70,9 +94,42 @@ "name": "member-one", "clusterResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myClusters/providers/Microsoft.ContainerService/managedClusters/myCluster" } + ], + "beforeGates": [ + { + "displayName": "gate before group-a", + "status": { + "state": "NotStarted" + } + } + ], + "afterGates": [ + { + "displayName": "gate after group-a", + "status": { + "state": "NotStarted" + } + } ] } ], + "beforeGates": [ + { + "displayName": "gate before stage1", + "gateId": "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/fleets/fleet-1/gates/12345678-910a-bcde-f000-000000000000", + "status": { + "state": "Pending" + } + } + ], + "afterGates": [ + { + "displayName": "gate after stage1", + "status": { + "state": "NotStarted" + } + } + ], "afterStageWaitStatus": { "status": { "state": "NotStarted" diff --git a/specification/containerservice/Fleet.Management/examples/2025-04-01-preview/UpdateRuns_ListByFleet.json b/specification/containerservice/Fleet.Management/examples/2025-04-01-preview/UpdateRuns_ListByFleet.json index 1a46b217a7a7..9145285b232c 100644 --- a/specification/containerservice/Fleet.Management/examples/2025-04-01-preview/UpdateRuns_ListByFleet.json +++ b/specification/containerservice/Fleet.Management/examples/2025-04-01-preview/UpdateRuns_ListByFleet.json @@ -31,7 +31,31 @@ "name": "stage1", "groups": [ { - "name": "group-a" + "name": "group-a", + "beforeGates": [ + { + "displayName": "gate before group-a", + "type": "Approval" + } + ], + "afterGates": [ + { + "displayName": "gate after group-a", + "type": "Approval" + } + ] + } + ], + "beforeGates": [ + { + "displayName": "gate before stage1", + "type": "Approval" + } + ], + "afterGates": [ + { + "displayName": "gate after stage1", + "type": "Approval" } ], "afterStageWaitInSeconds": 3600 @@ -49,12 +73,12 @@ }, "status": { "status": { - "state": "NotStarted" + "state": "Pending" }, "stages": [ { "status": { - "state": "NotStarted" + "state": "Pending" }, "name": "stage1", "groups": [ @@ -71,9 +95,42 @@ "name": "member-one", "clusterResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myClusters/providers/Microsoft.ContainerService/managedClusters/myCluster" } + ], + "beforeGates": [ + { + "displayName": "gate before group-a", + "status": { + "state": "NotStarted" + } + } + ], + "afterGates": [ + { + "displayName": "gate after group-a", + "status": { + "state": "NotStarted" + } + } ] } ], + "beforeGates": [ + { + "displayName": "gate before stage1", + "gateId": "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/fleets/fleet-1/gates/12345678-910a-bcde-f000-000000000000", + "status": { + "state": "Pending" + } + } + ], + "afterGates": [ + { + "displayName": "gate after stage1", + "status": { + "state": "NotStarted" + } + } + ], "afterStageWaitStatus": { "status": { "state": "NotStarted" diff --git a/specification/containerservice/Fleet.Management/examples/2025-04-01-preview/UpdateStrategies_CreateOrUpdate.json b/specification/containerservice/Fleet.Management/examples/2025-04-01-preview/UpdateStrategies_CreateOrUpdate.json index 1f6c199670a8..e114e8a23030 100644 --- a/specification/containerservice/Fleet.Management/examples/2025-04-01-preview/UpdateStrategies_CreateOrUpdate.json +++ b/specification/containerservice/Fleet.Management/examples/2025-04-01-preview/UpdateStrategies_CreateOrUpdate.json @@ -6,7 +6,7 @@ "subscriptionId": "00000000-0000-0000-0000-000000000000", "resourceGroupName": "rg1", "fleetName": "fleet1", - "updateStrategyName": "strartegy1", + "updateStrategyName": "strategy1", "resource": { "properties": { "strategy": { @@ -15,7 +15,31 @@ "name": "stage1", "groups": [ { - "name": "group-a" + "name": "group-a", + "beforeGates": [ + { + "displayName": "gate before group-a", + "type": "Approval" + } + ], + "afterGates": [ + { + "displayName": "gate after group-a", + "type": "Approval" + } + ] + } + ], + "beforeGates": [ + { + "displayName": "gate before stage1", + "type": "Approval" + } + ], + "afterGates": [ + { + "displayName": "gate after stage1", + "type": "Approval" } ], "afterStageWaitInSeconds": 3600 @@ -47,7 +71,31 @@ "name": "stage1", "groups": [ { - "name": "group-a" + "name": "group-a", + "beforeGates": [ + { + "displayName": "gate before group-a", + "type": "Approval" + } + ], + "afterGates": [ + { + "displayName": "gate after group-a", + "type": "Approval" + } + ] + } + ], + "beforeGates": [ + { + "displayName": "gate before stage1", + "type": "Approval" + } + ], + "afterGates": [ + { + "displayName": "gate after stage1", + "type": "Approval" } ], "afterStageWaitInSeconds": 3600 @@ -79,7 +127,31 @@ "name": "stage1", "groups": [ { - "name": "group-a" + "name": "group-a", + "beforeGates": [ + { + "displayName": "gate before group-a", + "type": "Approval" + } + ], + "afterGates": [ + { + "displayName": "gate after group-a", + "type": "Approval" + } + ] + } + ], + "beforeGates": [ + { + "displayName": "gate before stage1", + "type": "Approval" + } + ], + "afterGates": [ + { + "displayName": "gate after stage1", + "type": "Approval" } ], "afterStageWaitInSeconds": 3600 diff --git a/specification/containerservice/Fleet.Management/examples/2025-04-01-preview/UpdateStrategies_Get.json b/specification/containerservice/Fleet.Management/examples/2025-04-01-preview/UpdateStrategies_Get.json index 0b051b1af882..25aaeede995a 100644 --- a/specification/containerservice/Fleet.Management/examples/2025-04-01-preview/UpdateStrategies_Get.json +++ b/specification/containerservice/Fleet.Management/examples/2025-04-01-preview/UpdateStrategies_Get.json @@ -30,7 +30,31 @@ "name": "stage1", "groups": [ { - "name": "group-a" + "name": "group-a", + "beforeGates": [ + { + "displayName": "gate before group-a", + "type": "Approval" + } + ], + "afterGates": [ + { + "displayName": "gate after group-a", + "type": "Approval" + } + ] + } + ], + "beforeGates": [ + { + "displayName": "gate before stage1", + "type": "Approval" + } + ], + "afterGates": [ + { + "displayName": "gate after stage1", + "type": "Approval" } ], "afterStageWaitInSeconds": 3600 diff --git a/specification/containerservice/Fleet.Management/examples/2025-04-01-preview/UpdateStrategies_ListByFleet.json b/specification/containerservice/Fleet.Management/examples/2025-04-01-preview/UpdateStrategies_ListByFleet.json index ec71556b2910..e4496ed71ab3 100644 --- a/specification/containerservice/Fleet.Management/examples/2025-04-01-preview/UpdateStrategies_ListByFleet.json +++ b/specification/containerservice/Fleet.Management/examples/2025-04-01-preview/UpdateStrategies_ListByFleet.json @@ -31,7 +31,31 @@ "name": "stage1", "groups": [ { - "name": "group-a" + "name": "group-a", + "beforeGates": [ + { + "displayName": "gate before group-a", + "type": "Approval" + } + ], + "afterGates": [ + { + "displayName": "gate after group-a", + "type": "Approval" + } + ] + } + ], + "beforeGates": [ + { + "displayName": "gate before stage1", + "type": "Approval" + } + ], + "afterGates": [ + { + "displayName": "gate after stage1", + "type": "Approval" } ], "afterStageWaitInSeconds": 3600 diff --git a/specification/containerservice/Fleet.Management/gate.tsp b/specification/containerservice/Fleet.Management/gate.tsp new file mode 100644 index 000000000000..69686d946f35 --- /dev/null +++ b/specification/containerservice/Fleet.Management/gate.tsp @@ -0,0 +1,204 @@ +import "@typespec/rest"; +import "./helpers.tsp"; + +using TypeSpec.Http; +using TypeSpec.Rest; +using TypeSpec.Versioning; +using Azure.Core; +using Azure.ResourceManager; +using TypeSpec.OpenAPI; + +namespace Microsoft.ContainerService; + +@doc("A Gate controls the progression during a staged rollout, e.g. in an Update Run.") +@added(Versions.v2025_04_01_preview) +@resource("gates") +@parentResource(Fleet) +model Gate is TrackedResource { + @doc("The name of the Gate resource, a GUID.") + @pattern("^[0-9a-f]{8}[-][0-9a-f]{4}[-][0-9a-f]{4}[-][0-9a-f]{4}[-][0-9a-f]{12}$") + @minLength(36) + @maxLength(36) + @key("gateName") + @path + @segment("gates") + @visibility(Lifecycle.Read) + name: string; + + ...EntityTagProperty; +} + +@doc("The type of the Gate determines how it is completed.") +@added(Versions.v2025_04_01_preview) +union GateType { + string, + + @doc("An approval gate is completed by setting its state to be Completed.") + Approval: "Approval", +} + +@doc("The state of the Gate.") +@added(Versions.v2025_04_01_preview) +union GateState { + string, + + @doc("A Pending Gate will continue to block the staged rollout process it is controlling.") + Pending: "Pending", + + @doc("An Completed Gate allows the staged rollout process to continue.") + Completed: "Completed", +} + +@doc("A Gate controls the progression during a staged rollout, e.g. in an Update Run.") +@added(Versions.v2025_04_01_preview) +model GateProperties { + // adding a response header in the model currently impacts the model used in the List result model. + // omitting it for now as response headers do not impact SDK generation. + // ...EtagResponseEnvelope; + + @doc("The provisioning state of the Gate resource.") + @visibility(Lifecycle.Read) + provisioningState?: GateProvisioningState; + + @doc("The human-readable display name of the Gate.") + @visibility(Lifecycle.Create, Lifecycle.Read) + @pattern("^[A-Za-z0-9].*$") + @minLength(1) + @maxLength(100) + displayName?: string; + + @doc("The target that the Gate is controlling, e.g. an Update Run.") + @visibility(Lifecycle.Create, Lifecycle.Read) + target: GateTarget; + + @doc("The type of the Gate determines how it is completed.") + @visibility(Lifecycle.Create, Lifecycle.Read) + gateType: GateType; + + @doc("The state of the Gate.") + @visibility(Lifecycle.Create, Lifecycle.Update, Lifecycle.Read) + state: GateState; +} + +@doc("The type of the Gate target.") +@added(Versions.v2025_04_01_preview) +union GateTargetType { + string, + + @doc("The Gate targets an Update Run.") + UpdateRun: "UpdateRun", +} + +@doc("The type of staged rollout that the Gate is targeting.") +@added(Versions.v2025_04_01_preview) +union GateTargetProperties { + @doc("The Gate is controlling the staged rollout of an Update Run.") + updateRunProperties: UpdateRunGateTargetProperties, +} + +// A wrapper is needed because the union does not create one itself. Without it, properties of +// all different types would end up in a single `properties` model. +@doc("Wrapper object around the Update Run Gate Target Properties.") +@added(Versions.v2025_04_01_preview) +model UpdateRunGateTargetProperties { + @doc("Properties specific to the Update Run.") + updateRun: UpdateRunGateTarget; +} + +@doc("The Gate is targeting an Update Run staged rollout.") +@added(Versions.v2025_04_01_preview) +model UpdateRunGateTarget { + @doc("The name of the Update Run.") + @visibility(Lifecycle.Read) + @pattern("^[a-z0-9]([-a-z0-9]*[a-z0-9])?$") + @minLength(1) + @maxLength(50) + name: string; + + @doc("The Update Stage of the Update Run.") + @visibility(Lifecycle.Read) + @pattern("^[a-z0-9]([-a-z0-9]*[a-z0-9])?$") + @minLength(1) + @maxLength(50) + stage?: string; + + @doc("The Update Group of the Update Run.") + @visibility(Lifecycle.Read) + @pattern("^[a-z0-9]([-a-z0-9]*[a-z0-9])?$") + @minLength(1) + @maxLength(50) + group?: string; + + @doc("Whether the Gate is placed before or after the update itself.") + @visibility(Lifecycle.Create, Lifecycle.Read) + timing: Timing; +} + +@doc("Whether the Gate is placed before or after the target.") +@added(Versions.v2025_04_01_preview) +union Timing { + string, + + @doc("The Gate is before the target.") + Before: "Before", + + @doc("The Gate is after the target.") + After: "After", +} + +scalar UpdateRunResourceId + extends Azure.Core.armResourceIdentifier<[ + { + type: "Microsoft.ContainerService/fleets/updateRuns", + } + ]>; + +@doc("The resource id of staged rollout that the Gate is targeting.") +@added(Versions.v2025_04_01_preview) +union GateTargetId { + @doc("The Gate is controlling the staged rollout of an Update Run.") + updateRun: UpdateRunResourceId, +} + +@doc("The target that the Gate is controlling, e.g. an Update Run.") +@added(Versions.v2025_04_01_preview) +model GateTarget { + @doc("The resource id that the Gate is controlling the rollout of.") + @visibility(Lifecycle.Create, Lifecycle.Read) + id: GateTargetId; + + @doc("The type of the resource being targeted by this Gate.") + @visibility(Lifecycle.Create, Lifecycle.Read) + type: GateTargetType; + + @doc("Properties specific to the target of this Gate.") + @visibility(Lifecycle.Create, Lifecycle.Read) + properties: GateTargetProperties; +} + +@doc("The provisioning state of the Gate resource.") +@lroStatus +union GateProvisioningState { + string, + ResourceProvisioningState, +} + +@armResourceOperations +@added(Versions.v2025_04_01_preview) +interface Gates { + get is ArmResourceRead; + + // The create and delete APIs are both internal-only as Gates are created by the Update Run during + // its processing. As such, we only expose the update API here. + #suppress "@azure-tools/typespec-azure-core/invalid-final-state" "must change at next release" + @Azure.Core.useFinalStateVia("azure-async-operation") + update is ArmResourcePatchAsync< + Gate, + GateProperties, + Azure.ResourceManager.Foundations.BaseParameters & + IfMatchParameters & + IfNoneMatchParameters + >; + + listByFleet is ArmResourceListByParent; +} diff --git a/specification/containerservice/Fleet.Management/main.tsp b/specification/containerservice/Fleet.Management/main.tsp index 67831c2a942a..e0a5ce11e6d7 100644 --- a/specification/containerservice/Fleet.Management/main.tsp +++ b/specification/containerservice/Fleet.Management/main.tsp @@ -2,6 +2,7 @@ import "@typespec/versioning"; import "@azure-tools/typespec-azure-resource-manager"; import "./fleet.tsp"; import "./fleetmember.tsp"; +import "./gate.tsp"; import "./update/common.tsp"; import "./update/run.tsp"; import "./update/strategy.tsp"; diff --git a/specification/containerservice/Fleet.Management/update/common.tsp b/specification/containerservice/Fleet.Management/update/common.tsp index 258ff298c61a..d8c671c01746 100644 --- a/specification/containerservice/Fleet.Management/update/common.tsp +++ b/specification/containerservice/Fleet.Management/update/common.tsp @@ -1,5 +1,7 @@ import "@typespec/openapi"; + using TypeSpec.OpenAPI; +using TypeSpec.Versioning; namespace Microsoft.ContainerService; @@ -32,6 +34,16 @@ model UpdateStage { @doc("The time in seconds to wait at the end of this stage before starting the next one. Defaults to 0 seconds if unspecified.") afterStageWaitInSeconds?: int32; + + @doc("A list of Gates that will be created before this Stage is executed.") + @added(Versions.v2025_04_01_preview) + @extension("x-ms-identifiers", ["displayName"]) + beforeGates?: GateConfiguration[]; + + @doc("A list of Gates that will be created after this Stage is executed.") + @added(Versions.v2025_04_01_preview) + @extension("x-ms-identifiers", ["displayName"]) + afterGates?: GateConfiguration[]; } @doc("A group to be updated.") @@ -44,4 +56,27 @@ model UpdateGroup { @minLength(1) @maxLength(50) name: string; + + @doc("A list of Gates that will be created before this Group is executed.") + @added(Versions.v2025_04_01_preview) + @extension("x-ms-identifiers", ["displayName"]) + beforeGates?: GateConfiguration[]; + + @doc("A list of Gates that will be created after this Group is executed.") + @added(Versions.v2025_04_01_preview) + @extension("x-ms-identifiers", ["displayName"]) + afterGates?: GateConfiguration[]; +} + +@doc("GateConfiguration is used to define where Gates should be placed within the Update Run.") +@added(Versions.v2025_04_01_preview) +model GateConfiguration { + @doc("The human-readable display name of the Gate.") + @pattern("^[A-Za-z0-9].*$") + @minLength(1) + @maxLength(100) + displayName?: string; + + @doc("The type of the Gate determines how it is completed.") + type: GateType; } diff --git a/specification/containerservice/Fleet.Management/update/run.tsp b/specification/containerservice/Fleet.Management/update/run.tsp index 0614b271ccc6..7c9c12c98dc5 100644 --- a/specification/containerservice/Fleet.Management/update/run.tsp +++ b/specification/containerservice/Fleet.Management/update/run.tsp @@ -50,6 +50,13 @@ scalar AutoUpgradeProfileId } ]>; +scalar GateResourceId + extends Azure.Core.armResourceIdentifier<[ + { + type: "Microsoft.ContainerService/fleets/gates", + } + ]>; + @doc("The properties of the UpdateRun.") model UpdateRunProperties { @visibility("read") @@ -182,6 +189,9 @@ union UpdateState { @doc("The state of an UpdateRun/UpdateStage/UpdateGroup/MemberUpdate that has failed.") "Failed", + @doc("The state of an UpdateRun/UpdateStage/UpdateGroup/MemberUpdate that is pending.") + "Pending", + @doc("The state of an UpdateRun/UpdateStage/UpdateGroup/MemberUpdate that has completed.") "Completed", } @@ -254,6 +264,18 @@ model UpdateStageStatus { @doc("The list of groups to be updated as part of this UpdateStage.") groups?: UpdateGroupStatus[]; + @visibility("read") + @extension("x-ms-identifiers", ["displayName"]) + @doc("The list of Gates that will run before this UpdateStage.") + @added(Versions.v2025_04_01_preview) + beforeGates?: UpdateRunGateStatus[]; + + @visibility("read") + @extension("x-ms-identifiers", ["displayName"]) + @doc("The list of Gates that will run after this UpdateStage.") + @added(Versions.v2025_04_01_preview) + afterGates?: UpdateRunGateStatus[]; + @visibility("read") @doc("The status of the wait period configured on the UpdateStage.") afterStageWaitStatus?: WaitStatus; @@ -273,6 +295,18 @@ model UpdateGroupStatus { @extension("x-ms-identifiers", ["name"]) @doc("The list of member this UpdateGroup updates.") members?: MemberUpdateStatus[]; + + @visibility("read") + @extension("x-ms-identifiers", ["displayName"]) + @doc("The list of Gates that will run before this UpdateGroup.") + @added(Versions.v2025_04_01_preview) + beforeGates?: UpdateRunGateStatus[]; + + @visibility("read") + @extension("x-ms-identifiers", ["displayName"]) + @doc("The list of Gates that will run after this UpdateGroup.") + @added(Versions.v2025_04_01_preview) + afterGates?: UpdateRunGateStatus[]; } @doc("The status of the wait duration.") @@ -286,6 +320,25 @@ model WaitStatus { waitDurationInSeconds?: int32; } +@doc("The status of the Gate, as represented in the Update Run.") +@added(Versions.v2025_04_01_preview) +model UpdateRunGateStatus { + @doc("The human-readable display name of the Gate.") + @visibility("read") + @pattern("^[A-Za-z0-9].*$") + @minLength(1) + @maxLength(100) + displayName?: string; + + @doc("The resource id of the Gate.") + @visibility("read") + gateId?: GateResourceId; + + @doc("The status of the Gate.") + @visibility("read") + status?: UpdateStatus; +} + @doc("The status of a member update operation.") model MemberUpdateStatus { @visibility("read") diff --git a/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-03-15-preview/fleets.json b/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-03-15-preview/fleets.json index e417235fe678..95ef0a028187 100644 --- a/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-03-15-preview/fleets.json +++ b/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-03-15-preview/fleets.json @@ -2001,6 +2001,7 @@ "Stopping", "Stopped", "Failed", + "Pending", "Completed" ], "x-ms-enum": { @@ -2032,6 +2033,11 @@ "value": "Failed", "description": "The state of an UpdateRun/UpdateStage/UpdateGroup/MemberUpdate that has failed." }, + { + "name": "Pending", + "value": "Pending", + "description": "The state of an UpdateRun/UpdateStage/UpdateGroup/MemberUpdate that is pending." + }, { "name": "Completed", "value": "Completed", diff --git a/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-06-15-preview/fleets.json b/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-06-15-preview/fleets.json index 34920e3e1e53..eebab910ae0e 100644 --- a/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-06-15-preview/fleets.json +++ b/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-06-15-preview/fleets.json @@ -2205,6 +2205,7 @@ "Stopped", "Skipped", "Failed", + "Pending", "Completed" ], "x-ms-enum": { @@ -2241,6 +2242,11 @@ "value": "Failed", "description": "The state of an UpdateRun/UpdateStage/UpdateGroup/MemberUpdate that has failed." }, + { + "name": "Pending", + "value": "Pending", + "description": "The state of an UpdateRun/UpdateStage/UpdateGroup/MemberUpdate that is pending." + }, { "name": "Completed", "value": "Completed", diff --git a/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/fleets.json b/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/fleets.json index 8e46f5fb8893..4c25b49e3ad9 100644 --- a/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/fleets.json +++ b/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/fleets.json @@ -2626,6 +2626,7 @@ "Stopped", "Skipped", "Failed", + "Pending", "Completed" ], "x-ms-enum": { @@ -2662,6 +2663,11 @@ "value": "Failed", "description": "The state of an UpdateRun/UpdateStage/UpdateGroup/MemberUpdate that has failed." }, + { + "name": "Pending", + "value": "Pending", + "description": "The state of an UpdateRun/UpdateStage/UpdateGroup/MemberUpdate that is pending." + }, { "name": "Completed", "value": "Completed", diff --git a/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-02-02-preview/fleets.json b/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-02-02-preview/fleets.json index 7fb3a46f3a10..16f0c9adaf27 100644 --- a/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-02-02-preview/fleets.json +++ b/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-02-02-preview/fleets.json @@ -2800,6 +2800,7 @@ "Stopped", "Skipped", "Failed", + "Pending", "Completed" ], "x-ms-enum": { @@ -2836,6 +2837,11 @@ "value": "Failed", "description": "The state of an UpdateRun/UpdateStage/UpdateGroup/MemberUpdate that has failed." }, + { + "name": "Pending", + "value": "Pending", + "description": "The state of an UpdateRun/UpdateStage/UpdateGroup/MemberUpdate that is pending." + }, { "name": "Completed", "value": "Completed", diff --git a/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-05-02-preview/fleets.json b/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-05-02-preview/fleets.json index 64f3de1da899..bea04d1fcd95 100644 --- a/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-05-02-preview/fleets.json +++ b/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-05-02-preview/fleets.json @@ -3261,6 +3261,7 @@ "Stopped", "Skipped", "Failed", + "Pending", "Completed" ], "x-ms-enum": { @@ -3297,6 +3298,11 @@ "value": "Failed", "description": "The state of an UpdateRun/UpdateStage/UpdateGroup/MemberUpdate that has failed." }, + { + "name": "Pending", + "value": "Pending", + "description": "The state of an UpdateRun/UpdateStage/UpdateGroup/MemberUpdate that is pending." + }, { "name": "Completed", "value": "Completed", diff --git a/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2025-04-01-preview/examples/Gates_Get.json b/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2025-04-01-preview/examples/Gates_Get.json new file mode 100644 index 000000000000..e1ce10435cea --- /dev/null +++ b/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2025-04-01-preview/examples/Gates_Get.json @@ -0,0 +1,51 @@ +{ + "operationId": "Gates_Get", + "title": "Gets a Gate resource.", + "parameters": { + "api-version": "2025-04-01-preview", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "rg1", + "fleetName": "fleet1", + "gateName": "12345678-910a-bcde-f000-000000000000" + }, + "responses": { + "200": { + "headers": { + "ETag": "kd30rkdfo49=" + }, + "body": { + "id": "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/fleets/fleet-1/gates/12345678-910a-bcde-f000-000000000000", + "name": "12345678-910a-bcde-f000-000000000000", + "type": "Microsoft.ContainerService/fleets/gates", + "location": "East US", + "systemData": { + "createdBy": "someUser", + "createdByType": "User", + "createdAt": "2022-03-23T05:40:40.657Z", + "lastModifiedBy": "someOtherUser", + "lastModifiedByType": "User", + "lastModifiedAt": "2022-03-23T05:40:40.657Z" + }, + "eTag": "kd30rkdfo49=", + "properties": { + "provisioningState": "Succeeded", + "displayName": "Perform health checks after Group 1", + "target": { + "id": "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/fleets/fleet-1/updateRuns/run1", + "type": "UpdateRun", + "properties": { + "updateRun": { + "name": "run1", + "stage": "stage1", + "group": "group1", + "timing": "After" + } + } + }, + "gateType": "Approval", + "state": "Pending" + } + } + } + } +} diff --git a/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2025-04-01-preview/examples/Gates_ListByFleet.json b/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2025-04-01-preview/examples/Gates_ListByFleet.json new file mode 100644 index 000000000000..4ddffe8f1f6a --- /dev/null +++ b/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2025-04-01-preview/examples/Gates_ListByFleet.json @@ -0,0 +1,52 @@ +{ + "operationId": "Gates_ListByFleet", + "title": "Lists the Gates of a Fleet.", + "parameters": { + "api-version": "2025-04-01-preview", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "rg1", + "fleetName": "fleet1" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/fleets/fleet-1/gates/12345678-910a-bcde-f000-000000000000", + "name": "12345678-910a-bcde-f000-000000000000", + "type": "Microsoft.ContainerService/fleets/gates", + "location": "East US", + "systemData": { + "createdBy": "someUser", + "createdByType": "User", + "createdAt": "2022-03-23T05:40:40.657Z", + "lastModifiedBy": "someOtherUser", + "lastModifiedByType": "User", + "lastModifiedAt": "2022-03-23T05:40:40.657Z" + }, + "eTag": "kd30rkdfo49=", + "properties": { + "provisioningState": "Succeeded", + "displayName": "Perform health checks after Group 1", + "target": { + "id": "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/fleets/fleet-1/updateRuns/run1", + "type": "UpdateRun", + "properties": { + "updateRun": { + "name": "run1", + "stage": "stage1", + "group": "group1", + "timing": "After" + } + } + }, + "gateType": "Approval", + "state": "Pending" + } + } + ], + "nextLink": null + } + } + } +} diff --git a/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2025-04-01-preview/examples/Gates_Update.json b/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2025-04-01-preview/examples/Gates_Update.json new file mode 100644 index 000000000000..e24dda9b8fe9 --- /dev/null +++ b/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2025-04-01-preview/examples/Gates_Update.json @@ -0,0 +1,63 @@ +{ + "operationId": "Gates_Update", + "title": "Updates a Gate resource.", + "parameters": { + "api-version": "2025-04-01-preview", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "rg1", + "fleetName": "fleet1", + "gateName": "12345678-910a-bcde-f000-000000000000", + "properties": { + "location": "East US", + "properties": { + "state": "Completed" + } + } + }, + "responses": { + "200": { + "headers": { + "ETag": "23ujdflewrj3=" + }, + "body": { + "id": "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/fleets/fleet-1/gates/12345678-910a-bcde-f000-000000000000", + "name": "12345678-910a-bcde-f000-000000000000", + "type": "Microsoft.ContainerService/fleets/gates", + "location": "East US", + "systemData": { + "createdBy": "someUser", + "createdByType": "User", + "createdAt": "2022-03-23T05:40:40.657Z", + "lastModifiedBy": "someOtherUser", + "lastModifiedByType": "User", + "lastModifiedAt": "2022-03-23T05:40:40.657Z" + }, + "eTag": "kd30rkdfo49=", + "properties": { + "provisioningState": "Succeeded", + "displayName": "Perform health checks after Group 1", + "target": { + "id": "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/fleets/fleet-1/updateRuns/run1", + "type": "UpdateRun", + "properties": { + "updateRun": { + "name": "run1", + "stage": "stage1", + "group": "group1", + "timing": "After" + } + } + }, + "gateType": "Approval", + "state": "Completed" + } + } + }, + "202": { + "headers": { + "Retry-After": "20", + "Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerService/locations/eastus/operations/00000000-0000-0000-0000-000000000000?api-version=2022-02-01" + } + } + } +} diff --git a/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2025-04-01-preview/examples/UpdateRuns_CreateOrUpdate.json b/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2025-04-01-preview/examples/UpdateRuns_CreateOrUpdate.json index 06d90ae11d8e..6fca66afb217 100644 --- a/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2025-04-01-preview/examples/UpdateRuns_CreateOrUpdate.json +++ b/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2025-04-01-preview/examples/UpdateRuns_CreateOrUpdate.json @@ -16,7 +16,31 @@ "name": "stage1", "groups": [ { - "name": "group-a" + "name": "group-a", + "beforeGates": [ + { + "displayName": "gate before group-a", + "type": "Approval" + } + ], + "afterGates": [ + { + "displayName": "gate after group-a", + "type": "Approval" + } + ] + } + ], + "beforeGates": [ + { + "displayName": "gate before stage1", + "type": "Approval" + } + ], + "afterGates": [ + { + "displayName": "gate after stage1", + "type": "Approval" } ], "afterStageWaitInSeconds": 3600 @@ -58,7 +82,31 @@ "name": "stage1", "groups": [ { - "name": "group-a" + "name": "group-a", + "beforeGates": [ + { + "displayName": "gate before group-a", + "type": "Approval" + } + ], + "afterGates": [ + { + "displayName": "gate after group-a", + "type": "Approval" + } + ] + } + ], + "beforeGates": [ + { + "displayName": "gate before stage1", + "type": "Approval" + } + ], + "afterGates": [ + { + "displayName": "gate after stage1", + "type": "Approval" } ], "afterStageWaitInSeconds": 3600 @@ -76,12 +124,12 @@ }, "status": { "status": { - "state": "NotStarted" + "state": "Pending" }, "stages": [ { "status": { - "state": "NotStarted" + "state": "Pending" }, "name": "stage1", "groups": [ @@ -98,9 +146,42 @@ "name": "member-one", "clusterResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myClusters/providers/Microsoft.ContainerService/managedClusters/myCluster" } + ], + "beforeGates": [ + { + "displayName": "gate before group-a", + "status": { + "state": "NotStarted" + } + } + ], + "afterGates": [ + { + "displayName": "gate after group-a", + "status": { + "state": "NotStarted" + } + } ] } ], + "beforeGates": [ + { + "displayName": "gate before stage1", + "gateId": "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/fleets/fleet-1/gates/12345678-910a-bcde-f000-000000000000", + "status": { + "state": "Pending" + } + } + ], + "afterGates": [ + { + "displayName": "gate after stage1", + "status": { + "state": "NotStarted" + } + } + ], "afterStageWaitStatus": { "status": { "state": "NotStarted" @@ -136,7 +217,31 @@ "name": "stage1", "groups": [ { - "name": "group-a" + "name": "group-a", + "beforeGates": [ + { + "displayName": "gate before group-a", + "type": "Approval" + } + ], + "afterGates": [ + { + "displayName": "gate after group-a", + "type": "Approval" + } + ] + } + ], + "beforeGates": [ + { + "displayName": "gate before stage1", + "type": "Approval" + } + ], + "afterGates": [ + { + "displayName": "gate after stage1", + "type": "Approval" } ], "afterStageWaitInSeconds": 3600 @@ -154,12 +259,12 @@ }, "status": { "status": { - "state": "NotStarted" + "state": "Pending" }, "stages": [ { "status": { - "state": "NotStarted" + "state": "Pending" }, "name": "stage1", "groups": [ @@ -176,9 +281,42 @@ "name": "member-one", "clusterResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myClusters/providers/Microsoft.ContainerService/managedClusters/myCluster" } + ], + "beforeGates": [ + { + "displayName": "gate before group-a", + "status": { + "state": "NotStarted" + } + } + ], + "afterGates": [ + { + "displayName": "gate after group-a", + "status": { + "state": "NotStarted" + } + } ] } ], + "beforeGates": [ + { + "displayName": "gate before stage1", + "gateId": "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/fleets/fleet-1/gates/12345678-910a-bcde-f000-000000000000", + "status": { + "state": "Pending" + } + } + ], + "afterGates": [ + { + "displayName": "gate after stage1", + "status": { + "state": "NotStarted" + } + } + ], "afterStageWaitStatus": { "status": { "state": "NotStarted" diff --git a/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2025-04-01-preview/examples/UpdateRuns_Get.json b/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2025-04-01-preview/examples/UpdateRuns_Get.json index 3abfd89ed1db..4a7b37feb883 100644 --- a/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2025-04-01-preview/examples/UpdateRuns_Get.json +++ b/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2025-04-01-preview/examples/UpdateRuns_Get.json @@ -30,7 +30,31 @@ "name": "stage1", "groups": [ { - "name": "group-a" + "name": "group-a", + "beforeGates": [ + { + "displayName": "gate before group-a", + "type": "Approval" + } + ], + "afterGates": [ + { + "displayName": "gate after group-a", + "type": "Approval" + } + ] + } + ], + "beforeGates": [ + { + "displayName": "gate before stage1", + "type": "Approval" + } + ], + "afterGates": [ + { + "displayName": "gate after stage1", + "type": "Approval" } ], "afterStageWaitInSeconds": 3600 @@ -48,12 +72,12 @@ }, "status": { "status": { - "state": "NotStarted" + "state": "Pending" }, "stages": [ { "status": { - "state": "NotStarted" + "state": "Pending" }, "name": "stage1", "groups": [ @@ -70,9 +94,42 @@ "name": "member-one", "clusterResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myClusters/providers/Microsoft.ContainerService/managedClusters/myCluster" } + ], + "beforeGates": [ + { + "displayName": "gate before group-a", + "status": { + "state": "NotStarted" + } + } + ], + "afterGates": [ + { + "displayName": "gate after group-a", + "status": { + "state": "NotStarted" + } + } ] } ], + "beforeGates": [ + { + "displayName": "gate before stage1", + "gateId": "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/fleets/fleet-1/gates/12345678-910a-bcde-f000-000000000000", + "status": { + "state": "Pending" + } + } + ], + "afterGates": [ + { + "displayName": "gate after stage1", + "status": { + "state": "NotStarted" + } + } + ], "afterStageWaitStatus": { "status": { "state": "NotStarted" diff --git a/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2025-04-01-preview/examples/UpdateRuns_ListByFleet.json b/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2025-04-01-preview/examples/UpdateRuns_ListByFleet.json index 1a46b217a7a7..9145285b232c 100644 --- a/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2025-04-01-preview/examples/UpdateRuns_ListByFleet.json +++ b/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2025-04-01-preview/examples/UpdateRuns_ListByFleet.json @@ -31,7 +31,31 @@ "name": "stage1", "groups": [ { - "name": "group-a" + "name": "group-a", + "beforeGates": [ + { + "displayName": "gate before group-a", + "type": "Approval" + } + ], + "afterGates": [ + { + "displayName": "gate after group-a", + "type": "Approval" + } + ] + } + ], + "beforeGates": [ + { + "displayName": "gate before stage1", + "type": "Approval" + } + ], + "afterGates": [ + { + "displayName": "gate after stage1", + "type": "Approval" } ], "afterStageWaitInSeconds": 3600 @@ -49,12 +73,12 @@ }, "status": { "status": { - "state": "NotStarted" + "state": "Pending" }, "stages": [ { "status": { - "state": "NotStarted" + "state": "Pending" }, "name": "stage1", "groups": [ @@ -71,9 +95,42 @@ "name": "member-one", "clusterResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myClusters/providers/Microsoft.ContainerService/managedClusters/myCluster" } + ], + "beforeGates": [ + { + "displayName": "gate before group-a", + "status": { + "state": "NotStarted" + } + } + ], + "afterGates": [ + { + "displayName": "gate after group-a", + "status": { + "state": "NotStarted" + } + } ] } ], + "beforeGates": [ + { + "displayName": "gate before stage1", + "gateId": "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/fleets/fleet-1/gates/12345678-910a-bcde-f000-000000000000", + "status": { + "state": "Pending" + } + } + ], + "afterGates": [ + { + "displayName": "gate after stage1", + "status": { + "state": "NotStarted" + } + } + ], "afterStageWaitStatus": { "status": { "state": "NotStarted" diff --git a/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2025-04-01-preview/examples/UpdateStrategies_CreateOrUpdate.json b/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2025-04-01-preview/examples/UpdateStrategies_CreateOrUpdate.json index 1f6c199670a8..e114e8a23030 100644 --- a/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2025-04-01-preview/examples/UpdateStrategies_CreateOrUpdate.json +++ b/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2025-04-01-preview/examples/UpdateStrategies_CreateOrUpdate.json @@ -6,7 +6,7 @@ "subscriptionId": "00000000-0000-0000-0000-000000000000", "resourceGroupName": "rg1", "fleetName": "fleet1", - "updateStrategyName": "strartegy1", + "updateStrategyName": "strategy1", "resource": { "properties": { "strategy": { @@ -15,7 +15,31 @@ "name": "stage1", "groups": [ { - "name": "group-a" + "name": "group-a", + "beforeGates": [ + { + "displayName": "gate before group-a", + "type": "Approval" + } + ], + "afterGates": [ + { + "displayName": "gate after group-a", + "type": "Approval" + } + ] + } + ], + "beforeGates": [ + { + "displayName": "gate before stage1", + "type": "Approval" + } + ], + "afterGates": [ + { + "displayName": "gate after stage1", + "type": "Approval" } ], "afterStageWaitInSeconds": 3600 @@ -47,7 +71,31 @@ "name": "stage1", "groups": [ { - "name": "group-a" + "name": "group-a", + "beforeGates": [ + { + "displayName": "gate before group-a", + "type": "Approval" + } + ], + "afterGates": [ + { + "displayName": "gate after group-a", + "type": "Approval" + } + ] + } + ], + "beforeGates": [ + { + "displayName": "gate before stage1", + "type": "Approval" + } + ], + "afterGates": [ + { + "displayName": "gate after stage1", + "type": "Approval" } ], "afterStageWaitInSeconds": 3600 @@ -79,7 +127,31 @@ "name": "stage1", "groups": [ { - "name": "group-a" + "name": "group-a", + "beforeGates": [ + { + "displayName": "gate before group-a", + "type": "Approval" + } + ], + "afterGates": [ + { + "displayName": "gate after group-a", + "type": "Approval" + } + ] + } + ], + "beforeGates": [ + { + "displayName": "gate before stage1", + "type": "Approval" + } + ], + "afterGates": [ + { + "displayName": "gate after stage1", + "type": "Approval" } ], "afterStageWaitInSeconds": 3600 diff --git a/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2025-04-01-preview/examples/UpdateStrategies_Get.json b/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2025-04-01-preview/examples/UpdateStrategies_Get.json index 0b051b1af882..25aaeede995a 100644 --- a/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2025-04-01-preview/examples/UpdateStrategies_Get.json +++ b/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2025-04-01-preview/examples/UpdateStrategies_Get.json @@ -30,7 +30,31 @@ "name": "stage1", "groups": [ { - "name": "group-a" + "name": "group-a", + "beforeGates": [ + { + "displayName": "gate before group-a", + "type": "Approval" + } + ], + "afterGates": [ + { + "displayName": "gate after group-a", + "type": "Approval" + } + ] + } + ], + "beforeGates": [ + { + "displayName": "gate before stage1", + "type": "Approval" + } + ], + "afterGates": [ + { + "displayName": "gate after stage1", + "type": "Approval" } ], "afterStageWaitInSeconds": 3600 diff --git a/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2025-04-01-preview/examples/UpdateStrategies_ListByFleet.json b/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2025-04-01-preview/examples/UpdateStrategies_ListByFleet.json index ec71556b2910..e4496ed71ab3 100644 --- a/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2025-04-01-preview/examples/UpdateStrategies_ListByFleet.json +++ b/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2025-04-01-preview/examples/UpdateStrategies_ListByFleet.json @@ -31,7 +31,31 @@ "name": "stage1", "groups": [ { - "name": "group-a" + "name": "group-a", + "beforeGates": [ + { + "displayName": "gate before group-a", + "type": "Approval" + } + ], + "afterGates": [ + { + "displayName": "gate after group-a", + "type": "Approval" + } + ] + } + ], + "beforeGates": [ + { + "displayName": "gate before stage1", + "type": "Approval" + } + ], + "afterGates": [ + { + "displayName": "gate after stage1", + "type": "Approval" } ], "afterStageWaitInSeconds": 3600 diff --git a/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2025-04-01-preview/fleets.json b/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2025-04-01-preview/fleets.json index f0c1bae79a44..e29723412d6c 100644 --- a/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2025-04-01-preview/fleets.json +++ b/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2025-04-01-preview/fleets.json @@ -48,6 +48,9 @@ { "name": "FleetMembers" }, + { + "name": "Gates" + }, { "name": "UpdateRuns" }, @@ -799,6 +802,217 @@ "x-ms-long-running-operation": true } }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/gates": { + "get": { + "operationId": "Gates_ListByFleet", + "tags": [ + "Gates" + ], + "description": "List Gate resources by Fleet", + "parameters": [ + { + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "fleetName", + "in": "path", + "description": "The name of the Fleet resource.", + "required": true, + "type": "string", + "minLength": 1, + "maxLength": 63, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/GateListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Lists the Gates of a Fleet.": { + "$ref": "./examples/Gates_ListByFleet.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/gates/{gateName}": { + "get": { + "operationId": "Gates_Get", + "tags": [ + "Gates" + ], + "description": "Get a Gate", + "parameters": [ + { + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "fleetName", + "in": "path", + "description": "The name of the Fleet resource.", + "required": true, + "type": "string", + "minLength": 1, + "maxLength": 63, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" + }, + { + "name": "gateName", + "in": "path", + "description": "The name of the Gate resource, a GUID.", + "required": true, + "type": "string", + "minLength": 36, + "maxLength": 36, + "pattern": "^[0-9a-f]{8}[-][0-9a-f]{4}[-][0-9a-f]{4}[-][0-9a-f]{4}[-][0-9a-f]{12}$" + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/Gate" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Gets a Gate resource.": { + "$ref": "./examples/Gates_Get.json" + } + } + }, + "patch": { + "operationId": "Gates_Update", + "tags": [ + "Gates" + ], + "description": "Update a Gate", + "parameters": [ + { + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "If-Match", + "in": "header", + "description": "The request should only proceed if an entity matches this string.", + "required": false, + "type": "string", + "x-ms-client-name": "ifMatch" + }, + { + "name": "If-None-Match", + "in": "header", + "description": "The request should only proceed if no entity matches this string.", + "required": false, + "type": "string", + "x-ms-client-name": "ifNoneMatch" + }, + { + "name": "fleetName", + "in": "path", + "description": "The name of the Fleet resource.", + "required": true, + "type": "string", + "minLength": 1, + "maxLength": 63, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" + }, + { + "name": "gateName", + "in": "path", + "description": "The name of the Gate resource, a GUID.", + "required": true, + "type": "string", + "minLength": 36, + "maxLength": 36, + "pattern": "^[0-9a-f]{8}[-][0-9a-f]{4}[-][0-9a-f]{4}[-][0-9a-f]{4}[-][0-9a-f]{12}$" + }, + { + "name": "properties", + "in": "body", + "description": "The resource properties to be updated.", + "required": true, + "schema": { + "$ref": "#/definitions/GateUpdate" + } + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/Gate" + } + }, + "202": { + "description": "Resource update request accepted.", + "headers": { + "Location": { + "type": "string", + "description": "The Location header contains the URL where the status of the long running operation can be checked." + }, + "Retry-After": { + "type": "integer", + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Updates a Gate resource.": { + "$ref": "./examples/Gates_Update.json" + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + }, + "x-ms-long-running-operation": true + } + }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/listCredentials": { "post": { "operationId": "Fleets_ListCredentials", @@ -2863,84 +3077,380 @@ ] } }, - "KubernetesVersion": { - "type": "string" - }, - "ManagedClusterUpdate": { + "Gate": { "type": "object", - "description": "The update to be applied to the ManagedClusters.", + "description": "A Gate controls the progression during a staged rollout, e.g. in an Update Run.", "properties": { - "upgrade": { - "$ref": "#/definitions/ManagedClusterUpgradeSpec", - "description": "The upgrade to apply to the ManagedClusters." + "properties": { + "$ref": "#/definitions/GateProperties", + "description": "The resource-specific properties for this resource.", + "x-ms-client-flatten": true }, - "nodeImageSelection": { - "$ref": "#/definitions/NodeImageSelection", - "description": "The node image upgrade to be applied to the target nodes in update run.", - "x-ms-mutability": [ - "read", - "create" - ] + "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 } }, - "required": [ - "upgrade" + "allOf": [ + { + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" + } ] }, - "ManagedClusterUpgradeSpec": { + "GateConfiguration": { "type": "object", - "description": "The upgrade to apply to a ManagedCluster.", + "description": "GateConfiguration is used to define where Gates should be placed within the Update Run.", "properties": { - "type": { - "$ref": "#/definitions/ManagedClusterUpgradeType", - "description": "ManagedClusterUpgradeType is the type of upgrade to be applied." + "displayName": { + "type": "string", + "description": "The human-readable display name of the Gate.", + "minLength": 1, + "maxLength": 100, + "pattern": "^[A-Za-z0-9].*$" }, - "kubernetesVersion": { - "$ref": "#/definitions/KubernetesVersion", - "description": "The Kubernetes version to upgrade the member clusters to." + "type": { + "$ref": "#/definitions/GateType", + "description": "The type of the Gate determines how it is completed." } }, "required": [ "type" ] }, - "ManagedClusterUpgradeType": { - "type": "string", - "description": "The type of upgrade to perform when targeting ManagedClusters.", - "enum": [ - "Full", - "NodeImageOnly", - "ControlPlaneOnly" - ], - "x-ms-enum": { - "name": "ManagedClusterUpgradeType", - "modelAsString": true, - "values": [ - { - "name": "Full", - "value": "Full", - "description": "Full upgrades the control plane and all agent pools of the target ManagedClusters. Requires the ManagedClusterUpgradeSpec.KubernetesVersion property to be set." - }, - { - "name": "NodeImageOnly", - "value": "NodeImageOnly", - "description": "NodeImageOnly upgrades only the node images of the target ManagedClusters. Requires the ManagedClusterUpgradeSpec.KubernetesVersion property to NOT be set." - }, - { - "name": "ControlPlaneOnly", - "value": "ControlPlaneOnly", - "description": "ControlPlaneOnly upgrades only targets the KubernetesVersion of the ManagedClusters and will not be applied to the AgentPool. Requires the ManagedClusterUpgradeSpec.KubernetesVersion property to be set." - } - ] - } - }, - "MemberUpdateStatus": { + "GateListResult": { "type": "object", - "description": "The status of a member update operation.", + "description": "The response of a Gate list operation.", "properties": { - "status": { - "$ref": "#/definitions/UpdateStatus", - "description": "The status of the MemberUpdate operation.", + "value": { + "type": "array", + "description": "The Gate items on this page", + "items": { + "$ref": "#/definitions/Gate" + } + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "GateProperties": { + "type": "object", + "description": "A Gate controls the progression during a staged rollout, e.g. in an Update Run.", + "properties": { + "provisioningState": { + "$ref": "#/definitions/GateProvisioningState", + "description": "The provisioning state of the Gate resource.", + "readOnly": true + }, + "displayName": { + "type": "string", + "description": "The human-readable display name of the Gate.", + "minLength": 1, + "maxLength": 100, + "pattern": "^[A-Za-z0-9].*$", + "x-ms-mutability": [ + "read", + "create" + ] + }, + "target": { + "$ref": "#/definitions/GateTarget", + "description": "The target that the Gate is controlling, e.g. an Update Run.", + "x-ms-mutability": [ + "read", + "create" + ] + }, + "gateType": { + "$ref": "#/definitions/GateType", + "description": "The type of the Gate determines how it is completed.", + "x-ms-mutability": [ + "read", + "create" + ] + }, + "state": { + "$ref": "#/definitions/GateState", + "description": "The state of the Gate.", + "x-ms-mutability": [ + "read", + "update", + "create" + ] + } + }, + "required": [ + "target", + "gateType", + "state" + ] + }, + "GatePropertiesUpdate": { + "type": "object", + "description": "A Gate controls the progression during a staged rollout, e.g. in an Update Run.", + "properties": { + "state": { + "$ref": "#/definitions/GateState", + "description": "The state of the Gate.", + "x-ms-mutability": [ + "read", + "update", + "create" + ] + } + } + }, + "GateProvisioningState": { + "type": "string", + "description": "The provisioning state of the Gate resource.", + "enum": [ + "Succeeded", + "Failed", + "Canceled" + ], + "x-ms-enum": { + "name": "GateProvisioningState", + "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 + }, + "GateResourceId": { + "type": "string", + "format": "arm-id", + "description": "A type definition that refers the id to an Azure Resource Manager resource.", + "x-ms-arm-id-details": { + "allowedResources": [ + { + "type": "Microsoft.ContainerService/fleets/gates" + } + ] + } + }, + "GateState": { + "type": "string", + "description": "The state of the Gate.", + "enum": [ + "Pending", + "Completed" + ], + "x-ms-enum": { + "name": "GateState", + "modelAsString": true, + "values": [ + { + "name": "Pending", + "value": "Pending", + "description": "A Pending Gate will continue to block the staged rollout process it is controlling." + }, + { + "name": "Completed", + "value": "Completed", + "description": "An Completed Gate allows the staged rollout process to continue." + } + ] + } + }, + "GateTarget": { + "type": "object", + "description": "The target that the Gate is controlling, e.g. an Update Run.", + "properties": { + "id": { + "$ref": "#/definitions/GateTargetId", + "description": "The resource id that the Gate is controlling the rollout of.", + "x-ms-mutability": [ + "read", + "create" + ] + }, + "type": { + "$ref": "#/definitions/GateTargetType", + "description": "The type of the resource being targeted by this Gate.", + "x-ms-mutability": [ + "read", + "create" + ] + }, + "properties": { + "$ref": "#/definitions/GateTargetProperties", + "description": "Properties specific to the target of this Gate.", + "x-ms-mutability": [ + "read", + "create" + ] + } + }, + "required": [ + "id", + "type", + "properties" + ] + }, + "GateTargetId": { + "$ref": "#/definitions/UpdateRunResourceId", + "x-nullable": false + }, + "GateTargetProperties": { + "type": "object", + "x-nullable": false, + "allOf": [ + { + "$ref": "#/definitions/UpdateRunGateTargetProperties" + } + ] + }, + "GateTargetType": { + "type": "string", + "description": "The type of the Gate target.", + "enum": [ + "UpdateRun" + ], + "x-ms-enum": { + "name": "GateTargetType", + "modelAsString": true, + "values": [ + { + "name": "UpdateRun", + "value": "UpdateRun", + "description": "The Gate targets an Update Run." + } + ] + } + }, + "GateType": { + "type": "string", + "description": "The type of the Gate determines how it is completed.", + "enum": [ + "Approval" + ], + "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." + } + ] + } + }, + "GateUpdate": { + "type": "object", + "description": "A Gate controls the progression during a staged rollout, e.g. in an Update Run.", + "properties": { + "properties": { + "$ref": "#/definitions/GatePropertiesUpdate", + "description": "The resource-specific properties for this resource.", + "x-ms-client-flatten": true + } + }, + "allOf": [ + { + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" + } + ] + }, + "KubernetesVersion": { + "type": "string" + }, + "ManagedClusterUpdate": { + "type": "object", + "description": "The update to be applied to the ManagedClusters.", + "properties": { + "upgrade": { + "$ref": "#/definitions/ManagedClusterUpgradeSpec", + "description": "The upgrade to apply to the ManagedClusters." + }, + "nodeImageSelection": { + "$ref": "#/definitions/NodeImageSelection", + "description": "The node image upgrade to be applied to the target nodes in update run.", + "x-ms-mutability": [ + "read", + "create" + ] + } + }, + "required": [ + "upgrade" + ] + }, + "ManagedClusterUpgradeSpec": { + "type": "object", + "description": "The upgrade to apply to a ManagedCluster.", + "properties": { + "type": { + "$ref": "#/definitions/ManagedClusterUpgradeType", + "description": "ManagedClusterUpgradeType is the type of upgrade to be applied." + }, + "kubernetesVersion": { + "$ref": "#/definitions/KubernetesVersion", + "description": "The Kubernetes version to upgrade the member clusters to." + } + }, + "required": [ + "type" + ] + }, + "ManagedClusterUpgradeType": { + "type": "string", + "description": "The type of upgrade to perform when targeting ManagedClusters.", + "enum": [ + "Full", + "NodeImageOnly", + "ControlPlaneOnly" + ], + "x-ms-enum": { + "name": "ManagedClusterUpgradeType", + "modelAsString": true, + "values": [ + { + "name": "Full", + "value": "Full", + "description": "Full upgrades the control plane and all agent pools of the target ManagedClusters. Requires the ManagedClusterUpgradeSpec.KubernetesVersion property to be set." + }, + { + "name": "NodeImageOnly", + "value": "NodeImageOnly", + "description": "NodeImageOnly upgrades only the node images of the target ManagedClusters. Requires the ManagedClusterUpgradeSpec.KubernetesVersion property to NOT be set." + }, + { + "name": "ControlPlaneOnly", + "value": "ControlPlaneOnly", + "description": "ControlPlaneOnly upgrades only targets the KubernetesVersion of the ManagedClusters and will not be applied to the AgentPool. Requires the ManagedClusterUpgradeSpec.KubernetesVersion property to be set." + } + ] + } + }, + "MemberUpdateStatus": { + "type": "object", + "description": "The status of a member update operation.", + "properties": { + "status": { + "$ref": "#/definitions/UpdateStatus", + "description": "The status of the MemberUpdate operation.", "readOnly": true }, "name": { @@ -3136,6 +3646,30 @@ ] } }, + "Timing": { + "type": "string", + "description": "Whether the Gate is placed before or after the target.", + "enum": [ + "Before", + "After" + ], + "x-ms-enum": { + "name": "Timing", + "modelAsString": true, + "values": [ + { + "name": "Before", + "value": "Before", + "description": "The Gate is before the target." + }, + { + "name": "After", + "value": "After", + "description": "The Gate is after the target." + } + ] + } + }, "UpdateGroup": { "type": "object", "description": "A group to be updated.", @@ -3146,6 +3680,26 @@ "minLength": 1, "maxLength": 50, "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" + }, + "beforeGates": { + "type": "array", + "description": "A list of Gates that will be created before this Group is executed.", + "items": { + "$ref": "#/definitions/GateConfiguration" + }, + "x-ms-identifiers": [ + "displayName" + ] + }, + "afterGates": { + "type": "array", + "description": "A list of Gates that will be created after this Group is executed.", + "items": { + "$ref": "#/definitions/GateConfiguration" + }, + "x-ms-identifiers": [ + "displayName" + ] } }, "required": [ @@ -3176,6 +3730,28 @@ "x-ms-identifiers": [ "name" ] + }, + "beforeGates": { + "type": "array", + "description": "The list of Gates that will run before this UpdateGroup.", + "items": { + "$ref": "#/definitions/UpdateRunGateStatus" + }, + "readOnly": true, + "x-ms-identifiers": [ + "displayName" + ] + }, + "afterGates": { + "type": "array", + "description": "The list of Gates that will run after this UpdateGroup.", + "items": { + "$ref": "#/definitions/UpdateRunGateStatus" + }, + "readOnly": true, + "x-ms-identifiers": [ + "displayName" + ] } } }, @@ -3200,6 +3776,85 @@ } ] }, + "UpdateRunGateStatus": { + "type": "object", + "description": "The status of the Gate, as represented in the Update Run.", + "properties": { + "displayName": { + "type": "string", + "description": "The human-readable display name of the Gate.", + "minLength": 1, + "maxLength": 100, + "pattern": "^[A-Za-z0-9].*$", + "readOnly": true + }, + "gateId": { + "$ref": "#/definitions/GateResourceId", + "description": "The resource id of the Gate.", + "readOnly": true + }, + "status": { + "$ref": "#/definitions/UpdateStatus", + "description": "The status of the Gate.", + "readOnly": true + } + } + }, + "UpdateRunGateTarget": { + "type": "object", + "description": "The Gate is targeting an Update Run staged rollout.", + "properties": { + "name": { + "type": "string", + "description": "The name of the Update Run.", + "minLength": 1, + "maxLength": 50, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$", + "readOnly": true + }, + "stage": { + "type": "string", + "description": "The Update Stage of the Update Run.", + "minLength": 1, + "maxLength": 50, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$", + "readOnly": true + }, + "group": { + "type": "string", + "description": "The Update Group of the Update Run.", + "minLength": 1, + "maxLength": 50, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$", + "readOnly": true + }, + "timing": { + "$ref": "#/definitions/Timing", + "description": "Whether the Gate is placed before or after the update itself.", + "x-ms-mutability": [ + "read", + "create" + ] + } + }, + "required": [ + "name", + "timing" + ] + }, + "UpdateRunGateTargetProperties": { + "type": "object", + "description": "Wrapper object around the Update Run Gate Target Properties.", + "properties": { + "updateRun": { + "$ref": "#/definitions/UpdateRunGateTarget", + "description": "Properties specific to the Update Run." + } + }, + "required": [ + "updateRun" + ] + }, "UpdateRunListResult": { "type": "object", "description": "The response of a UpdateRun list operation.", @@ -3288,6 +3943,18 @@ }, "readOnly": true }, + "UpdateRunResourceId": { + "type": "string", + "format": "arm-id", + "description": "A type definition that refers the id to an Azure Resource Manager resource.", + "x-ms-arm-id-details": { + "allowedResources": [ + { + "type": "Microsoft.ContainerService/fleets/updateRuns" + } + ] + } + }, "UpdateRunStatus": { "type": "object", "description": "The status of a UpdateRun.", @@ -3359,6 +4026,26 @@ "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." + }, + "beforeGates": { + "type": "array", + "description": "A list of Gates that will be created before this Stage is executed.", + "items": { + "$ref": "#/definitions/GateConfiguration" + }, + "x-ms-identifiers": [ + "displayName" + ] + }, + "afterGates": { + "type": "array", + "description": "A list of Gates that will be created after this Stage is executed.", + "items": { + "$ref": "#/definitions/GateConfiguration" + }, + "x-ms-identifiers": [ + "displayName" + ] } }, "required": [ @@ -3390,6 +4077,28 @@ "name" ] }, + "beforeGates": { + "type": "array", + "description": "The list of Gates that will run before this UpdateStage.", + "items": { + "$ref": "#/definitions/UpdateRunGateStatus" + }, + "readOnly": true, + "x-ms-identifiers": [ + "displayName" + ] + }, + "afterGates": { + "type": "array", + "description": "The list of Gates that will run after this UpdateStage.", + "items": { + "$ref": "#/definitions/UpdateRunGateStatus" + }, + "readOnly": true, + "x-ms-identifiers": [ + "displayName" + ] + }, "afterStageWaitStatus": { "$ref": "#/definitions/WaitStatus", "description": "The status of the wait period configured on the UpdateStage.", @@ -3407,6 +4116,7 @@ "Stopped", "Skipped", "Failed", + "Pending", "Completed" ], "x-ms-enum": { @@ -3443,6 +4153,11 @@ "value": "Failed", "description": "The state of an UpdateRun/UpdateStage/UpdateGroup/MemberUpdate that has failed." }, + { + "name": "Pending", + "value": "Pending", + "description": "The state of an UpdateRun/UpdateStage/UpdateGroup/MemberUpdate that is pending." + }, { "name": "Completed", "value": "Completed", diff --git a/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/readme.md b/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/readme.md index f2d2cb981812..a02772843fe3 100644 --- a/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/readme.md +++ b/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/readme.md @@ -37,7 +37,7 @@ These settings apply only when `--tag=package-2025-04-01-preview` is specified o ```yaml $(tag) == 'package-2025-04-01-preview' input-file: - - stable/2025-04-01-preview/fleets.json + - preview/2025-04-01-preview/fleets.json ``` ### Tag: package-2025-03-01 diff --git a/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/fleets.json b/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/fleets.json index aa4b4ff1e51f..d433fb198bbb 100644 --- a/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/fleets.json +++ b/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/fleets.json @@ -2510,6 +2510,7 @@ "Stopped", "Skipped", "Failed", + "Pending", "Completed" ], "x-ms-enum": { @@ -2546,6 +2547,11 @@ "value": "Failed", "description": "The state of an UpdateRun/UpdateStage/UpdateGroup/MemberUpdate that has failed." }, + { + "name": "Pending", + "value": "Pending", + "description": "The state of an UpdateRun/UpdateStage/UpdateGroup/MemberUpdate that is pending." + }, { "name": "Completed", "value": "Completed", diff --git a/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-01/fleets.json b/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-01/fleets.json index ef8fba3a38b8..f81384c2fa07 100644 --- a/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-01/fleets.json +++ b/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-01/fleets.json @@ -2784,6 +2784,7 @@ "Stopped", "Skipped", "Failed", + "Pending", "Completed" ], "x-ms-enum": { @@ -2820,6 +2821,11 @@ "value": "Failed", "description": "The state of an UpdateRun/UpdateStage/UpdateGroup/MemberUpdate that has failed." }, + { + "name": "Pending", + "value": "Pending", + "description": "The state of an UpdateRun/UpdateStage/UpdateGroup/MemberUpdate that is pending." + }, { "name": "Completed", "value": "Completed", diff --git a/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2025-03-01/fleets.json b/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2025-03-01/fleets.json index 099c560dd471..0a6eac53102c 100644 --- a/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2025-03-01/fleets.json +++ b/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2025-03-01/fleets.json @@ -3407,6 +3407,7 @@ "Stopped", "Skipped", "Failed", + "Pending", "Completed" ], "x-ms-enum": { @@ -3443,6 +3444,11 @@ "value": "Failed", "description": "The state of an UpdateRun/UpdateStage/UpdateGroup/MemberUpdate that has failed." }, + { + "name": "Pending", + "value": "Pending", + "description": "The state of an UpdateRun/UpdateStage/UpdateGroup/MemberUpdate that is pending." + }, { "name": "Completed", "value": "Completed",