diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_AutoUpgradeProfileCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_AutoUpgradeProfileCollection.cs
new file mode 100644
index 000000000000..39e7ebacea78
--- /dev/null
+++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_AutoUpgradeProfileCollection.cs
@@ -0,0 +1,200 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Threading.Tasks;
+using Azure.Core;
+using Azure.Identity;
+using Azure.ResourceManager.ContainerService.Models;
+using NUnit.Framework;
+
+namespace Azure.ResourceManager.ContainerService.Samples
+{
+ public partial class Sample_AutoUpgradeProfileCollection
+ {
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task CreateOrUpdate_CreateAnAutoUpgradeProfile()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2025-03-01/examples/AutoUpgradeProfiles_CreateOrUpdate.json
+ // this example is just showing the usage of "AutoUpgradeProfiles_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 FleetResource created on azure
+ // for more information of creating FleetResource, please refer to the document of FleetResource
+ string subscriptionId = "00000000-0000-0000-0000-000000000000";
+ string resourceGroupName = "rg1";
+ string fleetName = "fleet1";
+ ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName);
+ FleetResource fleet = client.GetFleetResource(fleetResourceId);
+
+ // get the collection of this AutoUpgradeProfileResource
+ AutoUpgradeProfileCollection collection = fleet.GetAutoUpgradeProfiles();
+
+ // invoke the operation
+ string autoUpgradeProfileName = "autoupgradeprofile1";
+ AutoUpgradeProfileData data = new AutoUpgradeProfileData
+ {
+ Channel = UpgradeChannel.Stable,
+ };
+ ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, autoUpgradeProfileName, data);
+ AutoUpgradeProfileResource 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
+ AutoUpgradeProfileData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Get_GetsAnAutoUpgradeProfileResource()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2025-03-01/examples/AutoUpgradeProfiles_Get.json
+ // this example is just showing the usage of "AutoUpgradeProfiles_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 FleetResource created on azure
+ // for more information of creating FleetResource, please refer to the document of FleetResource
+ string subscriptionId = "00000000-0000-0000-0000-000000000000";
+ string resourceGroupName = "rg1";
+ string fleetName = "fleet1";
+ ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName);
+ FleetResource fleet = client.GetFleetResource(fleetResourceId);
+
+ // get the collection of this AutoUpgradeProfileResource
+ AutoUpgradeProfileCollection collection = fleet.GetAutoUpgradeProfiles();
+
+ // invoke the operation
+ string autoUpgradeProfileName = "autoupgradeprofile1";
+ AutoUpgradeProfileResource result = await collection.GetAsync(autoUpgradeProfileName);
+
+ // 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
+ AutoUpgradeProfileData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task GetAll_ListsTheAutoUpgradeProfileResourcesByFleet()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2025-03-01/examples/AutoUpgradeProfiles_ListByFleet.json
+ // this example is just showing the usage of "AutoUpgradeProfiles_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 FleetResource created on azure
+ // for more information of creating FleetResource, please refer to the document of FleetResource
+ string subscriptionId = "00000000-0000-0000-0000-000000000000";
+ string resourceGroupName = "rg1";
+ string fleetName = "fleet1";
+ ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName);
+ FleetResource fleet = client.GetFleetResource(fleetResourceId);
+
+ // get the collection of this AutoUpgradeProfileResource
+ AutoUpgradeProfileCollection collection = fleet.GetAutoUpgradeProfiles();
+
+ // invoke the operation and iterate over the result
+ await foreach (AutoUpgradeProfileResource 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
+ AutoUpgradeProfileData resourceData = item.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+
+ Console.WriteLine("Succeeded");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Exists_GetsAnAutoUpgradeProfileResource()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2025-03-01/examples/AutoUpgradeProfiles_Get.json
+ // this example is just showing the usage of "AutoUpgradeProfiles_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 FleetResource created on azure
+ // for more information of creating FleetResource, please refer to the document of FleetResource
+ string subscriptionId = "00000000-0000-0000-0000-000000000000";
+ string resourceGroupName = "rg1";
+ string fleetName = "fleet1";
+ ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName);
+ FleetResource fleet = client.GetFleetResource(fleetResourceId);
+
+ // get the collection of this AutoUpgradeProfileResource
+ AutoUpgradeProfileCollection collection = fleet.GetAutoUpgradeProfiles();
+
+ // invoke the operation
+ string autoUpgradeProfileName = "autoupgradeprofile1";
+ bool result = await collection.ExistsAsync(autoUpgradeProfileName);
+
+ Console.WriteLine($"Succeeded: {result}");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task GetIfExists_GetsAnAutoUpgradeProfileResource()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2025-03-01/examples/AutoUpgradeProfiles_Get.json
+ // this example is just showing the usage of "AutoUpgradeProfiles_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 FleetResource created on azure
+ // for more information of creating FleetResource, please refer to the document of FleetResource
+ string subscriptionId = "00000000-0000-0000-0000-000000000000";
+ string resourceGroupName = "rg1";
+ string fleetName = "fleet1";
+ ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName);
+ FleetResource fleet = client.GetFleetResource(fleetResourceId);
+
+ // get the collection of this AutoUpgradeProfileResource
+ AutoUpgradeProfileCollection collection = fleet.GetAutoUpgradeProfiles();
+
+ // invoke the operation
+ string autoUpgradeProfileName = "autoupgradeprofile1";
+ NullableResponse response = await collection.GetIfExistsAsync(autoUpgradeProfileName);
+ AutoUpgradeProfileResource 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
+ AutoUpgradeProfileData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+ }
+ }
+}
diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_AutoUpgradeProfileResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_AutoUpgradeProfileResource.cs
new file mode 100644
index 000000000000..1473fa70e316
--- /dev/null
+++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_AutoUpgradeProfileResource.cs
@@ -0,0 +1,113 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Threading.Tasks;
+using Azure.Core;
+using Azure.Identity;
+using Azure.ResourceManager.ContainerService.Models;
+using NUnit.Framework;
+
+namespace Azure.ResourceManager.ContainerService.Samples
+{
+ public partial class Sample_AutoUpgradeProfileResource
+ {
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Get_GetsAnAutoUpgradeProfileResource()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2025-03-01/examples/AutoUpgradeProfiles_Get.json
+ // this example is just showing the usage of "AutoUpgradeProfiles_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 AutoUpgradeProfileResource created on azure
+ // for more information of creating AutoUpgradeProfileResource, please refer to the document of AutoUpgradeProfileResource
+ string subscriptionId = "00000000-0000-0000-0000-000000000000";
+ string resourceGroupName = "rg1";
+ string fleetName = "fleet1";
+ string autoUpgradeProfileName = "autoupgradeprofile1";
+ ResourceIdentifier autoUpgradeProfileResourceId = AutoUpgradeProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, autoUpgradeProfileName);
+ AutoUpgradeProfileResource autoUpgradeProfile = client.GetAutoUpgradeProfileResource(autoUpgradeProfileResourceId);
+
+ // invoke the operation
+ AutoUpgradeProfileResource result = await autoUpgradeProfile.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
+ AutoUpgradeProfileData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Delete_DeleteAnAutoUpgradeProfileResource()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2025-03-01/examples/AutoUpgradeProfiles_Delete.json
+ // this example is just showing the usage of "AutoUpgradeProfiles_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 AutoUpgradeProfileResource created on azure
+ // for more information of creating AutoUpgradeProfileResource, please refer to the document of AutoUpgradeProfileResource
+ string subscriptionId = "subid1";
+ string resourceGroupName = "rg1";
+ string fleetName = "fleet1";
+ string autoUpgradeProfileName = "autoupgradeprofile1";
+ ResourceIdentifier autoUpgradeProfileResourceId = AutoUpgradeProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, autoUpgradeProfileName);
+ AutoUpgradeProfileResource autoUpgradeProfile = client.GetAutoUpgradeProfileResource(autoUpgradeProfileResourceId);
+
+ // invoke the operation
+ await autoUpgradeProfile.DeleteAsync(WaitUntil.Completed);
+
+ Console.WriteLine("Succeeded");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Update_CreateAnAutoUpgradeProfile()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2025-03-01/examples/AutoUpgradeProfiles_CreateOrUpdate.json
+ // this example is just showing the usage of "AutoUpgradeProfiles_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 AutoUpgradeProfileResource created on azure
+ // for more information of creating AutoUpgradeProfileResource, please refer to the document of AutoUpgradeProfileResource
+ string subscriptionId = "00000000-0000-0000-0000-000000000000";
+ string resourceGroupName = "rg1";
+ string fleetName = "fleet1";
+ string autoUpgradeProfileName = "autoupgradeprofile1";
+ ResourceIdentifier autoUpgradeProfileResourceId = AutoUpgradeProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, autoUpgradeProfileName);
+ AutoUpgradeProfileResource autoUpgradeProfile = client.GetAutoUpgradeProfileResource(autoUpgradeProfileResourceId);
+
+ // invoke the operation
+ AutoUpgradeProfileData data = new AutoUpgradeProfileData
+ {
+ Channel = UpgradeChannel.Stable,
+ };
+ ArmOperation lro = await autoUpgradeProfile.UpdateAsync(WaitUntil.Completed, data);
+ AutoUpgradeProfileResource 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
+ AutoUpgradeProfileData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+ }
+}
diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_FleetCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_FleetCollection.cs
new file mode 100644
index 000000000000..20fbe32390c9
--- /dev/null
+++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_FleetCollection.cs
@@ -0,0 +1,208 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Threading.Tasks;
+using Azure.Core;
+using Azure.Identity;
+using Azure.ResourceManager.ContainerService.Models;
+using Azure.ResourceManager.Resources;
+using NUnit.Framework;
+
+namespace Azure.ResourceManager.ContainerService.Samples
+{
+ public partial class Sample_FleetCollection
+ {
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task CreateOrUpdate_CreatesAFleetResourceWithALongRunningOperation()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2025-03-01/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
+ TokenCredential cred = new DefaultAzureCredential();
+ // authenticate your client
+ ArmClient client = new ArmClient(cred);
+
+ // this example assumes you already have this ResourceGroupResource created on azure
+ // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
+ string subscriptionId = "subid1";
+ string resourceGroupName = "rg1";
+ ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
+ ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
+
+ // get the collection of this FleetResource
+ FleetCollection collection = resourceGroupResource.GetFleets();
+
+ // invoke the operation
+ string fleetName = "fleet1";
+ FleetData data = new FleetData(new AzureLocation("East US"))
+ {
+ HubProfile = new FleetHubProfile
+ {
+ DnsPrefix = "dnsprefix1",
+ AgentProfile = new AgentProfile
+ {
+ VmSize = "Standard_DS1",
+ },
+ },
+ Tags =
+{
+["archv2"] = "",
+["tier"] = "production"
+},
+ };
+ ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, fleetName, data);
+ FleetResource 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
+ FleetData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Get_GetsAFleetResource()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2025-03-01/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
+ TokenCredential cred = new DefaultAzureCredential();
+ // authenticate your client
+ ArmClient client = new ArmClient(cred);
+
+ // this example assumes you already have this ResourceGroupResource created on azure
+ // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
+ string subscriptionId = "subid1";
+ string resourceGroupName = "rg1";
+ ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
+ ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
+
+ // get the collection of this FleetResource
+ FleetCollection collection = resourceGroupResource.GetFleets();
+
+ // invoke the operation
+ string fleetName = "fleet1";
+ FleetResource result = await collection.GetAsync(fleetName);
+
+ // 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
+ FleetData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task GetAll_ListsTheFleetResourcesInAResourceGroup()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2025-03-01/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
+ TokenCredential cred = new DefaultAzureCredential();
+ // authenticate your client
+ ArmClient client = new ArmClient(cred);
+
+ // this example assumes you already have this ResourceGroupResource created on azure
+ // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
+ string subscriptionId = "subid1";
+ string resourceGroupName = "rg1";
+ ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
+ ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
+
+ // get the collection of this FleetResource
+ FleetCollection collection = resourceGroupResource.GetFleets();
+
+ // invoke the operation and iterate over the result
+ await foreach (FleetResource 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
+ FleetData resourceData = item.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+
+ Console.WriteLine("Succeeded");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Exists_GetsAFleetResource()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2025-03-01/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
+ TokenCredential cred = new DefaultAzureCredential();
+ // authenticate your client
+ ArmClient client = new ArmClient(cred);
+
+ // this example assumes you already have this ResourceGroupResource created on azure
+ // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
+ string subscriptionId = "subid1";
+ string resourceGroupName = "rg1";
+ ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
+ ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
+
+ // get the collection of this FleetResource
+ FleetCollection collection = resourceGroupResource.GetFleets();
+
+ // invoke the operation
+ string fleetName = "fleet1";
+ bool result = await collection.ExistsAsync(fleetName);
+
+ Console.WriteLine($"Succeeded: {result}");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task GetIfExists_GetsAFleetResource()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2025-03-01/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
+ TokenCredential cred = new DefaultAzureCredential();
+ // authenticate your client
+ ArmClient client = new ArmClient(cred);
+
+ // this example assumes you already have this ResourceGroupResource created on azure
+ // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
+ string subscriptionId = "subid1";
+ string resourceGroupName = "rg1";
+ ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
+ ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
+
+ // get the collection of this FleetResource
+ FleetCollection collection = resourceGroupResource.GetFleets();
+
+ // invoke the operation
+ string fleetName = "fleet1";
+ NullableResponse response = await collection.GetIfExistsAsync(fleetName);
+ FleetResource 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
+ FleetData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+ }
+ }
+}
diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_FleetMemberCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_FleetMemberCollection.cs
new file mode 100644
index 000000000000..db107707b38e
--- /dev/null
+++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_FleetMemberCollection.cs
@@ -0,0 +1,203 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Threading.Tasks;
+using Azure.Core;
+using Azure.Identity;
+using NUnit.Framework;
+
+namespace Azure.ResourceManager.ContainerService.Samples
+{
+ public partial class Sample_FleetMemberCollection
+ {
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task CreateOrUpdate_CreatesAFleetMemberResourceWithALongRunningOperation()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2025-03-01/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
+ TokenCredential cred = new DefaultAzureCredential();
+ // authenticate your client
+ ArmClient client = new ArmClient(cred);
+
+ // this example assumes you already have this FleetResource created on azure
+ // for more information of creating FleetResource, please refer to the document of FleetResource
+ string subscriptionId = "subid1";
+ string resourceGroupName = "rg1";
+ string fleetName = "fleet1";
+ ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName);
+ FleetResource fleet = client.GetFleetResource(fleetResourceId);
+
+ // get the collection of this FleetMemberResource
+ FleetMemberCollection collection = fleet.GetFleetMembers();
+
+ // invoke the operation
+ string fleetMemberName = "member-1";
+ FleetMemberData data = new FleetMemberData
+ {
+ ClusterResourceId = new ResourceIdentifier("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster-1"),
+ Labels =
+{
+["environment"] = "production"
+},
+ };
+ ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, fleetMemberName, data);
+ FleetMemberResource 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
+ FleetMemberData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Get_GetsAFleetMemberResource()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2025-03-01/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
+ TokenCredential cred = new DefaultAzureCredential();
+ // authenticate your client
+ ArmClient client = new ArmClient(cred);
+
+ // this example assumes you already have this FleetResource created on azure
+ // for more information of creating FleetResource, please refer to the document of FleetResource
+ string subscriptionId = "subid1";
+ string resourceGroupName = "rg1";
+ string fleetName = "fleet1";
+ ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName);
+ FleetResource fleet = client.GetFleetResource(fleetResourceId);
+
+ // get the collection of this FleetMemberResource
+ FleetMemberCollection collection = fleet.GetFleetMembers();
+
+ // invoke the operation
+ string fleetMemberName = "member-1";
+ FleetMemberResource result = await collection.GetAsync(fleetMemberName);
+
+ // 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
+ FleetMemberData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task GetAll_ListsTheMembersOfAFleet()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2025-03-01/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
+ TokenCredential cred = new DefaultAzureCredential();
+ // authenticate your client
+ ArmClient client = new ArmClient(cred);
+
+ // this example assumes you already have this FleetResource created on azure
+ // for more information of creating FleetResource, please refer to the document of FleetResource
+ string subscriptionId = "subid1";
+ string resourceGroupName = "rg1";
+ string fleetName = "fleet1";
+ ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName);
+ FleetResource fleet = client.GetFleetResource(fleetResourceId);
+
+ // get the collection of this FleetMemberResource
+ FleetMemberCollection collection = fleet.GetFleetMembers();
+
+ // invoke the operation and iterate over the result
+ await foreach (FleetMemberResource 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
+ FleetMemberData resourceData = item.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+
+ Console.WriteLine("Succeeded");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Exists_GetsAFleetMemberResource()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2025-03-01/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
+ TokenCredential cred = new DefaultAzureCredential();
+ // authenticate your client
+ ArmClient client = new ArmClient(cred);
+
+ // this example assumes you already have this FleetResource created on azure
+ // for more information of creating FleetResource, please refer to the document of FleetResource
+ string subscriptionId = "subid1";
+ string resourceGroupName = "rg1";
+ string fleetName = "fleet1";
+ ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName);
+ FleetResource fleet = client.GetFleetResource(fleetResourceId);
+
+ // get the collection of this FleetMemberResource
+ FleetMemberCollection collection = fleet.GetFleetMembers();
+
+ // invoke the operation
+ string fleetMemberName = "member-1";
+ bool result = await collection.ExistsAsync(fleetMemberName);
+
+ Console.WriteLine($"Succeeded: {result}");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task GetIfExists_GetsAFleetMemberResource()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2025-03-01/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
+ TokenCredential cred = new DefaultAzureCredential();
+ // authenticate your client
+ ArmClient client = new ArmClient(cred);
+
+ // this example assumes you already have this FleetResource created on azure
+ // for more information of creating FleetResource, please refer to the document of FleetResource
+ string subscriptionId = "subid1";
+ string resourceGroupName = "rg1";
+ string fleetName = "fleet1";
+ ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName);
+ FleetResource fleet = client.GetFleetResource(fleetResourceId);
+
+ // get the collection of this FleetMemberResource
+ FleetMemberCollection collection = fleet.GetFleetMembers();
+
+ // invoke the operation
+ string fleetMemberName = "member-1";
+ NullableResponse response = await collection.GetIfExistsAsync(fleetMemberName);
+ FleetMemberResource 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
+ FleetMemberData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+ }
+ }
+}
diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_FleetMemberResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_FleetMemberResource.cs
new file mode 100644
index 000000000000..af8deb380f25
--- /dev/null
+++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_FleetMemberResource.cs
@@ -0,0 +1,113 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Threading.Tasks;
+using Azure.Core;
+using Azure.Identity;
+using Azure.ResourceManager.ContainerService.Models;
+using NUnit.Framework;
+
+namespace Azure.ResourceManager.ContainerService.Samples
+{
+ public partial class Sample_FleetMemberResource
+ {
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Get_GetsAFleetMemberResource()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2025-03-01/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
+ TokenCredential cred = new DefaultAzureCredential();
+ // authenticate your client
+ ArmClient client = new ArmClient(cred);
+
+ // this example assumes you already have this FleetMemberResource created on azure
+ // for more information of creating FleetMemberResource, please refer to the document of FleetMemberResource
+ string subscriptionId = "subid1";
+ string resourceGroupName = "rg1";
+ string fleetName = "fleet1";
+ string fleetMemberName = "member-1";
+ ResourceIdentifier fleetMemberResourceId = FleetMemberResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetMemberName);
+ FleetMemberResource fleetMember = client.GetFleetMemberResource(fleetMemberResourceId);
+
+ // invoke the operation
+ FleetMemberResource result = await fleetMember.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
+ FleetMemberData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Delete_DeletesAFleetMemberResourceAsynchronouslyWithALongRunningOperation()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2025-03-01/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
+ TokenCredential cred = new DefaultAzureCredential();
+ // authenticate your client
+ ArmClient client = new ArmClient(cred);
+
+ // this example assumes you already have this FleetMemberResource created on azure
+ // for more information of creating FleetMemberResource, please refer to the document of FleetMemberResource
+ string subscriptionId = "subid1";
+ string resourceGroupName = "rg1";
+ string fleetName = "fleet1";
+ string fleetMemberName = "member-1";
+ ResourceIdentifier fleetMemberResourceId = FleetMemberResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetMemberName);
+ FleetMemberResource fleetMember = client.GetFleetMemberResource(fleetMemberResourceId);
+
+ // invoke the operation
+ await fleetMember.DeleteAsync(WaitUntil.Completed);
+
+ Console.WriteLine("Succeeded");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Update_UpdatesAFleetMemberResourceSynchronously()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2025-03-01/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
+ TokenCredential cred = new DefaultAzureCredential();
+ // authenticate your client
+ ArmClient client = new ArmClient(cred);
+
+ // this example assumes you already have this FleetMemberResource created on azure
+ // for more information of creating FleetMemberResource, please refer to the document of FleetMemberResource
+ string subscriptionId = "subid1";
+ string resourceGroupName = "rg1";
+ string fleetName = "fleet1";
+ string fleetMemberName = "member-1";
+ ResourceIdentifier fleetMemberResourceId = FleetMemberResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetMemberName);
+ FleetMemberResource fleetMember = client.GetFleetMemberResource(fleetMemberResourceId);
+
+ // invoke the operation
+ FleetMemberPatch patch = new FleetMemberPatch
+ {
+ Group = "staging",
+ };
+ ArmOperation lro = await fleetMember.UpdateAsync(WaitUntil.Completed, patch);
+ FleetMemberResource 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
+ FleetMemberData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+ }
+}
diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_FleetResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_FleetResource.cs
new file mode 100644
index 000000000000..639c540c5c17
--- /dev/null
+++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_FleetResource.cs
@@ -0,0 +1,141 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Threading.Tasks;
+using Azure.Core;
+using Azure.Identity;
+using Azure.ResourceManager.ContainerService.Models;
+using NUnit.Framework;
+
+namespace Azure.ResourceManager.ContainerService.Samples
+{
+ public partial class Sample_FleetResource
+ {
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Get_GetsAFleetResource()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2025-03-01/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
+ TokenCredential cred = new DefaultAzureCredential();
+ // authenticate your client
+ ArmClient client = new ArmClient(cred);
+
+ // this example assumes you already have this FleetResource created on azure
+ // for more information of creating FleetResource, please refer to the document of FleetResource
+ string subscriptionId = "subid1";
+ string resourceGroupName = "rg1";
+ string fleetName = "fleet1";
+ ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName);
+ FleetResource fleet = client.GetFleetResource(fleetResourceId);
+
+ // invoke the operation
+ FleetResource result = await fleet.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
+ FleetData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Delete_DeletesAFleetResourceAsynchronouslyWithALongRunningOperation()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2025-03-01/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
+ TokenCredential cred = new DefaultAzureCredential();
+ // authenticate your client
+ ArmClient client = new ArmClient(cred);
+
+ // this example assumes you already have this FleetResource created on azure
+ // for more information of creating FleetResource, please refer to the document of FleetResource
+ string subscriptionId = "subid1";
+ string resourceGroupName = "rg1";
+ string fleetName = "fleet1";
+ ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName);
+ FleetResource fleet = client.GetFleetResource(fleetResourceId);
+
+ // invoke the operation
+ await fleet.DeleteAsync(WaitUntil.Completed);
+
+ Console.WriteLine("Succeeded");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Update_UpdateAFleet()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2025-03-01/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
+ TokenCredential cred = new DefaultAzureCredential();
+ // authenticate your client
+ ArmClient client = new ArmClient(cred);
+
+ // this example assumes you already have this FleetResource created on azure
+ // for more information of creating FleetResource, please refer to the document of FleetResource
+ string subscriptionId = "subid1";
+ string resourceGroupName = "rg1";
+ string fleetName = "fleet1";
+ ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName);
+ FleetResource fleet = client.GetFleetResource(fleetResourceId);
+
+ // invoke the operation
+ FleetPatch patch = new FleetPatch
+ {
+ Tags =
+{
+["env"] = "prod",
+["tier"] = "secure"
+},
+ };
+ string ifMatch = "dfjkwelr7384";
+ ArmOperation lro = await fleet.UpdateAsync(WaitUntil.Completed, patch, ifMatch: ifMatch);
+ FleetResource 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
+ FleetData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task GetCredentials_ListsTheUserCredentialsOfAFleet()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2025-03-01/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
+ TokenCredential cred = new DefaultAzureCredential();
+ // authenticate your client
+ ArmClient client = new ArmClient(cred);
+
+ // this example assumes you already have this FleetResource created on azure
+ // for more information of creating FleetResource, please refer to the document of FleetResource
+ string subscriptionId = "subid1";
+ string resourceGroupName = "rg1";
+ string fleetName = "fleet";
+ ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName);
+ FleetResource fleet = client.GetFleetResource(fleetResourceId);
+
+ // invoke the operation
+ FleetCredentialResults result = await fleet.GetCredentialsAsync();
+
+ Console.WriteLine($"Succeeded: {result}");
+ }
+ }
+}
diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_FleetUpdateStrategyCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_FleetUpdateStrategyCollection.cs
new file mode 100644
index 000000000000..de7afc926c27
--- /dev/null
+++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_FleetUpdateStrategyCollection.cs
@@ -0,0 +1,204 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Threading.Tasks;
+using Azure.Core;
+using Azure.Identity;
+using Azure.ResourceManager.ContainerService.Models;
+using NUnit.Framework;
+
+namespace Azure.ResourceManager.ContainerService.Samples
+{
+ public partial class Sample_FleetUpdateStrategyCollection
+ {
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task CreateOrUpdate_CreateAFleetUpdateStrategy()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2025-03-01/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 FleetResource created on azure
+ // for more information of creating FleetResource, please refer to the document of FleetResource
+ string subscriptionId = "00000000-0000-0000-0000-000000000000";
+ string resourceGroupName = "rg1";
+ string fleetName = "fleet1";
+ ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName);
+ FleetResource fleet = client.GetFleetResource(fleetResourceId);
+
+ // get the collection of this FleetUpdateStrategyResource
+ FleetUpdateStrategyCollection collection = fleet.GetFleetUpdateStrategies();
+
+ // invoke the operation
+ string updateStrategyName = "strartegy1";
+ FleetUpdateStrategyData data = new FleetUpdateStrategyData
+ {
+ StrategyStages = {new UpdateStage("stage1")
+{
+Groups = {new UpdateGroup("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}");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Get_GetAFleetUpdateStrategyResource()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2025-03-01/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 FleetResource created on azure
+ // for more information of creating FleetResource, please refer to the document of FleetResource
+ string subscriptionId = "00000000-0000-0000-0000-000000000000";
+ string resourceGroupName = "rg1";
+ string fleetName = "fleet1";
+ ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName);
+ FleetResource fleet = client.GetFleetResource(fleetResourceId);
+
+ // get the collection of this FleetUpdateStrategyResource
+ FleetUpdateStrategyCollection collection = fleet.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}");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task GetAll_ListTheFleetUpdateStrategyResourcesByFleet()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2025-03-01/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 FleetResource created on azure
+ // for more information of creating FleetResource, please refer to the document of FleetResource
+ string subscriptionId = "00000000-0000-0000-0000-000000000000";
+ string resourceGroupName = "rg1";
+ string fleetName = "fleet1";
+ ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName);
+ FleetResource fleet = client.GetFleetResource(fleetResourceId);
+
+ // get the collection of this FleetUpdateStrategyResource
+ FleetUpdateStrategyCollection collection = fleet.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");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Exists_GetAFleetUpdateStrategyResource()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2025-03-01/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 FleetResource created on azure
+ // for more information of creating FleetResource, please refer to the document of FleetResource
+ string subscriptionId = "00000000-0000-0000-0000-000000000000";
+ string resourceGroupName = "rg1";
+ string fleetName = "fleet1";
+ ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName);
+ FleetResource fleet = client.GetFleetResource(fleetResourceId);
+
+ // get the collection of this FleetUpdateStrategyResource
+ FleetUpdateStrategyCollection collection = fleet.GetFleetUpdateStrategies();
+
+ // invoke the operation
+ string updateStrategyName = "strategy1";
+ bool result = await collection.ExistsAsync(updateStrategyName);
+
+ Console.WriteLine($"Succeeded: {result}");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task GetIfExists_GetAFleetUpdateStrategyResource()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2025-03-01/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 FleetResource created on azure
+ // for more information of creating FleetResource, please refer to the document of FleetResource
+ string subscriptionId = "00000000-0000-0000-0000-000000000000";
+ string resourceGroupName = "rg1";
+ string fleetName = "fleet1";
+ ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName);
+ FleetResource fleet = client.GetFleetResource(fleetResourceId);
+
+ // get the collection of this FleetUpdateStrategyResource
+ FleetUpdateStrategyCollection collection = fleet.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}");
+ }
+ }
+ }
+}
diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_FleetUpdateStrategyResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_FleetUpdateStrategyResource.cs
new file mode 100644
index 000000000000..48c1f085772f
--- /dev/null
+++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_FleetUpdateStrategyResource.cs
@@ -0,0 +1,117 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Threading.Tasks;
+using Azure.Core;
+using Azure.Identity;
+using Azure.ResourceManager.ContainerService.Models;
+using NUnit.Framework;
+
+namespace Azure.ResourceManager.ContainerService.Samples
+{
+ public partial class Sample_FleetUpdateStrategyResource
+ {
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Get_GetAFleetUpdateStrategyResource()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2025-03-01/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}");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Delete_DeleteAFleetUpdateStrategyResource()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2025-03-01/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");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Update_CreateAFleetUpdateStrategy()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2025-03-01/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 UpdateStage("stage1")
+{
+Groups = {new UpdateGroup("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}");
+ }
+ }
+}
diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs
index d4e1e40228ea..20ca8b8de5e2 100644
--- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs
+++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs
@@ -9,7 +9,6 @@
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
-using Azure.ResourceManager.ContainerService.Models;
using Azure.ResourceManager.Resources;
using NUnit.Framework;
@@ -19,10 +18,10 @@ public partial class Sample_SubscriptionResourceExtensions
{
[Test]
[Ignore("Only validating compilation of examples")]
- public async Task GetKubernetesVersionsManagedCluster_ListKubernetesVersions()
+ public async Task GetFleets_ListsTheFleetResourcesInASubscription()
{
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/KubernetesVersions_List.json
- // this example is just showing the usage of "ManagedClusters_ListKubernetesVersions" operation, for the dependent resources, they will have to be created separately.
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2025-03-01/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
TokenCredential cred = new DefaultAzureCredential();
@@ -31,105 +30,21 @@ public async Task GetKubernetesVersionsManagedCluster_ListKubernetesVersions()
// this example assumes you already have this SubscriptionResource created on azure
// for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId);
- SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId);
-
- // invoke the operation
- AzureLocation location = new AzureLocation("location1");
- KubernetesVersionListResult result = await subscriptionResource.GetKubernetesVersionsManagedClusterAsync(location);
-
- Console.WriteLine($"Succeeded: {result}");
- }
-
- [Test]
- [Ignore("Only validating compilation of examples")]
- public async Task GetContainerServiceManagedClusters_ListManagedClusters()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersList.json
- // this example is just showing the usage of "ManagedClusters_List" 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 SubscriptionResource created on azure
- // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
+ string subscriptionId = "subid1";
ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId);
SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId);
// invoke the operation and iterate over the result
- await foreach (ContainerServiceManagedClusterResource item in subscriptionResource.GetContainerServiceManagedClustersAsync())
+ await foreach (FleetResource item in subscriptionResource.GetFleetsAsync())
{
// 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
- ContainerServiceManagedClusterData resourceData = item.Data;
+ FleetData resourceData = item.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
Console.WriteLine("Succeeded");
}
-
- [Test]
- [Ignore("Only validating compilation of examples")]
- public async Task GetAgentPoolSnapshots_ListSnapshots()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/SnapshotsList.json
- // this example is just showing the usage of "Snapshots_List" 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 SubscriptionResource created on azure
- // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId);
- SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId);
-
- // invoke the operation and iterate over the result
- await foreach (AgentPoolSnapshotResource item in subscriptionResource.GetAgentPoolSnapshotsAsync())
- {
- // 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
- AgentPoolSnapshotData resourceData = item.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- Console.WriteLine("Succeeded");
- }
-
- [Test]
- [Ignore("Only validating compilation of examples")]
- public async Task GetTrustedAccessRoles_ListTrustedAccessRoles()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/TrustedAccessRoles_List.json
- // this example is just showing the usage of "TrustedAccessRoles_List" 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 SubscriptionResource created on azure
- // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId);
- SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId);
-
- // invoke the operation and iterate over the result
- AzureLocation location = new AzureLocation("westus2");
- await foreach (ContainerServiceTrustedAccessRole item in subscriptionResource.GetTrustedAccessRolesAsync(location))
- {
- Console.WriteLine($"Succeeded: {item}");
- }
-
- Console.WriteLine("Succeeded");
- }
}
}
diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_UpdateRunCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_UpdateRunCollection.cs
new file mode 100644
index 000000000000..9ce443bcae3b
--- /dev/null
+++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_UpdateRunCollection.cs
@@ -0,0 +1,212 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Threading.Tasks;
+using Azure.Core;
+using Azure.Identity;
+using Azure.ResourceManager.ContainerService.Models;
+using NUnit.Framework;
+
+namespace Azure.ResourceManager.ContainerService.Samples
+{
+ public partial class Sample_UpdateRunCollection
+ {
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task CreateOrUpdate_CreateAnUpdateRun()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2025-03-01/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
+ TokenCredential cred = new DefaultAzureCredential();
+ // authenticate your client
+ ArmClient client = new ArmClient(cred);
+
+ // this example assumes you already have this FleetResource created on azure
+ // for more information of creating FleetResource, please refer to the document of FleetResource
+ string subscriptionId = "00000000-0000-0000-0000-000000000000";
+ string resourceGroupName = "rg1";
+ string fleetName = "fleet1";
+ ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName);
+ FleetResource fleet = client.GetFleetResource(fleetResourceId);
+
+ // get the collection of this UpdateRunResource
+ UpdateRunCollection collection = fleet.GetUpdateRuns();
+
+ // invoke the operation
+ string updateRunName = "run1";
+ UpdateRunData data = new UpdateRunData
+ {
+ UpdateStrategyId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/fleets/myFleet/updateStrategies/strategy1"),
+ StrategyStages = {new UpdateStage("stage1")
+{
+Groups = {new UpdateGroup("group-a")},
+AfterStageWaitInSeconds = 3600,
+}},
+ ManagedClusterUpdate = new ManagedClusterUpdate(new ManagedClusterUpgradeSpec(ManagedClusterUpgradeType.Full)
+ {
+ KubernetesVersion = "1.26.1",
+ })
+ {
+ NodeImageSelection = new NodeImageSelection(NodeImageSelectionType.Latest),
+ },
+ };
+ ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, updateRunName, data);
+ UpdateRunResource 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
+ UpdateRunData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Get_GetsAnUpdateRunResource()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2025-03-01/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
+ TokenCredential cred = new DefaultAzureCredential();
+ // authenticate your client
+ ArmClient client = new ArmClient(cred);
+
+ // this example assumes you already have this FleetResource created on azure
+ // for more information of creating FleetResource, please refer to the document of FleetResource
+ string subscriptionId = "00000000-0000-0000-0000-000000000000";
+ string resourceGroupName = "rg1";
+ string fleetName = "fleet1";
+ ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName);
+ FleetResource fleet = client.GetFleetResource(fleetResourceId);
+
+ // get the collection of this UpdateRunResource
+ UpdateRunCollection collection = fleet.GetUpdateRuns();
+
+ // invoke the operation
+ string updateRunName = "run1";
+ UpdateRunResource result = await collection.GetAsync(updateRunName);
+
+ // 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
+ UpdateRunData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task GetAll_ListsTheUpdateRunResourcesByFleet()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2025-03-01/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
+ TokenCredential cred = new DefaultAzureCredential();
+ // authenticate your client
+ ArmClient client = new ArmClient(cred);
+
+ // this example assumes you already have this FleetResource created on azure
+ // for more information of creating FleetResource, please refer to the document of FleetResource
+ string subscriptionId = "00000000-0000-0000-0000-000000000000";
+ string resourceGroupName = "rg1";
+ string fleetName = "fleet1";
+ ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName);
+ FleetResource fleet = client.GetFleetResource(fleetResourceId);
+
+ // get the collection of this UpdateRunResource
+ UpdateRunCollection collection = fleet.GetUpdateRuns();
+
+ // invoke the operation and iterate over the result
+ await foreach (UpdateRunResource 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
+ UpdateRunData resourceData = item.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+
+ Console.WriteLine("Succeeded");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Exists_GetsAnUpdateRunResource()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2025-03-01/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
+ TokenCredential cred = new DefaultAzureCredential();
+ // authenticate your client
+ ArmClient client = new ArmClient(cred);
+
+ // this example assumes you already have this FleetResource created on azure
+ // for more information of creating FleetResource, please refer to the document of FleetResource
+ string subscriptionId = "00000000-0000-0000-0000-000000000000";
+ string resourceGroupName = "rg1";
+ string fleetName = "fleet1";
+ ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName);
+ FleetResource fleet = client.GetFleetResource(fleetResourceId);
+
+ // get the collection of this UpdateRunResource
+ UpdateRunCollection collection = fleet.GetUpdateRuns();
+
+ // invoke the operation
+ string updateRunName = "run1";
+ bool result = await collection.ExistsAsync(updateRunName);
+
+ Console.WriteLine($"Succeeded: {result}");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task GetIfExists_GetsAnUpdateRunResource()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2025-03-01/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
+ TokenCredential cred = new DefaultAzureCredential();
+ // authenticate your client
+ ArmClient client = new ArmClient(cred);
+
+ // this example assumes you already have this FleetResource created on azure
+ // for more information of creating FleetResource, please refer to the document of FleetResource
+ string subscriptionId = "00000000-0000-0000-0000-000000000000";
+ string resourceGroupName = "rg1";
+ string fleetName = "fleet1";
+ ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName);
+ FleetResource fleet = client.GetFleetResource(fleetResourceId);
+
+ // get the collection of this UpdateRunResource
+ UpdateRunCollection collection = fleet.GetUpdateRuns();
+
+ // invoke the operation
+ string updateRunName = "run1";
+ NullableResponse response = await collection.GetIfExistsAsync(updateRunName);
+ UpdateRunResource 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
+ UpdateRunData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+ }
+ }
+}
diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_UpdateRunResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_UpdateRunResource.cs
new file mode 100644
index 000000000000..fc088bb2d0d2
--- /dev/null
+++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_UpdateRunResource.cs
@@ -0,0 +1,226 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Threading.Tasks;
+using Azure.Core;
+using Azure.Identity;
+using Azure.ResourceManager.ContainerService.Models;
+using NUnit.Framework;
+
+namespace Azure.ResourceManager.ContainerService.Samples
+{
+ public partial class Sample_UpdateRunResource
+ {
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Get_GetsAnUpdateRunResource()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2025-03-01/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
+ TokenCredential cred = new DefaultAzureCredential();
+ // authenticate your client
+ ArmClient client = new ArmClient(cred);
+
+ // this example assumes you already have this UpdateRunResource created on azure
+ // for more information of creating UpdateRunResource, please refer to the document of UpdateRunResource
+ string subscriptionId = "00000000-0000-0000-0000-000000000000";
+ string resourceGroupName = "rg1";
+ string fleetName = "fleet1";
+ string updateRunName = "run1";
+ ResourceIdentifier updateRunResourceId = UpdateRunResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, updateRunName);
+ UpdateRunResource updateRun = client.GetUpdateRunResource(updateRunResourceId);
+
+ // invoke the operation
+ UpdateRunResource result = await updateRun.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
+ UpdateRunData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Delete_DeleteAnUpdateRunResource()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2025-03-01/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
+ TokenCredential cred = new DefaultAzureCredential();
+ // authenticate your client
+ ArmClient client = new ArmClient(cred);
+
+ // this example assumes you already have this UpdateRunResource created on azure
+ // for more information of creating UpdateRunResource, please refer to the document of UpdateRunResource
+ string subscriptionId = "subid1";
+ string resourceGroupName = "rg1";
+ string fleetName = "fleet1";
+ string updateRunName = "run1";
+ ResourceIdentifier updateRunResourceId = UpdateRunResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, updateRunName);
+ UpdateRunResource updateRun = client.GetUpdateRunResource(updateRunResourceId);
+
+ // invoke the operation
+ await updateRun.DeleteAsync(WaitUntil.Completed);
+
+ Console.WriteLine("Succeeded");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Update_CreateAnUpdateRun()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2025-03-01/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
+ TokenCredential cred = new DefaultAzureCredential();
+ // authenticate your client
+ ArmClient client = new ArmClient(cred);
+
+ // this example assumes you already have this UpdateRunResource created on azure
+ // for more information of creating UpdateRunResource, please refer to the document of UpdateRunResource
+ string subscriptionId = "00000000-0000-0000-0000-000000000000";
+ string resourceGroupName = "rg1";
+ string fleetName = "fleet1";
+ string updateRunName = "run1";
+ ResourceIdentifier updateRunResourceId = UpdateRunResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, updateRunName);
+ UpdateRunResource updateRun = client.GetUpdateRunResource(updateRunResourceId);
+
+ // invoke the operation
+ UpdateRunData data = new UpdateRunData
+ {
+ UpdateStrategyId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/fleets/myFleet/updateStrategies/strategy1"),
+ StrategyStages = {new UpdateStage("stage1")
+{
+Groups = {new UpdateGroup("group-a")},
+AfterStageWaitInSeconds = 3600,
+}},
+ ManagedClusterUpdate = new ManagedClusterUpdate(new ManagedClusterUpgradeSpec(ManagedClusterUpgradeType.Full)
+ {
+ KubernetesVersion = "1.26.1",
+ })
+ {
+ NodeImageSelection = new NodeImageSelection(NodeImageSelectionType.Latest),
+ },
+ };
+ ArmOperation lro = await updateRun.UpdateAsync(WaitUntil.Completed, data);
+ UpdateRunResource 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
+ UpdateRunData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Skip_SkipsOneOrMoreMemberGroupStageAfterStageWaitSOfAnUpdateRun()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2025-03-01/examples/UpdateRuns_Skip.json
+ // this example is just showing the usage of "UpdateRuns_Skip" 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 UpdateRunResource created on azure
+ // for more information of creating UpdateRunResource, please refer to the document of UpdateRunResource
+ string subscriptionId = "00000000-0000-0000-0000-000000000000";
+ string resourceGroupName = "rg1";
+ string fleetName = "fleet1";
+ string updateRunName = "run1";
+ ResourceIdentifier updateRunResourceId = UpdateRunResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, updateRunName);
+ UpdateRunResource updateRun = client.GetUpdateRunResource(updateRunResourceId);
+
+ // invoke the operation
+ SkipProperties body = new SkipProperties(new SkipTarget[]
+ {
+new SkipTarget(TargetType.Member, "member-one"),
+new SkipTarget(TargetType.AfterStageWait, "stage1")
+ });
+ ArmOperation lro = await updateRun.SkipAsync(WaitUntil.Completed, body);
+ UpdateRunResource 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
+ UpdateRunData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Start_StartsAnUpdateRun()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2025-03-01/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
+ TokenCredential cred = new DefaultAzureCredential();
+ // authenticate your client
+ ArmClient client = new ArmClient(cred);
+
+ // this example assumes you already have this UpdateRunResource created on azure
+ // for more information of creating UpdateRunResource, please refer to the document of UpdateRunResource
+ string subscriptionId = "00000000-0000-0000-0000-000000000000";
+ string resourceGroupName = "rg1";
+ string fleetName = "fleet1";
+ string updateRunName = "run1";
+ ResourceIdentifier updateRunResourceId = UpdateRunResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, updateRunName);
+ UpdateRunResource updateRun = client.GetUpdateRunResource(updateRunResourceId);
+
+ // invoke the operation
+ ArmOperation lro = await updateRun.StartAsync(WaitUntil.Completed);
+ UpdateRunResource 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
+ UpdateRunData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Stop_StopsAnUpdateRun()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2025-03-01/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
+ TokenCredential cred = new DefaultAzureCredential();
+ // authenticate your client
+ ArmClient client = new ArmClient(cred);
+
+ // this example assumes you already have this UpdateRunResource created on azure
+ // for more information of creating UpdateRunResource, please refer to the document of UpdateRunResource
+ string subscriptionId = "00000000-0000-0000-0000-000000000000";
+ string resourceGroupName = "rg1";
+ string fleetName = "fleet1";
+ string updateRunName = "run1";
+ ResourceIdentifier updateRunResourceId = UpdateRunResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, updateRunName);
+ UpdateRunResource updateRun = client.GetUpdateRunResource(updateRunResourceId);
+
+ // invoke the operation
+ ArmOperation lro = await updateRun.StopAsync(WaitUntil.Completed);
+ UpdateRunResource 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
+ UpdateRunData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+ }
+}
diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotCollection.cs
deleted file mode 100644
index 327b8b63ae23..000000000000
--- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotCollection.cs
+++ /dev/null
@@ -1,498 +0,0 @@
-// 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.Core;
-using Azure.Core.Pipeline;
-using Azure.ResourceManager.Resources;
-
-namespace Azure.ResourceManager.ContainerService
-{
- ///
- /// A class representing a collection of and their operations.
- /// Each in the collection will belong to the same instance of .
- /// To get an instance call the GetAgentPoolSnapshots method from an instance of .
- ///
- public partial class AgentPoolSnapshotCollection : ArmCollection, IEnumerable, IAsyncEnumerable
- {
- private readonly ClientDiagnostics _agentPoolSnapshotSnapshotsClientDiagnostics;
- private readonly SnapshotsRestOperations _agentPoolSnapshotSnapshotsRestClient;
-
- /// Initializes a new instance of the class for mocking.
- protected AgentPoolSnapshotCollection()
- {
- }
-
- /// 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 AgentPoolSnapshotCollection(ArmClient client, ResourceIdentifier id) : base(client, id)
- {
- _agentPoolSnapshotSnapshotsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", AgentPoolSnapshotResource.ResourceType.Namespace, Diagnostics);
- TryGetApiVersion(AgentPoolSnapshotResource.ResourceType, out string agentPoolSnapshotSnapshotsApiVersion);
- _agentPoolSnapshotSnapshotsRestClient = new SnapshotsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, agentPoolSnapshotSnapshotsApiVersion);
-#if DEBUG
- ValidateResourceId(Id);
-#endif
- }
-
- internal static void ValidateResourceId(ResourceIdentifier id)
- {
- if (id.ResourceType != ResourceGroupResource.ResourceType)
- throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id));
- }
-
- ///
- /// Creates or updates a snapshot.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}
- ///
- /// -
- /// Operation Id
- /// Snapshots_CreateOrUpdate
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// 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 managed cluster resource.
- /// The snapshot to create or update.
- /// 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 resourceName, AgentPoolSnapshotData data, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName));
- Argument.AssertNotNull(data, nameof(data));
-
- using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotCollection.CreateOrUpdate");
- scope.Start();
- try
- {
- var response = await _agentPoolSnapshotSnapshotsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, resourceName, data, cancellationToken).ConfigureAwait(false);
- var uri = _agentPoolSnapshotSnapshotsRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, resourceName, data);
- var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString());
- var operation = new ContainerServiceArmOperation(Response.FromValue(new AgentPoolSnapshotResource(Client, response), response.GetRawResponse()), rehydrationToken);
- if (waitUntil == WaitUntil.Completed)
- await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
- return operation;
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Creates or updates a snapshot.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}
- ///
- /// -
- /// Operation Id
- /// Snapshots_CreateOrUpdate
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// 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 managed cluster resource.
- /// The snapshot to create or update.
- /// 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 resourceName, AgentPoolSnapshotData data, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName));
- Argument.AssertNotNull(data, nameof(data));
-
- using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotCollection.CreateOrUpdate");
- scope.Start();
- try
- {
- var response = _agentPoolSnapshotSnapshotsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, resourceName, data, cancellationToken);
- var uri = _agentPoolSnapshotSnapshotsRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, resourceName, data);
- var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString());
- var operation = new ContainerServiceArmOperation(Response.FromValue(new AgentPoolSnapshotResource(Client, response), response.GetRawResponse()), rehydrationToken);
- if (waitUntil == WaitUntil.Completed)
- operation.WaitForCompletion(cancellationToken);
- return operation;
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Gets a snapshot.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}
- ///
- /// -
- /// Operation Id
- /// Snapshots_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The name of the managed cluster 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 resourceName, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName));
-
- using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotCollection.Get");
- scope.Start();
- try
- {
- var response = await _agentPoolSnapshotSnapshotsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, resourceName, cancellationToken).ConfigureAwait(false);
- if (response.Value == null)
- throw new RequestFailedException(response.GetRawResponse());
- return Response.FromValue(new AgentPoolSnapshotResource(Client, response.Value), response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Gets a snapshot.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}
- ///
- /// -
- /// Operation Id
- /// Snapshots_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The name of the managed cluster resource.
- /// The cancellation token to use.
- /// is an empty string, and was expected to be non-empty.
- /// is null.
- public virtual Response Get(string resourceName, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName));
-
- using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotCollection.Get");
- scope.Start();
- try
- {
- var response = _agentPoolSnapshotSnapshotsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, resourceName, cancellationToken);
- if (response.Value == null)
- throw new RequestFailedException(response.GetRawResponse());
- return Response.FromValue(new AgentPoolSnapshotResource(Client, response.Value), response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Lists snapshots in the specified subscription and resource group.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots
- ///
- /// -
- /// Operation Id
- /// Snapshots_ListByResourceGroup
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// 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) => _agentPoolSnapshotSnapshotsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName);
- HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _agentPoolSnapshotSnapshotsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName);
- return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AgentPoolSnapshotResource(Client, AgentPoolSnapshotData.DeserializeAgentPoolSnapshotData(e)), _agentPoolSnapshotSnapshotsClientDiagnostics, Pipeline, "AgentPoolSnapshotCollection.GetAll", "value", "nextLink", cancellationToken);
- }
-
- ///
- /// Lists snapshots in the specified subscription and resource group.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots
- ///
- /// -
- /// Operation Id
- /// Snapshots_ListByResourceGroup
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// 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) => _agentPoolSnapshotSnapshotsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName);
- HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _agentPoolSnapshotSnapshotsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName);
- return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AgentPoolSnapshotResource(Client, AgentPoolSnapshotData.DeserializeAgentPoolSnapshotData(e)), _agentPoolSnapshotSnapshotsClientDiagnostics, Pipeline, "AgentPoolSnapshotCollection.GetAll", "value", "nextLink", cancellationToken);
- }
-
- ///
- /// Checks to see if the resource exists in azure.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}
- ///
- /// -
- /// Operation Id
- /// Snapshots_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The name of the managed cluster 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 resourceName, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName));
-
- using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotCollection.Exists");
- scope.Start();
- try
- {
- var response = await _agentPoolSnapshotSnapshotsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, resourceName, 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/snapshots/{resourceName}
- ///
- /// -
- /// Operation Id
- /// Snapshots_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The name of the managed cluster resource.
- /// The cancellation token to use.
- /// is an empty string, and was expected to be non-empty.
- /// is null.
- public virtual Response Exists(string resourceName, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName));
-
- using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotCollection.Exists");
- scope.Start();
- try
- {
- var response = _agentPoolSnapshotSnapshotsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, resourceName, 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/snapshots/{resourceName}
- ///
- /// -
- /// Operation Id
- /// Snapshots_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The name of the managed cluster 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 resourceName, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName));
-
- using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotCollection.GetIfExists");
- scope.Start();
- try
- {
- var response = await _agentPoolSnapshotSnapshotsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, resourceName, cancellationToken: cancellationToken).ConfigureAwait(false);
- if (response.Value == null)
- return new NoValueResponse(response.GetRawResponse());
- return Response.FromValue(new AgentPoolSnapshotResource(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/snapshots/{resourceName}
- ///
- /// -
- /// Operation Id
- /// Snapshots_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The name of the managed cluster resource.
- /// The cancellation token to use.
- /// is an empty string, and was expected to be non-empty.
- /// is null.
- public virtual NullableResponse GetIfExists(string resourceName, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName));
-
- using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotCollection.GetIfExists");
- scope.Start();
- try
- {
- var response = _agentPoolSnapshotSnapshotsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, resourceName, cancellationToken: cancellationToken);
- if (response.Value == null)
- return new NoValueResponse(response.GetRawResponse());
- return Response.FromValue(new AgentPoolSnapshotResource(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/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotData.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotData.Serialization.cs
deleted file mode 100644
index c99254a7bcde..000000000000
--- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotData.Serialization.cs
+++ /dev/null
@@ -1,567 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.ClientModel.Primitives;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Text.Json;
-using Azure.Core;
-using Azure.ResourceManager.ContainerService.Models;
-using Azure.ResourceManager.Models;
-
-namespace Azure.ResourceManager.ContainerService
-{
- public partial class AgentPoolSnapshotData : IUtf8JsonSerializable, IJsonModel
- {
- void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
-
- void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
- {
- writer.WriteStartObject();
- JsonModelWriteCore(writer, options);
- writer.WriteEndObject();
- }
-
- /// The JSON writer.
- /// The client options for reading and writing models.
- protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
- if (format != "J")
- {
- throw new FormatException($"The model {nameof(AgentPoolSnapshotData)} does not support writing '{format}' format.");
- }
-
- base.JsonModelWriteCore(writer, options);
- writer.WritePropertyName("properties"u8);
- writer.WriteStartObject();
- if (Optional.IsDefined(CreationData))
- {
- writer.WritePropertyName("creationData"u8);
- writer.WriteObjectValue(CreationData, options);
- }
- if (Optional.IsDefined(SnapshotType))
- {
- writer.WritePropertyName("snapshotType"u8);
- writer.WriteStringValue(SnapshotType.Value.ToString());
- }
- if (options.Format != "W" && Optional.IsDefined(KubernetesVersion))
- {
- writer.WritePropertyName("kubernetesVersion"u8);
- writer.WriteStringValue(KubernetesVersion);
- }
- if (options.Format != "W" && Optional.IsDefined(NodeImageVersion))
- {
- writer.WritePropertyName("nodeImageVersion"u8);
- writer.WriteStringValue(NodeImageVersion);
- }
- if (options.Format != "W" && Optional.IsDefined(OSType))
- {
- writer.WritePropertyName("osType"u8);
- writer.WriteStringValue(OSType.Value.ToString());
- }
- if (options.Format != "W" && Optional.IsDefined(OSSku))
- {
- writer.WritePropertyName("osSku"u8);
- writer.WriteStringValue(OSSku.Value.ToString());
- }
- if (options.Format != "W" && Optional.IsDefined(VmSize))
- {
- writer.WritePropertyName("vmSize"u8);
- writer.WriteStringValue(VmSize);
- }
- if (options.Format != "W" && Optional.IsDefined(EnableFips))
- {
- writer.WritePropertyName("enableFIPS"u8);
- writer.WriteBooleanValue(EnableFips.Value);
- }
- writer.WriteEndObject();
- }
-
- AgentPoolSnapshotData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
- if (format != "J")
- {
- throw new FormatException($"The model {nameof(AgentPoolSnapshotData)} does not support reading '{format}' format.");
- }
-
- using JsonDocument document = JsonDocument.ParseValue(ref reader);
- return DeserializeAgentPoolSnapshotData(document.RootElement, options);
- }
-
- internal static AgentPoolSnapshotData DeserializeAgentPoolSnapshotData(JsonElement element, ModelReaderWriterOptions options = null)
- {
- options ??= ModelSerializationExtensions.WireOptions;
-
- if (element.ValueKind == JsonValueKind.Null)
- {
- return null;
- }
- IDictionary tags = default;
- AzureLocation location = default;
- ResourceIdentifier id = default;
- string name = default;
- ResourceType type = default;
- SystemData systemData = default;
- ContainerServiceCreationData creationData = default;
- SnapshotType? snapshotType = default;
- string kubernetesVersion = default;
- string nodeImageVersion = default;
- ContainerServiceOSType? osType = default;
- ContainerServiceOSSku? osSku = default;
- string vmSize = default;
- bool? enableFIPS = default;
- IDictionary serializedAdditionalRawData = default;
- Dictionary rawDataDictionary = new Dictionary();
- foreach (var property in element.EnumerateObject())
- {
- if (property.NameEquals("tags"u8))
- {
- if (property.Value.ValueKind == JsonValueKind.Null)
- {
- continue;
- }
- Dictionary dictionary = new Dictionary();
- foreach (var property0 in property.Value.EnumerateObject())
- {
- dictionary.Add(property0.Name, property0.Value.GetString());
- }
- tags = dictionary;
- continue;
- }
- if (property.NameEquals("location"u8))
- {
- location = new AzureLocation(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("creationData"u8))
- {
- if (property0.Value.ValueKind == JsonValueKind.Null)
- {
- continue;
- }
- creationData = ContainerServiceCreationData.DeserializeContainerServiceCreationData(property0.Value, options);
- continue;
- }
- if (property0.NameEquals("snapshotType"u8))
- {
- if (property0.Value.ValueKind == JsonValueKind.Null)
- {
- continue;
- }
- snapshotType = new SnapshotType(property0.Value.GetString());
- continue;
- }
- if (property0.NameEquals("kubernetesVersion"u8))
- {
- kubernetesVersion = property0.Value.GetString();
- continue;
- }
- if (property0.NameEquals("nodeImageVersion"u8))
- {
- nodeImageVersion = property0.Value.GetString();
- continue;
- }
- if (property0.NameEquals("osType"u8))
- {
- if (property0.Value.ValueKind == JsonValueKind.Null)
- {
- continue;
- }
- osType = new ContainerServiceOSType(property0.Value.GetString());
- continue;
- }
- if (property0.NameEquals("osSku"u8))
- {
- if (property0.Value.ValueKind == JsonValueKind.Null)
- {
- continue;
- }
- osSku = new ContainerServiceOSSku(property0.Value.GetString());
- continue;
- }
- if (property0.NameEquals("vmSize"u8))
- {
- vmSize = property0.Value.GetString();
- continue;
- }
- if (property0.NameEquals("enableFIPS"u8))
- {
- if (property0.Value.ValueKind == JsonValueKind.Null)
- {
- continue;
- }
- enableFIPS = property0.Value.GetBoolean();
- continue;
- }
- }
- continue;
- }
- if (options.Format != "W")
- {
- rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
- }
- }
- serializedAdditionalRawData = rawDataDictionary;
- return new AgentPoolSnapshotData(
- id,
- name,
- type,
- systemData,
- tags ?? new ChangeTrackingDictionary(),
- location,
- creationData,
- snapshotType,
- kubernetesVersion,
- nodeImageVersion,
- osType,
- osSku,
- vmSize,
- enableFIPS,
- serializedAdditionalRawData);
- }
-
- private BinaryData SerializeBicep(ModelReaderWriterOptions options)
- {
- StringBuilder builder = new StringBuilder();
- BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions;
- IDictionary propertyOverrides = null;
- bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides);
- bool hasPropertyOverride = false;
- string propertyOverride = null;
-
- builder.AppendLine("{");
-
- hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride);
- if (hasPropertyOverride)
- {
- builder.Append(" name: ");
- builder.AppendLine(propertyOverride);
- }
- else
- {
- if (Optional.IsDefined(Name))
- {
- builder.Append(" name: ");
- if (Name.Contains(Environment.NewLine))
- {
- builder.AppendLine("'''");
- builder.AppendLine($"{Name}'''");
- }
- else
- {
- builder.AppendLine($"'{Name}'");
- }
- }
- }
-
- hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Location), out propertyOverride);
- if (hasPropertyOverride)
- {
- builder.Append(" location: ");
- builder.AppendLine(propertyOverride);
- }
- else
- {
- builder.Append(" location: ");
- builder.AppendLine($"'{Location.ToString()}'");
- }
-
- hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tags), out propertyOverride);
- if (hasPropertyOverride)
- {
- builder.Append(" tags: ");
- builder.AppendLine(propertyOverride);
- }
- else
- {
- if (Optional.IsCollectionDefined(Tags))
- {
- if (Tags.Any())
- {
- builder.Append(" tags: ");
- builder.AppendLine("{");
- foreach (var item in Tags)
- {
- builder.Append($" '{item.Key}': ");
- if (item.Value == null)
- {
- builder.Append("null");
- continue;
- }
- if (item.Value.Contains(Environment.NewLine))
- {
- builder.AppendLine("'''");
- builder.AppendLine($"{item.Value}'''");
- }
- else
- {
- builder.AppendLine($"'{item.Value}'");
- }
- }
- builder.AppendLine(" }");
- }
- }
- }
-
- hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride);
- if (hasPropertyOverride)
- {
- builder.Append(" id: ");
- builder.AppendLine(propertyOverride);
- }
- else
- {
- if (Optional.IsDefined(Id))
- {
- builder.Append(" id: ");
- builder.AppendLine($"'{Id.ToString()}'");
- }
- }
-
- hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride);
- if (hasPropertyOverride)
- {
- builder.Append(" systemData: ");
- builder.AppendLine(propertyOverride);
- }
- else
- {
- if (Optional.IsDefined(SystemData))
- {
- builder.Append(" systemData: ");
- builder.AppendLine($"'{SystemData.ToString()}'");
- }
- }
-
- builder.Append(" properties:");
- builder.AppendLine(" {");
- hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("CreationDataSourceResourceId", out propertyOverride);
- if (hasPropertyOverride)
- {
- builder.Append(" creationData: ");
- builder.AppendLine("{");
- builder.AppendLine(" creationData: {");
- builder.Append(" sourceResourceId: ");
- builder.AppendLine(propertyOverride);
- builder.AppendLine(" }");
- builder.AppendLine(" }");
- }
- else
- {
- if (Optional.IsDefined(CreationData))
- {
- builder.Append(" creationData: ");
- BicepSerializationHelpers.AppendChildObject(builder, CreationData, options, 4, false, " creationData: ");
- }
- }
-
- hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SnapshotType), out propertyOverride);
- if (hasPropertyOverride)
- {
- builder.Append(" snapshotType: ");
- builder.AppendLine(propertyOverride);
- }
- else
- {
- if (Optional.IsDefined(SnapshotType))
- {
- builder.Append(" snapshotType: ");
- builder.AppendLine($"'{SnapshotType.Value.ToString()}'");
- }
- }
-
- hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(KubernetesVersion), out propertyOverride);
- if (hasPropertyOverride)
- {
- builder.Append(" kubernetesVersion: ");
- builder.AppendLine(propertyOverride);
- }
- else
- {
- if (Optional.IsDefined(KubernetesVersion))
- {
- builder.Append(" kubernetesVersion: ");
- if (KubernetesVersion.Contains(Environment.NewLine))
- {
- builder.AppendLine("'''");
- builder.AppendLine($"{KubernetesVersion}'''");
- }
- else
- {
- builder.AppendLine($"'{KubernetesVersion}'");
- }
- }
- }
-
- hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NodeImageVersion), out propertyOverride);
- if (hasPropertyOverride)
- {
- builder.Append(" nodeImageVersion: ");
- builder.AppendLine(propertyOverride);
- }
- else
- {
- if (Optional.IsDefined(NodeImageVersion))
- {
- builder.Append(" nodeImageVersion: ");
- if (NodeImageVersion.Contains(Environment.NewLine))
- {
- builder.AppendLine("'''");
- builder.AppendLine($"{NodeImageVersion}'''");
- }
- else
- {
- builder.AppendLine($"'{NodeImageVersion}'");
- }
- }
- }
-
- hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(OSType), out propertyOverride);
- if (hasPropertyOverride)
- {
- builder.Append(" osType: ");
- builder.AppendLine(propertyOverride);
- }
- else
- {
- if (Optional.IsDefined(OSType))
- {
- builder.Append(" osType: ");
- builder.AppendLine($"'{OSType.Value.ToString()}'");
- }
- }
-
- hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(OSSku), out propertyOverride);
- if (hasPropertyOverride)
- {
- builder.Append(" osSku: ");
- builder.AppendLine(propertyOverride);
- }
- else
- {
- if (Optional.IsDefined(OSSku))
- {
- builder.Append(" osSku: ");
- builder.AppendLine($"'{OSSku.Value.ToString()}'");
- }
- }
-
- hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(VmSize), out propertyOverride);
- if (hasPropertyOverride)
- {
- builder.Append(" vmSize: ");
- builder.AppendLine(propertyOverride);
- }
- else
- {
- if (Optional.IsDefined(VmSize))
- {
- builder.Append(" vmSize: ");
- if (VmSize.Contains(Environment.NewLine))
- {
- builder.AppendLine("'''");
- builder.AppendLine($"{VmSize}'''");
- }
- else
- {
- builder.AppendLine($"'{VmSize}'");
- }
- }
- }
-
- hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnableFips), out propertyOverride);
- if (hasPropertyOverride)
- {
- builder.Append(" enableFIPS: ");
- builder.AppendLine(propertyOverride);
- }
- else
- {
- if (Optional.IsDefined(EnableFips))
- {
- builder.Append(" enableFIPS: ");
- var boolValue = EnableFips.Value == true ? "true" : "false";
- builder.AppendLine($"{boolValue}");
- }
- }
-
- builder.AppendLine(" }");
- builder.AppendLine("}");
- return BinaryData.FromString(builder.ToString());
- }
-
- BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- return ModelReaderWriter.Write(this, options);
- case "bicep":
- return SerializeBicep(options);
- default:
- throw new FormatException($"The model {nameof(AgentPoolSnapshotData)} does not support writing '{options.Format}' format.");
- }
- }
-
- AgentPoolSnapshotData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- {
- using JsonDocument document = JsonDocument.Parse(data);
- return DeserializeAgentPoolSnapshotData(document.RootElement, options);
- }
- default:
- throw new FormatException($"The model {nameof(AgentPoolSnapshotData)} does not support reading '{options.Format}' format.");
- }
- }
-
- string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
- }
-}
diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotData.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotData.cs
deleted file mode 100644
index 64208b02be45..000000000000
--- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotData.cs
+++ /dev/null
@@ -1,131 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Collections.Generic;
-using Azure.Core;
-using Azure.ResourceManager.ContainerService.Models;
-using Azure.ResourceManager.Models;
-
-namespace Azure.ResourceManager.ContainerService
-{
- ///
- /// A class representing the AgentPoolSnapshot data model.
- /// A node pool snapshot resource.
- ///
- public partial class AgentPoolSnapshotData : TrackedResourceData
- {
- ///
- /// Keeps track of any properties unknown to the library.
- ///
- /// To assign an object to the value of this property use .
- ///
- ///
- /// To assign an already formatted json string to this property use .
- ///
- ///
- /// Examples:
- ///
- /// -
- /// BinaryData.FromObjectAsJson("foo")
- /// Creates a payload of "foo".
- ///
- /// -
- /// BinaryData.FromString("\"foo\"")
- /// Creates a payload of "foo".
- ///
- /// -
- /// BinaryData.FromObjectAsJson(new { key = "value" })
- /// Creates a payload of { "key": "value" }.
- ///
- /// -
- /// BinaryData.FromString("{\"key\": \"value\"}")
- /// Creates a payload of { "key": "value" }.
- ///
- ///
- ///
- ///
- private IDictionary _serializedAdditionalRawData;
-
- /// Initializes a new instance of .
- /// The location.
- public AgentPoolSnapshotData(AzureLocation location) : base(location)
- {
- }
-
- /// Initializes a new instance of .
- /// The id.
- /// The name.
- /// The resourceType.
- /// The systemData.
- /// The tags.
- /// The location.
- /// CreationData to be used to specify the source agent pool resource ID to create this snapshot.
- /// The type of a snapshot. The default is NodePool.
- /// The version of Kubernetes.
- /// The version of node image.
- /// The operating system type. The default is Linux.
- /// Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType is Windows.
- /// The size of the VM.
- /// Whether to use a FIPS-enabled OS.
- /// Keeps track of any properties unknown to the library.
- internal AgentPoolSnapshotData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ContainerServiceCreationData creationData, SnapshotType? snapshotType, string kubernetesVersion, string nodeImageVersion, ContainerServiceOSType? osType, ContainerServiceOSSku? osSku, string vmSize, bool? enableFips, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location)
- {
- CreationData = creationData;
- SnapshotType = snapshotType;
- KubernetesVersion = kubernetesVersion;
- NodeImageVersion = nodeImageVersion;
- OSType = osType;
- OSSku = osSku;
- VmSize = vmSize;
- EnableFips = enableFips;
- _serializedAdditionalRawData = serializedAdditionalRawData;
- }
-
- /// Initializes a new instance of for deserialization.
- internal AgentPoolSnapshotData()
- {
- }
-
- /// CreationData to be used to specify the source agent pool resource ID to create this snapshot.
- internal ContainerServiceCreationData CreationData { get; set; }
- /// This is the ARM ID of the source object to be used to create the target object.
- [WirePath("properties.creationData.sourceResourceId")]
- public ResourceIdentifier CreationDataSourceResourceId
- {
- get => CreationData is null ? default : CreationData.SourceResourceId;
- set
- {
- if (CreationData is null)
- CreationData = new ContainerServiceCreationData();
- CreationData.SourceResourceId = value;
- }
- }
-
- /// The type of a snapshot. The default is NodePool.
- [WirePath("properties.snapshotType")]
- public SnapshotType? SnapshotType { get; set; }
- /// The version of Kubernetes.
- [WirePath("properties.kubernetesVersion")]
- public string KubernetesVersion { get; }
- /// The version of node image.
- [WirePath("properties.nodeImageVersion")]
- public string NodeImageVersion { get; }
- /// The operating system type. The default is Linux.
- [WirePath("properties.osType")]
- public ContainerServiceOSType? OSType { get; }
- /// Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType is Windows.
- [WirePath("properties.osSku")]
- public ContainerServiceOSSku? OSSku { get; }
- /// The size of the VM.
- [WirePath("properties.vmSize")]
- public string VmSize { get; }
- /// Whether to use a FIPS-enabled OS.
- [WirePath("properties.enableFIPS")]
- public bool? EnableFips { get; }
- }
-}
diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotResource.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotResource.Serialization.cs
deleted file mode 100644
index 7e89aba8ec1a..000000000000
--- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotResource.Serialization.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.ClientModel.Primitives;
-using System.Text.Json;
-
-namespace Azure.ResourceManager.ContainerService
-{
- public partial class AgentPoolSnapshotResource : IJsonModel
- {
- void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options);
-
- AgentPoolSnapshotData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options);
-
- BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options);
-
- AgentPoolSnapshotData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options);
-
- string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options);
- }
-}
diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotResource.cs
deleted file mode 100644
index 6045d3413e5b..000000000000
--- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotResource.cs
+++ /dev/null
@@ -1,703 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Collections.Generic;
-using System.Globalization;
-using System.Threading;
-using System.Threading.Tasks;
-using Azure.Core;
-using Azure.Core.Pipeline;
-using Azure.ResourceManager.ContainerService.Models;
-using Azure.ResourceManager.Resources;
-
-namespace Azure.ResourceManager.ContainerService
-{
- ///
- /// A Class representing an AgentPoolSnapshot along with the instance operations that can be performed on it.
- /// If you have a you can construct an
- /// from an instance of using the GetAgentPoolSnapshotResource method.
- /// Otherwise you can get one from its parent resource using the GetAgentPoolSnapshot method.
- ///
- public partial class AgentPoolSnapshotResource : ArmResource
- {
- /// Generate the resource identifier of a instance.
- /// The subscriptionId.
- /// The resourceGroupName.
- /// The resourceName.
- public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string resourceName)
- {
- var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}";
- return new ResourceIdentifier(resourceId);
- }
-
- private readonly ClientDiagnostics _agentPoolSnapshotSnapshotsClientDiagnostics;
- private readonly SnapshotsRestOperations _agentPoolSnapshotSnapshotsRestClient;
- private readonly AgentPoolSnapshotData _data;
-
- /// Gets the resource type for the operations.
- public static readonly ResourceType ResourceType = "Microsoft.ContainerService/snapshots";
-
- /// Initializes a new instance of the class for mocking.
- protected AgentPoolSnapshotResource()
- {
- }
-
- /// Initializes a new instance of the class.
- /// The client parameters to use in these operations.
- /// The resource that is the target of operations.
- internal AgentPoolSnapshotResource(ArmClient client, AgentPoolSnapshotData 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 AgentPoolSnapshotResource(ArmClient client, ResourceIdentifier id) : base(client, id)
- {
- _agentPoolSnapshotSnapshotsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ResourceType.Namespace, Diagnostics);
- TryGetApiVersion(ResourceType, out string agentPoolSnapshotSnapshotsApiVersion);
- _agentPoolSnapshotSnapshotsRestClient = new SnapshotsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, agentPoolSnapshotSnapshotsApiVersion);
-#if DEBUG
- ValidateResourceId(Id);
-#endif
- }
-
- /// 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 AgentPoolSnapshotData 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));
- }
-
- ///
- /// Gets a snapshot.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}
- ///
- /// -
- /// Operation Id
- /// Snapshots_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The cancellation token to use.
- public virtual async Task> GetAsync(CancellationToken cancellationToken = default)
- {
- using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotResource.Get");
- scope.Start();
- try
- {
- var response = await _agentPoolSnapshotSnapshotsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false);
- if (response.Value == null)
- throw new RequestFailedException(response.GetRawResponse());
- return Response.FromValue(new AgentPoolSnapshotResource(Client, response.Value), response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Gets a snapshot.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}
- ///
- /// -
- /// Operation Id
- /// Snapshots_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The cancellation token to use.
- public virtual Response Get(CancellationToken cancellationToken = default)
- {
- using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotResource.Get");
- scope.Start();
- try
- {
- var response = _agentPoolSnapshotSnapshotsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken);
- if (response.Value == null)
- throw new RequestFailedException(response.GetRawResponse());
- return Response.FromValue(new AgentPoolSnapshotResource(Client, response.Value), response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Deletes a snapshot.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}
- ///
- /// -
- /// Operation Id
- /// Snapshots_Delete
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// 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 cancellation token to use.
- public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default)
- {
- using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotResource.Delete");
- scope.Start();
- try
- {
- var response = await _agentPoolSnapshotSnapshotsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false);
- var uri = _agentPoolSnapshotSnapshotsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name);
- var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString());
- var operation = new ContainerServiceArmOperation(response, rehydrationToken);
- if (waitUntil == WaitUntil.Completed)
- await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false);
- return operation;
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Deletes a snapshot.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}
- ///
- /// -
- /// Operation Id
- /// Snapshots_Delete
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// 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 cancellation token to use.
- public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default)
- {
- using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotResource.Delete");
- scope.Start();
- try
- {
- var response = _agentPoolSnapshotSnapshotsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken);
- var uri = _agentPoolSnapshotSnapshotsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name);
- var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString());
- var operation = new ContainerServiceArmOperation(response, rehydrationToken);
- if (waitUntil == WaitUntil.Completed)
- operation.WaitForCompletionResponse(cancellationToken);
- return operation;
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Updates tags on a snapshot.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}
- ///
- /// -
- /// Operation Id
- /// Snapshots_UpdateTags
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// Parameters supplied to the Update snapshot Tags operation.
- /// The cancellation token to use.
- /// is null.
- public virtual async Task> UpdateAsync(ContainerServiceTagsObject containerServiceTagsObject, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNull(containerServiceTagsObject, nameof(containerServiceTagsObject));
-
- using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotResource.Update");
- scope.Start();
- try
- {
- var response = await _agentPoolSnapshotSnapshotsRestClient.UpdateTagsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, containerServiceTagsObject, cancellationToken).ConfigureAwait(false);
- return Response.FromValue(new AgentPoolSnapshotResource(Client, response.Value), response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Updates tags on a snapshot.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}
- ///
- /// -
- /// Operation Id
- /// Snapshots_UpdateTags
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// Parameters supplied to the Update snapshot Tags operation.
- /// The cancellation token to use.
- /// is null.
- public virtual Response Update(ContainerServiceTagsObject containerServiceTagsObject, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNull(containerServiceTagsObject, nameof(containerServiceTagsObject));
-
- using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotResource.Update");
- scope.Start();
- try
- {
- var response = _agentPoolSnapshotSnapshotsRestClient.UpdateTags(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, containerServiceTagsObject, cancellationToken);
- return Response.FromValue(new AgentPoolSnapshotResource(Client, response.Value), response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Add a tag to the current resource.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}
- ///
- /// -
- /// Operation Id
- /// Snapshots_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The key for the tag.
- /// The value for the tag.
- /// The cancellation token to use.
- /// or is null.
- public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNull(key, nameof(key));
- Argument.AssertNotNull(value, nameof(value));
-
- using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotResource.AddTag");
- scope.Start();
- try
- {
- if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false))
- {
- var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false);
- originalTags.Value.Data.TagValues[key] = value;
- await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false);
- var originalResponse = await _agentPoolSnapshotSnapshotsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false);
- return Response.FromValue(new AgentPoolSnapshotResource(Client, originalResponse.Value), originalResponse.GetRawResponse());
- }
- else
- {
- var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data;
- var patch = new ContainerServiceTagsObject();
- foreach (var tag in current.Tags)
- {
- patch.Tags.Add(tag);
- }
- patch.Tags[key] = value;
- var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false);
- return result;
- }
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Add a tag to the current resource.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}
- ///
- /// -
- /// Operation Id
- /// Snapshots_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The key for the tag.
- /// The value for the tag.
- /// The cancellation token to use.
- /// or is null.
- public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNull(key, nameof(key));
- Argument.AssertNotNull(value, nameof(value));
-
- using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotResource.AddTag");
- scope.Start();
- try
- {
- if (CanUseTagResource(cancellationToken: cancellationToken))
- {
- var originalTags = GetTagResource().Get(cancellationToken);
- originalTags.Value.Data.TagValues[key] = value;
- GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken);
- var originalResponse = _agentPoolSnapshotSnapshotsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken);
- return Response.FromValue(new AgentPoolSnapshotResource(Client, originalResponse.Value), originalResponse.GetRawResponse());
- }
- else
- {
- var current = Get(cancellationToken: cancellationToken).Value.Data;
- var patch = new ContainerServiceTagsObject();
- foreach (var tag in current.Tags)
- {
- patch.Tags.Add(tag);
- }
- patch.Tags[key] = value;
- var result = Update(patch, cancellationToken: cancellationToken);
- return result;
- }
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Replace the tags on the resource with the given set.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}
- ///
- /// -
- /// Operation Id
- /// Snapshots_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The set of tags to use as replacement.
- /// The cancellation token to use.
- /// is null.
- public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNull(tags, nameof(tags));
-
- using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotResource.SetTags");
- scope.Start();
- try
- {
- if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false))
- {
- await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false);
- var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false);
- originalTags.Value.Data.TagValues.ReplaceWith(tags);
- await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false);
- var originalResponse = await _agentPoolSnapshotSnapshotsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false);
- return Response.FromValue(new AgentPoolSnapshotResource(Client, originalResponse.Value), originalResponse.GetRawResponse());
- }
- else
- {
- var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data;
- var patch = new ContainerServiceTagsObject();
- patch.Tags.ReplaceWith(tags);
- var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false);
- return result;
- }
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Replace the tags on the resource with the given set.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}
- ///
- /// -
- /// Operation Id
- /// Snapshots_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The set of tags to use as replacement.
- /// The cancellation token to use.
- /// is null.
- public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNull(tags, nameof(tags));
-
- using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotResource.SetTags");
- scope.Start();
- try
- {
- if (CanUseTagResource(cancellationToken: cancellationToken))
- {
- GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken);
- var originalTags = GetTagResource().Get(cancellationToken);
- originalTags.Value.Data.TagValues.ReplaceWith(tags);
- GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken);
- var originalResponse = _agentPoolSnapshotSnapshotsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken);
- return Response.FromValue(new AgentPoolSnapshotResource(Client, originalResponse.Value), originalResponse.GetRawResponse());
- }
- else
- {
- var current = Get(cancellationToken: cancellationToken).Value.Data;
- var patch = new ContainerServiceTagsObject();
- patch.Tags.ReplaceWith(tags);
- var result = Update(patch, cancellationToken: cancellationToken);
- return result;
- }
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Removes a tag by key from the resource.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}
- ///
- /// -
- /// Operation Id
- /// Snapshots_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The key for the tag.
- /// The cancellation token to use.
- /// is null.
- public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNull(key, nameof(key));
-
- using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotResource.RemoveTag");
- scope.Start();
- try
- {
- if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false))
- {
- var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false);
- originalTags.Value.Data.TagValues.Remove(key);
- await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false);
- var originalResponse = await _agentPoolSnapshotSnapshotsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false);
- return Response.FromValue(new AgentPoolSnapshotResource(Client, originalResponse.Value), originalResponse.GetRawResponse());
- }
- else
- {
- var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data;
- var patch = new ContainerServiceTagsObject();
- foreach (var tag in current.Tags)
- {
- patch.Tags.Add(tag);
- }
- patch.Tags.Remove(key);
- var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false);
- return result;
- }
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Removes a tag by key from the resource.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}
- ///
- /// -
- /// Operation Id
- /// Snapshots_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The key for the tag.
- /// The cancellation token to use.
- /// is null.
- public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNull(key, nameof(key));
-
- using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotResource.RemoveTag");
- scope.Start();
- try
- {
- if (CanUseTagResource(cancellationToken: cancellationToken))
- {
- var originalTags = GetTagResource().Get(cancellationToken);
- originalTags.Value.Data.TagValues.Remove(key);
- GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken);
- var originalResponse = _agentPoolSnapshotSnapshotsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken);
- return Response.FromValue(new AgentPoolSnapshotResource(Client, originalResponse.Value), originalResponse.GetRawResponse());
- }
- else
- {
- var current = Get(cancellationToken: cancellationToken).Value.Data;
- var patch = new ContainerServiceTagsObject();
- foreach (var tag in current.Tags)
- {
- patch.Tags.Add(tag);
- }
- patch.Tags.Remove(key);
- var result = Update(patch, cancellationToken: cancellationToken);
- return result;
- }
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
- }
-}
diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileData.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileData.cs
deleted file mode 100644
index f38a54871b37..000000000000
--- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileData.cs
+++ /dev/null
@@ -1,104 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Collections.Generic;
-using Azure.Core;
-using Azure.ResourceManager.ContainerService.Models;
-using Azure.ResourceManager.Models;
-
-namespace Azure.ResourceManager.ContainerService
-{
- ///
- /// A class representing the AgentPoolUpgradeProfile data model.
- /// The list of available upgrades for an agent pool.
- ///
- public partial class AgentPoolUpgradeProfileData : ResourceData
- {
- ///
- /// Keeps track of any properties unknown to the library.
- ///
- /// To assign an object to the value of this property use .
- ///
- ///
- /// To assign an already formatted json string to this property use .
- ///
- ///
- /// Examples:
- ///
- /// -
- /// BinaryData.FromObjectAsJson("foo")
- /// Creates a payload of "foo".
- ///
- /// -
- /// BinaryData.FromString("\"foo\"")
- /// Creates a payload of "foo".
- ///
- /// -
- /// BinaryData.FromObjectAsJson(new { key = "value" })
- /// Creates a payload of { "key": "value" }.
- ///
- /// -
- /// BinaryData.FromString("{\"key\": \"value\"}")
- /// Creates a payload of { "key": "value" }.
- ///
- ///
- ///
- ///
- private IDictionary _serializedAdditionalRawData;
-
- /// Initializes a new instance of .
- /// The Kubernetes version (major.minor.patch).
- /// The operating system type. The default is Linux.
- /// is null.
- internal AgentPoolUpgradeProfileData(string kubernetesVersion, ContainerServiceOSType osType)
- {
- Argument.AssertNotNull(kubernetesVersion, nameof(kubernetesVersion));
-
- KubernetesVersion = kubernetesVersion;
- OSType = osType;
- Upgrades = new ChangeTrackingList();
- }
-
- /// Initializes a new instance of .
- /// The id.
- /// The name.
- /// The resourceType.
- /// The systemData.
- /// The Kubernetes version (major.minor.patch).
- /// The operating system type. The default is Linux.
- /// List of orchestrator types and versions available for upgrade.
- /// The latest AKS supported node image version.
- /// Keeps track of any properties unknown to the library.
- internal AgentPoolUpgradeProfileData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string kubernetesVersion, ContainerServiceOSType osType, IReadOnlyList upgrades, string latestNodeImageVersion, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData)
- {
- KubernetesVersion = kubernetesVersion;
- OSType = osType;
- Upgrades = upgrades;
- LatestNodeImageVersion = latestNodeImageVersion;
- _serializedAdditionalRawData = serializedAdditionalRawData;
- }
-
- /// Initializes a new instance of for deserialization.
- internal AgentPoolUpgradeProfileData()
- {
- }
-
- /// The Kubernetes version (major.minor.patch).
- [WirePath("properties.kubernetesVersion")]
- public string KubernetesVersion { get; }
- /// The operating system type. The default is Linux.
- [WirePath("properties.osType")]
- public ContainerServiceOSType OSType { get; }
- /// List of orchestrator types and versions available for upgrade.
- [WirePath("properties.upgrades")]
- public IReadOnlyList Upgrades { get; }
- /// The latest AKS supported node image version.
- [WirePath("properties.latestNodeImageVersion")]
- public string LatestNodeImageVersion { get; }
- }
-}
diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileResource.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileResource.Serialization.cs
deleted file mode 100644
index 1f850d48dafc..000000000000
--- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileResource.Serialization.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.ClientModel.Primitives;
-using System.Text.Json;
-
-namespace Azure.ResourceManager.ContainerService
-{
- public partial class AgentPoolUpgradeProfileResource : IJsonModel
- {
- void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options);
-
- AgentPoolUpgradeProfileData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options);
-
- BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options);
-
- AgentPoolUpgradeProfileData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options);
-
- string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options);
- }
-}
diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileResource.cs
deleted file mode 100644
index 9c357b37cb3d..000000000000
--- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileResource.cs
+++ /dev/null
@@ -1,171 +0,0 @@
-// 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.Core;
-using Azure.Core.Pipeline;
-
-namespace Azure.ResourceManager.ContainerService
-{
- ///
- /// A Class representing an AgentPoolUpgradeProfile along with the instance operations that can be performed on it.
- /// If you have a you can construct an
- /// from an instance of using the GetAgentPoolUpgradeProfileResource method.
- /// Otherwise you can get one from its parent resource using the GetAgentPoolUpgradeProfile method.
- ///
- public partial class AgentPoolUpgradeProfileResource : ArmResource
- {
- /// Generate the resource identifier of a instance.
- /// The subscriptionId.
- /// The resourceGroupName.
- /// The resourceName.
- /// The agentPoolName.
- public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName)
- {
- var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default";
- return new ResourceIdentifier(resourceId);
- }
-
- private readonly ClientDiagnostics _agentPoolUpgradeProfileAgentPoolsClientDiagnostics;
- private readonly AgentPoolsRestOperations _agentPoolUpgradeProfileAgentPoolsRestClient;
- private readonly AgentPoolUpgradeProfileData _data;
-
- /// Gets the resource type for the operations.
- public static readonly ResourceType ResourceType = "Microsoft.ContainerService/managedClusters/agentPools/upgradeProfiles";
-
- /// Initializes a new instance of the class for mocking.
- protected AgentPoolUpgradeProfileResource()
- {
- }
-
- /// Initializes a new instance of the class.
- /// The client parameters to use in these operations.
- /// The resource that is the target of operations.
- internal AgentPoolUpgradeProfileResource(ArmClient client, AgentPoolUpgradeProfileData 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 AgentPoolUpgradeProfileResource(ArmClient client, ResourceIdentifier id) : base(client, id)
- {
- _agentPoolUpgradeProfileAgentPoolsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ResourceType.Namespace, Diagnostics);
- TryGetApiVersion(ResourceType, out string agentPoolUpgradeProfileAgentPoolsApiVersion);
- _agentPoolUpgradeProfileAgentPoolsRestClient = new AgentPoolsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, agentPoolUpgradeProfileAgentPoolsApiVersion);
-#if DEBUG
- ValidateResourceId(Id);
-#endif
- }
-
- /// 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 AgentPoolUpgradeProfileData 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));
- }
-
- ///
- /// Gets the upgrade profile for an agent pool.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default
- ///
- /// -
- /// Operation Id
- /// AgentPools_GetUpgradeProfile
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The cancellation token to use.
- public virtual async Task> GetAsync(CancellationToken cancellationToken = default)
- {
- using var scope = _agentPoolUpgradeProfileAgentPoolsClientDiagnostics.CreateScope("AgentPoolUpgradeProfileResource.Get");
- scope.Start();
- try
- {
- var response = await _agentPoolUpgradeProfileAgentPoolsRestClient.GetUpgradeProfileAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken).ConfigureAwait(false);
- if (response.Value == null)
- throw new RequestFailedException(response.GetRawResponse());
- return Response.FromValue(new AgentPoolUpgradeProfileResource(Client, response.Value), response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Gets the upgrade profile for an agent pool.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default
- ///
- /// -
- /// Operation Id
- /// AgentPools_GetUpgradeProfile
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The cancellation token to use.
- public virtual Response Get(CancellationToken cancellationToken = default)
- {
- using var scope = _agentPoolUpgradeProfileAgentPoolsClientDiagnostics.CreateScope("AgentPoolUpgradeProfileResource.Get");
- scope.Start();
- try
- {
- var response = _agentPoolUpgradeProfileAgentPoolsRestClient.GetUpgradeProfile(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken);
- if (response.Value == null)
- throw new RequestFailedException(response.GetRawResponse());
- return Response.FromValue(new AgentPoolUpgradeProfileResource(Client, response.Value), response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
- }
-}
diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ArmContainerServiceModelFactory.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ArmContainerServiceModelFactory.cs
index d8ce03a6d98a..e959fb180eba 100644
--- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ArmContainerServiceModelFactory.cs
+++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ArmContainerServiceModelFactory.cs
@@ -8,956 +8,318 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using System.Net;
using Azure.Core;
using Azure.ResourceManager.Models;
-using Azure.ResourceManager.Resources.Models;
namespace Azure.ResourceManager.ContainerService.Models
{
/// Model factory for models.
public static partial class ArmContainerServiceModelFactory
{
- /// Initializes a new instance of .
- /// The id.
- /// The name.
- /// The resourceType.
- /// The systemData.
- /// The list of OS options.
- /// A new instance for mocking.
- public static OSOptionProfileData OSOptionProfileData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IEnumerable osOptionPropertyList = null)
- {
- osOptionPropertyList ??= new List();
-
- return new OSOptionProfileData(
- id,
- name,
- resourceType,
- systemData,
- osOptionPropertyList?.ToList(),
- serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The OS type.
- /// Whether the image is FIPS-enabled.
- /// A new instance for mocking.
- public static ContainerServiceOSOptionProperty ContainerServiceOSOptionProperty(string osType = null, bool enableFipsImage = default)
- {
- return new ContainerServiceOSOptionProperty(osType, enableFipsImage, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// Array of AKS supported Kubernetes versions.
- /// A new instance for mocking.
- public static KubernetesVersionListResult KubernetesVersionListResult(IEnumerable values = null)
- {
- values ??= new List();
-
- return new KubernetesVersionListResult(values?.ToList(), serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// major.minor version of Kubernetes release.
- /// Capabilities on this Kubernetes version.
- /// Whether this version is in preview mode.
- /// Patch versions of Kubernetes release.
- /// A new instance for mocking.
- public static KubernetesVersion KubernetesVersion(string version = null, IEnumerable capabilitiesSupportPlan = null, bool? isPreview = null, IReadOnlyDictionary patchVersions = null)
- {
- capabilitiesSupportPlan ??= new List();
- patchVersions ??= new Dictionary();
-
- return new KubernetesVersion(version, capabilitiesSupportPlan != null ? new KubernetesVersionCapabilities(capabilitiesSupportPlan?.ToList(), serializedAdditionalRawData: null) : null, isPreview, patchVersions, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// Possible upgrade path for given patch version.
- /// A new instance for mocking.
- public static KubernetesPatchVersion KubernetesPatchVersion(IEnumerable upgrades = null)
- {
- upgrades ??= new List();
-
- return new KubernetesPatchVersion(upgrades?.ToList(), serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
+ /// Initializes a new instance of .
/// The id.
/// The name.
/// The resourceType.
/// The systemData.
/// The tags.
/// The location.
- /// The managed cluster SKU.
- /// The extended location of the Virtual Machine.
- /// The identity of the managed cluster, if configured.
- /// The current provisioning state.
- /// The Power State of the cluster.
- /// The max number of agent pools for the managed cluster.
- /// Both patch version <major.minor.patch> (e.g. 1.20.13) and <major.minor> (e.g. 1.20) are supported. When <major.minor> is specified, the latest supported GA patch version is chosen automatically. Updating the cluster with the same <major.minor> once it has been created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. When you upgrade a supported AKS cluster, Kubernetes minor versions cannot be skipped. All upgrades must be performed sequentially by major version number. For example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, however 1.14.x -> 1.16.x is not allowed. See [upgrading an AKS cluster](https://docs.microsoft.com/azure/aks/upgrade-cluster) for more details.
- /// If kubernetesVersion was a fully specified version <major.minor.patch>, this field will be exactly equal to it. If kubernetesVersion was <major.minor>, this field will contain the full <major.minor.patch> version being used.
- /// This cannot be updated once the Managed Cluster has been created.
- /// This cannot be updated once the Managed Cluster has been created.
- /// The FQDN of the master pool.
- /// The FQDN of private cluster.
- /// The Azure Portal requires certain Cross-Origin Resource Sharing (CORS) headers to be sent in some responses, which Kubernetes APIServer doesn't handle by default. This special FQDN supports CORS, allowing the Azure Portal to function properly.
- /// The agent pool properties.
- /// The profile for Linux VMs in the Managed Cluster.
- /// The profile for Windows VMs in the Managed Cluster.
- /// Information about a service principal identity for the cluster to use for manipulating Azure APIs.
- /// The profile of managed cluster add-on.
- /// See [use AAD pod identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity) for more details on AAD pod identity integration.
- /// The OIDC issuer profile of the Managed Cluster.
- /// The name of the resource group containing agent pool nodes.
- /// Whether to enable Kubernetes Role-Based Access Control.
- /// The support plan for the Managed Cluster. If unspecified, the default is 'KubernetesOfficial'.
- /// (DEPRECATED) Whether to enable Kubernetes pod security policy (preview). PodSecurityPolicy was deprecated in Kubernetes v1.21, and removed from Kubernetes in v1.25. Learn more at https://aka.ms/k8s/psp and https://aka.ms/aks/psp.
- /// The network configuration profile.
- /// The Azure Active Directory configuration.
- /// The auto upgrade configuration.
- /// Settings for upgrading a cluster.
- /// Parameters to be applied to the cluster-autoscaler when enabled.
- /// The access profile for managed cluster API server.
- /// This is of the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'.
- /// Identities associated with the cluster.
- /// Private link resources associated with the cluster.
- /// If set to true, getting static credentials will be disabled for this cluster. This must only be used on Managed Clusters that are AAD enabled. For more details see [disable local accounts](https://docs.microsoft.com/azure/aks/managed-aad#disable-local-accounts-preview).
- /// Configurations for provisioning the cluster with HTTP proxy servers.
- /// Security profile for the managed cluster.
- /// Storage profile for the managed cluster.
- /// Allow or deny public network access for AKS.
- /// Workload Auto-scaler profile for the managed cluster.
- /// Azure Monitor addon profiles for monitoring the managed cluster.
- /// Service mesh profile for a managed cluster.
- /// The resourceUID uniquely identifies ManagedClusters that reuse ARM ResourceIds (i.e: create, delete, create sequence).
- /// A new instance for mocking.
- public static ContainerServiceManagedClusterData ContainerServiceManagedClusterData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedClusterSku sku = null, ExtendedLocation extendedLocation = null, ManagedClusterIdentity clusterIdentity = null, string provisioningState = null, ContainerServiceStateCode? powerStateCode = null, int? maxAgentPools = null, string kubernetesVersion = null, string currentKubernetesVersion = null, string dnsPrefix = null, string fqdnSubdomain = null, string fqdn = null, string privateFqdn = null, string azurePortalFqdn = null, IEnumerable agentPoolProfiles = null, ContainerServiceLinuxProfile linuxProfile = null, ManagedClusterWindowsProfile windowsProfile = null, ManagedClusterServicePrincipalProfile servicePrincipalProfile = null, IDictionary addonProfiles = null, ManagedClusterPodIdentityProfile podIdentityProfile = null, ManagedClusterOidcIssuerProfile oidcIssuerProfile = null, string nodeResourceGroup = null, bool? enableRbac = null, KubernetesSupportPlan? supportPlan = null, bool? enablePodSecurityPolicy = null, ContainerServiceNetworkProfile networkProfile = null, ManagedClusterAadProfile aadProfile = null, ManagedClusterAutoUpgradeProfile autoUpgradeProfile = null, UpgradeOverrideSettings upgradeOverrideSettings = null, ManagedClusterAutoScalerProfile autoScalerProfile = null, ManagedClusterApiServerAccessProfile apiServerAccessProfile = null, ResourceIdentifier diskEncryptionSetId = null, IDictionary identityProfile = null, IEnumerable privateLinkResources = null, bool? disableLocalAccounts = null, ManagedClusterHttpProxyConfig httpProxyConfig = null, ManagedClusterSecurityProfile securityProfile = null, ManagedClusterStorageProfile storageProfile = null, ContainerServicePublicNetworkAccess? publicNetworkAccess = null, ManagedClusterWorkloadAutoScalerProfile workloadAutoScalerProfile = null, ManagedClusterMonitorProfileMetrics azureMonitorMetrics = null, ServiceMeshProfile serviceMeshProfile = null, ResourceIdentifier resourceId = null)
+ /// 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.
+ /// Managed identity.
+ /// The status of the last operation.
+ /// The FleetHubProfile configures the Fleet's hub.
+ /// Status information for the fleet.
+ /// A new instance for mocking.
+ public static FleetData FleetData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ETag? etag = null, ResourceManager.Models.ManagedServiceIdentity identity = null, FleetProvisioningState? provisioningState = null, FleetHubProfile hubProfile = null, FleetStatus status = null)
{
tags ??= new Dictionary();
- agentPoolProfiles ??= new List();
- addonProfiles ??= new Dictionary();
- identityProfile ??= new Dictionary();
- privateLinkResources ??= new List();
- return new ContainerServiceManagedClusterData(
+ return new FleetData(
id,
name,
resourceType,
systemData,
tags,
location,
- sku,
- extendedLocation,
- clusterIdentity,
- provisioningState,
- powerStateCode != null ? new ContainerServicePowerState(powerStateCode, serializedAdditionalRawData: null) : null,
- maxAgentPools,
- kubernetesVersion,
- currentKubernetesVersion,
- dnsPrefix,
- fqdnSubdomain,
- fqdn,
- privateFqdn,
- azurePortalFqdn,
- agentPoolProfiles?.ToList(),
- linuxProfile,
- windowsProfile,
- servicePrincipalProfile,
- addonProfiles,
- podIdentityProfile,
- oidcIssuerProfile,
- nodeResourceGroup,
- enableRbac,
- supportPlan,
- enablePodSecurityPolicy,
- networkProfile,
- aadProfile,
- autoUpgradeProfile,
- upgradeOverrideSettings != null ? new ClusterUpgradeSettings(upgradeOverrideSettings, serializedAdditionalRawData: null) : null,
- autoScalerProfile,
- apiServerAccessProfile,
- diskEncryptionSetId,
- identityProfile,
- privateLinkResources?.ToList(),
- disableLocalAccounts,
- httpProxyConfig,
- securityProfile,
- storageProfile,
- publicNetworkAccess,
- workloadAutoScalerProfile,
- azureMonitorMetrics != null ? new ManagedClusterAzureMonitorProfile(azureMonitorMetrics, serializedAdditionalRawData: null) : null,
- serviceMeshProfile,
- resourceId,
- serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1.
- /// VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions.
- /// OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified.
- /// The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os).
- /// Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage.
- /// Determines the type of workload a node can run.
- /// If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}.
- /// If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}.
- /// The maximum number of pods that can run on a node.
- /// The operating system type. The default is Linux.
- /// Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType is Windows.
- /// The maximum number of nodes for auto-scaling.
- /// The minimum number of nodes for auto-scaling.
- /// Whether to enable auto-scaler.
- /// This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete.
- /// The type of Agent Pool.
- /// A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools.
- /// Both patch version <major.minor.patch> (e.g. 1.20.13) and <major.minor> (e.g. 1.20) are supported. When <major.minor> is specified, the latest supported GA patch version is chosen automatically. Updating the cluster with the same <major.minor> once it has been created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool).
- /// If orchestratorVersion is a fully specified version <major.minor.patch>, this field will be exactly equal to it. If orchestratorVersion is <major.minor>, this field will contain the full <major.minor.patch> version being used.
- /// The version of node image.
- /// Settings for upgrading the agentpool.
- /// The current deployment or provisioning state.
- /// When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded.
- /// The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'.
- /// Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). The default is false.
- /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}.
- /// The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'.
- /// This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'.
- /// Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing).
- /// The tags to be persisted on the agent pool virtual machine scale set.
- /// The node labels to be persisted across all nodes in agent pool.
- /// The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule.
- /// The ID for Proximity Placement Group.
- /// The Kubelet configuration on the agent pool nodes.
- /// The OS configuration of Linux agent nodes.
- /// This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption.
- /// Whether to enable UltraSSD.
- /// See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) for more details.
- /// GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU.
- /// CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot.
- /// AKS will associate the specified agent pool with the Capacity Reservation Group.
- /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts).
- /// Network-related settings of an agent pool.
- /// Windows agent pool names must be 6 characters or less.
- /// A new instance for mocking.
- public static ManagedClusterAgentPoolProfile ManagedClusterAgentPoolProfile(int? count = null, string vmSize = null, int? osDiskSizeInGB = null, ContainerServiceOSDiskType? osDiskType = null, KubeletDiskType? kubeletDiskType = null, WorkloadRuntime? workloadRuntime = null, ResourceIdentifier vnetSubnetId = null, ResourceIdentifier podSubnetId = null, int? maxPods = null, ContainerServiceOSType? osType = null, ContainerServiceOSSku? osSku = null, int? maxCount = null, int? minCount = null, bool? enableAutoScaling = null, ScaleDownMode? scaleDownMode = null, AgentPoolType? agentPoolType = null, AgentPoolMode? mode = null, string orchestratorVersion = null, string currentOrchestratorVersion = null, string nodeImageVersion = null, AgentPoolUpgradeSettings upgradeSettings = null, string provisioningState = null, ContainerServiceStateCode? powerStateCode = null, IEnumerable availabilityZones = null, bool? enableNodePublicIP = null, ResourceIdentifier nodePublicIPPrefixId = null, ScaleSetPriority? scaleSetPriority = null, ScaleSetEvictionPolicy? scaleSetEvictionPolicy = null, float? spotMaxPrice = null, IDictionary tags = null, IDictionary nodeLabels = null, IEnumerable nodeTaints = null, ResourceIdentifier proximityPlacementGroupId = null, KubeletConfig kubeletConfig = null, LinuxOSConfig linuxOSConfig = null, bool? enableEncryptionAtHost = null, bool? enableUltraSsd = null, bool? enableFips = null, GpuInstanceProfile? gpuInstanceProfile = null, ResourceIdentifier creationDataSourceResourceId = null, ResourceIdentifier capacityReservationGroupId = null, ResourceIdentifier hostGroupId = null, AgentPoolNetworkProfile networkProfile = null, string name = null)
- {
- availabilityZones ??= new List();
- tags ??= new Dictionary();
- nodeLabels ??= new Dictionary();
- nodeTaints ??= new List();
-
- return new ManagedClusterAgentPoolProfile(
- count,
- vmSize,
- osDiskSizeInGB,
- osDiskType,
- kubeletDiskType,
- workloadRuntime,
- vnetSubnetId,
- podSubnetId,
- maxPods,
- osType,
- osSku,
- maxCount,
- minCount,
- enableAutoScaling,
- scaleDownMode,
- agentPoolType,
- mode,
- orchestratorVersion,
- currentOrchestratorVersion,
- nodeImageVersion,
- upgradeSettings,
- provisioningState,
- powerStateCode != null ? new ContainerServicePowerState(powerStateCode, serializedAdditionalRawData: null) : null,
- availabilityZones?.ToList(),
- enableNodePublicIP,
- nodePublicIPPrefixId,
- scaleSetPriority,
- scaleSetEvictionPolicy,
- spotMaxPrice,
- tags,
- nodeLabels,
- nodeTaints?.ToList(),
- proximityPlacementGroupId,
- kubeletConfig,
- linuxOSConfig,
- enableEncryptionAtHost,
- enableUltraSsd,
- enableFips,
- gpuInstanceProfile,
- creationDataSourceResourceId != null ? new ContainerServiceCreationData(creationDataSourceResourceId, serializedAdditionalRawData: null) : null,
- capacityReservationGroupId,
- hostGroupId,
- networkProfile,
- serializedAdditionalRawData: null,
- name);
- }
-
- /// Initializes a new instance of .
- /// Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1.
- /// VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions.
- /// OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified.
- /// The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os).
- /// Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage.
- /// Determines the type of workload a node can run.
- /// If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}.
- /// If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}.
- /// The maximum number of pods that can run on a node.
- /// The operating system type. The default is Linux.
- /// Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType is Windows.
- /// The maximum number of nodes for auto-scaling.
- /// The minimum number of nodes for auto-scaling.
- /// Whether to enable auto-scaler.
- /// This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete.
- /// The type of Agent Pool.
- /// A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools.
- /// Both patch version <major.minor.patch> (e.g. 1.20.13) and <major.minor> (e.g. 1.20) are supported. When <major.minor> is specified, the latest supported GA patch version is chosen automatically. Updating the cluster with the same <major.minor> once it has been created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool).
- /// If orchestratorVersion is a fully specified version <major.minor.patch>, this field will be exactly equal to it. If orchestratorVersion is <major.minor>, this field will contain the full <major.minor.patch> version being used.
- /// The version of node image.
- /// Settings for upgrading the agentpool.
- /// The current deployment or provisioning state.
- /// When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded.
- /// The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'.
- /// Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). The default is false.
- /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}.
- /// The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'.
- /// This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'.
- /// Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing).
- /// The tags to be persisted on the agent pool virtual machine scale set.
- /// The node labels to be persisted across all nodes in agent pool.
- /// The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule.
- /// The ID for Proximity Placement Group.
- /// The Kubelet configuration on the agent pool nodes.
- /// The OS configuration of Linux agent nodes.
- /// This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption.
- /// Whether to enable UltraSSD.
- /// See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) for more details.
- /// GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU.
- /// CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot.
- /// AKS will associate the specified agent pool with the Capacity Reservation Group.
- /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts).
- /// Network-related settings of an agent pool.
- /// A new instance for mocking.
- public static ManagedClusterAgentPoolProfileProperties ManagedClusterAgentPoolProfileProperties(int? count = null, string vmSize = null, int? osDiskSizeInGB = null, ContainerServiceOSDiskType? osDiskType = null, KubeletDiskType? kubeletDiskType = null, WorkloadRuntime? workloadRuntime = null, ResourceIdentifier vnetSubnetId = null, ResourceIdentifier podSubnetId = null, int? maxPods = null, ContainerServiceOSType? osType = null, ContainerServiceOSSku? osSku = null, int? maxCount = null, int? minCount = null, bool? enableAutoScaling = null, ScaleDownMode? scaleDownMode = null, AgentPoolType? agentPoolType = null, AgentPoolMode? mode = null, string orchestratorVersion = null, string currentOrchestratorVersion = null, string nodeImageVersion = null, AgentPoolUpgradeSettings upgradeSettings = null, string provisioningState = null, ContainerServiceStateCode? powerStateCode = null, IEnumerable availabilityZones = null, bool? enableNodePublicIP = null, ResourceIdentifier nodePublicIPPrefixId = null, ScaleSetPriority? scaleSetPriority = null, ScaleSetEvictionPolicy? scaleSetEvictionPolicy = null, float? spotMaxPrice = null, IDictionary tags = null, IDictionary nodeLabels = null, IEnumerable nodeTaints = null, ResourceIdentifier proximityPlacementGroupId = null, KubeletConfig kubeletConfig = null, LinuxOSConfig linuxOSConfig = null, bool? enableEncryptionAtHost = null, bool? enableUltraSsd = null, bool? enableFips = null, GpuInstanceProfile? gpuInstanceProfile = null, ResourceIdentifier creationDataSourceResourceId = null, ResourceIdentifier capacityReservationGroupId = null, ResourceIdentifier hostGroupId = null, AgentPoolNetworkProfile networkProfile = null)
- {
- availabilityZones ??= new List();
- tags ??= new Dictionary();
- nodeLabels ??= new Dictionary();
- nodeTaints ??= new List();
-
- return new ManagedClusterAgentPoolProfileProperties(
- count,
- vmSize,
- osDiskSizeInGB,
- osDiskType,
- kubeletDiskType,
- workloadRuntime,
- vnetSubnetId,
- podSubnetId,
- maxPods,
- osType,
- osSku,
- maxCount,
- minCount,
- enableAutoScaling,
- scaleDownMode,
- agentPoolType,
- mode,
- orchestratorVersion,
- currentOrchestratorVersion,
- nodeImageVersion,
- upgradeSettings,
- provisioningState,
- powerStateCode != null ? new ContainerServicePowerState(powerStateCode, serializedAdditionalRawData: null) : null,
- availabilityZones?.ToList(),
- enableNodePublicIP,
- nodePublicIPPrefixId,
- scaleSetPriority,
- scaleSetEvictionPolicy,
- spotMaxPrice,
- tags,
- nodeLabels,
- nodeTaints?.ToList(),
- proximityPlacementGroupId,
- kubeletConfig,
- linuxOSConfig,
- enableEncryptionAtHost,
- enableUltraSsd,
- enableFips,
- gpuInstanceProfile,
- creationDataSourceResourceId != null ? new ContainerServiceCreationData(creationDataSourceResourceId, serializedAdditionalRawData: null) : null,
- capacityReservationGroupId,
- hostGroupId,
- networkProfile,
- serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// Whether the add-on is enabled or not.
- /// Key-value pairs for configuring an add-on.
- /// Information of user assigned identity used by this add-on.
- /// A new instance for mocking.
- public static ManagedClusterAddonProfile ManagedClusterAddonProfile(bool isEnabled = default, IDictionary config = null, ManagedClusterAddonProfileIdentity identity = null)
- {
- config ??= new Dictionary();
-
- return new ManagedClusterAddonProfile(isEnabled, config, identity, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The name of the pod identity.
- /// The namespace of the pod identity.
- /// The binding selector to use for the AzureIdentityBinding resource.
- /// The user assigned identity details.
- /// The current provisioning state of the pod identity.
- ///
- /// A new instance for mocking.
- public static ManagedClusterPodIdentity ManagedClusterPodIdentity(string name = null, string @namespace = null, string bindingSelector = null, ContainerServiceUserAssignedIdentity identity = null, ManagedClusterPodIdentityProvisioningState? provisioningState = null, ResponseError errorDetail = null)
- {
- return new ManagedClusterPodIdentity(
- name,
- @namespace,
- bindingSelector,
+ etag,
identity,
provisioningState,
- errorDetail != null ? new ManagedClusterPodIdentityProvisioningInfo(new ManagedClusterPodIdentityProvisioningError(errorDetail, serializedAdditionalRawData: null), serializedAdditionalRawData: null) : null,
- serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The OIDC issuer url of the Managed Cluster.
- /// Whether the OIDC issuer is enabled.
- /// A new instance for mocking.
- public static ManagedClusterOidcIssuerProfile ManagedClusterOidcIssuerProfile(string issuerUriInfo = null, bool? isEnabled = null)
- {
- return new ManagedClusterOidcIssuerProfile(issuerUriInfo, isEnabled, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The ID of the private link resource.
- /// The name of the private link resource.
- /// The resource type.
- /// The group ID of the resource.
- /// The RequiredMembers of the resource.
- /// The private link service ID of the resource, this field is exposed only to NRP internally.
- /// A new instance for mocking.
- public static ContainerServicePrivateLinkResourceData ContainerServicePrivateLinkResourceData(ResourceIdentifier id = null, string name = null, ResourceType? resourceType = null, string groupId = null, IEnumerable requiredMembers = null, ResourceIdentifier privateLinkServiceId = null)
- {
- requiredMembers ??= new List();
-
- return new ContainerServicePrivateLinkResourceData(
- id,
- name,
- resourceType,
- groupId,
- requiredMembers?.ToList(),
- privateLinkServiceId,
+ hubProfile,
+ status,
serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
- /// The id.
- /// The name.
- /// The resourceType.
- /// The systemData.
- /// The list of available upgrade versions for the control plane.
- /// The list of available upgrade versions for agent pools.
- /// A new instance for mocking.
- public static ManagedClusterUpgradeProfileData ManagedClusterUpgradeProfileData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ManagedClusterPoolUpgradeProfile controlPlaneProfile = null, IEnumerable agentPoolProfiles = null)
+ /// Initializes a new instance of .
+ /// 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 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, ApiServerAccessProfile apiServerAccessProfile = null, AgentProfile agentProfile = null, string fqdn = null, string kubernetesVersion = null, string portalFqdn = null)
{
- agentPoolProfiles ??= new List();
-
- return new ManagedClusterUpgradeProfileData(
- id,
- name,
- resourceType,
- systemData,
- controlPlaneProfile,
- agentPoolProfiles?.ToList(),
+ return new FleetHubProfile(
+ dnsPrefix,
+ apiServerAccessProfile,
+ agentProfile,
+ fqdn,
+ kubernetesVersion,
+ portalFqdn,
serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
- /// The Kubernetes version (major.minor.patch).
- /// The Agent Pool name.
- /// The operating system type. The default is Linux.
- /// List of orchestrator types and versions available for upgrade.
- /// A new instance for mocking.
- public static ManagedClusterPoolUpgradeProfile ManagedClusterPoolUpgradeProfile(string kubernetesVersion = null, string name = null, ContainerServiceOSType osType = default, IEnumerable upgrades = null)
+ /// Initializes a new instance of .
+ /// The last operation ID for the fleet.
+ /// The last operation error for the fleet.
+ /// A new instance for mocking.
+ public static FleetStatus FleetStatus(string lastOperationId = null, ResponseError lastOperationError = null)
{
- upgrades ??= new List();
-
- return new ManagedClusterPoolUpgradeProfile(kubernetesVersion, name, osType, upgrades?.ToList(), serializedAdditionalRawData: null);
+ return new FleetStatus(lastOperationId, lastOperationError, serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
- /// The Kubernetes version (major.minor.patch).
- /// Whether the Kubernetes version is currently in preview.
- /// A new instance for mocking.
- public static ManagedClusterPoolUpgradeProfileUpgradesItem ManagedClusterPoolUpgradeProfileUpgradesItem(string kubernetesVersion = null, bool? isPreview = null)
- {
- return new ManagedClusterPoolUpgradeProfileUpgradesItem(kubernetesVersion, isPreview, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
+ /// Initializes a new instance of .
/// The id.
/// The name.
/// The resourceType.
/// The systemData.
- /// The tags.
- /// The location.
- /// Base64-encoded Kubernetes configuration file.
- /// A new instance for mocking.
- public static ManagedClusterAccessProfile ManagedClusterAccessProfile(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, byte[] kubeConfig = null)
- {
- tags ??= new Dictionary();
-
- return new ManagedClusterAccessProfile(
+ /// 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 AutoUpgradeProfile resource.
+ /// The resource id of the UpdateStrategy resource to reference. If not specified, the auto upgrade will run on all clusters which are members of the fleet.
+ /// Configures how auto-upgrade will be run.
+ /// The node image upgrade to be applied to the target clusters in auto upgrade.
+ ///
+ /// If set to False: the auto upgrade has effect - target managed clusters will be upgraded on schedule.
+ /// If set to True: the auto upgrade has no effect - no upgrade will be run on the target managed clusters.
+ /// This is a boolean and not an enum because enabled/disabled are all available states of the auto upgrade profile.
+ /// By default, this is set to False.
+ ///
+ /// A new instance for mocking.
+ public static AutoUpgradeProfileData AutoUpgradeProfileData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ETag? etag = null, AutoUpgradeProfileProvisioningState? provisioningState = null, ResourceIdentifier updateStrategyId = null, UpgradeChannel? channel = null, AutoUpgradeNodeImageSelectionType? selectionType = null, bool? disabled = null)
+ {
+ return new AutoUpgradeProfileData(
id,
name,
resourceType,
systemData,
- tags,
- location,
- kubeConfig,
+ etag,
+ provisioningState,
+ updateStrategyId,
+ channel,
+ selectionType.HasValue ? new AutoUpgradeNodeImageSelection(selectionType.Value, serializedAdditionalRawData: null) : null,
+ disabled,
serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
- /// Base64-encoded Kubernetes configuration file.
- /// A new instance for mocking.
- public static ManagedClusterCredentials ManagedClusterCredentials(IEnumerable kubeconfigs = null)
+ /// Initializes a new instance of .
+ /// Array of base64-encoded Kubernetes configuration files.
+ /// A new instance for mocking.
+ public static FleetCredentialResults FleetCredentialResults(IEnumerable kubeconfigs = null)
{
- kubeconfigs ??= new List();
+ kubeconfigs ??= new List();
- return new ManagedClusterCredentials(kubeconfigs?.ToList(), serializedAdditionalRawData: null);
+ return new FleetCredentialResults(kubeconfigs?.ToList(), serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
+ /// Initializes a new instance of .
/// The name of the credential.
/// Base64-encoded Kubernetes configuration file.
- /// A new instance for mocking.
- public static ManagedClusterCredential ManagedClusterCredential(string name = null, byte[] value = null)
- {
- return new ManagedClusterCredential(name, value, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The id.
- /// The name.
- /// The resourceType.
- /// The systemData.
- /// If two array entries specify the same day of the week, the applied configuration is the union of times in both entries.
- /// Time slots on which upgrade is not allowed.
- /// Maintenance window for the maintenance configuration.
- /// A new instance for mocking.
- public static ContainerServiceMaintenanceConfigurationData ContainerServiceMaintenanceConfigurationData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IEnumerable timesInWeek = null, IEnumerable notAllowedTimes = null, ContainerServiceMaintenanceWindow maintenanceWindow = null)
+ /// A new instance for mocking.
+ public static FleetCredentialResult FleetCredentialResult(string name = null, byte[] value = null)
{
- timesInWeek ??= new List();
- notAllowedTimes ??= new List();
-
- return new ContainerServiceMaintenanceConfigurationData(
- id,
- name,
- resourceType,
- systemData,
- timesInWeek?.ToList(),
- notAllowedTimes?.ToList(),
- maintenanceWindow,
- serializedAdditionalRawData: null);
+ return new FleetCredentialResult(name, value, serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
+ /// Initializes a new instance of .
/// The id.
/// The name.
/// The resourceType.
/// The systemData.
- /// Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1.
- /// VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions.
- /// OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified.
- /// The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os).
- /// Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage.
- /// Determines the type of workload a node can run.
- /// If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}.
- /// If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}.
- /// The maximum number of pods that can run on a node.
- /// The operating system type. The default is Linux.
- /// Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType is Windows.
- /// The maximum number of nodes for auto-scaling.
- /// The minimum number of nodes for auto-scaling.
- /// Whether to enable auto-scaler.
- /// This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete.
- /// The type of Agent Pool.
- /// A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools.
- /// Both patch version <major.minor.patch> (e.g. 1.20.13) and <major.minor> (e.g. 1.20) are supported. When <major.minor> is specified, the latest supported GA patch version is chosen automatically. Updating the cluster with the same <major.minor> once it has been created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool).
- /// If orchestratorVersion is a fully specified version <major.minor.patch>, this field will be exactly equal to it. If orchestratorVersion is <major.minor>, this field will contain the full <major.minor.patch> version being used.
- /// The version of node image.
- /// Settings for upgrading the agentpool.
- /// The current deployment or provisioning state.
- /// When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded.
- /// The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'.
- /// Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). The default is false.
- /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}.
- /// The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'.
- /// This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'.
- /// Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing).
- /// The tags to be persisted on the agent pool virtual machine scale set.
- /// The node labels to be persisted across all nodes in agent pool.
- /// The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule.
- /// The ID for Proximity Placement Group.
- /// The Kubelet configuration on the agent pool nodes.
- /// The OS configuration of Linux agent nodes.
- /// This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption.
- /// Whether to enable UltraSSD.
- /// See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) for more details.
- /// GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU.
- /// CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot.
- /// AKS will associate the specified agent pool with the Capacity Reservation Group.
- /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts).
- /// Network-related settings of an agent pool.
- /// A new instance for mocking.
- public static ContainerServiceAgentPoolData ContainerServiceAgentPoolData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, int? count = null, string vmSize = null, int? osDiskSizeInGB = null, ContainerServiceOSDiskType? osDiskType = null, KubeletDiskType? kubeletDiskType = null, WorkloadRuntime? workloadRuntime = null, ResourceIdentifier vnetSubnetId = null, ResourceIdentifier podSubnetId = null, int? maxPods = null, ContainerServiceOSType? osType = null, ContainerServiceOSSku? osSku = null, int? maxCount = null, int? minCount = null, bool? enableAutoScaling = null, ScaleDownMode? scaleDownMode = null, AgentPoolType? typePropertiesType = null, AgentPoolMode? mode = null, string orchestratorVersion = null, string currentOrchestratorVersion = null, string nodeImageVersion = null, AgentPoolUpgradeSettings upgradeSettings = null, string provisioningState = null, ContainerServiceStateCode? powerStateCode = null, IEnumerable availabilityZones = null, bool? enableNodePublicIP = null, ResourceIdentifier nodePublicIPPrefixId = null, ScaleSetPriority? scaleSetPriority = null, ScaleSetEvictionPolicy? scaleSetEvictionPolicy = null, float? spotMaxPrice = null, IDictionary tags = null, IDictionary nodeLabels = null, IEnumerable nodeTaints = null, ResourceIdentifier proximityPlacementGroupId = null, KubeletConfig kubeletConfig = null, LinuxOSConfig linuxOSConfig = null, bool? enableEncryptionAtHost = null, bool? enableUltraSsd = null, bool? enableFips = null, GpuInstanceProfile? gpuInstanceProfile = null, ResourceIdentifier creationDataSourceResourceId = null, ResourceIdentifier capacityReservationGroupId = null, ResourceIdentifier hostGroupId = null, AgentPoolNetworkProfile networkProfile = null)
- {
- availabilityZones ??= new List();
- tags ??= new Dictionary();
- nodeLabels ??= new Dictionary();
- nodeTaints ??= new List();
-
- return new ContainerServiceAgentPoolData(
+ /// 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 ARM resource id of the cluster that joins the Fleet. Must be a valid Azure resource id. e.g.: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{clusterName}'.
+ /// The group this member belongs to for multi-cluster update management.
+ /// The status of the last operation.
+ /// Status information of the last operation for fleet member.
+ /// The labels for the fleet member.
+ /// A new instance for mocking.
+ public static FleetMemberData FleetMemberData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ETag? etag = null, ResourceIdentifier clusterResourceId = null, string group = null, FleetMemberProvisioningState? provisioningState = null, FleetMemberStatus status = null, IDictionary labels = null)
+ {
+ labels ??= new Dictionary();
+
+ return new FleetMemberData(
id,
name,
resourceType,
systemData,
- count,
- vmSize,
- osDiskSizeInGB,
- osDiskType,
- kubeletDiskType,
- workloadRuntime,
- vnetSubnetId,
- podSubnetId,
- maxPods,
- osType,
- osSku,
- maxCount,
- minCount,
- enableAutoScaling,
- scaleDownMode,
- typePropertiesType,
- mode,
- orchestratorVersion,
- currentOrchestratorVersion,
- nodeImageVersion,
- upgradeSettings,
+ etag,
+ clusterResourceId,
+ group,
provisioningState,
- powerStateCode != null ? new ContainerServicePowerState(powerStateCode, serializedAdditionalRawData: null) : null,
- availabilityZones?.ToList(),
- enableNodePublicIP,
- nodePublicIPPrefixId,
- scaleSetPriority,
- scaleSetEvictionPolicy,
- spotMaxPrice,
- tags,
- nodeLabels,
- nodeTaints?.ToList(),
- proximityPlacementGroupId,
- kubeletConfig,
- linuxOSConfig,
- enableEncryptionAtHost,
- enableUltraSsd,
- enableFips,
- gpuInstanceProfile,
- creationDataSourceResourceId != null ? new ContainerServiceCreationData(creationDataSourceResourceId, serializedAdditionalRawData: null) : null,
- capacityReservationGroupId,
- hostGroupId,
- networkProfile,
- serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The id.
- /// The name.
- /// The resourceType.
- /// The systemData.
- /// The Kubernetes version (major.minor.patch).
- /// The operating system type. The default is Linux.
- /// List of orchestrator types and versions available for upgrade.
- /// The latest AKS supported node image version.
- /// A new instance for mocking.
- public static AgentPoolUpgradeProfileData AgentPoolUpgradeProfileData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string kubernetesVersion = null, ContainerServiceOSType osType = default, IEnumerable upgrades = null, string latestNodeImageVersion = null)
- {
- upgrades ??= new List();
-
- return new AgentPoolUpgradeProfileData(
- id,
- name,
- resourceType,
- systemData,
- kubernetesVersion,
- osType,
- upgrades?.ToList(),
- latestNodeImageVersion,
- serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The Kubernetes version (major.minor.patch).
- /// Whether the Kubernetes version is currently in preview.
- /// A new instance for mocking.
- public static AgentPoolUpgradeProfilePropertiesUpgradesItem AgentPoolUpgradeProfilePropertiesUpgradesItem(string kubernetesVersion = null, bool? isPreview = null)
- {
- return new AgentPoolUpgradeProfilePropertiesUpgradesItem(kubernetesVersion, isPreview, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The id.
- /// The name.
- /// The resourceType.
- /// The systemData.
- /// List of versions available for agent pool.
- /// A new instance for mocking.
- public static AgentPoolAvailableVersions AgentPoolAvailableVersions(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IEnumerable agentPoolVersions = null)
- {
- agentPoolVersions ??= new List();
-
- return new AgentPoolAvailableVersions(
- id,
- name,
- resourceType,
- systemData,
- agentPoolVersions?.ToList(),
+ status,
+ labels,
serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
- /// Whether this version is the default agent pool version.
- /// The Kubernetes version (major.minor.patch).
- /// Whether Kubernetes version is currently in preview.
- /// A new instance for mocking.
- public static AgentPoolAvailableVersion AgentPoolAvailableVersion(bool? isDefault = null, string kubernetesVersion = null, bool? isPreview = null)
+ /// Initializes a new instance of .
+ /// The last operation ID for the fleet member.
+ /// The last operation error of the fleet member.
+ /// A new instance for mocking.
+ public static FleetMemberStatus FleetMemberStatus(string lastOperationId = null, ResponseError lastOperationError = null)
{
- return new AgentPoolAvailableVersion(isDefault, kubernetesVersion, isPreview, serializedAdditionalRawData: null);
+ return new FleetMemberStatus(lastOperationId, lastOperationError, serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
+ /// Initializes a new instance of .
/// The id.
/// The name.
/// The resourceType.
/// The systemData.
- /// The current provisioning state.
- /// The resource of private endpoint.
- /// A collection of information about the state of the connection between service consumer and provider.
- /// A new instance for mocking.
- public static ContainerServicePrivateEndpointConnectionData ContainerServicePrivateEndpointConnectionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ContainerServicePrivateEndpointConnectionProvisioningState? provisioningState = null, ResourceIdentifier privateEndpointId = null, ContainerServicePrivateLinkServiceConnectionState connectionState = null)
- {
- return new ContainerServicePrivateEndpointConnectionData(
+ /// 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.
+ /// The strategy of the UpdateRun can be modified until the run is started.
+ ///
+ /// 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 UpdateRunData UpdateRunData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ETag? etag = null, UpdateRunProvisioningState? provisioningState = null, ResourceIdentifier updateStrategyId = null, IEnumerable strategyStages = null, ManagedClusterUpdate managedClusterUpdate = null, UpdateRunStatus status = null)
+ {
+ strategyStages ??= new List();
+
+ return new UpdateRunData(
id,
name,
resourceType,
systemData,
+ etag,
provisioningState,
- privateEndpointId != null ? ResourceManagerModelFactory.WritableSubResource(privateEndpointId) : null,
- connectionState,
+ updateStrategyId,
+ strategyStages != null ? new UpdateRunStrategy(strategyStages?.ToList(), serializedAdditionalRawData: null) : null,
+ managedClusterUpdate,
+ status,
serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
- /// The command to run.
- /// A base64 encoded zip file containing the files required by the command.
- /// AuthToken issued for AKS AAD Server App.
- /// A new instance for mocking.
- public static ManagedClusterRunCommandContent ManagedClusterRunCommandContent(string command = null, string context = null, string clusterToken = null)
+ /// Initializes a new instance of .
+ /// The image version to upgrade the nodes to (e.g., 'AKSUbuntu-1804gen2containerd-2022.12.13').
+ /// A new instance for mocking.
+ public static NodeImageVersion NodeImageVersion(string version = null)
{
- return new ManagedClusterRunCommandContent(command, context, clusterToken, serializedAdditionalRawData: null);
+ return new NodeImageVersion(version, serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
- /// The command id.
- /// provisioning State.
- /// The exit code of the command.
- /// The time when the command started.
- /// The time when the command finished.
- /// The command output.
- /// An explanation of why provisioningState is set to failed (if so).
- /// A new instance for mocking.
- public static ManagedClusterRunCommandResult ManagedClusterRunCommandResult(string id = null, string provisioningState = null, int? exitCode = null, DateTimeOffset? startedOn = null, DateTimeOffset? finishedOn = null, string logs = null, string reason = null)
+ /// Initializes a new instance of .
+ /// The status of the UpdateRun.
+ /// The stages composing an update run. Stages are run sequentially withing an UpdateRun.
+ /// The node image upgrade specs for the update run. It is only set in update run when `NodeImageSelection.type` is `Consistent`.
+ /// A new instance for mocking.
+ public static UpdateRunStatus UpdateRunStatus(UpdateStatus status = null, IEnumerable stages = null, IEnumerable selectedNodeImageVersions = null)
{
- return new ManagedClusterRunCommandResult(
- id,
- provisioningState,
- exitCode,
- startedOn,
- finishedOn,
- logs,
- reason,
- serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The category of endpoints accessed by the AKS agent node, e.g. azure-resource-management, apiserver, etc.
- /// The endpoints that AKS agent nodes connect to.
- /// A new instance for mocking.
- public static ContainerServiceOutboundEnvironmentEndpoint ContainerServiceOutboundEnvironmentEndpoint(string category = null, IEnumerable endpoints = null)
- {
- endpoints ??= new List();
+ stages ??= new List();
+ selectedNodeImageVersions ??= new List();
- return new ContainerServiceOutboundEnvironmentEndpoint(category, endpoints?.ToList(), serializedAdditionalRawData: null);
+ return new UpdateRunStatus(status, stages?.ToList(), selectedNodeImageVersions != null ? new NodeImageSelectionStatus(selectedNodeImageVersions?.ToList(), serializedAdditionalRawData: null) : null, serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
- /// The domain name of the dependency.
- /// The Ports and Protocols used when connecting to domainName.
- /// A new instance for mocking.
- public static ContainerServiceEndpointDependency ContainerServiceEndpointDependency(string domainName = null, IEnumerable endpointDetails = null)
+ /// Initializes a new instance of .
+ /// The time the operation or group was started.
+ /// The time the operation or group was completed.
+ /// The State of the operation or group.
+ /// The error details when a failure is encountered.
+ /// A new instance for mocking.
+ public static UpdateStatus UpdateStatus(DateTimeOffset? startOn = null, DateTimeOffset? completedOn = null, UpdateState? state = null, ResponseError error = null)
{
- endpointDetails ??= new List();
-
- return new ContainerServiceEndpointDependency(domainName, endpointDetails?.ToList(), serializedAdditionalRawData: null);
+ return new UpdateStatus(startOn, completedOn, state, error, serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
- /// An IP Address that Domain Name currently resolves to.
- /// The port an endpoint is connected to.
- /// The protocol used for connection.
- /// Description of the detail.
- /// A new instance for mocking.
- public static ContainerServiceEndpointDetail ContainerServiceEndpointDetail(IPAddress ipAddress = null, int? port = null, string protocol = null, string description = null)
+ /// Initializes a new instance of .
+ /// The status of the UpdateStage.
+ /// The name of the UpdateStage.
+ /// The list of groups to be updated as part of this UpdateStage.
+ /// The status of the wait period configured on the UpdateStage.
+ /// A new instance for mocking.
+ public static UpdateStageStatus UpdateStageStatus(UpdateStatus status = null, string name = null, IEnumerable groups = null, WaitStatus afterStageWaitStatus = null)
{
- return new ContainerServiceEndpointDetail(ipAddress, port, protocol, description, serializedAdditionalRawData: null);
+ groups ??= new List();
+
+ return new UpdateStageStatus(status, name, groups?.ToList(), afterStageWaitStatus, serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
- /// The id.
- /// The name.
- /// The resourceType.
- /// The systemData.
- /// The tags.
- /// The location.
- /// CreationData to be used to specify the source agent pool resource ID to create this snapshot.
- /// The type of a snapshot. The default is NodePool.
- /// The version of Kubernetes.
- /// The version of node image.
- /// The operating system type. The default is Linux.
- /// Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType is Windows.
- /// The size of the VM.
- /// Whether to use a FIPS-enabled OS.
- /// A new instance for mocking.
- public static AgentPoolSnapshotData AgentPoolSnapshotData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ResourceIdentifier creationDataSourceResourceId = null, SnapshotType? snapshotType = null, string kubernetesVersion = null, string nodeImageVersion = null, ContainerServiceOSType? osType = null, ContainerServiceOSSku? osSku = null, string vmSize = null, bool? enableFips = null)
+ /// Initializes a new instance of .
+ /// The status of the UpdateGroup.
+ /// The name of the UpdateGroup.
+ /// The list of member this UpdateGroup updates.
+ /// A new instance for mocking.
+ public static UpdateGroupStatus UpdateGroupStatus(UpdateStatus status = null, string name = null, IEnumerable members = null)
{
- tags ??= new Dictionary();
+ members ??= new List();
- return new AgentPoolSnapshotData(
- id,
- name,
- resourceType,
- systemData,
- tags,
- location,
- creationDataSourceResourceId != null ? new ContainerServiceCreationData(creationDataSourceResourceId, serializedAdditionalRawData: null) : null,
- snapshotType,
- kubernetesVersion,
- nodeImageVersion,
- osType,
- osSku,
- vmSize,
- enableFips,
- serializedAdditionalRawData: null);
+ return new UpdateGroupStatus(status, name, members?.ToList(), serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
- /// The id.
- /// The name.
- /// The resourceType.
- /// The systemData.
- /// Mesh revision profile properties for a mesh.
- /// A new instance for mocking.
- public static MeshRevisionProfileData MeshRevisionProfileData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IEnumerable meshRevisions = null)
+ /// Initializes a new instance of .
+ /// The status of the MemberUpdate operation.
+ /// The name of the FleetMember.
+ /// The Azure resource id of the target Kubernetes cluster.
+ /// The operation resource id of the latest attempt to perform the operation.
+ /// The status message after processing the member update operation.
+ /// A new instance for mocking.
+ public static MemberUpdateStatus MemberUpdateStatus(UpdateStatus status = null, string name = null, ResourceIdentifier clusterResourceId = null, string operationId = null, string message = null)
{
- meshRevisions ??= new List();
-
- return new MeshRevisionProfileData(
- id,
+ return new MemberUpdateStatus(
+ status,
name,
- resourceType,
- systemData,
- meshRevisions != null ? new MeshRevisionProfileProperties(meshRevisions?.ToList(), serializedAdditionalRawData: null) : null,
+ clusterResourceId,
+ operationId,
+ message,
serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
- /// The id.
- /// The name.
- /// The resourceType.
- /// The systemData.
- /// Mesh upgrade profile properties for a major.minor release.
- /// A new instance for mocking.
- public static MeshUpgradeProfileData MeshUpgradeProfileData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MeshUpgradeProfileProperties properties = null)
+ /// Initializes a new instance of .
+ /// The status of the wait duration.
+ /// The wait duration configured in seconds.
+ /// A new instance for mocking.
+ public static WaitStatus WaitStatus(UpdateStatus status = null, int? waitDurationInSeconds = null)
{
- return new MeshUpgradeProfileData(
- id,
- name,
- resourceType,
- systemData,
- properties,
- serializedAdditionalRawData: null);
+ return new WaitStatus(status, waitDurationInSeconds, serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
+ /// Initializes a new instance of .
/// The id.
/// The name.
/// The resourceType.
/// The systemData.
- /// The current provisioning state of trusted access role binding.
- /// The ARM resource ID of source resource that trusted access is configured for.
- /// A list of roles to bind, each item is a resource type qualified role name. For example: 'Microsoft.MachineLearningServices/workspaces/reader'.
- /// A new instance for mocking.
- public static ContainerServiceTrustedAccessRoleBindingData ContainerServiceTrustedAccessRoleBindingData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ContainerServiceTrustedAccessRoleBindingProvisioningState? provisioningState = null, ResourceIdentifier sourceResourceId = null, IEnumerable roles = null)
+ /// 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)
{
- roles ??= new List();
+ strategyStages ??= new List();
- return new ContainerServiceTrustedAccessRoleBindingData(
+ return new FleetUpdateStrategyData(
id,
name,
resourceType,
systemData,
+ etag,
provisioningState,
- sourceResourceId,
- roles?.ToList(),
- serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// Resource type of Azure resource.
- /// Name of role, name is unique under a source resource type.
- /// List of rules for the role. This maps to 'rules' property of [Kubernetes Cluster Role](https://kubernetes.io/docs/reference/kubernetes-api/authorization-resources/cluster-role-v1/#ClusterRole).
- /// A new instance for mocking.
- public static ContainerServiceTrustedAccessRole ContainerServiceTrustedAccessRole(string sourceResourceType = null, string name = null, IEnumerable rules = null)
- {
- rules ??= new List();
-
- return new ContainerServiceTrustedAccessRole(sourceResourceType, name, rules?.ToList(), serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// List of allowed verbs.
- /// List of allowed apiGroups.
- /// List of allowed resources.
- /// List of allowed names.
- /// List of allowed nonResourceURLs.
- /// A new instance for mocking.
- public static ContainerServiceTrustedAccessRoleRule ContainerServiceTrustedAccessRoleRule(IEnumerable verbs = null, IEnumerable apiGroups = null, IEnumerable resources = null, IEnumerable resourceNames = null, IEnumerable nonResourceUrls = null)
- {
- verbs ??= new List();
- apiGroups ??= new List();
- resources ??= new List();
- resourceNames ??= new List();
- nonResourceUrls ??= new List();
-
- return new ContainerServiceTrustedAccessRoleRule(
- verbs?.ToList(),
- apiGroups?.ToList(),
- resources?.ToList(),
- resourceNames?.ToList(),
- nonResourceUrls?.ToList(),
+ strategyStages != null ? new UpdateRunStrategy(strategyStages?.ToList(), serializedAdditionalRawData: null) : null,
serializedAdditionalRawData: null);
}
}
diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AutoUpgradeProfileCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AutoUpgradeProfileCollection.cs
new file mode 100644
index 000000000000..ca73e9222994
--- /dev/null
+++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AutoUpgradeProfileCollection.cs
@@ -0,0 +1,497 @@
+// 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.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.ResourceManager.ContainerService
+{
+ ///
+ /// A class representing a collection of and their operations.
+ /// Each in the collection will belong to the same instance of .
+ /// To get an instance call the GetAutoUpgradeProfiles method from an instance of .
+ ///
+ public partial class AutoUpgradeProfileCollection : ArmCollection, IEnumerable, IAsyncEnumerable
+ {
+ private readonly ClientDiagnostics _autoUpgradeProfileClientDiagnostics;
+ private readonly AutoUpgradeProfilesRestOperations _autoUpgradeProfileRestClient;
+
+ /// Initializes a new instance of the class for mocking.
+ protected AutoUpgradeProfileCollection()
+ {
+ }
+
+ /// 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 AutoUpgradeProfileCollection(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ _autoUpgradeProfileClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", AutoUpgradeProfileResource.ResourceType.Namespace, Diagnostics);
+ TryGetApiVersion(AutoUpgradeProfileResource.ResourceType, out string autoUpgradeProfileApiVersion);
+ _autoUpgradeProfileRestClient = new AutoUpgradeProfilesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, autoUpgradeProfileApiVersion);
+#if DEBUG
+ ValidateResourceId(Id);
+#endif
+ }
+
+ internal static void ValidateResourceId(ResourceIdentifier id)
+ {
+ if (id.ResourceType != FleetResource.ResourceType)
+ throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, FleetResource.ResourceType), nameof(id));
+ }
+
+ ///
+ /// Create a AutoUpgradeProfile
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/autoUpgradeProfiles/{autoUpgradeProfileName}
+ ///
+ /// -
+ /// Operation Id
+ /// AutoUpgradeProfiles_CreateOrUpdate
+ ///
+ /// -
+ /// Default Api Version
+ /// 2025-03-01
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// 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 AutoUpgradeProfile 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 autoUpgradeProfileName, AutoUpgradeProfileData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(autoUpgradeProfileName, nameof(autoUpgradeProfileName));
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _autoUpgradeProfileClientDiagnostics.CreateScope("AutoUpgradeProfileCollection.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ var response = await _autoUpgradeProfileRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, autoUpgradeProfileName, data, ifMatch, ifNoneMatch, cancellationToken).ConfigureAwait(false);
+ var operation = new ContainerServiceArmOperation(new AutoUpgradeProfileOperationSource(Client), _autoUpgradeProfileClientDiagnostics, Pipeline, _autoUpgradeProfileRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, autoUpgradeProfileName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Create a AutoUpgradeProfile
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/autoUpgradeProfiles/{autoUpgradeProfileName}
+ ///
+ /// -
+ /// Operation Id
+ /// AutoUpgradeProfiles_CreateOrUpdate
+ ///
+ /// -
+ /// Default Api Version
+ /// 2025-03-01
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// 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 AutoUpgradeProfile 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 autoUpgradeProfileName, AutoUpgradeProfileData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(autoUpgradeProfileName, nameof(autoUpgradeProfileName));
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _autoUpgradeProfileClientDiagnostics.CreateScope("AutoUpgradeProfileCollection.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ var response = _autoUpgradeProfileRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, autoUpgradeProfileName, data, ifMatch, ifNoneMatch, cancellationToken);
+ var operation = new ContainerServiceArmOperation(new AutoUpgradeProfileOperationSource(Client), _autoUpgradeProfileClientDiagnostics, Pipeline, _autoUpgradeProfileRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, autoUpgradeProfileName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletion(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a AutoUpgradeProfile
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/autoUpgradeProfiles/{autoUpgradeProfileName}
+ ///
+ /// -
+ /// Operation Id
+ /// AutoUpgradeProfiles_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2025-03-01
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The name of the AutoUpgradeProfile 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 autoUpgradeProfileName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(autoUpgradeProfileName, nameof(autoUpgradeProfileName));
+
+ using var scope = _autoUpgradeProfileClientDiagnostics.CreateScope("AutoUpgradeProfileCollection.Get");
+ scope.Start();
+ try
+ {
+ var response = await _autoUpgradeProfileRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, autoUpgradeProfileName, cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new AutoUpgradeProfileResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a AutoUpgradeProfile
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/autoUpgradeProfiles/{autoUpgradeProfileName}
+ ///
+ /// -
+ /// Operation Id
+ /// AutoUpgradeProfiles_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2025-03-01
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The name of the AutoUpgradeProfile resource.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual Response Get(string autoUpgradeProfileName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(autoUpgradeProfileName, nameof(autoUpgradeProfileName));
+
+ using var scope = _autoUpgradeProfileClientDiagnostics.CreateScope("AutoUpgradeProfileCollection.Get");
+ scope.Start();
+ try
+ {
+ var response = _autoUpgradeProfileRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, autoUpgradeProfileName, cancellationToken);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new AutoUpgradeProfileResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// List AutoUpgradeProfile resources by Fleet
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/autoUpgradeProfiles
+ ///
+ /// -
+ /// Operation Id
+ /// AutoUpgradeProfiles_ListByFleet
+ ///
+ /// -
+ /// Default Api Version
+ /// 2025-03-01
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// 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) => _autoUpgradeProfileRestClient.CreateListByFleetRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _autoUpgradeProfileRestClient.CreateListByFleetNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name);
+ return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AutoUpgradeProfileResource(Client, AutoUpgradeProfileData.DeserializeAutoUpgradeProfileData(e)), _autoUpgradeProfileClientDiagnostics, Pipeline, "AutoUpgradeProfileCollection.GetAll", "value", "nextLink", cancellationToken);
+ }
+
+ ///
+ /// List AutoUpgradeProfile resources by Fleet
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/autoUpgradeProfiles
+ ///
+ /// -
+ /// Operation Id
+ /// AutoUpgradeProfiles_ListByFleet
+ ///
+ /// -
+ /// Default Api Version
+ /// 2025-03-01
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// 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) => _autoUpgradeProfileRestClient.CreateListByFleetRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _autoUpgradeProfileRestClient.CreateListByFleetNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name);
+ return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AutoUpgradeProfileResource(Client, AutoUpgradeProfileData.DeserializeAutoUpgradeProfileData(e)), _autoUpgradeProfileClientDiagnostics, Pipeline, "AutoUpgradeProfileCollection.GetAll", "value", "nextLink", cancellationToken);
+ }
+
+ ///
+ /// Checks to see if the resource exists in azure.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/autoUpgradeProfiles/{autoUpgradeProfileName}
+ ///
+ /// -
+ /// Operation Id
+ /// AutoUpgradeProfiles_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2025-03-01
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The name of the AutoUpgradeProfile 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 autoUpgradeProfileName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(autoUpgradeProfileName, nameof(autoUpgradeProfileName));
+
+ using var scope = _autoUpgradeProfileClientDiagnostics.CreateScope("AutoUpgradeProfileCollection.Exists");
+ scope.Start();
+ try
+ {
+ var response = await _autoUpgradeProfileRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, autoUpgradeProfileName, 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}/autoUpgradeProfiles/{autoUpgradeProfileName}
+ ///
+ /// -
+ /// Operation Id
+ /// AutoUpgradeProfiles_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2025-03-01
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The name of the AutoUpgradeProfile resource.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual Response Exists(string autoUpgradeProfileName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(autoUpgradeProfileName, nameof(autoUpgradeProfileName));
+
+ using var scope = _autoUpgradeProfileClientDiagnostics.CreateScope("AutoUpgradeProfileCollection.Exists");
+ scope.Start();
+ try
+ {
+ var response = _autoUpgradeProfileRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, autoUpgradeProfileName, 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}/autoUpgradeProfiles/{autoUpgradeProfileName}
+ ///
+ /// -
+ /// Operation Id
+ /// AutoUpgradeProfiles_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2025-03-01
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The name of the AutoUpgradeProfile 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 autoUpgradeProfileName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(autoUpgradeProfileName, nameof(autoUpgradeProfileName));
+
+ using var scope = _autoUpgradeProfileClientDiagnostics.CreateScope("AutoUpgradeProfileCollection.GetIfExists");
+ scope.Start();
+ try
+ {
+ var response = await _autoUpgradeProfileRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, autoUpgradeProfileName, cancellationToken: cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ return new NoValueResponse(response.GetRawResponse());
+ return Response.FromValue(new AutoUpgradeProfileResource(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}/autoUpgradeProfiles/{autoUpgradeProfileName}
+ ///
+ /// -
+ /// Operation Id
+ /// AutoUpgradeProfiles_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2025-03-01
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The name of the AutoUpgradeProfile resource.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual NullableResponse GetIfExists(string autoUpgradeProfileName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(autoUpgradeProfileName, nameof(autoUpgradeProfileName));
+
+ using var scope = _autoUpgradeProfileClientDiagnostics.CreateScope("AutoUpgradeProfileCollection.GetIfExists");
+ scope.Start();
+ try
+ {
+ var response = _autoUpgradeProfileRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, autoUpgradeProfileName, cancellationToken: cancellationToken);
+ if (response.Value == null)
+ return new NoValueResponse(response.GetRawResponse());
+ return Response.FromValue(new AutoUpgradeProfileResource(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/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationData.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AutoUpgradeProfileData.Serialization.cs
similarity index 54%
rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationData.Serialization.cs
rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AutoUpgradeProfileData.Serialization.cs
index cde4d80a25cc..4cf6e3dd38e0 100644
--- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationData.Serialization.cs
+++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AutoUpgradeProfileData.Serialization.cs
@@ -8,7 +8,6 @@
using System;
using System.ClientModel.Primitives;
using System.Collections.Generic;
-using System.Linq;
using System.Text;
using System.Text.Json;
using Azure.Core;
@@ -17,11 +16,11 @@
namespace Azure.ResourceManager.ContainerService
{
- public partial class ContainerServiceMaintenanceConfigurationData : IUtf8JsonSerializable, IJsonModel
+ public partial class AutoUpgradeProfileData : IUtf8JsonSerializable, IJsonModel
{
- void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
- void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
{
writer.WriteStartObject();
JsonModelWriteCore(writer, options);
@@ -32,56 +31,61 @@ void IJsonModel.Write(Utf8JsonWrit
/// The client options for reading and writing models.
protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
{
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
if (format != "J")
{
- throw new FormatException($"The model {nameof(ContainerServiceMaintenanceConfigurationData)} does not support writing '{format}' format.");
+ throw new FormatException($"The model {nameof(AutoUpgradeProfileData)} does not support writing '{format}' format.");
}
base.JsonModelWriteCore(writer, options);
+ if (options.Format != "W" && Optional.IsDefined(ETag))
+ {
+ writer.WritePropertyName("eTag"u8);
+ writer.WriteStringValue(ETag.Value.ToString());
+ }
writer.WritePropertyName("properties"u8);
writer.WriteStartObject();
- if (Optional.IsCollectionDefined(TimesInWeek))
+ if (options.Format != "W" && Optional.IsDefined(ProvisioningState))
{
- writer.WritePropertyName("timeInWeek"u8);
- writer.WriteStartArray();
- foreach (var item in TimesInWeek)
- {
- writer.WriteObjectValue(item, options);
- }
- writer.WriteEndArray();
+ writer.WritePropertyName("provisioningState"u8);
+ writer.WriteStringValue(ProvisioningState.Value.ToString());
}
- if (Optional.IsCollectionDefined(NotAllowedTimes))
+ if (Optional.IsDefined(UpdateStrategyId))
{
- writer.WritePropertyName("notAllowedTime"u8);
- writer.WriteStartArray();
- foreach (var item in NotAllowedTimes)
- {
- writer.WriteObjectValue(item, options);
- }
- writer.WriteEndArray();
+ writer.WritePropertyName("updateStrategyId"u8);
+ writer.WriteStringValue(UpdateStrategyId);
+ }
+ if (Optional.IsDefined(Channel))
+ {
+ writer.WritePropertyName("channel"u8);
+ writer.WriteStringValue(Channel.Value.ToString());
}
- if (Optional.IsDefined(MaintenanceWindow))
+ if (Optional.IsDefined(NodeImageSelection))
{
- writer.WritePropertyName("maintenanceWindow"u8);
- writer.WriteObjectValue(MaintenanceWindow, options);
+ writer.WritePropertyName("nodeImageSelection"u8);
+ writer.WriteObjectValue(NodeImageSelection, options);
+ }
+ if (Optional.IsDefined(Disabled))
+ {
+ writer.WritePropertyName("disabled"u8);
+ writer.WriteBooleanValue(Disabled.Value);
}
writer.WriteEndObject();
}
- ContainerServiceMaintenanceConfigurationData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ AutoUpgradeProfileData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
{
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
if (format != "J")
{
- throw new FormatException($"The model {nameof(ContainerServiceMaintenanceConfigurationData)} does not support reading '{format}' format.");
+ throw new FormatException($"The model {nameof(AutoUpgradeProfileData)} does not support reading '{format}' format.");
}
using JsonDocument document = JsonDocument.ParseValue(ref reader);
- return DeserializeContainerServiceMaintenanceConfigurationData(document.RootElement, options);
+ return DeserializeAutoUpgradeProfileData(document.RootElement, options);
}
- internal static ContainerServiceMaintenanceConfigurationData DeserializeContainerServiceMaintenanceConfigurationData(JsonElement element, ModelReaderWriterOptions options = null)
+ internal static AutoUpgradeProfileData DeserializeAutoUpgradeProfileData(JsonElement element, ModelReaderWriterOptions options = null)
{
options ??= ModelSerializationExtensions.WireOptions;
@@ -89,17 +93,29 @@ internal static ContainerServiceMaintenanceConfigurationData DeserializeContaine
{
return null;
}
+ ETag? etag = default;
ResourceIdentifier id = default;
string name = default;
ResourceType type = default;
SystemData systemData = default;
- IList timeInWeek = default;
- IList notAllowedTime = default;
- ContainerServiceMaintenanceWindow maintenanceWindow = default;
+ AutoUpgradeProfileProvisioningState? provisioningState = default;
+ ResourceIdentifier updateStrategyId = default;
+ UpgradeChannel? channel = default;
+ AutoUpgradeNodeImageSelection nodeImageSelection = default;
+ bool? disabled = default;
IDictionary serializedAdditionalRawData = default;
Dictionary rawDataDictionary = new Dictionary();
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());
@@ -133,41 +149,49 @@ internal static ContainerServiceMaintenanceConfigurationData DeserializeContaine
}
foreach (var property0 in property.Value.EnumerateObject())
{
- if (property0.NameEquals("timeInWeek"u8))
+ if (property0.NameEquals("provisioningState"u8))
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
- List array = new List();
- foreach (var item in property0.Value.EnumerateArray())
+ provisioningState = new AutoUpgradeProfileProvisioningState(property0.Value.GetString());
+ continue;
+ }
+ if (property0.NameEquals("updateStrategyId"u8))
+ {
+ if (property0.Value.ValueKind == JsonValueKind.Null)
{
- array.Add(ContainerServiceTimeInWeek.DeserializeContainerServiceTimeInWeek(item, options));
+ continue;
}
- timeInWeek = array;
+ updateStrategyId = new ResourceIdentifier(property0.Value.GetString());
continue;
}
- if (property0.NameEquals("notAllowedTime"u8))
+ if (property0.NameEquals("channel"u8))
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
- List array = new List();
- foreach (var item in property0.Value.EnumerateArray())
+ channel = new UpgradeChannel(property0.Value.GetString());
+ continue;
+ }
+ if (property0.NameEquals("nodeImageSelection"u8))
+ {
+ if (property0.Value.ValueKind == JsonValueKind.Null)
{
- array.Add(ContainerServiceTimeSpan.DeserializeContainerServiceTimeSpan(item, options));
+ continue;
}
- notAllowedTime = array;
+ nodeImageSelection = AutoUpgradeNodeImageSelection.DeserializeAutoUpgradeNodeImageSelection(property0.Value, options);
continue;
}
- if (property0.NameEquals("maintenanceWindow"u8))
+ if (property0.NameEquals("disabled"u8))
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
- maintenanceWindow = ContainerServiceMaintenanceWindow.DeserializeContainerServiceMaintenanceWindow(property0.Value, options);
+ disabled = property0.Value.GetBoolean();
continue;
}
}
@@ -179,14 +203,17 @@ internal static ContainerServiceMaintenanceConfigurationData DeserializeContaine
}
}
serializedAdditionalRawData = rawDataDictionary;
- return new ContainerServiceMaintenanceConfigurationData(
+ return new AutoUpgradeProfileData(
id,
name,
type,
systemData,
- timeInWeek ?? new ChangeTrackingList(),
- notAllowedTime ?? new ChangeTrackingList(),
- maintenanceWindow,
+ etag,
+ provisioningState,
+ updateStrategyId,
+ channel,
+ nodeImageSelection,
+ disabled,
serializedAdditionalRawData);
}
@@ -224,6 +251,21 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options)
}
}
+ hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ETag), out propertyOverride);
+ if (hasPropertyOverride)
+ {
+ builder.Append(" eTag: ");
+ builder.AppendLine(propertyOverride);
+ }
+ else
+ {
+ if (Optional.IsDefined(ETag))
+ {
+ builder.Append(" eTag: ");
+ builder.AppendLine($"'{ETag.Value.ToString()}'");
+ }
+ }
+
hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride);
if (hasPropertyOverride)
{
@@ -256,64 +298,84 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options)
builder.Append(" properties:");
builder.AppendLine(" {");
- hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TimesInWeek), out propertyOverride);
+ hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride);
if (hasPropertyOverride)
{
- builder.Append(" timeInWeek: ");
+ builder.Append(" provisioningState: ");
builder.AppendLine(propertyOverride);
}
else
{
- if (Optional.IsCollectionDefined(TimesInWeek))
+ if (Optional.IsDefined(ProvisioningState))
{
- if (TimesInWeek.Any())
- {
- builder.Append(" timeInWeek: ");
- builder.AppendLine("[");
- foreach (var item in TimesInWeek)
- {
- BicepSerializationHelpers.AppendChildObject(builder, item, options, 6, true, " timeInWeek: ");
- }
- builder.AppendLine(" ]");
- }
+ builder.Append(" provisioningState: ");
+ builder.AppendLine($"'{ProvisioningState.Value.ToString()}'");
}
}
- hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NotAllowedTimes), out propertyOverride);
+ hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(UpdateStrategyId), out propertyOverride);
if (hasPropertyOverride)
{
- builder.Append(" notAllowedTime: ");
+ builder.Append(" updateStrategyId: ");
builder.AppendLine(propertyOverride);
}
else
{
- if (Optional.IsCollectionDefined(NotAllowedTimes))
+ if (Optional.IsDefined(UpdateStrategyId))
{
- if (NotAllowedTimes.Any())
- {
- builder.Append(" notAllowedTime: ");
- builder.AppendLine("[");
- foreach (var item in NotAllowedTimes)
- {
- BicepSerializationHelpers.AppendChildObject(builder, item, options, 6, true, " notAllowedTime: ");
- }
- builder.AppendLine(" ]");
- }
+ builder.Append(" updateStrategyId: ");
+ builder.AppendLine($"'{UpdateStrategyId.ToString()}'");
+ }
+ }
+
+ hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Channel), out propertyOverride);
+ if (hasPropertyOverride)
+ {
+ builder.Append(" channel: ");
+ builder.AppendLine(propertyOverride);
+ }
+ else
+ {
+ if (Optional.IsDefined(Channel))
+ {
+ builder.Append(" channel: ");
+ builder.AppendLine($"'{Channel.Value.ToString()}'");
+ }
+ }
+
+ hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("SelectionType", out propertyOverride);
+ if (hasPropertyOverride)
+ {
+ builder.Append(" nodeImageSelection: ");
+ builder.AppendLine("{");
+ builder.AppendLine(" nodeImageSelection: {");
+ builder.Append(" type: ");
+ builder.AppendLine(propertyOverride);
+ builder.AppendLine(" }");
+ builder.AppendLine(" }");
+ }
+ else
+ {
+ if (Optional.IsDefined(NodeImageSelection))
+ {
+ builder.Append(" nodeImageSelection: ");
+ BicepSerializationHelpers.AppendChildObject(builder, NodeImageSelection, options, 4, false, " nodeImageSelection: ");
}
}
- hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MaintenanceWindow), out propertyOverride);
+ hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Disabled), out propertyOverride);
if (hasPropertyOverride)
{
- builder.Append(" maintenanceWindow: ");
+ builder.Append(" disabled: ");
builder.AppendLine(propertyOverride);
}
else
{
- if (Optional.IsDefined(MaintenanceWindow))
+ if (Optional.IsDefined(Disabled))
{
- builder.Append(" maintenanceWindow: ");
- BicepSerializationHelpers.AppendChildObject(builder, MaintenanceWindow, options, 4, false, " maintenanceWindow: ");
+ builder.Append(" disabled: ");
+ var boolValue = Disabled.Value == true ? "true" : "false";
+ builder.AppendLine($"{boolValue}");
}
}
@@ -322,9 +384,9 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options)
return BinaryData.FromString(builder.ToString());
}
- BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
{
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
switch (format)
{
@@ -333,26 +395,26 @@ BinaryData IPersistableModel.Write
case "bicep":
return SerializeBicep(options);
default:
- throw new FormatException($"The model {nameof(ContainerServiceMaintenanceConfigurationData)} does not support writing '{options.Format}' format.");
+ throw new FormatException($"The model {nameof(AutoUpgradeProfileData)} does not support writing '{options.Format}' format.");
}
}
- ContainerServiceMaintenanceConfigurationData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ AutoUpgradeProfileData IPersistableModel