diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/CHANGELOG.md b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/CHANGELOG.md index e41769b3da214..4ff162cea2d4d 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/CHANGELOG.md +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/CHANGELOG.md @@ -1,14 +1,16 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.2 (2023-10-13) ### Features Added -### Breaking Changes +- Updated to Fleet API `2023-08-15`. +- Add `FleetUpdateStrategy` support. ### Bugs Fixed -### Other Changes +- Fix `SubnetResourceId` null check. +- Fix LRO async call issues. ## 1.0.0-beta.1 (2023-10-05) diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/api/Azure.ResourceManager.ContainerServiceFleet.netstandard2.0.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/api/Azure.ResourceManager.ContainerServiceFleet.netstandard2.0.cs index 2dd376155d1ff..f707f744a6882 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/api/Azure.ResourceManager.ContainerServiceFleet.netstandard2.0.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/api/Azure.ResourceManager.ContainerServiceFleet.netstandard2.0.cs @@ -35,6 +35,7 @@ public static partial class ContainerServiceFleetExtensions public static Azure.Pageable GetContainerServiceFleets(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetContainerServiceFleetsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.ContainerServiceFleet.ContainerServiceFleetUpdateRunResource GetContainerServiceFleetUpdateRunResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.FleetUpdateStrategyResource GetFleetUpdateStrategyResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } } public partial class ContainerServiceFleetMemberCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { @@ -96,6 +97,9 @@ protected ContainerServiceFleetResource() { } public virtual Azure.ResourceManager.ContainerServiceFleet.ContainerServiceFleetUpdateRunCollection GetContainerServiceFleetUpdateRuns() { throw null; } public virtual Azure.Response GetCredentials(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetCredentialsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ContainerServiceFleet.FleetUpdateStrategyCollection GetFleetUpdateStrategies() { throw null; } + public virtual Azure.Response GetFleetUpdateStrategy(string updateStrategyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFleetUpdateStrategyAsync(string updateStrategyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -128,6 +132,7 @@ public ContainerServiceFleetUpdateRunData() { } public Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetUpdateRunProvisioningState? ProvisioningState { get { throw null; } } public Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetUpdateRunStatus Status { get { throw null; } } public System.Collections.Generic.IList StrategyStages { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier UpdateStrategyId { get { throw null; } set { } } } public partial class ContainerServiceFleetUpdateRunResource : Azure.ResourceManager.ArmResource { @@ -147,6 +152,44 @@ protected ContainerServiceFleetUpdateRunResource() { } public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerServiceFleet.ContainerServiceFleetUpdateRunData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerServiceFleet.ContainerServiceFleetUpdateRunData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } + public partial class FleetUpdateStrategyCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FleetUpdateStrategyCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string updateStrategyName, Azure.ResourceManager.ContainerServiceFleet.FleetUpdateStrategyData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string updateStrategyName, Azure.ResourceManager.ContainerServiceFleet.FleetUpdateStrategyData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string updateStrategyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string updateStrategyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string updateStrategyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string updateStrategyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string updateStrategyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string updateStrategyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FleetUpdateStrategyData : Azure.ResourceManager.Models.ResourceData + { + public FleetUpdateStrategyData() { } + public Azure.ETag? ETag { get { throw null; } } + public Azure.ResourceManager.ContainerServiceFleet.Models.FleetUpdateStrategyProvisioningState? ProvisioningState { get { throw null; } } + public System.Collections.Generic.IList StrategyStages { get { throw null; } set { } } + } + public partial class FleetUpdateStrategyResource : Azure.ResourceManager.ArmResource + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FleetUpdateStrategyResource() { } + public virtual Azure.ResourceManager.ContainerServiceFleet.FleetUpdateStrategyData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string updateStrategyName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerServiceFleet.FleetUpdateStrategyData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerServiceFleet.FleetUpdateStrategyData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } } namespace Azure.ResourceManager.ContainerServiceFleet.Models { @@ -155,17 +198,24 @@ public static partial class ArmContainerServiceFleetModelFactory public static Azure.ResourceManager.ContainerServiceFleet.ContainerServiceFleetData ContainerServiceFleetData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ETag? eTag = default(Azure.ETag?), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.ContainerServiceFleet.Models.FleetProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerServiceFleet.Models.FleetProvisioningState?), Azure.ResourceManager.ContainerServiceFleet.Models.FleetHubProfile hubProfile = null) { throw null; } public static Azure.ResourceManager.ContainerServiceFleet.ContainerServiceFleetMemberData ContainerServiceFleetMemberData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ETag? eTag = default(Azure.ETag?), Azure.Core.ResourceIdentifier clusterResourceId = null, string group = null, Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberProvisioningState?)) { throw null; } public static Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetUpdateGroupStatus ContainerServiceFleetUpdateGroupStatus(Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetUpdateStatus status = null, string name = null, System.Collections.Generic.IEnumerable members = null) { throw null; } - public static Azure.ResourceManager.ContainerServiceFleet.ContainerServiceFleetUpdateRunData ContainerServiceFleetUpdateRunData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ETag? eTag = default(Azure.ETag?), Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetUpdateRunProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetUpdateRunProvisioningState?), System.Collections.Generic.IEnumerable strategyStages = null, Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetManagedClusterUpdate managedClusterUpdate = null, Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetUpdateRunStatus status = null) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.ContainerServiceFleetUpdateRunData ContainerServiceFleetUpdateRunData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ETag? eTag = default(Azure.ETag?), Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetUpdateRunProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetUpdateRunProvisioningState?), Azure.Core.ResourceIdentifier updateStrategyId = null, System.Collections.Generic.IEnumerable strategyStages = null, Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetManagedClusterUpdate managedClusterUpdate = null, Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetUpdateRunStatus status = null) { throw null; } public static Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetUpdateRunStatus ContainerServiceFleetUpdateRunStatus(Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetUpdateStatus status = null, System.Collections.Generic.IEnumerable stages = null, System.Collections.Generic.IEnumerable selectedNodeImageVersions = null) { throw null; } public static Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetUpdateStageStatus ContainerServiceFleetUpdateStageStatus(Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetUpdateStatus status = null, string name = null, System.Collections.Generic.IEnumerable groups = null, Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetWaitStatus afterStageWaitStatus = null) { throw null; } public static Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetUpdateStatus ContainerServiceFleetUpdateStatus(System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? completedOn = default(System.DateTimeOffset?), Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetUpdateState? state = default(Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetUpdateState?), Azure.ResponseError error = null) { throw null; } public static Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetWaitStatus ContainerServiceFleetWaitStatus(Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetUpdateStatus status = null, int? waitDurationInSeconds = default(int?)) { throw null; } public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetCredentialResult FleetCredentialResult(string name = null, byte[] value = null) { throw null; } public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetCredentialResults FleetCredentialResults(System.Collections.Generic.IEnumerable kubeconfigs = null) { throw null; } - public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetHubProfile FleetHubProfile(string dnsPrefix = null, Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetAPIServerAccessProfile apiServerAccessProfile = null, Azure.Core.ResourceIdentifier agentSubnetId = null, string fqdn = null, string kubernetesVersion = null) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetHubProfile FleetHubProfile(string dnsPrefix = null, Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetAPIServerAccessProfile apiServerAccessProfile = null, Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetAgentProfile agentProfile = null, string fqdn = null, string kubernetesVersion = null, string portalFqdn = null) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.FleetUpdateStrategyData FleetUpdateStrategyData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ETag? eTag = default(Azure.ETag?), Azure.ResourceManager.ContainerServiceFleet.Models.FleetUpdateStrategyProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerServiceFleet.Models.FleetUpdateStrategyProvisioningState?), System.Collections.Generic.IEnumerable strategyStages = null) { throw null; } public static Azure.ResourceManager.ContainerServiceFleet.Models.MemberUpdateStatus MemberUpdateStatus(Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetUpdateStatus status = null, string name = null, Azure.Core.ResourceIdentifier clusterResourceId = null, string operationId = null, string message = null) { throw null; } public static Azure.ResourceManager.ContainerServiceFleet.Models.NodeImageVersion NodeImageVersion(string version = null) { throw null; } } + public partial class ContainerServiceFleetAgentProfile + { + public ContainerServiceFleetAgentProfile() { } + public Azure.Core.ResourceIdentifier SubnetId { get { throw null; } set { } } + public string VmSize { get { throw null; } set { } } + } public partial class ContainerServiceFleetAPIServerAccessProfile { public ContainerServiceFleetAPIServerAccessProfile() { } @@ -318,11 +368,12 @@ internal FleetCredentialResults() { } public partial class FleetHubProfile { public FleetHubProfile() { } - public Azure.Core.ResourceIdentifier AgentSubnetId { get { throw null; } set { } } + public Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetAgentProfile AgentProfile { get { throw null; } set { } } public Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetAPIServerAccessProfile ApiServerAccessProfile { get { throw null; } set { } } public string DnsPrefix { get { throw null; } set { } } public string Fqdn { get { throw null; } } public string KubernetesVersion { get { throw null; } } + public string PortalFqdn { get { throw null; } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct FleetMemberProvisioningState : System.IEquatable @@ -368,6 +419,25 @@ public FleetHubProfile() { } public static bool operator !=(Azure.ResourceManager.ContainerServiceFleet.Models.FleetProvisioningState left, Azure.ResourceManager.ContainerServiceFleet.Models.FleetProvisioningState right) { throw null; } public override string ToString() { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct FleetUpdateStrategyProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public FleetUpdateStrategyProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetUpdateStrategyProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetUpdateStrategyProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetUpdateStrategyProvisioningState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerServiceFleet.Models.FleetUpdateStrategyProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerServiceFleet.Models.FleetUpdateStrategyProvisioningState left, Azure.ResourceManager.ContainerServiceFleet.Models.FleetUpdateStrategyProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerServiceFleet.Models.FleetUpdateStrategyProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerServiceFleet.Models.FleetUpdateStrategyProvisioningState left, Azure.ResourceManager.ContainerServiceFleet.Models.FleetUpdateStrategyProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } public partial class MemberUpdateStatus { internal MemberUpdateStatus() { } diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_ContainerServiceFleetCollection.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_ContainerServiceFleetCollection.cs index 9e7cde4b58307..1f9eb18786499 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_ContainerServiceFleetCollection.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_ContainerServiceFleetCollection.cs @@ -24,7 +24,7 @@ public partial class Sample_ContainerServiceFleetCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListsTheFleetResourcesInAResourceGroup() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-06-15-preview/examples/Fleets_ListByResourceGroup.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/Fleets_ListByResourceGroup.json // this example is just showing the usage of "Fleets_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +60,7 @@ public async Task GetAll_ListsTheFleetResourcesInAResourceGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsAFleetResource() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-06-15-preview/examples/Fleets_Get.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/Fleets_Get.json // this example is just showing the usage of "Fleets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +94,7 @@ public async Task Get_GetsAFleetResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetsAFleetResource() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-06-15-preview/examples/Fleets_Get.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/Fleets_Get.json // this example is just showing the usage of "Fleets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -124,7 +124,7 @@ public async Task Exists_GetsAFleetResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetsAFleetResource() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-06-15-preview/examples/Fleets_Get.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/Fleets_Get.json // this example is just showing the usage of "Fleets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +166,7 @@ public async Task GetIfExists_GetsAFleetResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreatesAFleetResourceWithALongRunningOperation() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-06-15-preview/examples/Fleets_CreateOrUpdate.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/Fleets_CreateOrUpdate.json // this example is just showing the usage of "Fleets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -191,6 +191,10 @@ public async Task CreateOrUpdate_CreatesAFleetResourceWithALongRunningOperation( HubProfile = new FleetHubProfile() { DnsPrefix = "dnsprefix1", + AgentProfile = new ContainerServiceFleetAgentProfile() + { + VmSize = "Standard_DS1", + }, }, Tags = { diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_ContainerServiceFleetMemberCollection.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_ContainerServiceFleetMemberCollection.cs index bbe091175fc63..ebb54cd3b9c6a 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_ContainerServiceFleetMemberCollection.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_ContainerServiceFleetMemberCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_ContainerServiceFleetMemberCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListsTheMembersOfAFleet() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-06-15-preview/examples/FleetMembers_ListByFleet.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/FleetMembers_ListByFleet.json // this example is just showing the usage of "FleetMembers_ListByFleet" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -59,7 +59,7 @@ public async Task GetAll_ListsTheMembersOfAFleet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsAFleetMemberResource() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-06-15-preview/examples/FleetMembers_Get.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/FleetMembers_Get.json // this example is just showing the usage of "FleetMembers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +94,7 @@ public async Task Get_GetsAFleetMemberResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetsAFleetMemberResource() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-06-15-preview/examples/FleetMembers_Get.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/FleetMembers_Get.json // this example is just showing the usage of "FleetMembers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -125,7 +125,7 @@ public async Task Exists_GetsAFleetMemberResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetsAFleetMemberResource() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-06-15-preview/examples/FleetMembers_Get.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/FleetMembers_Get.json // this example is just showing the usage of "FleetMembers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -168,7 +168,7 @@ public async Task GetIfExists_GetsAFleetMemberResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreatesAFleetMemberResourceWithALongRunningOperation() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-06-15-preview/examples/FleetMembers_Create.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/FleetMembers_Create.json // this example is just showing the usage of "FleetMembers_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_ContainerServiceFleetMemberResource.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_ContainerServiceFleetMemberResource.cs index 3e0968830928a..e8dda797a61ec 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_ContainerServiceFleetMemberResource.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_ContainerServiceFleetMemberResource.cs @@ -23,7 +23,7 @@ public partial class Sample_ContainerServiceFleetMemberResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsAFleetMemberResource() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-06-15-preview/examples/FleetMembers_Get.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/FleetMembers_Get.json // this example is just showing the usage of "FleetMembers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -55,7 +55,7 @@ public async Task Get_GetsAFleetMemberResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdatesAFleetMemberResourceSynchronously() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-06-15-preview/examples/FleetMembers_Update.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/FleetMembers_Update.json // this example is just showing the usage of "FleetMembers_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +92,7 @@ public async Task Update_UpdatesAFleetMemberResourceSynchronously() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeletesAFleetMemberResourceAsynchronouslyWithALongRunningOperation() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-06-15-preview/examples/FleetMembers_Delete.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/FleetMembers_Delete.json // this example is just showing the usage of "FleetMembers_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_ContainerServiceFleetResource.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_ContainerServiceFleetResource.cs index b6ebe86224cd6..d74f8f53950cd 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_ContainerServiceFleetResource.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_ContainerServiceFleetResource.cs @@ -24,7 +24,7 @@ public partial class Sample_ContainerServiceFleetResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetContainerServiceFleets_ListsTheFleetResourcesInASubscription() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-06-15-preview/examples/Fleets_ListBySub.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/Fleets_ListBySub.json // this example is just showing the usage of "Fleets_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -56,7 +56,7 @@ public async Task GetContainerServiceFleets_ListsTheFleetResourcesInASubscriptio [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsAFleetResource() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-06-15-preview/examples/Fleets_Get.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/Fleets_Get.json // this example is just showing the usage of "Fleets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -87,7 +87,7 @@ public async Task Get_GetsAFleetResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateAFleet() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-06-15-preview/examples/Fleets_PatchTags.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/Fleets_PatchTags.json // this example is just showing the usage of "Fleets_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -128,7 +128,7 @@ public async Task Update_UpdateAFleet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeletesAFleetResourceAsynchronouslyWithALongRunningOperation() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-06-15-preview/examples/Fleets_Delete.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/Fleets_Delete.json // this example is just showing the usage of "Fleets_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -155,7 +155,7 @@ public async Task Delete_DeletesAFleetResourceAsynchronouslyWithALongRunningOper [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetCredentials_ListsTheUserCredentialsOfAFleet() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-06-15-preview/examples/Fleets_ListCredentialsResult.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/Fleets_ListCredentialsResult.json // this example is just showing the usage of "Fleets_ListCredentials" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_ContainerServiceFleetUpdateRunCollection.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_ContainerServiceFleetUpdateRunCollection.cs index 2980d398ed974..03f67787fcadf 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_ContainerServiceFleetUpdateRunCollection.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_ContainerServiceFleetUpdateRunCollection.cs @@ -23,7 +23,7 @@ public partial class Sample_ContainerServiceFleetUpdateRunCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListsTheUpdateRunResourcesByFleet() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-06-15-preview/examples/UpdateRuns_ListByFleet.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/UpdateRuns_ListByFleet.json // this example is just showing the usage of "UpdateRuns_ListByFleet" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +60,7 @@ public async Task GetAll_ListsTheUpdateRunResourcesByFleet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsAnUpdateRunResource() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-06-15-preview/examples/UpdateRuns_Get.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/UpdateRuns_Get.json // this example is just showing the usage of "UpdateRuns_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -95,7 +95,7 @@ public async Task Get_GetsAnUpdateRunResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetsAnUpdateRunResource() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-06-15-preview/examples/UpdateRuns_Get.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/UpdateRuns_Get.json // this example is just showing the usage of "UpdateRuns_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -126,7 +126,7 @@ public async Task Exists_GetsAnUpdateRunResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetsAnUpdateRunResource() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-06-15-preview/examples/UpdateRuns_Get.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/UpdateRuns_Get.json // this example is just showing the usage of "UpdateRuns_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -169,7 +169,7 @@ public async Task GetIfExists_GetsAnUpdateRunResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAnUpdateRun() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-06-15-preview/examples/UpdateRuns_CreateOrUpdate.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/UpdateRuns_CreateOrUpdate.json // this example is just showing the usage of "UpdateRuns_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -192,6 +192,7 @@ public async Task CreateOrUpdate_CreateAnUpdateRun() string updateRunName = "run1"; ContainerServiceFleetUpdateRunData data = new ContainerServiceFleetUpdateRunData() { + UpdateStrategyId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/fleets/myFleet/updateStrategies/strategy1"), StrategyStages = { new ContainerServiceFleetUpdateStage("stage1") diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_ContainerServiceFleetUpdateRunResource.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_ContainerServiceFleetUpdateRunResource.cs index 798502c128aa3..7bfede3247246 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_ContainerServiceFleetUpdateRunResource.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_ContainerServiceFleetUpdateRunResource.cs @@ -23,7 +23,7 @@ public partial class Sample_ContainerServiceFleetUpdateRunResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsAnUpdateRunResource() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-06-15-preview/examples/UpdateRuns_Get.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/UpdateRuns_Get.json // this example is just showing the usage of "UpdateRuns_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -55,7 +55,7 @@ public async Task Get_GetsAnUpdateRunResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateAnUpdateRun() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-06-15-preview/examples/UpdateRuns_CreateOrUpdate.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/UpdateRuns_CreateOrUpdate.json // this example is just showing the usage of "UpdateRuns_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -75,6 +75,7 @@ public async Task Update_CreateAnUpdateRun() // invoke the operation ContainerServiceFleetUpdateRunData data = new ContainerServiceFleetUpdateRunData() { + UpdateStrategyId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/fleets/myFleet/updateStrategies/strategy1"), StrategyStages = { new ContainerServiceFleetUpdateStage("stage1") @@ -109,7 +110,7 @@ public async Task Update_CreateAnUpdateRun() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteAnUpdateRunResource() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-06-15-preview/examples/UpdateRuns_Delete.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/UpdateRuns_Delete.json // this example is just showing the usage of "UpdateRuns_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -137,7 +138,7 @@ public async Task Delete_DeleteAnUpdateRunResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Start_StartsAnUpdateRun() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-06-15-preview/examples/UpdateRuns_Start.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/UpdateRuns_Start.json // this example is just showing the usage of "UpdateRuns_Start" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -170,7 +171,7 @@ public async Task Start_StartsAnUpdateRun() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Stop_StopsAnUpdateRun() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-06-15-preview/examples/UpdateRuns_Stop.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/UpdateRuns_Stop.json // this example is just showing the usage of "UpdateRuns_Stop" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_FleetUpdateStrategyCollection.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_FleetUpdateStrategyCollection.cs new file mode 100644 index 0000000000000..7bc011e5f2ad4 --- /dev/null +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_FleetUpdateStrategyCollection.cs @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.ContainerServiceFleet; +using Azure.ResourceManager.ContainerServiceFleet.Models; + +namespace Azure.ResourceManager.ContainerServiceFleet.Samples +{ + public partial class Sample_FleetUpdateStrategyCollection + { + // List the FleetUpdateStrategy resources by fleet. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListTheFleetUpdateStrategyResourcesByFleet() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/UpdateStrategies_ListByFleet.json + // this example is just showing the usage of "FleetUpdateStrategies_ListByFleet" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerServiceFleetResource created on azure + // for more information of creating ContainerServiceFleetResource, please refer to the document of ContainerServiceFleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier containerServiceFleetResourceId = ContainerServiceFleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + ContainerServiceFleetResource containerServiceFleet = client.GetContainerServiceFleetResource(containerServiceFleetResourceId); + + // get the collection of this FleetUpdateStrategyResource + FleetUpdateStrategyCollection collection = containerServiceFleet.GetFleetUpdateStrategies(); + + // invoke the operation and iterate over the result + await foreach (FleetUpdateStrategyResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetUpdateStrategyData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get a FleetUpdateStrategy resource. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetAFleetUpdateStrategyResource() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/UpdateStrategies_Get.json + // this example is just showing the usage of "FleetUpdateStrategies_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerServiceFleetResource created on azure + // for more information of creating ContainerServiceFleetResource, please refer to the document of ContainerServiceFleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier containerServiceFleetResourceId = ContainerServiceFleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + ContainerServiceFleetResource containerServiceFleet = client.GetContainerServiceFleetResource(containerServiceFleetResourceId); + + // get the collection of this FleetUpdateStrategyResource + FleetUpdateStrategyCollection collection = containerServiceFleet.GetFleetUpdateStrategies(); + + // invoke the operation + string updateStrategyName = "strategy1"; + FleetUpdateStrategyResource result = await collection.GetAsync(updateStrategyName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetUpdateStrategyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get a FleetUpdateStrategy resource. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetAFleetUpdateStrategyResource() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/UpdateStrategies_Get.json + // this example is just showing the usage of "FleetUpdateStrategies_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerServiceFleetResource created on azure + // for more information of creating ContainerServiceFleetResource, please refer to the document of ContainerServiceFleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier containerServiceFleetResourceId = ContainerServiceFleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + ContainerServiceFleetResource containerServiceFleet = client.GetContainerServiceFleetResource(containerServiceFleetResourceId); + + // get the collection of this FleetUpdateStrategyResource + FleetUpdateStrategyCollection collection = containerServiceFleet.GetFleetUpdateStrategies(); + + // invoke the operation + string updateStrategyName = "strategy1"; + bool result = await collection.ExistsAsync(updateStrategyName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get a FleetUpdateStrategy resource. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetAFleetUpdateStrategyResource() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/UpdateStrategies_Get.json + // this example is just showing the usage of "FleetUpdateStrategies_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerServiceFleetResource created on azure + // for more information of creating ContainerServiceFleetResource, please refer to the document of ContainerServiceFleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier containerServiceFleetResourceId = ContainerServiceFleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + ContainerServiceFleetResource containerServiceFleet = client.GetContainerServiceFleetResource(containerServiceFleetResourceId); + + // get the collection of this FleetUpdateStrategyResource + FleetUpdateStrategyCollection collection = containerServiceFleet.GetFleetUpdateStrategies(); + + // invoke the operation + string updateStrategyName = "strategy1"; + NullableResponse response = await collection.GetIfExistsAsync(updateStrategyName); + FleetUpdateStrategyResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetUpdateStrategyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Create a FleetUpdateStrategy. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateAFleetUpdateStrategy() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/UpdateStrategies_CreateOrUpdate.json + // this example is just showing the usage of "FleetUpdateStrategies_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerServiceFleetResource created on azure + // for more information of creating ContainerServiceFleetResource, please refer to the document of ContainerServiceFleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier containerServiceFleetResourceId = ContainerServiceFleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + ContainerServiceFleetResource containerServiceFleet = client.GetContainerServiceFleetResource(containerServiceFleetResourceId); + + // get the collection of this FleetUpdateStrategyResource + FleetUpdateStrategyCollection collection = containerServiceFleet.GetFleetUpdateStrategies(); + + // invoke the operation + string updateStrategyName = "strartegy1"; + FleetUpdateStrategyData data = new FleetUpdateStrategyData() + { + StrategyStages = +{ +new ContainerServiceFleetUpdateStage("stage1") +{ +Groups = +{ +new ContainerServiceFleetUpdateGroup("group-a") +}, +AfterStageWaitInSeconds = 3600, +} +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, updateStrategyName, data); + FleetUpdateStrategyResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetUpdateStrategyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_FleetUpdateStrategyResource.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_FleetUpdateStrategyResource.cs new file mode 100644 index 0000000000000..e560a876b26bb --- /dev/null +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_FleetUpdateStrategyResource.cs @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.ContainerServiceFleet; +using Azure.ResourceManager.ContainerServiceFleet.Models; + +namespace Azure.ResourceManager.ContainerServiceFleet.Samples +{ + public partial class Sample_FleetUpdateStrategyResource + { + // Get a FleetUpdateStrategy resource. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetAFleetUpdateStrategyResource() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/UpdateStrategies_Get.json + // this example is just showing the usage of "FleetUpdateStrategies_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetUpdateStrategyResource created on azure + // for more information of creating FleetUpdateStrategyResource, please refer to the document of FleetUpdateStrategyResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + string updateStrategyName = "strategy1"; + ResourceIdentifier fleetUpdateStrategyResourceId = FleetUpdateStrategyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, updateStrategyName); + FleetUpdateStrategyResource fleetUpdateStrategy = client.GetFleetUpdateStrategyResource(fleetUpdateStrategyResourceId); + + // invoke the operation + FleetUpdateStrategyResource result = await fleetUpdateStrategy.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetUpdateStrategyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Create a FleetUpdateStrategy. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_CreateAFleetUpdateStrategy() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/UpdateStrategies_CreateOrUpdate.json + // this example is just showing the usage of "FleetUpdateStrategies_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetUpdateStrategyResource created on azure + // for more information of creating FleetUpdateStrategyResource, please refer to the document of FleetUpdateStrategyResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + string updateStrategyName = "strartegy1"; + ResourceIdentifier fleetUpdateStrategyResourceId = FleetUpdateStrategyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, updateStrategyName); + FleetUpdateStrategyResource fleetUpdateStrategy = client.GetFleetUpdateStrategyResource(fleetUpdateStrategyResourceId); + + // invoke the operation + FleetUpdateStrategyData data = new FleetUpdateStrategyData() + { + StrategyStages = +{ +new ContainerServiceFleetUpdateStage("stage1") +{ +Groups = +{ +new ContainerServiceFleetUpdateGroup("group-a") +}, +AfterStageWaitInSeconds = 3600, +} +}, + }; + ArmOperation lro = await fleetUpdateStrategy.UpdateAsync(WaitUntil.Completed, data); + FleetUpdateStrategyResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetUpdateStrategyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Delete a FleetUpdateStrategy resource. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_DeleteAFleetUpdateStrategyResource() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/UpdateStrategies_Delete.json + // this example is just showing the usage of "FleetUpdateStrategies_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetUpdateStrategyResource created on azure + // for more information of creating FleetUpdateStrategyResource, please refer to the document of FleetUpdateStrategyResource + string subscriptionId = "subid1"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + string updateStrategyName = "strategy1"; + ResourceIdentifier fleetUpdateStrategyResourceId = FleetUpdateStrategyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, updateStrategyName); + FleetUpdateStrategyResource fleetUpdateStrategy = client.GetFleetUpdateStrategyResource(fleetUpdateStrategyResourceId); + + // invoke the operation + await fleetUpdateStrategy.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + } +} diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ArmContainerServiceFleetModelFactory.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ArmContainerServiceFleetModelFactory.cs index 14a60b4ceba9d..a8f0b1f8cf6f7 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ArmContainerServiceFleetModelFactory.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ArmContainerServiceFleetModelFactory.cs @@ -40,13 +40,14 @@ public static ContainerServiceFleetData ContainerServiceFleetData(ResourceIdenti /// Initializes a new instance of FleetHubProfile. /// DNS prefix used to create the FQDN for the Fleet hub. /// The access profile for the Fleet hub API server. - /// The agent profile for the Fleet hub. + /// The agent profile for the Fleet hub. /// The FQDN of the Fleet hub. /// The Kubernetes version of the Fleet hub. + /// The Azure Portal FQDN of the Fleet hub. /// A new instance for mocking. - public static FleetHubProfile FleetHubProfile(string dnsPrefix = null, ContainerServiceFleetAPIServerAccessProfile apiServerAccessProfile = null, ResourceIdentifier agentSubnetId = null, string fqdn = null, string kubernetesVersion = null) + public static FleetHubProfile FleetHubProfile(string dnsPrefix = null, ContainerServiceFleetAPIServerAccessProfile apiServerAccessProfile = null, ContainerServiceFleetAgentProfile agentProfile = null, string fqdn = null, string kubernetesVersion = null, string portalFqdn = null) { - return new FleetHubProfile(dnsPrefix, apiServerAccessProfile, agentSubnetId != null ? new ContainerServiceFleetAgentProfile(agentSubnetId) : null, fqdn, kubernetesVersion); + return new FleetHubProfile(dnsPrefix, apiServerAccessProfile, agentProfile, fqdn, kubernetesVersion, portalFqdn); } /// Initializes a new instance of FleetCredentialResults. @@ -90,6 +91,20 @@ public static ContainerServiceFleetMemberData ContainerServiceFleetMemberData(Re /// The systemData. /// 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. /// The provisioning state of the UpdateRun resource. + /// + /// The resource id of the FleetUpdateStrategy resource to reference. + /// + /// When creating a new run, there are three ways to define a strategy for the run: + /// 1. Define a new strategy in place: Set the "strategy" field. + /// 2. Use an existing strategy: Set the "updateStrategyId" field. (since 2023-08-15-preview) + /// 3. Use the default strategy to update all the members one by one: Leave both "updateStrategyId" and "strategy" unset. (since 2023-08-15-preview) + /// + /// Setting both "updateStrategyId" and "strategy" is invalid. + /// + /// UpdateRuns created by "updateStrategyId" snapshot the referenced UpdateStrategy at the time of creation and store it in the "strategy" field. + /// Subsequent changes to the referenced FleetUpdateStrategy resource do not propagate. + /// UpdateRunStrategy changes can be made directly on the "strategy" field before launching the UpdateRun. + /// /// /// The strategy defines the order in which the clusters will be updated. /// If not set, all members will be updated sequentially. The UpdateRun status will show a single UpdateStage and a single UpdateGroup targeting all members. @@ -98,11 +113,11 @@ public static ContainerServiceFleetMemberData ContainerServiceFleetMemberData(Re /// The update to be applied to all clusters in the UpdateRun. The managedClusterUpdate can be modified until the run is started. /// The status of the UpdateRun. /// A new instance for mocking. - public static ContainerServiceFleetUpdateRunData ContainerServiceFleetUpdateRunData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ETag? eTag = null, ContainerServiceFleetUpdateRunProvisioningState? provisioningState = null, IEnumerable strategyStages = null, ContainerServiceFleetManagedClusterUpdate managedClusterUpdate = null, ContainerServiceFleetUpdateRunStatus status = null) + public static ContainerServiceFleetUpdateRunData ContainerServiceFleetUpdateRunData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ETag? eTag = null, ContainerServiceFleetUpdateRunProvisioningState? provisioningState = null, ResourceIdentifier updateStrategyId = null, IEnumerable strategyStages = null, ContainerServiceFleetManagedClusterUpdate managedClusterUpdate = null, ContainerServiceFleetUpdateRunStatus status = null) { strategyStages ??= new List(); - return new ContainerServiceFleetUpdateRunData(id, name, resourceType, systemData, eTag, provisioningState, strategyStages != null ? new ContainerServiceFleetUpdateRunStrategy(strategyStages?.ToList()) : null, managedClusterUpdate, status); + return new ContainerServiceFleetUpdateRunData(id, name, resourceType, systemData, eTag, provisioningState, updateStrategyId, strategyStages != null ? new ContainerServiceFleetUpdateRunStrategy(strategyStages?.ToList()) : null, managedClusterUpdate, status); } /// Initializes a new instance of ContainerServiceFleetUpdateRunStatus. @@ -182,5 +197,21 @@ public static NodeImageVersion NodeImageVersion(string version = null) { return new NodeImageVersion(version); } + + /// Initializes a new instance of FleetUpdateStrategyData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// 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. + /// The provisioning state of the UpdateStrategy resource. + /// Defines the update sequence of the clusters. + /// A new instance for mocking. + public static FleetUpdateStrategyData FleetUpdateStrategyData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ETag? eTag = null, FleetUpdateStrategyProvisioningState? provisioningState = null, IEnumerable strategyStages = null) + { + strategyStages ??= new List(); + + return new FleetUpdateStrategyData(id, name, resourceType, systemData, eTag, provisioningState, strategyStages != null ? new ContainerServiceFleetUpdateRunStrategy(strategyStages?.ToList()) : null); + } } } diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetCollection.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetCollection.cs index 47465e33c6e66..c1880a1735c42 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetCollection.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetCollection.cs @@ -85,7 +85,7 @@ public virtual async Task> CreateOrU try { var response = await _containerServiceFleetFleetsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, fleetName, data, ifMatch, ifNoneMatch, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetOperationSource(Client), _containerServiceFleetFleetsClientDiagnostics, Pipeline, _containerServiceFleetFleetsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, fleetName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetOperationSource(Client), _containerServiceFleetFleetsClientDiagnostics, Pipeline, _containerServiceFleetFleetsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, fleetName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation, apiVersionOverrideValue: "2016-03-30"); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -128,7 +128,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUn try { var response = _containerServiceFleetFleetsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, fleetName, data, ifMatch, ifNoneMatch, cancellationToken); - var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetOperationSource(Client), _containerServiceFleetFleetsClientDiagnostics, Pipeline, _containerServiceFleetFleetsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, fleetName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetOperationSource(Client), _containerServiceFleetFleetsClientDiagnostics, Pipeline, _containerServiceFleetFleetsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, fleetName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation, apiVersionOverrideValue: "2016-03-30"); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetMemberCollection.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetMemberCollection.cs index 97575951d96fd..c4ad11733b2c7 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetMemberCollection.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetMemberCollection.cs @@ -84,7 +84,7 @@ public virtual async Task> Cre try { var response = await _containerServiceFleetMemberFleetMembersRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetMemberName, data, ifMatch, ifNoneMatch, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetMemberOperationSource(Client), _containerServiceFleetMemberFleetMembersClientDiagnostics, Pipeline, _containerServiceFleetMemberFleetMembersRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetMemberName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetMemberOperationSource(Client), _containerServiceFleetMemberFleetMembersClientDiagnostics, Pipeline, _containerServiceFleetMemberFleetMembersRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetMemberName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation, apiVersionOverrideValue: "2016-03-30"); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -127,7 +127,7 @@ public virtual ArmOperation CreateOrUpdate( try { var response = _containerServiceFleetMemberFleetMembersRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetMemberName, data, ifMatch, ifNoneMatch, cancellationToken); - var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetMemberOperationSource(Client), _containerServiceFleetMemberFleetMembersClientDiagnostics, Pipeline, _containerServiceFleetMemberFleetMembersRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetMemberName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetMemberOperationSource(Client), _containerServiceFleetMemberFleetMembersClientDiagnostics, Pipeline, _containerServiceFleetMemberFleetMembersRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetMemberName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation, apiVersionOverrideValue: "2016-03-30"); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetMemberResource.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetMemberResource.cs index 3139f44c15619..79d73014025d0 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetMemberResource.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetMemberResource.cs @@ -174,7 +174,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, string try { var response = await _containerServiceFleetMemberFleetMembersRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceFleetArmOperation(_containerServiceFleetMemberFleetMembersClientDiagnostics, Pipeline, _containerServiceFleetMemberFleetMembersRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); + var operation = new ContainerServiceFleetArmOperation(_containerServiceFleetMemberFleetMembersClientDiagnostics, Pipeline, _containerServiceFleetMemberFleetMembersRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2016-03-30"); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -209,7 +209,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, string ifMatch = null, C try { var response = _containerServiceFleetMemberFleetMembersRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch, cancellationToken); - var operation = new ContainerServiceFleetArmOperation(_containerServiceFleetMemberFleetMembersClientDiagnostics, Pipeline, _containerServiceFleetMemberFleetMembersRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); + var operation = new ContainerServiceFleetArmOperation(_containerServiceFleetMemberFleetMembersClientDiagnostics, Pipeline, _containerServiceFleetMemberFleetMembersRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2016-03-30"); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -248,7 +248,7 @@ public virtual async Task> Upd try { var response = await _containerServiceFleetMemberFleetMembersRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, ifMatch, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetMemberOperationSource(Client), _containerServiceFleetMemberFleetMembersClientDiagnostics, Pipeline, _containerServiceFleetMemberFleetMembersRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, ifMatch).Request, response, OperationFinalStateVia.Location); + var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetMemberOperationSource(Client), _containerServiceFleetMemberFleetMembersClientDiagnostics, Pipeline, _containerServiceFleetMemberFleetMembersRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, ifMatch).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2016-03-30"); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -287,7 +287,7 @@ public virtual ArmOperation Update(WaitUnti try { var response = _containerServiceFleetMemberFleetMembersRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, ifMatch, cancellationToken); - var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetMemberOperationSource(Client), _containerServiceFleetMemberFleetMembersClientDiagnostics, Pipeline, _containerServiceFleetMemberFleetMembersRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, ifMatch).Request, response, OperationFinalStateVia.Location); + var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetMemberOperationSource(Client), _containerServiceFleetMemberFleetMembersClientDiagnostics, Pipeline, _containerServiceFleetMemberFleetMembersRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, ifMatch).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2016-03-30"); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetResource.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetResource.cs index dae8e4cf2c3f7..ceb62d0e77e16 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetResource.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetResource.cs @@ -195,6 +195,59 @@ public virtual Response GetContainerServ return GetContainerServiceFleetUpdateRuns().Get(updateRunName, cancellationToken); } + /// Gets a collection of FleetUpdateStrategyResources in the ContainerServiceFleet. + /// An object representing collection of FleetUpdateStrategyResources and their operations over a FleetUpdateStrategyResource. + public virtual FleetUpdateStrategyCollection GetFleetUpdateStrategies() + { + return GetCachedClient(Client => new FleetUpdateStrategyCollection(Client, Id)); + } + + /// + /// Get a FleetUpdateStrategy + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} + /// + /// + /// Operation Id + /// FleetUpdateStrategies_Get + /// + /// + /// + /// The name of the UpdateStrategy resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual async Task> GetFleetUpdateStrategyAsync(string updateStrategyName, CancellationToken cancellationToken = default) + { + return await GetFleetUpdateStrategies().GetAsync(updateStrategyName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a FleetUpdateStrategy + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} + /// + /// + /// Operation Id + /// FleetUpdateStrategies_Get + /// + /// + /// + /// The name of the UpdateStrategy resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual Response GetFleetUpdateStrategy(string updateStrategyName, CancellationToken cancellationToken = default) + { + return GetFleetUpdateStrategies().Get(updateStrategyName, cancellationToken); + } + /// /// Gets a Fleet. /// @@ -282,7 +335,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, string try { var response = await _containerServiceFleetFleetsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, ifMatch, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceFleetArmOperation(_containerServiceFleetFleetsClientDiagnostics, Pipeline, _containerServiceFleetFleetsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); + var operation = new ContainerServiceFleetArmOperation(_containerServiceFleetFleetsClientDiagnostics, Pipeline, _containerServiceFleetFleetsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2016-03-30"); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -317,7 +370,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, string ifMatch = null, C try { var response = _containerServiceFleetFleetsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, ifMatch, cancellationToken); - var operation = new ContainerServiceFleetArmOperation(_containerServiceFleetFleetsClientDiagnostics, Pipeline, _containerServiceFleetFleetsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); + var operation = new ContainerServiceFleetArmOperation(_containerServiceFleetFleetsClientDiagnostics, Pipeline, _containerServiceFleetFleetsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2016-03-30"); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -356,7 +409,7 @@ public virtual async Task> UpdateAsy try { var response = await _containerServiceFleetFleetsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetOperationSource(Client), _containerServiceFleetFleetsClientDiagnostics, Pipeline, _containerServiceFleetFleetsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch).Request, response, OperationFinalStateVia.Location); + var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetOperationSource(Client), _containerServiceFleetFleetsClientDiagnostics, Pipeline, _containerServiceFleetFleetsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2016-03-30"); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -395,7 +448,7 @@ public virtual ArmOperation Update(WaitUntil wait try { var response = _containerServiceFleetFleetsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch, cancellationToken); - var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetOperationSource(Client), _containerServiceFleetFleetsClientDiagnostics, Pipeline, _containerServiceFleetFleetsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch).Request, response, OperationFinalStateVia.Location); + var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetOperationSource(Client), _containerServiceFleetFleetsClientDiagnostics, Pipeline, _containerServiceFleetFleetsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2016-03-30"); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetUpdateRunCollection.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetUpdateRunCollection.cs index d644c4b44e075..275e83e02d01a 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetUpdateRunCollection.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetUpdateRunCollection.cs @@ -84,7 +84,7 @@ public virtual async Task> try { var response = await _containerServiceFleetUpdateRunUpdateRunsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateRunName, data, ifMatch, ifNoneMatch, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetUpdateRunOperationSource(Client), _containerServiceFleetUpdateRunUpdateRunsClientDiagnostics, Pipeline, _containerServiceFleetUpdateRunUpdateRunsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateRunName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetUpdateRunOperationSource(Client), _containerServiceFleetUpdateRunUpdateRunsClientDiagnostics, Pipeline, _containerServiceFleetUpdateRunUpdateRunsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateRunName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation, apiVersionOverrideValue: "2016-03-30"); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -127,7 +127,7 @@ public virtual ArmOperation CreateOrUpda try { var response = _containerServiceFleetUpdateRunUpdateRunsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateRunName, data, ifMatch, ifNoneMatch, cancellationToken); - var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetUpdateRunOperationSource(Client), _containerServiceFleetUpdateRunUpdateRunsClientDiagnostics, Pipeline, _containerServiceFleetUpdateRunUpdateRunsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateRunName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetUpdateRunOperationSource(Client), _containerServiceFleetUpdateRunUpdateRunsClientDiagnostics, Pipeline, _containerServiceFleetUpdateRunUpdateRunsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateRunName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation, apiVersionOverrideValue: "2016-03-30"); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetUpdateRunData.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetUpdateRunData.cs index b4d5cee77962b..ea978f2cee78c 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetUpdateRunData.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetUpdateRunData.cs @@ -15,7 +15,7 @@ namespace Azure.ResourceManager.ContainerServiceFleet { /// /// A class representing the ContainerServiceFleetUpdateRun data model. - /// An UpdateRun is a multi-stage process to perform update operations across members of a Fleet. + /// A multi-stage process to perform update operations across members of a Fleet. /// public partial class ContainerServiceFleetUpdateRunData : ResourceData { @@ -31,6 +31,20 @@ public ContainerServiceFleetUpdateRunData() /// The systemData. /// 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. /// The provisioning state of the UpdateRun resource. + /// + /// The resource id of the FleetUpdateStrategy resource to reference. + /// + /// When creating a new run, there are three ways to define a strategy for the run: + /// 1. Define a new strategy in place: Set the "strategy" field. + /// 2. Use an existing strategy: Set the "updateStrategyId" field. (since 2023-08-15-preview) + /// 3. Use the default strategy to update all the members one by one: Leave both "updateStrategyId" and "strategy" unset. (since 2023-08-15-preview) + /// + /// Setting both "updateStrategyId" and "strategy" is invalid. + /// + /// UpdateRuns created by "updateStrategyId" snapshot the referenced UpdateStrategy at the time of creation and store it in the "strategy" field. + /// Subsequent changes to the referenced FleetUpdateStrategy resource do not propagate. + /// UpdateRunStrategy changes can be made directly on the "strategy" field before launching the UpdateRun. + /// /// /// The strategy defines the order in which the clusters will be updated. /// If not set, all members will be updated sequentially. The UpdateRun status will show a single UpdateStage and a single UpdateGroup targeting all members. @@ -38,10 +52,11 @@ public ContainerServiceFleetUpdateRunData() /// /// The update to be applied to all clusters in the UpdateRun. The managedClusterUpdate can be modified until the run is started. /// The status of the UpdateRun. - internal ContainerServiceFleetUpdateRunData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ETag? eTag, ContainerServiceFleetUpdateRunProvisioningState? provisioningState, ContainerServiceFleetUpdateRunStrategy strategy, ContainerServiceFleetManagedClusterUpdate managedClusterUpdate, ContainerServiceFleetUpdateRunStatus status) : base(id, name, resourceType, systemData) + internal ContainerServiceFleetUpdateRunData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ETag? eTag, ContainerServiceFleetUpdateRunProvisioningState? provisioningState, ResourceIdentifier updateStrategyId, ContainerServiceFleetUpdateRunStrategy strategy, ContainerServiceFleetManagedClusterUpdate managedClusterUpdate, ContainerServiceFleetUpdateRunStatus status) : base(id, name, resourceType, systemData) { ETag = eTag; ProvisioningState = provisioningState; + UpdateStrategyId = updateStrategyId; Strategy = strategy; ManagedClusterUpdate = managedClusterUpdate; Status = status; @@ -52,12 +67,27 @@ internal ContainerServiceFleetUpdateRunData(ResourceIdentifier id, string name, /// The provisioning state of the UpdateRun resource. public ContainerServiceFleetUpdateRunProvisioningState? ProvisioningState { get; } /// + /// The resource id of the FleetUpdateStrategy resource to reference. + /// + /// When creating a new run, there are three ways to define a strategy for the run: + /// 1. Define a new strategy in place: Set the "strategy" field. + /// 2. Use an existing strategy: Set the "updateStrategyId" field. (since 2023-08-15-preview) + /// 3. Use the default strategy to update all the members one by one: Leave both "updateStrategyId" and "strategy" unset. (since 2023-08-15-preview) + /// + /// Setting both "updateStrategyId" and "strategy" is invalid. + /// + /// UpdateRuns created by "updateStrategyId" snapshot the referenced UpdateStrategy at the time of creation and store it in the "strategy" field. + /// Subsequent changes to the referenced FleetUpdateStrategy resource do not propagate. + /// UpdateRunStrategy changes can be made directly on the "strategy" field before launching the UpdateRun. + /// + public ResourceIdentifier UpdateStrategyId { get; set; } + /// /// The strategy defines the order in which the clusters will be updated. /// If not set, all members will be updated sequentially. The UpdateRun status will show a single UpdateStage and a single UpdateGroup targeting all members. /// The strategy of the UpdateRun can be modified until the run is started. /// internal ContainerServiceFleetUpdateRunStrategy Strategy { get; set; } - /// The list of stages that compose this update run. + /// The list of stages that compose this update run. Min size: 1. public IList StrategyStages { get => Strategy is null ? default : Strategy.Stages; diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetUpdateRunResource.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetUpdateRunResource.cs index e2b2a7afcb8fe..299fd11ae8b9e 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetUpdateRunResource.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetUpdateRunResource.cs @@ -173,7 +173,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, string try { var response = await _containerServiceFleetUpdateRunUpdateRunsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceFleetArmOperation(_containerServiceFleetUpdateRunUpdateRunsClientDiagnostics, Pipeline, _containerServiceFleetUpdateRunUpdateRunsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); + var operation = new ContainerServiceFleetArmOperation(_containerServiceFleetUpdateRunUpdateRunsClientDiagnostics, Pipeline, _containerServiceFleetUpdateRunUpdateRunsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2016-03-30"); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -208,7 +208,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, string ifMatch = null, C try { var response = _containerServiceFleetUpdateRunUpdateRunsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch, cancellationToken); - var operation = new ContainerServiceFleetArmOperation(_containerServiceFleetUpdateRunUpdateRunsClientDiagnostics, Pipeline, _containerServiceFleetUpdateRunUpdateRunsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); + var operation = new ContainerServiceFleetArmOperation(_containerServiceFleetUpdateRunUpdateRunsClientDiagnostics, Pipeline, _containerServiceFleetUpdateRunUpdateRunsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2016-03-30"); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -248,7 +248,7 @@ public virtual async Task> try { var response = await _containerServiceFleetUpdateRunUpdateRunsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetUpdateRunOperationSource(Client), _containerServiceFleetUpdateRunUpdateRunsClientDiagnostics, Pipeline, _containerServiceFleetUpdateRunUpdateRunsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetUpdateRunOperationSource(Client), _containerServiceFleetUpdateRunUpdateRunsClientDiagnostics, Pipeline, _containerServiceFleetUpdateRunUpdateRunsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation, apiVersionOverrideValue: "2016-03-30"); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -288,7 +288,7 @@ public virtual ArmOperation Update(WaitU try { var response = _containerServiceFleetUpdateRunUpdateRunsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch, cancellationToken); - var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetUpdateRunOperationSource(Client), _containerServiceFleetUpdateRunUpdateRunsClientDiagnostics, Pipeline, _containerServiceFleetUpdateRunUpdateRunsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetUpdateRunOperationSource(Client), _containerServiceFleetUpdateRunUpdateRunsClientDiagnostics, Pipeline, _containerServiceFleetUpdateRunUpdateRunsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation, apiVersionOverrideValue: "2016-03-30"); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/ContainerServiceFleetExtensions.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/ContainerServiceFleetExtensions.cs index 1b4e9719c8f5d..8646973c2d1d0 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/ContainerServiceFleetExtensions.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/ContainerServiceFleetExtensions.cs @@ -106,6 +106,25 @@ public static ContainerServiceFleetUpdateRunResource GetContainerServiceFleetUpd } #endregion + #region FleetUpdateStrategyResource + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static FleetUpdateStrategyResource GetFleetUpdateStrategyResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + FleetUpdateStrategyResource.ValidateResourceId(id); + return new FleetUpdateStrategyResource(client, id); + } + ); + } + #endregion + /// Gets a collection of ContainerServiceFleetResources in the ResourceGroupResource. /// The instance the method will execute against. /// An object representing collection of ContainerServiceFleetResources and their operations over a ContainerServiceFleetResource. diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetUpdateStrategyCollection.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetUpdateStrategyCollection.cs new file mode 100644 index 0000000000000..4ba57d9f99bf8 --- /dev/null +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetUpdateStrategyCollection.cs @@ -0,0 +1,419 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetFleetUpdateStrategies method from an instance of . + /// + public partial class FleetUpdateStrategyCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _fleetUpdateStrategyClientDiagnostics; + private readonly FleetUpdateStrategiesRestOperations _fleetUpdateStrategyRestClient; + + /// Initializes a new instance of the class for mocking. + protected FleetUpdateStrategyCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal FleetUpdateStrategyCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _fleetUpdateStrategyClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerServiceFleet", FleetUpdateStrategyResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(FleetUpdateStrategyResource.ResourceType, out string fleetUpdateStrategyApiVersion); + _fleetUpdateStrategyRestClient = new FleetUpdateStrategiesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fleetUpdateStrategyApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ContainerServiceFleetResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ContainerServiceFleetResource.ResourceType), nameof(id)); + } + + /// + /// Create a FleetUpdateStrategy + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} + /// + /// + /// Operation Id + /// FleetUpdateStrategies_CreateOrUpdate + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the UpdateStrategy resource. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string updateStrategyName, FleetUpdateStrategyData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(updateStrategyName, nameof(updateStrategyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetUpdateStrategyClientDiagnostics.CreateScope("FleetUpdateStrategyCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _fleetUpdateStrategyRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateStrategyName, data, ifMatch, ifNoneMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceFleetArmOperation(new FleetUpdateStrategyOperationSource(Client), _fleetUpdateStrategyClientDiagnostics, Pipeline, _fleetUpdateStrategyRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateStrategyName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation, apiVersionOverrideValue: "2016-03-30"); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a FleetUpdateStrategy + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} + /// + /// + /// Operation Id + /// FleetUpdateStrategies_CreateOrUpdate + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the UpdateStrategy resource. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string updateStrategyName, FleetUpdateStrategyData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(updateStrategyName, nameof(updateStrategyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetUpdateStrategyClientDiagnostics.CreateScope("FleetUpdateStrategyCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _fleetUpdateStrategyRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateStrategyName, data, ifMatch, ifNoneMatch, cancellationToken); + var operation = new ContainerServiceFleetArmOperation(new FleetUpdateStrategyOperationSource(Client), _fleetUpdateStrategyClientDiagnostics, Pipeline, _fleetUpdateStrategyRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateStrategyName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation, apiVersionOverrideValue: "2016-03-30"); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a FleetUpdateStrategy + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} + /// + /// + /// Operation Id + /// FleetUpdateStrategies_Get + /// + /// + /// + /// The name of the UpdateStrategy resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string updateStrategyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(updateStrategyName, nameof(updateStrategyName)); + + using var scope = _fleetUpdateStrategyClientDiagnostics.CreateScope("FleetUpdateStrategyCollection.Get"); + scope.Start(); + try + { + var response = await _fleetUpdateStrategyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateStrategyName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetUpdateStrategyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a FleetUpdateStrategy + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} + /// + /// + /// Operation Id + /// FleetUpdateStrategies_Get + /// + /// + /// + /// The name of the UpdateStrategy resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string updateStrategyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(updateStrategyName, nameof(updateStrategyName)); + + using var scope = _fleetUpdateStrategyClientDiagnostics.CreateScope("FleetUpdateStrategyCollection.Get"); + scope.Start(); + try + { + var response = _fleetUpdateStrategyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateStrategyName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetUpdateStrategyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List FleetUpdateStrategy resources by Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies + /// + /// + /// Operation Id + /// FleetUpdateStrategies_ListByFleet + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fleetUpdateStrategyRestClient.CreateListByFleetRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fleetUpdateStrategyRestClient.CreateListByFleetNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FleetUpdateStrategyResource(Client, FleetUpdateStrategyData.DeserializeFleetUpdateStrategyData(e)), _fleetUpdateStrategyClientDiagnostics, Pipeline, "FleetUpdateStrategyCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List FleetUpdateStrategy resources by Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies + /// + /// + /// Operation Id + /// FleetUpdateStrategies_ListByFleet + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fleetUpdateStrategyRestClient.CreateListByFleetRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fleetUpdateStrategyRestClient.CreateListByFleetNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FleetUpdateStrategyResource(Client, FleetUpdateStrategyData.DeserializeFleetUpdateStrategyData(e)), _fleetUpdateStrategyClientDiagnostics, Pipeline, "FleetUpdateStrategyCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} + /// + /// + /// Operation Id + /// FleetUpdateStrategies_Get + /// + /// + /// + /// The name of the UpdateStrategy resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string updateStrategyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(updateStrategyName, nameof(updateStrategyName)); + + using var scope = _fleetUpdateStrategyClientDiagnostics.CreateScope("FleetUpdateStrategyCollection.Exists"); + scope.Start(); + try + { + var response = await _fleetUpdateStrategyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateStrategyName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} + /// + /// + /// Operation Id + /// FleetUpdateStrategies_Get + /// + /// + /// + /// The name of the UpdateStrategy resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string updateStrategyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(updateStrategyName, nameof(updateStrategyName)); + + using var scope = _fleetUpdateStrategyClientDiagnostics.CreateScope("FleetUpdateStrategyCollection.Exists"); + scope.Start(); + try + { + var response = _fleetUpdateStrategyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateStrategyName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} + /// + /// + /// Operation Id + /// FleetUpdateStrategies_Get + /// + /// + /// + /// The name of the UpdateStrategy resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string updateStrategyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(updateStrategyName, nameof(updateStrategyName)); + + using var scope = _fleetUpdateStrategyClientDiagnostics.CreateScope("FleetUpdateStrategyCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _fleetUpdateStrategyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateStrategyName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FleetUpdateStrategyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} + /// + /// + /// Operation Id + /// FleetUpdateStrategies_Get + /// + /// + /// + /// The name of the UpdateStrategy resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string updateStrategyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(updateStrategyName, nameof(updateStrategyName)); + + using var scope = _fleetUpdateStrategyClientDiagnostics.CreateScope("FleetUpdateStrategyCollection.GetIfExists"); + scope.Start(); + try + { + var response = _fleetUpdateStrategyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateStrategyName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FleetUpdateStrategyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetUpdateStrategyData.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetUpdateStrategyData.cs new file mode 100644 index 0000000000000..0721c01eb525c --- /dev/null +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetUpdateStrategyData.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure; +using Azure.Core; +using Azure.ResourceManager.ContainerServiceFleet.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + /// + /// A class representing the FleetUpdateStrategy data model. + /// Defines a multi-stage process to perform update operations across members of a Fleet. + /// + public partial class FleetUpdateStrategyData : ResourceData + { + /// Initializes a new instance of FleetUpdateStrategyData. + public FleetUpdateStrategyData() + { + } + + /// Initializes a new instance of FleetUpdateStrategyData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// 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. + /// The provisioning state of the UpdateStrategy resource. + /// Defines the update sequence of the clusters. + internal FleetUpdateStrategyData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ETag? eTag, FleetUpdateStrategyProvisioningState? provisioningState, ContainerServiceFleetUpdateRunStrategy strategy) : base(id, name, resourceType, systemData) + { + ETag = eTag; + ProvisioningState = provisioningState; + Strategy = strategy; + } + + /// 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. + public ETag? ETag { get; } + /// The provisioning state of the UpdateStrategy resource. + public FleetUpdateStrategyProvisioningState? ProvisioningState { get; } + /// Defines the update sequence of the clusters. + internal ContainerServiceFleetUpdateRunStrategy Strategy { get; set; } + /// The list of stages that compose this update run. Min size: 1. + public IList StrategyStages + { + get => Strategy is null ? default : Strategy.Stages; + set => Strategy = new ContainerServiceFleetUpdateRunStrategy(value); + } + } +} diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetUpdateStrategyResource.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetUpdateStrategyResource.cs new file mode 100644 index 0000000000000..5b1e83cad2050 --- /dev/null +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetUpdateStrategyResource.cs @@ -0,0 +1,303 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + /// + /// A Class representing a FleetUpdateStrategy along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetFleetUpdateStrategyResource method. + /// Otherwise you can get one from its parent resource using the GetFleetUpdateStrategy method. + /// + public partial class FleetUpdateStrategyResource : ArmResource + { + /// Generate the resource identifier of a instance. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string updateStrategyName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _fleetUpdateStrategyClientDiagnostics; + private readonly FleetUpdateStrategiesRestOperations _fleetUpdateStrategyRestClient; + private readonly FleetUpdateStrategyData _data; + + /// Initializes a new instance of the class for mocking. + protected FleetUpdateStrategyResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal FleetUpdateStrategyResource(ArmClient client, FleetUpdateStrategyData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal FleetUpdateStrategyResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _fleetUpdateStrategyClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerServiceFleet", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string fleetUpdateStrategyApiVersion); + _fleetUpdateStrategyRestClient = new FleetUpdateStrategiesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fleetUpdateStrategyApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.ContainerService/fleets/updateStrategies"; + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual FleetUpdateStrategyData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a FleetUpdateStrategy + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} + /// + /// + /// Operation Id + /// FleetUpdateStrategies_Get + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _fleetUpdateStrategyClientDiagnostics.CreateScope("FleetUpdateStrategyResource.Get"); + scope.Start(); + try + { + var response = await _fleetUpdateStrategyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetUpdateStrategyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a FleetUpdateStrategy + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} + /// + /// + /// Operation Id + /// FleetUpdateStrategies_Get + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _fleetUpdateStrategyClientDiagnostics.CreateScope("FleetUpdateStrategyResource.Get"); + scope.Start(); + try + { + var response = _fleetUpdateStrategyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetUpdateStrategyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a FleetUpdateStrategy + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} + /// + /// + /// Operation Id + /// FleetUpdateStrategies_Delete + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, string ifMatch = null, CancellationToken cancellationToken = default) + { + using var scope = _fleetUpdateStrategyClientDiagnostics.CreateScope("FleetUpdateStrategyResource.Delete"); + scope.Start(); + try + { + var response = await _fleetUpdateStrategyRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceFleetArmOperation(_fleetUpdateStrategyClientDiagnostics, Pipeline, _fleetUpdateStrategyRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation, apiVersionOverrideValue: "2016-03-30"); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a FleetUpdateStrategy + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} + /// + /// + /// Operation Id + /// FleetUpdateStrategies_Delete + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, string ifMatch = null, CancellationToken cancellationToken = default) + { + using var scope = _fleetUpdateStrategyClientDiagnostics.CreateScope("FleetUpdateStrategyResource.Delete"); + scope.Start(); + try + { + var response = _fleetUpdateStrategyRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch, cancellationToken); + var operation = new ContainerServiceFleetArmOperation(_fleetUpdateStrategyClientDiagnostics, Pipeline, _fleetUpdateStrategyRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation, apiVersionOverrideValue: "2016-03-30"); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a FleetUpdateStrategy + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} + /// + /// + /// Operation Id + /// FleetUpdateStrategies_CreateOrUpdate + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, FleetUpdateStrategyData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetUpdateStrategyClientDiagnostics.CreateScope("FleetUpdateStrategyResource.Update"); + scope.Start(); + try + { + var response = await _fleetUpdateStrategyRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceFleetArmOperation(new FleetUpdateStrategyOperationSource(Client), _fleetUpdateStrategyClientDiagnostics, Pipeline, _fleetUpdateStrategyRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation, apiVersionOverrideValue: "2016-03-30"); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a FleetUpdateStrategy + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} + /// + /// + /// Operation Id + /// FleetUpdateStrategies_CreateOrUpdate + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, FleetUpdateStrategyData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetUpdateStrategyClientDiagnostics.CreateScope("FleetUpdateStrategyResource.Update"); + scope.Start(); + try + { + var response = _fleetUpdateStrategyRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch, cancellationToken); + var operation = new ContainerServiceFleetArmOperation(new FleetUpdateStrategyOperationSource(Client), _fleetUpdateStrategyClientDiagnostics, Pipeline, _fleetUpdateStrategyRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation, apiVersionOverrideValue: "2016-03-30"); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/LongRunningOperation/FleetUpdateStrategyOperationSource.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/LongRunningOperation/FleetUpdateStrategyOperationSource.cs new file mode 100644 index 0000000000000..de6e9999890b4 --- /dev/null +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/LongRunningOperation/FleetUpdateStrategyOperationSource.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + internal class FleetUpdateStrategyOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal FleetUpdateStrategyOperationSource(ArmClient client) + { + _client = client; + } + + FleetUpdateStrategyResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = FleetUpdateStrategyData.DeserializeFleetUpdateStrategyData(document.RootElement); + return new FleetUpdateStrategyResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = FleetUpdateStrategyData.DeserializeFleetUpdateStrategyData(document.RootElement); + return new FleetUpdateStrategyResource(_client, data); + } + } +} diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ContainerServiceFleetAgentProfile.Serialization.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ContainerServiceFleetAgentProfile.Serialization.cs index be37ac11227de..0bdb1e22c12ba 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ContainerServiceFleetAgentProfile.Serialization.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ContainerServiceFleetAgentProfile.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.ContainerServiceFleet.Models { - internal partial class ContainerServiceFleetAgentProfile : IUtf8JsonSerializable + public partial class ContainerServiceFleetAgentProfile : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { @@ -20,6 +20,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("subnetId"u8); writer.WriteStringValue(SubnetId); } + if (Optional.IsDefined(VmSize)) + { + writer.WritePropertyName("vmSize"u8); + writer.WriteStringValue(VmSize); + } writer.WriteEndObject(); } @@ -30,6 +35,7 @@ internal static ContainerServiceFleetAgentProfile DeserializeContainerServiceFle return null; } Optional subnetId = default; + Optional vmSize = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("subnetId"u8)) @@ -41,8 +47,13 @@ internal static ContainerServiceFleetAgentProfile DeserializeContainerServiceFle subnetId = new ResourceIdentifier(property.Value.GetString()); continue; } + if (property.NameEquals("vmSize"u8)) + { + vmSize = property.Value.GetString(); + continue; + } } - return new ContainerServiceFleetAgentProfile(subnetId.Value); + return new ContainerServiceFleetAgentProfile(subnetId.Value, vmSize.Value); } } } diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ContainerServiceFleetAgentProfile.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ContainerServiceFleetAgentProfile.cs index fd6b988cacb61..888526a0711c4 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ContainerServiceFleetAgentProfile.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ContainerServiceFleetAgentProfile.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.ContainerServiceFleet.Models { /// Agent profile for the Fleet hub. - internal partial class ContainerServiceFleetAgentProfile + public partial class ContainerServiceFleetAgentProfile { /// Initializes a new instance of ContainerServiceFleetAgentProfile. public ContainerServiceFleetAgentProfile() @@ -19,12 +19,16 @@ public ContainerServiceFleetAgentProfile() /// Initializes a new instance of ContainerServiceFleetAgentProfile. /// The ID of the subnet which the Fleet hub node will join on startup. If this is not specified, a vnet and subnet will be generated and used. - internal ContainerServiceFleetAgentProfile(ResourceIdentifier subnetId) + /// The virtual machine size of the Fleet hub. + internal ContainerServiceFleetAgentProfile(ResourceIdentifier subnetId, string vmSize) { SubnetId = subnetId; + VmSize = vmSize; } /// The ID of the subnet which the Fleet hub node will join on startup. If this is not specified, a vnet and subnet will be generated and used. public ResourceIdentifier SubnetId { get; set; } + /// The virtual machine size of the Fleet hub. + public string VmSize { get; set; } } } diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ContainerServiceFleetUpdateGroup.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ContainerServiceFleetUpdateGroup.cs index d34ad791886d4..3a243d7d66f0b 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ContainerServiceFleetUpdateGroup.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ContainerServiceFleetUpdateGroup.cs @@ -15,9 +15,8 @@ public partial class ContainerServiceFleetUpdateGroup { /// Initializes a new instance of ContainerServiceFleetUpdateGroup. /// - /// The name of the Fleet member group to update. - /// It should match the name of an existing FleetMember group. - /// A group can only appear once across all UpdateStages in the UpdateRun. + /// Name of the group. + /// It must match a group name of an existing fleet member. /// /// is null. public ContainerServiceFleetUpdateGroup(string name) @@ -28,9 +27,8 @@ public ContainerServiceFleetUpdateGroup(string name) } /// - /// The name of the Fleet member group to update. - /// It should match the name of an existing FleetMember group. - /// A group can only appear once across all UpdateStages in the UpdateRun. + /// Name of the group. + /// It must match a group name of an existing fleet member. /// public string Name { get; set; } } diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ContainerServiceFleetUpdateRunData.Serialization.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ContainerServiceFleetUpdateRunData.Serialization.cs index 0b4100e147908..7fec16c474544 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ContainerServiceFleetUpdateRunData.Serialization.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ContainerServiceFleetUpdateRunData.Serialization.cs @@ -20,6 +20,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStartObject(); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); + if (Optional.IsDefined(UpdateStrategyId)) + { + writer.WritePropertyName("updateStrategyId"u8); + writer.WriteStringValue(UpdateStrategyId); + } if (Optional.IsDefined(Strategy)) { writer.WritePropertyName("strategy"u8); @@ -46,6 +51,7 @@ internal static ContainerServiceFleetUpdateRunData DeserializeContainerServiceFl ResourceType type = default; Optional systemData = default; Optional provisioningState = default; + Optional updateStrategyId = default; Optional strategy = default; Optional managedClusterUpdate = default; Optional status = default; @@ -102,6 +108,15 @@ internal static ContainerServiceFleetUpdateRunData DeserializeContainerServiceFl provisioningState = new ContainerServiceFleetUpdateRunProvisioningState(property0.Value.GetString()); continue; } + if (property0.NameEquals("updateStrategyId"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + updateStrategyId = new ResourceIdentifier(property0.Value.GetString()); + continue; + } if (property0.NameEquals("strategy"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -133,7 +148,7 @@ internal static ContainerServiceFleetUpdateRunData DeserializeContainerServiceFl continue; } } - return new ContainerServiceFleetUpdateRunData(id, name, type, systemData.Value, Optional.ToNullable(eTag), Optional.ToNullable(provisioningState), strategy.Value, managedClusterUpdate.Value, status.Value); + return new ContainerServiceFleetUpdateRunData(id, name, type, systemData.Value, Optional.ToNullable(eTag), Optional.ToNullable(provisioningState), updateStrategyId.Value, strategy.Value, managedClusterUpdate.Value, status.Value); } } } diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ContainerServiceFleetUpdateRunStrategy.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ContainerServiceFleetUpdateRunStrategy.cs index 1a9c600ec3826..26551f004b2d8 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ContainerServiceFleetUpdateRunStrategy.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ContainerServiceFleetUpdateRunStrategy.cs @@ -12,11 +12,19 @@ namespace Azure.ResourceManager.ContainerServiceFleet.Models { - /// The UpdateRunStrategy configures the sequence of Stages and Groups in which the clusters will be updated. + /// + /// Defines the update sequence of the clusters via stages and groups. + /// + /// Stages within a run are executed sequentially one after another. + /// Groups within a stage are executed in parallel. + /// Member clusters within a group are updated sequentially one after another. + /// + /// A valid strategy contains no duplicate groups within or across stages. + /// internal partial class ContainerServiceFleetUpdateRunStrategy { /// Initializes a new instance of ContainerServiceFleetUpdateRunStrategy. - /// The list of stages that compose this update run. + /// The list of stages that compose this update run. Min size: 1. /// is null. public ContainerServiceFleetUpdateRunStrategy(IEnumerable stages) { @@ -26,13 +34,13 @@ public ContainerServiceFleetUpdateRunStrategy(IEnumerable Initializes a new instance of ContainerServiceFleetUpdateRunStrategy. - /// The list of stages that compose this update run. + /// The list of stages that compose this update run. Min size: 1. internal ContainerServiceFleetUpdateRunStrategy(IList stages) { Stages = stages; } - /// The list of stages that compose this update run. + /// The list of stages that compose this update run. Min size: 1. public IList Stages { get; } } } diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ContainerServiceFleetUpdateStage.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ContainerServiceFleetUpdateStage.cs index 12cbc250cc887..1e730f855753b 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ContainerServiceFleetUpdateStage.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ContainerServiceFleetUpdateStage.cs @@ -11,13 +11,7 @@ namespace Azure.ResourceManager.ContainerServiceFleet.Models { - /// - /// Contains the groups to be updated by an UpdateRun. - /// Update order: - /// - Sequential between stages: Stages run sequentially. The previous stage must complete before the next one starts. - /// - Parallel within a stage: Groups within a stage run in parallel. - /// - Sequential within a group: Clusters within a group are updated sequentially. - /// + /// 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. public partial class ContainerServiceFleetUpdateStage { /// Initializes a new instance of ContainerServiceFleetUpdateStage. @@ -33,10 +27,7 @@ public ContainerServiceFleetUpdateStage(string name) /// Initializes a new instance of ContainerServiceFleetUpdateStage. /// The name of the stage. Must be unique within the UpdateRun. - /// - /// A list of group names that compose the stage. - /// The groups will be updated in parallel. Each group name can only appear once in the UpdateRun. - /// + /// Defines the groups to be executed in parallel in this stage. Duplicate groups are not allowed. Min size: 1. /// The time in seconds to wait at the end of this stage before starting the next one. Defaults to 0 seconds if unspecified. internal ContainerServiceFleetUpdateStage(string name, IList groups, int? afterStageWaitInSeconds) { @@ -47,10 +38,7 @@ internal ContainerServiceFleetUpdateStage(string name, IList The name of the stage. Must be unique within the UpdateRun. public string Name { get; set; } - /// - /// A list of group names that compose the stage. - /// The groups will be updated in parallel. Each group name can only appear once in the UpdateRun. - /// + /// Defines the groups to be executed in parallel in this stage. Duplicate groups are not allowed. Min size: 1. public IList Groups { get; } /// The time in seconds to wait at the end of this stage before starting the next one. Defaults to 0 seconds if unspecified. public int? AfterStageWaitInSeconds { get; set; } diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetHubProfile.Serialization.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetHubProfile.Serialization.cs index 235e369ea51c6..6cb3dd33195d2 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetHubProfile.Serialization.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetHubProfile.Serialization.cs @@ -44,6 +44,7 @@ internal static FleetHubProfile DeserializeFleetHubProfile(JsonElement element) Optional agentProfile = default; Optional fqdn = default; Optional kubernetesVersion = default; + Optional portalFqdn = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("dnsPrefix"u8)) @@ -79,8 +80,13 @@ internal static FleetHubProfile DeserializeFleetHubProfile(JsonElement element) kubernetesVersion = property.Value.GetString(); continue; } + if (property.NameEquals("portalFqdn"u8)) + { + portalFqdn = property.Value.GetString(); + continue; + } } - return new FleetHubProfile(dnsPrefix.Value, apiServerAccessProfile.Value, agentProfile.Value, fqdn.Value, kubernetesVersion.Value); + return new FleetHubProfile(dnsPrefix.Value, apiServerAccessProfile.Value, agentProfile.Value, fqdn.Value, kubernetesVersion.Value, portalFqdn.Value); } } } diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetHubProfile.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetHubProfile.cs index 6c90fe0789ce5..a8aabd44acb74 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetHubProfile.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetHubProfile.cs @@ -5,8 +5,6 @@ #nullable disable -using Azure.Core; - namespace Azure.ResourceManager.ContainerServiceFleet.Models { /// The FleetHubProfile configures the fleet hub. @@ -23,13 +21,15 @@ public FleetHubProfile() /// The agent profile for the Fleet hub. /// The FQDN of the Fleet hub. /// The Kubernetes version of the Fleet hub. - internal FleetHubProfile(string dnsPrefix, ContainerServiceFleetAPIServerAccessProfile apiServerAccessProfile, ContainerServiceFleetAgentProfile agentProfile, string fqdn, string kubernetesVersion) + /// The Azure Portal FQDN of the Fleet hub. + internal FleetHubProfile(string dnsPrefix, ContainerServiceFleetAPIServerAccessProfile apiServerAccessProfile, ContainerServiceFleetAgentProfile agentProfile, string fqdn, string kubernetesVersion, string portalFqdn) { DnsPrefix = dnsPrefix; ApiServerAccessProfile = apiServerAccessProfile; AgentProfile = agentProfile; Fqdn = fqdn; KubernetesVersion = kubernetesVersion; + PortalFqdn = portalFqdn; } /// DNS prefix used to create the FQDN for the Fleet hub. @@ -37,22 +37,12 @@ internal FleetHubProfile(string dnsPrefix, ContainerServiceFleetAPIServerAccessP /// The access profile for the Fleet hub API server. public ContainerServiceFleetAPIServerAccessProfile ApiServerAccessProfile { get; set; } /// The agent profile for the Fleet hub. - internal ContainerServiceFleetAgentProfile AgentProfile { get; set; } - /// The ID of the subnet which the Fleet hub node will join on startup. If this is not specified, a vnet and subnet will be generated and used. - public ResourceIdentifier AgentSubnetId - { - get => AgentProfile is null ? default : AgentProfile.SubnetId; - set - { - if (AgentProfile is null) - AgentProfile = new ContainerServiceFleetAgentProfile(); - AgentProfile.SubnetId = value; - } - } - + public ContainerServiceFleetAgentProfile AgentProfile { get; set; } /// The FQDN of the Fleet hub. public string Fqdn { get; } /// The Kubernetes version of the Fleet hub. public string KubernetesVersion { get; } + /// The Azure Portal FQDN of the Fleet hub. + public string PortalFqdn { get; } } } diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetUpdateStrategyData.Serialization.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetUpdateStrategyData.Serialization.cs new file mode 100644 index 0000000000000..f623861dd319d --- /dev/null +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetUpdateStrategyData.Serialization.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure; +using Azure.Core; +using Azure.ResourceManager.ContainerServiceFleet.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + public partial class FleetUpdateStrategyData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(Strategy)) + { + writer.WritePropertyName("strategy"u8); + writer.WriteObjectValue(Strategy); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static FleetUpdateStrategyData DeserializeFleetUpdateStrategyData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional eTag = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + Optional provisioningState = default; + Optional strategy = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("eTag"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + eTag = new ETag(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new FleetUpdateStrategyProvisioningState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("strategy"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + strategy = ContainerServiceFleetUpdateRunStrategy.DeserializeContainerServiceFleetUpdateRunStrategy(property0.Value); + continue; + } + } + continue; + } + } + return new FleetUpdateStrategyData(id, name, type, systemData.Value, Optional.ToNullable(eTag), Optional.ToNullable(provisioningState), strategy.Value); + } + } +} diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetUpdateStrategyListResult.Serialization.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetUpdateStrategyListResult.Serialization.cs new file mode 100644 index 0000000000000..e2d44322e5cef --- /dev/null +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetUpdateStrategyListResult.Serialization.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.ContainerServiceFleet; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + internal partial class FleetUpdateStrategyListResult + { + internal static FleetUpdateStrategyListResult DeserializeFleetUpdateStrategyListResult(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FleetUpdateStrategyData.DeserializeFleetUpdateStrategyData(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + } + return new FleetUpdateStrategyListResult(value, nextLink.Value); + } + } +} diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetUpdateStrategyListResult.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetUpdateStrategyListResult.cs new file mode 100644 index 0000000000000..ec28b7a2848d4 --- /dev/null +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetUpdateStrategyListResult.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; +using Azure.ResourceManager.ContainerServiceFleet; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// The response of a FleetUpdateStrategy list operation. + internal partial class FleetUpdateStrategyListResult + { + /// Initializes a new instance of FleetUpdateStrategyListResult. + /// The FleetUpdateStrategy items on this page. + /// is null. + internal FleetUpdateStrategyListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of FleetUpdateStrategyListResult. + /// The FleetUpdateStrategy items on this page. + /// The link to the next page of items. + internal FleetUpdateStrategyListResult(IReadOnlyList value, Uri nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// The FleetUpdateStrategy items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetUpdateStrategyProvisioningState.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetUpdateStrategyProvisioningState.cs new file mode 100644 index 0000000000000..560f7b40e7044 --- /dev/null +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetUpdateStrategyProvisioningState.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// The provisioning state of the UpdateStrategy resource. + public readonly partial struct FleetUpdateStrategyProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public FleetUpdateStrategyProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + + /// Resource has been created. + public static FleetUpdateStrategyProvisioningState Succeeded { get; } = new FleetUpdateStrategyProvisioningState(SucceededValue); + /// Resource creation failed. + public static FleetUpdateStrategyProvisioningState Failed { get; } = new FleetUpdateStrategyProvisioningState(FailedValue); + /// Resource creation was canceled. + public static FleetUpdateStrategyProvisioningState Canceled { get; } = new FleetUpdateStrategyProvisioningState(CanceledValue); + /// Determines if two values are the same. + public static bool operator ==(FleetUpdateStrategyProvisioningState left, FleetUpdateStrategyProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(FleetUpdateStrategyProvisioningState left, FleetUpdateStrategyProvisioningState right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator FleetUpdateStrategyProvisioningState(string value) => new FleetUpdateStrategyProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is FleetUpdateStrategyProvisioningState other && Equals(other); + /// + public bool Equals(FleetUpdateStrategyProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/FleetMembersRestOperations.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/FleetMembersRestOperations.cs index 8f0f433dd6ded..5a3d06f2c8b61 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/FleetMembersRestOperations.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/FleetMembersRestOperations.cs @@ -33,7 +33,7 @@ public FleetMembersRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-15-preview"; + _apiVersion = apiVersion ?? "2023-08-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/FleetUpdateStrategiesRestOperations.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/FleetUpdateStrategiesRestOperations.cs new file mode 100644 index 0000000000000..0aa5af2d5fd9d --- /dev/null +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/FleetUpdateStrategiesRestOperations.cs @@ -0,0 +1,463 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ContainerServiceFleet.Models; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + internal partial class FleetUpdateStrategiesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of FleetUpdateStrategiesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public FleetUpdateStrategiesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-08-15-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateListByFleetRequest(string subscriptionId, string resourceGroupName, string fleetName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateStrategies", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List FleetUpdateStrategy resources by Fleet. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByFleetAsync(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetRequest(subscriptionId, resourceGroupName, fleetName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetUpdateStrategyListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FleetUpdateStrategyListResult.DeserializeFleetUpdateStrategyListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List FleetUpdateStrategy resources by Fleet. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByFleet(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetRequest(subscriptionId, resourceGroupName, fleetName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetUpdateStrategyListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FleetUpdateStrategyListResult.DeserializeFleetUpdateStrategyListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string fleetName, string updateStrategyName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateStrategies/", false); + uri.AppendPath(updateStrategyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a FleetUpdateStrategy. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the UpdateStrategy resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string fleetName, string updateStrategyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateStrategyName, nameof(updateStrategyName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, updateStrategyName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetUpdateStrategyData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FleetUpdateStrategyData.DeserializeFleetUpdateStrategyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FleetUpdateStrategyData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a FleetUpdateStrategy. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the UpdateStrategy resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string fleetName, string updateStrategyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateStrategyName, nameof(updateStrategyName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, updateStrategyName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetUpdateStrategyData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FleetUpdateStrategyData.DeserializeFleetUpdateStrategyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FleetUpdateStrategyData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string fleetName, string updateStrategyName, FleetUpdateStrategyData data, string ifMatch, string ifNoneMatch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateStrategies/", false); + uri.AppendPath(updateStrategyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } + if (ifNoneMatch != null) + { + request.Headers.Add("If-None-Match", ifNoneMatch); + } + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a FleetUpdateStrategy. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the UpdateStrategy resource. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string fleetName, string updateStrategyName, FleetUpdateStrategyData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateStrategyName, nameof(updateStrategyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, updateStrategyName, data, ifMatch, ifNoneMatch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a FleetUpdateStrategy. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the UpdateStrategy resource. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string fleetName, string updateStrategyName, FleetUpdateStrategyData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateStrategyName, nameof(updateStrategyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, updateStrategyName, data, ifMatch, ifNoneMatch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string fleetName, string updateStrategyName, string ifMatch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateStrategies/", false); + uri.AppendPath(updateStrategyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a FleetUpdateStrategy. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the UpdateStrategy resource. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string fleetName, string updateStrategyName, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateStrategyName, nameof(updateStrategyName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, updateStrategyName, ifMatch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a FleetUpdateStrategy. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the UpdateStrategy resource. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string fleetName, string updateStrategyName, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateStrategyName, nameof(updateStrategyName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, updateStrategyName, ifMatch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListByFleetNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string fleetName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List FleetUpdateStrategy resources by Fleet. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByFleetNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetUpdateStrategyListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FleetUpdateStrategyListResult.DeserializeFleetUpdateStrategyListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List FleetUpdateStrategy resources by Fleet. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByFleetNextPage(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetUpdateStrategyListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FleetUpdateStrategyListResult.DeserializeFleetUpdateStrategyListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/FleetsRestOperations.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/FleetsRestOperations.cs index 5aeef400c8457..5b7f51d089d5e 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/FleetsRestOperations.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/FleetsRestOperations.cs @@ -33,7 +33,7 @@ public FleetsRestOperations(HttpPipeline pipeline, string applicationId, Uri end { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-15-preview"; + _apiVersion = apiVersion ?? "2023-08-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/UpdateRunsRestOperations.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/UpdateRunsRestOperations.cs index f29c755513a53..a37f9eddefc20 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/UpdateRunsRestOperations.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/UpdateRunsRestOperations.cs @@ -33,7 +33,7 @@ public UpdateRunsRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-15-preview"; + _apiVersion = apiVersion ?? "2023-08-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/autorest.md b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/autorest.md index f6c4f055524d4..70a80552e0c8b 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/autorest.md +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/autorest.md @@ -7,8 +7,8 @@ azure-arm: true csharp: true library-name: ContainerServiceFleet namespace: Azure.ResourceManager.ContainerServiceFleet -require: https://github.com/Azure/azure-rest-api-specs/blob/de06c42bd985fb66b6a49c907aaf5baee693bc7b/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/readme.md -#tag: package-2023-06-preview +require: https://github.com/Azure/azure-rest-api-specs/blob/e1017d9ab49f41296177b4f4c9ac741fb7de044d/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/readme.md +#tag: package-2023-08-preview output-folder: $(this-folder)/Generated clear-output-folder: true sample-gen: @@ -77,4 +77,18 @@ acronym-mapping: URI: Uri Etag: ETag|etag +operations-to-lro-api-version-override: + Fleets_CreateOrUpdate: "2016-03-30" + Fleets_Update: "2016-03-30" + Fleets_Delete: "2016-03-30" + FleetMembers_Create: "2016-03-30" + FleetMembers_Update: "2016-03-30" + FleetMembers_Delete: "2016-03-30" + UpdateRuns_CreateOrUpdate: "2016-03-30" + UpdateRuns_Delete: "2016-03-30" + FleetUpdateStrategies_CreateOrUpdate: "2016-03-30" + FleetUpdateStrategies_Delete: "2016-03-30" + +models-to-treat-empty-string-as-null: +- SubnetResourceId ``` \ No newline at end of file