diff --git a/sdk/communication/Azure.Communication.JobRouter/tsp-location.yaml b/sdk/communication/Azure.Communication.JobRouter/tsp-location.yaml
index 4076cbb60368..25b3b9cefb98 100644
--- a/sdk/communication/Azure.Communication.JobRouter/tsp-location.yaml
+++ b/sdk/communication/Azure.Communication.JobRouter/tsp-location.yaml
@@ -1,5 +1,4 @@
-commit: 6a4cd586934a8478cc84c677afc49c4f149f8d87
directory: specification/communication/Communication.JobRouter
-additionalDirectories: []
-repo: Azure/azure-rest-api-specs
-
+commit: 7594b7d0821b951429204ec732c6916d27ae5fdc
+repo: test-repo-billy/azure-rest-api-specs
+additionalDirectories:
diff --git a/sdk/communication/Azure.Communication.Messages/tsp-location.yaml b/sdk/communication/Azure.Communication.Messages/tsp-location.yaml
index 01b9db9a86ed..49a42feecf85 100644
--- a/sdk/communication/Azure.Communication.Messages/tsp-location.yaml
+++ b/sdk/communication/Azure.Communication.Messages/tsp-location.yaml
@@ -1,4 +1,4 @@
-commit: b8ec3841224e5a9a27c128e588b1c387baef6a99
directory: specification/communication/Communication.Messages
-additionalDirectories: []
-repo: Azure/azure-rest-api-specs
+commit: 7594b7d0821b951429204ec732c6916d27ae5fdc
+repo: test-repo-billy/azure-rest-api-specs
+additionalDirectories:
diff --git a/sdk/confidentialledger/Azure.Security.CodeTransparency/tsp-location.yaml b/sdk/confidentialledger/Azure.Security.CodeTransparency/tsp-location.yaml
index bfe49dde41ae..c4f918b8ba21 100644
--- a/sdk/confidentialledger/Azure.Security.CodeTransparency/tsp-location.yaml
+++ b/sdk/confidentialledger/Azure.Security.CodeTransparency/tsp-location.yaml
@@ -1,5 +1,4 @@
-commit: 54cc502c020371277427a5e518b83fccb52452f5
-repo: Azure/azure-rest-api-specs
directory: specification/confidentialledger/Microsoft.CodeTransparency
-additionalDirectories: []
-
+commit: 7594b7d0821b951429204ec732c6916d27ae5fdc
+repo: test-repo-billy/azure-rest-api-specs
+additionalDirectories:
diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_AgentPoolSnapshotResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_AgentPoolSnapshotResource.cs
deleted file mode 100644
index 85da91d3b4d9..000000000000
--- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_AgentPoolSnapshotResource.cs
+++ /dev/null
@@ -1,148 +0,0 @@
-// 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;
-
-namespace Azure.ResourceManager.ContainerService.Samples
-{
- public partial class Sample_AgentPoolSnapshotResource
- {
- // List Snapshots
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- 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");
- }
-
- // Get Snapshot
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Get_GetSnapshot()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/SnapshotsGet.json
- // this example is just showing the usage of "Snapshots_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 AgentPoolSnapshotResource created on azure
- // for more information of creating AgentPoolSnapshotResource, please refer to the document of AgentPoolSnapshotResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "snapshot1";
- ResourceIdentifier agentPoolSnapshotResourceId = AgentPoolSnapshotResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- AgentPoolSnapshotResource agentPoolSnapshot = client.GetAgentPoolSnapshotResource(agentPoolSnapshotResourceId);
-
- // invoke the operation
- AgentPoolSnapshotResource result = await agentPoolSnapshot.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
- AgentPoolSnapshotData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Update Snapshot Tags
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Update_UpdateSnapshotTags()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/SnapshotsUpdateTags.json
- // this example is just showing the usage of "Snapshots_UpdateTags" 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 AgentPoolSnapshotResource created on azure
- // for more information of creating AgentPoolSnapshotResource, please refer to the document of AgentPoolSnapshotResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "snapshot1";
- ResourceIdentifier agentPoolSnapshotResourceId = AgentPoolSnapshotResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- AgentPoolSnapshotResource agentPoolSnapshot = client.GetAgentPoolSnapshotResource(agentPoolSnapshotResourceId);
-
- // invoke the operation
- ContainerServiceTagsObject containerServiceTagsObject = new ContainerServiceTagsObject()
- {
- Tags =
-{
-["key2"] = "new-val2",
-["key3"] = "val3",
-},
- };
- AgentPoolSnapshotResource result = await agentPoolSnapshot.UpdateAsync(containerServiceTagsObject);
-
- // 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
- AgentPoolSnapshotData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Delete Snapshot
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Delete_DeleteSnapshot()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/SnapshotsDelete.json
- // this example is just showing the usage of "Snapshots_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 AgentPoolSnapshotResource created on azure
- // for more information of creating AgentPoolSnapshotResource, please refer to the document of AgentPoolSnapshotResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "snapshot1";
- ResourceIdentifier agentPoolSnapshotResourceId = AgentPoolSnapshotResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- AgentPoolSnapshotResource agentPoolSnapshot = client.GetAgentPoolSnapshotResource(agentPoolSnapshotResourceId);
-
- // invoke the operation
- await agentPoolSnapshot.DeleteAsync(WaitUntil.Completed);
-
- Console.WriteLine($"Succeeded");
- }
- }
-}
diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_AgentPoolUpgradeProfileResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_AgentPoolUpgradeProfileResource.cs
deleted file mode 100644
index 51a85ec9943c..000000000000
--- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_AgentPoolUpgradeProfileResource.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-// 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;
-
-namespace Azure.ResourceManager.ContainerService.Samples
-{
- public partial class Sample_AgentPoolUpgradeProfileResource
- {
- // Get Upgrade Profile for Agent Pool
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Get_GetUpgradeProfileForAgentPool()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsGetUpgradeProfile.json
- // this example is just showing the usage of "AgentPools_GetUpgradeProfile" 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 AgentPoolUpgradeProfileResource created on azure
- // for more information of creating AgentPoolUpgradeProfileResource, please refer to the document of AgentPoolUpgradeProfileResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- string agentPoolName = "agentpool1";
- ResourceIdentifier agentPoolUpgradeProfileResourceId = AgentPoolUpgradeProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName);
- AgentPoolUpgradeProfileResource agentPoolUpgradeProfile = client.GetAgentPoolUpgradeProfileResource(agentPoolUpgradeProfileResourceId);
-
- // invoke the operation
- AgentPoolUpgradeProfileResource result = await agentPoolUpgradeProfile.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
- AgentPoolUpgradeProfileData 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_ContainerServiceAgentPoolCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceAgentPoolCollection.cs
deleted file mode 100644
index 7b21e704d8cc..000000000000
--- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceAgentPoolCollection.cs
+++ /dev/null
@@ -1,1067 +0,0 @@
-// 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;
-
-namespace Azure.ResourceManager.ContainerService.Samples
-{
- public partial class Sample_ContainerServiceAgentPoolCollection
- {
- // List Agent Pools by Managed Cluster
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task GetAll_ListAgentPoolsByManagedCluster()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsList.json
- // this example is just showing the usage of "AgentPools_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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // get the collection of this ContainerServiceAgentPoolResource
- ContainerServiceAgentPoolCollection collection = containerServiceManagedCluster.GetContainerServiceAgentPools();
-
- // invoke the operation and iterate over the result
- await foreach (ContainerServiceAgentPoolResource 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
- ContainerServiceAgentPoolData resourceData = item.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- Console.WriteLine($"Succeeded");
- }
-
- // Get Agent Pool
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Get_GetAgentPool()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsGet.json
- // this example is just showing the usage of "AgentPools_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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // get the collection of this ContainerServiceAgentPoolResource
- ContainerServiceAgentPoolCollection collection = containerServiceManagedCluster.GetContainerServiceAgentPools();
-
- // invoke the operation
- string agentPoolName = "agentpool1";
- ContainerServiceAgentPoolResource result = await collection.GetAsync(agentPoolName);
-
- // 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
- ContainerServiceAgentPoolData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Get Agent Pool
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Exists_GetAgentPool()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsGet.json
- // this example is just showing the usage of "AgentPools_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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // get the collection of this ContainerServiceAgentPoolResource
- ContainerServiceAgentPoolCollection collection = containerServiceManagedCluster.GetContainerServiceAgentPools();
-
- // invoke the operation
- string agentPoolName = "agentpool1";
- bool result = await collection.ExistsAsync(agentPoolName);
-
- Console.WriteLine($"Succeeded: {result}");
- }
-
- // Get Agent Pool
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task GetIfExists_GetAgentPool()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsGet.json
- // this example is just showing the usage of "AgentPools_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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // get the collection of this ContainerServiceAgentPoolResource
- ContainerServiceAgentPoolCollection collection = containerServiceManagedCluster.GetContainerServiceAgentPools();
-
- // invoke the operation
- string agentPoolName = "agentpool1";
- NullableResponse response = await collection.GetIfExistsAsync(agentPoolName);
- ContainerServiceAgentPoolResource 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
- ContainerServiceAgentPoolData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
- }
-
- // Create Agent Pool using an agent pool snapshot
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task CreateOrUpdate_CreateAgentPoolUsingAnAgentPoolSnapshot()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_Snapshot.json
- // this example is just showing the usage of "AgentPools_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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // get the collection of this ContainerServiceAgentPoolResource
- ContainerServiceAgentPoolCollection collection = containerServiceManagedCluster.GetContainerServiceAgentPools();
-
- // invoke the operation
- string agentPoolName = "agentpool1";
- ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData()
- {
- Count = 3,
- VmSize = "Standard_DS2_v2",
- OSType = ContainerServiceOSType.Linux,
- OrchestratorVersion = "",
- EnableFips = true,
- CreationDataSourceResourceId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1"),
- };
- ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, agentPoolName, data);
- ContainerServiceAgentPoolResource 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
- ContainerServiceAgentPoolData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create Agent Pool with Capacity Reservation Group
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task CreateOrUpdate_CreateAgentPoolWithCapacityReservationGroup()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_CRG.json
- // this example is just showing the usage of "AgentPools_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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // get the collection of this ContainerServiceAgentPoolResource
- ContainerServiceAgentPoolCollection collection = containerServiceManagedCluster.GetContainerServiceAgentPools();
-
- // invoke the operation
- string agentPoolName = "agentpool1";
- ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData()
- {
- Count = 3,
- VmSize = "Standard_DS2_v2",
- OSType = ContainerServiceOSType.Linux,
- OrchestratorVersion = "",
- CapacityReservationGroupId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/CapacityReservationGroups/crg1"),
- };
- ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, agentPoolName, data);
- ContainerServiceAgentPoolResource 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
- ContainerServiceAgentPoolData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create Agent Pool with Dedicated Host Group
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task CreateOrUpdate_CreateAgentPoolWithDedicatedHostGroup()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_DedicatedHostGroup.json
- // this example is just showing the usage of "AgentPools_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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // get the collection of this ContainerServiceAgentPoolResource
- ContainerServiceAgentPoolCollection collection = containerServiceManagedCluster.GetContainerServiceAgentPools();
-
- // invoke the operation
- string agentPoolName = "agentpool1";
- ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData()
- {
- Count = 3,
- VmSize = "Standard_DS2_v2",
- OSType = ContainerServiceOSType.Linux,
- OrchestratorVersion = "",
- HostGroupId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1"),
- };
- ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, agentPoolName, data);
- ContainerServiceAgentPoolResource 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
- ContainerServiceAgentPoolData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create Agent Pool with EncryptionAtHost enabled
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task CreateOrUpdate_CreateAgentPoolWithEncryptionAtHostEnabled()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_EnableEncryptionAtHost.json
- // this example is just showing the usage of "AgentPools_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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // get the collection of this ContainerServiceAgentPoolResource
- ContainerServiceAgentPoolCollection collection = containerServiceManagedCluster.GetContainerServiceAgentPools();
-
- // invoke the operation
- string agentPoolName = "agentpool1";
- ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData()
- {
- Count = 3,
- VmSize = "Standard_DS2_v2",
- OSType = ContainerServiceOSType.Linux,
- OrchestratorVersion = "",
- EnableEncryptionAtHost = true,
- };
- ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, agentPoolName, data);
- ContainerServiceAgentPoolResource 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
- ContainerServiceAgentPoolData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create Agent Pool with Ephemeral OS Disk
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task CreateOrUpdate_CreateAgentPoolWithEphemeralOSDisk()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_Ephemeral.json
- // this example is just showing the usage of "AgentPools_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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // get the collection of this ContainerServiceAgentPoolResource
- ContainerServiceAgentPoolCollection collection = containerServiceManagedCluster.GetContainerServiceAgentPools();
-
- // invoke the operation
- string agentPoolName = "agentpool1";
- ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData()
- {
- Count = 3,
- VmSize = "Standard_DS2_v2",
- OSDiskSizeInGB = 64,
- OSDiskType = ContainerServiceOSDiskType.Ephemeral,
- OSType = ContainerServiceOSType.Linux,
- OrchestratorVersion = "",
- };
- ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, agentPoolName, data);
- ContainerServiceAgentPoolResource 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
- ContainerServiceAgentPoolData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create Agent Pool with FIPS enabled OS
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task CreateOrUpdate_CreateAgentPoolWithFIPSEnabledOS()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_EnableFIPS.json
- // this example is just showing the usage of "AgentPools_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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // get the collection of this ContainerServiceAgentPoolResource
- ContainerServiceAgentPoolCollection collection = containerServiceManagedCluster.GetContainerServiceAgentPools();
-
- // invoke the operation
- string agentPoolName = "agentpool1";
- ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData()
- {
- Count = 3,
- VmSize = "Standard_DS2_v2",
- OSType = ContainerServiceOSType.Linux,
- OrchestratorVersion = "",
- EnableFips = true,
- };
- ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, agentPoolName, data);
- ContainerServiceAgentPoolResource 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
- ContainerServiceAgentPoolData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create Agent Pool with GPUMIG
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task CreateOrUpdate_CreateAgentPoolWithGPUMIG()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_GPUMIG.json
- // this example is just showing the usage of "AgentPools_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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // get the collection of this ContainerServiceAgentPoolResource
- ContainerServiceAgentPoolCollection collection = containerServiceManagedCluster.GetContainerServiceAgentPools();
-
- // invoke the operation
- string agentPoolName = "agentpool1";
- ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData()
- {
- Count = 3,
- VmSize = "Standard_ND96asr_v4",
- OSType = ContainerServiceOSType.Linux,
- OrchestratorVersion = "",
- KubeletConfig = new KubeletConfig()
- {
- CpuManagerPolicy = "static",
- IsCpuCfsQuotaEnabled = true,
- CpuCfsQuotaPeriod = "200ms",
- ImageGcHighThreshold = 90,
- ImageGcLowThreshold = 70,
- TopologyManagerPolicy = "best-effort",
- AllowedUnsafeSysctls =
-{
-"kernel.msg*","net.core.somaxconn"
-},
- FailStartWithSwapOn = false,
- },
- LinuxOSConfig = new LinuxOSConfig()
- {
- Sysctls = new SysctlConfig()
- {
- NetCoreWmemDefault = 12345,
- NetIPv4TcpTwReuse = true,
- NetIPv4IPLocalPortRange = "20000 60000",
- KernelThreadsMax = 99999,
- },
- TransparentHugePageEnabled = "always",
- TransparentHugePageDefrag = "madvise",
- SwapFileSizeInMB = 1500,
- },
- GpuInstanceProfile = GpuInstanceProfile.Mig2G,
- };
- ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, agentPoolName, data);
- ContainerServiceAgentPoolResource 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
- ContainerServiceAgentPoolData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create Agent Pool with Krustlet and the WASI runtime
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task CreateOrUpdate_CreateAgentPoolWithKrustletAndTheWASIRuntime()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_WasmWasi.json
- // this example is just showing the usage of "AgentPools_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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // get the collection of this ContainerServiceAgentPoolResource
- ContainerServiceAgentPoolCollection collection = containerServiceManagedCluster.GetContainerServiceAgentPools();
-
- // invoke the operation
- string agentPoolName = "agentpool1";
- ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData()
- {
- Count = 3,
- VmSize = "Standard_DS2_v2",
- OSDiskSizeInGB = 64,
- WorkloadRuntime = WorkloadRuntime.WasmWasi,
- OSType = ContainerServiceOSType.Linux,
- Mode = AgentPoolMode.User,
- OrchestratorVersion = "",
- };
- ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, agentPoolName, data);
- ContainerServiceAgentPoolResource 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
- ContainerServiceAgentPoolData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create Agent Pool with KubeletConfig and LinuxOSConfig
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task CreateOrUpdate_CreateAgentPoolWithKubeletConfigAndLinuxOSConfig()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_CustomNodeConfig.json
- // this example is just showing the usage of "AgentPools_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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // get the collection of this ContainerServiceAgentPoolResource
- ContainerServiceAgentPoolCollection collection = containerServiceManagedCluster.GetContainerServiceAgentPools();
-
- // invoke the operation
- string agentPoolName = "agentpool1";
- ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData()
- {
- Count = 3,
- VmSize = "Standard_DS2_v2",
- OSType = ContainerServiceOSType.Linux,
- OrchestratorVersion = "",
- KubeletConfig = new KubeletConfig()
- {
- CpuManagerPolicy = "static",
- IsCpuCfsQuotaEnabled = true,
- CpuCfsQuotaPeriod = "200ms",
- ImageGcHighThreshold = 90,
- ImageGcLowThreshold = 70,
- TopologyManagerPolicy = "best-effort",
- AllowedUnsafeSysctls =
-{
-"kernel.msg*","net.core.somaxconn"
-},
- FailStartWithSwapOn = false,
- },
- LinuxOSConfig = new LinuxOSConfig()
- {
- Sysctls = new SysctlConfig()
- {
- NetCoreWmemDefault = 12345,
- NetIPv4TcpTwReuse = true,
- NetIPv4IPLocalPortRange = "20000 60000",
- KernelThreadsMax = 99999,
- },
- TransparentHugePageEnabled = "always",
- TransparentHugePageDefrag = "madvise",
- SwapFileSizeInMB = 1500,
- },
- };
- ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, agentPoolName, data);
- ContainerServiceAgentPoolResource 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
- ContainerServiceAgentPoolData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create Agent Pool with OSSKU
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task CreateOrUpdate_CreateAgentPoolWithOSSKU()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_OSSKU.json
- // this example is just showing the usage of "AgentPools_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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // get the collection of this ContainerServiceAgentPoolResource
- ContainerServiceAgentPoolCollection collection = containerServiceManagedCluster.GetContainerServiceAgentPools();
-
- // invoke the operation
- string agentPoolName = "agentpool1";
- ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData()
- {
- Count = 3,
- VmSize = "Standard_DS2_v2",
- OSType = ContainerServiceOSType.Linux,
- OSSku = ContainerServiceOSSku.AzureLinux,
- OrchestratorVersion = "",
- KubeletConfig = new KubeletConfig()
- {
- CpuManagerPolicy = "static",
- IsCpuCfsQuotaEnabled = true,
- CpuCfsQuotaPeriod = "200ms",
- ImageGcHighThreshold = 90,
- ImageGcLowThreshold = 70,
- TopologyManagerPolicy = "best-effort",
- AllowedUnsafeSysctls =
-{
-"kernel.msg*","net.core.somaxconn"
-},
- FailStartWithSwapOn = false,
- },
- LinuxOSConfig = new LinuxOSConfig()
- {
- Sysctls = new SysctlConfig()
- {
- NetCoreWmemDefault = 12345,
- NetIPv4TcpTwReuse = true,
- NetIPv4IPLocalPortRange = "20000 60000",
- KernelThreadsMax = 99999,
- },
- TransparentHugePageEnabled = "always",
- TransparentHugePageDefrag = "madvise",
- SwapFileSizeInMB = 1500,
- },
- };
- ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, agentPoolName, data);
- ContainerServiceAgentPoolResource 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
- ContainerServiceAgentPoolData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create Agent Pool with PPG
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task CreateOrUpdate_CreateAgentPoolWithPPG()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_PPG.json
- // this example is just showing the usage of "AgentPools_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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // get the collection of this ContainerServiceAgentPoolResource
- ContainerServiceAgentPoolCollection collection = containerServiceManagedCluster.GetContainerServiceAgentPools();
-
- // invoke the operation
- string agentPoolName = "agentpool1";
- ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData()
- {
- Count = 3,
- VmSize = "Standard_DS2_v2",
- OSType = ContainerServiceOSType.Linux,
- OrchestratorVersion = "",
- ProximityPlacementGroupId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"),
- };
- ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, agentPoolName, data);
- ContainerServiceAgentPoolResource 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
- ContainerServiceAgentPoolData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create Agent Pool with UltraSSD enabled
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task CreateOrUpdate_CreateAgentPoolWithUltraSSDEnabled()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_EnableUltraSSD.json
- // this example is just showing the usage of "AgentPools_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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // get the collection of this ContainerServiceAgentPoolResource
- ContainerServiceAgentPoolCollection collection = containerServiceManagedCluster.GetContainerServiceAgentPools();
-
- // invoke the operation
- string agentPoolName = "agentpool1";
- ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData()
- {
- Count = 3,
- VmSize = "Standard_DS2_v2",
- OSType = ContainerServiceOSType.Linux,
- OrchestratorVersion = "",
- EnableUltraSsd = true,
- };
- ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, agentPoolName, data);
- ContainerServiceAgentPoolResource 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
- ContainerServiceAgentPoolData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create Agent Pool with Windows OSSKU
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task CreateOrUpdate_CreateAgentPoolWithWindowsOSSKU()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_WindowsOSSKU.json
- // this example is just showing the usage of "AgentPools_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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // get the collection of this ContainerServiceAgentPoolResource
- ContainerServiceAgentPoolCollection collection = containerServiceManagedCluster.GetContainerServiceAgentPools();
-
- // invoke the operation
- string agentPoolName = "wnp2";
- ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData()
- {
- Count = 3,
- VmSize = "Standard_D4s_v3",
- OSType = ContainerServiceOSType.Windows,
- OSSku = ContainerServiceOSSku.Windows2022,
- OrchestratorVersion = "1.23.3",
- };
- ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, agentPoolName, data);
- ContainerServiceAgentPoolResource 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
- ContainerServiceAgentPoolData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create Spot Agent Pool
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task CreateOrUpdate_CreateSpotAgentPool()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_Spot.json
- // this example is just showing the usage of "AgentPools_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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // get the collection of this ContainerServiceAgentPoolResource
- ContainerServiceAgentPoolCollection collection = containerServiceManagedCluster.GetContainerServiceAgentPools();
-
- // invoke the operation
- string agentPoolName = "agentpool1";
- ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData()
- {
- Count = 3,
- VmSize = "Standard_DS1_v2",
- OSType = ContainerServiceOSType.Linux,
- OrchestratorVersion = "",
- ScaleSetPriority = ScaleSetPriority.Spot,
- ScaleSetEvictionPolicy = ScaleSetEvictionPolicy.Delete,
- Tags =
-{
-["name1"] = "val1",
-},
- NodeLabels =
-{
-["key1"] = "val1",
-},
- NodeTaints =
-{
-"Key1=Value1:NoSchedule"
-},
- };
- ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, agentPoolName, data);
- ContainerServiceAgentPoolResource 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
- ContainerServiceAgentPoolData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create/Update Agent Pool
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task CreateOrUpdate_CreateUpdateAgentPool()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_Update.json
- // this example is just showing the usage of "AgentPools_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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // get the collection of this ContainerServiceAgentPoolResource
- ContainerServiceAgentPoolCollection collection = containerServiceManagedCluster.GetContainerServiceAgentPools();
-
- // invoke the operation
- string agentPoolName = "agentpool1";
- ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData()
- {
- Count = 3,
- VmSize = "Standard_DS1_v2",
- OSType = ContainerServiceOSType.Linux,
- Mode = AgentPoolMode.User,
- OrchestratorVersion = "",
- ScaleSetPriority = ScaleSetPriority.Spot,
- ScaleSetEvictionPolicy = ScaleSetEvictionPolicy.Delete,
- Tags =
-{
-["name1"] = "val1",
-},
- NodeLabels =
-{
-["key1"] = "val1",
-},
- NodeTaints =
-{
-"Key1=Value1:NoSchedule"
-},
- };
- ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, agentPoolName, data);
- ContainerServiceAgentPoolResource 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
- ContainerServiceAgentPoolData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Start Agent Pool
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task CreateOrUpdate_StartAgentPool()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPools_Start.json
- // this example is just showing the usage of "AgentPools_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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // get the collection of this ContainerServiceAgentPoolResource
- ContainerServiceAgentPoolCollection collection = containerServiceManagedCluster.GetContainerServiceAgentPools();
-
- // invoke the operation
- string agentPoolName = "agentpool1";
- ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData()
- {
- PowerStateCode = ContainerServiceStateCode.Running,
- };
- ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, agentPoolName, data);
- ContainerServiceAgentPoolResource 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
- ContainerServiceAgentPoolData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Stop Agent Pool
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task CreateOrUpdate_StopAgentPool()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPools_Stop.json
- // this example is just showing the usage of "AgentPools_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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // get the collection of this ContainerServiceAgentPoolResource
- ContainerServiceAgentPoolCollection collection = containerServiceManagedCluster.GetContainerServiceAgentPools();
-
- // invoke the operation
- string agentPoolName = "agentpool1";
- ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData()
- {
- PowerStateCode = ContainerServiceStateCode.Stopped,
- };
- ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, agentPoolName, data);
- ContainerServiceAgentPoolResource 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
- ContainerServiceAgentPoolData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Update Agent Pool
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task CreateOrUpdate_UpdateAgentPool()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPools_Update.json
- // this example is just showing the usage of "AgentPools_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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // get the collection of this ContainerServiceAgentPoolResource
- ContainerServiceAgentPoolCollection collection = containerServiceManagedCluster.GetContainerServiceAgentPools();
-
- // invoke the operation
- string agentPoolName = "agentpool1";
- ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData()
- {
- Count = 3,
- VmSize = "Standard_DS1_v2",
- OSType = ContainerServiceOSType.Linux,
- MaxCount = 2,
- MinCount = 2,
- EnableAutoScaling = true,
- OrchestratorVersion = "",
- ScaleSetPriority = ScaleSetPriority.Spot,
- ScaleSetEvictionPolicy = ScaleSetEvictionPolicy.Delete,
- NodeTaints =
-{
-"Key1=Value1:NoSchedule"
-},
- };
- ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, agentPoolName, data);
- ContainerServiceAgentPoolResource 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
- ContainerServiceAgentPoolData 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_ContainerServiceAgentPoolResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceAgentPoolResource.cs
deleted file mode 100644
index 7f4a5fba28b0..000000000000
--- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceAgentPoolResource.cs
+++ /dev/null
@@ -1,983 +0,0 @@
-// 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;
-
-namespace Azure.ResourceManager.ContainerService.Samples
-{
- public partial class Sample_ContainerServiceAgentPoolResource
- {
- // Abort operation on agent pool
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task AbortLatestOperation_AbortOperationOnAgentPool()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsAbortOperation.json
- // this example is just showing the usage of "AgentPools_AbortLatestOperation" 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 ContainerServiceAgentPoolResource created on azure
- // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- string agentPoolName = "agentpool1";
- ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName);
- ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId);
-
- // invoke the operation
- await containerServiceAgentPool.AbortLatestOperationAsync(WaitUntil.Completed);
-
- Console.WriteLine($"Succeeded");
- }
-
- // Get Agent Pool
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Get_GetAgentPool()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsGet.json
- // this example is just showing the usage of "AgentPools_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 ContainerServiceAgentPoolResource created on azure
- // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- string agentPoolName = "agentpool1";
- ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName);
- ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId);
-
- // invoke the operation
- ContainerServiceAgentPoolResource result = await containerServiceAgentPool.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
- ContainerServiceAgentPoolData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create Agent Pool using an agent pool snapshot
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Update_CreateAgentPoolUsingAnAgentPoolSnapshot()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_Snapshot.json
- // this example is just showing the usage of "AgentPools_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 ContainerServiceAgentPoolResource created on azure
- // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- string agentPoolName = "agentpool1";
- ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName);
- ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId);
-
- // invoke the operation
- ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData()
- {
- Count = 3,
- VmSize = "Standard_DS2_v2",
- OSType = ContainerServiceOSType.Linux,
- OrchestratorVersion = "",
- EnableFips = true,
- CreationDataSourceResourceId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1"),
- };
- ArmOperation lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data);
- ContainerServiceAgentPoolResource 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
- ContainerServiceAgentPoolData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create Agent Pool with Capacity Reservation Group
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Update_CreateAgentPoolWithCapacityReservationGroup()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_CRG.json
- // this example is just showing the usage of "AgentPools_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 ContainerServiceAgentPoolResource created on azure
- // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- string agentPoolName = "agentpool1";
- ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName);
- ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId);
-
- // invoke the operation
- ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData()
- {
- Count = 3,
- VmSize = "Standard_DS2_v2",
- OSType = ContainerServiceOSType.Linux,
- OrchestratorVersion = "",
- CapacityReservationGroupId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/CapacityReservationGroups/crg1"),
- };
- ArmOperation lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data);
- ContainerServiceAgentPoolResource 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
- ContainerServiceAgentPoolData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create Agent Pool with Dedicated Host Group
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Update_CreateAgentPoolWithDedicatedHostGroup()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_DedicatedHostGroup.json
- // this example is just showing the usage of "AgentPools_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 ContainerServiceAgentPoolResource created on azure
- // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- string agentPoolName = "agentpool1";
- ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName);
- ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId);
-
- // invoke the operation
- ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData()
- {
- Count = 3,
- VmSize = "Standard_DS2_v2",
- OSType = ContainerServiceOSType.Linux,
- OrchestratorVersion = "",
- HostGroupId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1"),
- };
- ArmOperation lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data);
- ContainerServiceAgentPoolResource 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
- ContainerServiceAgentPoolData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create Agent Pool with EncryptionAtHost enabled
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Update_CreateAgentPoolWithEncryptionAtHostEnabled()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_EnableEncryptionAtHost.json
- // this example is just showing the usage of "AgentPools_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 ContainerServiceAgentPoolResource created on azure
- // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- string agentPoolName = "agentpool1";
- ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName);
- ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId);
-
- // invoke the operation
- ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData()
- {
- Count = 3,
- VmSize = "Standard_DS2_v2",
- OSType = ContainerServiceOSType.Linux,
- OrchestratorVersion = "",
- EnableEncryptionAtHost = true,
- };
- ArmOperation lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data);
- ContainerServiceAgentPoolResource 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
- ContainerServiceAgentPoolData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create Agent Pool with Ephemeral OS Disk
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Update_CreateAgentPoolWithEphemeralOSDisk()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_Ephemeral.json
- // this example is just showing the usage of "AgentPools_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 ContainerServiceAgentPoolResource created on azure
- // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- string agentPoolName = "agentpool1";
- ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName);
- ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId);
-
- // invoke the operation
- ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData()
- {
- Count = 3,
- VmSize = "Standard_DS2_v2",
- OSDiskSizeInGB = 64,
- OSDiskType = ContainerServiceOSDiskType.Ephemeral,
- OSType = ContainerServiceOSType.Linux,
- OrchestratorVersion = "",
- };
- ArmOperation lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data);
- ContainerServiceAgentPoolResource 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
- ContainerServiceAgentPoolData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create Agent Pool with FIPS enabled OS
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Update_CreateAgentPoolWithFIPSEnabledOS()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_EnableFIPS.json
- // this example is just showing the usage of "AgentPools_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 ContainerServiceAgentPoolResource created on azure
- // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- string agentPoolName = "agentpool1";
- ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName);
- ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId);
-
- // invoke the operation
- ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData()
- {
- Count = 3,
- VmSize = "Standard_DS2_v2",
- OSType = ContainerServiceOSType.Linux,
- OrchestratorVersion = "",
- EnableFips = true,
- };
- ArmOperation lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data);
- ContainerServiceAgentPoolResource 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
- ContainerServiceAgentPoolData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create Agent Pool with GPUMIG
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Update_CreateAgentPoolWithGPUMIG()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_GPUMIG.json
- // this example is just showing the usage of "AgentPools_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 ContainerServiceAgentPoolResource created on azure
- // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- string agentPoolName = "agentpool1";
- ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName);
- ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId);
-
- // invoke the operation
- ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData()
- {
- Count = 3,
- VmSize = "Standard_ND96asr_v4",
- OSType = ContainerServiceOSType.Linux,
- OrchestratorVersion = "",
- KubeletConfig = new KubeletConfig()
- {
- CpuManagerPolicy = "static",
- IsCpuCfsQuotaEnabled = true,
- CpuCfsQuotaPeriod = "200ms",
- ImageGcHighThreshold = 90,
- ImageGcLowThreshold = 70,
- TopologyManagerPolicy = "best-effort",
- AllowedUnsafeSysctls =
-{
-"kernel.msg*","net.core.somaxconn"
-},
- FailStartWithSwapOn = false,
- },
- LinuxOSConfig = new LinuxOSConfig()
- {
- Sysctls = new SysctlConfig()
- {
- NetCoreWmemDefault = 12345,
- NetIPv4TcpTwReuse = true,
- NetIPv4IPLocalPortRange = "20000 60000",
- KernelThreadsMax = 99999,
- },
- TransparentHugePageEnabled = "always",
- TransparentHugePageDefrag = "madvise",
- SwapFileSizeInMB = 1500,
- },
- GpuInstanceProfile = GpuInstanceProfile.Mig2G,
- };
- ArmOperation lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data);
- ContainerServiceAgentPoolResource 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
- ContainerServiceAgentPoolData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create Agent Pool with Krustlet and the WASI runtime
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Update_CreateAgentPoolWithKrustletAndTheWASIRuntime()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_WasmWasi.json
- // this example is just showing the usage of "AgentPools_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 ContainerServiceAgentPoolResource created on azure
- // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- string agentPoolName = "agentpool1";
- ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName);
- ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId);
-
- // invoke the operation
- ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData()
- {
- Count = 3,
- VmSize = "Standard_DS2_v2",
- OSDiskSizeInGB = 64,
- WorkloadRuntime = WorkloadRuntime.WasmWasi,
- OSType = ContainerServiceOSType.Linux,
- Mode = AgentPoolMode.User,
- OrchestratorVersion = "",
- };
- ArmOperation lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data);
- ContainerServiceAgentPoolResource 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
- ContainerServiceAgentPoolData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create Agent Pool with KubeletConfig and LinuxOSConfig
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Update_CreateAgentPoolWithKubeletConfigAndLinuxOSConfig()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_CustomNodeConfig.json
- // this example is just showing the usage of "AgentPools_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 ContainerServiceAgentPoolResource created on azure
- // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- string agentPoolName = "agentpool1";
- ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName);
- ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId);
-
- // invoke the operation
- ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData()
- {
- Count = 3,
- VmSize = "Standard_DS2_v2",
- OSType = ContainerServiceOSType.Linux,
- OrchestratorVersion = "",
- KubeletConfig = new KubeletConfig()
- {
- CpuManagerPolicy = "static",
- IsCpuCfsQuotaEnabled = true,
- CpuCfsQuotaPeriod = "200ms",
- ImageGcHighThreshold = 90,
- ImageGcLowThreshold = 70,
- TopologyManagerPolicy = "best-effort",
- AllowedUnsafeSysctls =
-{
-"kernel.msg*","net.core.somaxconn"
-},
- FailStartWithSwapOn = false,
- },
- LinuxOSConfig = new LinuxOSConfig()
- {
- Sysctls = new SysctlConfig()
- {
- NetCoreWmemDefault = 12345,
- NetIPv4TcpTwReuse = true,
- NetIPv4IPLocalPortRange = "20000 60000",
- KernelThreadsMax = 99999,
- },
- TransparentHugePageEnabled = "always",
- TransparentHugePageDefrag = "madvise",
- SwapFileSizeInMB = 1500,
- },
- };
- ArmOperation lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data);
- ContainerServiceAgentPoolResource 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
- ContainerServiceAgentPoolData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create Agent Pool with OSSKU
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Update_CreateAgentPoolWithOSSKU()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_OSSKU.json
- // this example is just showing the usage of "AgentPools_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 ContainerServiceAgentPoolResource created on azure
- // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- string agentPoolName = "agentpool1";
- ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName);
- ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId);
-
- // invoke the operation
- ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData()
- {
- Count = 3,
- VmSize = "Standard_DS2_v2",
- OSType = ContainerServiceOSType.Linux,
- OSSku = ContainerServiceOSSku.AzureLinux,
- OrchestratorVersion = "",
- KubeletConfig = new KubeletConfig()
- {
- CpuManagerPolicy = "static",
- IsCpuCfsQuotaEnabled = true,
- CpuCfsQuotaPeriod = "200ms",
- ImageGcHighThreshold = 90,
- ImageGcLowThreshold = 70,
- TopologyManagerPolicy = "best-effort",
- AllowedUnsafeSysctls =
-{
-"kernel.msg*","net.core.somaxconn"
-},
- FailStartWithSwapOn = false,
- },
- LinuxOSConfig = new LinuxOSConfig()
- {
- Sysctls = new SysctlConfig()
- {
- NetCoreWmemDefault = 12345,
- NetIPv4TcpTwReuse = true,
- NetIPv4IPLocalPortRange = "20000 60000",
- KernelThreadsMax = 99999,
- },
- TransparentHugePageEnabled = "always",
- TransparentHugePageDefrag = "madvise",
- SwapFileSizeInMB = 1500,
- },
- };
- ArmOperation lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data);
- ContainerServiceAgentPoolResource 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
- ContainerServiceAgentPoolData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create Agent Pool with PPG
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Update_CreateAgentPoolWithPPG()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_PPG.json
- // this example is just showing the usage of "AgentPools_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 ContainerServiceAgentPoolResource created on azure
- // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- string agentPoolName = "agentpool1";
- ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName);
- ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId);
-
- // invoke the operation
- ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData()
- {
- Count = 3,
- VmSize = "Standard_DS2_v2",
- OSType = ContainerServiceOSType.Linux,
- OrchestratorVersion = "",
- ProximityPlacementGroupId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"),
- };
- ArmOperation lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data);
- ContainerServiceAgentPoolResource 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
- ContainerServiceAgentPoolData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create Agent Pool with UltraSSD enabled
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Update_CreateAgentPoolWithUltraSSDEnabled()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_EnableUltraSSD.json
- // this example is just showing the usage of "AgentPools_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 ContainerServiceAgentPoolResource created on azure
- // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- string agentPoolName = "agentpool1";
- ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName);
- ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId);
-
- // invoke the operation
- ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData()
- {
- Count = 3,
- VmSize = "Standard_DS2_v2",
- OSType = ContainerServiceOSType.Linux,
- OrchestratorVersion = "",
- EnableUltraSsd = true,
- };
- ArmOperation lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data);
- ContainerServiceAgentPoolResource 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
- ContainerServiceAgentPoolData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create Agent Pool with Windows OSSKU
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Update_CreateAgentPoolWithWindowsOSSKU()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_WindowsOSSKU.json
- // this example is just showing the usage of "AgentPools_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 ContainerServiceAgentPoolResource created on azure
- // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- string agentPoolName = "wnp2";
- ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName);
- ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId);
-
- // invoke the operation
- ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData()
- {
- Count = 3,
- VmSize = "Standard_D4s_v3",
- OSType = ContainerServiceOSType.Windows,
- OSSku = ContainerServiceOSSku.Windows2022,
- OrchestratorVersion = "1.23.3",
- };
- ArmOperation lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data);
- ContainerServiceAgentPoolResource 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
- ContainerServiceAgentPoolData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create Spot Agent Pool
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Update_CreateSpotAgentPool()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_Spot.json
- // this example is just showing the usage of "AgentPools_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 ContainerServiceAgentPoolResource created on azure
- // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- string agentPoolName = "agentpool1";
- ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName);
- ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId);
-
- // invoke the operation
- ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData()
- {
- Count = 3,
- VmSize = "Standard_DS1_v2",
- OSType = ContainerServiceOSType.Linux,
- OrchestratorVersion = "",
- ScaleSetPriority = ScaleSetPriority.Spot,
- ScaleSetEvictionPolicy = ScaleSetEvictionPolicy.Delete,
- Tags =
-{
-["name1"] = "val1",
-},
- NodeLabels =
-{
-["key1"] = "val1",
-},
- NodeTaints =
-{
-"Key1=Value1:NoSchedule"
-},
- };
- ArmOperation lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data);
- ContainerServiceAgentPoolResource 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
- ContainerServiceAgentPoolData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create/Update Agent Pool
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Update_CreateUpdateAgentPool()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_Update.json
- // this example is just showing the usage of "AgentPools_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 ContainerServiceAgentPoolResource created on azure
- // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- string agentPoolName = "agentpool1";
- ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName);
- ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId);
-
- // invoke the operation
- ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData()
- {
- Count = 3,
- VmSize = "Standard_DS1_v2",
- OSType = ContainerServiceOSType.Linux,
- Mode = AgentPoolMode.User,
- OrchestratorVersion = "",
- ScaleSetPriority = ScaleSetPriority.Spot,
- ScaleSetEvictionPolicy = ScaleSetEvictionPolicy.Delete,
- Tags =
-{
-["name1"] = "val1",
-},
- NodeLabels =
-{
-["key1"] = "val1",
-},
- NodeTaints =
-{
-"Key1=Value1:NoSchedule"
-},
- };
- ArmOperation lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data);
- ContainerServiceAgentPoolResource 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
- ContainerServiceAgentPoolData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Start Agent Pool
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Update_StartAgentPool()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPools_Start.json
- // this example is just showing the usage of "AgentPools_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 ContainerServiceAgentPoolResource created on azure
- // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- string agentPoolName = "agentpool1";
- ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName);
- ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId);
-
- // invoke the operation
- ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData()
- {
- PowerStateCode = ContainerServiceStateCode.Running,
- };
- ArmOperation lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data);
- ContainerServiceAgentPoolResource 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
- ContainerServiceAgentPoolData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Stop Agent Pool
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Update_StopAgentPool()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPools_Stop.json
- // this example is just showing the usage of "AgentPools_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 ContainerServiceAgentPoolResource created on azure
- // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- string agentPoolName = "agentpool1";
- ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName);
- ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId);
-
- // invoke the operation
- ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData()
- {
- PowerStateCode = ContainerServiceStateCode.Stopped,
- };
- ArmOperation lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data);
- ContainerServiceAgentPoolResource 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
- ContainerServiceAgentPoolData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Update Agent Pool
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Update_UpdateAgentPool()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPools_Update.json
- // this example is just showing the usage of "AgentPools_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 ContainerServiceAgentPoolResource created on azure
- // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- string agentPoolName = "agentpool1";
- ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName);
- ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId);
-
- // invoke the operation
- ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData()
- {
- Count = 3,
- VmSize = "Standard_DS1_v2",
- OSType = ContainerServiceOSType.Linux,
- MaxCount = 2,
- MinCount = 2,
- EnableAutoScaling = true,
- OrchestratorVersion = "",
- ScaleSetPriority = ScaleSetPriority.Spot,
- ScaleSetEvictionPolicy = ScaleSetEvictionPolicy.Delete,
- NodeTaints =
-{
-"Key1=Value1:NoSchedule"
-},
- };
- ArmOperation lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data);
- ContainerServiceAgentPoolResource 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
- ContainerServiceAgentPoolData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Delete Agent Pool
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Delete_DeleteAgentPool()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsDelete.json
- // this example is just showing the usage of "AgentPools_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 ContainerServiceAgentPoolResource created on azure
- // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- string agentPoolName = "agentpool1";
- ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName);
- ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId);
-
- // invoke the operation
- await containerServiceAgentPool.DeleteAsync(WaitUntil.Completed);
-
- Console.WriteLine($"Succeeded");
- }
-
- // Upgrade Agent Pool Node Image Version
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task UpgradeNodeImageVersion_UpgradeAgentPoolNodeImageVersion()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsUpgradeNodeImageVersion.json
- // this example is just showing the usage of "AgentPools_UpgradeNodeImageVersion" 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 ContainerServiceAgentPoolResource created on azure
- // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- string agentPoolName = "agentpool1";
- ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName);
- ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId);
-
- // invoke the operation
- await containerServiceAgentPool.UpgradeNodeImageVersionAsync(WaitUntil.Completed);
-
- Console.WriteLine($"Succeeded");
- }
- }
-}
diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceMaintenanceConfigurationCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceMaintenanceConfigurationCollection.cs
deleted file mode 100644
index 519813677639..000000000000
--- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceMaintenanceConfigurationCollection.cs
+++ /dev/null
@@ -1,419 +0,0 @@
-// 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;
-
-namespace Azure.ResourceManager.ContainerService.Samples
-{
- public partial class Sample_ContainerServiceMaintenanceConfigurationCollection
- {
- // List maintenance configurations by Managed Cluster
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task GetAll_ListMaintenanceConfigurationsByManagedCluster()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsList.json
- // this example is just showing the usage of "MaintenanceConfigurations_ListByManagedCluster" 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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // get the collection of this ContainerServiceMaintenanceConfigurationResource
- ContainerServiceMaintenanceConfigurationCollection collection = containerServiceManagedCluster.GetContainerServiceMaintenanceConfigurations();
-
- // invoke the operation and iterate over the result
- await foreach (ContainerServiceMaintenanceConfigurationResource 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
- ContainerServiceMaintenanceConfigurationData resourceData = item.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- Console.WriteLine($"Succeeded");
- }
-
- // List maintenance configurations configured with maintenance window by Managed Cluster
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task GetAll_ListMaintenanceConfigurationsConfiguredWithMaintenanceWindowByManagedCluster()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsList_MaintenanceWindow.json
- // this example is just showing the usage of "MaintenanceConfigurations_ListByManagedCluster" 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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // get the collection of this ContainerServiceMaintenanceConfigurationResource
- ContainerServiceMaintenanceConfigurationCollection collection = containerServiceManagedCluster.GetContainerServiceMaintenanceConfigurations();
-
- // invoke the operation and iterate over the result
- await foreach (ContainerServiceMaintenanceConfigurationResource 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
- ContainerServiceMaintenanceConfigurationData resourceData = item.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- Console.WriteLine($"Succeeded");
- }
-
- // Get Maintenance Configuration
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Get_GetMaintenanceConfiguration()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsGet.json
- // this example is just showing the usage of "MaintenanceConfigurations_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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // get the collection of this ContainerServiceMaintenanceConfigurationResource
- ContainerServiceMaintenanceConfigurationCollection collection = containerServiceManagedCluster.GetContainerServiceMaintenanceConfigurations();
-
- // invoke the operation
- string configName = "default";
- ContainerServiceMaintenanceConfigurationResource result = await collection.GetAsync(configName);
-
- // 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
- ContainerServiceMaintenanceConfigurationData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Get Maintenance Configuration
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Exists_GetMaintenanceConfiguration()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsGet.json
- // this example is just showing the usage of "MaintenanceConfigurations_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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // get the collection of this ContainerServiceMaintenanceConfigurationResource
- ContainerServiceMaintenanceConfigurationCollection collection = containerServiceManagedCluster.GetContainerServiceMaintenanceConfigurations();
-
- // invoke the operation
- string configName = "default";
- bool result = await collection.ExistsAsync(configName);
-
- Console.WriteLine($"Succeeded: {result}");
- }
-
- // Get Maintenance Configuration
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task GetIfExists_GetMaintenanceConfiguration()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsGet.json
- // this example is just showing the usage of "MaintenanceConfigurations_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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // get the collection of this ContainerServiceMaintenanceConfigurationResource
- ContainerServiceMaintenanceConfigurationCollection collection = containerServiceManagedCluster.GetContainerServiceMaintenanceConfigurations();
-
- // invoke the operation
- string configName = "default";
- NullableResponse response = await collection.GetIfExistsAsync(configName);
- ContainerServiceMaintenanceConfigurationResource 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
- ContainerServiceMaintenanceConfigurationData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
- }
-
- // Get Maintenance Configuration Configured With Maintenance Window
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Get_GetMaintenanceConfigurationConfiguredWithMaintenanceWindow()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsGet_MaintenanceWindow.json
- // this example is just showing the usage of "MaintenanceConfigurations_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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // get the collection of this ContainerServiceMaintenanceConfigurationResource
- ContainerServiceMaintenanceConfigurationCollection collection = containerServiceManagedCluster.GetContainerServiceMaintenanceConfigurations();
-
- // invoke the operation
- string configName = "aksManagedNodeOSUpgradeSchedule";
- ContainerServiceMaintenanceConfigurationResource result = await collection.GetAsync(configName);
-
- // 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
- ContainerServiceMaintenanceConfigurationData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Get Maintenance Configuration Configured With Maintenance Window
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Exists_GetMaintenanceConfigurationConfiguredWithMaintenanceWindow()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsGet_MaintenanceWindow.json
- // this example is just showing the usage of "MaintenanceConfigurations_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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // get the collection of this ContainerServiceMaintenanceConfigurationResource
- ContainerServiceMaintenanceConfigurationCollection collection = containerServiceManagedCluster.GetContainerServiceMaintenanceConfigurations();
-
- // invoke the operation
- string configName = "aksManagedNodeOSUpgradeSchedule";
- bool result = await collection.ExistsAsync(configName);
-
- Console.WriteLine($"Succeeded: {result}");
- }
-
- // Get Maintenance Configuration Configured With Maintenance Window
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task GetIfExists_GetMaintenanceConfigurationConfiguredWithMaintenanceWindow()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsGet_MaintenanceWindow.json
- // this example is just showing the usage of "MaintenanceConfigurations_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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // get the collection of this ContainerServiceMaintenanceConfigurationResource
- ContainerServiceMaintenanceConfigurationCollection collection = containerServiceManagedCluster.GetContainerServiceMaintenanceConfigurations();
-
- // invoke the operation
- string configName = "aksManagedNodeOSUpgradeSchedule";
- NullableResponse response = await collection.GetIfExistsAsync(configName);
- ContainerServiceMaintenanceConfigurationResource 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
- ContainerServiceMaintenanceConfigurationData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
- }
-
- // Create/Update Maintenance Configuration
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task CreateOrUpdate_CreateUpdateMaintenanceConfiguration()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsCreate_Update.json
- // this example is just showing the usage of "MaintenanceConfigurations_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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // get the collection of this ContainerServiceMaintenanceConfigurationResource
- ContainerServiceMaintenanceConfigurationCollection collection = containerServiceManagedCluster.GetContainerServiceMaintenanceConfigurations();
-
- // invoke the operation
- string configName = "default";
- ContainerServiceMaintenanceConfigurationData data = new ContainerServiceMaintenanceConfigurationData()
- {
- TimesInWeek =
-{
-new ContainerServiceTimeInWeek()
-{
-Day = ContainerServiceWeekDay.Monday,
-HourSlots =
-{
-1,2
-},
-}
-},
- NotAllowedTimes =
-{
-new ContainerServiceTimeSpan()
-{
-StartOn = DateTimeOffset.Parse("2020-11-26T03:00:00Z"),
-EndOn = DateTimeOffset.Parse("2020-11-30T12:00:00Z"),
-}
-},
- };
- ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, configName, data);
- ContainerServiceMaintenanceConfigurationResource 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
- ContainerServiceMaintenanceConfigurationData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create/Update Maintenance Configuration with Maintenance Window
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task CreateOrUpdate_CreateUpdateMaintenanceConfigurationWithMaintenanceWindow()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsCreate_Update_MaintenanceWindow.json
- // this example is just showing the usage of "MaintenanceConfigurations_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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // get the collection of this ContainerServiceMaintenanceConfigurationResource
- ContainerServiceMaintenanceConfigurationCollection collection = containerServiceManagedCluster.GetContainerServiceMaintenanceConfigurations();
-
- // invoke the operation
- string configName = "aksManagedAutoUpgradeSchedule";
- ContainerServiceMaintenanceConfigurationData data = new ContainerServiceMaintenanceConfigurationData()
- {
- MaintenanceWindow = new ContainerServiceMaintenanceWindow(new ContainerServiceMaintenanceSchedule()
- {
- RelativeMonthly = new ContainerServiceMaintenanceRelativeMonthlySchedule(3, ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex.First, ContainerServiceWeekDay.Monday),
- }, 10, "08:30")
- {
- UtcOffset = "+05:30",
- StartDate = "2023-01-01",
- NotAllowedDates =
-{
-new ContainerServiceDateSpan(DateTimeOffset.Parse("2023-02-18"),DateTimeOffset.Parse("2023-02-25")),new ContainerServiceDateSpan(DateTimeOffset.Parse("2023-12-23"),DateTimeOffset.Parse("2024-01-05"))
-},
- },
- };
- ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, configName, data);
- ContainerServiceMaintenanceConfigurationResource 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
- ContainerServiceMaintenanceConfigurationData 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_ContainerServiceMaintenanceConfigurationResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceMaintenanceConfigurationResource.cs
deleted file mode 100644
index e944fd8a1db7..000000000000
--- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceMaintenanceConfigurationResource.cs
+++ /dev/null
@@ -1,241 +0,0 @@
-// 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;
-
-namespace Azure.ResourceManager.ContainerService.Samples
-{
- public partial class Sample_ContainerServiceMaintenanceConfigurationResource
- {
- // Get Maintenance Configuration
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Get_GetMaintenanceConfiguration()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsGet.json
- // this example is just showing the usage of "MaintenanceConfigurations_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 ContainerServiceMaintenanceConfigurationResource created on azure
- // for more information of creating ContainerServiceMaintenanceConfigurationResource, please refer to the document of ContainerServiceMaintenanceConfigurationResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- string configName = "default";
- ResourceIdentifier containerServiceMaintenanceConfigurationResourceId = ContainerServiceMaintenanceConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, configName);
- ContainerServiceMaintenanceConfigurationResource containerServiceMaintenanceConfiguration = client.GetContainerServiceMaintenanceConfigurationResource(containerServiceMaintenanceConfigurationResourceId);
-
- // invoke the operation
- ContainerServiceMaintenanceConfigurationResource result = await containerServiceMaintenanceConfiguration.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
- ContainerServiceMaintenanceConfigurationData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Get Maintenance Configuration Configured With Maintenance Window
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Get_GetMaintenanceConfigurationConfiguredWithMaintenanceWindow()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsGet_MaintenanceWindow.json
- // this example is just showing the usage of "MaintenanceConfigurations_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 ContainerServiceMaintenanceConfigurationResource created on azure
- // for more information of creating ContainerServiceMaintenanceConfigurationResource, please refer to the document of ContainerServiceMaintenanceConfigurationResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- string configName = "aksManagedNodeOSUpgradeSchedule";
- ResourceIdentifier containerServiceMaintenanceConfigurationResourceId = ContainerServiceMaintenanceConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, configName);
- ContainerServiceMaintenanceConfigurationResource containerServiceMaintenanceConfiguration = client.GetContainerServiceMaintenanceConfigurationResource(containerServiceMaintenanceConfigurationResourceId);
-
- // invoke the operation
- ContainerServiceMaintenanceConfigurationResource result = await containerServiceMaintenanceConfiguration.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
- ContainerServiceMaintenanceConfigurationData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create/Update Maintenance Configuration
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Update_CreateUpdateMaintenanceConfiguration()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsCreate_Update.json
- // this example is just showing the usage of "MaintenanceConfigurations_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 ContainerServiceMaintenanceConfigurationResource created on azure
- // for more information of creating ContainerServiceMaintenanceConfigurationResource, please refer to the document of ContainerServiceMaintenanceConfigurationResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- string configName = "default";
- ResourceIdentifier containerServiceMaintenanceConfigurationResourceId = ContainerServiceMaintenanceConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, configName);
- ContainerServiceMaintenanceConfigurationResource containerServiceMaintenanceConfiguration = client.GetContainerServiceMaintenanceConfigurationResource(containerServiceMaintenanceConfigurationResourceId);
-
- // invoke the operation
- ContainerServiceMaintenanceConfigurationData data = new ContainerServiceMaintenanceConfigurationData()
- {
- TimesInWeek =
-{
-new ContainerServiceTimeInWeek()
-{
-Day = ContainerServiceWeekDay.Monday,
-HourSlots =
-{
-1,2
-},
-}
-},
- NotAllowedTimes =
-{
-new ContainerServiceTimeSpan()
-{
-StartOn = DateTimeOffset.Parse("2020-11-26T03:00:00Z"),
-EndOn = DateTimeOffset.Parse("2020-11-30T12:00:00Z"),
-}
-},
- };
- ArmOperation lro = await containerServiceMaintenanceConfiguration.UpdateAsync(WaitUntil.Completed, data);
- ContainerServiceMaintenanceConfigurationResource 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
- ContainerServiceMaintenanceConfigurationData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create/Update Maintenance Configuration with Maintenance Window
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Update_CreateUpdateMaintenanceConfigurationWithMaintenanceWindow()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsCreate_Update_MaintenanceWindow.json
- // this example is just showing the usage of "MaintenanceConfigurations_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 ContainerServiceMaintenanceConfigurationResource created on azure
- // for more information of creating ContainerServiceMaintenanceConfigurationResource, please refer to the document of ContainerServiceMaintenanceConfigurationResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- string configName = "aksManagedAutoUpgradeSchedule";
- ResourceIdentifier containerServiceMaintenanceConfigurationResourceId = ContainerServiceMaintenanceConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, configName);
- ContainerServiceMaintenanceConfigurationResource containerServiceMaintenanceConfiguration = client.GetContainerServiceMaintenanceConfigurationResource(containerServiceMaintenanceConfigurationResourceId);
-
- // invoke the operation
- ContainerServiceMaintenanceConfigurationData data = new ContainerServiceMaintenanceConfigurationData()
- {
- MaintenanceWindow = new ContainerServiceMaintenanceWindow(new ContainerServiceMaintenanceSchedule()
- {
- RelativeMonthly = new ContainerServiceMaintenanceRelativeMonthlySchedule(3, ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex.First, ContainerServiceWeekDay.Monday),
- }, 10, "08:30")
- {
- UtcOffset = "+05:30",
- StartDate = "2023-01-01",
- NotAllowedDates =
-{
-new ContainerServiceDateSpan(DateTimeOffset.Parse("2023-02-18"),DateTimeOffset.Parse("2023-02-25")),new ContainerServiceDateSpan(DateTimeOffset.Parse("2023-12-23"),DateTimeOffset.Parse("2024-01-05"))
-},
- },
- };
- ArmOperation lro = await containerServiceMaintenanceConfiguration.UpdateAsync(WaitUntil.Completed, data);
- ContainerServiceMaintenanceConfigurationResource 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
- ContainerServiceMaintenanceConfigurationData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Delete Maintenance Configuration
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Delete_DeleteMaintenanceConfiguration()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsDelete.json
- // this example is just showing the usage of "MaintenanceConfigurations_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 ContainerServiceMaintenanceConfigurationResource created on azure
- // for more information of creating ContainerServiceMaintenanceConfigurationResource, please refer to the document of ContainerServiceMaintenanceConfigurationResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- string configName = "default";
- ResourceIdentifier containerServiceMaintenanceConfigurationResourceId = ContainerServiceMaintenanceConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, configName);
- ContainerServiceMaintenanceConfigurationResource containerServiceMaintenanceConfiguration = client.GetContainerServiceMaintenanceConfigurationResource(containerServiceMaintenanceConfigurationResourceId);
-
- // invoke the operation
- await containerServiceMaintenanceConfiguration.DeleteAsync(WaitUntil.Completed);
-
- Console.WriteLine($"Succeeded");
- }
-
- // Delete Maintenance Configuration For Node OS Upgrade
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Delete_DeleteMaintenanceConfigurationForNodeOSUpgrade()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsDelete_MaintenanceWindow.json
- // this example is just showing the usage of "MaintenanceConfigurations_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 ContainerServiceMaintenanceConfigurationResource created on azure
- // for more information of creating ContainerServiceMaintenanceConfigurationResource, please refer to the document of ContainerServiceMaintenanceConfigurationResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- string configName = "aksManagedNodeOSUpgradeSchedule";
- ResourceIdentifier containerServiceMaintenanceConfigurationResourceId = ContainerServiceMaintenanceConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, configName);
- ContainerServiceMaintenanceConfigurationResource containerServiceMaintenanceConfiguration = client.GetContainerServiceMaintenanceConfigurationResource(containerServiceMaintenanceConfigurationResourceId);
-
- // invoke the operation
- await containerServiceMaintenanceConfiguration.DeleteAsync(WaitUntil.Completed);
-
- Console.WriteLine($"Succeeded");
- }
- }
-}
diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceManagedClusterCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceManagedClusterCollection.cs
deleted file mode 100644
index 9a1c4cb74427..000000000000
--- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceManagedClusterCollection.cs
+++ /dev/null
@@ -1,2858 +0,0 @@
-// 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.Models;
-using Azure.ResourceManager.Resources;
-
-namespace Azure.ResourceManager.ContainerService.Samples
-{
- public partial class Sample_ContainerServiceManagedClusterCollection
- {
- // Get Managed Clusters by Resource Group
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task GetAll_GetManagedClustersByResourceGroup()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersListByResourceGroup.json
- // this example is just showing the usage of "ManagedClusters_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 = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
- ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
-
- // get the collection of this ContainerServiceManagedClusterResource
- ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters();
-
- // invoke the operation and iterate over the result
- await foreach (ContainerServiceManagedClusterResource 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
- ContainerServiceManagedClusterData resourceData = item.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- Console.WriteLine($"Succeeded");
- }
-
- // Get Managed Cluster
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Get_GetManagedCluster()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGet.json
- // this example is just showing the usage of "ManagedClusters_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 = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
- ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
-
- // get the collection of this ContainerServiceManagedClusterResource
- ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters();
-
- // invoke the operation
- string resourceName = "clustername1";
- ContainerServiceManagedClusterResource result = await collection.GetAsync(resourceName);
-
- // 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
- ContainerServiceManagedClusterData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Get Managed Cluster
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Exists_GetManagedCluster()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGet.json
- // this example is just showing the usage of "ManagedClusters_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 = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
- ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
-
- // get the collection of this ContainerServiceManagedClusterResource
- ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters();
-
- // invoke the operation
- string resourceName = "clustername1";
- bool result = await collection.ExistsAsync(resourceName);
-
- Console.WriteLine($"Succeeded: {result}");
- }
-
- // Get Managed Cluster
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task GetIfExists_GetManagedCluster()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGet.json
- // this example is just showing the usage of "ManagedClusters_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 = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
- ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
-
- // get the collection of this ContainerServiceManagedClusterResource
- ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters();
-
- // invoke the operation
- string resourceName = "clustername1";
- NullableResponse response = await collection.GetIfExistsAsync(resourceName);
- ContainerServiceManagedClusterResource 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
- ContainerServiceManagedClusterData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
- }
-
- // Create Managed Cluster using an agent pool snapshot
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task CreateOrUpdate_CreateManagedClusterUsingAnAgentPoolSnapshot()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_Snapshot.json
- // this example is just showing the usage of "ManagedClusters_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 = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
- ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
-
- // get the collection of this ContainerServiceManagedClusterResource
- ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters();
-
- // invoke the operation
- string resourceName = "clustername1";
- ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1"))
- {
- Sku = new ManagedClusterSku()
- {
- Name = new ManagedClusterSkuName("Basic"),
- Tier = ManagedClusterSkuTier.Free,
- },
- KubernetesVersion = "",
- DnsPrefix = "dnsprefix1",
- AgentPoolProfiles =
-{
-new ManagedClusterAgentPoolProfile("nodepool1")
-{
-Count = 3,
-VmSize = "Standard_DS2_v2",
-OSType = ContainerServiceOSType.Linux,
-AgentPoolType = AgentPoolType.VirtualMachineScaleSets,
-Mode = AgentPoolMode.System,
-EnableNodePublicIP = true,
-EnableFips = true,
-CreationDataSourceResourceId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1"),
-}
-},
- LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[]
- {
-new ContainerServiceSshPublicKey("keydata")
- })),
- WindowsProfile = new ManagedClusterWindowsProfile("azureuser")
- {
- AdminPassword = "replacePassword1234$",
- },
- ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid")
- {
- Secret = "secret",
- },
- AddonProfiles =
-{
-},
- EnableRbac = true,
- EnablePodSecurityPolicy = false,
- NetworkProfile = new ContainerServiceNetworkProfile()
- {
- OutboundType = ContainerServiceOutboundType.LoadBalancer,
- LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard,
- LoadBalancerProfile = new ManagedClusterLoadBalancerProfile()
- {
- ManagedOutboundIPs = new ManagedClusterLoadBalancerProfileManagedOutboundIPs()
- {
- Count = 2,
- },
- },
- },
- AutoScalerProfile = new ManagedClusterAutoScalerProfile()
- {
- ScanIntervalInSeconds = "20s",
- ScaleDownDelayAfterAdd = "15m",
- },
- DiskEncryptionSetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
- Tags =
-{
-["archv2"] = "",
-["tier"] = "production",
-},
- };
- ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data);
- ContainerServiceManagedClusterResource 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
- ContainerServiceManagedClusterData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create Managed Cluster with AKS-managed NAT gateway as outbound type
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task CreateOrUpdate_CreateManagedClusterWithAKSManagedNATGatewayAsOutboundType()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_ManagedNATGateway.json
- // this example is just showing the usage of "ManagedClusters_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 = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
- ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
-
- // get the collection of this ContainerServiceManagedClusterResource
- ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters();
-
- // invoke the operation
- string resourceName = "clustername1";
- ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1"))
- {
- Sku = new ManagedClusterSku()
- {
- Name = new ManagedClusterSkuName("Basic"),
- Tier = ManagedClusterSkuTier.Free,
- },
- KubernetesVersion = "",
- DnsPrefix = "dnsprefix1",
- AgentPoolProfiles =
-{
-new ManagedClusterAgentPoolProfile("nodepool1")
-{
-Count = 3,
-VmSize = "Standard_DS2_v2",
-OSType = ContainerServiceOSType.Linux,
-AgentPoolType = AgentPoolType.VirtualMachineScaleSets,
-Mode = AgentPoolMode.System,
-EnableNodePublicIP = false,
-}
-},
- LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[]
- {
-new ContainerServiceSshPublicKey("keydata")
- })),
- WindowsProfile = new ManagedClusterWindowsProfile("azureuser")
- {
- AdminPassword = "replacePassword1234$",
- },
- ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid")
- {
- Secret = "secret",
- },
- AddonProfiles =
-{
-},
- EnableRbac = true,
- EnablePodSecurityPolicy = true,
- NetworkProfile = new ContainerServiceNetworkProfile()
- {
- OutboundType = ContainerServiceOutboundType.ManagedNatGateway,
- LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard,
- NatGatewayProfile = new ManagedClusterNatGatewayProfile()
- {
- ManagedOutboundIPCount = 2,
- },
- },
- AutoScalerProfile = new ManagedClusterAutoScalerProfile()
- {
- ScanIntervalInSeconds = "20s",
- ScaleDownDelayAfterAdd = "15m",
- },
- DiskEncryptionSetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
- Tags =
-{
-["archv2"] = "",
-["tier"] = "production",
-},
- };
- ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data);
- ContainerServiceManagedClusterResource 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
- ContainerServiceManagedClusterData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create Managed Cluster with Azure KeyVault Secrets Provider Addon
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task CreateOrUpdate_CreateManagedClusterWithAzureKeyVaultSecretsProviderAddon()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_AzureKeyvaultSecretsProvider.json
- // this example is just showing the usage of "ManagedClusters_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 = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
- ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
-
- // get the collection of this ContainerServiceManagedClusterResource
- ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters();
-
- // invoke the operation
- string resourceName = "clustername1";
- ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1"))
- {
- Sku = new ManagedClusterSku()
- {
- Name = new ManagedClusterSkuName("Basic"),
- Tier = ManagedClusterSkuTier.Free,
- },
- KubernetesVersion = "",
- DnsPrefix = "dnsprefix1",
- AgentPoolProfiles =
-{
-new ManagedClusterAgentPoolProfile("nodepool1")
-{
-Count = 3,
-VmSize = "Standard_DS2_v2",
-OSType = ContainerServiceOSType.Linux,
-AgentPoolType = AgentPoolType.VirtualMachineScaleSets,
-Mode = AgentPoolMode.System,
-EnableNodePublicIP = true,
-}
-},
- LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[]
- {
-new ContainerServiceSshPublicKey("keydata")
- })),
- WindowsProfile = new ManagedClusterWindowsProfile("azureuser")
- {
- AdminPassword = "replacePassword1234$",
- },
- ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid")
- {
- Secret = "secret",
- },
- AddonProfiles =
-{
-["azureKeyvaultSecretsProvider"] = new ManagedClusterAddonProfile(true)
-{
-Config =
-{
-["enableSecretRotation"] = "true",
-["rotationPollInterval"] = "2m",
-},
-},
-},
- EnableRbac = true,
- EnablePodSecurityPolicy = true,
- NetworkProfile = new ContainerServiceNetworkProfile()
- {
- OutboundType = ContainerServiceOutboundType.LoadBalancer,
- LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard,
- LoadBalancerProfile = new ManagedClusterLoadBalancerProfile()
- {
- ManagedOutboundIPs = new ManagedClusterLoadBalancerProfileManagedOutboundIPs()
- {
- Count = 2,
- },
- },
- },
- AutoScalerProfile = new ManagedClusterAutoScalerProfile()
- {
- ScanIntervalInSeconds = "20s",
- ScaleDownDelayAfterAdd = "15m",
- },
- DiskEncryptionSetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
- Tags =
-{
-["archv2"] = "",
-["tier"] = "production",
-},
- };
- ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data);
- ContainerServiceManagedClusterResource 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
- ContainerServiceManagedClusterData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create Managed Cluster with Capacity Reservation Group
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task CreateOrUpdate_CreateManagedClusterWithCapacityReservationGroup()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_CRG.json
- // this example is just showing the usage of "ManagedClusters_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 = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
- ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
-
- // get the collection of this ContainerServiceManagedClusterResource
- ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters();
-
- // invoke the operation
- string resourceName = "clustername1";
- ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1"))
- {
- Sku = new ManagedClusterSku()
- {
- Name = new ManagedClusterSkuName("Basic"),
- Tier = ManagedClusterSkuTier.Free,
- },
- KubernetesVersion = "",
- DnsPrefix = "dnsprefix1",
- AgentPoolProfiles =
-{
-new ManagedClusterAgentPoolProfile("nodepool1")
-{
-Count = 3,
-VmSize = "Standard_DS2_v2",
-OSType = ContainerServiceOSType.Linux,
-AgentPoolType = AgentPoolType.VirtualMachineScaleSets,
-Mode = AgentPoolMode.System,
-EnableNodePublicIP = true,
-CapacityReservationGroupId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/capacityReservationGroups/crg1"),
-}
-},
- LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[]
- {
-new ContainerServiceSshPublicKey("keydata")
- })),
- WindowsProfile = new ManagedClusterWindowsProfile("azureuser")
- {
- AdminPassword = "replacePassword1234$",
- },
- ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid")
- {
- Secret = "secret",
- },
- AddonProfiles =
-{
-},
- EnableRbac = true,
- EnablePodSecurityPolicy = true,
- NetworkProfile = new ContainerServiceNetworkProfile()
- {
- OutboundType = ContainerServiceOutboundType.LoadBalancer,
- LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard,
- LoadBalancerProfile = new ManagedClusterLoadBalancerProfile()
- {
- ManagedOutboundIPs = new ManagedClusterLoadBalancerProfileManagedOutboundIPs()
- {
- Count = 2,
- },
- },
- },
- AutoScalerProfile = new ManagedClusterAutoScalerProfile()
- {
- ScanIntervalInSeconds = "20s",
- ScaleDownDelayAfterAdd = "15m",
- },
- DiskEncryptionSetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
- Tags =
-{
-["archv2"] = "",
-["tier"] = "production",
-},
- };
- ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data);
- ContainerServiceManagedClusterResource 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
- ContainerServiceManagedClusterData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create Managed Cluster with Dedicated Host Group
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task CreateOrUpdate_CreateManagedClusterWithDedicatedHostGroup()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_DedicatedHostGroup.json
- // this example is just showing the usage of "ManagedClusters_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 = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
- ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
-
- // get the collection of this ContainerServiceManagedClusterResource
- ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters();
-
- // invoke the operation
- string resourceName = "clustername1";
- ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1"))
- {
- Sku = new ManagedClusterSku()
- {
- Name = new ManagedClusterSkuName("Basic"),
- Tier = ManagedClusterSkuTier.Free,
- },
- KubernetesVersion = "",
- DnsPrefix = "dnsprefix1",
- AgentPoolProfiles =
-{
-new ManagedClusterAgentPoolProfile("nodepool1")
-{
-Count = 3,
-VmSize = "Standard_DS2_v2",
-OSType = ContainerServiceOSType.Linux,
-AgentPoolType = AgentPoolType.VirtualMachineScaleSets,
-EnableNodePublicIP = true,
-HostGroupId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1"),
-}
-},
- LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[]
- {
-new ContainerServiceSshPublicKey("keydata")
- })),
- WindowsProfile = new ManagedClusterWindowsProfile("azureuser")
- {
- AdminPassword = "replacePassword1234$",
- },
- ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid")
- {
- Secret = "secret",
- },
- AddonProfiles =
-{
-},
- EnableRbac = true,
- EnablePodSecurityPolicy = false,
- NetworkProfile = new ContainerServiceNetworkProfile()
- {
- OutboundType = ContainerServiceOutboundType.LoadBalancer,
- LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard,
- LoadBalancerProfile = new ManagedClusterLoadBalancerProfile()
- {
- ManagedOutboundIPs = new ManagedClusterLoadBalancerProfileManagedOutboundIPs()
- {
- Count = 2,
- },
- },
- },
- AutoScalerProfile = new ManagedClusterAutoScalerProfile()
- {
- ScanIntervalInSeconds = "20s",
- ScaleDownDelayAfterAdd = "15m",
- },
- DiskEncryptionSetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
- Tags =
-{
-["archv2"] = "",
-["tier"] = "production",
-},
- };
- ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data);
- ContainerServiceManagedClusterResource 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
- ContainerServiceManagedClusterData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create Managed Cluster with EncryptionAtHost enabled
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task CreateOrUpdate_CreateManagedClusterWithEncryptionAtHostEnabled()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_EnableEncryptionAtHost.json
- // this example is just showing the usage of "ManagedClusters_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 = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
- ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
-
- // get the collection of this ContainerServiceManagedClusterResource
- ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters();
-
- // invoke the operation
- string resourceName = "clustername1";
- ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1"))
- {
- Sku = new ManagedClusterSku()
- {
- Name = new ManagedClusterSkuName("Basic"),
- Tier = ManagedClusterSkuTier.Free,
- },
- KubernetesVersion = "",
- DnsPrefix = "dnsprefix1",
- AgentPoolProfiles =
-{
-new ManagedClusterAgentPoolProfile("nodepool1")
-{
-Count = 3,
-VmSize = "Standard_DS2_v2",
-OSType = ContainerServiceOSType.Linux,
-AgentPoolType = AgentPoolType.VirtualMachineScaleSets,
-Mode = AgentPoolMode.System,
-EnableNodePublicIP = true,
-EnableEncryptionAtHost = true,
-}
-},
- LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[]
- {
-new ContainerServiceSshPublicKey("keydata")
- })),
- WindowsProfile = new ManagedClusterWindowsProfile("azureuser")
- {
- AdminPassword = "replacePassword1234$",
- },
- ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid")
- {
- Secret = "secret",
- },
- AddonProfiles =
-{
-},
- EnableRbac = true,
- EnablePodSecurityPolicy = true,
- NetworkProfile = new ContainerServiceNetworkProfile()
- {
- OutboundType = ContainerServiceOutboundType.LoadBalancer,
- LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard,
- LoadBalancerProfile = new ManagedClusterLoadBalancerProfile()
- {
- ManagedOutboundIPs = new ManagedClusterLoadBalancerProfileManagedOutboundIPs()
- {
- Count = 2,
- },
- },
- },
- AutoScalerProfile = new ManagedClusterAutoScalerProfile()
- {
- ScanIntervalInSeconds = "20s",
- ScaleDownDelayAfterAdd = "15m",
- },
- DiskEncryptionSetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
- Tags =
-{
-["archv2"] = "",
-["tier"] = "production",
-},
- };
- ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data);
- ContainerServiceManagedClusterResource 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
- ContainerServiceManagedClusterData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create Managed Cluster with FIPS enabled OS
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task CreateOrUpdate_CreateManagedClusterWithFIPSEnabledOS()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_EnabledFIPS.json
- // this example is just showing the usage of "ManagedClusters_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 = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
- ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
-
- // get the collection of this ContainerServiceManagedClusterResource
- ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters();
-
- // invoke the operation
- string resourceName = "clustername1";
- ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1"))
- {
- Sku = new ManagedClusterSku()
- {
- Name = new ManagedClusterSkuName("Basic"),
- Tier = ManagedClusterSkuTier.Free,
- },
- KubernetesVersion = "",
- DnsPrefix = "dnsprefix1",
- AgentPoolProfiles =
-{
-new ManagedClusterAgentPoolProfile("nodepool1")
-{
-Count = 3,
-VmSize = "Standard_DS2_v2",
-OSType = ContainerServiceOSType.Linux,
-AgentPoolType = AgentPoolType.VirtualMachineScaleSets,
-Mode = AgentPoolMode.System,
-EnableNodePublicIP = true,
-EnableFips = true,
-}
-},
- LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[]
- {
-new ContainerServiceSshPublicKey("keydata")
- })),
- WindowsProfile = new ManagedClusterWindowsProfile("azureuser")
- {
- AdminPassword = "replacePassword1234$",
- },
- ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid")
- {
- Secret = "secret",
- },
- AddonProfiles =
-{
-},
- EnableRbac = true,
- EnablePodSecurityPolicy = false,
- NetworkProfile = new ContainerServiceNetworkProfile()
- {
- OutboundType = ContainerServiceOutboundType.LoadBalancer,
- LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard,
- LoadBalancerProfile = new ManagedClusterLoadBalancerProfile()
- {
- ManagedOutboundIPs = new ManagedClusterLoadBalancerProfileManagedOutboundIPs()
- {
- Count = 2,
- },
- },
- },
- AutoScalerProfile = new ManagedClusterAutoScalerProfile()
- {
- ScanIntervalInSeconds = "20s",
- ScaleDownDelayAfterAdd = "15m",
- },
- DiskEncryptionSetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
- Tags =
-{
-["archv2"] = "",
-["tier"] = "production",
-},
- };
- ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data);
- ContainerServiceManagedClusterResource 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
- ContainerServiceManagedClusterData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create Managed Cluster with GPUMIG
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task CreateOrUpdate_CreateManagedClusterWithGPUMIG()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_GPUMIG.json
- // this example is just showing the usage of "ManagedClusters_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 = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
- ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
-
- // get the collection of this ContainerServiceManagedClusterResource
- ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters();
-
- // invoke the operation
- string resourceName = "clustername1";
- ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1"))
- {
- Sku = new ManagedClusterSku()
- {
- Name = new ManagedClusterSkuName("Basic"),
- Tier = ManagedClusterSkuTier.Free,
- },
- KubernetesVersion = "",
- DnsPrefix = "dnsprefix1",
- AgentPoolProfiles =
-{
-new ManagedClusterAgentPoolProfile("nodepool1")
-{
-Count = 3,
-VmSize = "Standard_ND96asr_v4",
-OSType = ContainerServiceOSType.Linux,
-AgentPoolType = AgentPoolType.VirtualMachineScaleSets,
-Mode = AgentPoolMode.System,
-EnableNodePublicIP = true,
-GpuInstanceProfile = GpuInstanceProfile.Mig3G,
-}
-},
- LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[]
- {
-new ContainerServiceSshPublicKey("keydata")
- })),
- WindowsProfile = new ManagedClusterWindowsProfile("azureuser")
- {
- AdminPassword = "replacePassword1234$",
- },
- ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid")
- {
- Secret = "secret",
- },
- AddonProfiles =
-{
-},
- EnableRbac = true,
- EnablePodSecurityPolicy = true,
- NetworkProfile = new ContainerServiceNetworkProfile()
- {
- OutboundType = ContainerServiceOutboundType.LoadBalancer,
- LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard,
- LoadBalancerProfile = new ManagedClusterLoadBalancerProfile()
- {
- ManagedOutboundIPs = new ManagedClusterLoadBalancerProfileManagedOutboundIPs()
- {
- Count = 2,
- },
- },
- },
- AutoScalerProfile = new ManagedClusterAutoScalerProfile()
- {
- ScanIntervalInSeconds = "20s",
- ScaleDownDelayAfterAdd = "15m",
- },
- DiskEncryptionSetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
- HttpProxyConfig = new ManagedClusterHttpProxyConfig()
- {
- HttpProxy = "http://myproxy.server.com:8080",
- HttpsProxy = "https://myproxy.server.com:8080",
- NoProxy =
-{
-"localhost","127.0.0.1"
-},
- TrustedCA = "Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U=",
- },
- Tags =
-{
-["archv2"] = "",
-["tier"] = "production",
-},
- };
- ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data);
- ContainerServiceManagedClusterResource 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
- ContainerServiceManagedClusterData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create Managed Cluster with HTTP proxy configured
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task CreateOrUpdate_CreateManagedClusterWithHTTPProxyConfigured()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_HTTPProxy.json
- // this example is just showing the usage of "ManagedClusters_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 = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
- ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
-
- // get the collection of this ContainerServiceManagedClusterResource
- ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters();
-
- // invoke the operation
- string resourceName = "clustername1";
- ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1"))
- {
- Sku = new ManagedClusterSku()
- {
- Name = new ManagedClusterSkuName("Basic"),
- Tier = ManagedClusterSkuTier.Free,
- },
- KubernetesVersion = "",
- DnsPrefix = "dnsprefix1",
- AgentPoolProfiles =
-{
-new ManagedClusterAgentPoolProfile("nodepool1")
-{
-Count = 3,
-VmSize = "Standard_DS2_v2",
-OSType = ContainerServiceOSType.Linux,
-AgentPoolType = AgentPoolType.VirtualMachineScaleSets,
-Mode = AgentPoolMode.System,
-EnableNodePublicIP = true,
-}
-},
- LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[]
- {
-new ContainerServiceSshPublicKey("keydata")
- })),
- WindowsProfile = new ManagedClusterWindowsProfile("azureuser")
- {
- AdminPassword = "replacePassword1234$",
- },
- ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid")
- {
- Secret = "secret",
- },
- AddonProfiles =
-{
-},
- EnableRbac = true,
- EnablePodSecurityPolicy = true,
- NetworkProfile = new ContainerServiceNetworkProfile()
- {
- OutboundType = ContainerServiceOutboundType.LoadBalancer,
- LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard,
- LoadBalancerProfile = new ManagedClusterLoadBalancerProfile()
- {
- ManagedOutboundIPs = new ManagedClusterLoadBalancerProfileManagedOutboundIPs()
- {
- Count = 2,
- },
- },
- },
- AutoScalerProfile = new ManagedClusterAutoScalerProfile()
- {
- ScanIntervalInSeconds = "20s",
- ScaleDownDelayAfterAdd = "15m",
- },
- DiskEncryptionSetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
- HttpProxyConfig = new ManagedClusterHttpProxyConfig()
- {
- HttpProxy = "http://myproxy.server.com:8080",
- HttpsProxy = "https://myproxy.server.com:8080",
- NoProxy =
-{
-"localhost","127.0.0.1"
-},
- TrustedCA = "Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U=",
- },
- Tags =
-{
-["archv2"] = "",
-["tier"] = "production",
-},
- };
- ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data);
- ContainerServiceManagedClusterResource 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
- ContainerServiceManagedClusterData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create Managed Cluster with LongTermSupport
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task CreateOrUpdate_CreateManagedClusterWithLongTermSupport()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_Premium.json
- // this example is just showing the usage of "ManagedClusters_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 = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
- ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
-
- // get the collection of this ContainerServiceManagedClusterResource
- ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters();
-
- // invoke the operation
- string resourceName = "clustername1";
- ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1"))
- {
- Sku = new ManagedClusterSku()
- {
- Name = ManagedClusterSkuName.Base,
- Tier = ManagedClusterSkuTier.Premium,
- },
- KubernetesVersion = "",
- DnsPrefix = "dnsprefix1",
- AgentPoolProfiles =
-{
-new ManagedClusterAgentPoolProfile("nodepool1")
-{
-Count = 3,
-VmSize = "Standard_DS2_v2",
-OSType = ContainerServiceOSType.Linux,
-AgentPoolType = AgentPoolType.VirtualMachineScaleSets,
-Mode = AgentPoolMode.System,
-EnableNodePublicIP = true,
-EnableEncryptionAtHost = true,
-}
-},
- LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[]
- {
-new ContainerServiceSshPublicKey("keydata")
- })),
- WindowsProfile = new ManagedClusterWindowsProfile("azureuser")
- {
- AdminPassword = "replacePassword1234$",
- },
- ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid")
- {
- Secret = "secret",
- },
- AddonProfiles =
-{
-},
- EnableRbac = true,
- SupportPlan = KubernetesSupportPlan.AKSLongTermSupport,
- EnablePodSecurityPolicy = true,
- NetworkProfile = new ContainerServiceNetworkProfile()
- {
- OutboundType = ContainerServiceOutboundType.LoadBalancer,
- LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard,
- LoadBalancerProfile = new ManagedClusterLoadBalancerProfile()
- {
- ManagedOutboundIPs = new ManagedClusterLoadBalancerProfileManagedOutboundIPs()
- {
- Count = 2,
- },
- },
- },
- AutoScalerProfile = new ManagedClusterAutoScalerProfile()
- {
- ScanIntervalInSeconds = "20s",
- ScaleDownDelayAfterAdd = "15m",
- },
- ApiServerAccessProfile = new ManagedClusterApiServerAccessProfile()
- {
- DisableRunCommand = true,
- },
- Tags =
-{
-["archv2"] = "",
-["tier"] = "production",
-},
- };
- ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data);
- ContainerServiceManagedClusterResource 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
- ContainerServiceManagedClusterData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create Managed Cluster with Node Public IP Prefix
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task CreateOrUpdate_CreateManagedClusterWithNodePublicIPPrefix()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_NodePublicIPPrefix.json
- // this example is just showing the usage of "ManagedClusters_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 = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
- ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
-
- // get the collection of this ContainerServiceManagedClusterResource
- ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters();
-
- // invoke the operation
- string resourceName = "clustername1";
- ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1"))
- {
- Sku = new ManagedClusterSku()
- {
- Name = new ManagedClusterSkuName("Basic"),
- Tier = ManagedClusterSkuTier.Free,
- },
- KubernetesVersion = "",
- DnsPrefix = "dnsprefix1",
- AgentPoolProfiles =
-{
-new ManagedClusterAgentPoolProfile("nodepool1")
-{
-Count = 3,
-VmSize = "Standard_DS2_v2",
-OSType = ContainerServiceOSType.Linux,
-AgentPoolType = AgentPoolType.VirtualMachineScaleSets,
-Mode = AgentPoolMode.System,
-EnableNodePublicIP = true,
-NodePublicIPPrefixId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Network/publicIPPrefixes/public-ip-prefix"),
-}
-},
- LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[]
- {
-new ContainerServiceSshPublicKey("keydata")
- })),
- WindowsProfile = new ManagedClusterWindowsProfile("azureuser")
- {
- AdminPassword = "replacePassword1234$",
- },
- ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid")
- {
- Secret = "secret",
- },
- AddonProfiles =
-{
-},
- EnableRbac = true,
- EnablePodSecurityPolicy = true,
- NetworkProfile = new ContainerServiceNetworkProfile()
- {
- OutboundType = ContainerServiceOutboundType.LoadBalancer,
- LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard,
- LoadBalancerProfile = new ManagedClusterLoadBalancerProfile()
- {
- ManagedOutboundIPs = new ManagedClusterLoadBalancerProfileManagedOutboundIPs()
- {
- Count = 2,
- },
- },
- },
- AutoScalerProfile = new ManagedClusterAutoScalerProfile()
- {
- ScanIntervalInSeconds = "20s",
- ScaleDownDelayAfterAdd = "15m",
- },
- DiskEncryptionSetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
- Tags =
-{
-["archv2"] = "",
-["tier"] = "production",
-},
- };
- ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data);
- ContainerServiceManagedClusterResource 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
- ContainerServiceManagedClusterData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create Managed Cluster with OSSKU
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task CreateOrUpdate_CreateManagedClusterWithOSSKU()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_OSSKU.json
- // this example is just showing the usage of "ManagedClusters_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 = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
- ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
-
- // get the collection of this ContainerServiceManagedClusterResource
- ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters();
-
- // invoke the operation
- string resourceName = "clustername1";
- ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1"))
- {
- Sku = new ManagedClusterSku()
- {
- Name = new ManagedClusterSkuName("Basic"),
- Tier = ManagedClusterSkuTier.Free,
- },
- KubernetesVersion = "",
- DnsPrefix = "dnsprefix1",
- AgentPoolProfiles =
-{
-new ManagedClusterAgentPoolProfile("nodepool1")
-{
-Count = 3,
-VmSize = "Standard_DS2_v2",
-OSType = ContainerServiceOSType.Linux,
-OSSku = ContainerServiceOSSku.AzureLinux,
-AgentPoolType = AgentPoolType.VirtualMachineScaleSets,
-Mode = AgentPoolMode.System,
-EnableNodePublicIP = true,
-}
-},
- LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[]
- {
-new ContainerServiceSshPublicKey("keydata")
- })),
- WindowsProfile = new ManagedClusterWindowsProfile("azureuser")
- {
- AdminPassword = "replacePassword1234$",
- },
- ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid")
- {
- Secret = "secret",
- },
- AddonProfiles =
-{
-},
- EnableRbac = true,
- EnablePodSecurityPolicy = true,
- NetworkProfile = new ContainerServiceNetworkProfile()
- {
- OutboundType = ContainerServiceOutboundType.LoadBalancer,
- LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard,
- LoadBalancerProfile = new ManagedClusterLoadBalancerProfile()
- {
- ManagedOutboundIPs = new ManagedClusterLoadBalancerProfileManagedOutboundIPs()
- {
- Count = 2,
- },
- },
- },
- AutoScalerProfile = new ManagedClusterAutoScalerProfile()
- {
- ScanIntervalInSeconds = "20s",
- ScaleDownDelayAfterAdd = "15m",
- },
- DiskEncryptionSetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
- HttpProxyConfig = new ManagedClusterHttpProxyConfig()
- {
- HttpProxy = "http://myproxy.server.com:8080",
- HttpsProxy = "https://myproxy.server.com:8080",
- NoProxy =
-{
-"localhost","127.0.0.1"
-},
- TrustedCA = "Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U=",
- },
- Tags =
-{
-["archv2"] = "",
-["tier"] = "production",
-},
- };
- ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data);
- ContainerServiceManagedClusterResource 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
- ContainerServiceManagedClusterData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create Managed Cluster with PPG
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task CreateOrUpdate_CreateManagedClusterWithPPG()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_PPG.json
- // this example is just showing the usage of "ManagedClusters_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 = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
- ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
-
- // get the collection of this ContainerServiceManagedClusterResource
- ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters();
-
- // invoke the operation
- string resourceName = "clustername1";
- ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1"))
- {
- Sku = new ManagedClusterSku()
- {
- Name = new ManagedClusterSkuName("Basic"),
- Tier = ManagedClusterSkuTier.Free,
- },
- KubernetesVersion = "",
- DnsPrefix = "dnsprefix1",
- AgentPoolProfiles =
-{
-new ManagedClusterAgentPoolProfile("nodepool1")
-{
-Count = 3,
-VmSize = "Standard_DS2_v2",
-OSType = ContainerServiceOSType.Linux,
-AgentPoolType = AgentPoolType.VirtualMachineScaleSets,
-Mode = AgentPoolMode.System,
-EnableNodePublicIP = true,
-ProximityPlacementGroupId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"),
-}
-},
- LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[]
- {
-new ContainerServiceSshPublicKey("keydata")
- })),
- WindowsProfile = new ManagedClusterWindowsProfile("azureuser")
- {
- AdminPassword = "replacePassword1234$",
- },
- ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid")
- {
- Secret = "secret",
- },
- AddonProfiles =
-{
-},
- EnableRbac = true,
- EnablePodSecurityPolicy = true,
- NetworkProfile = new ContainerServiceNetworkProfile()
- {
- OutboundType = ContainerServiceOutboundType.LoadBalancer,
- LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard,
- LoadBalancerProfile = new ManagedClusterLoadBalancerProfile()
- {
- ManagedOutboundIPs = new ManagedClusterLoadBalancerProfileManagedOutboundIPs()
- {
- Count = 2,
- },
- },
- },
- AutoScalerProfile = new ManagedClusterAutoScalerProfile()
- {
- ScanIntervalInSeconds = "20s",
- ScaleDownDelayAfterAdd = "15m",
- },
- DiskEncryptionSetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
- Tags =
-{
-["archv2"] = "",
-["tier"] = "production",
-},
- };
- ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data);
- ContainerServiceManagedClusterResource 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
- ContainerServiceManagedClusterData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create Managed Cluster with PodIdentity enabled
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task CreateOrUpdate_CreateManagedClusterWithPodIdentityEnabled()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_PodIdentity.json
- // this example is just showing the usage of "ManagedClusters_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 = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
- ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
-
- // get the collection of this ContainerServiceManagedClusterResource
- ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters();
-
- // invoke the operation
- string resourceName = "clustername1";
- ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1"))
- {
- Sku = new ManagedClusterSku()
- {
- Name = new ManagedClusterSkuName("Basic"),
- Tier = ManagedClusterSkuTier.Free,
- },
- KubernetesVersion = "",
- DnsPrefix = "dnsprefix1",
- AgentPoolProfiles =
-{
-new ManagedClusterAgentPoolProfile("nodepool1")
-{
-Count = 3,
-VmSize = "Standard_DS2_v2",
-OSType = ContainerServiceOSType.Linux,
-AgentPoolType = AgentPoolType.VirtualMachineScaleSets,
-Mode = AgentPoolMode.System,
-EnableNodePublicIP = true,
-}
-},
- LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[]
- {
-new ContainerServiceSshPublicKey("keydata")
- })),
- WindowsProfile = new ManagedClusterWindowsProfile("azureuser")
- {
- AdminPassword = "replacePassword1234$",
- },
- ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid")
- {
- Secret = "secret",
- },
- AddonProfiles =
-{
-},
- PodIdentityProfile = new ManagedClusterPodIdentityProfile()
- {
- IsEnabled = true,
- AllowNetworkPluginKubenet = true,
- },
- EnableRbac = true,
- EnablePodSecurityPolicy = true,
- NetworkProfile = new ContainerServiceNetworkProfile()
- {
- OutboundType = ContainerServiceOutboundType.LoadBalancer,
- LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard,
- LoadBalancerProfile = new ManagedClusterLoadBalancerProfile()
- {
- ManagedOutboundIPs = new ManagedClusterLoadBalancerProfileManagedOutboundIPs()
- {
- Count = 2,
- },
- },
- },
- AutoScalerProfile = new ManagedClusterAutoScalerProfile()
- {
- ScanIntervalInSeconds = "20s",
- ScaleDownDelayAfterAdd = "15m",
- },
- DiskEncryptionSetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
- Tags =
-{
-["archv2"] = "",
-["tier"] = "production",
-},
- };
- ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data);
- ContainerServiceManagedClusterResource 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
- ContainerServiceManagedClusterData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create Managed Cluster with RunCommand disabled
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task CreateOrUpdate_CreateManagedClusterWithRunCommandDisabled()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_DisableRunCommand.json
- // this example is just showing the usage of "ManagedClusters_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 = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
- ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
-
- // get the collection of this ContainerServiceManagedClusterResource
- ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters();
-
- // invoke the operation
- string resourceName = "clustername1";
- ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1"))
- {
- Sku = new ManagedClusterSku()
- {
- Name = new ManagedClusterSkuName("Basic"),
- Tier = ManagedClusterSkuTier.Free,
- },
- KubernetesVersion = "",
- DnsPrefix = "dnsprefix1",
- AgentPoolProfiles =
-{
-new ManagedClusterAgentPoolProfile("nodepool1")
-{
-Count = 3,
-VmSize = "Standard_DS2_v2",
-OSType = ContainerServiceOSType.Linux,
-AgentPoolType = AgentPoolType.VirtualMachineScaleSets,
-Mode = AgentPoolMode.System,
-EnableNodePublicIP = true,
-EnableEncryptionAtHost = true,
-}
-},
- LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[]
- {
-new ContainerServiceSshPublicKey("keydata")
- })),
- WindowsProfile = new ManagedClusterWindowsProfile("azureuser")
- {
- AdminPassword = "replacePassword1234$",
- },
- ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid")
- {
- Secret = "secret",
- },
- AddonProfiles =
-{
-},
- EnableRbac = true,
- EnablePodSecurityPolicy = true,
- NetworkProfile = new ContainerServiceNetworkProfile()
- {
- OutboundType = ContainerServiceOutboundType.LoadBalancer,
- LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard,
- LoadBalancerProfile = new ManagedClusterLoadBalancerProfile()
- {
- ManagedOutboundIPs = new ManagedClusterLoadBalancerProfileManagedOutboundIPs()
- {
- Count = 2,
- },
- },
- },
- AutoScalerProfile = new ManagedClusterAutoScalerProfile()
- {
- ScanIntervalInSeconds = "20s",
- ScaleDownDelayAfterAdd = "15m",
- },
- ApiServerAccessProfile = new ManagedClusterApiServerAccessProfile()
- {
- DisableRunCommand = true,
- },
- Tags =
-{
-["archv2"] = "",
-["tier"] = "production",
-},
- };
- ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data);
- ContainerServiceManagedClusterResource 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
- ContainerServiceManagedClusterData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create Managed Cluster with Security Profile configured
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task CreateOrUpdate_CreateManagedClusterWithSecurityProfileConfigured()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_SecurityProfile.json
- // this example is just showing the usage of "ManagedClusters_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 = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
- ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
-
- // get the collection of this ContainerServiceManagedClusterResource
- ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters();
-
- // invoke the operation
- string resourceName = "clustername1";
- ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1"))
- {
- Sku = new ManagedClusterSku()
- {
- Name = new ManagedClusterSkuName("Basic"),
- Tier = ManagedClusterSkuTier.Free,
- },
- KubernetesVersion = "",
- DnsPrefix = "dnsprefix1",
- AgentPoolProfiles =
-{
-new ManagedClusterAgentPoolProfile("nodepool1")
-{
-Count = 3,
-VmSize = "Standard_DS2_v2",
-OSType = ContainerServiceOSType.Linux,
-AgentPoolType = AgentPoolType.VirtualMachineScaleSets,
-Mode = AgentPoolMode.System,
-EnableNodePublicIP = true,
-}
-},
- LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[]
- {
-new ContainerServiceSshPublicKey("keydata")
- })),
- NetworkProfile = new ContainerServiceNetworkProfile()
- {
- OutboundType = ContainerServiceOutboundType.LoadBalancer,
- LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard,
- LoadBalancerProfile = new ManagedClusterLoadBalancerProfile()
- {
- ManagedOutboundIPs = new ManagedClusterLoadBalancerProfileManagedOutboundIPs()
- {
- Count = 2,
- },
- },
- },
- SecurityProfile = new ManagedClusterSecurityProfile()
- {
- Defender = new ManagedClusterSecurityProfileDefender()
- {
- LogAnalyticsWorkspaceResourceId = new ResourceIdentifier("/subscriptions/SUB_ID/resourcegroups/RG_NAME/providers/microsoft.operationalinsights/workspaces/WORKSPACE_NAME"),
- IsSecurityMonitoringEnabled = true,
- },
- IsWorkloadIdentityEnabled = true,
- },
- Tags =
-{
-["archv2"] = "",
-["tier"] = "production",
-},
- };
- ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data);
- ContainerServiceManagedClusterResource 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
- ContainerServiceManagedClusterData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create Managed Cluster with UltraSSD enabled
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task CreateOrUpdate_CreateManagedClusterWithUltraSSDEnabled()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_EnableUltraSSD.json
- // this example is just showing the usage of "ManagedClusters_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 = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
- ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
-
- // get the collection of this ContainerServiceManagedClusterResource
- ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters();
-
- // invoke the operation
- string resourceName = "clustername1";
- ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1"))
- {
- Sku = new ManagedClusterSku()
- {
- Name = new ManagedClusterSkuName("Basic"),
- Tier = ManagedClusterSkuTier.Free,
- },
- KubernetesVersion = "",
- DnsPrefix = "dnsprefix1",
- AgentPoolProfiles =
-{
-new ManagedClusterAgentPoolProfile("nodepool1")
-{
-Count = 3,
-VmSize = "Standard_DS2_v2",
-OSType = ContainerServiceOSType.Linux,
-AgentPoolType = AgentPoolType.VirtualMachineScaleSets,
-Mode = AgentPoolMode.System,
-EnableNodePublicIP = true,
-EnableUltraSsd = true,
-}
-},
- LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[]
- {
-new ContainerServiceSshPublicKey("keydata")
- })),
- WindowsProfile = new ManagedClusterWindowsProfile("azureuser")
- {
- AdminPassword = "replacePassword1234$",
- },
- ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid")
- {
- Secret = "secret",
- },
- AddonProfiles =
-{
-},
- EnableRbac = true,
- EnablePodSecurityPolicy = true,
- NetworkProfile = new ContainerServiceNetworkProfile()
- {
- OutboundType = ContainerServiceOutboundType.LoadBalancer,
- LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard,
- LoadBalancerProfile = new ManagedClusterLoadBalancerProfile()
- {
- ManagedOutboundIPs = new ManagedClusterLoadBalancerProfileManagedOutboundIPs()
- {
- Count = 2,
- },
- },
- },
- AutoScalerProfile = new ManagedClusterAutoScalerProfile()
- {
- ScanIntervalInSeconds = "20s",
- ScaleDownDelayAfterAdd = "15m",
- },
- DiskEncryptionSetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
- Tags =
-{
-["archv2"] = "",
-["tier"] = "production",
-},
- };
- ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data);
- ContainerServiceManagedClusterResource 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
- ContainerServiceManagedClusterData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create Managed Cluster with user-assigned NAT gateway as outbound type
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task CreateOrUpdate_CreateManagedClusterWithUserAssignedNATGatewayAsOutboundType()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_UserAssignedNATGateway.json
- // this example is just showing the usage of "ManagedClusters_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 = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
- ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
-
- // get the collection of this ContainerServiceManagedClusterResource
- ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters();
-
- // invoke the operation
- string resourceName = "clustername1";
- ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1"))
- {
- Sku = new ManagedClusterSku()
- {
- Name = new ManagedClusterSkuName("Basic"),
- Tier = ManagedClusterSkuTier.Free,
- },
- KubernetesVersion = "",
- DnsPrefix = "dnsprefix1",
- AgentPoolProfiles =
-{
-new ManagedClusterAgentPoolProfile("nodepool1")
-{
-Count = 3,
-VmSize = "Standard_DS2_v2",
-OSType = ContainerServiceOSType.Linux,
-AgentPoolType = AgentPoolType.VirtualMachineScaleSets,
-Mode = AgentPoolMode.System,
-EnableNodePublicIP = false,
-}
-},
- LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[]
- {
-new ContainerServiceSshPublicKey("keydata")
- })),
- WindowsProfile = new ManagedClusterWindowsProfile("azureuser")
- {
- AdminPassword = "replacePassword1234$",
- },
- ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid")
- {
- Secret = "secret",
- },
- AddonProfiles =
-{
-},
- EnableRbac = true,
- EnablePodSecurityPolicy = true,
- NetworkProfile = new ContainerServiceNetworkProfile()
- {
- OutboundType = ContainerServiceOutboundType.UserAssignedNatGateway,
- LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard,
- },
- AutoScalerProfile = new ManagedClusterAutoScalerProfile()
- {
- ScanIntervalInSeconds = "20s",
- ScaleDownDelayAfterAdd = "15m",
- },
- DiskEncryptionSetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
- Tags =
-{
-["archv2"] = "",
-["tier"] = "production",
-},
- };
- ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data);
- ContainerServiceManagedClusterResource 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
- ContainerServiceManagedClusterData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create Managed Private Cluster with Public FQDN specified
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task CreateOrUpdate_CreateManagedPrivateClusterWithPublicFQDNSpecified()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_PrivateClusterPublicFQDN.json
- // this example is just showing the usage of "ManagedClusters_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 = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
- ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
-
- // get the collection of this ContainerServiceManagedClusterResource
- ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters();
-
- // invoke the operation
- string resourceName = "clustername1";
- ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1"))
- {
- Sku = new ManagedClusterSku()
- {
- Name = new ManagedClusterSkuName("Basic"),
- Tier = ManagedClusterSkuTier.Free,
- },
- KubernetesVersion = "",
- DnsPrefix = "dnsprefix1",
- AgentPoolProfiles =
-{
-new ManagedClusterAgentPoolProfile("nodepool1")
-{
-Count = 3,
-VmSize = "Standard_DS2_v2",
-OSType = ContainerServiceOSType.Linux,
-AgentPoolType = AgentPoolType.VirtualMachineScaleSets,
-Mode = AgentPoolMode.System,
-EnableNodePublicIP = true,
-EnableEncryptionAtHost = true,
-}
-},
- LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[]
- {
-new ContainerServiceSshPublicKey("keydata")
- })),
- WindowsProfile = new ManagedClusterWindowsProfile("azureuser")
- {
- AdminPassword = "replacePassword1234$",
- },
- ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid")
- {
- Secret = "secret",
- },
- AddonProfiles =
-{
-},
- EnableRbac = true,
- EnablePodSecurityPolicy = true,
- NetworkProfile = new ContainerServiceNetworkProfile()
- {
- OutboundType = ContainerServiceOutboundType.LoadBalancer,
- LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard,
- LoadBalancerProfile = new ManagedClusterLoadBalancerProfile()
- {
- ManagedOutboundIPs = new ManagedClusterLoadBalancerProfileManagedOutboundIPs()
- {
- Count = 2,
- },
- },
- },
- AutoScalerProfile = new ManagedClusterAutoScalerProfile()
- {
- ScanIntervalInSeconds = "20s",
- ScaleDownDelayAfterAdd = "15m",
- },
- ApiServerAccessProfile = new ManagedClusterApiServerAccessProfile()
- {
- EnablePrivateCluster = true,
- EnablePrivateClusterPublicFqdn = true,
- },
- Tags =
-{
-["archv2"] = "",
-["tier"] = "production",
-},
- };
- ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data);
- ContainerServiceManagedClusterResource 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
- ContainerServiceManagedClusterData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create Managed Private Cluster with fqdn subdomain specified
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task CreateOrUpdate_CreateManagedPrivateClusterWithFqdnSubdomainSpecified()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_PrivateClusterFQDNSubdomain.json
- // this example is just showing the usage of "ManagedClusters_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 = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
- ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
-
- // get the collection of this ContainerServiceManagedClusterResource
- ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters();
-
- // invoke the operation
- string resourceName = "clustername1";
- ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1"))
- {
- Sku = new ManagedClusterSku()
- {
- Name = new ManagedClusterSkuName("Basic"),
- Tier = ManagedClusterSkuTier.Free,
- },
- KubernetesVersion = "",
- FqdnSubdomain = "domain1",
- AgentPoolProfiles =
-{
-new ManagedClusterAgentPoolProfile("nodepool1")
-{
-Count = 3,
-VmSize = "Standard_DS2_v2",
-OSType = ContainerServiceOSType.Linux,
-AgentPoolType = AgentPoolType.VirtualMachineScaleSets,
-Mode = AgentPoolMode.System,
-EnableNodePublicIP = true,
-EnableEncryptionAtHost = true,
-}
-},
- LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[]
- {
-new ContainerServiceSshPublicKey("keydata")
- })),
- WindowsProfile = new ManagedClusterWindowsProfile("azureuser")
- {
- AdminPassword = "replacePassword1234$",
- },
- ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid")
- {
- Secret = "secret",
- },
- AddonProfiles =
-{
-},
- EnableRbac = true,
- EnablePodSecurityPolicy = true,
- NetworkProfile = new ContainerServiceNetworkProfile()
- {
- OutboundType = ContainerServiceOutboundType.LoadBalancer,
- LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard,
- LoadBalancerProfile = new ManagedClusterLoadBalancerProfile()
- {
- ManagedOutboundIPs = new ManagedClusterLoadBalancerProfileManagedOutboundIPs()
- {
- Count = 2,
- },
- },
- },
- AutoScalerProfile = new ManagedClusterAutoScalerProfile()
- {
- ScanIntervalInSeconds = "20s",
- ScaleDownDelayAfterAdd = "15m",
- },
- ApiServerAccessProfile = new ManagedClusterApiServerAccessProfile()
- {
- EnablePrivateCluster = true,
- PrivateDnsZone = "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Network/privateDnsZones/privatelink.location1.azmk8s.io",
- },
- Tags =
-{
-["archv2"] = "",
-["tier"] = "production",
-},
- };
- ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data);
- ContainerServiceManagedClusterResource 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
- ContainerServiceManagedClusterData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create/Update AAD Managed Cluster with EnableAzureRBAC
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task CreateOrUpdate_CreateUpdateAADManagedClusterWithEnableAzureRBAC()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_UpdateWithEnableAzureRBAC.json
- // this example is just showing the usage of "ManagedClusters_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 = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
- ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
-
- // get the collection of this ContainerServiceManagedClusterResource
- ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters();
-
- // invoke the operation
- string resourceName = "clustername1";
- ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1"))
- {
- Sku = new ManagedClusterSku()
- {
- Name = new ManagedClusterSkuName("Basic"),
- Tier = ManagedClusterSkuTier.Free,
- },
- KubernetesVersion = "",
- DnsPrefix = "dnsprefix1",
- AgentPoolProfiles =
-{
-new ManagedClusterAgentPoolProfile("nodepool1")
-{
-Count = 3,
-VmSize = "Standard_DS1_v2",
-OSType = ContainerServiceOSType.Linux,
-AgentPoolType = AgentPoolType.VirtualMachineScaleSets,
-Mode = AgentPoolMode.System,
-AvailabilityZones =
-{
-"1","2","3"
-},
-EnableNodePublicIP = true,
-}
-},
- LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[]
- {
-new ContainerServiceSshPublicKey("keydata")
- })),
- WindowsProfile = new ManagedClusterWindowsProfile("azureuser")
- {
- AdminPassword = "replacePassword1234$",
- },
- ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid")
- {
- Secret = "secret",
- },
- AddonProfiles =
-{
-},
- EnableRbac = true,
- EnablePodSecurityPolicy = true,
- NetworkProfile = new ContainerServiceNetworkProfile()
- {
- OutboundType = ContainerServiceOutboundType.LoadBalancer,
- LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard,
- LoadBalancerProfile = new ManagedClusterLoadBalancerProfile()
- {
- ManagedOutboundIPs = new ManagedClusterLoadBalancerProfileManagedOutboundIPs()
- {
- Count = 2,
- },
- },
- },
- AadProfile = new ManagedClusterAadProfile()
- {
- IsManagedAadEnabled = true,
- IsAzureRbacEnabled = true,
- },
- AutoScalerProfile = new ManagedClusterAutoScalerProfile()
- {
- ScanIntervalInSeconds = "20s",
- ScaleDownDelayAfterAdd = "15m",
- },
- DiskEncryptionSetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
- Tags =
-{
-["archv2"] = "",
-["tier"] = "production",
-},
- };
- ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data);
- ContainerServiceManagedClusterResource 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
- ContainerServiceManagedClusterData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create/Update Managed Cluster
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task CreateOrUpdate_CreateUpdateManagedCluster()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_Update.json
- // this example is just showing the usage of "ManagedClusters_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 = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
- ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
-
- // get the collection of this ContainerServiceManagedClusterResource
- ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters();
-
- // invoke the operation
- string resourceName = "clustername1";
- ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1"))
- {
- Sku = new ManagedClusterSku()
- {
- Name = new ManagedClusterSkuName("Basic"),
- Tier = ManagedClusterSkuTier.Free,
- },
- ClusterIdentity = new ManagedClusterIdentity()
- {
- ResourceIdentityType = "UserAssigned",
- UserAssignedIdentities =
-{
-[new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1")] = new UserAssignedIdentity(),
-},
- },
- KubernetesVersion = "",
- DnsPrefix = "dnsprefix1",
- AgentPoolProfiles =
-{
-new ManagedClusterAgentPoolProfile("nodepool1")
-{
-Count = 3,
-VmSize = "Standard_DS1_v2",
-OSType = ContainerServiceOSType.Linux,
-ScaleDownMode = ScaleDownMode.Deallocate,
-AgentPoolType = AgentPoolType.VirtualMachineScaleSets,
-Mode = AgentPoolMode.System,
-AvailabilityZones =
-{
-"1","2","3"
-},
-EnableNodePublicIP = true,
-}
-},
- LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[]
- {
-new ContainerServiceSshPublicKey("keydata")
- })),
- WindowsProfile = new ManagedClusterWindowsProfile("azureuser")
- {
- AdminPassword = "replacePassword1234$",
- },
- ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid")
- {
- Secret = "secret",
- },
- AddonProfiles =
-{
-},
- EnableRbac = true,
- EnablePodSecurityPolicy = true,
- NetworkProfile = new ContainerServiceNetworkProfile()
- {
- OutboundType = ContainerServiceOutboundType.LoadBalancer,
- LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard,
- LoadBalancerProfile = new ManagedClusterLoadBalancerProfile()
- {
- ManagedOutboundIPs = new ManagedClusterLoadBalancerProfileManagedOutboundIPs()
- {
- Count = 2,
- },
- },
- },
- UpgradeOverrideSettings = new UpgradeOverrideSettings()
- {
- ForceUpgrade = false,
- Until = DateTimeOffset.Parse("2022-11-01T13:00:00Z"),
- },
- AutoScalerProfile = new ManagedClusterAutoScalerProfile()
- {
- BalanceSimilarNodeGroups = "true",
- Expander = AutoScaleExpander.Priority,
- MaxNodeProvisionTime = "15m",
- NewPodScaleUpDelay = "1m",
- ScanIntervalInSeconds = "20s",
- ScaleDownDelayAfterAdd = "15m",
- SkipNodesWithSystemPods = "false",
- },
- DiskEncryptionSetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
- Tags =
-{
-["archv2"] = "",
-["tier"] = "production",
-},
- };
- ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data);
- ContainerServiceManagedClusterResource 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
- ContainerServiceManagedClusterData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create/Update Managed Cluster with Azure Service Mesh
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task CreateOrUpdate_CreateUpdateManagedClusterWithAzureServiceMesh()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_AzureServiceMesh.json
- // this example is just showing the usage of "ManagedClusters_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 = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
- ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
-
- // get the collection of this ContainerServiceManagedClusterResource
- ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters();
-
- // invoke the operation
- string resourceName = "clustername1";
- ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1"))
- {
- Sku = new ManagedClusterSku()
- {
- Name = new ManagedClusterSkuName("Basic"),
- Tier = ManagedClusterSkuTier.Free,
- },
- KubernetesVersion = "",
- DnsPrefix = "dnsprefix1",
- AgentPoolProfiles =
-{
-new ManagedClusterAgentPoolProfile("nodepool1")
-{
-Count = 3,
-VmSize = "Standard_DS2_v2",
-OSType = ContainerServiceOSType.Linux,
-AgentPoolType = AgentPoolType.VirtualMachineScaleSets,
-Mode = AgentPoolMode.System,
-EnableNodePublicIP = true,
-}
-},
- LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[]
- {
-new ContainerServiceSshPublicKey("keydata")
- })),
- WindowsProfile = new ManagedClusterWindowsProfile("azureuser")
- {
- AdminPassword = "replacePassword1234$",
- },
- ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid")
- {
- Secret = "secret",
- },
- AddonProfiles =
-{
-["azureKeyvaultSecretsProvider"] = new ManagedClusterAddonProfile(true)
-{
-Config =
-{
-["enableSecretRotation"] = "true",
-["rotationPollInterval"] = "2m",
-},
-},
-},
- EnableRbac = true,
- EnablePodSecurityPolicy = true,
- NetworkProfile = new ContainerServiceNetworkProfile()
- {
- OutboundType = ContainerServiceOutboundType.LoadBalancer,
- LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard,
- LoadBalancerProfile = new ManagedClusterLoadBalancerProfile()
- {
- ManagedOutboundIPs = new ManagedClusterLoadBalancerProfileManagedOutboundIPs()
- {
- Count = 2,
- },
- },
- },
- AutoScalerProfile = new ManagedClusterAutoScalerProfile()
- {
- ScanIntervalInSeconds = "20s",
- ScaleDownDelayAfterAdd = "15m",
- },
- DiskEncryptionSetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
- ServiceMeshProfile = new ServiceMeshProfile(ServiceMeshMode.Istio)
- {
- Istio = new IstioServiceMesh()
- {
- Components = new IstioComponents()
- {
- IngressGateways =
-{
-new IstioIngressGateway(IstioIngressGatewayMode.Internal,true)
-},
- EgressGateways =
-{
-new IstioEgressGateway(true)
-{
-NodeSelector =
-{
-["istio"] = "egress",
-},
-}
-},
- },
- CertificateAuthorityPlugin = new IstioPluginCertificateAuthority()
- {
- KeyVaultId = new ResourceIdentifier("/subscriptions/854c9ddb-fe9e-4aea-8d58-99ed88282881/resourceGroups/ddama-test/providers/Microsoft.KeyVault/vaults/my-akv"),
- CertObjectName = "ca-cert",
- KeyObjectName = "ca-key",
- RootCertObjectName = "root-cert",
- CertChainObjectName = "cert-chain",
- },
- },
- },
- Tags =
-{
-["archv2"] = "",
-["tier"] = "production",
-},
- };
- ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data);
- ContainerServiceManagedClusterResource 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
- ContainerServiceManagedClusterData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create/Update Managed Cluster with EnableAHUB
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task CreateOrUpdate_CreateUpdateManagedClusterWithEnableAHUB()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_UpdateWithAHUB.json
- // this example is just showing the usage of "ManagedClusters_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 = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
- ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
-
- // get the collection of this ContainerServiceManagedClusterResource
- ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters();
-
- // invoke the operation
- string resourceName = "clustername1";
- ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1"))
- {
- Sku = new ManagedClusterSku()
- {
- Name = new ManagedClusterSkuName("Basic"),
- Tier = ManagedClusterSkuTier.Free,
- },
- ClusterIdentity = new ManagedClusterIdentity()
- {
- ResourceIdentityType = "UserAssigned",
- UserAssignedIdentities =
-{
-[new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1")] = new UserAssignedIdentity(),
-},
- },
- KubernetesVersion = "",
- DnsPrefix = "dnsprefix1",
- AgentPoolProfiles =
-{
-new ManagedClusterAgentPoolProfile("nodepool1")
-{
-Count = 3,
-VmSize = "Standard_DS1_v2",
-OSType = ContainerServiceOSType.Linux,
-AgentPoolType = AgentPoolType.VirtualMachineScaleSets,
-Mode = AgentPoolMode.System,
-AvailabilityZones =
-{
-"1","2","3"
-},
-EnableNodePublicIP = true,
-}
-},
- LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[]
- {
-new ContainerServiceSshPublicKey("keydata")
- })),
- WindowsProfile = new ManagedClusterWindowsProfile("azureuser")
- {
- AdminPassword = "replacePassword1234$",
- LicenseType = WindowsVmLicenseType.WindowsServer,
- },
- ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid")
- {
- Secret = "secret",
- },
- AddonProfiles =
-{
-},
- EnableRbac = true,
- EnablePodSecurityPolicy = true,
- NetworkProfile = new ContainerServiceNetworkProfile()
- {
- OutboundType = ContainerServiceOutboundType.LoadBalancer,
- LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard,
- LoadBalancerProfile = new ManagedClusterLoadBalancerProfile()
- {
- ManagedOutboundIPs = new ManagedClusterLoadBalancerProfileManagedOutboundIPs()
- {
- Count = 2,
- },
- },
- },
- AutoScalerProfile = new ManagedClusterAutoScalerProfile()
- {
- ScanIntervalInSeconds = "20s",
- ScaleDownDelayAfterAdd = "15m",
- },
- DiskEncryptionSetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
- Tags =
-{
-["archv2"] = "",
-["tier"] = "production",
-},
- };
- ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data);
- ContainerServiceManagedClusterResource 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
- ContainerServiceManagedClusterData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create/Update Managed Cluster with Windows gMSA enabled
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task CreateOrUpdate_CreateUpdateManagedClusterWithWindowsGMSAEnabled()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_UpdateWindowsGmsa.json
- // this example is just showing the usage of "ManagedClusters_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 = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
- ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
-
- // get the collection of this ContainerServiceManagedClusterResource
- ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters();
-
- // invoke the operation
- string resourceName = "clustername1";
- ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1"))
- {
- Sku = new ManagedClusterSku()
- {
- Name = new ManagedClusterSkuName("Basic"),
- Tier = ManagedClusterSkuTier.Free,
- },
- ClusterIdentity = new ManagedClusterIdentity()
- {
- ResourceIdentityType = "UserAssigned",
- UserAssignedIdentities =
-{
-[new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1")] = new UserAssignedIdentity(),
-},
- },
- KubernetesVersion = "",
- DnsPrefix = "dnsprefix1",
- AgentPoolProfiles =
-{
-new ManagedClusterAgentPoolProfile("nodepool1")
-{
-Count = 3,
-VmSize = "Standard_DS1_v2",
-OSType = ContainerServiceOSType.Linux,
-AgentPoolType = AgentPoolType.VirtualMachineScaleSets,
-Mode = AgentPoolMode.System,
-AvailabilityZones =
-{
-"1","2","3"
-},
-EnableNodePublicIP = true,
-}
-},
- LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[]
- {
-new ContainerServiceSshPublicKey("keydata")
- })),
- WindowsProfile = new ManagedClusterWindowsProfile("azureuser")
- {
- AdminPassword = "replacePassword1234$",
- GmsaProfile = new WindowsGmsaProfile()
- {
- IsEnabled = true,
- },
- },
- ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid")
- {
- Secret = "secret",
- },
- AddonProfiles =
-{
-},
- EnableRbac = true,
- EnablePodSecurityPolicy = true,
- NetworkProfile = new ContainerServiceNetworkProfile()
- {
- OutboundType = ContainerServiceOutboundType.LoadBalancer,
- LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard,
- LoadBalancerProfile = new ManagedClusterLoadBalancerProfile()
- {
- ManagedOutboundIPs = new ManagedClusterLoadBalancerProfileManagedOutboundIPs()
- {
- Count = 2,
- },
- },
- },
- AutoScalerProfile = new ManagedClusterAutoScalerProfile()
- {
- ScanIntervalInSeconds = "20s",
- ScaleDownDelayAfterAdd = "15m",
- },
- DiskEncryptionSetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
- Tags =
-{
-["archv2"] = "",
-["tier"] = "production",
-},
- };
- ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data);
- ContainerServiceManagedClusterResource 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
- ContainerServiceManagedClusterData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create/Update Managed Cluster with dual-stack networking
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task CreateOrUpdate_CreateUpdateManagedClusterWithDualStackNetworking()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_DualStackNetworking.json
- // this example is just showing the usage of "ManagedClusters_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 = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
- ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
-
- // get the collection of this ContainerServiceManagedClusterResource
- ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters();
-
- // invoke the operation
- string resourceName = "clustername1";
- ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1"))
- {
- Sku = new ManagedClusterSku()
- {
- Name = new ManagedClusterSkuName("Basic"),
- Tier = ManagedClusterSkuTier.Free,
- },
- ClusterIdentity = new ManagedClusterIdentity()
- {
- ResourceIdentityType = "UserAssigned",
- UserAssignedIdentities =
-{
-[new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1")] = new UserAssignedIdentity(),
-},
- },
- KubernetesVersion = "",
- DnsPrefix = "dnsprefix1",
- AgentPoolProfiles =
-{
-new ManagedClusterAgentPoolProfile("nodepool1")
-{
-Count = 3,
-VmSize = "Standard_DS1_v2",
-OSType = ContainerServiceOSType.Linux,
-ScaleDownMode = ScaleDownMode.Deallocate,
-AgentPoolType = AgentPoolType.VirtualMachineScaleSets,
-Mode = AgentPoolMode.System,
-AvailabilityZones =
-{
-"1","2","3"
-},
-EnableNodePublicIP = true,
-}
-},
- LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[]
- {
-new ContainerServiceSshPublicKey("keydata")
- })),
- WindowsProfile = new ManagedClusterWindowsProfile("azureuser")
- {
- AdminPassword = "replacePassword1234$",
- },
- ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid")
- {
- Secret = "secret",
- },
- AddonProfiles =
-{
-},
- EnableRbac = true,
- EnablePodSecurityPolicy = true,
- NetworkProfile = new ContainerServiceNetworkProfile()
- {
- OutboundType = ContainerServiceOutboundType.LoadBalancer,
- LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard,
- LoadBalancerProfile = new ManagedClusterLoadBalancerProfile()
- {
- ManagedOutboundIPs = new ManagedClusterLoadBalancerProfileManagedOutboundIPs()
- {
- Count = 2,
- },
- },
- IPFamilies =
-{
-IPFamily.IPv4,IPFamily.IPv6
-},
- },
- AutoScalerProfile = new ManagedClusterAutoScalerProfile()
- {
- BalanceSimilarNodeGroups = "true",
- Expander = AutoScaleExpander.Priority,
- MaxNodeProvisionTime = "15m",
- NewPodScaleUpDelay = "1m",
- ScanIntervalInSeconds = "20s",
- ScaleDownDelayAfterAdd = "15m",
- SkipNodesWithSystemPods = "false",
- },
- DiskEncryptionSetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
- Tags =
-{
-["archv2"] = "",
-["tier"] = "production",
-},
- };
- ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data);
- ContainerServiceManagedClusterResource 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
- ContainerServiceManagedClusterData 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_ContainerServiceManagedClusterResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceManagedClusterResource.cs
deleted file mode 100644
index 268529b0778f..000000000000
--- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceManagedClusterResource.cs
+++ /dev/null
@@ -1,665 +0,0 @@
-// 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;
-
-namespace Azure.ResourceManager.ContainerService.Samples
-{
- public partial class Sample_ContainerServiceManagedClusterResource
- {
- // List Managed Clusters
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- 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";
- 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())
- {
- // 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;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- Console.WriteLine($"Succeeded");
- }
-
- // Get Managed Cluster
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task GetAccessProfile_GetManagedCluster()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGetAccessProfile.json
- // this example is just showing the usage of "ManagedClusters_GetAccessProfile" 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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // invoke the operation
- string roleName = "clusterUser";
- ManagedClusterAccessProfile result = await containerServiceManagedCluster.GetAccessProfileAsync(roleName);
-
- Console.WriteLine($"Succeeded: {result}");
- }
-
- // Get Managed Cluster
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task GetClusterAdminCredentials_GetManagedCluster()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersListClusterAdminCredentials.json
- // this example is just showing the usage of "ManagedClusters_ListClusterAdminCredentials" 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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // invoke the operation
- ManagedClusterCredentials result = await containerServiceManagedCluster.GetClusterAdminCredentialsAsync();
-
- Console.WriteLine($"Succeeded: {result}");
- }
-
- // Get Managed Cluster
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task GetClusterUserCredentials_GetManagedCluster()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersListClusterUserCredentials.json
- // this example is just showing the usage of "ManagedClusters_ListClusterUserCredentials" 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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // invoke the operation
- ManagedClusterCredentials result = await containerServiceManagedCluster.GetClusterUserCredentialsAsync();
-
- Console.WriteLine($"Succeeded: {result}");
- }
-
- // Get Managed Cluster
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task GetClusterMonitoringUserCredentials_GetManagedCluster()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersListClusterMonitoringUserCredentials.json
- // this example is just showing the usage of "ManagedClusters_ListClusterMonitoringUserCredentials" 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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // invoke the operation
- ManagedClusterCredentials result = await containerServiceManagedCluster.GetClusterMonitoringUserCredentialsAsync();
-
- Console.WriteLine($"Succeeded: {result}");
- }
-
- // Get Managed Cluster
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Get_GetManagedCluster()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGet.json
- // this example is just showing the usage of "ManagedClusters_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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // invoke the operation
- ContainerServiceManagedClusterResource result = await containerServiceManagedCluster.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
- ContainerServiceManagedClusterData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Update Managed Cluster Tags
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Update_UpdateManagedClusterTags()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersUpdateTags.json
- // this example is just showing the usage of "ManagedClusters_UpdateTags" 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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // invoke the operation
- ContainerServiceTagsObject containerServiceTagsObject = new ContainerServiceTagsObject()
- {
- Tags =
-{
-["archv3"] = "",
-["tier"] = "testing",
-},
- };
- ArmOperation lro = await containerServiceManagedCluster.UpdateAsync(WaitUntil.Completed, containerServiceTagsObject);
- ContainerServiceManagedClusterResource 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
- ContainerServiceManagedClusterData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Delete Managed Cluster
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Delete_DeleteManagedCluster()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersDelete.json
- // this example is just showing the usage of "ManagedClusters_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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // invoke the operation
- await containerServiceManagedCluster.DeleteAsync(WaitUntil.Completed);
-
- Console.WriteLine($"Succeeded");
- }
-
- // Reset Service Principal Profile
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task ResetServicePrincipalProfile_ResetServicePrincipalProfile()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersResetServicePrincipalProfile.json
- // this example is just showing the usage of "ManagedClusters_ResetServicePrincipalProfile" 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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // invoke the operation
- ManagedClusterServicePrincipalProfile managedClusterServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid")
- {
- Secret = "secret",
- };
- await containerServiceManagedCluster.ResetServicePrincipalProfileAsync(WaitUntil.Completed, managedClusterServicePrincipalProfile);
-
- Console.WriteLine($"Succeeded");
- }
-
- // Reset AAD Profile
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task ResetAadProfile_ResetAADProfile()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersResetAADProfile.json
- // this example is just showing the usage of "ManagedClusters_ResetAadProfile" 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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // invoke the operation
- ManagedClusterAadProfile managedClusterAadProfile = new ManagedClusterAadProfile()
- {
- ClientAppId = Guid.Parse("clientappid"),
- ServerAppId = Guid.Parse("serverappid"),
- ServerAppSecret = "serverappsecret",
- TenantId = Guid.Parse("tenantid"),
- };
- await containerServiceManagedCluster.ResetAadProfileAsync(WaitUntil.Completed, managedClusterAadProfile);
-
- Console.WriteLine($"Succeeded");
- }
-
- // Rotate Cluster Certificates
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task RotateClusterCertificates_RotateClusterCertificates()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersRotateClusterCertificates.json
- // this example is just showing the usage of "ManagedClusters_RotateClusterCertificates" 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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // invoke the operation
- await containerServiceManagedCluster.RotateClusterCertificatesAsync(WaitUntil.Completed);
-
- Console.WriteLine($"Succeeded");
- }
-
- // Abort operation on managed cluster
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task AbortLatestOperation_AbortOperationOnManagedCluster()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersAbortOperation.json
- // this example is just showing the usage of "ManagedClusters_AbortLatestOperation" 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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // invoke the operation
- await containerServiceManagedCluster.AbortLatestOperationAsync(WaitUntil.Completed);
-
- Console.WriteLine($"Succeeded");
- }
-
- // Rotate Cluster Service Account Signing Keys
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task RotateServiceAccountSigningKeys_RotateClusterServiceAccountSigningKeys()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersRotateServiceAccountSigningKeys.json
- // this example is just showing the usage of "ManagedClusters_RotateServiceAccountSigningKeys" 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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // invoke the operation
- await containerServiceManagedCluster.RotateServiceAccountSigningKeysAsync(WaitUntil.Completed);
-
- Console.WriteLine($"Succeeded");
- }
-
- // Stop Managed Cluster
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Stop_StopManagedCluster()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersStop.json
- // this example is just showing the usage of "ManagedClusters_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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // invoke the operation
- await containerServiceManagedCluster.StopAsync(WaitUntil.Completed);
-
- Console.WriteLine($"Succeeded");
- }
-
- // Start Managed Cluster
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Start_StartManagedCluster()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersStart.json
- // this example is just showing the usage of "ManagedClusters_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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // invoke the operation
- await containerServiceManagedCluster.StartAsync(WaitUntil.Completed);
-
- Console.WriteLine($"Succeeded");
- }
-
- // submitNewCommand
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task RunCommand_SubmitNewCommand()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/RunCommandRequest.json
- // this example is just showing the usage of "ManagedClusters_RunCommand" 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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // invoke the operation
- ManagedClusterRunCommandContent content = new ManagedClusterRunCommandContent("kubectl apply -f ns.yaml")
- {
- Context = "",
- ClusterToken = "",
- };
- ArmOperation lro = await containerServiceManagedCluster.RunCommandAsync(WaitUntil.Completed, content);
- ManagedClusterRunCommandResult result = lro.Value;
-
- Console.WriteLine($"Succeeded: {result}");
- }
-
- // commandFailedResult
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task GetCommandResult_CommandFailedResult()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/RunCommandResultFailed.json
- // this example is just showing the usage of "ManagedClusters_GetCommandResult" 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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // invoke the operation
- string commandId = "def7b3ea71bd4f7e9d226ddbc0f00ad9";
- ManagedClusterRunCommandResult result = await containerServiceManagedCluster.GetCommandResultAsync(commandId);
-
- Console.WriteLine($"Succeeded: {result}");
- }
-
- // commandSucceedResult
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task GetCommandResult_CommandSucceedResult()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/RunCommandResultSucceed.json
- // this example is just showing the usage of "ManagedClusters_GetCommandResult" 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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // invoke the operation
- string commandId = "def7b3ea71bd4f7e9d226ddbc0f00ad9";
- ManagedClusterRunCommandResult result = await containerServiceManagedCluster.GetCommandResultAsync(commandId);
-
- Console.WriteLine($"Succeeded: {result}");
- }
-
- // List OutboundNetworkDependenciesEndpoints by Managed Cluster
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task GetOutboundNetworkDependenciesEndpoints_ListOutboundNetworkDependenciesEndpointsByManagedCluster()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/OutboundNetworkDependenciesEndpointsList.json
- // this example is just showing the usage of "ManagedClusters_ListOutboundNetworkDependenciesEndpoints" 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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // invoke the operation and iterate over the result
- await foreach (ContainerServiceOutboundEnvironmentEndpoint item in containerServiceManagedCluster.GetOutboundNetworkDependenciesEndpointsAsync())
- {
- Console.WriteLine($"Succeeded: {item}");
- }
-
- Console.WriteLine($"Succeeded");
- }
-
- // Get available versions for agent pool
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task GetAvailableAgentPoolVersions_GetAvailableVersionsForAgentPool()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsGetAgentPoolAvailableVersions.json
- // this example is just showing the usage of "AgentPools_GetAvailableAgentPoolVersions" 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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // invoke the operation
- AgentPoolAvailableVersions result = await containerServiceManagedCluster.GetAvailableAgentPoolVersionsAsync();
-
- Console.WriteLine($"Succeeded: {result}");
- }
-
- // List Private Link Resources by Managed Cluster
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task GetPrivateLinkResources_ListPrivateLinkResourcesByManagedCluster()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/PrivateLinkResourcesList.json
- // this example is just showing the usage of "PrivateLinkResources_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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // invoke the operation and iterate over the result
- await foreach (ContainerServicePrivateLinkResourceData item in containerServiceManagedCluster.GetPrivateLinkResourcesAsync())
- {
- Console.WriteLine($"Succeeded: {item}");
- }
-
- Console.WriteLine($"Succeeded");
- }
-
- // Resolve the Private Link Service ID for Managed Cluster
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task ResolvePrivateLinkServiceId_ResolveThePrivateLinkServiceIDForManagedCluster()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ResolvePrivateLinkServiceId.json
- // this example is just showing the usage of "ResolvePrivateLinkServiceId_Post" 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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // invoke the operation
- ContainerServicePrivateLinkResourceData data = new ContainerServicePrivateLinkResourceData()
- {
- Name = "management",
- };
- ContainerServicePrivateLinkResourceData result = await containerServiceManagedCluster.ResolvePrivateLinkServiceIdAsync(data);
-
- Console.WriteLine($"Succeeded: {result}");
- }
- }
-}
diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServicePrivateEndpointConnectionCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServicePrivateEndpointConnectionCollection.cs
deleted file mode 100644
index 253453010288..000000000000
--- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServicePrivateEndpointConnectionCollection.cs
+++ /dev/null
@@ -1,207 +0,0 @@
-// 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;
-
-namespace Azure.ResourceManager.ContainerService.Samples
-{
- public partial class Sample_ContainerServicePrivateEndpointConnectionCollection
- {
- // List Private Endpoint Connections by Managed Cluster
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task GetAll_ListPrivateEndpointConnectionsByManagedCluster()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/PrivateEndpointConnectionsList.json
- // this example is just showing the usage of "PrivateEndpointConnections_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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // get the collection of this ContainerServicePrivateEndpointConnectionResource
- ContainerServicePrivateEndpointConnectionCollection collection = containerServiceManagedCluster.GetContainerServicePrivateEndpointConnections();
-
- // invoke the operation and iterate over the result
- await foreach (ContainerServicePrivateEndpointConnectionResource 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
- ContainerServicePrivateEndpointConnectionData resourceData = item.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- Console.WriteLine($"Succeeded");
- }
-
- // Get Private Endpoint Connection
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Get_GetPrivateEndpointConnection()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/PrivateEndpointConnectionsGet.json
- // this example is just showing the usage of "PrivateEndpointConnections_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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // get the collection of this ContainerServicePrivateEndpointConnectionResource
- ContainerServicePrivateEndpointConnectionCollection collection = containerServiceManagedCluster.GetContainerServicePrivateEndpointConnections();
-
- // invoke the operation
- string privateEndpointConnectionName = "privateendpointconnection1";
- ContainerServicePrivateEndpointConnectionResource result = await collection.GetAsync(privateEndpointConnectionName);
-
- // 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
- ContainerServicePrivateEndpointConnectionData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Get Private Endpoint Connection
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Exists_GetPrivateEndpointConnection()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/PrivateEndpointConnectionsGet.json
- // this example is just showing the usage of "PrivateEndpointConnections_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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // get the collection of this ContainerServicePrivateEndpointConnectionResource
- ContainerServicePrivateEndpointConnectionCollection collection = containerServiceManagedCluster.GetContainerServicePrivateEndpointConnections();
-
- // invoke the operation
- string privateEndpointConnectionName = "privateendpointconnection1";
- bool result = await collection.ExistsAsync(privateEndpointConnectionName);
-
- Console.WriteLine($"Succeeded: {result}");
- }
-
- // Get Private Endpoint Connection
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task GetIfExists_GetPrivateEndpointConnection()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/PrivateEndpointConnectionsGet.json
- // this example is just showing the usage of "PrivateEndpointConnections_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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // get the collection of this ContainerServicePrivateEndpointConnectionResource
- ContainerServicePrivateEndpointConnectionCollection collection = containerServiceManagedCluster.GetContainerServicePrivateEndpointConnections();
-
- // invoke the operation
- string privateEndpointConnectionName = "privateendpointconnection1";
- NullableResponse response = await collection.GetIfExistsAsync(privateEndpointConnectionName);
- ContainerServicePrivateEndpointConnectionResource 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
- ContainerServicePrivateEndpointConnectionData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
- }
-
- // Update Private Endpoint Connection
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task CreateOrUpdate_UpdatePrivateEndpointConnection()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/PrivateEndpointConnectionsUpdate.json
- // this example is just showing the usage of "PrivateEndpointConnections_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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // get the collection of this ContainerServicePrivateEndpointConnectionResource
- ContainerServicePrivateEndpointConnectionCollection collection = containerServiceManagedCluster.GetContainerServicePrivateEndpointConnections();
-
- // invoke the operation
- string privateEndpointConnectionName = "privateendpointconnection1";
- ContainerServicePrivateEndpointConnectionData data = new ContainerServicePrivateEndpointConnectionData()
- {
- ConnectionState = new ContainerServicePrivateLinkServiceConnectionState()
- {
- Status = ContainerServicePrivateLinkServiceConnectionStatus.Approved,
- },
- };
- ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, privateEndpointConnectionName, data);
- ContainerServicePrivateEndpointConnectionResource 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
- ContainerServicePrivateEndpointConnectionData 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_ContainerServicePrivateEndpointConnectionResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServicePrivateEndpointConnectionResource.cs
deleted file mode 100644
index 89fceb7048f1..000000000000
--- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServicePrivateEndpointConnectionResource.cs
+++ /dev/null
@@ -1,118 +0,0 @@
-// 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;
-
-namespace Azure.ResourceManager.ContainerService.Samples
-{
- public partial class Sample_ContainerServicePrivateEndpointConnectionResource
- {
- // Get Private Endpoint Connection
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Get_GetPrivateEndpointConnection()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/PrivateEndpointConnectionsGet.json
- // this example is just showing the usage of "PrivateEndpointConnections_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 ContainerServicePrivateEndpointConnectionResource created on azure
- // for more information of creating ContainerServicePrivateEndpointConnectionResource, please refer to the document of ContainerServicePrivateEndpointConnectionResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- string privateEndpointConnectionName = "privateendpointconnection1";
- ResourceIdentifier containerServicePrivateEndpointConnectionResourceId = ContainerServicePrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, privateEndpointConnectionName);
- ContainerServicePrivateEndpointConnectionResource containerServicePrivateEndpointConnection = client.GetContainerServicePrivateEndpointConnectionResource(containerServicePrivateEndpointConnectionResourceId);
-
- // invoke the operation
- ContainerServicePrivateEndpointConnectionResource result = await containerServicePrivateEndpointConnection.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
- ContainerServicePrivateEndpointConnectionData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Update Private Endpoint Connection
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Update_UpdatePrivateEndpointConnection()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/PrivateEndpointConnectionsUpdate.json
- // this example is just showing the usage of "PrivateEndpointConnections_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 ContainerServicePrivateEndpointConnectionResource created on azure
- // for more information of creating ContainerServicePrivateEndpointConnectionResource, please refer to the document of ContainerServicePrivateEndpointConnectionResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- string privateEndpointConnectionName = "privateendpointconnection1";
- ResourceIdentifier containerServicePrivateEndpointConnectionResourceId = ContainerServicePrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, privateEndpointConnectionName);
- ContainerServicePrivateEndpointConnectionResource containerServicePrivateEndpointConnection = client.GetContainerServicePrivateEndpointConnectionResource(containerServicePrivateEndpointConnectionResourceId);
-
- // invoke the operation
- ContainerServicePrivateEndpointConnectionData data = new ContainerServicePrivateEndpointConnectionData()
- {
- ConnectionState = new ContainerServicePrivateLinkServiceConnectionState()
- {
- Status = ContainerServicePrivateLinkServiceConnectionStatus.Approved,
- },
- };
- ArmOperation lro = await containerServicePrivateEndpointConnection.UpdateAsync(WaitUntil.Completed, data);
- ContainerServicePrivateEndpointConnectionResource 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
- ContainerServicePrivateEndpointConnectionData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Delete Private Endpoint Connection
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Delete_DeletePrivateEndpointConnection()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/PrivateEndpointConnectionsDelete.json
- // this example is just showing the usage of "PrivateEndpointConnections_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 ContainerServicePrivateEndpointConnectionResource created on azure
- // for more information of creating ContainerServicePrivateEndpointConnectionResource, please refer to the document of ContainerServicePrivateEndpointConnectionResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- string privateEndpointConnectionName = "privateendpointconnection1";
- ResourceIdentifier containerServicePrivateEndpointConnectionResourceId = ContainerServicePrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, privateEndpointConnectionName);
- ContainerServicePrivateEndpointConnectionResource containerServicePrivateEndpointConnection = client.GetContainerServicePrivateEndpointConnectionResource(containerServicePrivateEndpointConnectionResourceId);
-
- // invoke the operation
- await containerServicePrivateEndpointConnection.DeleteAsync(WaitUntil.Completed);
-
- Console.WriteLine($"Succeeded");
- }
- }
-}
diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceTrustedAccessRoleBindingCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceTrustedAccessRoleBindingCollection.cs
deleted file mode 100644
index bc47c1281cb0..000000000000
--- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceTrustedAccessRoleBindingCollection.cs
+++ /dev/null
@@ -1,203 +0,0 @@
-// 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;
-
-namespace Azure.ResourceManager.ContainerService.Samples
-{
- public partial class Sample_ContainerServiceTrustedAccessRoleBindingCollection
- {
- // List trusted access role bindings
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task GetAll_ListTrustedAccessRoleBindings()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/TrustedAccessRoleBindings_List.json
- // this example is just showing the usage of "TrustedAccessRoleBindings_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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // get the collection of this ContainerServiceTrustedAccessRoleBindingResource
- ContainerServiceTrustedAccessRoleBindingCollection collection = containerServiceManagedCluster.GetContainerServiceTrustedAccessRoleBindings();
-
- // invoke the operation and iterate over the result
- await foreach (ContainerServiceTrustedAccessRoleBindingResource 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
- ContainerServiceTrustedAccessRoleBindingData resourceData = item.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- Console.WriteLine($"Succeeded");
- }
-
- // Get a trusted access role binding
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Get_GetATrustedAccessRoleBinding()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/TrustedAccessRoleBindings_Get.json
- // this example is just showing the usage of "TrustedAccessRoleBindings_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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // get the collection of this ContainerServiceTrustedAccessRoleBindingResource
- ContainerServiceTrustedAccessRoleBindingCollection collection = containerServiceManagedCluster.GetContainerServiceTrustedAccessRoleBindings();
-
- // invoke the operation
- string trustedAccessRoleBindingName = "binding1";
- ContainerServiceTrustedAccessRoleBindingResource result = await collection.GetAsync(trustedAccessRoleBindingName);
-
- // 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
- ContainerServiceTrustedAccessRoleBindingData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Get a trusted access role binding
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Exists_GetATrustedAccessRoleBinding()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/TrustedAccessRoleBindings_Get.json
- // this example is just showing the usage of "TrustedAccessRoleBindings_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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // get the collection of this ContainerServiceTrustedAccessRoleBindingResource
- ContainerServiceTrustedAccessRoleBindingCollection collection = containerServiceManagedCluster.GetContainerServiceTrustedAccessRoleBindings();
-
- // invoke the operation
- string trustedAccessRoleBindingName = "binding1";
- bool result = await collection.ExistsAsync(trustedAccessRoleBindingName);
-
- Console.WriteLine($"Succeeded: {result}");
- }
-
- // Get a trusted access role binding
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task GetIfExists_GetATrustedAccessRoleBinding()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/TrustedAccessRoleBindings_Get.json
- // this example is just showing the usage of "TrustedAccessRoleBindings_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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // get the collection of this ContainerServiceTrustedAccessRoleBindingResource
- ContainerServiceTrustedAccessRoleBindingCollection collection = containerServiceManagedCluster.GetContainerServiceTrustedAccessRoleBindings();
-
- // invoke the operation
- string trustedAccessRoleBindingName = "binding1";
- NullableResponse response = await collection.GetIfExistsAsync(trustedAccessRoleBindingName);
- ContainerServiceTrustedAccessRoleBindingResource 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
- ContainerServiceTrustedAccessRoleBindingData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
- }
-
- // Create or update a trusted access role binding
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task CreateOrUpdate_CreateOrUpdateATrustedAccessRoleBinding()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/TrustedAccessRoleBindings_CreateOrUpdate.json
- // this example is just showing the usage of "TrustedAccessRoleBindings_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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // get the collection of this ContainerServiceTrustedAccessRoleBindingResource
- ContainerServiceTrustedAccessRoleBindingCollection collection = containerServiceManagedCluster.GetContainerServiceTrustedAccessRoleBindings();
-
- // invoke the operation
- string trustedAccessRoleBindingName = "binding1";
- ContainerServiceTrustedAccessRoleBindingData data = new ContainerServiceTrustedAccessRoleBindingData(new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/b/providers/Microsoft.MachineLearningServices/workspaces/c"), new string[]
- {
-"Microsoft.MachineLearningServices/workspaces/reader","Microsoft.MachineLearningServices/workspaces/writer"
- });
- ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, trustedAccessRoleBindingName, data);
- ContainerServiceTrustedAccessRoleBindingResource 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
- ContainerServiceTrustedAccessRoleBindingData 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_ContainerServiceTrustedAccessRoleBindingResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceTrustedAccessRoleBindingResource.cs
deleted file mode 100644
index 71e7ffd14015..000000000000
--- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceTrustedAccessRoleBindingResource.cs
+++ /dev/null
@@ -1,114 +0,0 @@
-// 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;
-
-namespace Azure.ResourceManager.ContainerService.Samples
-{
- public partial class Sample_ContainerServiceTrustedAccessRoleBindingResource
- {
- // Get a trusted access role binding
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Get_GetATrustedAccessRoleBinding()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/TrustedAccessRoleBindings_Get.json
- // this example is just showing the usage of "TrustedAccessRoleBindings_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 ContainerServiceTrustedAccessRoleBindingResource created on azure
- // for more information of creating ContainerServiceTrustedAccessRoleBindingResource, please refer to the document of ContainerServiceTrustedAccessRoleBindingResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- string trustedAccessRoleBindingName = "binding1";
- ResourceIdentifier containerServiceTrustedAccessRoleBindingResourceId = ContainerServiceTrustedAccessRoleBindingResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, trustedAccessRoleBindingName);
- ContainerServiceTrustedAccessRoleBindingResource containerServiceTrustedAccessRoleBinding = client.GetContainerServiceTrustedAccessRoleBindingResource(containerServiceTrustedAccessRoleBindingResourceId);
-
- // invoke the operation
- ContainerServiceTrustedAccessRoleBindingResource result = await containerServiceTrustedAccessRoleBinding.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
- ContainerServiceTrustedAccessRoleBindingData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Create or update a trusted access role binding
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Update_CreateOrUpdateATrustedAccessRoleBinding()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/TrustedAccessRoleBindings_CreateOrUpdate.json
- // this example is just showing the usage of "TrustedAccessRoleBindings_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 ContainerServiceTrustedAccessRoleBindingResource created on azure
- // for more information of creating ContainerServiceTrustedAccessRoleBindingResource, please refer to the document of ContainerServiceTrustedAccessRoleBindingResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- string trustedAccessRoleBindingName = "binding1";
- ResourceIdentifier containerServiceTrustedAccessRoleBindingResourceId = ContainerServiceTrustedAccessRoleBindingResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, trustedAccessRoleBindingName);
- ContainerServiceTrustedAccessRoleBindingResource containerServiceTrustedAccessRoleBinding = client.GetContainerServiceTrustedAccessRoleBindingResource(containerServiceTrustedAccessRoleBindingResourceId);
-
- // invoke the operation
- ContainerServiceTrustedAccessRoleBindingData data = new ContainerServiceTrustedAccessRoleBindingData(new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/b/providers/Microsoft.MachineLearningServices/workspaces/c"), new string[]
- {
-"Microsoft.MachineLearningServices/workspaces/reader","Microsoft.MachineLearningServices/workspaces/writer"
- });
- ArmOperation lro = await containerServiceTrustedAccessRoleBinding.UpdateAsync(WaitUntil.Completed, data);
- ContainerServiceTrustedAccessRoleBindingResource 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
- ContainerServiceTrustedAccessRoleBindingData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Delete a trusted access role binding
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Delete_DeleteATrustedAccessRoleBinding()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/TrustedAccessRoleBindings_Delete.json
- // this example is just showing the usage of "TrustedAccessRoleBindings_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 ContainerServiceTrustedAccessRoleBindingResource created on azure
- // for more information of creating ContainerServiceTrustedAccessRoleBindingResource, please refer to the document of ContainerServiceTrustedAccessRoleBindingResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- string trustedAccessRoleBindingName = "binding1";
- ResourceIdentifier containerServiceTrustedAccessRoleBindingResourceId = ContainerServiceTrustedAccessRoleBindingResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, trustedAccessRoleBindingName);
- ContainerServiceTrustedAccessRoleBindingResource containerServiceTrustedAccessRoleBinding = client.GetContainerServiceTrustedAccessRoleBindingResource(containerServiceTrustedAccessRoleBindingResourceId);
-
- // invoke the operation
- await containerServiceTrustedAccessRoleBinding.DeleteAsync(WaitUntil.Completed);
-
- Console.WriteLine($"Succeeded");
- }
- }
-}
diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_AgentPoolSnapshotCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_FleetCollection.cs
similarity index 62%
rename from sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_AgentPoolSnapshotCollection.cs
rename to sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_FleetCollection.cs
index 63175e8ef93c..475f719228db 100644
--- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_AgentPoolSnapshotCollection.cs
+++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_FleetCollection.cs
@@ -9,19 +9,20 @@
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
+using Azure.ResourceManager.ContainerService.Models;
using Azure.ResourceManager.Resources;
namespace Azure.ResourceManager.ContainerService.Samples
{
- public partial class Sample_AgentPoolSnapshotCollection
+ public partial class Sample_FleetCollection
{
- // List Snapshots by Resource Group
+ // Lists the Fleet resources in a resource group.
[NUnit.Framework.Test]
[NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task GetAll_ListSnapshotsByResourceGroup()
+ public async Task GetAll_ListsTheFleetResourcesInAResourceGroup()
{
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/SnapshotsListByResourceGroup.json
- // this example is just showing the usage of "Snapshots_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately.
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-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();
@@ -30,20 +31,20 @@ public async Task GetAll_ListSnapshotsByResourceGroup()
// 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 = "00000000-0000-0000-0000-000000000000";
+ string subscriptionId = "subid1";
string resourceGroupName = "rg1";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
- // get the collection of this AgentPoolSnapshotResource
- AgentPoolSnapshotCollection collection = resourceGroupResource.GetAgentPoolSnapshots();
+ // get the collection of this FleetResource
+ FleetCollection collection = resourceGroupResource.GetFleets();
// invoke the operation and iterate over the result
- await foreach (AgentPoolSnapshotResource item in collection.GetAllAsync())
+ 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
- AgentPoolSnapshotData resourceData = item.Data;
+ FleetData resourceData = item.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
@@ -51,13 +52,13 @@ public async Task GetAll_ListSnapshotsByResourceGroup()
Console.WriteLine($"Succeeded");
}
- // Get Snapshot
+ // Gets a Fleet resource.
[NUnit.Framework.Test]
[NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Get_GetSnapshot()
+ public async Task Get_GetsAFleetResource()
{
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/SnapshotsGet.json
- // this example is just showing the usage of "Snapshots_Get" operation, for the dependent resources, they will have to be created separately.
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-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();
@@ -66,32 +67,32 @@ public async Task Get_GetSnapshot()
// 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 = "00000000-0000-0000-0000-000000000000";
+ string subscriptionId = "subid1";
string resourceGroupName = "rg1";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
- // get the collection of this AgentPoolSnapshotResource
- AgentPoolSnapshotCollection collection = resourceGroupResource.GetAgentPoolSnapshots();
+ // get the collection of this FleetResource
+ FleetCollection collection = resourceGroupResource.GetFleets();
// invoke the operation
- string resourceName = "snapshot1";
- AgentPoolSnapshotResource result = await collection.GetAsync(resourceName);
+ 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
- AgentPoolSnapshotData resourceData = result.Data;
+ FleetData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
- // Get Snapshot
+ // Gets a Fleet resource.
[NUnit.Framework.Test]
[NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Exists_GetSnapshot()
+ public async Task Exists_GetsAFleetResource()
{
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/SnapshotsGet.json
- // this example is just showing the usage of "Snapshots_Get" operation, for the dependent resources, they will have to be created separately.
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-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();
@@ -100,28 +101,28 @@ public async Task Exists_GetSnapshot()
// 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 = "00000000-0000-0000-0000-000000000000";
+ string subscriptionId = "subid1";
string resourceGroupName = "rg1";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
- // get the collection of this AgentPoolSnapshotResource
- AgentPoolSnapshotCollection collection = resourceGroupResource.GetAgentPoolSnapshots();
+ // get the collection of this FleetResource
+ FleetCollection collection = resourceGroupResource.GetFleets();
// invoke the operation
- string resourceName = "snapshot1";
- bool result = await collection.ExistsAsync(resourceName);
+ string fleetName = "fleet1";
+ bool result = await collection.ExistsAsync(fleetName);
Console.WriteLine($"Succeeded: {result}");
}
- // Get Snapshot
+ // Gets a Fleet resource.
[NUnit.Framework.Test]
[NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task GetIfExists_GetSnapshot()
+ public async Task GetIfExists_GetsAFleetResource()
{
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/SnapshotsGet.json
- // this example is just showing the usage of "Snapshots_Get" operation, for the dependent resources, they will have to be created separately.
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-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();
@@ -130,18 +131,18 @@ public async Task GetIfExists_GetSnapshot()
// 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 = "00000000-0000-0000-0000-000000000000";
+ string subscriptionId = "subid1";
string resourceGroupName = "rg1";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
- // get the collection of this AgentPoolSnapshotResource
- AgentPoolSnapshotCollection collection = resourceGroupResource.GetAgentPoolSnapshots();
+ // get the collection of this FleetResource
+ FleetCollection collection = resourceGroupResource.GetFleets();
// invoke the operation
- string resourceName = "snapshot1";
- NullableResponse response = await collection.GetIfExistsAsync(resourceName);
- AgentPoolSnapshotResource result = response.HasValue ? response.Value : null;
+ string fleetName = "fleet1";
+ NullableResponse response = await collection.GetIfExistsAsync(fleetName);
+ FleetResource result = response.HasValue ? response.Value : null;
if (result == null)
{
@@ -151,19 +152,19 @@ public async Task GetIfExists_GetSnapshot()
{
// 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
- AgentPoolSnapshotData resourceData = result.Data;
+ FleetData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
}
- // Create/Update Snapshot
+ // Creates a Fleet resource with a long running operation.
[NUnit.Framework.Test]
[NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task CreateOrUpdate_CreateUpdateSnapshot()
+ public async Task CreateOrUpdate_CreatesAFleetResourceWithALongRunningOperation()
{
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/SnapshotsCreate.json
- // this example is just showing the usage of "Snapshots_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-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();
@@ -172,31 +173,38 @@ public async Task CreateOrUpdate_CreateUpdateSnapshot()
// 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 = "00000000-0000-0000-0000-000000000000";
+ string subscriptionId = "subid1";
string resourceGroupName = "rg1";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
- // get the collection of this AgentPoolSnapshotResource
- AgentPoolSnapshotCollection collection = resourceGroupResource.GetAgentPoolSnapshots();
+ // get the collection of this FleetResource
+ FleetCollection collection = resourceGroupResource.GetFleets();
// invoke the operation
- string resourceName = "snapshot1";
- AgentPoolSnapshotData data = new AgentPoolSnapshotData(new AzureLocation("westus"))
+ string fleetName = "fleet1";
+ FleetData data = new FleetData(new AzureLocation("East US"))
{
- CreationDataSourceResourceId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1/agentPools/pool0"),
+ HubProfile = new FleetHubProfile()
+ {
+ DnsPrefix = "dnsprefix1",
+ AgentProfile = new AgentProfile()
+ {
+ VmSize = "Standard_DS1",
+ },
+ },
Tags =
{
-["key1"] = "val1",
-["key2"] = "val2",
+["archv2"] = "",
+["tier"] = "production",
},
};
- ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data);
- AgentPoolSnapshotResource result = lro.Value;
+ 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
- AgentPoolSnapshotData resourceData = result.Data;
+ 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..55d1268f0cce
--- /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;
+
+namespace Azure.ResourceManager.ContainerService.Samples
+{
+ public partial class Sample_FleetMemberCollection
+ {
+ // Lists the members of a Fleet.
+ [NUnit.Framework.Test]
+ [NUnit.Framework.Ignore("Only verifying that the sample builds")]
+ public async Task GetAll_ListsTheMembersOfAFleet()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-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");
+ }
+
+ // Gets a FleetMember resource.
+ [NUnit.Framework.Test]
+ [NUnit.Framework.Ignore("Only verifying that the sample builds")]
+ public async Task Get_GetsAFleetMemberResource()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-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}");
+ }
+
+ // Gets a FleetMember resource.
+ [NUnit.Framework.Test]
+ [NUnit.Framework.Ignore("Only verifying that the sample builds")]
+ public async Task Exists_GetsAFleetMemberResource()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-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}");
+ }
+
+ // Gets a FleetMember resource.
+ [NUnit.Framework.Test]
+ [NUnit.Framework.Ignore("Only verifying that the sample builds")]
+ public async Task GetIfExists_GetsAFleetMemberResource()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-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}");
+ }
+ }
+
+ // Creates a FleetMember resource with a long running operation.
+ [NUnit.Framework.Test]
+ [NUnit.Framework.Ignore("Only verifying that the sample builds")]
+ public async Task CreateOrUpdate_CreatesAFleetMemberResourceWithALongRunningOperation()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-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"),
+ };
+ 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}");
+ }
+ }
+}
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..ba45df11dcdd
--- /dev/null
+++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_FleetMemberResource.cs
@@ -0,0 +1,115 @@
+// 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;
+
+namespace Azure.ResourceManager.ContainerService.Samples
+{
+ public partial class Sample_FleetMemberResource
+ {
+ // Gets a FleetMember resource.
+ [NUnit.Framework.Test]
+ [NUnit.Framework.Ignore("Only verifying that the sample builds")]
+ public async Task Get_GetsAFleetMemberResource()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-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}");
+ }
+
+ // Updates a FleetMember resource synchronously.
+ [NUnit.Framework.Test]
+ [NUnit.Framework.Ignore("Only verifying that the sample builds")]
+ public async Task Update_UpdatesAFleetMemberResourceSynchronously()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-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}");
+ }
+
+ // Deletes a FleetMember resource asynchronously with a long running operation.
+ [NUnit.Framework.Test]
+ [NUnit.Framework.Ignore("Only verifying that the sample builds")]
+ public async Task Delete_DeletesAFleetMemberResourceAsynchronouslyWithALongRunningOperation()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-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");
+ }
+ }
+}
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..8510c5e17cd8
--- /dev/null
+++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_FleetResource.cs
@@ -0,0 +1,177 @@
+// 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;
+
+namespace Azure.ResourceManager.ContainerService.Samples
+{
+ public partial class Sample_FleetResource
+ {
+ // Lists the Fleet resources in a subscription.
+ [NUnit.Framework.Test]
+ [NUnit.Framework.Ignore("Only verifying that the sample builds")]
+ public async Task GetFleets_ListsTheFleetResourcesInASubscription()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-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();
+ // 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 = "subid1";
+ ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId);
+ SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId);
+
+ // invoke the operation and iterate over the result
+ 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
+ FleetData resourceData = item.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+
+ Console.WriteLine($"Succeeded");
+ }
+
+ // Gets a Fleet resource.
+ [NUnit.Framework.Test]
+ [NUnit.Framework.Ignore("Only verifying that the sample builds")]
+ public async Task Get_GetsAFleetResource()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-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}");
+ }
+
+ // Update a Fleet.
+ [NUnit.Framework.Test]
+ [NUnit.Framework.Ignore("Only verifying that the sample builds")]
+ public async Task Update_UpdateAFleet()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-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}");
+ }
+
+ // Deletes a Fleet resource asynchronously with a long running operation.
+ [NUnit.Framework.Test]
+ [NUnit.Framework.Ignore("Only verifying that the sample builds")]
+ public async Task Delete_DeletesAFleetResourceAsynchronouslyWithALongRunningOperation()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-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");
+ }
+
+ // Lists the user credentials of a Fleet.
+ [NUnit.Framework.Test]
+ [NUnit.Framework.Ignore("Only verifying that the sample builds")]
+ public async Task GetCredentials_ListsTheUserCredentialsOfAFleet()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-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..c564be1b75a3
--- /dev/null
+++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_FleetUpdateStrategyCollection.cs
@@ -0,0 +1,214 @@
+// 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;
+
+namespace Azure.ResourceManager.ContainerService.Samples
+{
+ public partial class Sample_FleetUpdateStrategyCollection
+ {
+ // List the FleetUpdateStrategy resources by fleet.
+ [NUnit.Framework.Test]
+ [NUnit.Framework.Ignore("Only verifying that the sample builds")]
+ public async Task GetAll_ListTheFleetUpdateStrategyResourcesByFleet()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-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");
+ }
+
+ // Get a FleetUpdateStrategy resource.
+ [NUnit.Framework.Test]
+ [NUnit.Framework.Ignore("Only verifying that the sample builds")]
+ public async Task Get_GetAFleetUpdateStrategyResource()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-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}");
+ }
+
+ // Get a FleetUpdateStrategy resource.
+ [NUnit.Framework.Test]
+ [NUnit.Framework.Ignore("Only verifying that the sample builds")]
+ public async Task Exists_GetAFleetUpdateStrategyResource()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-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}");
+ }
+
+ // Get a FleetUpdateStrategy resource.
+ [NUnit.Framework.Test]
+ [NUnit.Framework.Ignore("Only verifying that the sample builds")]
+ public async Task GetIfExists_GetAFleetUpdateStrategyResource()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-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}");
+ }
+ }
+
+ // Create a FleetUpdateStrategy.
+ [NUnit.Framework.Test]
+ [NUnit.Framework.Ignore("Only verifying that the sample builds")]
+ public async Task CreateOrUpdate_CreateAFleetUpdateStrategy()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-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}");
+ }
+ }
+}
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..7f934bc9ed4e
--- /dev/null
+++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_FleetUpdateStrategyResource.cs
@@ -0,0 +1,125 @@
+// 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;
+
+namespace Azure.ResourceManager.ContainerService.Samples
+{
+ public partial class Sample_FleetUpdateStrategyResource
+ {
+ // Get a FleetUpdateStrategy resource.
+ [NUnit.Framework.Test]
+ [NUnit.Framework.Ignore("Only verifying that the sample builds")]
+ public async Task Get_GetAFleetUpdateStrategyResource()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-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}");
+ }
+
+ // Create a FleetUpdateStrategy.
+ [NUnit.Framework.Test]
+ [NUnit.Framework.Ignore("Only verifying that the sample builds")]
+ public async Task Update_CreateAFleetUpdateStrategy()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-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}");
+ }
+
+ // Delete a FleetUpdateStrategy resource.
+ [NUnit.Framework.Test]
+ [NUnit.Framework.Ignore("Only verifying that the sample builds")]
+ public async Task Delete_DeleteAFleetUpdateStrategyResource()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-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");
+ }
+ }
+}
diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ManagedClusterUpgradeProfileResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ManagedClusterUpgradeProfileResource.cs
deleted file mode 100644
index f47c234140f9..000000000000
--- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ManagedClusterUpgradeProfileResource.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-// 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;
-
-namespace Azure.ResourceManager.ContainerService.Samples
-{
- public partial class Sample_ManagedClusterUpgradeProfileResource
- {
- // Get Upgrade Profile for Managed Cluster
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Get_GetUpgradeProfileForManagedCluster()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGetUpgradeProfile.json
- // this example is just showing the usage of "ManagedClusters_GetUpgradeProfile" 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 ManagedClusterUpgradeProfileResource created on azure
- // for more information of creating ManagedClusterUpgradeProfileResource, please refer to the document of ManagedClusterUpgradeProfileResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier managedClusterUpgradeProfileResourceId = ManagedClusterUpgradeProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ManagedClusterUpgradeProfileResource managedClusterUpgradeProfile = client.GetManagedClusterUpgradeProfileResource(managedClusterUpgradeProfileResourceId);
-
- // invoke the operation
- ManagedClusterUpgradeProfileResource result = await managedClusterUpgradeProfile.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
- ManagedClusterUpgradeProfileData 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_MeshRevisionProfileCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MeshRevisionProfileCollection.cs
deleted file mode 100644
index 884bd8df18bb..000000000000
--- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MeshRevisionProfileCollection.cs
+++ /dev/null
@@ -1,160 +0,0 @@
-// 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.Resources;
-
-namespace Azure.ResourceManager.ContainerService.Samples
-{
- public partial class Sample_MeshRevisionProfileCollection
- {
- // List mesh revision profiles in a location
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task GetAll_ListMeshRevisionProfilesInALocation()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersList_MeshRevisionProfiles.json
- // this example is just showing the usage of "ManagedClusters_ListMeshRevisionProfiles" 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);
-
- // get the collection of this MeshRevisionProfileResource
- AzureLocation location = new AzureLocation("location1");
- MeshRevisionProfileCollection collection = subscriptionResource.GetMeshRevisionProfiles(location);
-
- // invoke the operation and iterate over the result
- await foreach (MeshRevisionProfileResource 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
- MeshRevisionProfileData resourceData = item.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- Console.WriteLine($"Succeeded");
- }
-
- // Get a mesh revision profile for a mesh mode
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Get_GetAMeshRevisionProfileForAMeshMode()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGet_MeshRevisionProfile.json
- // this example is just showing the usage of "ManagedClusters_GetMeshRevisionProfile" 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);
-
- // get the collection of this MeshRevisionProfileResource
- AzureLocation location = new AzureLocation("location1");
- MeshRevisionProfileCollection collection = subscriptionResource.GetMeshRevisionProfiles(location);
-
- // invoke the operation
- string mode = "istio";
- MeshRevisionProfileResource result = await collection.GetAsync(mode);
-
- // 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
- MeshRevisionProfileData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Get a mesh revision profile for a mesh mode
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Exists_GetAMeshRevisionProfileForAMeshMode()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGet_MeshRevisionProfile.json
- // this example is just showing the usage of "ManagedClusters_GetMeshRevisionProfile" 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);
-
- // get the collection of this MeshRevisionProfileResource
- AzureLocation location = new AzureLocation("location1");
- MeshRevisionProfileCollection collection = subscriptionResource.GetMeshRevisionProfiles(location);
-
- // invoke the operation
- string mode = "istio";
- bool result = await collection.ExistsAsync(mode);
-
- Console.WriteLine($"Succeeded: {result}");
- }
-
- // Get a mesh revision profile for a mesh mode
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task GetIfExists_GetAMeshRevisionProfileForAMeshMode()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGet_MeshRevisionProfile.json
- // this example is just showing the usage of "ManagedClusters_GetMeshRevisionProfile" 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);
-
- // get the collection of this MeshRevisionProfileResource
- AzureLocation location = new AzureLocation("location1");
- MeshRevisionProfileCollection collection = subscriptionResource.GetMeshRevisionProfiles(location);
-
- // invoke the operation
- string mode = "istio";
- NullableResponse response = await collection.GetIfExistsAsync(mode);
- MeshRevisionProfileResource 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
- MeshRevisionProfileData 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_MeshRevisionProfileResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MeshRevisionProfileResource.cs
deleted file mode 100644
index 1f93aa28ed71..000000000000
--- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MeshRevisionProfileResource.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-// 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;
-
-namespace Azure.ResourceManager.ContainerService.Samples
-{
- public partial class Sample_MeshRevisionProfileResource
- {
- // Get a mesh revision profile for a mesh mode
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Get_GetAMeshRevisionProfileForAMeshMode()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGet_MeshRevisionProfile.json
- // this example is just showing the usage of "ManagedClusters_GetMeshRevisionProfile" 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 MeshRevisionProfileResource created on azure
- // for more information of creating MeshRevisionProfileResource, please refer to the document of MeshRevisionProfileResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- AzureLocation location = new AzureLocation("location1");
- string mode = "istio";
- ResourceIdentifier meshRevisionProfileResourceId = MeshRevisionProfileResource.CreateResourceIdentifier(subscriptionId, location, mode);
- MeshRevisionProfileResource meshRevisionProfile = client.GetMeshRevisionProfileResource(meshRevisionProfileResourceId);
-
- // invoke the operation
- MeshRevisionProfileResource result = await meshRevisionProfile.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
- MeshRevisionProfileData 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_MeshUpgradeProfileCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MeshUpgradeProfileCollection.cs
deleted file mode 100644
index 3cfc385c081e..000000000000
--- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MeshUpgradeProfileCollection.cs
+++ /dev/null
@@ -1,163 +0,0 @@
-// 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;
-
-namespace Azure.ResourceManager.ContainerService.Samples
-{
- public partial class Sample_MeshUpgradeProfileCollection
- {
- // Lists version compatibility and upgrade profile for all service meshes in a cluster
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task GetAll_ListsVersionCompatibilityAndUpgradeProfileForAllServiceMeshesInACluster()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersList_MeshUpgradeProfiles.json
- // this example is just showing the usage of "ManagedClusters_ListMeshUpgradeProfiles" 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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // get the collection of this MeshUpgradeProfileResource
- MeshUpgradeProfileCollection collection = containerServiceManagedCluster.GetMeshUpgradeProfiles();
-
- // invoke the operation and iterate over the result
- await foreach (MeshUpgradeProfileResource 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
- MeshUpgradeProfileData resourceData = item.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- Console.WriteLine($"Succeeded");
- }
-
- // Gets version compatibility and upgrade profile for a service mesh in a cluster
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Get_GetsVersionCompatibilityAndUpgradeProfileForAServiceMeshInACluster()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGet_MeshUpgradeProfile.json
- // this example is just showing the usage of "ManagedClusters_GetMeshUpgradeProfile" 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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // get the collection of this MeshUpgradeProfileResource
- MeshUpgradeProfileCollection collection = containerServiceManagedCluster.GetMeshUpgradeProfiles();
-
- // invoke the operation
- string mode = "istio";
- MeshUpgradeProfileResource result = await collection.GetAsync(mode);
-
- // 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
- MeshUpgradeProfileData resourceData = result.Data;
- // for demo we just print out the id
- Console.WriteLine($"Succeeded on id: {resourceData.Id}");
- }
-
- // Gets version compatibility and upgrade profile for a service mesh in a cluster
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Exists_GetsVersionCompatibilityAndUpgradeProfileForAServiceMeshInACluster()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGet_MeshUpgradeProfile.json
- // this example is just showing the usage of "ManagedClusters_GetMeshUpgradeProfile" 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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // get the collection of this MeshUpgradeProfileResource
- MeshUpgradeProfileCollection collection = containerServiceManagedCluster.GetMeshUpgradeProfiles();
-
- // invoke the operation
- string mode = "istio";
- bool result = await collection.ExistsAsync(mode);
-
- Console.WriteLine($"Succeeded: {result}");
- }
-
- // Gets version compatibility and upgrade profile for a service mesh in a cluster
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task GetIfExists_GetsVersionCompatibilityAndUpgradeProfileForAServiceMeshInACluster()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGet_MeshUpgradeProfile.json
- // this example is just showing the usage of "ManagedClusters_GetMeshUpgradeProfile" 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 ContainerServiceManagedClusterResource created on azure
- // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName);
- ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId);
-
- // get the collection of this MeshUpgradeProfileResource
- MeshUpgradeProfileCollection collection = containerServiceManagedCluster.GetMeshUpgradeProfiles();
-
- // invoke the operation
- string mode = "istio";
- NullableResponse response = await collection.GetIfExistsAsync(mode);
- MeshUpgradeProfileResource 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
- MeshUpgradeProfileData 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_MeshUpgradeProfileResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MeshUpgradeProfileResource.cs
deleted file mode 100644
index 9d5fb16420aa..000000000000
--- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MeshUpgradeProfileResource.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-// 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;
-
-namespace Azure.ResourceManager.ContainerService.Samples
-{
- public partial class Sample_MeshUpgradeProfileResource
- {
- // Gets version compatibility and upgrade profile for a service mesh in a cluster
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Get_GetsVersionCompatibilityAndUpgradeProfileForAServiceMeshInACluster()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGet_MeshUpgradeProfile.json
- // this example is just showing the usage of "ManagedClusters_GetMeshUpgradeProfile" 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 MeshUpgradeProfileResource created on azure
- // for more information of creating MeshUpgradeProfileResource, please refer to the document of MeshUpgradeProfileResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- string resourceGroupName = "rg1";
- string resourceName = "clustername1";
- string mode = "istio";
- ResourceIdentifier meshUpgradeProfileResourceId = MeshUpgradeProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, mode);
- MeshUpgradeProfileResource meshUpgradeProfile = client.GetMeshUpgradeProfileResource(meshUpgradeProfileResourceId);
-
- // invoke the operation
- MeshUpgradeProfileResource result = await meshUpgradeProfile.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
- MeshUpgradeProfileData 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_OSOptionProfileResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_OSOptionProfileResource.cs
deleted file mode 100644
index d523ebe5480a..000000000000
--- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_OSOptionProfileResource.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-// 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;
-
-namespace Azure.ResourceManager.ContainerService.Samples
-{
- public partial class Sample_OSOptionProfileResource
- {
- // Get Container Service OS Options
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task Get_GetContainerServiceOSOptions()
- {
- // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ContainerServiceGetOSOptions.json
- // this example is just showing the usage of "ManagedClusters_GetOSOptions" 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 OSOptionProfileResource created on azure
- // for more information of creating OSOptionProfileResource, please refer to the document of OSOptionProfileResource
- string subscriptionId = "00000000-0000-0000-0000-000000000000";
- AzureLocation location = new AzureLocation("location1");
- ResourceIdentifier osOptionProfileResourceId = OSOptionProfileResource.CreateResourceIdentifier(subscriptionId, location);
- OSOptionProfileResource osOptionProfile = client.GetOSOptionProfileResource(osOptionProfileResourceId);
-
- // invoke the operation
- OSOptionProfileResource result = await osOptionProfile.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
- OSOptionProfileData 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
deleted file mode 100644
index 4ffce8b10134..000000000000
--- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-// 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;
-
-namespace Azure.ResourceManager.ContainerService.Samples
-{
- public partial class Sample_SubscriptionResourceExtensions
- {
- // List Kubernetes Versions
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- public async Task GetKubernetesVersionsManagedCluster_ListKubernetesVersions()
- {
- // 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.
-
- // 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
- AzureLocation location = new AzureLocation("location1");
- KubernetesVersionListResult result = await subscriptionResource.GetKubernetesVersionsManagedClusterAsync(location);
-
- Console.WriteLine($"Succeeded: {result}");
- }
-
- // List trusted access roles
- [NUnit.Framework.Test]
- [NUnit.Framework.Ignore("Only verifying that the sample builds")]
- 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..51ce8e355136
--- /dev/null
+++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_UpdateRunCollection.cs
@@ -0,0 +1,222 @@
+// 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;
+
+namespace Azure.ResourceManager.ContainerService.Samples
+{
+ public partial class Sample_UpdateRunCollection
+ {
+ // Lists the UpdateRun resources by fleet.
+ [NUnit.Framework.Test]
+ [NUnit.Framework.Ignore("Only verifying that the sample builds")]
+ public async Task GetAll_ListsTheUpdateRunResourcesByFleet()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-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");
+ }
+
+ // Gets an UpdateRun resource.
+ [NUnit.Framework.Test]
+ [NUnit.Framework.Ignore("Only verifying that the sample builds")]
+ public async Task Get_GetsAnUpdateRunResource()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-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}");
+ }
+
+ // Gets an UpdateRun resource.
+ [NUnit.Framework.Test]
+ [NUnit.Framework.Ignore("Only verifying that the sample builds")]
+ public async Task Exists_GetsAnUpdateRunResource()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-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}");
+ }
+
+ // Gets an UpdateRun resource.
+ [NUnit.Framework.Test]
+ [NUnit.Framework.Ignore("Only verifying that the sample builds")]
+ public async Task GetIfExists_GetsAnUpdateRunResource()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-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}");
+ }
+ }
+
+ // Create an UpdateRun.
+ [NUnit.Framework.Test]
+ [NUnit.Framework.Ignore("Only verifying that the sample builds")]
+ public async Task CreateOrUpdate_CreateAnUpdateRun()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-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",
+ })
+ {
+ SelectionType = 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}");
+ }
+ }
+}
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..7f68e86a8f50
--- /dev/null
+++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_UpdateRunResource.cs
@@ -0,0 +1,236 @@
+// 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;
+
+namespace Azure.ResourceManager.ContainerService.Samples
+{
+ public partial class Sample_UpdateRunResource
+ {
+ // Gets an UpdateRun resource.
+ [NUnit.Framework.Test]
+ [NUnit.Framework.Ignore("Only verifying that the sample builds")]
+ public async Task Get_GetsAnUpdateRunResource()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-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}");
+ }
+
+ // Create an UpdateRun.
+ [NUnit.Framework.Test]
+ [NUnit.Framework.Ignore("Only verifying that the sample builds")]
+ public async Task Update_CreateAnUpdateRun()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-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",
+ })
+ {
+ SelectionType = 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}");
+ }
+
+ // Delete an updateRun resource.
+ [NUnit.Framework.Test]
+ [NUnit.Framework.Ignore("Only verifying that the sample builds")]
+ public async Task Delete_DeleteAnUpdateRunResource()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-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");
+ }
+
+ // Skips one or more member/group/stage/afterStageWait(s) of an UpdateRun.
+ [NUnit.Framework.Test]
+ [NUnit.Framework.Ignore("Only verifying that the sample builds")]
+ public async Task Skip_SkipsOneOrMoreMemberGroupStageAfterStageWaitSOfAnUpdateRun()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-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}");
+ }
+
+ // Starts an UpdateRun.
+ [NUnit.Framework.Test]
+ [NUnit.Framework.Ignore("Only verifying that the sample builds")]
+ public async Task Start_StartsAnUpdateRun()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-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}");
+ }
+
+ // Stops an UpdateRun.
+ [NUnit.Framework.Test]
+ [NUnit.Framework.Ignore("Only verifying that the sample builds")]
+ public async Task Stop_StopsAnUpdateRun()
+ {
+ // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-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.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotData.cs
deleted file mode 100644
index 1bbf5325758a..000000000000
--- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotData.cs
+++ /dev/null
@@ -1,123 +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.
- 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.
- public SnapshotType? SnapshotType { get; set; }
- /// The version of Kubernetes.
- public string KubernetesVersion { get; }
- /// The version of node image.
- public string NodeImageVersion { get; }
- /// The operating system type. The default is Linux.
- 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.
- public ContainerServiceOSSku? OSSku { get; }
- /// The size of the VM.
- public string VmSize { get; }
- /// Whether to use a FIPS-enabled OS.
- 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/AgentPoolUpgradeProfileData.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileData.Serialization.cs
deleted file mode 100644
index 419d90b11e1d..000000000000
--- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileData.Serialization.cs
+++ /dev/null
@@ -1,237 +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.Text.Json;
-using Azure.Core;
-using Azure.ResourceManager.ContainerService.Models;
-using Azure.ResourceManager.Models;
-
-namespace Azure.ResourceManager.ContainerService
-{
- public partial class AgentPoolUpgradeProfileData : IUtf8JsonSerializable, IJsonModel
- {
- void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
-
- void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
- if (format != "J")
- {
- throw new FormatException($"The model {nameof(AgentPoolUpgradeProfileData)} does not support writing '{format}' format.");
- }
-
- writer.WriteStartObject();
- if (options.Format != "W")
- {
- writer.WritePropertyName("id"u8);
- writer.WriteStringValue(Id);
- }
- if (options.Format != "W")
- {
- writer.WritePropertyName("name"u8);
- writer.WriteStringValue(Name);
- }
- if (options.Format != "W")
- {
- writer.WritePropertyName("type"u8);
- writer.WriteStringValue(ResourceType);
- }
- if (options.Format != "W" && Optional.IsDefined(SystemData))
- {
- writer.WritePropertyName("systemData"u8);
- JsonSerializer.Serialize(writer, SystemData);
- }
- writer.WritePropertyName("properties"u8);
- writer.WriteStartObject();
- writer.WritePropertyName("kubernetesVersion"u8);
- writer.WriteStringValue(KubernetesVersion);
- writer.WritePropertyName("osType"u8);
- writer.WriteStringValue(OSType.ToString());
- if (Optional.IsCollectionDefined(Upgrades))
- {
- writer.WritePropertyName("upgrades"u8);
- writer.WriteStartArray();
- foreach (var item in Upgrades)
- {
- writer.WriteObjectValue(item, options);
- }
- writer.WriteEndArray();
- }
- if (Optional.IsDefined(LatestNodeImageVersion))
- {
- writer.WritePropertyName("latestNodeImageVersion"u8);
- writer.WriteStringValue(LatestNodeImageVersion);
- }
- writer.WriteEndObject();
- if (options.Format != "W" && _serializedAdditionalRawData != null)
- {
- foreach (var item in _serializedAdditionalRawData)
- {
- writer.WritePropertyName(item.Key);
-#if NET6_0_OR_GREATER
- writer.WriteRawValue(item.Value);
-#else
- using (JsonDocument document = JsonDocument.Parse(item.Value))
- {
- JsonSerializer.Serialize(writer, document.RootElement);
- }
-#endif
- }
- }
- writer.WriteEndObject();
- }
-
- AgentPoolUpgradeProfileData 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(AgentPoolUpgradeProfileData)} does not support reading '{format}' format.");
- }
-
- using JsonDocument document = JsonDocument.ParseValue(ref reader);
- return DeserializeAgentPoolUpgradeProfileData(document.RootElement, options);
- }
-
- internal static AgentPoolUpgradeProfileData DeserializeAgentPoolUpgradeProfileData(JsonElement element, ModelReaderWriterOptions options = null)
- {
- options ??= ModelSerializationExtensions.WireOptions;
-
- if (element.ValueKind == JsonValueKind.Null)
- {
- return null;
- }
- ResourceIdentifier id = default;
- string name = default;
- ResourceType type = default;
- SystemData systemData = default;
- string kubernetesVersion = default;
- ContainerServiceOSType osType = default;
- IReadOnlyList upgrades = default;
- string latestNodeImageVersion = default;
- IDictionary serializedAdditionalRawData = default;
- Dictionary rawDataDictionary = new Dictionary();
- foreach (var property in element.EnumerateObject())
- {
- 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("kubernetesVersion"u8))
- {
- kubernetesVersion = property0.Value.GetString();
- continue;
- }
- if (property0.NameEquals("osType"u8))
- {
- osType = new ContainerServiceOSType(property0.Value.GetString());
- continue;
- }
- if (property0.NameEquals("upgrades"u8))
- {
- if (property0.Value.ValueKind == JsonValueKind.Null)
- {
- continue;
- }
- List array = new List();
- foreach (var item in property0.Value.EnumerateArray())
- {
- array.Add(AgentPoolUpgradeProfilePropertiesUpgradesItem.DeserializeAgentPoolUpgradeProfilePropertiesUpgradesItem(item, options));
- }
- upgrades = array;
- continue;
- }
- if (property0.NameEquals("latestNodeImageVersion"u8))
- {
- latestNodeImageVersion = property0.Value.GetString();
- continue;
- }
- }
- continue;
- }
- if (options.Format != "W")
- {
- rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
- }
- }
- serializedAdditionalRawData = rawDataDictionary;
- return new AgentPoolUpgradeProfileData(
- id,
- name,
- type,
- systemData,
- kubernetesVersion,
- osType,
- upgrades ?? new ChangeTrackingList(),
- latestNodeImageVersion,
- serializedAdditionalRawData);
- }
-
- 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);
- default:
- throw new FormatException($"The model {nameof(AgentPoolUpgradeProfileData)} does not support writing '{options.Format}' format.");
- }
- }
-
- AgentPoolUpgradeProfileData 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 DeserializeAgentPoolUpgradeProfileData(document.RootElement, options);
- }
- default:
- throw new FormatException($"The model {nameof(AgentPoolUpgradeProfileData)} does not support reading '{options.Format}' format.");
- }
- }
-
- string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
- }
-}
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 1269f3b9a22f..000000000000
--- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileData.cs
+++ /dev/null
@@ -1,100 +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).
- public string KubernetesVersion { get; }
- /// The operating system type. The default is Linux.
- public ContainerServiceOSType OSType { get; }
- /// List of orchestrator types and versions available for upgrade.
- public IReadOnlyList Upgrades { get; }
- /// The latest AKS supported node image version.
- 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..6f011aad34c4 100644
--- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ArmContainerServiceModelFactory.cs
+++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ArmContainerServiceModelFactory.cs
@@ -8,956 +8,259 @@
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.
+ /// 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)
{
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,
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, bool? enablePrivateCluster = 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(),
- 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)
- {
- upgrades ??= new List();
-
- return new ManagedClusterPoolUpgradeProfile(kubernetesVersion, name, osType, upgrades?.ToList(), 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 .
- /// 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(
- id,
- name,
- resourceType,
- systemData,
- tags,
- location,
- kubeConfig,
+ return new FleetHubProfile(
+ dnsPrefix,
+ enablePrivateCluster != null ? new ApiServerAccessProfile(enablePrivateCluster, serializedAdditionalRawData: null) : null,
+ agentProfile,
+ fqdn,
+ kubernetesVersion,
+ portalFqdn,
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)
+ /// A new instance for mocking.
+ public static FleetCredentialResult FleetCredentialResult(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)
- {
- 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.
+ /// 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)
+ {
+ 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(),
- 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)
- {
- return new AgentPoolAvailableVersion(isDefault, kubernetesVersion, isPreview, 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 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 ManagedClusterRunCommandContent(command, context, clusterToken, serializedAdditionalRawData: null);
- }
+ stages ??= new List();
+ selectedNodeImageVersions ??= new List();
- /// 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)
- {
- return new ManagedClusterRunCommandResult(
- id,
- provisioningState,
- exitCode,
- startedOn,
- finishedOn,
- logs,
- reason,
- 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 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)
+ /// 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)
{
- endpoints ??= new List();
-
- return new ContainerServiceOutboundEnvironmentEndpoint(category, endpoints?.ToList(), serializedAdditionalRawData: null);
+ return new UpdateStatus(startOn, completedOn, state, error, 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 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)
{
- endpointDetails ??= new List();
+ groups ??= new List();
- return new ContainerServiceEndpointDependency(domainName, endpointDetails?.ToList(), serializedAdditionalRawData: null);
+ return new UpdateStageStatus(status, name, groups?.ToList(), afterStageWaitStatus, 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 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)
{
- return new ContainerServiceEndpointDetail(ipAddress, port, protocol, description, serializedAdditionalRawData: null);
+ members ??= new List();
+
+ return new UpdateGroupStatus(status, name, members?.ToList(), 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 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)
{
- tags ??= new Dictionary();
-
- return new AgentPoolSnapshotData(
- id,
+ return new MemberUpdateStatus(
+ status,
name,
- resourceType,
- systemData,
- tags,
- location,
- creationDataSourceResourceId != null ? new ContainerServiceCreationData(creationDataSourceResourceId, serializedAdditionalRawData: null) : null,
- snapshotType,
- kubernetesVersion,
- nodeImageVersion,
- osType,
- osSku,
- vmSize,
- enableFips,
+ clusterResourceId,
+ operationId,
+ message,
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 wait duration.
+ /// The wait duration configured in seconds.
+ /// A new instance for mocking.
+ public static WaitStatus WaitStatus(UpdateStatus status = null, int? waitDurationInSeconds = null)
{
- meshRevisions ??= new List();
-
- return new MeshRevisionProfileData(
- id,
- name,
- resourceType,
- systemData,
- meshRevisions != null ? new MeshRevisionProfileProperties(meshRevisions?.ToList(), serializedAdditionalRawData: null) : null,
- serializedAdditionalRawData: null);
+ return new WaitStatus(status, waitDurationInSeconds, 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 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 MeshUpgradeProfileData(
- id,
- name,
- resourceType,
- systemData,
- properties,
- serializedAdditionalRawData: null);
+ return new NodeImageVersion(version, 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