diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_AgentPoolSnapshotCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_AgentPoolSnapshotCollection.cs index 5863b1521d9f..960e40f41d52 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_AgentPoolSnapshotCollection.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_AgentPoolSnapshotCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_AgentPoolSnapshotCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateUpdateSnapshot() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/SnapshotsCreate.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -63,7 +63,7 @@ public async Task CreateOrUpdate_CreateUpdateSnapshot() [Ignore("Only validating compilation of examples")] public async Task Get_GetSnapshot() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/SnapshotsGet.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -96,7 +96,7 @@ public async Task Get_GetSnapshot() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListSnapshotsByResourceGroup() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/SnapshotsListByResourceGroup.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -131,7 +131,7 @@ public async Task GetAll_ListSnapshotsByResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_GetSnapshot() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/SnapshotsGet.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -160,7 +160,7 @@ public async Task Exists_GetSnapshot() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetSnapshot() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/SnapshotsGet.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 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 index 18f0d6f5f8fc..a5d28c0b43ce 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_AgentPoolSnapshotResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_AgentPoolSnapshotResource.cs @@ -20,7 +20,7 @@ public partial class Sample_AgentPoolSnapshotResource [Ignore("Only validating compilation of examples")] public async Task Get_GetSnapshot() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/SnapshotsGet.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -50,7 +50,7 @@ public async Task Get_GetSnapshot() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteSnapshot() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/SnapshotsDelete.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -76,7 +76,7 @@ public async Task Delete_DeleteSnapshot() [Ignore("Only validating compilation of examples")] public async Task Update_UpdateSnapshotTags() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/SnapshotsUpdateTags.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 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 index 16685e88b2e2..29f474fdbb7b 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_AgentPoolUpgradeProfileResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_AgentPoolUpgradeProfileResource.cs @@ -19,7 +19,7 @@ public partial class Sample_AgentPoolUpgradeProfileResource [Ignore("Only validating compilation of examples")] public async Task Get_GetUpgradeProfileForAgentPool() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsGetUpgradeProfile.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 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 index d89556d52e00..acee52f33ad8 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceAgentPoolCollection.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceAgentPoolCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerServiceAgentPoolCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateAgentPoolUsingAnAgentPoolSnapshot() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_Snapshot.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -64,7 +64,7 @@ public async Task CreateOrUpdate_CreateAgentPoolUsingAnAgentPoolSnapshot() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateAgentPoolWithCapacityReservationGroup() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_CRG.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -107,7 +107,7 @@ public async Task CreateOrUpdate_CreateAgentPoolWithCapacityReservationGroup() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateAgentPoolWithDedicatedHostGroup() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_DedicatedHostGroup.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -150,7 +150,7 @@ public async Task CreateOrUpdate_CreateAgentPoolWithDedicatedHostGroup() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateAgentPoolWithEncryptionAtHostEnabled() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_EnableEncryptionAtHost.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -193,7 +193,7 @@ public async Task CreateOrUpdate_CreateAgentPoolWithEncryptionAtHostEnabled() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateAgentPoolWithEphemeralOSDisk() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_Ephemeral.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -237,7 +237,7 @@ public async Task CreateOrUpdate_CreateAgentPoolWithEphemeralOSDisk() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateAgentPoolWithFIPSEnabledOS() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_EnableFIPS.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -280,7 +280,7 @@ public async Task CreateOrUpdate_CreateAgentPoolWithFIPSEnabledOS() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateAgentPoolWithGPUMIG() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_GPUMIG.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -347,7 +347,7 @@ public async Task CreateOrUpdate_CreateAgentPoolWithGPUMIG() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateAgentPoolWithKrustletAndTheWASIRuntime() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_WasmWasi.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -392,7 +392,7 @@ public async Task CreateOrUpdate_CreateAgentPoolWithKrustletAndTheWASIRuntime() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateAgentPoolWithKubeletConfigAndLinuxOSConfig() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_CustomNodeConfig.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -454,11 +454,56 @@ public async Task CreateOrUpdate_CreateAgentPoolWithKubeletConfigAndLinuxOSConfi Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateAgentPoolWithMessageOfTheDay() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/AgentPoolsCreate_MessageOfTheDay.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, + MessageOfTheDay = "Zm9vCg==", + 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}"); + } + [Test] [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateAgentPoolWithOSSKU() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_OSSKU.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -525,7 +570,7 @@ public async Task CreateOrUpdate_CreateAgentPoolWithOSSKU() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateAgentPoolWithPPG() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_PPG.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -568,7 +613,7 @@ public async Task CreateOrUpdate_CreateAgentPoolWithPPG() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateAgentPoolWithUltraSSDEnabled() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_EnableUltraSSD.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -611,7 +656,7 @@ public async Task CreateOrUpdate_CreateAgentPoolWithUltraSSDEnabled() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateAgentPoolWithWindowsOSSKU() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_WindowsOSSKU.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -654,7 +699,7 @@ public async Task CreateOrUpdate_CreateAgentPoolWithWindowsOSSKU() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateSpotAgentPool() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_Spot.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -703,11 +748,55 @@ public async Task CreateOrUpdate_CreateSpotAgentPool() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateWindowsAgentPoolWithDisablingOutboundNAT() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/AgentPoolsCreate_WindowsDisableOutboundNAT.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.8", + DisableOutboundNat = 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}"); + } + [Test] [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateUpdateAgentPool() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_Update.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -761,7 +850,7 @@ public async Task CreateOrUpdate_CreateUpdateAgentPool() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_StartAgentPool() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPools_Start.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -800,7 +889,7 @@ public async Task CreateOrUpdate_StartAgentPool() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_StopAgentPool() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPools_Stop.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -839,7 +928,7 @@ public async Task CreateOrUpdate_StopAgentPool() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_UpdateAgentPool() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPools_Update.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -887,7 +976,7 @@ public async Task CreateOrUpdate_UpdateAgentPool() [Ignore("Only validating compilation of examples")] public async Task Get_GetAgentPool() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsGet.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -921,7 +1010,7 @@ public async Task Get_GetAgentPool() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListAgentPoolsByManagedCluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsList.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -957,7 +1046,7 @@ public async Task GetAll_ListAgentPoolsByManagedCluster() [Ignore("Only validating compilation of examples")] public async Task Exists_GetAgentPool() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsGet.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -987,7 +1076,7 @@ public async Task Exists_GetAgentPool() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetAgentPool() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsGet.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 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 index 8f449f069239..f38b3a4b29ef 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceAgentPoolResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceAgentPoolResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerServiceAgentPoolResource [Ignore("Only validating compilation of examples")] public async Task Get_GetAgentPool() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsGet.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -51,7 +51,7 @@ public async Task Get_GetAgentPool() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteAgentPool() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsDelete.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -78,7 +78,7 @@ public async Task Delete_DeleteAgentPool() [Ignore("Only validating compilation of examples")] public async Task Update_CreateAgentPoolUsingAnAgentPoolSnapshot() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_Snapshot.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -119,7 +119,7 @@ public async Task Update_CreateAgentPoolUsingAnAgentPoolSnapshot() [Ignore("Only validating compilation of examples")] public async Task Update_CreateAgentPoolWithCapacityReservationGroup() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_CRG.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -159,7 +159,7 @@ public async Task Update_CreateAgentPoolWithCapacityReservationGroup() [Ignore("Only validating compilation of examples")] public async Task Update_CreateAgentPoolWithDedicatedHostGroup() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_DedicatedHostGroup.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -199,7 +199,7 @@ public async Task Update_CreateAgentPoolWithDedicatedHostGroup() [Ignore("Only validating compilation of examples")] public async Task Update_CreateAgentPoolWithEncryptionAtHostEnabled() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_EnableEncryptionAtHost.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -239,7 +239,7 @@ public async Task Update_CreateAgentPoolWithEncryptionAtHostEnabled() [Ignore("Only validating compilation of examples")] public async Task Update_CreateAgentPoolWithEphemeralOSDisk() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_Ephemeral.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -280,7 +280,7 @@ public async Task Update_CreateAgentPoolWithEphemeralOSDisk() [Ignore("Only validating compilation of examples")] public async Task Update_CreateAgentPoolWithFIPSEnabledOS() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_EnableFIPS.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -320,7 +320,7 @@ public async Task Update_CreateAgentPoolWithFIPSEnabledOS() [Ignore("Only validating compilation of examples")] public async Task Update_CreateAgentPoolWithGPUMIG() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_GPUMIG.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -384,7 +384,7 @@ public async Task Update_CreateAgentPoolWithGPUMIG() [Ignore("Only validating compilation of examples")] public async Task Update_CreateAgentPoolWithKrustletAndTheWASIRuntime() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_WasmWasi.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -426,7 +426,7 @@ public async Task Update_CreateAgentPoolWithKrustletAndTheWASIRuntime() [Ignore("Only validating compilation of examples")] public async Task Update_CreateAgentPoolWithKubeletConfigAndLinuxOSConfig() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_CustomNodeConfig.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -485,11 +485,53 @@ public async Task Update_CreateAgentPoolWithKubeletConfigAndLinuxOSConfig() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CreateAgentPoolWithMessageOfTheDay() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/AgentPoolsCreate_MessageOfTheDay.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, + MessageOfTheDay = "Zm9vCg==", + 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}"); + } + [Test] [Ignore("Only validating compilation of examples")] public async Task Update_CreateAgentPoolWithOSSKU() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_OSSKU.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -553,7 +595,7 @@ public async Task Update_CreateAgentPoolWithOSSKU() [Ignore("Only validating compilation of examples")] public async Task Update_CreateAgentPoolWithPPG() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_PPG.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -593,7 +635,7 @@ public async Task Update_CreateAgentPoolWithPPG() [Ignore("Only validating compilation of examples")] public async Task Update_CreateAgentPoolWithUltraSSDEnabled() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_EnableUltraSSD.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -633,7 +675,7 @@ public async Task Update_CreateAgentPoolWithUltraSSDEnabled() [Ignore("Only validating compilation of examples")] public async Task Update_CreateAgentPoolWithWindowsOSSKU() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_WindowsOSSKU.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -673,7 +715,7 @@ public async Task Update_CreateAgentPoolWithWindowsOSSKU() [Ignore("Only validating compilation of examples")] public async Task Update_CreateSpotAgentPool() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_Spot.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -719,11 +761,52 @@ public async Task Update_CreateSpotAgentPool() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CreateWindowsAgentPoolWithDisablingOutboundNAT() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/AgentPoolsCreate_WindowsDisableOutboundNAT.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.8", + DisableOutboundNat = 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}"); + } + [Test] [Ignore("Only validating compilation of examples")] public async Task Update_CreateUpdateAgentPool() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_Update.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -774,7 +857,7 @@ public async Task Update_CreateUpdateAgentPool() [Ignore("Only validating compilation of examples")] public async Task Update_StartAgentPool() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPools_Start.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -810,7 +893,7 @@ public async Task Update_StartAgentPool() [Ignore("Only validating compilation of examples")] public async Task Update_StopAgentPool() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPools_Stop.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -846,7 +929,7 @@ public async Task Update_StopAgentPool() [Ignore("Only validating compilation of examples")] public async Task Update_UpdateAgentPool() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPools_Update.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -891,7 +974,7 @@ public async Task Update_UpdateAgentPool() [Ignore("Only validating compilation of examples")] public async Task AbortLatestOperation_AbortOperationOnAgentPool() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsAbortOperation.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -914,11 +997,39 @@ public async Task AbortLatestOperation_AbortOperationOnAgentPool() Console.WriteLine("Succeeded"); } + [Test] + [Ignore("Only validating compilation of examples")] + public async Task DeleteMachines_DeleteSpecificMachinesInAnAgentPool() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/AgentPoolsDeleteMachines.json + // this example is just showing the usage of "AgentPools_DeleteMachines" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 + AgentPoolDeleteMachinesParameter machines = new AgentPoolDeleteMachinesParameter(new string[] { "aks-nodepool1-42263519-vmss00000a", "aks-nodepool1-42263519-vmss00000b" }); + await containerServiceAgentPool.DeleteMachinesAsync(WaitUntil.Completed, machines); + + Console.WriteLine("Succeeded"); + } + [Test] [Ignore("Only validating compilation of examples")] public async Task UpgradeNodeImageVersion_UpgradeAgentPoolNodeImageVersion() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsUpgradeNodeImageVersion.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 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 index 6c6340f77ea6..185762b403f5 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceMaintenanceConfigurationCollection.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceMaintenanceConfigurationCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerServiceMaintenanceConfigurationCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateUpdateMaintenanceConfiguration() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsCreate_Update.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -68,7 +68,7 @@ public async Task CreateOrUpdate_CreateUpdateMaintenanceConfiguration() [Ignore("Only validating compilation of examples")] 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 + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -115,7 +115,7 @@ public async Task CreateOrUpdate_CreateUpdateMaintenanceConfigurationWithMainten [Ignore("Only validating compilation of examples")] public async Task Get_GetMaintenanceConfiguration() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsGet.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -149,7 +149,7 @@ public async Task Get_GetMaintenanceConfiguration() [Ignore("Only validating compilation of examples")] public async Task Get_GetMaintenanceConfigurationConfiguredWithMaintenanceWindow() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsGet_MaintenanceWindow.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -183,7 +183,7 @@ public async Task Get_GetMaintenanceConfigurationConfiguredWithMaintenanceWindow [Ignore("Only validating compilation of examples")] public async Task GetAll_ListMaintenanceConfigurationsByManagedCluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsList.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -219,7 +219,7 @@ public async Task GetAll_ListMaintenanceConfigurationsByManagedCluster() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListMaintenanceConfigurationsConfiguredWithMaintenanceWindowByManagedCluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsList_MaintenanceWindow.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -255,7 +255,7 @@ public async Task GetAll_ListMaintenanceConfigurationsConfiguredWithMaintenanceW [Ignore("Only validating compilation of examples")] public async Task Exists_GetMaintenanceConfiguration() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsGet.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -285,7 +285,7 @@ public async Task Exists_GetMaintenanceConfiguration() [Ignore("Only validating compilation of examples")] public async Task Exists_GetMaintenanceConfigurationConfiguredWithMaintenanceWindow() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsGet_MaintenanceWindow.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -315,7 +315,7 @@ public async Task Exists_GetMaintenanceConfigurationConfiguredWithMaintenanceWin [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetMaintenanceConfiguration() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsGet.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -357,7 +357,7 @@ public async Task GetIfExists_GetMaintenanceConfiguration() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetMaintenanceConfigurationConfiguredWithMaintenanceWindow() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsGet_MaintenanceWindow.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 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 index bacc1890041f..4d89e627139a 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceMaintenanceConfigurationResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceMaintenanceConfigurationResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerServiceMaintenanceConfigurationResource [Ignore("Only validating compilation of examples")] public async Task Get_GetMaintenanceConfiguration() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsGet.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -51,7 +51,7 @@ public async Task Get_GetMaintenanceConfiguration() [Ignore("Only validating compilation of examples")] public async Task Get_GetMaintenanceConfigurationConfiguredWithMaintenanceWindow() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsGet_MaintenanceWindow.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -82,7 +82,7 @@ public async Task Get_GetMaintenanceConfigurationConfiguredWithMaintenanceWindow [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteMaintenanceConfiguration() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsDelete.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -109,7 +109,7 @@ public async Task Delete_DeleteMaintenanceConfiguration() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteMaintenanceConfigurationForNodeOSUpgrade() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsDelete_MaintenanceWindow.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -136,7 +136,7 @@ public async Task Delete_DeleteMaintenanceConfigurationForNodeOSUpgrade() [Ignore("Only validating compilation of examples")] public async Task Update_CreateUpdateMaintenanceConfiguration() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsCreate_Update.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -181,7 +181,7 @@ public async Task Update_CreateUpdateMaintenanceConfiguration() [Ignore("Only validating compilation of examples")] 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 + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 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 index 76550907a7de..f6700f42026f 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceManagedClusterCollection.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceManagedClusterCollection.cs @@ -6,6 +6,7 @@ #nullable disable using System; +using System.Text; using System.Threading.Tasks; using Azure.Core; using Azure.Identity; @@ -22,7 +23,7 @@ public partial class Sample_ContainerServiceManagedClusterCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateManagedClusterUsingAnAgentPoolSnapshot() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_Snapshot.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -76,7 +77,6 @@ public async Task CreateOrUpdate_CreateManagedClusterUsingAnAgentPoolSnapshot() }, AddonProfiles = { }, EnableRbac = true, - EnablePodSecurityPolicy = false, NetworkProfile = new ContainerServiceNetworkProfile { OutboundType = ContainerServiceOutboundType.LoadBalancer, @@ -115,7 +115,7 @@ public async Task CreateOrUpdate_CreateManagedClusterUsingAnAgentPoolSnapshot() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateManagedClusterWithAKSManagedNATGatewayAsOutboundType() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_ManagedNATGateway.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -167,7 +167,6 @@ public async Task CreateOrUpdate_CreateManagedClusterWithAKSManagedNATGatewayAsO }, AddonProfiles = { }, EnableRbac = true, - EnablePodSecurityPolicy = true, NetworkProfile = new ContainerServiceNetworkProfile { OutboundType = ContainerServiceOutboundType.ManagedNatGateway, @@ -203,7 +202,7 @@ public async Task CreateOrUpdate_CreateManagedClusterWithAKSManagedNATGatewayAsO [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateManagedClusterWithAzureKeyVaultSecretsProviderAddon() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_AzureKeyvaultSecretsProvider.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -265,7 +264,6 @@ public async Task CreateOrUpdate_CreateManagedClusterWithAzureKeyVaultSecretsPro } }, EnableRbac = true, - EnablePodSecurityPolicy = true, NetworkProfile = new ContainerServiceNetworkProfile { OutboundType = ContainerServiceOutboundType.LoadBalancer, @@ -304,7 +302,7 @@ public async Task CreateOrUpdate_CreateManagedClusterWithAzureKeyVaultSecretsPro [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateManagedClusterWithCapacityReservationGroup() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_CRG.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -357,7 +355,6 @@ public async Task CreateOrUpdate_CreateManagedClusterWithCapacityReservationGrou }, AddonProfiles = { }, EnableRbac = true, - EnablePodSecurityPolicy = true, NetworkProfile = new ContainerServiceNetworkProfile { OutboundType = ContainerServiceOutboundType.LoadBalancer, @@ -375,7 +372,101 @@ public async Task CreateOrUpdate_CreateManagedClusterWithCapacityReservationGrou ScanIntervalInSeconds = "20s", ScaleDownDelayAfterAdd = "15m", }, - DiskEncryptionSetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + 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}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateManagedClusterWithCustomCATrustCertificates() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersCreate_CustomCATrustCertificates.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, + 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"), + SecurityProfile = new ManagedClusterSecurityProfile + { + CustomCATrustCertificates = { Encoding.UTF8.GetBytes("ZHVtbXlFeGFtcGxlVGVzdFZhbHVlRm9yQ2VydGlmaWNhdGVUb0JlQWRkZWQ=") }, + }, Tags = { ["archv2"] = "", @@ -396,7 +487,7 @@ public async Task CreateOrUpdate_CreateManagedClusterWithCapacityReservationGrou [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateManagedClusterWithDedicatedHostGroup() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_DedicatedHostGroup.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -448,7 +539,6 @@ public async Task CreateOrUpdate_CreateManagedClusterWithDedicatedHostGroup() }, AddonProfiles = { }, EnableRbac = true, - EnablePodSecurityPolicy = false, NetworkProfile = new ContainerServiceNetworkProfile { OutboundType = ContainerServiceOutboundType.LoadBalancer, @@ -487,7 +577,7 @@ public async Task CreateOrUpdate_CreateManagedClusterWithDedicatedHostGroup() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateManagedClusterWithEncryptionAtHostEnabled() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_EnableEncryptionAtHost.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -540,7 +630,6 @@ public async Task CreateOrUpdate_CreateManagedClusterWithEncryptionAtHostEnabled }, AddonProfiles = { }, EnableRbac = true, - EnablePodSecurityPolicy = true, NetworkProfile = new ContainerServiceNetworkProfile { OutboundType = ContainerServiceOutboundType.LoadBalancer, @@ -579,7 +668,7 @@ public async Task CreateOrUpdate_CreateManagedClusterWithEncryptionAtHostEnabled [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateManagedClusterWithFIPSEnabledOS() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_EnabledFIPS.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -632,7 +721,6 @@ public async Task CreateOrUpdate_CreateManagedClusterWithFIPSEnabledOS() }, AddonProfiles = { }, EnableRbac = true, - EnablePodSecurityPolicy = false, NetworkProfile = new ContainerServiceNetworkProfile { OutboundType = ContainerServiceOutboundType.LoadBalancer, @@ -671,7 +759,7 @@ public async Task CreateOrUpdate_CreateManagedClusterWithFIPSEnabledOS() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateManagedClusterWithGPUMIG() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_GPUMIG.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -724,7 +812,6 @@ public async Task CreateOrUpdate_CreateManagedClusterWithGPUMIG() }, AddonProfiles = { }, EnableRbac = true, - EnablePodSecurityPolicy = true, NetworkProfile = new ContainerServiceNetworkProfile { OutboundType = ContainerServiceOutboundType.LoadBalancer, @@ -770,7 +857,7 @@ public async Task CreateOrUpdate_CreateManagedClusterWithGPUMIG() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateManagedClusterWithHTTPProxyConfigured() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_HTTPProxy.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -822,7 +909,6 @@ public async Task CreateOrUpdate_CreateManagedClusterWithHTTPProxyConfigured() }, AddonProfiles = { }, EnableRbac = true, - EnablePodSecurityPolicy = true, NetworkProfile = new ContainerServiceNetworkProfile { OutboundType = ContainerServiceOutboundType.LoadBalancer, @@ -868,7 +954,7 @@ public async Task CreateOrUpdate_CreateManagedClusterWithHTTPProxyConfigured() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateManagedClusterWithLongTermSupport() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_Premium.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -922,7 +1008,6 @@ public async Task CreateOrUpdate_CreateManagedClusterWithLongTermSupport() AddonProfiles = { }, EnableRbac = true, SupportPlan = KubernetesSupportPlan.AKSLongTermSupport, - EnablePodSecurityPolicy = true, NetworkProfile = new ContainerServiceNetworkProfile { OutboundType = ContainerServiceOutboundType.LoadBalancer, @@ -964,7 +1049,7 @@ public async Task CreateOrUpdate_CreateManagedClusterWithLongTermSupport() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateManagedClusterWithNodePublicIPPrefix() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_NodePublicIPPrefix.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -1017,7 +1102,6 @@ public async Task CreateOrUpdate_CreateManagedClusterWithNodePublicIPPrefix() }, AddonProfiles = { }, EnableRbac = true, - EnablePodSecurityPolicy = true, NetworkProfile = new ContainerServiceNetworkProfile { OutboundType = ContainerServiceOutboundType.LoadBalancer, @@ -1056,7 +1140,7 @@ public async Task CreateOrUpdate_CreateManagedClusterWithNodePublicIPPrefix() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateManagedClusterWithOSSKU() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_OSSKU.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -1109,7 +1193,6 @@ public async Task CreateOrUpdate_CreateManagedClusterWithOSSKU() }, AddonProfiles = { }, EnableRbac = true, - EnablePodSecurityPolicy = true, NetworkProfile = new ContainerServiceNetworkProfile { OutboundType = ContainerServiceOutboundType.LoadBalancer, @@ -1155,7 +1238,7 @@ public async Task CreateOrUpdate_CreateManagedClusterWithOSSKU() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateManagedClusterWithPPG() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_PPG.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -1208,7 +1291,6 @@ public async Task CreateOrUpdate_CreateManagedClusterWithPPG() }, AddonProfiles = { }, EnableRbac = true, - EnablePodSecurityPolicy = true, NetworkProfile = new ContainerServiceNetworkProfile { OutboundType = ContainerServiceOutboundType.LoadBalancer, @@ -1247,7 +1329,7 @@ public async Task CreateOrUpdate_CreateManagedClusterWithPPG() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateManagedClusterWithPodIdentityEnabled() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_PodIdentity.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -1304,7 +1386,6 @@ public async Task CreateOrUpdate_CreateManagedClusterWithPodIdentityEnabled() AllowNetworkPluginKubenet = true, }, EnableRbac = true, - EnablePodSecurityPolicy = true, NetworkProfile = new ContainerServiceNetworkProfile { OutboundType = ContainerServiceOutboundType.LoadBalancer, @@ -1343,7 +1424,7 @@ public async Task CreateOrUpdate_CreateManagedClusterWithPodIdentityEnabled() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateManagedClusterWithRunCommandDisabled() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_DisableRunCommand.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -1396,7 +1477,6 @@ public async Task CreateOrUpdate_CreateManagedClusterWithRunCommandDisabled() }, AddonProfiles = { }, EnableRbac = true, - EnablePodSecurityPolicy = true, NetworkProfile = new ContainerServiceNetworkProfile { OutboundType = ContainerServiceOutboundType.LoadBalancer, @@ -1438,7 +1518,7 @@ public async Task CreateOrUpdate_CreateManagedClusterWithRunCommandDisabled() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateManagedClusterWithSecurityProfileConfigured() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_SecurityProfile.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -1521,7 +1601,7 @@ public async Task CreateOrUpdate_CreateManagedClusterWithSecurityProfileConfigur [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateManagedClusterWithUltraSSDEnabled() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_EnableUltraSSD.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -1574,7 +1654,6 @@ public async Task CreateOrUpdate_CreateManagedClusterWithUltraSSDEnabled() }, AddonProfiles = { }, EnableRbac = true, - EnablePodSecurityPolicy = true, NetworkProfile = new ContainerServiceNetworkProfile { OutboundType = ContainerServiceOutboundType.LoadBalancer, @@ -1609,11 +1688,90 @@ public async Task CreateOrUpdate_CreateManagedClusterWithUltraSSDEnabled() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateManagedClusterWithWebAppRoutingIngressProfileConfigured() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/ManagedClustersCreate_IngressProfile_WebAppRouting.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, + }, + }, + }, + IngressWebAppRouting = new ManagedClusterIngressProfileWebAppRouting + { + Enabled = true, + DnsZoneResourceIds = { new ResourceIdentifier("/subscriptions/SUB_ID/resourceGroups/RG_NAME/providers/Microsoft.Network/dnszones/DNS_ZONE_NAME") }, + }, + 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}"); + } + [Test] [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateManagedClusterWithUserAssignedNATGatewayAsOutboundType() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_UserAssignedNATGateway.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -1665,7 +1823,6 @@ public async Task CreateOrUpdate_CreateManagedClusterWithUserAssignedNATGatewayA }, AddonProfiles = { }, EnableRbac = true, - EnablePodSecurityPolicy = true, NetworkProfile = new ContainerServiceNetworkProfile { OutboundType = ContainerServiceOutboundType.UserAssignedNatGateway, @@ -1697,7 +1854,7 @@ public async Task CreateOrUpdate_CreateManagedClusterWithUserAssignedNATGatewayA [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateManagedPrivateClusterWithPublicFQDNSpecified() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_PrivateClusterPublicFQDN.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -1750,7 +1907,6 @@ public async Task CreateOrUpdate_CreateManagedPrivateClusterWithPublicFQDNSpecif }, AddonProfiles = { }, EnableRbac = true, - EnablePodSecurityPolicy = true, NetworkProfile = new ContainerServiceNetworkProfile { OutboundType = ContainerServiceOutboundType.LoadBalancer, @@ -1793,7 +1949,7 @@ public async Task CreateOrUpdate_CreateManagedPrivateClusterWithPublicFQDNSpecif [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateManagedPrivateClusterWithFqdnSubdomainSpecified() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_PrivateClusterFQDNSubdomain.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -1846,7 +2002,6 @@ public async Task CreateOrUpdate_CreateManagedPrivateClusterWithFqdnSubdomainSpe }, AddonProfiles = { }, EnableRbac = true, - EnablePodSecurityPolicy = true, NetworkProfile = new ContainerServiceNetworkProfile { OutboundType = ContainerServiceOutboundType.LoadBalancer, @@ -1889,7 +2044,7 @@ public async Task CreateOrUpdate_CreateManagedPrivateClusterWithFqdnSubdomainSpe [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateUpdateAADManagedClusterWithEnableAzureRBAC() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_UpdateWithEnableAzureRBAC.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -1942,7 +2097,6 @@ public async Task CreateOrUpdate_CreateUpdateAADManagedClusterWithEnableAzureRBA }, AddonProfiles = { }, EnableRbac = true, - EnablePodSecurityPolicy = true, NetworkProfile = new ContainerServiceNetworkProfile { OutboundType = ContainerServiceOutboundType.LoadBalancer, @@ -1986,7 +2140,7 @@ public async Task CreateOrUpdate_CreateUpdateAADManagedClusterWithEnableAzureRBA [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateUpdateManagedCluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_Update.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -2048,7 +2202,6 @@ public async Task CreateOrUpdate_CreateUpdateManagedCluster() }, AddonProfiles = { }, EnableRbac = true, - EnablePodSecurityPolicy = true, NetworkProfile = new ContainerServiceNetworkProfile { OutboundType = ContainerServiceOutboundType.LoadBalancer, @@ -2097,7 +2250,7 @@ public async Task CreateOrUpdate_CreateUpdateManagedCluster() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateUpdateManagedClusterWithAzureServiceMesh() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_AzureServiceMesh.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -2159,7 +2312,6 @@ public async Task CreateOrUpdate_CreateUpdateManagedClusterWithAzureServiceMesh( } }, EnableRbac = true, - EnablePodSecurityPolicy = true, NetworkProfile = new ContainerServiceNetworkProfile { OutboundType = ContainerServiceOutboundType.LoadBalancer, @@ -2185,13 +2337,7 @@ public async Task CreateOrUpdate_CreateUpdateManagedClusterWithAzureServiceMesh( Components = new IstioComponents { IngressGateways = { new IstioIngressGateway(IstioIngressGatewayMode.Internal, true) }, - EgressGateways = {new IstioEgressGateway(true) -{ -NodeSelector = -{ -["istio"] = "egress" -}, -}}, + EgressGateways = { new IstioEgressGateway(true) }, }, CertificateAuthorityPlugin = new IstioPluginCertificateAuthority { @@ -2223,7 +2369,7 @@ public async Task CreateOrUpdate_CreateUpdateManagedClusterWithAzureServiceMesh( [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateUpdateManagedClusterWithEnableAHUB() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_UpdateWithAHUB.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -2285,7 +2431,6 @@ public async Task CreateOrUpdate_CreateUpdateManagedClusterWithEnableAHUB() }, AddonProfiles = { }, EnableRbac = true, - EnablePodSecurityPolicy = true, NetworkProfile = new ContainerServiceNetworkProfile { OutboundType = ContainerServiceOutboundType.LoadBalancer, @@ -2324,7 +2469,7 @@ public async Task CreateOrUpdate_CreateUpdateManagedClusterWithEnableAHUB() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateUpdateManagedClusterWithWindowsGMSAEnabled() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_UpdateWindowsGmsa.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -2389,7 +2534,6 @@ public async Task CreateOrUpdate_CreateUpdateManagedClusterWithWindowsGMSAEnable }, AddonProfiles = { }, EnableRbac = true, - EnablePodSecurityPolicy = true, NetworkProfile = new ContainerServiceNetworkProfile { OutboundType = ContainerServiceOutboundType.LoadBalancer, @@ -2428,7 +2572,7 @@ public async Task CreateOrUpdate_CreateUpdateManagedClusterWithWindowsGMSAEnable [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateUpdateManagedClusterWithDualStackNetworking() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_DualStackNetworking.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -2490,7 +2634,6 @@ public async Task CreateOrUpdate_CreateUpdateManagedClusterWithDualStackNetworki }, AddonProfiles = { }, EnableRbac = true, - EnablePodSecurityPolicy = true, NetworkProfile = new ContainerServiceNetworkProfile { OutboundType = ContainerServiceOutboundType.LoadBalancer, @@ -2535,7 +2678,7 @@ public async Task CreateOrUpdate_CreateUpdateManagedClusterWithDualStackNetworki [Ignore("Only validating compilation of examples")] public async Task Get_GetManagedCluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGet.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -2568,7 +2711,7 @@ public async Task Get_GetManagedCluster() [Ignore("Only validating compilation of examples")] public async Task GetAll_GetManagedClustersByResourceGroup() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersListByResourceGroup.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -2603,7 +2746,7 @@ public async Task GetAll_GetManagedClustersByResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_GetManagedCluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGet.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -2632,7 +2775,7 @@ public async Task Exists_GetManagedCluster() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetManagedCluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGet.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 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 index 6d601b6ae0e4..85113a451880 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceManagedClusterResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceManagedClusterResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerServiceManagedClusterResource [Ignore("Only validating compilation of examples")] public async Task Get_GetManagedCluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGet.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -50,7 +50,7 @@ public async Task Get_GetManagedCluster() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteManagedCluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersDelete.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -76,7 +76,7 @@ public async Task Delete_DeleteManagedCluster() [Ignore("Only validating compilation of examples")] public async Task Update_UpdateManagedClusterTags() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersUpdateTags.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -115,7 +115,7 @@ public async Task Update_UpdateManagedClusterTags() [Ignore("Only validating compilation of examples")] public async Task GetAccessProfile_GetManagedCluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGetAccessProfile.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -142,7 +142,7 @@ public async Task GetAccessProfile_GetManagedCluster() [Ignore("Only validating compilation of examples")] public async Task GetClusterAdminCredentials_GetManagedCluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersListClusterAdminCredentials.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -168,7 +168,7 @@ public async Task GetClusterAdminCredentials_GetManagedCluster() [Ignore("Only validating compilation of examples")] public async Task GetClusterUserCredentials_GetManagedCluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersListClusterUserCredentials.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -194,7 +194,7 @@ public async Task GetClusterUserCredentials_GetManagedCluster() [Ignore("Only validating compilation of examples")] public async Task GetClusterMonitoringUserCredentials_GetManagedCluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersListClusterMonitoringUserCredentials.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -220,7 +220,7 @@ public async Task GetClusterMonitoringUserCredentials_GetManagedCluster() [Ignore("Only validating compilation of examples")] public async Task ResetServicePrincipalProfile_ResetServicePrincipalProfile() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersResetServicePrincipalProfile.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -250,7 +250,7 @@ public async Task ResetServicePrincipalProfile_ResetServicePrincipalProfile() [Ignore("Only validating compilation of examples")] public async Task ResetAadProfile_ResetAADProfile() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersResetAADProfile.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -283,7 +283,7 @@ public async Task ResetAadProfile_ResetAADProfile() [Ignore("Only validating compilation of examples")] public async Task RotateClusterCertificates_RotateClusterCertificates() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersRotateClusterCertificates.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -309,7 +309,7 @@ public async Task RotateClusterCertificates_RotateClusterCertificates() [Ignore("Only validating compilation of examples")] public async Task AbortLatestOperation_AbortOperationOnManagedCluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersAbortOperation.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -335,7 +335,7 @@ public async Task AbortLatestOperation_AbortOperationOnManagedCluster() [Ignore("Only validating compilation of examples")] public async Task RotateServiceAccountSigningKeys_RotateClusterServiceAccountSigningKeys() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersRotateServiceAccountSigningKeys.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -361,7 +361,7 @@ public async Task RotateServiceAccountSigningKeys_RotateClusterServiceAccountSig [Ignore("Only validating compilation of examples")] public async Task Stop_StopManagedCluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersStop.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -387,7 +387,7 @@ public async Task Stop_StopManagedCluster() [Ignore("Only validating compilation of examples")] public async Task Start_StartManagedCluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersStart.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -413,7 +413,7 @@ public async Task Start_StartManagedCluster() [Ignore("Only validating compilation of examples")] public async Task RunCommand_SubmitNewCommand() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/RunCommandRequest.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -445,7 +445,7 @@ public async Task RunCommand_SubmitNewCommand() [Ignore("Only validating compilation of examples")] public async Task GetCommandResult_CommandFailedResult() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/RunCommandResultFailed.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -472,7 +472,7 @@ public async Task GetCommandResult_CommandFailedResult() [Ignore("Only validating compilation of examples")] public async Task GetCommandResult_CommandSucceedResult() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/RunCommandResultSucceed.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -499,7 +499,7 @@ public async Task GetCommandResult_CommandSucceedResult() [Ignore("Only validating compilation of examples")] public async Task GetOutboundNetworkDependenciesEndpoints_ListOutboundNetworkDependenciesEndpointsByManagedCluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/OutboundNetworkDependenciesEndpointsList.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -528,7 +528,7 @@ public async Task GetOutboundNetworkDependenciesEndpoints_ListOutboundNetworkDep [Ignore("Only validating compilation of examples")] public async Task GetAvailableAgentPoolVersions_GetAvailableVersionsForAgentPool() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsGetAgentPoolAvailableVersions.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -554,7 +554,7 @@ public async Task GetAvailableAgentPoolVersions_GetAvailableVersionsForAgentPool [Ignore("Only validating compilation of examples")] public async Task GetPrivateLinkResources_ListPrivateLinkResourcesByManagedCluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/PrivateLinkResourcesList.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -583,7 +583,7 @@ public async Task GetPrivateLinkResources_ListPrivateLinkResourcesByManagedClust [Ignore("Only validating compilation of examples")] public async Task ResolvePrivateLinkServiceId_ResolveThePrivateLinkServiceIDForManagedCluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ResolvePrivateLinkServiceId.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 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 index c86354e22e27..736d11689887 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServicePrivateEndpointConnectionCollection.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServicePrivateEndpointConnectionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerServicePrivateEndpointConnectionCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_UpdatePrivateEndpointConnection() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/PrivateEndpointConnectionsUpdate.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -62,7 +62,7 @@ public async Task CreateOrUpdate_UpdatePrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task Get_GetPrivateEndpointConnection() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/PrivateEndpointConnectionsGet.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -96,7 +96,7 @@ public async Task Get_GetPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListPrivateEndpointConnectionsByManagedCluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/PrivateEndpointConnectionsList.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -132,7 +132,7 @@ public async Task GetAll_ListPrivateEndpointConnectionsByManagedCluster() [Ignore("Only validating compilation of examples")] public async Task Exists_GetPrivateEndpointConnection() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/PrivateEndpointConnectionsGet.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -162,7 +162,7 @@ public async Task Exists_GetPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetPrivateEndpointConnection() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/PrivateEndpointConnectionsGet.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 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 index 9e5acc67aca0..7985e44a7d65 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServicePrivateEndpointConnectionResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServicePrivateEndpointConnectionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerServicePrivateEndpointConnectionResource [Ignore("Only validating compilation of examples")] public async Task Get_GetPrivateEndpointConnection() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/PrivateEndpointConnectionsGet.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -51,7 +51,7 @@ public async Task Get_GetPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task Delete_DeletePrivateEndpointConnection() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/PrivateEndpointConnectionsDelete.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -78,7 +78,7 @@ public async Task Delete_DeletePrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task Update_UpdatePrivateEndpointConnection() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/PrivateEndpointConnectionsUpdate.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 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 index 0b58e1ae96a7..52008b368bf3 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceTrustedAccessRoleBindingCollection.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceTrustedAccessRoleBindingCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_ContainerServiceTrustedAccessRoleBindingCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateOrUpdateATrustedAccessRoleBinding() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/TrustedAccessRoleBindings_CreateOrUpdate.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -55,7 +55,7 @@ public async Task CreateOrUpdate_CreateOrUpdateATrustedAccessRoleBinding() [Ignore("Only validating compilation of examples")] public async Task Get_GetATrustedAccessRoleBinding() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/TrustedAccessRoleBindings_Get.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -89,7 +89,7 @@ public async Task Get_GetATrustedAccessRoleBinding() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListTrustedAccessRoleBindings() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/TrustedAccessRoleBindings_List.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -125,7 +125,7 @@ public async Task GetAll_ListTrustedAccessRoleBindings() [Ignore("Only validating compilation of examples")] public async Task Exists_GetATrustedAccessRoleBinding() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/TrustedAccessRoleBindings_Get.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -155,7 +155,7 @@ public async Task Exists_GetATrustedAccessRoleBinding() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetATrustedAccessRoleBinding() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/TrustedAccessRoleBindings_Get.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 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 index 6d9666b3d4c5..3dcf9cbfebba 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceTrustedAccessRoleBindingResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceTrustedAccessRoleBindingResource.cs @@ -19,7 +19,7 @@ public partial class Sample_ContainerServiceTrustedAccessRoleBindingResource [Ignore("Only validating compilation of examples")] public async Task Get_GetATrustedAccessRoleBinding() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/TrustedAccessRoleBindings_Get.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -50,7 +50,7 @@ public async Task Get_GetATrustedAccessRoleBinding() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteATrustedAccessRoleBinding() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/TrustedAccessRoleBindings_Delete.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -77,7 +77,7 @@ public async Task Delete_DeleteATrustedAccessRoleBinding() [Ignore("Only validating compilation of examples")] public async Task Update_CreateOrUpdateATrustedAccessRoleBinding() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/TrustedAccessRoleBindings_CreateOrUpdate.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MachineCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MachineCollection.cs new file mode 100644 index 000000000000..4ba200489f67 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MachineCollection.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.ContainerService.Samples +{ + public partial class Sample_MachineCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetAMachineInAnAgentPoolsByManagedCluster() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/MachineGet.json + // this example is just showing the usage of "Machines_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 = "26fe00f8-9173-4872-9134-bb1d2e00343a"; + string resourceGroupName = "rg1"; + string resourceName = "clustername1"; + string agentPoolName = "agentpool1"; + ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName); + ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId); + + // get the collection of this MachineResource + MachineCollection collection = containerServiceAgentPool.GetMachines(); + + // invoke the operation + string machineName = "aks-nodepool1-42263519-vmss00000t"; + MachineResource result = await collection.GetAsync(machineName); + + // 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 + MachineData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListMachinesInAnAgentpoolByManagedCluster() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/MachineList.json + // this example is just showing the usage of "Machines_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 ContainerServiceAgentPoolResource created on azure + // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource + string subscriptionId = "26fe00f8-9173-4872-9134-bb1d2e00343a"; + string resourceGroupName = "rg1"; + string resourceName = "clustername1"; + string agentPoolName = "agentpool1"; + ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName); + ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId); + + // get the collection of this MachineResource + MachineCollection collection = containerServiceAgentPool.GetMachines(); + + // invoke the operation and iterate over the result + await foreach (MachineResource 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 + MachineData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetAMachineInAnAgentPoolsByManagedCluster() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/MachineGet.json + // this example is just showing the usage of "Machines_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 = "26fe00f8-9173-4872-9134-bb1d2e00343a"; + string resourceGroupName = "rg1"; + string resourceName = "clustername1"; + string agentPoolName = "agentpool1"; + ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName); + ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId); + + // get the collection of this MachineResource + MachineCollection collection = containerServiceAgentPool.GetMachines(); + + // invoke the operation + string machineName = "aks-nodepool1-42263519-vmss00000t"; + bool result = await collection.ExistsAsync(machineName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetAMachineInAnAgentPoolsByManagedCluster() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/MachineGet.json + // this example is just showing the usage of "Machines_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 = "26fe00f8-9173-4872-9134-bb1d2e00343a"; + string resourceGroupName = "rg1"; + string resourceName = "clustername1"; + string agentPoolName = "agentpool1"; + ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName); + ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId); + + // get the collection of this MachineResource + MachineCollection collection = containerServiceAgentPool.GetMachines(); + + // invoke the operation + string machineName = "aks-nodepool1-42263519-vmss00000t"; + NullableResponse response = await collection.GetIfExistsAsync(machineName); + MachineResource 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 + MachineData 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_MachineResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MachineResource.cs new file mode 100644 index 000000000000..7d6564525acf --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MachineResource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.ContainerService.Samples +{ + public partial class Sample_MachineResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetAMachineInAnAgentPoolsByManagedCluster() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-01/examples/MachineGet.json + // this example is just showing the usage of "Machines_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 MachineResource created on azure + // for more information of creating MachineResource, please refer to the document of MachineResource + string subscriptionId = "26fe00f8-9173-4872-9134-bb1d2e00343a"; + string resourceGroupName = "rg1"; + string resourceName = "clustername1"; + string agentPoolName = "agentpool1"; + string machineName = "aks-nodepool1-42263519-vmss00000t"; + ResourceIdentifier machineResourceId = MachineResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName, machineName); + MachineResource machine = client.GetMachineResource(machineResourceId); + + // invoke the operation + MachineResource result = await machine.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 + MachineData 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_ManagedClusterUpgradeProfileResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ManagedClusterUpgradeProfileResource.cs index 0481cdaf7948..0457c9052e47 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ManagedClusterUpgradeProfileResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ManagedClusterUpgradeProfileResource.cs @@ -19,7 +19,7 @@ public partial class Sample_ManagedClusterUpgradeProfileResource [Ignore("Only validating compilation of examples")] public async Task Get_GetUpgradeProfileForManagedCluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGetUpgradeProfile.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 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 index a12ea79e1106..d9f5fd668ab7 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MeshRevisionProfileCollection.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MeshRevisionProfileCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MeshRevisionProfileCollection [Ignore("Only validating compilation of examples")] public async Task Get_GetAMeshRevisionProfileForAMeshMode() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGet_MeshRevisionProfile.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -53,7 +53,7 @@ public async Task Get_GetAMeshRevisionProfileForAMeshMode() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListMeshRevisionProfilesInALocation() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersList_MeshRevisionProfiles.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -88,7 +88,7 @@ public async Task GetAll_ListMeshRevisionProfilesInALocation() [Ignore("Only validating compilation of examples")] public async Task Exists_GetAMeshRevisionProfileForAMeshMode() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGet_MeshRevisionProfile.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -117,7 +117,7 @@ public async Task Exists_GetAMeshRevisionProfileForAMeshMode() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetAMeshRevisionProfileForAMeshMode() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGet_MeshRevisionProfile.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 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 index 8e0938d5a73e..4636cb48043f 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MeshRevisionProfileResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MeshRevisionProfileResource.cs @@ -19,7 +19,7 @@ public partial class Sample_MeshRevisionProfileResource [Ignore("Only validating compilation of examples")] public async Task Get_GetAMeshRevisionProfileForAMeshMode() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGet_MeshRevisionProfile.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 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 index 53dc0a0a6d5c..0efb911d7443 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MeshUpgradeProfileCollection.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MeshUpgradeProfileCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_MeshUpgradeProfileCollection [Ignore("Only validating compilation of examples")] public async Task Get_GetsVersionCompatibilityAndUpgradeProfileForAServiceMeshInACluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGet_MeshUpgradeProfile.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -53,7 +53,7 @@ public async Task Get_GetsVersionCompatibilityAndUpgradeProfileForAServiceMeshIn [Ignore("Only validating compilation of examples")] public async Task GetAll_ListsVersionCompatibilityAndUpgradeProfileForAllServiceMeshesInACluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersList_MeshUpgradeProfiles.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -89,7 +89,7 @@ public async Task GetAll_ListsVersionCompatibilityAndUpgradeProfileForAllService [Ignore("Only validating compilation of examples")] public async Task Exists_GetsVersionCompatibilityAndUpgradeProfileForAServiceMeshInACluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGet_MeshUpgradeProfile.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -119,7 +119,7 @@ public async Task Exists_GetsVersionCompatibilityAndUpgradeProfileForAServiceMes [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetsVersionCompatibilityAndUpgradeProfileForAServiceMeshInACluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGet_MeshUpgradeProfile.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 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 index d2e1b5438892..25f592d5290e 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MeshUpgradeProfileResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MeshUpgradeProfileResource.cs @@ -19,7 +19,7 @@ public partial class Sample_MeshUpgradeProfileResource [Ignore("Only validating compilation of examples")] public async Task Get_GetsVersionCompatibilityAndUpgradeProfileForAServiceMeshInACluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGet_MeshUpgradeProfile.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index d4e1e40228ea..95f4040b304f 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -21,7 +21,7 @@ public partial class Sample_SubscriptionResourceExtensions [Ignore("Only validating compilation of examples")] public async Task GetKubernetesVersionsManagedCluster_ListKubernetesVersions() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/KubernetesVersions_List.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -46,7 +46,7 @@ public async Task GetKubernetesVersionsManagedCluster_ListKubernetesVersions() [Ignore("Only validating compilation of examples")] public async Task GetContainerServiceManagedClusters_ListManagedClusters() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersList.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -77,7 +77,7 @@ public async Task GetContainerServiceManagedClusters_ListManagedClusters() [Ignore("Only validating compilation of examples")] public async Task GetAgentPoolSnapshots_ListSnapshots() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/SnapshotsList.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 @@ -108,7 +108,7 @@ public async Task GetAgentPoolSnapshots_ListSnapshots() [Ignore("Only validating compilation of examples")] public async Task GetTrustedAccessRoles_ListTrustedAccessRoles() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/TrustedAccessRoles_List.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-03-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 diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotCollection.cs index 327b8b63ae23..7251fff4ede4 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotCollection.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -116,7 +116,7 @@ public virtual async Task> CreateOrUpdat /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -167,7 +167,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> GetAsync(string r /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -257,7 +257,7 @@ public virtual Response Get(string resourceName, Canc /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -287,7 +287,7 @@ public virtual AsyncPageable GetAllAsync(Cancellation /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -317,7 +317,7 @@ public virtual Pageable GetAll(CancellationToken canc /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -360,7 +360,7 @@ public virtual async Task> ExistsAsync(string resourceName, Cance /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -403,7 +403,7 @@ public virtual Response Exists(string resourceName, CancellationToken canc /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -448,7 +448,7 @@ public virtual async Task> GetIfExis /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotResource.cs index 6045d3413e5b..3d97e3577b55 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsync(Cancella /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationToken cancell /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -227,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -271,7 +271,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual async Task> UpdateAsync(Conta /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -355,7 +355,7 @@ public virtual Response Update(ContainerServiceTagsOb /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -417,7 +417,7 @@ public virtual async Task> AddTagAsync(strin /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -479,7 +479,7 @@ public virtual Response AddTag(string key, string val /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -536,7 +536,7 @@ public virtual async Task> SetTagsAsync(IDic /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -593,7 +593,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -653,7 +653,7 @@ public virtual async Task> RemoveTagAsync(st /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileResource.cs index 9c357b37cb3d..ffd7fcfa3df9 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsync(Ca /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ArmContainerServiceModelFactory.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ArmContainerServiceModelFactory.cs index d8ce03a6d98a..236b17d49f34 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ArmContainerServiceModelFactory.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ArmContainerServiceModelFactory.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using System.Net; using Azure.Core; @@ -18,35 +19,6 @@ 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. @@ -60,15 +32,22 @@ public static KubernetesVersionListResult KubernetesVersionListResult(IEnumerabl /// Initializes a new instance of . /// major.minor version of Kubernetes release. /// Capabilities on this Kubernetes version. + /// Whether this version is default. /// 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) + public static KubernetesVersion KubernetesVersion(string version = null, IEnumerable capabilitiesSupportPlan = null, bool? isDefault = 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); + return new KubernetesVersion( + version, + capabilitiesSupportPlan != null ? new KubernetesVersionCapabilities(capabilitiesSupportPlan?.ToList(), serializedAdditionalRawData: null) : null, + isDefault, + isPreview, + patchVersions, + serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -88,6 +67,7 @@ public static KubernetesPatchVersion KubernetesPatchVersion(IEnumerable /// The systemData. /// The tags. /// The location. + /// Unique read-only string used to implement optimistic concurrency. The eTag value will change when the resource is updated. Specify an if-match or if-none-match header with the eTag value for a subsequent request to enable optimistic concurrency per the normal etag convention. /// The managed cluster SKU. /// The extended location of the Virtual Machine. /// The identity of the managed cluster, if configured. @@ -109,9 +89,9 @@ public static KubernetesPatchVersion KubernetesPatchVersion(IEnumerable /// 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. + /// Profile of the node resource group configuration. /// 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. @@ -119,19 +99,22 @@ public static KubernetesPatchVersion KubernetesPatchVersion(IEnumerable /// 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. + /// The user identity associated with the managed cluster. This identity will be used by the kubelet. Only one user assigned identity is allowed. The only accepted key is "kubeletidentity", with value of "resourceId": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}". /// 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. + /// Ingress 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). + /// Optional cluster metrics configuration. + /// Profile of the cluster bootstrap configuration. /// 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) + public static ContainerServiceManagedClusterData ContainerServiceManagedClusterData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ETag? etag = null, 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, RestrictionLevel? nodeResourceGroupRestrictionLevel = null, bool? enableRbac = null, KubernetesSupportPlan? supportPlan = 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, ManagedClusterIngressProfileWebAppRouting ingressWebAppRouting = null, ContainerServicePublicNetworkAccess? publicNetworkAccess = null, ManagedClusterWorkloadAutoScalerProfile workloadAutoScalerProfile = null, ManagedClusterMonitorProfileMetrics azureMonitorMetrics = null, ServiceMeshProfile serviceMeshProfile = null, ResourceIdentifier resourceId = null, bool? costAnalysisEnabled = null, ManagedClusterBootstrapProfile bootstrapProfile = null) { tags ??= new Dictionary(); agentPoolProfiles ??= new List(); @@ -146,6 +129,7 @@ public static ContainerServiceManagedClusterData ContainerServiceManagedClusterD systemData, tags, location, + etag, sku, extendedLocation, clusterIdentity, @@ -167,9 +151,9 @@ public static ContainerServiceManagedClusterData ContainerServiceManagedClusterD podIdentityProfile, oidcIssuerProfile, nodeResourceGroup, + nodeResourceGroupRestrictionLevel != null ? new ManagedClusterNodeResourceGroupProfile(nodeResourceGroupRestrictionLevel, serializedAdditionalRawData: null) : null, enableRbac, supportPlan, - enablePodSecurityPolicy, networkProfile, aadProfile, autoUpgradeProfile, @@ -183,21 +167,26 @@ public static ContainerServiceManagedClusterData ContainerServiceManagedClusterD httpProxyConfig, securityProfile, storageProfile, + ingressWebAppRouting != null ? new ManagedClusterIngressProfile(ingressWebAppRouting, serializedAdditionalRawData: null) : null, publicNetworkAccess, workloadAutoScalerProfile, azureMonitorMetrics != null ? new ManagedClusterAzureMonitorProfile(azureMonitorMetrics, serializedAdditionalRawData: null) : null, serviceMeshProfile, resourceId, + costAnalysisEnabled != null ? new ManagedClusterMetricsProfile(new ManagedClusterCostAnalysis(costAnalysisEnabled, serializedAdditionalRawData: null), serializedAdditionalRawData: null) : null, + bootstrapProfile, serializedAdditionalRawData: null); } /// Initializes a new instance of . + /// Unique read-only string used to implement optimistic concurrency. The eTag value will change when the resource is updated. Specify an if-match or if-none-match header with the eTag value for a subsequent request to enable optimistic concurrency per the normal etag convention. /// 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. + /// A base64-encoded string which will be written to /etc/motd after decoding. This allows customization of the message of the day for Linux nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be printed raw and not be executed as a script). /// 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. @@ -235,9 +224,12 @@ public static ContainerServiceManagedClusterData ContainerServiceManagedClusterD /// 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. + /// The Windows agent pool's specific profile. + /// The security settings of an agent pool. + /// GPU settings for the 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) + public static ManagedClusterAgentPoolProfile ManagedClusterAgentPoolProfile(ETag? etag = null, int? count = null, string vmSize = null, int? osDiskSizeInGB = null, ContainerServiceOSDiskType? osDiskType = null, KubeletDiskType? kubeletDiskType = null, WorkloadRuntime? workloadRuntime = null, string messageOfTheDay = 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, bool? disableOutboundNat = null, AgentPoolSecurityProfile securityProfile = null, GpuDriver? gpuDriver = null, string name = null) { availabilityZones ??= new List(); tags ??= new Dictionary(); @@ -245,12 +237,14 @@ public static ManagedClusterAgentPoolProfile ManagedClusterAgentPoolProfile(int? nodeTaints ??= new List(); return new ManagedClusterAgentPoolProfile( + etag, count, vmSize, osDiskSizeInGB, osDiskType, kubeletDiskType, workloadRuntime, + messageOfTheDay, vnetSubnetId, podSubnetId, maxPods, @@ -288,17 +282,22 @@ public static ManagedClusterAgentPoolProfile ManagedClusterAgentPoolProfile(int? capacityReservationGroupId, hostGroupId, networkProfile, + disableOutboundNat != null ? new AgentPoolWindowsProfile(disableOutboundNat, serializedAdditionalRawData: null) : null, + securityProfile, + gpuDriver != null ? new GpuProfile(gpuDriver, serializedAdditionalRawData: null) : null, serializedAdditionalRawData: null, name); } /// Initializes a new instance of . + /// Unique read-only string used to implement optimistic concurrency. The eTag value will change when the resource is updated. Specify an if-match or if-none-match header with the eTag value for a subsequent request to enable optimistic concurrency per the normal etag convention. /// 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. + /// A base64-encoded string which will be written to /etc/motd after decoding. This allows customization of the message of the day for Linux nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be printed raw and not be executed as a script). /// 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. @@ -336,8 +335,11 @@ public static ManagedClusterAgentPoolProfile ManagedClusterAgentPoolProfile(int? /// 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. + /// The Windows agent pool's specific profile. + /// The security settings of an agent pool. + /// GPU settings for the 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) + public static ManagedClusterAgentPoolProfileProperties ManagedClusterAgentPoolProfileProperties(ETag? etag = null, int? count = null, string vmSize = null, int? osDiskSizeInGB = null, ContainerServiceOSDiskType? osDiskType = null, KubeletDiskType? kubeletDiskType = null, WorkloadRuntime? workloadRuntime = null, string messageOfTheDay = 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, bool? disableOutboundNat = null, AgentPoolSecurityProfile securityProfile = null, GpuDriver? gpuDriver = null) { availabilityZones ??= new List(); tags ??= new Dictionary(); @@ -345,12 +347,14 @@ public static ManagedClusterAgentPoolProfileProperties ManagedClusterAgentPoolPr nodeTaints ??= new List(); return new ManagedClusterAgentPoolProfileProperties( + etag, count, vmSize, osDiskSizeInGB, osDiskType, kubeletDiskType, workloadRuntime, + messageOfTheDay, vnetSubnetId, podSubnetId, maxPods, @@ -388,6 +392,9 @@ public static ManagedClusterAgentPoolProfileProperties ManagedClusterAgentPoolPr capacityReservationGroupId, hostGroupId, networkProfile, + disableOutboundNat != null ? new AgentPoolWindowsProfile(disableOutboundNat, serializedAdditionalRawData: null) : null, + securityProfile, + gpuDriver != null ? new GpuProfile(gpuDriver, serializedAdditionalRawData: null) : null, serializedAdditionalRawData: null); } @@ -432,6 +439,46 @@ public static ManagedClusterOidcIssuerProfile ManagedClusterOidcIssuerProfile(st return new ManagedClusterOidcIssuerProfile(issuerUriInfo, isEnabled, serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// Desired managed outbound IPs for the cluster load balancer. + /// Desired outbound IP Prefix resources for the cluster load balancer. + /// Desired outbound IP resources for the cluster load balancer. + /// The effective outbound IP resources of the cluster load balancer. + /// The desired number of allocated SNAT ports per VM. Allowed values are in the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure dynamically allocating ports. + /// Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The default value is 30 minutes. + /// Enable multiple standard load balancers per AKS cluster or not. + /// The type of the managed inbound Load Balancer BackendPool. + /// A new instance for mocking. + public static ManagedClusterLoadBalancerProfile ManagedClusterLoadBalancerProfile(ManagedClusterLoadBalancerProfileManagedOutboundIPs managedOutboundIPs = null, IEnumerable outboundPublicIPPrefixes = null, IEnumerable outboundPublicIPs = null, IEnumerable effectiveOutboundIPs = null, int? allocatedOutboundPorts = null, int? idleTimeoutInMinutes = null, bool? enableMultipleStandardLoadBalancers = null, ManagedClusterLoadBalancerBackendPoolType? backendPoolType = null) + { + outboundPublicIPPrefixes ??= new List(); + outboundPublicIPs ??= new List(); + effectiveOutboundIPs ??= new List(); + + return new ManagedClusterLoadBalancerProfile( + managedOutboundIPs, + outboundPublicIPPrefixes != null ? new ManagedClusterLoadBalancerProfileOutboundIPPrefixes(outboundPublicIPPrefixes?.ToList(), serializedAdditionalRawData: null) : null, + outboundPublicIPs != null ? new ManagedClusterLoadBalancerProfileOutboundIPs(outboundPublicIPs?.ToList(), serializedAdditionalRawData: null) : null, + effectiveOutboundIPs?.ToList(), + allocatedOutboundPorts, + idleTimeoutInMinutes, + enableMultipleStandardLoadBalancers, + backendPoolType, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Profile of the managed outbound IP resources of the cluster NAT gateway. + /// The effective outbound IP resources of the cluster NAT gateway. + /// Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The default value is 4 minutes. + /// A new instance for mocking. + public static ManagedClusterNatGatewayProfile ManagedClusterNatGatewayProfile(int? managedOutboundIPCount = null, IEnumerable effectiveOutboundIPs = null, int? idleTimeoutInMinutes = null) + { + effectiveOutboundIPs ??= new List(); + + return new ManagedClusterNatGatewayProfile(managedOutboundIPCount != null ? new ManagedClusterManagedOutboundIPProfile(managedOutboundIPCount, serializedAdditionalRawData: null) : null, effectiveOutboundIPs?.ToList(), idleTimeoutInMinutes, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The ID of the private link resource. /// The name of the private link resource. @@ -454,6 +501,19 @@ public static ContainerServicePrivateLinkResourceData ContainerServicePrivateLin serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// Whether to enable the Application Routing add-on. + /// Resource IDs of the DNS zones to be associated with the Application Routing add-on. Used only when Application Routing add-on is enabled. Public and private DNS zones can be in different resource groups, but all public DNS zones must be in the same resource group and all private DNS zones must be in the same resource group. + /// Configuration for the default NginxIngressController. See more at https://learn.microsoft.com/en-us/azure/aks/app-routing-nginx-configuration#the-default-nginx-ingress-controller. + /// Managed identity of the Application Routing add-on. This is the identity that should be granted permissions, for example, to manage the associated Azure DNS resource and get certificates from Azure Key Vault. See [this overview of the add-on](https://learn.microsoft.com/en-us/azure/aks/web-app-routing?tabs=with-osm) for more instructions. + /// A new instance for mocking. + public static ManagedClusterIngressProfileWebAppRouting ManagedClusterIngressProfileWebAppRouting(bool? enabled = null, IEnumerable dnsZoneResourceIds = null, NginxIngressControllerType? nginxDefaultIngressControllerType = null, ContainerServiceUserAssignedIdentity identity = null) + { + dnsZoneResourceIds ??= new List(); + + return new ManagedClusterIngressProfileWebAppRouting(enabled, dnsZoneResourceIds?.ToList(), nginxDefaultIngressControllerType != null ? new ManagedClusterIngressProfileNginx(nginxDefaultIngressControllerType, serializedAdditionalRawData: null) : null, identity, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The id. /// The name. @@ -571,12 +631,14 @@ public static ContainerServiceMaintenanceConfigurationData ContainerServiceMaint /// The name. /// The resourceType. /// The systemData. + /// Unique read-only string used to implement optimistic concurrency. The eTag value will change when the resource is updated. Specify an if-match or if-none-match header with the eTag value for a subsequent request to enable optimistic concurrency per the normal etag convention. /// 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. + /// A base64-encoded string which will be written to /etc/motd after decoding. This allows customization of the message of the day for Linux nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be printed raw and not be executed as a script). /// 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. @@ -614,8 +676,11 @@ public static ContainerServiceMaintenanceConfigurationData ContainerServiceMaint /// 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. + /// The Windows agent pool's specific profile. + /// The security settings of an agent pool. + /// GPU settings for the 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) + public static ContainerServiceAgentPoolData ContainerServiceAgentPoolData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ETag? etag = null, int? count = null, string vmSize = null, int? osDiskSizeInGB = null, ContainerServiceOSDiskType? osDiskType = null, KubeletDiskType? kubeletDiskType = null, WorkloadRuntime? workloadRuntime = null, string messageOfTheDay = 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, bool? disableOutboundNat = null, AgentPoolSecurityProfile securityProfile = null, GpuDriver? gpuDriver = null) { availabilityZones ??= new List(); tags ??= new Dictionary(); @@ -627,12 +692,14 @@ public static ContainerServiceAgentPoolData ContainerServiceAgentPoolData(Resour name, resourceType, systemData, + etag, count, vmSize, osDiskSizeInGB, osDiskType, kubeletDiskType, workloadRuntime, + messageOfTheDay, vnetSubnetId, podSubnetId, maxPods, @@ -670,6 +737,9 @@ public static ContainerServiceAgentPoolData ContainerServiceAgentPoolData(Resour capacityReservationGroupId, hostGroupId, networkProfile, + disableOutboundNat != null ? new AgentPoolWindowsProfile(disableOutboundNat, serializedAdditionalRawData: null) : null, + securityProfile, + gpuDriver != null ? new GpuProfile(gpuDriver, serializedAdditionalRawData: null) : null, serializedAdditionalRawData: null); } @@ -960,5 +1030,213 @@ public static ContainerServiceTrustedAccessRoleRule ContainerServiceTrustedAcces nonResourceUrls?.ToList(), serializedAdditionalRawData: null); } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The properties of the machine. + /// A new instance for mocking. + public static MachineData MachineData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MachineProperties properties = null) + { + return new MachineData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// network properties of the machine. + /// Azure resource id of the machine. It can be used to GET underlying VM Instance. + /// A new instance for mocking. + public static MachineProperties MachineProperties(IEnumerable networkIPAddresses = null, ResourceIdentifier resourceId = null) + { + networkIPAddresses ??= new List(); + + return new MachineProperties(networkIPAddresses != null ? new MachineNetworkProperties(networkIPAddresses?.ToList(), serializedAdditionalRawData: null) : null, resourceId, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// To determine if address belongs IPv4 or IPv6 family. + /// IPv4 or IPv6 address of the machine. + /// A new instance for mocking. + public static MachineIPAddress MachineIPAddress(IPFamily? family = null, string ip = null) + { + return new MachineIPAddress(family, ip, 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. + [EditorBrowsable(EditorBrowsableState.Never)] + public static KubernetesVersion KubernetesVersion(string version, IEnumerable capabilitiesSupportPlan, bool? isPreview, IReadOnlyDictionary patchVersions) + { + return KubernetesVersion(version: version, capabilitiesSupportPlan: capabilitiesSupportPlan, isDefault: default, isPreview: isPreview, patchVersions: patchVersions); + } + + /// 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. + [EditorBrowsable(EditorBrowsableState.Never)] + public static ManagedClusterAgentPoolProfile ManagedClusterAgentPoolProfile(int? count, string vmSize, int? osDiskSizeInGB, ContainerServiceOSDiskType? osDiskType, KubeletDiskType? kubeletDiskType, WorkloadRuntime? workloadRuntime, ResourceIdentifier vnetSubnetId, ResourceIdentifier podSubnetId, int? maxPods, ContainerServiceOSType? osType, ContainerServiceOSSku? osSku, int? maxCount, int? minCount, bool? enableAutoScaling, ScaleDownMode? scaleDownMode, AgentPoolType? agentPoolType, AgentPoolMode? mode, string orchestratorVersion, string currentOrchestratorVersion, string nodeImageVersion, AgentPoolUpgradeSettings upgradeSettings, string provisioningState, ContainerServiceStateCode? powerStateCode, IEnumerable availabilityZones, bool? enableNodePublicIP, ResourceIdentifier nodePublicIPPrefixId, ScaleSetPriority? scaleSetPriority, ScaleSetEvictionPolicy? scaleSetEvictionPolicy, float? spotMaxPrice, IDictionary tags, IDictionary nodeLabels, IEnumerable nodeTaints, ResourceIdentifier proximityPlacementGroupId, KubeletConfig kubeletConfig, LinuxOSConfig linuxOSConfig, bool? enableEncryptionAtHost, bool? enableUltraSsd, bool? enableFips, GpuInstanceProfile? gpuInstanceProfile, ResourceIdentifier creationDataSourceResourceId, ResourceIdentifier capacityReservationGroupId, ResourceIdentifier hostGroupId, AgentPoolNetworkProfile networkProfile, string name) + { + return ManagedClusterAgentPoolProfile(etag: default, count: count, vmSize: vmSize, osDiskSizeInGB: osDiskSizeInGB, osDiskType: osDiskType, kubeletDiskType: kubeletDiskType, workloadRuntime: workloadRuntime, messageOfTheDay: default, vnetSubnetId: vnetSubnetId, podSubnetId: podSubnetId, maxPods: maxPods, osType: osType, osSku: osSku, maxCount: maxCount, minCount: minCount, enableAutoScaling: enableAutoScaling, scaleDownMode: scaleDownMode, agentPoolType: agentPoolType, mode: mode, orchestratorVersion: orchestratorVersion, currentOrchestratorVersion: currentOrchestratorVersion, nodeImageVersion: nodeImageVersion, upgradeSettings: upgradeSettings, provisioningState: provisioningState, powerStateCode: powerStateCode, availabilityZones: availabilityZones, enableNodePublicIP: enableNodePublicIP, nodePublicIPPrefixId: nodePublicIPPrefixId, scaleSetPriority: scaleSetPriority, scaleSetEvictionPolicy: scaleSetEvictionPolicy, spotMaxPrice: spotMaxPrice, tags: tags, nodeLabels: nodeLabels, nodeTaints: nodeTaints, proximityPlacementGroupId: proximityPlacementGroupId, kubeletConfig: kubeletConfig, linuxOSConfig: linuxOSConfig, enableEncryptionAtHost: enableEncryptionAtHost, enableUltraSsd: enableUltraSsd, enableFips: enableFips, gpuInstanceProfile: gpuInstanceProfile, creationDataSourceResourceId: creationDataSourceResourceId, capacityReservationGroupId: capacityReservationGroupId, hostGroupId: hostGroupId, networkProfile: networkProfile, disableOutboundNat: default, securityProfile: default, gpuDriver: default, name: 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. + [EditorBrowsable(EditorBrowsableState.Never)] + public static ManagedClusterAgentPoolProfileProperties ManagedClusterAgentPoolProfileProperties(int? count, string vmSize, int? osDiskSizeInGB, ContainerServiceOSDiskType? osDiskType, KubeletDiskType? kubeletDiskType, WorkloadRuntime? workloadRuntime, ResourceIdentifier vnetSubnetId, ResourceIdentifier podSubnetId, int? maxPods, ContainerServiceOSType? osType, ContainerServiceOSSku? osSku, int? maxCount, int? minCount, bool? enableAutoScaling, ScaleDownMode? scaleDownMode, AgentPoolType? agentPoolType, AgentPoolMode? mode, string orchestratorVersion, string currentOrchestratorVersion, string nodeImageVersion, AgentPoolUpgradeSettings upgradeSettings, string provisioningState, ContainerServiceStateCode? powerStateCode, IEnumerable availabilityZones, bool? enableNodePublicIP, ResourceIdentifier nodePublicIPPrefixId, ScaleSetPriority? scaleSetPriority, ScaleSetEvictionPolicy? scaleSetEvictionPolicy, float? spotMaxPrice, IDictionary tags, IDictionary nodeLabels, IEnumerable nodeTaints, ResourceIdentifier proximityPlacementGroupId, KubeletConfig kubeletConfig, LinuxOSConfig linuxOSConfig, bool? enableEncryptionAtHost, bool? enableUltraSsd, bool? enableFips, GpuInstanceProfile? gpuInstanceProfile, ResourceIdentifier creationDataSourceResourceId, ResourceIdentifier capacityReservationGroupId, ResourceIdentifier hostGroupId, AgentPoolNetworkProfile networkProfile) + { + return ManagedClusterAgentPoolProfileProperties(etag: default, count: count, vmSize: vmSize, osDiskSizeInGB: osDiskSizeInGB, osDiskType: osDiskType, kubeletDiskType: kubeletDiskType, workloadRuntime: workloadRuntime, messageOfTheDay: default, vnetSubnetId: vnetSubnetId, podSubnetId: podSubnetId, maxPods: maxPods, osType: osType, osSku: osSku, maxCount: maxCount, minCount: minCount, enableAutoScaling: enableAutoScaling, scaleDownMode: scaleDownMode, agentPoolType: agentPoolType, mode: mode, orchestratorVersion: orchestratorVersion, currentOrchestratorVersion: currentOrchestratorVersion, nodeImageVersion: nodeImageVersion, upgradeSettings: upgradeSettings, provisioningState: provisioningState, powerStateCode: powerStateCode, availabilityZones: availabilityZones, enableNodePublicIP: enableNodePublicIP, nodePublicIPPrefixId: nodePublicIPPrefixId, scaleSetPriority: scaleSetPriority, scaleSetEvictionPolicy: scaleSetEvictionPolicy, spotMaxPrice: spotMaxPrice, tags: tags, nodeLabels: nodeLabels, nodeTaints: nodeTaints, proximityPlacementGroupId: proximityPlacementGroupId, kubeletConfig: kubeletConfig, linuxOSConfig: linuxOSConfig, enableEncryptionAtHost: enableEncryptionAtHost, enableUltraSsd: enableUltraSsd, enableFips: enableFips, gpuInstanceProfile: gpuInstanceProfile, creationDataSourceResourceId: creationDataSourceResourceId, capacityReservationGroupId: capacityReservationGroupId, hostGroupId: hostGroupId, networkProfile: networkProfile, disableOutboundNat: default, securityProfile: default, gpuDriver: default); + } + + /// 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. + [EditorBrowsable(EditorBrowsableState.Never)] + public static ContainerServiceAgentPoolData ContainerServiceAgentPoolData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, int? count, string vmSize, int? osDiskSizeInGB, ContainerServiceOSDiskType? osDiskType, KubeletDiskType? kubeletDiskType, WorkloadRuntime? workloadRuntime, ResourceIdentifier vnetSubnetId, ResourceIdentifier podSubnetId, int? maxPods, ContainerServiceOSType? osType, ContainerServiceOSSku? osSku, int? maxCount, int? minCount, bool? enableAutoScaling, ScaleDownMode? scaleDownMode, AgentPoolType? typePropertiesType, AgentPoolMode? mode, string orchestratorVersion, string currentOrchestratorVersion, string nodeImageVersion, AgentPoolUpgradeSettings upgradeSettings, string provisioningState, ContainerServiceStateCode? powerStateCode, IEnumerable availabilityZones, bool? enableNodePublicIP, ResourceIdentifier nodePublicIPPrefixId, ScaleSetPriority? scaleSetPriority, ScaleSetEvictionPolicy? scaleSetEvictionPolicy, float? spotMaxPrice, IDictionary tags, IDictionary nodeLabels, IEnumerable nodeTaints, ResourceIdentifier proximityPlacementGroupId, KubeletConfig kubeletConfig, LinuxOSConfig linuxOSConfig, bool? enableEncryptionAtHost, bool? enableUltraSsd, bool? enableFips, GpuInstanceProfile? gpuInstanceProfile, ResourceIdentifier creationDataSourceResourceId, ResourceIdentifier capacityReservationGroupId, ResourceIdentifier hostGroupId, AgentPoolNetworkProfile networkProfile) + { + return ContainerServiceAgentPoolData(id: id, name: name, resourceType: resourceType, systemData: systemData, etag: default, count: count, vmSize: vmSize, osDiskSizeInGB: osDiskSizeInGB, osDiskType: osDiskType, kubeletDiskType: kubeletDiskType, workloadRuntime: workloadRuntime, messageOfTheDay: default, vnetSubnetId: vnetSubnetId, podSubnetId: podSubnetId, maxPods: maxPods, osType: osType, osSku: osSku, maxCount: maxCount, minCount: minCount, enableAutoScaling: enableAutoScaling, scaleDownMode: scaleDownMode, typePropertiesType: typePropertiesType, mode: mode, orchestratorVersion: orchestratorVersion, currentOrchestratorVersion: currentOrchestratorVersion, nodeImageVersion: nodeImageVersion, upgradeSettings: upgradeSettings, provisioningState: provisioningState, powerStateCode: powerStateCode, availabilityZones: availabilityZones, enableNodePublicIP: enableNodePublicIP, nodePublicIPPrefixId: nodePublicIPPrefixId, scaleSetPriority: scaleSetPriority, scaleSetEvictionPolicy: scaleSetEvictionPolicy, spotMaxPrice: spotMaxPrice, tags: tags, nodeLabels: nodeLabels, nodeTaints: nodeTaints, proximityPlacementGroupId: proximityPlacementGroupId, kubeletConfig: kubeletConfig, linuxOSConfig: linuxOSConfig, enableEncryptionAtHost: enableEncryptionAtHost, enableUltraSsd: enableUltraSsd, enableFips: enableFips, gpuInstanceProfile: gpuInstanceProfile, creationDataSourceResourceId: creationDataSourceResourceId, capacityReservationGroupId: capacityReservationGroupId, hostGroupId: hostGroupId, networkProfile: networkProfile, disableOutboundNat: default, securityProfile: default, gpuDriver: default); + } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolCollection.cs index 88b66a8d18dd..268b9e5bb889 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolCollection.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -75,10 +75,12 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// 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 agent pool. /// The agent pool to create or update. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string agentPoolName, ContainerServiceAgentPoolData data, CancellationToken cancellationToken = default) + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string agentPoolName, ContainerServiceAgentPoolData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); Argument.AssertNotNull(data, nameof(data)); @@ -87,8 +89,8 @@ public virtual async Task> Creat scope.Start(); try { - var response = await _containerServiceAgentPoolAgentPoolsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, data, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(new ContainerServiceAgentPoolOperationSource(Client), _containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, data).Request, response, OperationFinalStateVia.Location); + var response = await _containerServiceAgentPoolAgentPoolsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, data, ifMatch, ifNoneMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceArmOperation(new ContainerServiceAgentPoolOperationSource(Client), _containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -113,7 +115,7 @@ public virtual async Task> Creat /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -124,10 +126,12 @@ public virtual async Task> Creat /// 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 agent pool. /// The agent pool to create or update. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string agentPoolName, ContainerServiceAgentPoolData data, CancellationToken cancellationToken = default) + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string agentPoolName, ContainerServiceAgentPoolData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); Argument.AssertNotNull(data, nameof(data)); @@ -136,8 +140,8 @@ public virtual ArmOperation CreateOrUpdate(Wa scope.Start(); try { - var response = _containerServiceAgentPoolAgentPoolsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, data, cancellationToken); - var operation = new ContainerServiceArmOperation(new ContainerServiceAgentPoolOperationSource(Client), _containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, data).Request, response, OperationFinalStateVia.Location); + var response = _containerServiceAgentPoolAgentPoolsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, data, ifMatch, ifNoneMatch, cancellationToken); + var operation = new ContainerServiceArmOperation(new ContainerServiceAgentPoolOperationSource(Client), _containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -162,7 +166,7 @@ public virtual ArmOperation CreateOrUpdate(Wa /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -207,7 +211,7 @@ public virtual async Task> GetAsync( /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -252,7 +256,7 @@ public virtual Response Get(string agentPoolN /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -282,7 +286,7 @@ public virtual AsyncPageable GetAllAsync(Canc /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -312,7 +316,7 @@ public virtual Pageable GetAll(CancellationTo /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -355,7 +359,7 @@ public virtual async Task> ExistsAsync(string agentPoolName, Canc /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -398,7 +402,7 @@ public virtual Response Exists(string agentPoolName, CancellationToken can /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -443,7 +447,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolData.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolData.Serialization.cs index 3485aab1f897..dd49fb8cca48 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolData.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolData.Serialization.cs @@ -41,6 +41,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(ETag)) + { + writer.WritePropertyName("eTag"u8); + writer.WriteStringValue(ETag.Value.ToString()); + } if (Optional.IsDefined(Count)) { writer.WritePropertyName("count"u8); @@ -71,6 +76,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("workloadRuntime"u8); writer.WriteStringValue(WorkloadRuntime.Value.ToString()); } + if (Optional.IsDefined(MessageOfTheDay)) + { + writer.WritePropertyName("messageOfTheDay"u8); + writer.WriteStringValue(MessageOfTheDay); + } if (Optional.IsDefined(VnetSubnetId)) { writer.WritePropertyName("vnetSubnetID"u8); @@ -278,6 +288,21 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("networkProfile"u8); writer.WriteObjectValue(NetworkProfile, options); } + if (Optional.IsDefined(WindowsProfile)) + { + writer.WritePropertyName("windowsProfile"u8); + writer.WriteObjectValue(WindowsProfile, options); + } + if (Optional.IsDefined(SecurityProfile)) + { + writer.WritePropertyName("securityProfile"u8); + writer.WriteObjectValue(SecurityProfile, options); + } + if (Optional.IsDefined(GpuProfile)) + { + writer.WritePropertyName("gpuProfile"u8); + writer.WriteObjectValue(GpuProfile, options); + } writer.WriteEndObject(); } @@ -305,12 +330,14 @@ internal static ContainerServiceAgentPoolData DeserializeContainerServiceAgentPo string name = default; ResourceType type = default; SystemData systemData = default; + ETag? etag = default; int? count = default; string vmSize = default; int? osDiskSizeGB = default; ContainerServiceOSDiskType? osDiskType = default; KubeletDiskType? kubeletDiskType = default; WorkloadRuntime? workloadRuntime = default; + string messageOfTheDay = default; ResourceIdentifier vnetSubnetId = default; ResourceIdentifier podSubnetId = default; int? maxPods = default; @@ -348,6 +375,9 @@ internal static ContainerServiceAgentPoolData DeserializeContainerServiceAgentPo ResourceIdentifier capacityReservationGroupId = default; ResourceIdentifier hostGroupId = default; AgentPoolNetworkProfile networkProfile = default; + AgentPoolWindowsProfile windowsProfile = default; + AgentPoolSecurityProfile securityProfile = default; + GpuProfile gpuProfile = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -385,6 +415,15 @@ internal static ContainerServiceAgentPoolData DeserializeContainerServiceAgentPo } foreach (var property0 in property.Value.EnumerateObject()) { + if (property0.NameEquals("eTag"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + etag = new ETag(property0.Value.GetString()); + continue; + } if (property0.NameEquals("count"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -435,6 +474,11 @@ internal static ContainerServiceAgentPoolData DeserializeContainerServiceAgentPo workloadRuntime = new WorkloadRuntime(property0.Value.GetString()); continue; } + if (property0.NameEquals("messageOfTheDay"u8)) + { + messageOfTheDay = property0.Value.GetString(); + continue; + } if (property0.NameEquals("vnetSubnetID"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -772,6 +816,33 @@ internal static ContainerServiceAgentPoolData DeserializeContainerServiceAgentPo networkProfile = AgentPoolNetworkProfile.DeserializeAgentPoolNetworkProfile(property0.Value, options); continue; } + if (property0.NameEquals("windowsProfile"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + windowsProfile = AgentPoolWindowsProfile.DeserializeAgentPoolWindowsProfile(property0.Value, options); + continue; + } + if (property0.NameEquals("securityProfile"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + securityProfile = AgentPoolSecurityProfile.DeserializeAgentPoolSecurityProfile(property0.Value, options); + continue; + } + if (property0.NameEquals("gpuProfile"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + gpuProfile = GpuProfile.DeserializeGpuProfile(property0.Value, options); + continue; + } } continue; } @@ -786,12 +857,14 @@ internal static ContainerServiceAgentPoolData DeserializeContainerServiceAgentPo name, type, systemData, + etag, count, vmSize, osDiskSizeGB, osDiskType, kubeletDiskType, workloadRuntime, + messageOfTheDay, vnetSubnetId, podSubnetId, maxPods, @@ -829,6 +902,9 @@ internal static ContainerServiceAgentPoolData DeserializeContainerServiceAgentPo capacityReservationGroupId, hostGroupId, networkProfile, + windowsProfile, + securityProfile, + gpuProfile, serializedAdditionalRawData); } @@ -898,6 +974,21 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) builder.Append(" properties:"); builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ETag), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" eTag: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ETag)) + { + builder.Append(" eTag: "); + builder.AppendLine($"'{ETag.Value.ToString()}'"); + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Count), out propertyOverride); if (hasPropertyOverride) { @@ -996,6 +1087,29 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MessageOfTheDay), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" messageOfTheDay: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(MessageOfTheDay)) + { + builder.Append(" messageOfTheDay: "); + if (MessageOfTheDay.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{MessageOfTheDay}'''"); + } + else + { + builder.AppendLine($"'{MessageOfTheDay}'"); + } + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(VnetSubnetId), out propertyOverride); if (hasPropertyOverride) { @@ -1684,6 +1798,61 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("DisableOutboundNat", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" windowsProfile: "); + builder.AppendLine("{"); + builder.AppendLine(" windowsProfile: {"); + builder.Append(" disableOutboundNat: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(WindowsProfile)) + { + builder.Append(" windowsProfile: "); + BicepSerializationHelpers.AppendChildObject(builder, WindowsProfile, options, 4, false, " windowsProfile: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SecurityProfile), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" securityProfile: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SecurityProfile)) + { + builder.Append(" securityProfile: "); + BicepSerializationHelpers.AppendChildObject(builder, SecurityProfile, options, 4, false, " securityProfile: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("GpuDriver", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" gpuProfile: "); + builder.AppendLine("{"); + builder.AppendLine(" gpuProfile: {"); + builder.Append(" driver: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(GpuProfile)) + { + builder.Append(" gpuProfile: "); + BicepSerializationHelpers.AppendChildObject(builder, GpuProfile, options, 4, false, " gpuProfile: "); + } + } + builder.AppendLine(" }"); builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolData.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolData.cs index d21fe3381f1a..109c475f4d9e 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolData.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolData.cs @@ -65,12 +65,14 @@ public ContainerServiceAgentPoolData() /// The name. /// The resourceType. /// The systemData. + /// Unique read-only string used to implement optimistic concurrency. The eTag value will change when the resource is updated. Specify an if-match or if-none-match header with the eTag value for a subsequent request to enable optimistic concurrency per the normal etag convention. /// 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. + /// A base64-encoded string which will be written to /etc/motd after decoding. This allows customization of the message of the day for Linux nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be printed raw and not be executed as a script). /// 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. @@ -108,15 +110,20 @@ public ContainerServiceAgentPoolData() /// 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. + /// The Windows agent pool's specific profile. + /// The security settings of an agent pool. + /// GPU settings for the Agent Pool. /// Keeps track of any properties unknown to the library. - internal ContainerServiceAgentPoolData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, int? count, string vmSize, int? osDiskSizeInGB, ContainerServiceOSDiskType? osDiskType, KubeletDiskType? kubeletDiskType, WorkloadRuntime? workloadRuntime, ResourceIdentifier vnetSubnetId, ResourceIdentifier podSubnetId, int? maxPods, ContainerServiceOSType? osType, ContainerServiceOSSku? osSku, int? maxCount, int? minCount, bool? enableAutoScaling, ScaleDownMode? scaleDownMode, AgentPoolType? typePropertiesType, AgentPoolMode? mode, string orchestratorVersion, string currentOrchestratorVersion, string nodeImageVersion, AgentPoolUpgradeSettings upgradeSettings, string provisioningState, ContainerServicePowerState powerState, IList availabilityZones, bool? enableNodePublicIP, ResourceIdentifier nodePublicIPPrefixId, ScaleSetPriority? scaleSetPriority, ScaleSetEvictionPolicy? scaleSetEvictionPolicy, float? spotMaxPrice, IDictionary tags, IDictionary nodeLabels, IList nodeTaints, ResourceIdentifier proximityPlacementGroupId, KubeletConfig kubeletConfig, LinuxOSConfig linuxOSConfig, bool? enableEncryptionAtHost, bool? enableUltraSsd, bool? enableFips, GpuInstanceProfile? gpuInstanceProfile, ContainerServiceCreationData creationData, ResourceIdentifier capacityReservationGroupId, ResourceIdentifier hostGroupId, AgentPoolNetworkProfile networkProfile, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal ContainerServiceAgentPoolData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ETag? etag, int? count, string vmSize, int? osDiskSizeInGB, ContainerServiceOSDiskType? osDiskType, KubeletDiskType? kubeletDiskType, WorkloadRuntime? workloadRuntime, string messageOfTheDay, ResourceIdentifier vnetSubnetId, ResourceIdentifier podSubnetId, int? maxPods, ContainerServiceOSType? osType, ContainerServiceOSSku? osSku, int? maxCount, int? minCount, bool? enableAutoScaling, ScaleDownMode? scaleDownMode, AgentPoolType? typePropertiesType, AgentPoolMode? mode, string orchestratorVersion, string currentOrchestratorVersion, string nodeImageVersion, AgentPoolUpgradeSettings upgradeSettings, string provisioningState, ContainerServicePowerState powerState, IList availabilityZones, bool? enableNodePublicIP, ResourceIdentifier nodePublicIPPrefixId, ScaleSetPriority? scaleSetPriority, ScaleSetEvictionPolicy? scaleSetEvictionPolicy, float? spotMaxPrice, IDictionary tags, IDictionary nodeLabels, IList nodeTaints, ResourceIdentifier proximityPlacementGroupId, KubeletConfig kubeletConfig, LinuxOSConfig linuxOSConfig, bool? enableEncryptionAtHost, bool? enableUltraSsd, bool? enableFips, GpuInstanceProfile? gpuInstanceProfile, ContainerServiceCreationData creationData, ResourceIdentifier capacityReservationGroupId, ResourceIdentifier hostGroupId, AgentPoolNetworkProfile networkProfile, AgentPoolWindowsProfile windowsProfile, AgentPoolSecurityProfile securityProfile, GpuProfile gpuProfile, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { + ETag = etag; Count = count; VmSize = vmSize; OSDiskSizeInGB = osDiskSizeInGB; OSDiskType = osDiskType; KubeletDiskType = kubeletDiskType; WorkloadRuntime = workloadRuntime; + MessageOfTheDay = messageOfTheDay; VnetSubnetId = vnetSubnetId; PodSubnetId = podSubnetId; MaxPods = maxPods; @@ -154,9 +161,15 @@ internal ContainerServiceAgentPoolData(ResourceIdentifier id, string name, Resou CapacityReservationGroupId = capacityReservationGroupId; HostGroupId = hostGroupId; NetworkProfile = networkProfile; + WindowsProfile = windowsProfile; + SecurityProfile = securityProfile; + GpuProfile = gpuProfile; _serializedAdditionalRawData = serializedAdditionalRawData; } + /// Unique read-only string used to implement optimistic concurrency. The eTag value will change when the resource is updated. Specify an if-match or if-none-match header with the eTag value for a subsequent request to enable optimistic concurrency per the normal etag convention. + [WirePath("properties.eTag")] + public ETag? ETag { get; } /// 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. [WirePath("properties.count")] public int? Count { get; set; } @@ -175,6 +188,9 @@ internal ContainerServiceAgentPoolData(ResourceIdentifier id, string name, Resou /// Determines the type of workload a node can run. [WirePath("properties.workloadRuntime")] public WorkloadRuntime? WorkloadRuntime { get; set; } + /// A base64-encoded string which will be written to /etc/motd after decoding. This allows customization of the message of the day for Linux nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be printed raw and not be executed as a script). + [WirePath("properties.messageOfTheDay")] + public string MessageOfTheDay { get; set; } /// 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}. [WirePath("properties.vnetSubnetID")] public ResourceIdentifier VnetSubnetId { get; set; } @@ -310,5 +326,37 @@ public ResourceIdentifier CreationDataSourceResourceId /// Network-related settings of an agent pool. [WirePath("properties.networkProfile")] public AgentPoolNetworkProfile NetworkProfile { get; set; } + /// The Windows agent pool's specific profile. + internal AgentPoolWindowsProfile WindowsProfile { get; set; } + /// The default value is false. Outbound NAT can only be disabled if the cluster outboundType is NAT Gateway and the Windows agent pool does not have node public IP enabled. + [WirePath("properties.windowsProfile.disableOutboundNat")] + public bool? DisableOutboundNat + { + get => WindowsProfile is null ? default : WindowsProfile.DisableOutboundNat; + set + { + if (WindowsProfile is null) + WindowsProfile = new AgentPoolWindowsProfile(); + WindowsProfile.DisableOutboundNat = value; + } + } + + /// The security settings of an agent pool. + [WirePath("properties.securityProfile")] + public AgentPoolSecurityProfile SecurityProfile { get; set; } + /// GPU settings for the Agent Pool. + internal GpuProfile GpuProfile { get; set; } + /// Whether to install GPU drivers. When it's not specified, default is Install. + [WirePath("properties.gpuProfile.driver")] + public GpuDriver? GpuDriver + { + get => GpuProfile is null ? default : GpuProfile.Driver; + set + { + if (GpuProfile is null) + GpuProfile = new GpuProfile(); + GpuProfile.Driver = value; + } + } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolResource.cs index e3ed5337ca43..baf69ef636bc 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolResource.cs @@ -12,6 +12,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager.ContainerService.Models; namespace Azure.ResourceManager.ContainerService { @@ -96,6 +97,75 @@ public virtual AgentPoolUpgradeProfileResource GetAgentPoolUpgradeProfile() return new AgentPoolUpgradeProfileResource(Client, Id.AppendChildResource("upgradeProfiles", "default")); } + /// Gets a collection of MachineResources in the ContainerServiceAgentPool. + /// An object representing collection of MachineResources and their operations over a MachineResource. + public virtual MachineCollection GetMachines() + { + return GetCachedClient(client => new MachineCollection(client, Id)); + } + + /// + /// Get a specific machine in the specified agent pool. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines/{machineName} + /// + /// + /// Operation Id + /// Machines_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// host name of the machine. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMachineAsync(string machineName, CancellationToken cancellationToken = default) + { + return await GetMachines().GetAsync(machineName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a specific machine in the specified agent pool. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines/{machineName} + /// + /// + /// Operation Id + /// Machines_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// host name of the machine. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMachine(string machineName, CancellationToken cancellationToken = default) + { + return GetMachines().Get(machineName, cancellationToken); + } + /// /// Gets the specified managed cluster agent pool. /// @@ -109,7 +179,7 @@ public virtual AgentPoolUpgradeProfileResource GetAgentPoolUpgradeProfile() /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -149,7 +219,7 @@ public virtual async Task> GetAsync( /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -189,7 +259,7 @@ public virtual Response Get(CancellationToken /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -198,15 +268,17 @@ public virtual Response Get(CancellationToken /// /// /// 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. + /// ignore-pod-disruption-budget=true to delete those pods on a node without considering Pod Disruption Budget. + /// The request should only proceed if an entity matches this string. /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + public virtual async Task DeleteAsync(WaitUntil waitUntil, bool? ignorePodDisruptionBudget = null, string ifMatch = null, CancellationToken cancellationToken = default) { using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.Delete"); scope.Start(); try { - var response = await _containerServiceAgentPoolAgentPoolsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(_containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _containerServiceAgentPoolAgentPoolsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ignorePodDisruptionBudget, ifMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceArmOperation(_containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ignorePodDisruptionBudget, ifMatch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -231,7 +303,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -240,15 +312,17 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// 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. + /// ignore-pod-disruption-budget=true to delete those pods on a node without considering Pod Disruption Budget. + /// The request should only proceed if an entity matches this string. /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + public virtual ArmOperation Delete(WaitUntil waitUntil, bool? ignorePodDisruptionBudget = null, string ifMatch = null, CancellationToken cancellationToken = default) { using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.Delete"); scope.Start(); try { - var response = _containerServiceAgentPoolAgentPoolsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new ContainerServiceArmOperation(_containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _containerServiceAgentPoolAgentPoolsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ignorePodDisruptionBudget, ifMatch, cancellationToken); + var operation = new ContainerServiceArmOperation(_containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ignorePodDisruptionBudget, ifMatch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -273,7 +347,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -283,9 +357,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// 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 agent pool to create or update. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. /// The cancellation token to use. /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, ContainerServiceAgentPoolData data, CancellationToken cancellationToken = default) + public virtual async Task> UpdateAsync(WaitUntil waitUntil, ContainerServiceAgentPoolData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); @@ -293,8 +369,8 @@ public virtual async Task> Updat scope.Start(); try { - var response = await _containerServiceAgentPoolAgentPoolsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(new ContainerServiceAgentPoolOperationSource(Client), _containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + var response = await _containerServiceAgentPoolAgentPoolsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceArmOperation(new ContainerServiceAgentPoolOperationSource(Client), _containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -319,7 +395,7 @@ public virtual async Task> Updat /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -329,9 +405,11 @@ public virtual async Task> Updat /// /// 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 agent pool to create or update. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. /// The cancellation token to use. /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, ContainerServiceAgentPoolData data, CancellationToken cancellationToken = default) + public virtual ArmOperation Update(WaitUntil waitUntil, ContainerServiceAgentPoolData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); @@ -339,8 +417,8 @@ public virtual ArmOperation Update(WaitUntil scope.Start(); try { - var response = _containerServiceAgentPoolAgentPoolsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); - var operation = new ContainerServiceArmOperation(new ContainerServiceAgentPoolOperationSource(Client), _containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + var response = _containerServiceAgentPoolAgentPoolsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch, cancellationToken); + var operation = new ContainerServiceArmOperation(new ContainerServiceAgentPoolOperationSource(Client), _containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -365,7 +443,7 @@ public virtual ArmOperation Update(WaitUntil /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -407,7 +485,7 @@ public virtual async Task AbortLatestOperationAsync(WaitUntil wait /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -436,6 +514,98 @@ public virtual ArmOperation AbortLatestOperation(WaitUntil waitUntil, Cancellati } } + /// + /// Deletes specific machines in an agent pool. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/deleteMachines + /// + /// + /// Operation Id + /// AgentPools_DeleteMachines + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// A list of machines from the agent pool to be deleted. + /// The cancellation token to use. + /// is null. + public virtual async Task DeleteMachinesAsync(WaitUntil waitUntil, AgentPoolDeleteMachinesParameter machines, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(machines, nameof(machines)); + + using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.DeleteMachines"); + scope.Start(); + try + { + var response = await _containerServiceAgentPoolAgentPoolsRestClient.DeleteMachinesAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, machines, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceArmOperation(_containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateDeleteMachinesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, machines).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes specific machines in an agent pool. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/deleteMachines + /// + /// + /// Operation Id + /// AgentPools_DeleteMachines + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// A list of machines from the agent pool to be deleted. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation DeleteMachines(WaitUntil waitUntil, AgentPoolDeleteMachinesParameter machines, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(machines, nameof(machines)); + + using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.DeleteMachines"); + scope.Start(); + try + { + var response = _containerServiceAgentPoolAgentPoolsRestClient.DeleteMachines(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, machines, cancellationToken); + var operation = new ContainerServiceArmOperation(_containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateDeleteMachinesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, machines).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + /// /// Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. AKS provides one new image per week with the latest updates. For more details on node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade /// @@ -449,7 +619,7 @@ public virtual ArmOperation AbortLatestOperation(WaitUntil waitUntil, Cancellati /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -491,7 +661,7 @@ public virtual async Task UpgradeNodeImageVersionAsync(WaitUntil w /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -533,7 +703,7 @@ public virtual ArmOperation UpgradeNodeImageVersion(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -590,7 +760,7 @@ public virtual async Task> AddTagAsy /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -647,7 +817,7 @@ public virtual Response AddTag(string key, st /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -703,7 +873,7 @@ public virtual async Task> SetTagsAs /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -759,7 +929,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -814,7 +984,7 @@ public virtual async Task> RemoveTag /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationCollection.cs index f608a529017b..8b0819571048 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationCollection.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -115,7 +115,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -166,7 +166,7 @@ public virtual ArmOperation Cr /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -211,7 +211,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -256,7 +256,7 @@ public virtual Response Get(st /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -286,7 +286,7 @@ public virtual AsyncPageable G /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -316,7 +316,7 @@ public virtual Pageable GetAll /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -359,7 +359,7 @@ public virtual async Task> ExistsAsync(string configName, Cancell /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -402,7 +402,7 @@ public virtual Response Exists(string configName, CancellationToken cancel /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -447,7 +447,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationResource.cs index f1463e991c78..d388a6768429 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(Ca /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -269,7 +269,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -317,7 +317,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterCollection.cs index a05f8d6c2d6d..86e818b6eaa5 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterCollection.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -76,10 +76,12 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// 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 managed cluster to create or update. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string resourceName, ContainerServiceManagedClusterData data, CancellationToken cancellationToken = default) + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string resourceName, ContainerServiceManagedClusterData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); Argument.AssertNotNull(data, nameof(data)); @@ -88,8 +90,8 @@ public virtual async Task> scope.Start(); try { - var response = await _containerServiceManagedClusterManagedClustersRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, resourceName, data, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(new ContainerServiceManagedClusterOperationSource(Client), _containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, resourceName, data).Request, response, OperationFinalStateVia.Location); + var response = await _containerServiceManagedClusterManagedClustersRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, resourceName, data, ifMatch, ifNoneMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceArmOperation(new ContainerServiceManagedClusterOperationSource(Client), _containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, resourceName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -114,7 +116,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -125,10 +127,12 @@ public virtual async Task> /// 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 managed cluster to create or update. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string resourceName, ContainerServiceManagedClusterData data, CancellationToken cancellationToken = default) + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string resourceName, ContainerServiceManagedClusterData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); Argument.AssertNotNull(data, nameof(data)); @@ -137,8 +141,8 @@ public virtual ArmOperation CreateOrUpda scope.Start(); try { - var response = _containerServiceManagedClusterManagedClustersRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, resourceName, data, cancellationToken); - var operation = new ContainerServiceArmOperation(new ContainerServiceManagedClusterOperationSource(Client), _containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, resourceName, data).Request, response, OperationFinalStateVia.Location); + var response = _containerServiceManagedClusterManagedClustersRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, resourceName, data, ifMatch, ifNoneMatch, cancellationToken); + var operation = new ContainerServiceArmOperation(new ContainerServiceManagedClusterOperationSource(Client), _containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, resourceName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -163,7 +167,7 @@ public virtual ArmOperation CreateOrUpda /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -208,7 +212,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -253,7 +257,7 @@ public virtual Response Get(string resou /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -283,7 +287,7 @@ public virtual AsyncPageable GetAllAsync /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -313,7 +317,7 @@ public virtual Pageable GetAll(Cancellat /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -356,7 +360,7 @@ public virtual async Task> ExistsAsync(string resourceName, Cance /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -399,7 +403,7 @@ public virtual Response Exists(string resourceName, CancellationToken canc /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -444,7 +448,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterData.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterData.Serialization.cs index b93b7ac71450..61727ecebd99 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterData.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterData.Serialization.cs @@ -40,6 +40,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); + if (options.Format != "W" && Optional.IsDefined(ETag)) + { + writer.WritePropertyName("eTag"u8); + writer.WriteStringValue(ETag.Value.ToString()); + } if (Optional.IsDefined(Sku)) { writer.WritePropertyName("sku"u8); @@ -158,6 +163,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("nodeResourceGroup"u8); writer.WriteStringValue(NodeResourceGroup); } + if (Optional.IsDefined(NodeResourceGroupProfile)) + { + writer.WritePropertyName("nodeResourceGroupProfile"u8); + writer.WriteObjectValue(NodeResourceGroupProfile, options); + } if (Optional.IsDefined(EnableRbac)) { writer.WritePropertyName("enableRBAC"u8); @@ -168,11 +178,6 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("supportPlan"u8); writer.WriteStringValue(SupportPlan.Value.ToString()); } - if (Optional.IsDefined(EnablePodSecurityPolicy)) - { - writer.WritePropertyName("enablePodSecurityPolicy"u8); - writer.WriteBooleanValue(EnablePodSecurityPolicy.Value); - } if (Optional.IsDefined(NetworkProfile)) { writer.WritePropertyName("networkProfile"u8); @@ -249,6 +254,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("storageProfile"u8); writer.WriteObjectValue(StorageProfile, options); } + if (Optional.IsDefined(IngressProfile)) + { + writer.WritePropertyName("ingressProfile"u8); + writer.WriteObjectValue(IngressProfile, options); + } if (Optional.IsDefined(PublicNetworkAccess)) { writer.WritePropertyName("publicNetworkAccess"u8); @@ -274,6 +284,16 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("resourceUID"u8); writer.WriteStringValue(ResourceId); } + if (Optional.IsDefined(MetricsProfile)) + { + writer.WritePropertyName("metricsProfile"u8); + writer.WriteObjectValue(MetricsProfile, options); + } + if (Optional.IsDefined(BootstrapProfile)) + { + writer.WritePropertyName("bootstrapProfile"u8); + writer.WriteObjectValue(BootstrapProfile, options); + } writer.WriteEndObject(); } @@ -297,6 +317,7 @@ internal static ContainerServiceManagedClusterData DeserializeContainerServiceMa { return null; } + ETag? etag = default; ManagedClusterSku sku = default; ExtendedLocation extendedLocation = default; ManagedClusterIdentity identity = default; @@ -324,9 +345,9 @@ internal static ContainerServiceManagedClusterData DeserializeContainerServiceMa ManagedClusterPodIdentityProfile podIdentityProfile = default; ManagedClusterOidcIssuerProfile oidcIssuerProfile = default; string nodeResourceGroup = default; + ManagedClusterNodeResourceGroupProfile nodeResourceGroupProfile = default; bool? enableRBAC = default; KubernetesSupportPlan? supportPlan = default; - bool? enablePodSecurityPolicy = default; ContainerServiceNetworkProfile networkProfile = default; ManagedClusterAadProfile aadProfile = default; ManagedClusterAutoUpgradeProfile autoUpgradeProfile = default; @@ -340,15 +361,27 @@ internal static ContainerServiceManagedClusterData DeserializeContainerServiceMa ManagedClusterHttpProxyConfig httpProxyConfig = default; ManagedClusterSecurityProfile securityProfile = default; ManagedClusterStorageProfile storageProfile = default; + ManagedClusterIngressProfile ingressProfile = default; ContainerServicePublicNetworkAccess? publicNetworkAccess = default; ManagedClusterWorkloadAutoScalerProfile workloadAutoScalerProfile = default; ManagedClusterAzureMonitorProfile azureMonitorProfile = default; ServiceMeshProfile serviceMeshProfile = default; ResourceIdentifier resourceUID = default; + ManagedClusterMetricsProfile metricsProfile = default; + ManagedClusterBootstrapProfile bootstrapProfile = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("eTag"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + etag = new ETag(property.Value.GetString()); + continue; + } if (property.NameEquals("sku"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -564,31 +597,31 @@ internal static ContainerServiceManagedClusterData DeserializeContainerServiceMa nodeResourceGroup = property0.Value.GetString(); continue; } - if (property0.NameEquals("enableRBAC"u8)) + if (property0.NameEquals("nodeResourceGroupProfile"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } - enableRBAC = property0.Value.GetBoolean(); + nodeResourceGroupProfile = ManagedClusterNodeResourceGroupProfile.DeserializeManagedClusterNodeResourceGroupProfile(property0.Value, options); continue; } - if (property0.NameEquals("supportPlan"u8)) + if (property0.NameEquals("enableRBAC"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } - supportPlan = new KubernetesSupportPlan(property0.Value.GetString()); + enableRBAC = property0.Value.GetBoolean(); continue; } - if (property0.NameEquals("enablePodSecurityPolicy"u8)) + if (property0.NameEquals("supportPlan"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } - enablePodSecurityPolicy = property0.Value.GetBoolean(); + supportPlan = new KubernetesSupportPlan(property0.Value.GetString()); continue; } if (property0.NameEquals("networkProfile"u8)) @@ -718,6 +751,15 @@ internal static ContainerServiceManagedClusterData DeserializeContainerServiceMa storageProfile = ManagedClusterStorageProfile.DeserializeManagedClusterStorageProfile(property0.Value, options); continue; } + if (property0.NameEquals("ingressProfile"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ingressProfile = ManagedClusterIngressProfile.DeserializeManagedClusterIngressProfile(property0.Value, options); + continue; + } if (property0.NameEquals("publicNetworkAccess"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -763,6 +805,24 @@ internal static ContainerServiceManagedClusterData DeserializeContainerServiceMa resourceUID = new ResourceIdentifier(property0.Value.GetString()); continue; } + if (property0.NameEquals("metricsProfile"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + metricsProfile = ManagedClusterMetricsProfile.DeserializeManagedClusterMetricsProfile(property0.Value, options); + continue; + } + if (property0.NameEquals("bootstrapProfile"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bootstrapProfile = ManagedClusterBootstrapProfile.DeserializeManagedClusterBootstrapProfile(property0.Value, options); + continue; + } } continue; } @@ -779,6 +839,7 @@ internal static ContainerServiceManagedClusterData DeserializeContainerServiceMa systemData, tags ?? new ChangeTrackingDictionary(), location, + etag, sku, extendedLocation, identity, @@ -800,9 +861,9 @@ internal static ContainerServiceManagedClusterData DeserializeContainerServiceMa podIdentityProfile, oidcIssuerProfile, nodeResourceGroup, + nodeResourceGroupProfile, enableRBAC, supportPlan, - enablePodSecurityPolicy, networkProfile, aadProfile, autoUpgradeProfile, @@ -816,11 +877,14 @@ internal static ContainerServiceManagedClusterData DeserializeContainerServiceMa httpProxyConfig, securityProfile, storageProfile, + ingressProfile, publicNetworkAccess, workloadAutoScalerProfile, azureMonitorProfile, serviceMeshProfile, resourceUID, + metricsProfile, + bootstrapProfile, serializedAdditionalRawData); } @@ -907,6 +971,21 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ETag), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" eTag: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ETag)) + { + builder.Append(" eTag: "); + builder.AppendLine($"'{ETag.Value.ToString()}'"); + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Sku), out propertyOverride); if (hasPropertyOverride) { @@ -1348,6 +1427,26 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("NodeResourceGroupRestrictionLevel", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nodeResourceGroupProfile: "); + builder.AppendLine("{"); + builder.AppendLine(" nodeResourceGroupProfile: {"); + builder.Append(" restrictionLevel: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(NodeResourceGroupProfile)) + { + builder.Append(" nodeResourceGroupProfile: "); + BicepSerializationHelpers.AppendChildObject(builder, NodeResourceGroupProfile, options, 4, false, " nodeResourceGroupProfile: "); + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnableRbac), out propertyOverride); if (hasPropertyOverride) { @@ -1379,22 +1478,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnablePodSecurityPolicy), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" enablePodSecurityPolicy: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(EnablePodSecurityPolicy)) - { - builder.Append(" enablePodSecurityPolicy: "); - var boolValue = EnablePodSecurityPolicy.Value == true ? "true" : "false"; - builder.AppendLine($"{boolValue}"); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NetworkProfile), out propertyOverride); if (hasPropertyOverride) { @@ -1613,6 +1696,26 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("IngressWebAppRouting", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" ingressProfile: "); + builder.AppendLine("{"); + builder.AppendLine(" ingressProfile: {"); + builder.Append(" webAppRouting: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(IngressProfile)) + { + builder.Append(" ingressProfile: "); + BicepSerializationHelpers.AppendChildObject(builder, IngressProfile, options, 4, false, " ingressProfile: "); + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PublicNetworkAccess), out propertyOverride); if (hasPropertyOverride) { @@ -1693,6 +1796,43 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("CostAnalysisEnabled", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" metricsProfile: "); + builder.AppendLine("{"); + builder.AppendLine(" metricsProfile: {"); + builder.AppendLine(" costAnalysis: {"); + builder.Append(" enabled: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + builder.AppendLine(" }"); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(MetricsProfile)) + { + builder.Append(" metricsProfile: "); + BicepSerializationHelpers.AppendChildObject(builder, MetricsProfile, options, 4, false, " metricsProfile: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(BootstrapProfile), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" bootstrapProfile: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(BootstrapProfile)) + { + builder.Append(" bootstrapProfile: "); + BicepSerializationHelpers.AppendChildObject(builder, BootstrapProfile, options, 4, false, " bootstrapProfile: "); + } + } + builder.AppendLine(" }"); builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterData.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterData.cs index 9d7696707b56..fa9289c49793 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterData.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterData.cs @@ -69,6 +69,7 @@ public ContainerServiceManagedClusterData(AzureLocation location) : base(locatio /// The systemData. /// The tags. /// The location. + /// Unique read-only string used to implement optimistic concurrency. The eTag value will change when the resource is updated. Specify an if-match or if-none-match header with the eTag value for a subsequent request to enable optimistic concurrency per the normal etag convention. /// The managed cluster SKU. /// The extended location of the Virtual Machine. /// The identity of the managed cluster, if configured. @@ -90,9 +91,9 @@ public ContainerServiceManagedClusterData(AzureLocation location) : base(locatio /// 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. + /// Profile of the node resource group configuration. /// 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. @@ -100,20 +101,24 @@ public ContainerServiceManagedClusterData(AzureLocation location) : base(locatio /// 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. + /// The user identity associated with the managed cluster. This identity will be used by the kubelet. Only one user assigned identity is allowed. The only accepted key is "kubeletidentity", with value of "resourceId": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}". /// 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. + /// Ingress 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). + /// Optional cluster metrics configuration. + /// Profile of the cluster bootstrap configuration. /// Keeps track of any properties unknown to the library. - internal ContainerServiceManagedClusterData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ManagedClusterSku sku, ExtendedLocation extendedLocation, ManagedClusterIdentity clusterIdentity, string provisioningState, ContainerServicePowerState powerState, int? maxAgentPools, string kubernetesVersion, string currentKubernetesVersion, string dnsPrefix, string fqdnSubdomain, string fqdn, string privateFqdn, string azurePortalFqdn, IList agentPoolProfiles, ContainerServiceLinuxProfile linuxProfile, ManagedClusterWindowsProfile windowsProfile, ManagedClusterServicePrincipalProfile servicePrincipalProfile, IDictionary addonProfiles, ManagedClusterPodIdentityProfile podIdentityProfile, ManagedClusterOidcIssuerProfile oidcIssuerProfile, string nodeResourceGroup, bool? enableRbac, KubernetesSupportPlan? supportPlan, bool? enablePodSecurityPolicy, ContainerServiceNetworkProfile networkProfile, ManagedClusterAadProfile aadProfile, ManagedClusterAutoUpgradeProfile autoUpgradeProfile, ClusterUpgradeSettings upgradeSettings, ManagedClusterAutoScalerProfile autoScalerProfile, ManagedClusterApiServerAccessProfile apiServerAccessProfile, ResourceIdentifier diskEncryptionSetId, IDictionary identityProfile, IList privateLinkResources, bool? disableLocalAccounts, ManagedClusterHttpProxyConfig httpProxyConfig, ManagedClusterSecurityProfile securityProfile, ManagedClusterStorageProfile storageProfile, ContainerServicePublicNetworkAccess? publicNetworkAccess, ManagedClusterWorkloadAutoScalerProfile workloadAutoScalerProfile, ManagedClusterAzureMonitorProfile azureMonitorProfile, ServiceMeshProfile serviceMeshProfile, ResourceIdentifier resourceId, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal ContainerServiceManagedClusterData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ETag? etag, ManagedClusterSku sku, ExtendedLocation extendedLocation, ManagedClusterIdentity clusterIdentity, string provisioningState, ContainerServicePowerState powerState, int? maxAgentPools, string kubernetesVersion, string currentKubernetesVersion, string dnsPrefix, string fqdnSubdomain, string fqdn, string privateFqdn, string azurePortalFqdn, IList agentPoolProfiles, ContainerServiceLinuxProfile linuxProfile, ManagedClusterWindowsProfile windowsProfile, ManagedClusterServicePrincipalProfile servicePrincipalProfile, IDictionary addonProfiles, ManagedClusterPodIdentityProfile podIdentityProfile, ManagedClusterOidcIssuerProfile oidcIssuerProfile, string nodeResourceGroup, ManagedClusterNodeResourceGroupProfile nodeResourceGroupProfile, bool? enableRbac, KubernetesSupportPlan? supportPlan, ContainerServiceNetworkProfile networkProfile, ManagedClusterAadProfile aadProfile, ManagedClusterAutoUpgradeProfile autoUpgradeProfile, ClusterUpgradeSettings upgradeSettings, ManagedClusterAutoScalerProfile autoScalerProfile, ManagedClusterApiServerAccessProfile apiServerAccessProfile, ResourceIdentifier diskEncryptionSetId, IDictionary identityProfile, IList privateLinkResources, bool? disableLocalAccounts, ManagedClusterHttpProxyConfig httpProxyConfig, ManagedClusterSecurityProfile securityProfile, ManagedClusterStorageProfile storageProfile, ManagedClusterIngressProfile ingressProfile, ContainerServicePublicNetworkAccess? publicNetworkAccess, ManagedClusterWorkloadAutoScalerProfile workloadAutoScalerProfile, ManagedClusterAzureMonitorProfile azureMonitorProfile, ServiceMeshProfile serviceMeshProfile, ResourceIdentifier resourceId, ManagedClusterMetricsProfile metricsProfile, ManagedClusterBootstrapProfile bootstrapProfile, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { + ETag = etag; Sku = sku; ExtendedLocation = extendedLocation; ClusterIdentity = clusterIdentity; @@ -135,9 +140,9 @@ internal ContainerServiceManagedClusterData(ResourceIdentifier id, string name, PodIdentityProfile = podIdentityProfile; OidcIssuerProfile = oidcIssuerProfile; NodeResourceGroup = nodeResourceGroup; + NodeResourceGroupProfile = nodeResourceGroupProfile; EnableRbac = enableRbac; SupportPlan = supportPlan; - EnablePodSecurityPolicy = enablePodSecurityPolicy; NetworkProfile = networkProfile; AadProfile = aadProfile; AutoUpgradeProfile = autoUpgradeProfile; @@ -151,11 +156,14 @@ internal ContainerServiceManagedClusterData(ResourceIdentifier id, string name, HttpProxyConfig = httpProxyConfig; SecurityProfile = securityProfile; StorageProfile = storageProfile; + IngressProfile = ingressProfile; PublicNetworkAccess = publicNetworkAccess; WorkloadAutoScalerProfile = workloadAutoScalerProfile; AzureMonitorProfile = azureMonitorProfile; ServiceMeshProfile = serviceMeshProfile; ResourceId = resourceId; + MetricsProfile = metricsProfile; + BootstrapProfile = bootstrapProfile; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -164,6 +172,9 @@ internal ContainerServiceManagedClusterData() { } + /// Unique read-only string used to implement optimistic concurrency. The eTag value will change when the resource is updated. Specify an if-match or if-none-match header with the eTag value for a subsequent request to enable optimistic concurrency per the normal etag convention. + [WirePath("eTag")] + public ETag? ETag { get; } /// The managed cluster SKU. [WirePath("sku")] public ManagedClusterSku Sku { get; set; } @@ -233,15 +244,27 @@ public ContainerServiceStateCode? PowerStateCode /// The name of the resource group containing agent pool nodes. [WirePath("properties.nodeResourceGroup")] public string NodeResourceGroup { get; set; } + /// Profile of the node resource group configuration. + internal ManagedClusterNodeResourceGroupProfile NodeResourceGroupProfile { get; set; } + /// The restriction level applied to the cluster's node resource group. If not specified, the default is 'Unrestricted'. + [WirePath("properties.nodeResourceGroupProfile.restrictionLevel")] + public RestrictionLevel? NodeResourceGroupRestrictionLevel + { + get => NodeResourceGroupProfile is null ? default : NodeResourceGroupProfile.RestrictionLevel; + set + { + if (NodeResourceGroupProfile is null) + NodeResourceGroupProfile = new ManagedClusterNodeResourceGroupProfile(); + NodeResourceGroupProfile.RestrictionLevel = value; + } + } + /// Whether to enable Kubernetes Role-Based Access Control. [WirePath("properties.enableRBAC")] public bool? EnableRbac { get; set; } /// The support plan for the Managed Cluster. If unspecified, the default is 'KubernetesOfficial'. [WirePath("properties.supportPlan")] public KubernetesSupportPlan? SupportPlan { get; set; } - /// (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. - [WirePath("properties.enablePodSecurityPolicy")] - public bool? EnablePodSecurityPolicy { get; set; } /// The network configuration profile. [WirePath("properties.networkProfile")] public ContainerServiceNetworkProfile NetworkProfile { get; set; } @@ -275,7 +298,7 @@ public UpgradeOverrideSettings UpgradeOverrideSettings /// This is of the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. [WirePath("properties.diskEncryptionSetID")] public ResourceIdentifier DiskEncryptionSetId { get; set; } - /// Identities associated with the cluster. + /// The user identity associated with the managed cluster. This identity will be used by the kubelet. Only one user assigned identity is allowed. The only accepted key is "kubeletidentity", with value of "resourceId": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}". [WirePath("properties.identityProfile")] public IDictionary IdentityProfile { get; } /// Private link resources associated with the cluster. @@ -293,6 +316,21 @@ public UpgradeOverrideSettings UpgradeOverrideSettings /// Storage profile for the managed cluster. [WirePath("properties.storageProfile")] public ManagedClusterStorageProfile StorageProfile { get; set; } + /// Ingress profile for the managed cluster. + internal ManagedClusterIngressProfile IngressProfile { get; set; } + /// App Routing settings for the ingress profile. You can find an overview and onboarding guide for this feature at https://learn.microsoft.com/en-us/azure/aks/app-routing?tabs=default%2Cdeploy-app-default. + [WirePath("properties.ingressProfile.webAppRouting")] + public ManagedClusterIngressProfileWebAppRouting IngressWebAppRouting + { + get => IngressProfile is null ? default : IngressProfile.WebAppRouting; + set + { + if (IngressProfile is null) + IngressProfile = new ManagedClusterIngressProfile(); + IngressProfile.WebAppRouting = value; + } + } + /// Allow or deny public network access for AKS. [WirePath("properties.publicNetworkAccess")] public ContainerServicePublicNetworkAccess? PublicNetworkAccess { get; set; } @@ -320,5 +358,23 @@ public ManagedClusterMonitorProfileMetrics AzureMonitorMetrics /// The resourceUID uniquely identifies ManagedClusters that reuse ARM ResourceIds (i.e: create, delete, create sequence). [WirePath("properties.resourceUID")] public ResourceIdentifier ResourceId { get; } + /// Optional cluster metrics configuration. + internal ManagedClusterMetricsProfile MetricsProfile { get; set; } + /// The Managed Cluster sku.tier must be set to 'Standard' or 'Premium' to enable this feature. Enabling this will add Kubernetes Namespace and Deployment details to the Cost Analysis views in the Azure portal. If not specified, the default is false. For more information see aka.ms/aks/docs/cost-analysis. + [WirePath("properties.metricsProfile.costAnalysis.enabled")] + public bool? CostAnalysisEnabled + { + get => MetricsProfile is null ? default : MetricsProfile.CostAnalysisEnabled; + set + { + if (MetricsProfile is null) + MetricsProfile = new ManagedClusterMetricsProfile(); + MetricsProfile.CostAnalysisEnabled = value; + } + } + + /// Profile of the cluster bootstrap configuration. + [WirePath("properties.bootstrapProfile")] + public ManagedClusterBootstrapProfile BootstrapProfile { get; set; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterResource.cs index e9761b7a74dd..faf3158f9a2d 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterResource.cs @@ -130,7 +130,7 @@ public virtual MeshUpgradeProfileCollection GetMeshUpgradeProfiles() /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -161,7 +161,7 @@ public virtual async Task> GetMeshUpgradePr /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -199,7 +199,7 @@ public virtual ContainerServiceMaintenanceConfigurationCollection GetContainerSe /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -230,7 +230,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -268,7 +268,7 @@ public virtual ContainerServiceAgentPoolCollection GetContainerServiceAgentPools /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -299,7 +299,7 @@ public virtual async Task> GetContai /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -337,7 +337,7 @@ public virtual ContainerServicePrivateEndpointConnectionCollection GetContainerS /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -368,7 +368,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -406,7 +406,7 @@ public virtual ContainerServiceTrustedAccessRoleBindingCollection GetContainerSe /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -437,7 +437,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -468,7 +468,7 @@ public virtual Response GetCon /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -508,7 +508,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -535,6 +535,92 @@ public virtual Response Get(Cancellation } } + /// + /// Deletes a managed cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName} + /// + /// + /// Operation Id + /// ManagedClusters_Delete + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, string ifMatch = null, CancellationToken cancellationToken = default) + { + using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.Delete"); + scope.Start(); + try + { + var response = await _containerServiceManagedClusterManagedClustersRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, ifMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceArmOperation(_containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a managed cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName} + /// + /// + /// Operation Id + /// ManagedClusters_Delete + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, string ifMatch = null, CancellationToken cancellationToken = default) + { + using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.Delete"); + scope.Start(); + try + { + var response = _containerServiceManagedClusterManagedClustersRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, ifMatch, cancellationToken); + var operation = new ContainerServiceArmOperation(_containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + /// /// Updates tags on a managed cluster. /// @@ -548,7 +634,7 @@ public virtual Response Get(Cancellation /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -558,9 +644,10 @@ public virtual Response Get(Cancellation /// /// 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. /// Parameters supplied to the Update Managed Cluster Tags operation. + /// The request should only proceed if an entity matches this string. /// The cancellation token to use. /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, ContainerServiceTagsObject containerServiceTagsObject, CancellationToken cancellationToken = default) + public virtual async Task> UpdateAsync(WaitUntil waitUntil, ContainerServiceTagsObject containerServiceTagsObject, string ifMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(containerServiceTagsObject, nameof(containerServiceTagsObject)); @@ -568,8 +655,8 @@ public virtual async Task> scope.Start(); try { - var response = await _containerServiceManagedClusterManagedClustersRestClient.UpdateTagsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, containerServiceTagsObject, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(new ContainerServiceManagedClusterOperationSource(Client), _containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateUpdateTagsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, containerServiceTagsObject).Request, response, OperationFinalStateVia.Location); + var response = await _containerServiceManagedClusterManagedClustersRestClient.UpdateTagsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, containerServiceTagsObject, ifMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceArmOperation(new ContainerServiceManagedClusterOperationSource(Client), _containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateUpdateTagsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, containerServiceTagsObject, ifMatch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -594,7 +681,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -604,9 +691,10 @@ public virtual async Task> /// /// 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. /// Parameters supplied to the Update Managed Cluster Tags operation. + /// The request should only proceed if an entity matches this string. /// The cancellation token to use. /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, ContainerServiceTagsObject containerServiceTagsObject, CancellationToken cancellationToken = default) + public virtual ArmOperation Update(WaitUntil waitUntil, ContainerServiceTagsObject containerServiceTagsObject, string ifMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(containerServiceTagsObject, nameof(containerServiceTagsObject)); @@ -614,8 +702,8 @@ public virtual ArmOperation Update(WaitU scope.Start(); try { - var response = _containerServiceManagedClusterManagedClustersRestClient.UpdateTags(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, containerServiceTagsObject, cancellationToken); - var operation = new ContainerServiceArmOperation(new ContainerServiceManagedClusterOperationSource(Client), _containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateUpdateTagsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, containerServiceTagsObject).Request, response, OperationFinalStateVia.Location); + var response = _containerServiceManagedClusterManagedClustersRestClient.UpdateTags(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, containerServiceTagsObject, ifMatch, cancellationToken); + var operation = new ContainerServiceArmOperation(new ContainerServiceManagedClusterOperationSource(Client), _containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateUpdateTagsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, containerServiceTagsObject, ifMatch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -640,7 +728,7 @@ public virtual ArmOperation Update(WaitU /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// @@ -679,7 +767,7 @@ public virtual async Task> GetAccessProfil /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// @@ -718,7 +806,7 @@ public virtual Response GetAccessProfile(string rol /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -757,7 +845,7 @@ public virtual async Task> GetClusterAdminCr /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -796,7 +884,7 @@ public virtual Response GetClusterAdminCredentials(st /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -836,7 +924,7 @@ public virtual async Task> GetClusterUserCre /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -876,7 +964,7 @@ public virtual Response GetClusterUserCredentials(str /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -915,7 +1003,7 @@ public virtual async Task> GetClusterMonitor /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -954,7 +1042,7 @@ public virtual Response GetClusterMonitoringUserCrede /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -1000,7 +1088,7 @@ public virtual async Task ResetServicePrincipalProfileAsync(WaitUn /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -1046,7 +1134,7 @@ public virtual ArmOperation ResetServicePrincipalProfile(WaitUntil waitUntil, Ma /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -1092,7 +1180,7 @@ public virtual async Task ResetAadProfileAsync(WaitUntil waitUntil /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -1138,7 +1226,7 @@ public virtual ArmOperation ResetAadProfile(WaitUntil waitUntil, ManagedClusterA /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -1180,7 +1268,7 @@ public virtual async Task RotateClusterCertificatesAsync(WaitUntil /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -1222,7 +1310,7 @@ public virtual ArmOperation RotateClusterCertificates(WaitUntil waitUntil, Cance /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -1264,7 +1352,7 @@ public virtual async Task AbortLatestOperationAsync(WaitUntil wait /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -1306,7 +1394,7 @@ public virtual ArmOperation AbortLatestOperation(WaitUntil waitUntil, Cancellati /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -1348,7 +1436,7 @@ public virtual async Task RotateServiceAccountSigningKeysAsync(Wai /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -1390,7 +1478,7 @@ public virtual ArmOperation RotateServiceAccountSigningKeys(WaitUntil waitUntil, /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -1432,7 +1520,7 @@ public virtual async Task StopAsync(WaitUntil waitUntil, Cancellat /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -1474,7 +1562,7 @@ public virtual ArmOperation Stop(WaitUntil waitUntil, CancellationToken cancella /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -1516,7 +1604,7 @@ public virtual async Task StartAsync(WaitUntil waitUntil, Cancella /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -1558,7 +1646,7 @@ public virtual ArmOperation Start(WaitUntil waitUntil, CancellationToken cancell /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -1604,7 +1692,7 @@ public virtual async Task> RunComma /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -1650,7 +1738,7 @@ public virtual ArmOperation RunCommand(WaitUntil /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// @@ -1689,7 +1777,7 @@ public virtual async Task> GetCommandRe /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// @@ -1728,7 +1816,7 @@ public virtual Response GetCommandResult(string /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -1758,7 +1846,7 @@ public virtual AsyncPageable GetOut /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -1788,7 +1876,7 @@ public virtual Pageable GetOutbound /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// @@ -1822,7 +1910,7 @@ public virtual async Task> GetAvailableAgen /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// @@ -1856,7 +1944,7 @@ public virtual Response GetAvailableAgentPoolVersion /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// @@ -1881,7 +1969,7 @@ public virtual AsyncPageable GetPrivate /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// @@ -1906,7 +1994,7 @@ public virtual Pageable GetPrivateLinkR /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// @@ -1944,7 +2032,7 @@ public virtual async Task> Res /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// @@ -1982,7 +2070,7 @@ public virtual Response ResolvePrivateL /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -2044,7 +2132,7 @@ public virtual async Task> AddT /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -2106,7 +2194,7 @@ public virtual Response AddTag(string ke /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -2163,7 +2251,7 @@ public virtual async Task> SetT /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -2220,7 +2308,7 @@ public virtual Response SetTags(IDiction /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -2280,7 +2368,7 @@ public virtual async Task> Remo /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServicePrivateEndpointConnectionCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServicePrivateEndpointConnectionCollection.cs index e42d1a48311f..d540ee89eba1 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServicePrivateEndpointConnectionCollection.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServicePrivateEndpointConnectionCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -115,7 +115,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -166,7 +166,7 @@ public virtual ArmOperation C /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -211,7 +211,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -256,7 +256,7 @@ public virtual Response Get(s /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -285,7 +285,7 @@ public virtual AsyncPageable /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -314,7 +314,7 @@ public virtual Pageable GetAl /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -357,7 +357,7 @@ public virtual async Task> ExistsAsync(string privateEndpointConn /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -400,7 +400,7 @@ public virtual Response Exists(string privateEndpointConnectionName, Cance /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -445,7 +445,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServicePrivateEndpointConnectionResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServicePrivateEndpointConnectionResource.cs index 56db01f3bb7c..7f306c45dc84 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServicePrivateEndpointConnectionResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServicePrivateEndpointConnectionResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(C /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -265,7 +265,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBindingCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBindingCollection.cs index 53b1a5b4fea4..34e675143917 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBindingCollection.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBindingCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation Cr /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(st /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable G /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string trustedAccessRoleBi /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string trustedAccessRoleBindingName, Cancel /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBindingResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBindingResource.cs index c31d699ddd30..af0b780341b5 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBindingResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBindingResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(Ca /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -265,7 +265,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/ContainerServiceExtensions.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/ContainerServiceExtensions.cs index 9d4c114d8c6b..0d2d7da8ca0f 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/ContainerServiceExtensions.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/ContainerServiceExtensions.cs @@ -33,25 +33,6 @@ private static MockableContainerServiceSubscriptionResource GetMockableContainer return resource.GetCachedClient(client => new MockableContainerServiceSubscriptionResource(client, resource.Id)); } - /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// is null. - /// Returns a object. - public static OSOptionProfileResource GetOSOptionProfileResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableContainerServiceArmClient(client).GetOSOptionProfileResource(id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -242,6 +223,25 @@ public static ContainerServiceTrustedAccessRoleBindingResource GetContainerServi return GetMockableContainerServiceArmClient(client).GetContainerServiceTrustedAccessRoleBindingResource(id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static MachineResource GetMachineResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableContainerServiceArmClient(client).GetMachineResource(id); + } + /// /// Gets a collection of ContainerServiceManagedClusterResources in the ResourceGroupResource. /// @@ -272,7 +272,7 @@ public static ContainerServiceManagedClusterCollection GetContainerServiceManage /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -310,7 +310,7 @@ public static async Task> GetCo /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -365,7 +365,7 @@ public static AgentPoolSnapshotCollection GetAgentPoolSnapshots(this ResourceGro /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -403,7 +403,7 @@ public static async Task> GetAgentPoolSnapsh /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -459,7 +459,7 @@ public static MeshRevisionProfileCollection GetMeshRevisionProfiles(this Subscri /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -498,7 +498,7 @@ public static async Task> GetMeshRevisionP /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -537,7 +537,7 @@ public static Response GetMeshRevisionProfile(this /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// @@ -569,7 +569,7 @@ public static async Task> GetKubernetesVer /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// @@ -601,7 +601,7 @@ public static Response GetKubernetesVersionsManaged /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -637,7 +637,7 @@ public static AsyncPageable GetContainer /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -673,7 +673,7 @@ public static Pageable GetContainerServi /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -709,7 +709,7 @@ public static AsyncPageable GetAgentPoolSnapshotsAsyn /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -745,7 +745,7 @@ public static Pageable GetAgentPoolSnapshots(this Sub /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// @@ -778,7 +778,7 @@ public static AsyncPageable GetTrustedAccessR /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/MockableContainerServiceArmClient.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/MockableContainerServiceArmClient.cs index 480506346597..c0488cd604fa 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/MockableContainerServiceArmClient.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/MockableContainerServiceArmClient.cs @@ -34,18 +34,6 @@ private string GetApiVersionOrNull(ResourceType resourceType) return apiVersion; } - /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual OSOptionProfileResource GetOSOptionProfileResource(ResourceIdentifier id) - { - OSOptionProfileResource.ValidateResourceId(id); - return new OSOptionProfileResource(Client, id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -165,5 +153,17 @@ public virtual ContainerServiceTrustedAccessRoleBindingResource GetContainerServ ContainerServiceTrustedAccessRoleBindingResource.ValidateResourceId(id); return new ContainerServiceTrustedAccessRoleBindingResource(Client, id); } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual MachineResource GetMachineResource(ResourceIdentifier id) + { + MachineResource.ValidateResourceId(id); + return new MachineResource(Client, id); + } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/MockableContainerServiceResourceGroupResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/MockableContainerServiceResourceGroupResource.cs index c0fa202bd1ae..ddad3dd7b919 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/MockableContainerServiceResourceGroupResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/MockableContainerServiceResourceGroupResource.cs @@ -53,7 +53,7 @@ public virtual ContainerServiceManagedClusterCollection GetContainerServiceManag /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -84,7 +84,7 @@ public virtual async Task> GetC /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -122,7 +122,7 @@ public virtual AgentPoolSnapshotCollection GetAgentPoolSnapshots() /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -153,7 +153,7 @@ public virtual async Task> GetAgentPoolSnaps /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/MockableContainerServiceSubscriptionResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/MockableContainerServiceSubscriptionResource.cs index fadc63f13095..c706cbc25311 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/MockableContainerServiceSubscriptionResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/MockableContainerServiceSubscriptionResource.cs @@ -75,7 +75,7 @@ public virtual MeshRevisionProfileCollection GetMeshRevisionProfiles(AzureLocati /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -107,7 +107,7 @@ public virtual async Task> GetMeshRevision /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -139,7 +139,7 @@ public virtual Response GetMeshRevisionProfile(Azur /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// @@ -174,7 +174,7 @@ public virtual async Task> GetKubernetesVe /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// @@ -209,7 +209,7 @@ public virtual Response GetKubernetesVersionsManage /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -239,7 +239,7 @@ public virtual AsyncPageable GetContaine /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -269,7 +269,7 @@ public virtual Pageable GetContainerServ /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -299,7 +299,7 @@ public virtual AsyncPageable GetAgentPoolSnapshotsAsy /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -329,7 +329,7 @@ public virtual Pageable GetAgentPoolSnapshots(Cancell /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// @@ -356,7 +356,7 @@ public virtual AsyncPageable GetTrustedAccess /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MachineCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MachineCollection.cs new file mode 100644 index 000000000000..7af736cf0226 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MachineCollection.cs @@ -0,0 +1,395 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ContainerService +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetMachines method from an instance of . + /// + public partial class MachineCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _machineClientDiagnostics; + private readonly MachinesRestOperations _machineRestClient; + + /// Initializes a new instance of the class for mocking. + protected MachineCollection() + { + } + + /// 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 MachineCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _machineClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", MachineResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(MachineResource.ResourceType, out string machineApiVersion); + _machineRestClient = new MachinesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, machineApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ContainerServiceAgentPoolResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ContainerServiceAgentPoolResource.ResourceType), nameof(id)); + } + + /// + /// Get a specific machine in the specified agent pool. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines/{machineName} + /// + /// + /// Operation Id + /// Machines_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// host name of the machine. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string machineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); + + using var scope = _machineClientDiagnostics.CreateScope("MachineCollection.Get"); + scope.Start(); + try + { + var response = await _machineRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, machineName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MachineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a specific machine in the specified agent pool. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines/{machineName} + /// + /// + /// Operation Id + /// Machines_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// host name of the machine. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string machineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); + + using var scope = _machineClientDiagnostics.CreateScope("MachineCollection.Get"); + scope.Start(); + try + { + var response = _machineRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, machineName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MachineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a list of machines in the specified agent pool. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines + /// + /// + /// Operation Id + /// Machines_List + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MachineResource(Client, MachineData.DeserializeMachineData(e)), _machineClientDiagnostics, Pipeline, "MachineCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets a list of machines in the specified agent pool. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines + /// + /// + /// Operation Id + /// Machines_List + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MachineResource(Client, MachineData.DeserializeMachineData(e)), _machineClientDiagnostics, Pipeline, "MachineCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines/{machineName} + /// + /// + /// Operation Id + /// Machines_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// host name of the machine. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string machineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); + + using var scope = _machineClientDiagnostics.CreateScope("MachineCollection.Exists"); + scope.Start(); + try + { + var response = await _machineRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, machineName, 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/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines/{machineName} + /// + /// + /// Operation Id + /// Machines_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// host name of the machine. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string machineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); + + using var scope = _machineClientDiagnostics.CreateScope("MachineCollection.Exists"); + scope.Start(); + try + { + var response = _machineRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, machineName, 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/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines/{machineName} + /// + /// + /// Operation Id + /// Machines_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// host name of the machine. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string machineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); + + using var scope = _machineClientDiagnostics.CreateScope("MachineCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _machineRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, machineName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MachineResource(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/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines/{machineName} + /// + /// + /// Operation Id + /// Machines_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// host name of the machine. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string machineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); + + using var scope = _machineClientDiagnostics.CreateScope("MachineCollection.GetIfExists"); + scope.Start(); + try + { + var response = _machineRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, machineName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MachineResource(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/OSOptionProfileData.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MachineData.Serialization.cs similarity index 64% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/OSOptionProfileData.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MachineData.Serialization.cs index ef9336d86d01..8fdfc7d45d92 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/OSOptionProfileData.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MachineData.Serialization.cs @@ -8,7 +8,6 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; -using System.Linq; using System.Text; using System.Text.Json; using Azure.Core; @@ -17,11 +16,11 @@ namespace Azure.ResourceManager.ContainerService { - public partial class OSOptionProfileData : IUtf8JsonSerializable, IJsonModel + public partial class MachineData : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -32,38 +31,33 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(OSOptionProfileData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(MachineData)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - writer.WritePropertyName("osOptionPropertyList"u8); - writer.WriteStartArray(); - foreach (var item in OSOptionPropertyList) + if (options.Format != "W" && Optional.IsDefined(Properties)) { - writer.WriteObjectValue(item, options); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); } - writer.WriteEndArray(); - writer.WriteEndObject(); } - OSOptionProfileData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + MachineData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(OSOptionProfileData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(MachineData)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeOSOptionProfileData(document.RootElement, options); + return DeserializeMachineData(document.RootElement, options); } - internal static OSOptionProfileData DeserializeOSOptionProfileData(JsonElement element, ModelReaderWriterOptions options = null) + internal static MachineData DeserializeMachineData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -71,15 +65,24 @@ internal static OSOptionProfileData DeserializeOSOptionProfileData(JsonElement e { return null; } + MachineProperties properties = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; SystemData systemData = default; - IReadOnlyList osOptionPropertyList = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = MachineProperties.DeserializeMachineProperties(property.Value, options); + continue; + } if (property.NameEquals("id"u8)) { id = new ResourceIdentifier(property.Value.GetString()); @@ -104,40 +107,18 @@ internal static OSOptionProfileData DeserializeOSOptionProfileData(JsonElement e 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("osOptionPropertyList"u8)) - { - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(ContainerServiceOSOptionProperty.DeserializeContainerServiceOSOptionProperty(item, options)); - } - osOptionPropertyList = array; - continue; - } - } - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new OSOptionProfileData( + return new MachineData( id, name, type, systemData, - osOptionPropertyList, + properties, serializedAdditionalRawData); } @@ -175,69 +156,58 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Properties), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" id: "); + builder.Append(" properties: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsDefined(Id)) + if (Optional.IsDefined(Properties)) { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); + builder.Append(" properties: "); + BicepSerializationHelpers.AppendChildObject(builder, Properties, options, 2, false, " properties: "); } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" systemData: "); + builder.Append(" id: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsDefined(SystemData)) + if (Optional.IsDefined(Id)) { - builder.Append(" systemData: "); - builder.AppendLine($"'{SystemData.ToString()}'"); + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); } } - builder.Append(" properties:"); - builder.AppendLine(" {"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(OSOptionPropertyList), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" osOptionPropertyList: "); + builder.Append(" systemData: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsCollectionDefined(OSOptionPropertyList)) + if (Optional.IsDefined(SystemData)) { - if (OSOptionPropertyList.Any()) - { - builder.Append(" osOptionPropertyList: "); - builder.AppendLine("["); - foreach (var item in OSOptionPropertyList) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 6, true, " osOptionPropertyList: "); - } - builder.AppendLine(" ]"); - } + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); } } - builder.AppendLine(" }"); builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { @@ -246,26 +216,26 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions case "bicep": return SerializeBicep(options); default: - throw new FormatException($"The model {nameof(OSOptionProfileData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(MachineData)} does not support writing '{options.Format}' format."); } } - OSOptionProfileData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + MachineData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeOSOptionProfileData(document.RootElement, options); + return DeserializeMachineData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(OSOptionProfileData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(MachineData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/OSOptionProfileData.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MachineData.cs similarity index 57% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/OSOptionProfileData.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MachineData.cs index 5fd0ccff4ad6..e9e90ff8d6d6 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/OSOptionProfileData.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MachineData.cs @@ -7,7 +7,6 @@ using System; using System.Collections.Generic; -using System.Linq; using Azure.Core; using Azure.ResourceManager.ContainerService.Models; using Azure.ResourceManager.Models; @@ -15,10 +14,10 @@ namespace Azure.ResourceManager.ContainerService { /// - /// A class representing the OSOptionProfile data model. - /// The OS option profile. + /// A class representing the Machine data model. + /// A machine. Contains details about the underlying virtual machine. A machine may be visible here but not in kubectl get nodes; if so it may be because the machine has not been registered with the Kubernetes API Server yet. /// - public partial class OSOptionProfileData : ResourceData + public partial class MachineData : ResourceData { /// /// Keeps track of any properties unknown to the library. @@ -52,36 +51,26 @@ public partial class OSOptionProfileData : ResourceData /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The list of OS options. - /// is null. - internal OSOptionProfileData(IEnumerable osOptionPropertyList) + /// Initializes a new instance of . + public MachineData() { - Argument.AssertNotNull(osOptionPropertyList, nameof(osOptionPropertyList)); - - OSOptionPropertyList = osOptionPropertyList.ToList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. - /// The list of OS options. + /// The properties of the machine. /// Keeps track of any properties unknown to the library. - internal OSOptionProfileData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IReadOnlyList osOptionPropertyList, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal MachineData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, MachineProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { - OSOptionPropertyList = osOptionPropertyList; + Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal OSOptionProfileData() - { - } - - /// The list of OS options. - [WirePath("properties.osOptionPropertyList")] - public IReadOnlyList OSOptionPropertyList { get; } + /// The properties of the machine. + [WirePath("properties")] + public MachineProperties Properties { get; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MachineResource.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MachineResource.Serialization.cs new file mode 100644 index 000000000000..8291bcab5f64 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MachineResource.Serialization.cs @@ -0,0 +1,26 @@ +// 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 MachineResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + MachineData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerContainerServiceContext.Default); + + MachineData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerContainerServiceContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/OSOptionProfileResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MachineResource.cs similarity index 51% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/OSOptionProfileResource.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MachineResource.cs index bd4c8e6a8bb9..0428d31a130f 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/OSOptionProfileResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MachineResource.cs @@ -11,56 +11,58 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Core.Pipeline; -using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.ContainerService { /// - /// A Class representing an OSOptionProfile 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 GetOSOptionProfileResource method. - /// Otherwise you can get one from its parent resource using the GetOSOptionProfile method. + /// A Class representing a Machine along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetMachineResource method. + /// Otherwise you can get one from its parent resource using the GetMachine method. /// - public partial class OSOptionProfileResource : ArmResource + public partial class MachineResource : ArmResource { - /// Generate the resource identifier of a instance. + /// Generate the resource identifier of a instance. /// The subscriptionId. - /// The location. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, AzureLocation location) + /// The resourceGroupName. + /// The resourceName. + /// The agentPoolName. + /// The machineName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, string machineName) { - var resourceId = $"/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default"; + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines/{machineName}"; return new ResourceIdentifier(resourceId); } - private readonly ClientDiagnostics _osOptionProfileManagedClustersClientDiagnostics; - private readonly ManagedClustersRestOperations _osOptionProfileManagedClustersRestClient; - private readonly OSOptionProfileData _data; + private readonly ClientDiagnostics _machineClientDiagnostics; + private readonly MachinesRestOperations _machineRestClient; + private readonly MachineData _data; /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.ContainerService/locations/osOptions"; + public static readonly ResourceType ResourceType = "Microsoft.ContainerService/managedClusters/agentPools/machines"; - /// Initializes a new instance of the class for mocking. - protected OSOptionProfileResource() + /// Initializes a new instance of the class for mocking. + protected MachineResource() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The resource that is the target of operations. - internal OSOptionProfileResource(ArmClient client, OSOptionProfileData data) : this(client, data.Id) + internal MachineResource(ArmClient client, MachineData data) : this(client, data.Id) { HasData = true; _data = data; } - /// Initializes a new instance of the class. + /// 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 OSOptionProfileResource(ArmClient client, ResourceIdentifier id) : base(client, id) + internal MachineResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _osOptionProfileManagedClustersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string osOptionProfileManagedClustersApiVersion); - _osOptionProfileManagedClustersRestClient = new ManagedClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, osOptionProfileManagedClustersApiVersion); + _machineClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string machineApiVersion); + _machineRestClient = new MachinesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, machineApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -71,7 +73,7 @@ internal OSOptionProfileResource(ArmClient client, ResourceIdentifier id) : base /// Gets the data representing this Feature. /// Throws if there is no data loaded in the current instance. - public virtual OSOptionProfileData Data + public virtual MachineData Data { get { @@ -88,38 +90,37 @@ internal static void ValidateResourceId(ResourceIdentifier id) } /// - /// Gets supported OS options in the specified subscription. + /// Get a specific machine in the specified agent pool. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines/{machineName} /// /// /// Operation Id - /// ManagedClusters_GetOSOptions + /// Machines_Get /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource - /// + /// /// /// /// - /// The resource type for which the OS options needs to be returned. /// The cancellation token to use. - public virtual async Task> GetAsync(ResourceType? resourceType = null, CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _osOptionProfileManagedClustersClientDiagnostics.CreateScope("OSOptionProfileResource.Get"); + using var scope = _machineClientDiagnostics.CreateScope("MachineResource.Get"); scope.Start(); try { - var response = await _osOptionProfileManagedClustersRestClient.GetOSOptionsAsync(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), resourceType, cancellationToken).ConfigureAwait(false); + var response = await _machineRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new OSOptionProfileResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new MachineResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -129,38 +130,37 @@ public virtual async Task> GetAsync(ResourceTy } /// - /// Gets supported OS options in the specified subscription. + /// Get a specific machine in the specified agent pool. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines/{machineName} /// /// /// Operation Id - /// ManagedClusters_GetOSOptions + /// Machines_Get /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource - /// + /// /// /// /// - /// The resource type for which the OS options needs to be returned. /// The cancellation token to use. - public virtual Response Get(ResourceType? resourceType = null, CancellationToken cancellationToken = default) + public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _osOptionProfileManagedClustersClientDiagnostics.CreateScope("OSOptionProfileResource.Get"); + using var scope = _machineClientDiagnostics.CreateScope("MachineResource.Get"); scope.Start(); try { - var response = _osOptionProfileManagedClustersRestClient.GetOSOptions(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), resourceType, cancellationToken); + var response = _machineRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new OSOptionProfileResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new MachineResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ManagedClusterUpgradeProfileResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ManagedClusterUpgradeProfileResource.cs index ae15f4b29f21..2c0ced34d5c6 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ManagedClusterUpgradeProfileResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ManagedClusterUpgradeProfileResource.cs @@ -100,7 +100,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -140,7 +140,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshRevisionProfileCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshRevisionProfileCollection.cs index 73f52e619891..7e0df97edae1 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshRevisionProfileCollection.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshRevisionProfileCollection.cs @@ -68,7 +68,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -158,7 +158,7 @@ public virtual Response Get(string mode, Cancellati /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -188,7 +188,7 @@ public virtual AsyncPageable GetAllAsync(Cancellati /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -218,7 +218,7 @@ public virtual Pageable GetAll(CancellationToken ca /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -261,7 +261,7 @@ public virtual async Task> ExistsAsync(string mode, CancellationT /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -304,7 +304,7 @@ public virtual Response Exists(string mode, CancellationToken cancellation /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -349,7 +349,7 @@ public virtual async Task> GetIfEx /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshRevisionProfileResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshRevisionProfileResource.cs index 349a3898fb10..d77d4729e2e8 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshRevisionProfileResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshRevisionProfileResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsync(Cancel /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshUpgradeProfileCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshUpgradeProfileCollection.cs index c9c2c819a366..ed63108c7ab2 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshUpgradeProfileCollection.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshUpgradeProfileCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -109,7 +109,7 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -154,7 +154,7 @@ public virtual Response Get(string mode, Cancellatio /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual AsyncPageable GetAllAsync(Cancellatio /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -214,7 +214,7 @@ public virtual Pageable GetAll(CancellationToken can /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -257,7 +257,7 @@ public virtual async Task> ExistsAsync(string mode, CancellationT /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -300,7 +300,7 @@ public virtual Response Exists(string mode, CancellationToken cancellation /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -345,7 +345,7 @@ public virtual async Task> GetIfExi /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshUpgradeProfileResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshUpgradeProfileResource.cs index 84cce4083213..281f0b01666c 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshUpgradeProfileResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshUpgradeProfileResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsync(Cancell /// /// /// Default Api Version - /// 2023-10-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AdvancedNetworking.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AdvancedNetworking.Serialization.cs new file mode 100644 index 000000000000..3e93ea237e9c --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AdvancedNetworking.Serialization.cs @@ -0,0 +1,233 @@ +// 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; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerService.Models +{ + public partial class AdvancedNetworking : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AdvancedNetworking)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Enabled)) + { + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(Enabled.Value); + } + if (Optional.IsDefined(Observability)) + { + writer.WritePropertyName("observability"u8); + writer.WriteObjectValue(Observability, options); + } + if (Optional.IsDefined(Security)) + { + writer.WritePropertyName("security"u8); + writer.WriteObjectValue(Security, options); + } + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AdvancedNetworking 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(AdvancedNetworking)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAdvancedNetworking(document.RootElement, options); + } + + internal static AdvancedNetworking DeserializeAdvancedNetworking(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? enabled = default; + AdvancedNetworkingObservability observability = default; + AdvancedNetworkingSecurity security = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("observability"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + observability = AdvancedNetworkingObservability.DeserializeAdvancedNetworkingObservability(property.Value, options); + continue; + } + if (property.NameEquals("security"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + security = AdvancedNetworkingSecurity.DeserializeAdvancedNetworkingSecurity(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AdvancedNetworking(enabled, observability, security, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Enabled), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" enabled: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Enabled)) + { + builder.Append(" enabled: "); + var boolValue = Enabled.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("ObservabilityEnabled", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" observability: "); + builder.AppendLine("{"); + builder.Append(" enabled: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(Observability)) + { + builder.Append(" observability: "); + BicepSerializationHelpers.AppendChildObject(builder, Observability, options, 2, false, " observability: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("SecurityEnabled", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" security: "); + builder.AppendLine("{"); + builder.Append(" enabled: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(Security)) + { + builder.Append(" security: "); + BicepSerializationHelpers.AppendChildObject(builder, Security, options, 2, false, " security: "); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerContainerServiceContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(AdvancedNetworking)} does not support writing '{options.Format}' format."); + } + } + + AdvancedNetworking 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAdvancedNetworking(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AdvancedNetworking)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AdvancedNetworking.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AdvancedNetworking.cs new file mode 100644 index 000000000000..0b5ddf543d3b --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AdvancedNetworking.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerService.Models +{ + /// Advanced Networking profile for enabling observability and security feature suite on a cluster. For more information see aka.ms/aksadvancednetworking. + public partial class AdvancedNetworking + { + /// + /// 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 . + public AdvancedNetworking() + { + } + + /// Initializes a new instance of . + /// Indicates the enablement of Advanced Networking functionalities of observability and security on AKS clusters. When this is set to true, all observability and security features will be set to enabled unless explicitly disabled. If not specified, the default is false. + /// Observability profile to enable advanced network metrics and flow logs with historical contexts. + /// Security profile to enable security features on cilium based cluster. + /// Keeps track of any properties unknown to the library. + internal AdvancedNetworking(bool? enabled, AdvancedNetworkingObservability observability, AdvancedNetworkingSecurity security, IDictionary serializedAdditionalRawData) + { + Enabled = enabled; + Observability = observability; + Security = security; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Indicates the enablement of Advanced Networking functionalities of observability and security on AKS clusters. When this is set to true, all observability and security features will be set to enabled unless explicitly disabled. If not specified, the default is false. + [WirePath("enabled")] + public bool? Enabled { get; set; } + /// Observability profile to enable advanced network metrics and flow logs with historical contexts. + internal AdvancedNetworkingObservability Observability { get; set; } + /// Indicates the enablement of Advanced Networking observability functionalities on clusters. + [WirePath("observability.enabled")] + public bool? ObservabilityEnabled + { + get => Observability is null ? default : Observability.Enabled; + set + { + if (Observability is null) + Observability = new AdvancedNetworkingObservability(); + Observability.Enabled = value; + } + } + + /// Security profile to enable security features on cilium based cluster. + internal AdvancedNetworkingSecurity Security { get; set; } + /// This feature allows user to configure network policy based on DNS (FQDN) names. It can be enabled only on cilium based clusters. If not specified, the default is false. + [WirePath("security.enabled")] + public bool? SecurityEnabled + { + get => Security is null ? default : Security.Enabled; + set + { + if (Security is null) + Security = new AdvancedNetworkingSecurity(); + Security.Enabled = value; + } + } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AdvancedNetworkingObservability.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AdvancedNetworkingObservability.Serialization.cs new file mode 100644 index 000000000000..c6faa5790d17 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AdvancedNetworkingObservability.Serialization.cs @@ -0,0 +1,167 @@ +// 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; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerService.Models +{ + internal partial class AdvancedNetworkingObservability : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AdvancedNetworkingObservability)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Enabled)) + { + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(Enabled.Value); + } + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AdvancedNetworkingObservability 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(AdvancedNetworkingObservability)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAdvancedNetworkingObservability(document.RootElement, options); + } + + internal static AdvancedNetworkingObservability DeserializeAdvancedNetworkingObservability(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? enabled = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enabled = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AdvancedNetworkingObservability(enabled, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Enabled), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" enabled: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Enabled)) + { + builder.Append(" enabled: "); + var boolValue = Enabled.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerContainerServiceContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(AdvancedNetworkingObservability)} does not support writing '{options.Format}' format."); + } + } + + AdvancedNetworkingObservability 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAdvancedNetworkingObservability(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AdvancedNetworkingObservability)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AdvancedNetworkingObservability.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AdvancedNetworkingObservability.cs new file mode 100644 index 000000000000..0a21cd603df1 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AdvancedNetworkingObservability.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerService.Models +{ + /// Observability profile to enable advanced network metrics and flow logs with historical contexts. + internal partial class AdvancedNetworkingObservability + { + /// + /// 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 . + public AdvancedNetworkingObservability() + { + } + + /// Initializes a new instance of . + /// Indicates the enablement of Advanced Networking observability functionalities on clusters. + /// Keeps track of any properties unknown to the library. + internal AdvancedNetworkingObservability(bool? enabled, IDictionary serializedAdditionalRawData) + { + Enabled = enabled; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Indicates the enablement of Advanced Networking observability functionalities on clusters. + [WirePath("enabled")] + public bool? Enabled { get; set; } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AdvancedNetworkingSecurity.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AdvancedNetworkingSecurity.Serialization.cs new file mode 100644 index 000000000000..0ee52d324f16 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AdvancedNetworkingSecurity.Serialization.cs @@ -0,0 +1,167 @@ +// 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; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerService.Models +{ + internal partial class AdvancedNetworkingSecurity : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AdvancedNetworkingSecurity)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Enabled)) + { + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(Enabled.Value); + } + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AdvancedNetworkingSecurity 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(AdvancedNetworkingSecurity)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAdvancedNetworkingSecurity(document.RootElement, options); + } + + internal static AdvancedNetworkingSecurity DeserializeAdvancedNetworkingSecurity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? enabled = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enabled = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AdvancedNetworkingSecurity(enabled, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Enabled), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" enabled: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Enabled)) + { + builder.Append(" enabled: "); + var boolValue = Enabled.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerContainerServiceContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(AdvancedNetworkingSecurity)} does not support writing '{options.Format}' format."); + } + } + + AdvancedNetworkingSecurity 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAdvancedNetworkingSecurity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AdvancedNetworkingSecurity)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AdvancedNetworkingSecurity.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AdvancedNetworkingSecurity.cs new file mode 100644 index 000000000000..aba4e57922b4 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AdvancedNetworkingSecurity.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerService.Models +{ + /// Security profile to enable security features on cilium based cluster. + internal partial class AdvancedNetworkingSecurity + { + /// + /// 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 . + public AdvancedNetworkingSecurity() + { + } + + /// Initializes a new instance of . + /// This feature allows user to configure network policy based on DNS (FQDN) names. It can be enabled only on cilium based clusters. If not specified, the default is false. + /// Keeps track of any properties unknown to the library. + internal AdvancedNetworkingSecurity(bool? enabled, IDictionary serializedAdditionalRawData) + { + Enabled = enabled; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// This feature allows user to configure network policy based on DNS (FQDN) names. It can be enabled only on cilium based clusters. If not specified, the default is false. + [WirePath("enabled")] + public bool? Enabled { get; set; } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolDeleteMachinesParameter.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolDeleteMachinesParameter.Serialization.cs new file mode 100644 index 000000000000..92dcca838e79 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolDeleteMachinesParameter.Serialization.cs @@ -0,0 +1,136 @@ +// 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; + +namespace Azure.ResourceManager.ContainerService.Models +{ + public partial class AgentPoolDeleteMachinesParameter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AgentPoolDeleteMachinesParameter)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("machineNames"u8); + writer.WriteStartArray(); + foreach (var item in MachineNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AgentPoolDeleteMachinesParameter 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(AgentPoolDeleteMachinesParameter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAgentPoolDeleteMachinesParameter(document.RootElement, options); + } + + internal static AgentPoolDeleteMachinesParameter DeserializeAgentPoolDeleteMachinesParameter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList machineNames = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("machineNames"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + machineNames = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AgentPoolDeleteMachinesParameter(machineNames, 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, AzureResourceManagerContainerServiceContext.Default); + default: + throw new FormatException($"The model {nameof(AgentPoolDeleteMachinesParameter)} does not support writing '{options.Format}' format."); + } + } + + AgentPoolDeleteMachinesParameter 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAgentPoolDeleteMachinesParameter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AgentPoolDeleteMachinesParameter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSOptionProperty.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolDeleteMachinesParameter.cs similarity index 55% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSOptionProperty.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolDeleteMachinesParameter.cs index 38edc7fbc43c..8a2f8c563cac 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSOptionProperty.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolDeleteMachinesParameter.cs @@ -7,11 +7,12 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.ContainerService.Models { - /// OS option property. - public partial class ContainerServiceOSOptionProperty + /// Specifies a list of machine names from the agent pool to be deleted. + public partial class AgentPoolDeleteMachinesParameter { /// /// Keeps track of any properties unknown to the library. @@ -45,39 +46,32 @@ public partial class ContainerServiceOSOptionProperty /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The OS type. - /// Whether the image is FIPS-enabled. - /// is null. - internal ContainerServiceOSOptionProperty(string osType, bool enableFipsImage) + /// Initializes a new instance of . + /// The agent pool machine names. + /// is null. + public AgentPoolDeleteMachinesParameter(IEnumerable machineNames) { - Argument.AssertNotNull(osType, nameof(osType)); + Argument.AssertNotNull(machineNames, nameof(machineNames)); - OSType = osType; - EnableFipsImage = enableFipsImage; + MachineNames = machineNames.ToList(); } - /// Initializes a new instance of . - /// The OS type. - /// Whether the image is FIPS-enabled. + /// Initializes a new instance of . + /// The agent pool machine names. /// Keeps track of any properties unknown to the library. - internal ContainerServiceOSOptionProperty(string osType, bool enableFipsImage, IDictionary serializedAdditionalRawData) + internal AgentPoolDeleteMachinesParameter(IList machineNames, IDictionary serializedAdditionalRawData) { - OSType = osType; - EnableFipsImage = enableFipsImage; + MachineNames = machineNames; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal ContainerServiceOSOptionProperty() + /// Initializes a new instance of for deserialization. + internal AgentPoolDeleteMachinesParameter() { } - /// The OS type. - [WirePath("os-type")] - public string OSType { get; } - /// Whether the image is FIPS-enabled. - [WirePath("enable-fips-image")] - public bool EnableFipsImage { get; } + /// The agent pool machine names. + [WirePath("machineNames")] + public IList MachineNames { get; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolSecurityProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolSecurityProfile.Serialization.cs new file mode 100644 index 000000000000..3f61218edf5c --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolSecurityProfile.Serialization.cs @@ -0,0 +1,198 @@ +// 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; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerService.Models +{ + public partial class AgentPoolSecurityProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AgentPoolSecurityProfile)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(EnableVtpm)) + { + writer.WritePropertyName("enableVTPM"u8); + writer.WriteBooleanValue(EnableVtpm.Value); + } + if (Optional.IsDefined(EnableSecureBoot)) + { + writer.WritePropertyName("enableSecureBoot"u8); + writer.WriteBooleanValue(EnableSecureBoot.Value); + } + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AgentPoolSecurityProfile 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(AgentPoolSecurityProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAgentPoolSecurityProfile(document.RootElement, options); + } + + internal static AgentPoolSecurityProfile DeserializeAgentPoolSecurityProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? enableVTPM = default; + bool? enableSecureBoot = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enableVTPM"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableVTPM = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("enableSecureBoot"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableSecureBoot = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AgentPoolSecurityProfile(enableVTPM, enableSecureBoot, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnableVtpm), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" enableVTPM: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(EnableVtpm)) + { + builder.Append(" enableVTPM: "); + var boolValue = EnableVtpm.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnableSecureBoot), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" enableSecureBoot: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(EnableSecureBoot)) + { + builder.Append(" enableSecureBoot: "); + var boolValue = EnableSecureBoot.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerContainerServiceContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(AgentPoolSecurityProfile)} does not support writing '{options.Format}' format."); + } + } + + AgentPoolSecurityProfile 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAgentPoolSecurityProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AgentPoolSecurityProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolSecurityProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolSecurityProfile.cs new file mode 100644 index 000000000000..058d79bbaef3 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolSecurityProfile.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerService.Models +{ + /// The security settings of an agent pool. + public partial class AgentPoolSecurityProfile + { + /// + /// 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 . + public AgentPoolSecurityProfile() + { + } + + /// Initializes a new instance of . + /// vTPM is a Trusted Launch feature for configuring a dedicated secure vault for keys and measurements held locally on the node. For more details, see aka.ms/aks/trustedlaunch. If not specified, the default is false. + /// Secure Boot is a feature of Trusted Launch which ensures that only signed operating systems and drivers can boot. For more details, see aka.ms/aks/trustedlaunch. If not specified, the default is false. + /// Keeps track of any properties unknown to the library. + internal AgentPoolSecurityProfile(bool? enableVtpm, bool? enableSecureBoot, IDictionary serializedAdditionalRawData) + { + EnableVtpm = enableVtpm; + EnableSecureBoot = enableSecureBoot; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// vTPM is a Trusted Launch feature for configuring a dedicated secure vault for keys and measurements held locally on the node. For more details, see aka.ms/aks/trustedlaunch. If not specified, the default is false. + [WirePath("enableVTPM")] + public bool? EnableVtpm { get; set; } + /// Secure Boot is a feature of Trusted Launch which ensures that only signed operating systems and drivers can boot. For more details, see aka.ms/aks/trustedlaunch. If not specified, the default is false. + [WirePath("enableSecureBoot")] + public bool? EnableSecureBoot { get; set; } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolUpgradeSettings.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolUpgradeSettings.Serialization.cs index 9508f6f37e67..91b4212e2d54 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolUpgradeSettings.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolUpgradeSettings.Serialization.cs @@ -40,11 +40,26 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("maxSurge"u8); writer.WriteStringValue(MaxSurge); } + if (Optional.IsDefined(MaxUnavailable)) + { + writer.WritePropertyName("maxUnavailable"u8); + writer.WriteStringValue(MaxUnavailable); + } if (Optional.IsDefined(DrainTimeoutInMinutes)) { writer.WritePropertyName("drainTimeoutInMinutes"u8); writer.WriteNumberValue(DrainTimeoutInMinutes.Value); } + if (Optional.IsDefined(NodeSoakDurationInMinutes)) + { + writer.WritePropertyName("nodeSoakDurationInMinutes"u8); + writer.WriteNumberValue(NodeSoakDurationInMinutes.Value); + } + if (Optional.IsDefined(UndrainableNodeBehavior)) + { + writer.WritePropertyName("undrainableNodeBehavior"u8); + writer.WriteStringValue(UndrainableNodeBehavior.Value.ToString()); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -83,7 +98,10 @@ internal static AgentPoolUpgradeSettings DeserializeAgentPoolUpgradeSettings(Jso return null; } string maxSurge = default; + string maxUnavailable = default; int? drainTimeoutInMinutes = default; + int? nodeSoakDurationInMinutes = default; + UndrainableNodeBehavior? undrainableNodeBehavior = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -93,6 +111,11 @@ internal static AgentPoolUpgradeSettings DeserializeAgentPoolUpgradeSettings(Jso maxSurge = property.Value.GetString(); continue; } + if (property.NameEquals("maxUnavailable"u8)) + { + maxUnavailable = property.Value.GetString(); + continue; + } if (property.NameEquals("drainTimeoutInMinutes"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -102,13 +125,37 @@ internal static AgentPoolUpgradeSettings DeserializeAgentPoolUpgradeSettings(Jso drainTimeoutInMinutes = property.Value.GetInt32(); continue; } + if (property.NameEquals("nodeSoakDurationInMinutes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nodeSoakDurationInMinutes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("undrainableNodeBehavior"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + undrainableNodeBehavior = new UndrainableNodeBehavior(property.Value.GetString()); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new AgentPoolUpgradeSettings(maxSurge, drainTimeoutInMinutes, serializedAdditionalRawData); + return new AgentPoolUpgradeSettings( + maxSurge, + maxUnavailable, + drainTimeoutInMinutes, + nodeSoakDurationInMinutes, + undrainableNodeBehavior, + serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -145,6 +192,29 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MaxUnavailable), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" maxUnavailable: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(MaxUnavailable)) + { + builder.Append(" maxUnavailable: "); + if (MaxUnavailable.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{MaxUnavailable}'''"); + } + else + { + builder.AppendLine($"'{MaxUnavailable}'"); + } + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DrainTimeoutInMinutes), out propertyOverride); if (hasPropertyOverride) { @@ -160,6 +230,36 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NodeSoakDurationInMinutes), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nodeSoakDurationInMinutes: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NodeSoakDurationInMinutes)) + { + builder.Append(" nodeSoakDurationInMinutes: "); + builder.AppendLine($"{NodeSoakDurationInMinutes.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(UndrainableNodeBehavior), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" undrainableNodeBehavior: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(UndrainableNodeBehavior)) + { + builder.Append(" undrainableNodeBehavior: "); + builder.AppendLine($"'{UndrainableNodeBehavior.Value.ToString()}'"); + } + } + builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolUpgradeSettings.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolUpgradeSettings.cs index a57cb99ed6af..d7448d118885 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolUpgradeSettings.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolUpgradeSettings.cs @@ -51,21 +51,36 @@ public AgentPoolUpgradeSettings() } /// Initializes a new instance of . - /// This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified, the default is 1. For more information, including best practices, see: https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade. + /// This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified, the default is 10%. For more information, including best practices, see: https://learn.microsoft.com/en-us/azure/aks/upgrade-cluster. + /// This can either be set to an integer (e.g. '1') or a percentage (e.g. '5%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified, the default is 0. For more information, including best practices, see: https://learn.microsoft.com/en-us/azure/aks/upgrade-cluster. /// The amount of time (in minutes) to wait on eviction of pods and graceful termination per node. This eviction wait time honors waiting on pod disruption budgets. If this time is exceeded, the upgrade fails. If not specified, the default is 30 minutes. + /// The amount of time (in minutes) to wait after draining a node and before reimaging it and moving on to next node. If not specified, the default is 0 minutes. + /// Defines the behavior for undrainable nodes during upgrade. The most common cause of undrainable nodes is Pod Disruption Budgets (PDBs), but other issues, such as pod termination grace period is exceeding the remaining per-node drain timeout or pod is still being in a running state, can also cause undrainable nodes. /// Keeps track of any properties unknown to the library. - internal AgentPoolUpgradeSettings(string maxSurge, int? drainTimeoutInMinutes, IDictionary serializedAdditionalRawData) + internal AgentPoolUpgradeSettings(string maxSurge, string maxUnavailable, int? drainTimeoutInMinutes, int? nodeSoakDurationInMinutes, UndrainableNodeBehavior? undrainableNodeBehavior, IDictionary serializedAdditionalRawData) { MaxSurge = maxSurge; + MaxUnavailable = maxUnavailable; DrainTimeoutInMinutes = drainTimeoutInMinutes; + NodeSoakDurationInMinutes = nodeSoakDurationInMinutes; + UndrainableNodeBehavior = undrainableNodeBehavior; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified, the default is 1. For more information, including best practices, see: https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade. + /// This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified, the default is 10%. For more information, including best practices, see: https://learn.microsoft.com/en-us/azure/aks/upgrade-cluster. [WirePath("maxSurge")] public string MaxSurge { get; set; } + /// This can either be set to an integer (e.g. '1') or a percentage (e.g. '5%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified, the default is 0. For more information, including best practices, see: https://learn.microsoft.com/en-us/azure/aks/upgrade-cluster. + [WirePath("maxUnavailable")] + public string MaxUnavailable { get; set; } /// The amount of time (in minutes) to wait on eviction of pods and graceful termination per node. This eviction wait time honors waiting on pod disruption budgets. If this time is exceeded, the upgrade fails. If not specified, the default is 30 minutes. [WirePath("drainTimeoutInMinutes")] public int? DrainTimeoutInMinutes { get; set; } + /// The amount of time (in minutes) to wait after draining a node and before reimaging it and moving on to next node. If not specified, the default is 0 minutes. + [WirePath("nodeSoakDurationInMinutes")] + public int? NodeSoakDurationInMinutes { get; set; } + /// Defines the behavior for undrainable nodes during upgrade. The most common cause of undrainable nodes is Pod Disruption Budgets (PDBs), but other issues, such as pod termination grace period is exceeding the remaining per-node drain timeout or pod is still being in a running state, can also cause undrainable nodes. + [WirePath("undrainableNodeBehavior")] + public UndrainableNodeBehavior? UndrainableNodeBehavior { get; set; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolWindowsProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolWindowsProfile.Serialization.cs new file mode 100644 index 000000000000..d2fe5be4ffe4 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolWindowsProfile.Serialization.cs @@ -0,0 +1,167 @@ +// 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; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerService.Models +{ + internal partial class AgentPoolWindowsProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AgentPoolWindowsProfile)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(DisableOutboundNat)) + { + writer.WritePropertyName("disableOutboundNat"u8); + writer.WriteBooleanValue(DisableOutboundNat.Value); + } + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AgentPoolWindowsProfile 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(AgentPoolWindowsProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAgentPoolWindowsProfile(document.RootElement, options); + } + + internal static AgentPoolWindowsProfile DeserializeAgentPoolWindowsProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? disableOutboundNat = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("disableOutboundNat"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + disableOutboundNat = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AgentPoolWindowsProfile(disableOutboundNat, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DisableOutboundNat), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" disableOutboundNat: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DisableOutboundNat)) + { + builder.Append(" disableOutboundNat: "); + var boolValue = DisableOutboundNat.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerContainerServiceContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(AgentPoolWindowsProfile)} does not support writing '{options.Format}' format."); + } + } + + AgentPoolWindowsProfile 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAgentPoolWindowsProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AgentPoolWindowsProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolWindowsProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolWindowsProfile.cs new file mode 100644 index 000000000000..f22bc75ada64 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolWindowsProfile.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerService.Models +{ + /// The Windows agent pool's specific profile. + internal partial class AgentPoolWindowsProfile + { + /// + /// 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 . + public AgentPoolWindowsProfile() + { + } + + /// Initializes a new instance of . + /// The default value is false. Outbound NAT can only be disabled if the cluster outboundType is NAT Gateway and the Windows agent pool does not have node public IP enabled. + /// Keeps track of any properties unknown to the library. + internal AgentPoolWindowsProfile(bool? disableOutboundNat, IDictionary serializedAdditionalRawData) + { + DisableOutboundNat = disableOutboundNat; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The default value is false. Outbound NAT can only be disabled if the cluster outboundType is NAT Gateway and the Windows agent pool does not have node public IP enabled. + [WirePath("disableOutboundNat")] + public bool? DisableOutboundNat { get; set; } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ArtifactSource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ArtifactSource.cs new file mode 100644 index 000000000000..5b31f994f257 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ArtifactSource.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerService.Models +{ + /// The source where the artifacts are downloaded from. + public readonly partial struct ArtifactSource : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ArtifactSource(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CacheValue = "Cache"; + private const string DirectValue = "Direct"; + + /// pull images from Azure Container Registry with cache. + public static ArtifactSource Cache { get; } = new ArtifactSource(CacheValue); + /// pull images from Microsoft Artifact Registry. + public static ArtifactSource Direct { get; } = new ArtifactSource(DirectValue); + /// Determines if two values are the same. + public static bool operator ==(ArtifactSource left, ArtifactSource right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ArtifactSource left, ArtifactSource right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ArtifactSource(string value) => new ArtifactSource(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ArtifactSource other && Equals(other); + /// + public bool Equals(ArtifactSource other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkPolicy.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkPolicy.cs index 1c5d4ee4d4a2..def12ed901ee 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkPolicy.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkPolicy.cs @@ -22,10 +22,13 @@ public ContainerServiceNetworkPolicy(string value) _value = value ?? throw new ArgumentNullException(nameof(value)); } + private const string NoneValue = "none"; private const string CalicoValue = "calico"; private const string AzureValue = "azure"; private const string CiliumValue = "cilium"; + /// Network policies will not be enforced. This is the default value when NetworkPolicy is not specified. + public static ContainerServiceNetworkPolicy None { get; } = new ContainerServiceNetworkPolicy(NoneValue); /// Use Calico network policies. See [differences between Azure and Calico policies](https://docs.microsoft.com/azure/aks/use-network-policies#differences-between-azure-and-calico-policies-and-their-capabilities) for more information. public static ContainerServiceNetworkPolicy Calico { get; } = new ContainerServiceNetworkPolicy(CalicoValue); /// Use Azure network policies. See [differences between Azure and Calico policies](https://docs.microsoft.com/azure/aks/use-network-policies#differences-between-azure-and-calico-policies-and-their-capabilities) for more information. diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkProfile.Serialization.cs index 5016bd3509ad..e93b2719e6eb 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkProfile.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkProfile.Serialization.cs @@ -61,6 +61,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("networkDataplane"u8); writer.WriteStringValue(NetworkDataplane.Value.ToString()); } + if (Optional.IsDefined(AdvancedNetworking)) + { + writer.WritePropertyName("advancedNetworking"u8); + writer.WriteObjectValue(AdvancedNetworking, options); + } if (Optional.IsDefined(PodCidr)) { writer.WritePropertyName("podCidr"u8); @@ -168,6 +173,7 @@ internal static ContainerServiceNetworkProfile DeserializeContainerServiceNetwor ContainerServiceNetworkPolicy? networkPolicy = default; ContainerServiceNetworkMode? networkMode = default; NetworkDataplane? networkDataplane = default; + AdvancedNetworking advancedNetworking = default; string podCidr = default; string serviceCidr = default; string dnsServiceIP = default; @@ -227,6 +233,15 @@ internal static ContainerServiceNetworkProfile DeserializeContainerServiceNetwor networkDataplane = new NetworkDataplane(property.Value.GetString()); continue; } + if (property.NameEquals("advancedNetworking"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + advancedNetworking = AdvancedNetworking.DeserializeAdvancedNetworking(property.Value, options); + continue; + } if (property.NameEquals("podCidr"u8)) { podCidr = property.Value.GetString(); @@ -332,6 +347,7 @@ internal static ContainerServiceNetworkProfile DeserializeContainerServiceNetwor networkPolicy, networkMode, networkDataplane, + advancedNetworking, podCidr, serviceCidr, dnsServiceIP, @@ -431,6 +447,21 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AdvancedNetworking), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" advancedNetworking: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(AdvancedNetworking)) + { + builder.Append(" advancedNetworking: "); + BicepSerializationHelpers.AppendChildObject(builder, AdvancedNetworking, options, 2, false, " advancedNetworking: "); + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PodCidr), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkProfile.cs index 81d5eb5c1e36..ca25b5e02ba0 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkProfile.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkProfile.cs @@ -59,6 +59,7 @@ public ContainerServiceNetworkProfile() /// Network policy used for building the Kubernetes network. /// This cannot be specified if networkPlugin is anything other than 'azure'. /// Network dataplane used in the Kubernetes cluster. + /// Advanced Networking profile for enabling observability and security feature suite on a cluster. For more information see aka.ms/aksadvancednetworking. /// A CIDR notation IP range from which to assign pod IPs when kubenet is used. /// A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. /// An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr. @@ -70,13 +71,14 @@ public ContainerServiceNetworkProfile() /// One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking. They must not overlap with any Subnet IP ranges. /// IP families are used to determine single-stack or dual-stack clusters. For single-stack, the expected value is IPv4. For dual-stack, the expected values are IPv4 and IPv6. /// Keeps track of any properties unknown to the library. - internal ContainerServiceNetworkProfile(ContainerServiceNetworkPlugin? networkPlugin, ContainerServiceNetworkPluginMode? networkPluginMode, ContainerServiceNetworkPolicy? networkPolicy, ContainerServiceNetworkMode? networkMode, NetworkDataplane? networkDataplane, string podCidr, string serviceCidr, string dnsServiceIP, ContainerServiceOutboundType? outboundType, ContainerServiceLoadBalancerSku? loadBalancerSku, ManagedClusterLoadBalancerProfile loadBalancerProfile, ManagedClusterNatGatewayProfile natGatewayProfile, IList podCidrs, IList serviceCidrs, IList ipFamilies, IDictionary serializedAdditionalRawData) + internal ContainerServiceNetworkProfile(ContainerServiceNetworkPlugin? networkPlugin, ContainerServiceNetworkPluginMode? networkPluginMode, ContainerServiceNetworkPolicy? networkPolicy, ContainerServiceNetworkMode? networkMode, NetworkDataplane? networkDataplane, AdvancedNetworking advancedNetworking, string podCidr, string serviceCidr, string dnsServiceIP, ContainerServiceOutboundType? outboundType, ContainerServiceLoadBalancerSku? loadBalancerSku, ManagedClusterLoadBalancerProfile loadBalancerProfile, ManagedClusterNatGatewayProfile natGatewayProfile, IList podCidrs, IList serviceCidrs, IList ipFamilies, IDictionary serializedAdditionalRawData) { NetworkPlugin = networkPlugin; NetworkPluginMode = networkPluginMode; NetworkPolicy = networkPolicy; NetworkMode = networkMode; NetworkDataplane = networkDataplane; + AdvancedNetworking = advancedNetworking; PodCidr = podCidr; ServiceCidr = serviceCidr; DnsServiceIP = dnsServiceIP; @@ -105,6 +107,9 @@ internal ContainerServiceNetworkProfile(ContainerServiceNetworkPlugin? networkPl /// Network dataplane used in the Kubernetes cluster. [WirePath("networkDataplane")] public NetworkDataplane? NetworkDataplane { get; set; } + /// Advanced Networking profile for enabling observability and security feature suite on a cluster. For more information see aka.ms/aksadvancednetworking. + [WirePath("advancedNetworking")] + public AdvancedNetworking AdvancedNetworking { get; set; } /// A CIDR notation IP range from which to assign pod IPs when kubenet is used. [WirePath("podCidr")] public string PodCidr { get; set; } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSSku.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSSku.cs index 81fcdb956927..88e63e201b63 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSSku.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSSku.cs @@ -27,6 +27,7 @@ public ContainerServiceOSSku(string value) private const string CblMarinerValue = "CBLMariner"; private const string Windows2019Value = "Windows2019"; private const string Windows2022Value = "Windows2022"; + private const string Ubuntu2204Value = "Ubuntu2204"; /// Use Ubuntu as the OS for node images. public static ContainerServiceOSSku Ubuntu { get; } = new ContainerServiceOSSku(UbuntuValue); @@ -38,6 +39,8 @@ public ContainerServiceOSSku(string value) public static ContainerServiceOSSku Windows2019 { get; } = new ContainerServiceOSSku(Windows2019Value); /// Use Windows2022 as the OS for node images. Unsupported for system node pools. Windows2022 only supports Windows2022 containers; it cannot run Windows2019 containers and vice versa. public static ContainerServiceOSSku Windows2022 { get; } = new ContainerServiceOSSku(Windows2022Value); + /// Use Ubuntu2204 as the OS for node images, however, Ubuntu 22.04 may not be supported for all nodepools. For limitations and supported kubernetes versions, see see https://aka.ms/aks/supported-ubuntu-versions. + public static ContainerServiceOSSku Ubuntu2204 { get; } = new ContainerServiceOSSku(Ubuntu2204Value); /// Determines if two values are the same. public static bool operator ==(ContainerServiceOSSku left, ContainerServiceOSSku right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOutboundType.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOutboundType.cs index 83a57bc5aa79..a606c6aa7f91 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOutboundType.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOutboundType.cs @@ -26,6 +26,7 @@ public ContainerServiceOutboundType(string value) private const string UserDefinedRoutingValue = "userDefinedRouting"; private const string ManagedNatGatewayValue = "managedNATGateway"; private const string UserAssignedNatGatewayValue = "userAssignedNATGateway"; + private const string NoneValue = "none"; /// The load balancer is used for egress through an AKS assigned public IP. This supports Kubernetes services of type 'loadBalancer'. For more information see [outbound type loadbalancer](https://docs.microsoft.com/azure/aks/egress-outboundtype#outbound-type-of-loadbalancer). public static ContainerServiceOutboundType LoadBalancer { get; } = new ContainerServiceOutboundType(LoadBalancerValue); @@ -35,6 +36,8 @@ public ContainerServiceOutboundType(string value) public static ContainerServiceOutboundType ManagedNatGateway { get; } = new ContainerServiceOutboundType(ManagedNatGatewayValue); /// The user-assigned NAT gateway associated to the cluster subnet is used for egress. This is an advanced scenario and requires proper network configuration. public static ContainerServiceOutboundType UserAssignedNatGateway { get; } = new ContainerServiceOutboundType(UserAssignedNatGatewayValue); + /// The AKS cluster is not set with any outbound-type. All AKS nodes follows Azure VM default outbound behavior. Please refer to https://azure.microsoft.com/en-us/updates/default-outbound-access-for-vms-in-azure-will-be-retired-transition-to-a-new-method-of-internet-access/. + public static ContainerServiceOutboundType None { get; } = new ContainerServiceOutboundType(NoneValue); /// Determines if two values are the same. public static bool operator ==(ContainerServiceOutboundType left, ContainerServiceOutboundType right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/GpuDriver.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/GpuDriver.cs new file mode 100644 index 000000000000..6a93ccd8a853 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/GpuDriver.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerService.Models +{ + /// Whether to install GPU drivers. When it's not specified, default is Install. + public readonly partial struct GpuDriver : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public GpuDriver(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string InstallValue = "Install"; + private const string NoneValue = "None"; + + /// Install driver. + public static GpuDriver Install { get; } = new GpuDriver(InstallValue); + /// Skip driver install. + public static GpuDriver None { get; } = new GpuDriver(NoneValue); + /// Determines if two values are the same. + public static bool operator ==(GpuDriver left, GpuDriver right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(GpuDriver left, GpuDriver right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator GpuDriver(string value) => new GpuDriver(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is GpuDriver other && Equals(other); + /// + public bool Equals(GpuDriver other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/GpuProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/GpuProfile.Serialization.cs new file mode 100644 index 000000000000..7791b73f74f6 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/GpuProfile.Serialization.cs @@ -0,0 +1,166 @@ +// 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; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerService.Models +{ + internal partial class GpuProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GpuProfile)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Driver)) + { + writer.WritePropertyName("driver"u8); + writer.WriteStringValue(Driver.Value.ToString()); + } + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + GpuProfile 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(GpuProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGpuProfile(document.RootElement, options); + } + + internal static GpuProfile DeserializeGpuProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + GpuDriver? driver = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("driver"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + driver = new GpuDriver(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GpuProfile(driver, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Driver), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" driver: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Driver)) + { + builder.Append(" driver: "); + builder.AppendLine($"'{Driver.Value.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerContainerServiceContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(GpuProfile)} does not support writing '{options.Format}' format."); + } + } + + GpuProfile 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeGpuProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GpuProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/GpuProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/GpuProfile.cs new file mode 100644 index 000000000000..34bfdd1823c8 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/GpuProfile.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerService.Models +{ + /// GPU settings for the Agent Pool. + internal partial class GpuProfile + { + /// + /// 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 . + public GpuProfile() + { + } + + /// Initializes a new instance of . + /// Whether to install GPU drivers. When it's not specified, default is Install. + /// Keeps track of any properties unknown to the library. + internal GpuProfile(GpuDriver? driver, IDictionary serializedAdditionalRawData) + { + Driver = driver; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Whether to install GPU drivers. When it's not specified, default is Install. + [WirePath("driver")] + public GpuDriver? Driver { get; set; } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioEgressGateway.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioEgressGateway.Serialization.cs index f49a9ad2c872..dcf96e6b9899 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioEgressGateway.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioEgressGateway.Serialization.cs @@ -8,7 +8,6 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; -using System.Linq; using System.Text; using System.Text.Json; using Azure.Core; @@ -38,17 +37,6 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("enabled"u8); writer.WriteBooleanValue(IsEnabled); - if (Optional.IsCollectionDefined(NodeSelector)) - { - writer.WritePropertyName("nodeSelector"u8); - writer.WriteStartObject(); - foreach (var item in NodeSelector) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -87,7 +75,6 @@ internal static IstioEgressGateway DeserializeIstioEgressGateway(JsonElement ele return null; } bool enabled = default; - IDictionary nodeSelector = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -97,27 +84,13 @@ internal static IstioEgressGateway DeserializeIstioEgressGateway(JsonElement ele enabled = property.Value.GetBoolean(); continue; } - if (property.NameEquals("nodeSelector"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - nodeSelector = dictionary; - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new IstioEgressGateway(enabled, nodeSelector ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); + return new IstioEgressGateway(enabled, serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -144,43 +117,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) builder.AppendLine($"{boolValue}"); } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NodeSelector), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" nodeSelector: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(NodeSelector)) - { - if (NodeSelector.Any()) - { - builder.Append(" nodeSelector: "); - builder.AppendLine("{"); - foreach (var item in NodeSelector) - { - builder.Append($" '{item.Key}': "); - if (item.Value == null) - { - builder.Append("null"); - continue; - } - if (item.Value.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{item.Value}'''"); - } - else - { - builder.AppendLine($"'{item.Value}'"); - } - } - builder.AppendLine(" }"); - } - } - } - builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioEgressGateway.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioEgressGateway.cs index c58b696e03c7..a432004c3b86 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioEgressGateway.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioEgressGateway.cs @@ -50,17 +50,14 @@ public partial class IstioEgressGateway public IstioEgressGateway(bool isEnabled) { IsEnabled = isEnabled; - NodeSelector = new ChangeTrackingDictionary(); } /// Initializes a new instance of . /// Whether to enable the egress gateway. - /// NodeSelector for scheduling the egress gateway. /// Keeps track of any properties unknown to the library. - internal IstioEgressGateway(bool isEnabled, IDictionary nodeSelector, IDictionary serializedAdditionalRawData) + internal IstioEgressGateway(bool isEnabled, IDictionary serializedAdditionalRawData) { IsEnabled = isEnabled; - NodeSelector = nodeSelector; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -72,8 +69,5 @@ internal IstioEgressGateway() /// Whether to enable the egress gateway. [WirePath("enabled")] public bool IsEnabled { get; set; } - /// NodeSelector for scheduling the egress gateway. - [WirePath("nodeSelector")] - public IDictionary NodeSelector { get; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersion.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersion.Serialization.cs index 1e4580dca767..8cef18920af5 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersion.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersion.Serialization.cs @@ -46,6 +46,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("capabilities"u8); writer.WriteObjectValue(Capabilities, options); } + if (Optional.IsDefined(IsDefault)) + { + writer.WritePropertyName("isDefault"u8); + writer.WriteBooleanValue(IsDefault.Value); + } if (Optional.IsDefined(IsPreview)) { writer.WritePropertyName("isPreview"u8); @@ -101,6 +106,7 @@ internal static KubernetesVersion DeserializeKubernetesVersion(JsonElement eleme } string version = default; KubernetesVersionCapabilities capabilities = default; + bool? isDefault = default; bool? isPreview = default; IReadOnlyDictionary patchVersions = default; IDictionary serializedAdditionalRawData = default; @@ -121,6 +127,15 @@ internal static KubernetesVersion DeserializeKubernetesVersion(JsonElement eleme capabilities = KubernetesVersionCapabilities.DeserializeKubernetesVersionCapabilities(property.Value, options); continue; } + if (property.NameEquals("isDefault"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isDefault = property.Value.GetBoolean(); + continue; + } if (property.NameEquals("isPreview"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -150,7 +165,13 @@ internal static KubernetesVersion DeserializeKubernetesVersion(JsonElement eleme } } serializedAdditionalRawData = rawDataDictionary; - return new KubernetesVersion(version, capabilities, isPreview, patchVersions ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); + return new KubernetesVersion( + version, + capabilities, + isDefault, + isPreview, + patchVersions ?? new ChangeTrackingDictionary(), + serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -205,6 +226,22 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IsDefault), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" isDefault: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(IsDefault)) + { + builder.Append(" isDefault: "); + var boolValue = IsDefault.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IsPreview), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersion.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersion.cs index 1eedcc878d7c..b7a4c82e4848 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersion.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersion.cs @@ -54,13 +54,15 @@ internal KubernetesVersion() /// Initializes a new instance of . /// major.minor version of Kubernetes release. /// Capabilities on this Kubernetes version. + /// Whether this version is default. /// Whether this version is in preview mode. /// Patch versions of Kubernetes release. /// Keeps track of any properties unknown to the library. - internal KubernetesVersion(string version, KubernetesVersionCapabilities capabilities, bool? isPreview, IReadOnlyDictionary patchVersions, IDictionary serializedAdditionalRawData) + internal KubernetesVersion(string version, KubernetesVersionCapabilities capabilities, bool? isDefault, bool? isPreview, IReadOnlyDictionary patchVersions, IDictionary serializedAdditionalRawData) { Version = version; Capabilities = capabilities; + IsDefault = isDefault; IsPreview = isPreview; PatchVersions = patchVersions; _serializedAdditionalRawData = serializedAdditionalRawData; @@ -78,6 +80,9 @@ public IReadOnlyList CapabilitiesSupportPlan get => Capabilities?.SupportPlan; } + /// Whether this version is default. + [WirePath("isDefault")] + public bool? IsDefault { get; } /// Whether this version is in preview mode. [WirePath("isPreview")] public bool? IsPreview { get; } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSOptionProperty.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineIPAddress.Serialization.cs similarity index 58% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSOptionProperty.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineIPAddress.Serialization.cs index 5217964bcc61..13fb167cd5c0 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSOptionProperty.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineIPAddress.Serialization.cs @@ -14,11 +14,11 @@ namespace Azure.ResourceManager.ContainerService.Models { - public partial class ContainerServiceOSOptionProperty : IUtf8JsonSerializable, IJsonModel + public partial class MachineIPAddress : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -29,16 +29,22 @@ void IJsonModel.Write(Utf8JsonWriter writer, M /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServiceOSOptionProperty)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(MachineIPAddress)} does not support writing '{format}' format."); } - writer.WritePropertyName("os-type"u8); - writer.WriteStringValue(OSType); - writer.WritePropertyName("enable-fips-image"u8); - writer.WriteBooleanValue(EnableFipsImage); + if (options.Format != "W" && Optional.IsDefined(Family)) + { + writer.WritePropertyName("family"u8); + writer.WriteStringValue(Family.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(IP)) + { + writer.WritePropertyName("ip"u8); + writer.WriteStringValue(IP); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -56,19 +62,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ContainerServiceOSOptionProperty IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + MachineIPAddress IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServiceOSOptionProperty)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(MachineIPAddress)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceOSOptionProperty(document.RootElement, options); + return DeserializeMachineIPAddress(document.RootElement, options); } - internal static ContainerServiceOSOptionProperty DeserializeContainerServiceOSOptionProperty(JsonElement element, ModelReaderWriterOptions options = null) + internal static MachineIPAddress DeserializeMachineIPAddress(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -76,20 +82,24 @@ internal static ContainerServiceOSOptionProperty DeserializeContainerServiceOSOp { return null; } - string osType = default; - bool enableFipsImage = default; + IPFamily? family = default; + string ip = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("os-type"u8)) + if (property.NameEquals("family"u8)) { - osType = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + family = new IPFamily(property.Value.GetString()); continue; } - if (property.NameEquals("enable-fips-image"u8)) + if (property.NameEquals("ip"u8)) { - enableFipsImage = property.Value.GetBoolean(); + ip = property.Value.GetString(); continue; } if (options.Format != "W") @@ -98,7 +108,7 @@ internal static ContainerServiceOSOptionProperty DeserializeContainerServiceOSOp } } serializedAdditionalRawData = rawDataDictionary; - return new ContainerServiceOSOptionProperty(osType, enableFipsImage, serializedAdditionalRawData); + return new MachineIPAddress(family, ip, serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -112,49 +122,51 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) builder.AppendLine("{"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(OSType), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Family), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" os-type: "); + builder.Append(" family: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsDefined(OSType)) + if (Optional.IsDefined(Family)) { - builder.Append(" os-type: "); - if (OSType.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{OSType}'''"); - } - else - { - builder.AppendLine($"'{OSType}'"); - } + builder.Append(" family: "); + builder.AppendLine($"'{Family.Value.ToString()}'"); } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnableFipsImage), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IP), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" enable-fips-image: "); + builder.Append(" ip: "); builder.AppendLine(propertyOverride); } else { - builder.Append(" enable-fips-image: "); - var boolValue = EnableFipsImage == true ? "true" : "false"; - builder.AppendLine($"{boolValue}"); + if (Optional.IsDefined(IP)) + { + builder.Append(" ip: "); + if (IP.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{IP}'''"); + } + else + { + builder.AppendLine($"'{IP}'"); + } + } } builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { @@ -163,26 +175,26 @@ BinaryData IPersistableModel.Write(ModelReader case "bicep": return SerializeBicep(options); default: - throw new FormatException($"The model {nameof(ContainerServiceOSOptionProperty)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(MachineIPAddress)} does not support writing '{options.Format}' format."); } } - ContainerServiceOSOptionProperty IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + MachineIPAddress IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeContainerServiceOSOptionProperty(document.RootElement, options); + return DeserializeMachineIPAddress(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ContainerServiceOSOptionProperty)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(MachineIPAddress)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineIPAddress.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineIPAddress.cs new file mode 100644 index 000000000000..a23d7fb7aa6a --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineIPAddress.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerService.Models +{ + /// The machine IP address details. + public partial class MachineIPAddress + { + /// + /// 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 . + internal MachineIPAddress() + { + } + + /// Initializes a new instance of . + /// To determine if address belongs IPv4 or IPv6 family. + /// IPv4 or IPv6 address of the machine. + /// Keeps track of any properties unknown to the library. + internal MachineIPAddress(IPFamily? family, string ip, IDictionary serializedAdditionalRawData) + { + Family = family; + IP = ip; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// To determine if address belongs IPv4 or IPv6 family. + [WirePath("family")] + public IPFamily? Family { get; } + /// IPv4 or IPv6 address of the machine. + [WirePath("ip")] + public string IP { get; } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineListResult.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineListResult.Serialization.cs new file mode 100644 index 000000000000..9677a019446c --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineListResult.Serialization.cs @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerService.Models +{ + internal partial class MachineListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MachineListResult)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + MachineListResult 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(MachineListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMachineListResult(document.RootElement, options); + } + + internal static MachineListResult DeserializeMachineListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Uri nextLink = default; + IReadOnlyList value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MachineData.DeserializeMachineData(item, options)); + } + value = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MachineListResult(nextLink, value ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + builder.AppendLine($"'{NextLink.AbsoluteUri}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerContainerServiceContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(MachineListResult)} does not support writing '{options.Format}' format."); + } + } + + MachineListResult 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeMachineListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MachineListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineListResult.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineListResult.cs new file mode 100644 index 000000000000..4f59799019c5 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineListResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerService.Models +{ + /// The response from the List Machines operation. + internal partial class MachineListResult + { + /// + /// 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 . + internal MachineListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The URL to get the next set of machine results. + /// The list of Machines in cluster. + /// Keeps track of any properties unknown to the library. + internal MachineListResult(Uri nextLink, IReadOnlyList value, IDictionary serializedAdditionalRawData) + { + NextLink = nextLink; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The URL to get the next set of machine results. + public Uri NextLink { get; } + /// The list of Machines in cluster. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineNetworkProperties.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineNetworkProperties.Serialization.cs new file mode 100644 index 000000000000..9c2ed42cb8b3 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineNetworkProperties.Serialization.cs @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerService.Models +{ + internal partial class MachineNetworkProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MachineNetworkProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsCollectionDefined(IPAddresses)) + { + writer.WritePropertyName("ipAddresses"u8); + writer.WriteStartArray(); + foreach (var item in IPAddresses) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + MachineNetworkProperties 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(MachineNetworkProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMachineNetworkProperties(document.RootElement, options); + } + + internal static MachineNetworkProperties DeserializeMachineNetworkProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList ipAddresses = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("ipAddresses"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MachineIPAddress.DeserializeMachineIPAddress(item, options)); + } + ipAddresses = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MachineNetworkProperties(ipAddresses ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IPAddresses), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" ipAddresses: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(IPAddresses)) + { + if (IPAddresses.Any()) + { + builder.Append(" ipAddresses: "); + builder.AppendLine("["); + foreach (var item in IPAddresses) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " ipAddresses: "); + } + builder.AppendLine(" ]"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerContainerServiceContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(MachineNetworkProperties)} does not support writing '{options.Format}' format."); + } + } + + MachineNetworkProperties 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeMachineNetworkProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MachineNetworkProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineNetworkProperties.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineNetworkProperties.cs new file mode 100644 index 000000000000..1e7ac382e543 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineNetworkProperties.cs @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerService.Models +{ + /// network properties of the machine. + internal partial class MachineNetworkProperties + { + /// + /// 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 . + internal MachineNetworkProperties() + { + IPAddresses = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// IPv4, IPv6 addresses of the machine. + /// Keeps track of any properties unknown to the library. + internal MachineNetworkProperties(IReadOnlyList ipAddresses, IDictionary serializedAdditionalRawData) + { + IPAddresses = ipAddresses; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// IPv4, IPv6 addresses of the machine. + [WirePath("ipAddresses")] + public IReadOnlyList IPAddresses { get; } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineProperties.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineProperties.Serialization.cs new file mode 100644 index 000000000000..121270a794d1 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineProperties.Serialization.cs @@ -0,0 +1,199 @@ +// 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; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerService.Models +{ + public partial class MachineProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MachineProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Network)) + { + writer.WritePropertyName("network"u8); + writer.WriteObjectValue(Network, options); + } + if (options.Format != "W" && Optional.IsDefined(ResourceId)) + { + writer.WritePropertyName("resourceId"u8); + writer.WriteStringValue(ResourceId); + } + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + MachineProperties 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(MachineProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMachineProperties(document.RootElement, options); + } + + internal static MachineProperties DeserializeMachineProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + MachineNetworkProperties network = default; + ResourceIdentifier resourceId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("network"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + network = MachineNetworkProperties.DeserializeMachineNetworkProperties(property.Value, options); + continue; + } + if (property.NameEquals("resourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MachineProperties(network, resourceId, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("NetworkIPAddresses", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" network: "); + builder.AppendLine("{"); + builder.Append(" ipAddresses: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(Network)) + { + builder.Append(" network: "); + BicepSerializationHelpers.AppendChildObject(builder, Network, options, 2, false, " network: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ResourceId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" resourceId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ResourceId)) + { + builder.Append(" resourceId: "); + builder.AppendLine($"'{ResourceId.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerContainerServiceContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(MachineProperties)} does not support writing '{options.Format}' format."); + } + } + + MachineProperties 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeMachineProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MachineProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineProperties.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineProperties.cs new file mode 100644 index 000000000000..2015203bd683 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineProperties.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerService.Models +{ + /// The properties of the machine. + public partial class MachineProperties + { + /// + /// 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 . + internal MachineProperties() + { + } + + /// Initializes a new instance of . + /// network properties of the machine. + /// Azure resource id of the machine. It can be used to GET underlying VM Instance. + /// Keeps track of any properties unknown to the library. + internal MachineProperties(MachineNetworkProperties network, ResourceIdentifier resourceId, IDictionary serializedAdditionalRawData) + { + Network = network; + ResourceId = resourceId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// network properties of the machine. + internal MachineNetworkProperties Network { get; } + /// IPv4, IPv6 addresses of the machine. + [WirePath("network.ipAddresses")] + public IReadOnlyList NetworkIPAddresses + { + get => Network?.IPAddresses; + } + + /// Azure resource id of the machine. It can be used to GET underlying VM Instance. + [WirePath("resourceId")] + public ResourceIdentifier ResourceId { get; } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.Serialization.cs index 9ef137951539..1f1f4393e061 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.Serialization.cs @@ -62,12 +62,14 @@ internal static ManagedClusterAgentPoolProfile DeserializeManagedClusterAgentPoo return null; } string name = default; + ETag? etag = default; int? count = default; string vmSize = default; int? osDiskSizeGB = default; ContainerServiceOSDiskType? osDiskType = default; KubeletDiskType? kubeletDiskType = default; WorkloadRuntime? workloadRuntime = default; + string messageOfTheDay = default; ResourceIdentifier vnetSubnetId = default; ResourceIdentifier podSubnetId = default; int? maxPods = default; @@ -105,6 +107,9 @@ internal static ManagedClusterAgentPoolProfile DeserializeManagedClusterAgentPoo ResourceIdentifier capacityReservationGroupId = default; ResourceIdentifier hostGroupId = default; AgentPoolNetworkProfile networkProfile = default; + AgentPoolWindowsProfile windowsProfile = default; + AgentPoolSecurityProfile securityProfile = default; + GpuProfile gpuProfile = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -114,6 +119,15 @@ internal static ManagedClusterAgentPoolProfile DeserializeManagedClusterAgentPoo name = property.Value.GetString(); continue; } + if (property.NameEquals("eTag"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + etag = new ETag(property.Value.GetString()); + continue; + } if (property.NameEquals("count"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -164,6 +178,11 @@ internal static ManagedClusterAgentPoolProfile DeserializeManagedClusterAgentPoo workloadRuntime = new WorkloadRuntime(property.Value.GetString()); continue; } + if (property.NameEquals("messageOfTheDay"u8)) + { + messageOfTheDay = property.Value.GetString(); + continue; + } if (property.NameEquals("vnetSubnetID"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -501,6 +520,33 @@ internal static ManagedClusterAgentPoolProfile DeserializeManagedClusterAgentPoo networkProfile = AgentPoolNetworkProfile.DeserializeAgentPoolNetworkProfile(property.Value, options); continue; } + if (property.NameEquals("windowsProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + windowsProfile = AgentPoolWindowsProfile.DeserializeAgentPoolWindowsProfile(property.Value, options); + continue; + } + if (property.NameEquals("securityProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + securityProfile = AgentPoolSecurityProfile.DeserializeAgentPoolSecurityProfile(property.Value, options); + continue; + } + if (property.NameEquals("gpuProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + gpuProfile = GpuProfile.DeserializeGpuProfile(property.Value, options); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -508,12 +554,14 @@ internal static ManagedClusterAgentPoolProfile DeserializeManagedClusterAgentPoo } serializedAdditionalRawData = rawDataDictionary; return new ManagedClusterAgentPoolProfile( + etag, count, vmSize, osDiskSizeGB, osDiskType, kubeletDiskType, workloadRuntime, + messageOfTheDay, vnetSubnetId, podSubnetId, maxPods, @@ -551,6 +599,9 @@ internal static ManagedClusterAgentPoolProfile DeserializeManagedClusterAgentPoo capacityReservationGroupId, hostGroupId, networkProfile, + windowsProfile, + securityProfile, + gpuProfile, serializedAdditionalRawData, name); } @@ -589,6 +640,21 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ETag), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" eTag: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ETag)) + { + builder.Append(" eTag: "); + builder.AppendLine($"'{ETag.Value.ToString()}'"); + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Count), out propertyOverride); if (hasPropertyOverride) { @@ -687,6 +753,29 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MessageOfTheDay), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" messageOfTheDay: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(MessageOfTheDay)) + { + builder.Append(" messageOfTheDay: "); + if (MessageOfTheDay.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{MessageOfTheDay}'''"); + } + else + { + builder.AppendLine($"'{MessageOfTheDay}'"); + } + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(VnetSubnetId), out propertyOverride); if (hasPropertyOverride) { @@ -1371,6 +1460,57 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("DisableOutboundNat", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" windowsProfile: "); + builder.AppendLine("{"); + builder.Append(" disableOutboundNat: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(WindowsProfile)) + { + builder.Append(" windowsProfile: "); + BicepSerializationHelpers.AppendChildObject(builder, WindowsProfile, options, 2, false, " windowsProfile: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SecurityProfile), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" securityProfile: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SecurityProfile)) + { + builder.Append(" securityProfile: "); + BicepSerializationHelpers.AppendChildObject(builder, SecurityProfile, options, 2, false, " securityProfile: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("GpuDriver", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" gpuProfile: "); + builder.AppendLine("{"); + builder.Append(" driver: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(GpuProfile)) + { + builder.Append(" gpuProfile: "); + BicepSerializationHelpers.AppendChildObject(builder, GpuProfile, options, 2, false, " gpuProfile: "); + } + } + builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.cs index 5814a5f2d5a7..73c343ca2d92 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.cs @@ -25,12 +25,14 @@ public ManagedClusterAgentPoolProfile(string name) } /// Initializes a new instance of . + /// Unique read-only string used to implement optimistic concurrency. The eTag value will change when the resource is updated. Specify an if-match or if-none-match header with the eTag value for a subsequent request to enable optimistic concurrency per the normal etag convention. /// 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. + /// A base64-encoded string which will be written to /etc/motd after decoding. This allows customization of the message of the day for Linux nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be printed raw and not be executed as a script). /// 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. @@ -68,9 +70,12 @@ public ManagedClusterAgentPoolProfile(string name) /// 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. + /// The Windows agent pool's specific profile. + /// The security settings of an agent pool. + /// GPU settings for the Agent Pool. /// Keeps track of any properties unknown to the library. /// Windows agent pool names must be 6 characters or less. - internal ManagedClusterAgentPoolProfile(int? count, string vmSize, int? osDiskSizeInGB, ContainerServiceOSDiskType? osDiskType, KubeletDiskType? kubeletDiskType, WorkloadRuntime? workloadRuntime, ResourceIdentifier vnetSubnetId, ResourceIdentifier podSubnetId, int? maxPods, ContainerServiceOSType? osType, ContainerServiceOSSku? osSku, int? maxCount, int? minCount, bool? enableAutoScaling, ScaleDownMode? scaleDownMode, AgentPoolType? agentPoolType, AgentPoolMode? mode, string orchestratorVersion, string currentOrchestratorVersion, string nodeImageVersion, AgentPoolUpgradeSettings upgradeSettings, string provisioningState, ContainerServicePowerState powerState, IList availabilityZones, bool? enableNodePublicIP, ResourceIdentifier nodePublicIPPrefixId, ScaleSetPriority? scaleSetPriority, ScaleSetEvictionPolicy? scaleSetEvictionPolicy, float? spotMaxPrice, IDictionary tags, IDictionary nodeLabels, IList nodeTaints, ResourceIdentifier proximityPlacementGroupId, KubeletConfig kubeletConfig, LinuxOSConfig linuxOSConfig, bool? enableEncryptionAtHost, bool? enableUltraSsd, bool? enableFips, GpuInstanceProfile? gpuInstanceProfile, ContainerServiceCreationData creationData, ResourceIdentifier capacityReservationGroupId, ResourceIdentifier hostGroupId, AgentPoolNetworkProfile networkProfile, IDictionary serializedAdditionalRawData, string name) : base(count, vmSize, osDiskSizeInGB, osDiskType, kubeletDiskType, workloadRuntime, vnetSubnetId, podSubnetId, maxPods, osType, osSku, maxCount, minCount, enableAutoScaling, scaleDownMode, agentPoolType, mode, orchestratorVersion, currentOrchestratorVersion, nodeImageVersion, upgradeSettings, provisioningState, powerState, availabilityZones, enableNodePublicIP, nodePublicIPPrefixId, scaleSetPriority, scaleSetEvictionPolicy, spotMaxPrice, tags, nodeLabels, nodeTaints, proximityPlacementGroupId, kubeletConfig, linuxOSConfig, enableEncryptionAtHost, enableUltraSsd, enableFips, gpuInstanceProfile, creationData, capacityReservationGroupId, hostGroupId, networkProfile, serializedAdditionalRawData) + internal ManagedClusterAgentPoolProfile(ETag? etag, int? count, string vmSize, int? osDiskSizeInGB, ContainerServiceOSDiskType? osDiskType, KubeletDiskType? kubeletDiskType, WorkloadRuntime? workloadRuntime, string messageOfTheDay, ResourceIdentifier vnetSubnetId, ResourceIdentifier podSubnetId, int? maxPods, ContainerServiceOSType? osType, ContainerServiceOSSku? osSku, int? maxCount, int? minCount, bool? enableAutoScaling, ScaleDownMode? scaleDownMode, AgentPoolType? agentPoolType, AgentPoolMode? mode, string orchestratorVersion, string currentOrchestratorVersion, string nodeImageVersion, AgentPoolUpgradeSettings upgradeSettings, string provisioningState, ContainerServicePowerState powerState, IList availabilityZones, bool? enableNodePublicIP, ResourceIdentifier nodePublicIPPrefixId, ScaleSetPriority? scaleSetPriority, ScaleSetEvictionPolicy? scaleSetEvictionPolicy, float? spotMaxPrice, IDictionary tags, IDictionary nodeLabels, IList nodeTaints, ResourceIdentifier proximityPlacementGroupId, KubeletConfig kubeletConfig, LinuxOSConfig linuxOSConfig, bool? enableEncryptionAtHost, bool? enableUltraSsd, bool? enableFips, GpuInstanceProfile? gpuInstanceProfile, ContainerServiceCreationData creationData, ResourceIdentifier capacityReservationGroupId, ResourceIdentifier hostGroupId, AgentPoolNetworkProfile networkProfile, AgentPoolWindowsProfile windowsProfile, AgentPoolSecurityProfile securityProfile, GpuProfile gpuProfile, IDictionary serializedAdditionalRawData, string name) : base(etag, count, vmSize, osDiskSizeInGB, osDiskType, kubeletDiskType, workloadRuntime, messageOfTheDay, vnetSubnetId, podSubnetId, maxPods, osType, osSku, maxCount, minCount, enableAutoScaling, scaleDownMode, agentPoolType, mode, orchestratorVersion, currentOrchestratorVersion, nodeImageVersion, upgradeSettings, provisioningState, powerState, availabilityZones, enableNodePublicIP, nodePublicIPPrefixId, scaleSetPriority, scaleSetEvictionPolicy, spotMaxPrice, tags, nodeLabels, nodeTaints, proximityPlacementGroupId, kubeletConfig, linuxOSConfig, enableEncryptionAtHost, enableUltraSsd, enableFips, gpuInstanceProfile, creationData, capacityReservationGroupId, hostGroupId, networkProfile, windowsProfile, securityProfile, gpuProfile, serializedAdditionalRawData) { Name = name; } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfileProperties.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfileProperties.Serialization.cs index 00ae20f86492..ffa7b03e32dd 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfileProperties.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfileProperties.Serialization.cs @@ -36,6 +36,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ManagedClusterAgentPoolProfileProperties)} does not support writing '{format}' format."); } + if (options.Format != "W" && Optional.IsDefined(ETag)) + { + writer.WritePropertyName("eTag"u8); + writer.WriteStringValue(ETag.Value.ToString()); + } if (Optional.IsDefined(Count)) { writer.WritePropertyName("count"u8); @@ -66,6 +71,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("workloadRuntime"u8); writer.WriteStringValue(WorkloadRuntime.Value.ToString()); } + if (Optional.IsDefined(MessageOfTheDay)) + { + writer.WritePropertyName("messageOfTheDay"u8); + writer.WriteStringValue(MessageOfTheDay); + } if (Optional.IsDefined(VnetSubnetId)) { writer.WritePropertyName("vnetSubnetID"u8); @@ -273,6 +283,21 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("networkProfile"u8); writer.WriteObjectValue(NetworkProfile, options); } + if (Optional.IsDefined(WindowsProfile)) + { + writer.WritePropertyName("windowsProfile"u8); + writer.WriteObjectValue(WindowsProfile, options); + } + if (Optional.IsDefined(SecurityProfile)) + { + writer.WritePropertyName("securityProfile"u8); + writer.WriteObjectValue(SecurityProfile, options); + } + if (Optional.IsDefined(GpuProfile)) + { + writer.WritePropertyName("gpuProfile"u8); + writer.WriteObjectValue(GpuProfile, options); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -310,12 +335,14 @@ internal static ManagedClusterAgentPoolProfileProperties DeserializeManagedClust { return null; } + ETag? etag = default; int? count = default; string vmSize = default; int? osDiskSizeGB = default; ContainerServiceOSDiskType? osDiskType = default; KubeletDiskType? kubeletDiskType = default; WorkloadRuntime? workloadRuntime = default; + string messageOfTheDay = default; ResourceIdentifier vnetSubnetId = default; ResourceIdentifier podSubnetId = default; int? maxPods = default; @@ -353,10 +380,22 @@ internal static ManagedClusterAgentPoolProfileProperties DeserializeManagedClust ResourceIdentifier capacityReservationGroupId = default; ResourceIdentifier hostGroupId = default; AgentPoolNetworkProfile networkProfile = default; + AgentPoolWindowsProfile windowsProfile = default; + AgentPoolSecurityProfile securityProfile = default; + GpuProfile gpuProfile = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("eTag"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + etag = new ETag(property.Value.GetString()); + continue; + } if (property.NameEquals("count"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -407,6 +446,11 @@ internal static ManagedClusterAgentPoolProfileProperties DeserializeManagedClust workloadRuntime = new WorkloadRuntime(property.Value.GetString()); continue; } + if (property.NameEquals("messageOfTheDay"u8)) + { + messageOfTheDay = property.Value.GetString(); + continue; + } if (property.NameEquals("vnetSubnetID"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -744,6 +788,33 @@ internal static ManagedClusterAgentPoolProfileProperties DeserializeManagedClust networkProfile = AgentPoolNetworkProfile.DeserializeAgentPoolNetworkProfile(property.Value, options); continue; } + if (property.NameEquals("windowsProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + windowsProfile = AgentPoolWindowsProfile.DeserializeAgentPoolWindowsProfile(property.Value, options); + continue; + } + if (property.NameEquals("securityProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + securityProfile = AgentPoolSecurityProfile.DeserializeAgentPoolSecurityProfile(property.Value, options); + continue; + } + if (property.NameEquals("gpuProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + gpuProfile = GpuProfile.DeserializeGpuProfile(property.Value, options); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -751,12 +822,14 @@ internal static ManagedClusterAgentPoolProfileProperties DeserializeManagedClust } serializedAdditionalRawData = rawDataDictionary; return new ManagedClusterAgentPoolProfileProperties( + etag, count, vmSize, osDiskSizeGB, osDiskType, kubeletDiskType, workloadRuntime, + messageOfTheDay, vnetSubnetId, podSubnetId, maxPods, @@ -794,6 +867,9 @@ internal static ManagedClusterAgentPoolProfileProperties DeserializeManagedClust capacityReservationGroupId, hostGroupId, networkProfile, + windowsProfile, + securityProfile, + gpuProfile, serializedAdditionalRawData); } @@ -808,6 +884,21 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) builder.AppendLine("{"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ETag), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" eTag: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ETag)) + { + builder.Append(" eTag: "); + builder.AppendLine($"'{ETag.Value.ToString()}'"); + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Count), out propertyOverride); if (hasPropertyOverride) { @@ -906,6 +997,29 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MessageOfTheDay), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" messageOfTheDay: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(MessageOfTheDay)) + { + builder.Append(" messageOfTheDay: "); + if (MessageOfTheDay.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{MessageOfTheDay}'''"); + } + else + { + builder.AppendLine($"'{MessageOfTheDay}'"); + } + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(VnetSubnetId), out propertyOverride); if (hasPropertyOverride) { @@ -1590,6 +1704,57 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("DisableOutboundNat", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" windowsProfile: "); + builder.AppendLine("{"); + builder.Append(" disableOutboundNat: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(WindowsProfile)) + { + builder.Append(" windowsProfile: "); + BicepSerializationHelpers.AppendChildObject(builder, WindowsProfile, options, 2, false, " windowsProfile: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SecurityProfile), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" securityProfile: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SecurityProfile)) + { + builder.Append(" securityProfile: "); + BicepSerializationHelpers.AppendChildObject(builder, SecurityProfile, options, 2, false, " securityProfile: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("GpuDriver", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" gpuProfile: "); + builder.AppendLine("{"); + builder.Append(" driver: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(GpuProfile)) + { + builder.Append(" gpuProfile: "); + BicepSerializationHelpers.AppendChildObject(builder, GpuProfile, options, 2, false, " gpuProfile: "); + } + } + builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfileProperties.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfileProperties.cs index b23edbb4a140..0902a8ae07fe 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfileProperties.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfileProperties.cs @@ -56,12 +56,14 @@ public ManagedClusterAgentPoolProfileProperties() } /// Initializes a new instance of . + /// Unique read-only string used to implement optimistic concurrency. The eTag value will change when the resource is updated. Specify an if-match or if-none-match header with the eTag value for a subsequent request to enable optimistic concurrency per the normal etag convention. /// 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. + /// A base64-encoded string which will be written to /etc/motd after decoding. This allows customization of the message of the day for Linux nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be printed raw and not be executed as a script). /// 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. @@ -99,15 +101,20 @@ public ManagedClusterAgentPoolProfileProperties() /// 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. + /// The Windows agent pool's specific profile. + /// The security settings of an agent pool. + /// GPU settings for the Agent Pool. /// Keeps track of any properties unknown to the library. - internal ManagedClusterAgentPoolProfileProperties(int? count, string vmSize, int? osDiskSizeInGB, ContainerServiceOSDiskType? osDiskType, KubeletDiskType? kubeletDiskType, WorkloadRuntime? workloadRuntime, ResourceIdentifier vnetSubnetId, ResourceIdentifier podSubnetId, int? maxPods, ContainerServiceOSType? osType, ContainerServiceOSSku? osSku, int? maxCount, int? minCount, bool? enableAutoScaling, ScaleDownMode? scaleDownMode, AgentPoolType? agentPoolType, AgentPoolMode? mode, string orchestratorVersion, string currentOrchestratorVersion, string nodeImageVersion, AgentPoolUpgradeSettings upgradeSettings, string provisioningState, ContainerServicePowerState powerState, IList availabilityZones, bool? enableNodePublicIP, ResourceIdentifier nodePublicIPPrefixId, ScaleSetPriority? scaleSetPriority, ScaleSetEvictionPolicy? scaleSetEvictionPolicy, float? spotMaxPrice, IDictionary tags, IDictionary nodeLabels, IList nodeTaints, ResourceIdentifier proximityPlacementGroupId, KubeletConfig kubeletConfig, LinuxOSConfig linuxOSConfig, bool? enableEncryptionAtHost, bool? enableUltraSsd, bool? enableFips, GpuInstanceProfile? gpuInstanceProfile, ContainerServiceCreationData creationData, ResourceIdentifier capacityReservationGroupId, ResourceIdentifier hostGroupId, AgentPoolNetworkProfile networkProfile, IDictionary serializedAdditionalRawData) + internal ManagedClusterAgentPoolProfileProperties(ETag? etag, int? count, string vmSize, int? osDiskSizeInGB, ContainerServiceOSDiskType? osDiskType, KubeletDiskType? kubeletDiskType, WorkloadRuntime? workloadRuntime, string messageOfTheDay, ResourceIdentifier vnetSubnetId, ResourceIdentifier podSubnetId, int? maxPods, ContainerServiceOSType? osType, ContainerServiceOSSku? osSku, int? maxCount, int? minCount, bool? enableAutoScaling, ScaleDownMode? scaleDownMode, AgentPoolType? agentPoolType, AgentPoolMode? mode, string orchestratorVersion, string currentOrchestratorVersion, string nodeImageVersion, AgentPoolUpgradeSettings upgradeSettings, string provisioningState, ContainerServicePowerState powerState, IList availabilityZones, bool? enableNodePublicIP, ResourceIdentifier nodePublicIPPrefixId, ScaleSetPriority? scaleSetPriority, ScaleSetEvictionPolicy? scaleSetEvictionPolicy, float? spotMaxPrice, IDictionary tags, IDictionary nodeLabels, IList nodeTaints, ResourceIdentifier proximityPlacementGroupId, KubeletConfig kubeletConfig, LinuxOSConfig linuxOSConfig, bool? enableEncryptionAtHost, bool? enableUltraSsd, bool? enableFips, GpuInstanceProfile? gpuInstanceProfile, ContainerServiceCreationData creationData, ResourceIdentifier capacityReservationGroupId, ResourceIdentifier hostGroupId, AgentPoolNetworkProfile networkProfile, AgentPoolWindowsProfile windowsProfile, AgentPoolSecurityProfile securityProfile, GpuProfile gpuProfile, IDictionary serializedAdditionalRawData) { + ETag = etag; Count = count; VmSize = vmSize; OSDiskSizeInGB = osDiskSizeInGB; OSDiskType = osDiskType; KubeletDiskType = kubeletDiskType; WorkloadRuntime = workloadRuntime; + MessageOfTheDay = messageOfTheDay; VnetSubnetId = vnetSubnetId; PodSubnetId = podSubnetId; MaxPods = maxPods; @@ -145,9 +152,15 @@ internal ManagedClusterAgentPoolProfileProperties(int? count, string vmSize, int CapacityReservationGroupId = capacityReservationGroupId; HostGroupId = hostGroupId; NetworkProfile = networkProfile; + WindowsProfile = windowsProfile; + SecurityProfile = securityProfile; + GpuProfile = gpuProfile; _serializedAdditionalRawData = serializedAdditionalRawData; } + /// Unique read-only string used to implement optimistic concurrency. The eTag value will change when the resource is updated. Specify an if-match or if-none-match header with the eTag value for a subsequent request to enable optimistic concurrency per the normal etag convention. + [WirePath("eTag")] + public ETag? ETag { get; } /// 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. [WirePath("count")] public int? Count { get; set; } @@ -166,6 +179,9 @@ internal ManagedClusterAgentPoolProfileProperties(int? count, string vmSize, int /// Determines the type of workload a node can run. [WirePath("workloadRuntime")] public WorkloadRuntime? WorkloadRuntime { get; set; } + /// A base64-encoded string which will be written to /etc/motd after decoding. This allows customization of the message of the day for Linux nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be printed raw and not be executed as a script). + [WirePath("messageOfTheDay")] + public string MessageOfTheDay { get; set; } /// 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}. [WirePath("vnetSubnetID")] public ResourceIdentifier VnetSubnetId { get; set; } @@ -301,5 +317,37 @@ public ResourceIdentifier CreationDataSourceResourceId /// Network-related settings of an agent pool. [WirePath("networkProfile")] public AgentPoolNetworkProfile NetworkProfile { get; set; } + /// The Windows agent pool's specific profile. + internal AgentPoolWindowsProfile WindowsProfile { get; set; } + /// The default value is false. Outbound NAT can only be disabled if the cluster outboundType is NAT Gateway and the Windows agent pool does not have node public IP enabled. + [WirePath("windowsProfile.disableOutboundNat")] + public bool? DisableOutboundNat + { + get => WindowsProfile is null ? default : WindowsProfile.DisableOutboundNat; + set + { + if (WindowsProfile is null) + WindowsProfile = new AgentPoolWindowsProfile(); + WindowsProfile.DisableOutboundNat = value; + } + } + + /// The security settings of an agent pool. + [WirePath("securityProfile")] + public AgentPoolSecurityProfile SecurityProfile { get; set; } + /// GPU settings for the Agent Pool. + internal GpuProfile GpuProfile { get; set; } + /// Whether to install GPU drivers. When it's not specified, default is Install. + [WirePath("gpuProfile.driver")] + public GpuDriver? GpuDriver + { + get => GpuProfile is null ? default : GpuProfile.Driver; + set + { + if (GpuProfile is null) + GpuProfile = new GpuProfile(); + GpuProfile.Driver = value; + } + } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterApiServerAccessProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterApiServerAccessProfile.Serialization.cs index f5345e1a664f..2de766179a4a 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterApiServerAccessProfile.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterApiServerAccessProfile.Serialization.cs @@ -66,6 +66,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("disableRunCommand"u8); writer.WriteBooleanValue(DisableRunCommand.Value); } + if (Optional.IsDefined(EnableVnetIntegration)) + { + writer.WritePropertyName("enableVnetIntegration"u8); + writer.WriteBooleanValue(EnableVnetIntegration.Value); + } + if (Optional.IsDefined(SubnetId)) + { + writer.WritePropertyName("subnetId"u8); + writer.WriteStringValue(SubnetId); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -108,6 +118,8 @@ internal static ManagedClusterApiServerAccessProfile DeserializeManagedClusterAp string privateDnsZone = default; bool? enablePrivateClusterPublicFQDN = default; bool? disableRunCommand = default; + bool? enableVnetIntegration = default; + ResourceIdentifier subnetId = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -158,6 +170,24 @@ internal static ManagedClusterApiServerAccessProfile DeserializeManagedClusterAp disableRunCommand = property.Value.GetBoolean(); continue; } + if (property.NameEquals("enableVnetIntegration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableVnetIntegration = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("subnetId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + subnetId = new ResourceIdentifier(property.Value.GetString()); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -170,6 +200,8 @@ internal static ManagedClusterApiServerAccessProfile DeserializeManagedClusterAp privateDnsZone, enablePrivateClusterPublicFQDN, disableRunCommand, + enableVnetIntegration, + subnetId, serializedAdditionalRawData); } @@ -291,6 +323,37 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnableVnetIntegration), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" enableVnetIntegration: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(EnableVnetIntegration)) + { + builder.Append(" enableVnetIntegration: "); + var boolValue = EnableVnetIntegration.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SubnetId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" subnetId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SubnetId)) + { + builder.Append(" subnetId: "); + builder.AppendLine($"'{SubnetId.ToString()}'"); + } + } + builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterApiServerAccessProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterApiServerAccessProfile.cs index 915054a6d67f..154f47beffa1 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterApiServerAccessProfile.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterApiServerAccessProfile.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using Azure.Core; namespace Azure.ResourceManager.ContainerService.Models { @@ -57,14 +58,18 @@ public ManagedClusterApiServerAccessProfile() /// The default is System. For more details see [configure private DNS zone](https://docs.microsoft.com/azure/aks/private-clusters#configure-private-dns-zone). Allowed values are 'system' and 'none'. /// Whether to create additional public FQDN for private cluster or not. /// Whether to disable run command for the cluster or not. + /// Whether to enable apiserver vnet integration for the cluster or not. See aka.ms/AksVnetIntegration for more details. + /// It is required when creating a new cluster with BYO Vnet, or when updating an existing cluster to enable apiserver vnet integration. /// Keeps track of any properties unknown to the library. - internal ManagedClusterApiServerAccessProfile(IList authorizedIPRanges, bool? enablePrivateCluster, string privateDnsZone, bool? enablePrivateClusterPublicFqdn, bool? disableRunCommand, IDictionary serializedAdditionalRawData) + internal ManagedClusterApiServerAccessProfile(IList authorizedIPRanges, bool? enablePrivateCluster, string privateDnsZone, bool? enablePrivateClusterPublicFqdn, bool? disableRunCommand, bool? enableVnetIntegration, ResourceIdentifier subnetId, IDictionary serializedAdditionalRawData) { AuthorizedIPRanges = authorizedIPRanges; EnablePrivateCluster = enablePrivateCluster; PrivateDnsZone = privateDnsZone; EnablePrivateClusterPublicFqdn = enablePrivateClusterPublicFqdn; DisableRunCommand = disableRunCommand; + EnableVnetIntegration = enableVnetIntegration; + SubnetId = subnetId; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -83,5 +88,11 @@ internal ManagedClusterApiServerAccessProfile(IList authorizedIPRanges, /// Whether to disable run command for the cluster or not. [WirePath("disableRunCommand")] public bool? DisableRunCommand { get; set; } + /// Whether to enable apiserver vnet integration for the cluster or not. See aka.ms/AksVnetIntegration for more details. + [WirePath("enableVnetIntegration")] + public bool? EnableVnetIntegration { get; set; } + /// It is required when creating a new cluster with BYO Vnet, or when updating an existing cluster to enable apiserver vnet integration. + [WirePath("subnetId")] + public ResourceIdentifier SubnetId { get; set; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAutoScalerProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAutoScalerProfile.Serialization.cs index adad6ccffd45..df75628f2f20 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAutoScalerProfile.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAutoScalerProfile.Serialization.cs @@ -40,6 +40,21 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("balance-similar-node-groups"u8); writer.WriteStringValue(BalanceSimilarNodeGroups); } + if (Optional.IsDefined(DaemonsetEvictionForEmptyNodes)) + { + writer.WritePropertyName("daemonset-eviction-for-empty-nodes"u8); + writer.WriteBooleanValue(DaemonsetEvictionForEmptyNodes.Value); + } + if (Optional.IsDefined(DaemonsetEvictionForOccupiedNodes)) + { + writer.WritePropertyName("daemonset-eviction-for-occupied-nodes"u8); + writer.WriteBooleanValue(DaemonsetEvictionForOccupiedNodes.Value); + } + if (Optional.IsDefined(IgnoreDaemonsetsUtilization)) + { + writer.WritePropertyName("ignore-daemonsets-utilization"u8); + writer.WriteBooleanValue(IgnoreDaemonsetsUtilization.Value); + } if (Optional.IsDefined(Expander)) { writer.WritePropertyName("expander"u8); @@ -158,6 +173,9 @@ internal static ManagedClusterAutoScalerProfile DeserializeManagedClusterAutoSca return null; } string balanceSimilarNodeGroups = default; + bool? daemonsetEvictionForEmptyNodes = default; + bool? daemonsetEvictionForOccupiedNodes = default; + bool? ignoreDaemonsetsUtilization = default; AutoScaleExpander? expander = default; string maxEmptyBulkDelete = default; string maxGracefulTerminationSec = default; @@ -183,6 +201,33 @@ internal static ManagedClusterAutoScalerProfile DeserializeManagedClusterAutoSca balanceSimilarNodeGroups = property.Value.GetString(); continue; } + if (property.NameEquals("daemonset-eviction-for-empty-nodes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + daemonsetEvictionForEmptyNodes = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("daemonset-eviction-for-occupied-nodes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + daemonsetEvictionForOccupiedNodes = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("ignore-daemonsets-utilization"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ignoreDaemonsetsUtilization = property.Value.GetBoolean(); + continue; + } if (property.NameEquals("expander"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -275,6 +320,9 @@ internal static ManagedClusterAutoScalerProfile DeserializeManagedClusterAutoSca serializedAdditionalRawData = rawDataDictionary; return new ManagedClusterAutoScalerProfile( balanceSimilarNodeGroups, + daemonsetEvictionForEmptyNodes, + daemonsetEvictionForOccupiedNodes, + ignoreDaemonsetsUtilization, expander, maxEmptyBulkDelete, maxGracefulTerminationSec, @@ -328,6 +376,54 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DaemonsetEvictionForEmptyNodes), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" daemonset-eviction-for-empty-nodes: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DaemonsetEvictionForEmptyNodes)) + { + builder.Append(" daemonset-eviction-for-empty-nodes: "); + var boolValue = DaemonsetEvictionForEmptyNodes.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DaemonsetEvictionForOccupiedNodes), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" daemonset-eviction-for-occupied-nodes: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DaemonsetEvictionForOccupiedNodes)) + { + builder.Append(" daemonset-eviction-for-occupied-nodes: "); + var boolValue = DaemonsetEvictionForOccupiedNodes.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IgnoreDaemonsetsUtilization), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" ignore-daemonsets-utilization: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(IgnoreDaemonsetsUtilization)) + { + builder.Append(" ignore-daemonsets-utilization: "); + var boolValue = IgnoreDaemonsetsUtilization.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Expander), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAutoScalerProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAutoScalerProfile.cs index 4cd1ca0a37ba..f8ffaecf322d 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAutoScalerProfile.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAutoScalerProfile.cs @@ -52,6 +52,9 @@ public ManagedClusterAutoScalerProfile() /// Initializes a new instance of . /// Valid values are 'true' and 'false'. + /// If set to true, all daemonset pods on empty nodes will be evicted before deletion of the node. If the daemonset pod cannot be evicted another node will be chosen for scaling. If set to false, the node will be deleted without ensuring that daemonset pods are deleted or evicted. + /// If set to true, all daemonset pods on occupied nodes will be evicted before deletion of the node. If the daemonset pod cannot be evicted another node will be chosen for scaling. If set to false, the node will be deleted without ensuring that daemonset pods are deleted or evicted. + /// If set to true, the resources used by daemonset will be taken into account when making scaling down decisions. /// If not specified, the default is 'random'. See [expanders](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-are-expanders) for more information. /// The default is 10. /// The default is 600. @@ -69,9 +72,12 @@ public ManagedClusterAutoScalerProfile() /// The default is true. /// The default is true. /// Keeps track of any properties unknown to the library. - internal ManagedClusterAutoScalerProfile(string balanceSimilarNodeGroups, AutoScaleExpander? expander, string maxEmptyBulkDelete, string maxGracefulTerminationSec, string maxNodeProvisionTime, string maxTotalUnreadyPercentage, string newPodScaleUpDelay, string okTotalUnreadyCount, string scanIntervalInSeconds, string scaleDownDelayAfterAdd, string scaleDownDelayAfterDelete, string scaleDownDelayAfterFailure, string scaleDownUnneededTime, string scaleDownUnreadyTime, string scaleDownUtilizationThreshold, string skipNodesWithLocalStorage, string skipNodesWithSystemPods, IDictionary serializedAdditionalRawData) + internal ManagedClusterAutoScalerProfile(string balanceSimilarNodeGroups, bool? daemonsetEvictionForEmptyNodes, bool? daemonsetEvictionForOccupiedNodes, bool? ignoreDaemonsetsUtilization, AutoScaleExpander? expander, string maxEmptyBulkDelete, string maxGracefulTerminationSec, string maxNodeProvisionTime, string maxTotalUnreadyPercentage, string newPodScaleUpDelay, string okTotalUnreadyCount, string scanIntervalInSeconds, string scaleDownDelayAfterAdd, string scaleDownDelayAfterDelete, string scaleDownDelayAfterFailure, string scaleDownUnneededTime, string scaleDownUnreadyTime, string scaleDownUtilizationThreshold, string skipNodesWithLocalStorage, string skipNodesWithSystemPods, IDictionary serializedAdditionalRawData) { BalanceSimilarNodeGroups = balanceSimilarNodeGroups; + DaemonsetEvictionForEmptyNodes = daemonsetEvictionForEmptyNodes; + DaemonsetEvictionForOccupiedNodes = daemonsetEvictionForOccupiedNodes; + IgnoreDaemonsetsUtilization = ignoreDaemonsetsUtilization; Expander = expander; MaxEmptyBulkDelete = maxEmptyBulkDelete; MaxGracefulTerminationSec = maxGracefulTerminationSec; @@ -94,6 +100,15 @@ internal ManagedClusterAutoScalerProfile(string balanceSimilarNodeGroups, AutoSc /// Valid values are 'true' and 'false'. [WirePath("balance-similar-node-groups")] public string BalanceSimilarNodeGroups { get; set; } + /// If set to true, all daemonset pods on empty nodes will be evicted before deletion of the node. If the daemonset pod cannot be evicted another node will be chosen for scaling. If set to false, the node will be deleted without ensuring that daemonset pods are deleted or evicted. + [WirePath("daemonset-eviction-for-empty-nodes")] + public bool? DaemonsetEvictionForEmptyNodes { get; set; } + /// If set to true, all daemonset pods on occupied nodes will be evicted before deletion of the node. If the daemonset pod cannot be evicted another node will be chosen for scaling. If set to false, the node will be deleted without ensuring that daemonset pods are deleted or evicted. + [WirePath("daemonset-eviction-for-occupied-nodes")] + public bool? DaemonsetEvictionForOccupiedNodes { get; set; } + /// If set to true, the resources used by daemonset will be taken into account when making scaling down decisions. + [WirePath("ignore-daemonsets-utilization")] + public bool? IgnoreDaemonsetsUtilization { get; set; } /// If not specified, the default is 'random'. See [expanders](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-are-expanders) for more information. [WirePath("expander")] public AutoScaleExpander? Expander { get; set; } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterBootstrapProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterBootstrapProfile.Serialization.cs new file mode 100644 index 000000000000..3e0245602b6f --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterBootstrapProfile.Serialization.cs @@ -0,0 +1,196 @@ +// 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; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerService.Models +{ + public partial class ManagedClusterBootstrapProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedClusterBootstrapProfile)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ArtifactSource)) + { + writer.WritePropertyName("artifactSource"u8); + writer.WriteStringValue(ArtifactSource.Value.ToString()); + } + if (Optional.IsDefined(ContainerRegistryId)) + { + writer.WritePropertyName("containerRegistryId"u8); + writer.WriteStringValue(ContainerRegistryId); + } + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ManagedClusterBootstrapProfile 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(ManagedClusterBootstrapProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeManagedClusterBootstrapProfile(document.RootElement, options); + } + + internal static ManagedClusterBootstrapProfile DeserializeManagedClusterBootstrapProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ArtifactSource? artifactSource = default; + ResourceIdentifier containerRegistryId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("artifactSource"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + artifactSource = new ArtifactSource(property.Value.GetString()); + continue; + } + if (property.NameEquals("containerRegistryId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + containerRegistryId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ManagedClusterBootstrapProfile(artifactSource, containerRegistryId, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ArtifactSource), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" artifactSource: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ArtifactSource)) + { + builder.Append(" artifactSource: "); + builder.AppendLine($"'{ArtifactSource.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ContainerRegistryId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" containerRegistryId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ContainerRegistryId)) + { + builder.Append(" containerRegistryId: "); + builder.AppendLine($"'{ContainerRegistryId.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerContainerServiceContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ManagedClusterBootstrapProfile)} does not support writing '{options.Format}' format."); + } + } + + ManagedClusterBootstrapProfile 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeManagedClusterBootstrapProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ManagedClusterBootstrapProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterBootstrapProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterBootstrapProfile.cs new file mode 100644 index 000000000000..e7b95028c2a0 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterBootstrapProfile.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerService.Models +{ + /// The bootstrap profile. + public partial class ManagedClusterBootstrapProfile + { + /// + /// 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 . + public ManagedClusterBootstrapProfile() + { + } + + /// Initializes a new instance of . + /// The source where the artifacts are downloaded from. + /// The resource Id of Azure Container Registry. The registry must have private network access, premium SKU and zone redundancy. + /// Keeps track of any properties unknown to the library. + internal ManagedClusterBootstrapProfile(ArtifactSource? artifactSource, ResourceIdentifier containerRegistryId, IDictionary serializedAdditionalRawData) + { + ArtifactSource = artifactSource; + ContainerRegistryId = containerRegistryId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The source where the artifacts are downloaded from. + [WirePath("artifactSource")] + public ArtifactSource? ArtifactSource { get; set; } + /// The resource Id of Azure Container Registry. The registry must have private network access, premium SKU and zone redundancy. + [WirePath("containerRegistryId")] + public ResourceIdentifier ContainerRegistryId { get; set; } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterCostAnalysis.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterCostAnalysis.Serialization.cs new file mode 100644 index 000000000000..694c6ec1ace7 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterCostAnalysis.Serialization.cs @@ -0,0 +1,167 @@ +// 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; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerService.Models +{ + internal partial class ManagedClusterCostAnalysis : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedClusterCostAnalysis)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Enabled)) + { + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(Enabled.Value); + } + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ManagedClusterCostAnalysis 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(ManagedClusterCostAnalysis)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeManagedClusterCostAnalysis(document.RootElement, options); + } + + internal static ManagedClusterCostAnalysis DeserializeManagedClusterCostAnalysis(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? enabled = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enabled = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ManagedClusterCostAnalysis(enabled, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Enabled), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" enabled: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Enabled)) + { + builder.Append(" enabled: "); + var boolValue = Enabled.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerContainerServiceContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ManagedClusterCostAnalysis)} does not support writing '{options.Format}' format."); + } + } + + ManagedClusterCostAnalysis 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeManagedClusterCostAnalysis(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ManagedClusterCostAnalysis)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterCostAnalysis.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterCostAnalysis.cs new file mode 100644 index 000000000000..63379cdd6fdf --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterCostAnalysis.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerService.Models +{ + /// The cost analysis configuration for the cluster. + internal partial class ManagedClusterCostAnalysis + { + /// + /// 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 . + public ManagedClusterCostAnalysis() + { + } + + /// Initializes a new instance of . + /// The Managed Cluster sku.tier must be set to 'Standard' or 'Premium' to enable this feature. Enabling this will add Kubernetes Namespace and Deployment details to the Cost Analysis views in the Azure portal. If not specified, the default is false. For more information see aka.ms/aks/docs/cost-analysis. + /// Keeps track of any properties unknown to the library. + internal ManagedClusterCostAnalysis(bool? enabled, IDictionary serializedAdditionalRawData) + { + Enabled = enabled; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The Managed Cluster sku.tier must be set to 'Standard' or 'Premium' to enable this feature. Enabling this will add Kubernetes Namespace and Deployment details to the Cost Analysis views in the Azure portal. If not specified, the default is false. For more information see aka.ms/aks/docs/cost-analysis. + [WirePath("enabled")] + public bool? Enabled { get; set; } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterIngressProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterIngressProfile.Serialization.cs new file mode 100644 index 000000000000..b63f74d76b8a --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterIngressProfile.Serialization.cs @@ -0,0 +1,166 @@ +// 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; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerService.Models +{ + internal partial class ManagedClusterIngressProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedClusterIngressProfile)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(WebAppRouting)) + { + writer.WritePropertyName("webAppRouting"u8); + writer.WriteObjectValue(WebAppRouting, options); + } + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ManagedClusterIngressProfile 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(ManagedClusterIngressProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeManagedClusterIngressProfile(document.RootElement, options); + } + + internal static ManagedClusterIngressProfile DeserializeManagedClusterIngressProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ManagedClusterIngressProfileWebAppRouting webAppRouting = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("webAppRouting"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + webAppRouting = ManagedClusterIngressProfileWebAppRouting.DeserializeManagedClusterIngressProfileWebAppRouting(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ManagedClusterIngressProfile(webAppRouting, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(WebAppRouting), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" webAppRouting: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(WebAppRouting)) + { + builder.Append(" webAppRouting: "); + BicepSerializationHelpers.AppendChildObject(builder, WebAppRouting, options, 2, false, " webAppRouting: "); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerContainerServiceContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ManagedClusterIngressProfile)} does not support writing '{options.Format}' format."); + } + } + + ManagedClusterIngressProfile 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeManagedClusterIngressProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ManagedClusterIngressProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterIngressProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterIngressProfile.cs new file mode 100644 index 000000000000..de760f817d65 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterIngressProfile.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerService.Models +{ + /// Ingress profile for the container service cluster. + internal partial class ManagedClusterIngressProfile + { + /// + /// 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 . + public ManagedClusterIngressProfile() + { + } + + /// Initializes a new instance of . + /// App Routing settings for the ingress profile. You can find an overview and onboarding guide for this feature at https://learn.microsoft.com/en-us/azure/aks/app-routing?tabs=default%2Cdeploy-app-default. + /// Keeps track of any properties unknown to the library. + internal ManagedClusterIngressProfile(ManagedClusterIngressProfileWebAppRouting webAppRouting, IDictionary serializedAdditionalRawData) + { + WebAppRouting = webAppRouting; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// App Routing settings for the ingress profile. You can find an overview and onboarding guide for this feature at https://learn.microsoft.com/en-us/azure/aks/app-routing?tabs=default%2Cdeploy-app-default. + [WirePath("webAppRouting")] + public ManagedClusterIngressProfileWebAppRouting WebAppRouting { get; set; } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterIngressProfileNginx.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterIngressProfileNginx.Serialization.cs new file mode 100644 index 000000000000..4cd981d1fb2f --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterIngressProfileNginx.Serialization.cs @@ -0,0 +1,166 @@ +// 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; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerService.Models +{ + internal partial class ManagedClusterIngressProfileNginx : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedClusterIngressProfileNginx)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(DefaultIngressControllerType)) + { + writer.WritePropertyName("defaultIngressControllerType"u8); + writer.WriteStringValue(DefaultIngressControllerType.Value.ToString()); + } + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ManagedClusterIngressProfileNginx 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(ManagedClusterIngressProfileNginx)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeManagedClusterIngressProfileNginx(document.RootElement, options); + } + + internal static ManagedClusterIngressProfileNginx DeserializeManagedClusterIngressProfileNginx(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + NginxIngressControllerType? defaultIngressControllerType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("defaultIngressControllerType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + defaultIngressControllerType = new NginxIngressControllerType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ManagedClusterIngressProfileNginx(defaultIngressControllerType, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DefaultIngressControllerType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" defaultIngressControllerType: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DefaultIngressControllerType)) + { + builder.Append(" defaultIngressControllerType: "); + builder.AppendLine($"'{DefaultIngressControllerType.Value.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerContainerServiceContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ManagedClusterIngressProfileNginx)} does not support writing '{options.Format}' format."); + } + } + + ManagedClusterIngressProfileNginx 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeManagedClusterIngressProfileNginx(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ManagedClusterIngressProfileNginx)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterIngressProfileNginx.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterIngressProfileNginx.cs new file mode 100644 index 000000000000..34e1e374ce3c --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterIngressProfileNginx.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerService.Models +{ + /// The ManagedClusterIngressProfileNginx. + internal partial class ManagedClusterIngressProfileNginx + { + /// + /// 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 . + public ManagedClusterIngressProfileNginx() + { + } + + /// Initializes a new instance of . + /// Ingress type for the default NginxIngressController custom resource. + /// Keeps track of any properties unknown to the library. + internal ManagedClusterIngressProfileNginx(NginxIngressControllerType? defaultIngressControllerType, IDictionary serializedAdditionalRawData) + { + DefaultIngressControllerType = defaultIngressControllerType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Ingress type for the default NginxIngressController custom resource. + [WirePath("defaultIngressControllerType")] + public NginxIngressControllerType? DefaultIngressControllerType { get; set; } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterIngressProfileWebAppRouting.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterIngressProfileWebAppRouting.Serialization.cs new file mode 100644 index 000000000000..7fe9f2f9c027 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterIngressProfileWebAppRouting.Serialization.cs @@ -0,0 +1,296 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerService.Models +{ + public partial class ManagedClusterIngressProfileWebAppRouting : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedClusterIngressProfileWebAppRouting)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Enabled)) + { + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(Enabled.Value); + } + if (Optional.IsCollectionDefined(DnsZoneResourceIds)) + { + writer.WritePropertyName("dnsZoneResourceIds"u8); + writer.WriteStartArray(); + foreach (var item in DnsZoneResourceIds) + { + if (item == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Nginx)) + { + writer.WritePropertyName("nginx"u8); + writer.WriteObjectValue(Nginx, options); + } + if (options.Format != "W" && Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + writer.WriteObjectValue(Identity, options); + } + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ManagedClusterIngressProfileWebAppRouting 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(ManagedClusterIngressProfileWebAppRouting)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeManagedClusterIngressProfileWebAppRouting(document.RootElement, options); + } + + internal static ManagedClusterIngressProfileWebAppRouting DeserializeManagedClusterIngressProfileWebAppRouting(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? enabled = default; + IList dnsZoneResourceIds = default; + ManagedClusterIngressProfileNginx nginx = default; + ContainerServiceUserAssignedIdentity identity = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("dnsZoneResourceIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(new ResourceIdentifier(item.GetString())); + } + } + dnsZoneResourceIds = array; + continue; + } + if (property.NameEquals("nginx"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nginx = ManagedClusterIngressProfileNginx.DeserializeManagedClusterIngressProfileNginx(property.Value, options); + continue; + } + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identity = ContainerServiceUserAssignedIdentity.DeserializeContainerServiceUserAssignedIdentity(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ManagedClusterIngressProfileWebAppRouting(enabled, dnsZoneResourceIds ?? new ChangeTrackingList(), nginx, identity, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Enabled), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" enabled: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Enabled)) + { + builder.Append(" enabled: "); + var boolValue = Enabled.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DnsZoneResourceIds), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" dnsZoneResourceIds: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(DnsZoneResourceIds)) + { + if (DnsZoneResourceIds.Any()) + { + builder.Append(" dnsZoneResourceIds: "); + builder.AppendLine("["); + foreach (var item in DnsZoneResourceIds) + { + if (item == null) + { + builder.Append("null"); + continue; + } + builder.AppendLine($" '{item.ToString()}'"); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("NginxDefaultIngressControllerType", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nginx: "); + builder.AppendLine("{"); + builder.Append(" defaultIngressControllerType: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(Nginx)) + { + builder.Append(" nginx: "); + BicepSerializationHelpers.AppendChildObject(builder, Nginx, options, 2, false, " nginx: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" identity: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Identity)) + { + builder.Append(" identity: "); + BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerContainerServiceContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ManagedClusterIngressProfileWebAppRouting)} does not support writing '{options.Format}' format."); + } + } + + ManagedClusterIngressProfileWebAppRouting 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeManagedClusterIngressProfileWebAppRouting(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ManagedClusterIngressProfileWebAppRouting)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterIngressProfileWebAppRouting.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterIngressProfileWebAppRouting.cs new file mode 100644 index 000000000000..9c70922e7f05 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterIngressProfileWebAppRouting.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerService.Models +{ + /// Application Routing add-on settings for the ingress profile. + public partial class ManagedClusterIngressProfileWebAppRouting + { + /// + /// 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 . + public ManagedClusterIngressProfileWebAppRouting() + { + DnsZoneResourceIds = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Whether to enable the Application Routing add-on. + /// Resource IDs of the DNS zones to be associated with the Application Routing add-on. Used only when Application Routing add-on is enabled. Public and private DNS zones can be in different resource groups, but all public DNS zones must be in the same resource group and all private DNS zones must be in the same resource group. + /// Configuration for the default NginxIngressController. See more at https://learn.microsoft.com/en-us/azure/aks/app-routing-nginx-configuration#the-default-nginx-ingress-controller. + /// Managed identity of the Application Routing add-on. This is the identity that should be granted permissions, for example, to manage the associated Azure DNS resource and get certificates from Azure Key Vault. See [this overview of the add-on](https://learn.microsoft.com/en-us/azure/aks/web-app-routing?tabs=with-osm) for more instructions. + /// Keeps track of any properties unknown to the library. + internal ManagedClusterIngressProfileWebAppRouting(bool? enabled, IList dnsZoneResourceIds, ManagedClusterIngressProfileNginx nginx, ContainerServiceUserAssignedIdentity identity, IDictionary serializedAdditionalRawData) + { + Enabled = enabled; + DnsZoneResourceIds = dnsZoneResourceIds; + Nginx = nginx; + Identity = identity; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Whether to enable the Application Routing add-on. + [WirePath("enabled")] + public bool? Enabled { get; set; } + /// Resource IDs of the DNS zones to be associated with the Application Routing add-on. Used only when Application Routing add-on is enabled. Public and private DNS zones can be in different resource groups, but all public DNS zones must be in the same resource group and all private DNS zones must be in the same resource group. + [WirePath("dnsZoneResourceIds")] + public IList DnsZoneResourceIds { get; } + /// Configuration for the default NginxIngressController. See more at https://learn.microsoft.com/en-us/azure/aks/app-routing-nginx-configuration#the-default-nginx-ingress-controller. + internal ManagedClusterIngressProfileNginx Nginx { get; set; } + /// Ingress type for the default NginxIngressController custom resource. + [WirePath("nginx.defaultIngressControllerType")] + public NginxIngressControllerType? NginxDefaultIngressControllerType + { + get => Nginx is null ? default : Nginx.DefaultIngressControllerType; + set + { + if (Nginx is null) + Nginx = new ManagedClusterIngressProfileNginx(); + Nginx.DefaultIngressControllerType = value; + } + } + + /// Managed identity of the Application Routing add-on. This is the identity that should be granted permissions, for example, to manage the associated Azure DNS resource and get certificates from Azure Key Vault. See [this overview of the add-on](https://learn.microsoft.com/en-us/azure/aks/web-app-routing?tabs=with-osm) for more instructions. + [WirePath("identity")] + public ContainerServiceUserAssignedIdentity Identity { get; } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfile.Serialization.cs index 4150043e6011..3aab6c1888b5 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfile.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfile.Serialization.cs @@ -52,7 +52,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("outboundIPs"u8); writer.WriteObjectValue(OutboundIPs, options); } - if (Optional.IsCollectionDefined(EffectiveOutboundIPs)) + if (options.Format != "W" && Optional.IsCollectionDefined(EffectiveOutboundIPs)) { writer.WritePropertyName("effectiveOutboundIPs"u8); writer.WriteStartArray(); @@ -122,7 +122,7 @@ internal static ManagedClusterLoadBalancerProfile DeserializeManagedClusterLoadB ManagedClusterLoadBalancerProfileManagedOutboundIPs managedOutboundIPs = default; ManagedClusterLoadBalancerProfileOutboundIPPrefixes outboundIPPrefixes = default; ManagedClusterLoadBalancerProfileOutboundIPs outboundIPs = default; - IList effectiveOutboundIPs = default; + IReadOnlyList effectiveOutboundIPs = default; int? allocatedOutboundPorts = default; int? idleTimeoutInMinutes = default; bool? enableMultipleStandardLoadBalancers = default; diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfile.cs index a40f522564dc..8387020b24af 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfile.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfile.cs @@ -62,7 +62,7 @@ public ManagedClusterLoadBalancerProfile() /// Enable multiple standard load balancers per AKS cluster or not. /// The type of the managed inbound Load Balancer BackendPool. /// Keeps track of any properties unknown to the library. - internal ManagedClusterLoadBalancerProfile(ManagedClusterLoadBalancerProfileManagedOutboundIPs managedOutboundIPs, ManagedClusterLoadBalancerProfileOutboundIPPrefixes outboundIPPrefixes, ManagedClusterLoadBalancerProfileOutboundIPs outboundIPs, IList effectiveOutboundIPs, int? allocatedOutboundPorts, int? idleTimeoutInMinutes, bool? enableMultipleStandardLoadBalancers, ManagedClusterLoadBalancerBackendPoolType? backendPoolType, IDictionary serializedAdditionalRawData) + internal ManagedClusterLoadBalancerProfile(ManagedClusterLoadBalancerProfileManagedOutboundIPs managedOutboundIPs, ManagedClusterLoadBalancerProfileOutboundIPPrefixes outboundIPPrefixes, ManagedClusterLoadBalancerProfileOutboundIPs outboundIPs, IReadOnlyList effectiveOutboundIPs, int? allocatedOutboundPorts, int? idleTimeoutInMinutes, bool? enableMultipleStandardLoadBalancers, ManagedClusterLoadBalancerBackendPoolType? backendPoolType, IDictionary serializedAdditionalRawData) { ManagedOutboundIPs = managedOutboundIPs; OutboundIPPrefixes = outboundIPPrefixes; @@ -108,7 +108,7 @@ public IList OutboundPublicIPs /// The effective outbound IP resources of the cluster load balancer. [WirePath("effectiveOutboundIPs")] - public IList EffectiveOutboundIPs { get; } + public IReadOnlyList EffectiveOutboundIPs { get; } /// The desired number of allocated SNAT ports per VM. Allowed values are in the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure dynamically allocating ports. [WirePath("allocatedOutboundPorts")] public int? AllocatedOutboundPorts { get; set; } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterMetricsProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterMetricsProfile.Serialization.cs new file mode 100644 index 000000000000..bf85af0ed473 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterMetricsProfile.Serialization.cs @@ -0,0 +1,169 @@ +// 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; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerService.Models +{ + internal partial class ManagedClusterMetricsProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedClusterMetricsProfile)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(CostAnalysis)) + { + writer.WritePropertyName("costAnalysis"u8); + writer.WriteObjectValue(CostAnalysis, options); + } + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ManagedClusterMetricsProfile 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(ManagedClusterMetricsProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeManagedClusterMetricsProfile(document.RootElement, options); + } + + internal static ManagedClusterMetricsProfile DeserializeManagedClusterMetricsProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ManagedClusterCostAnalysis costAnalysis = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("costAnalysis"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + costAnalysis = ManagedClusterCostAnalysis.DeserializeManagedClusterCostAnalysis(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ManagedClusterMetricsProfile(costAnalysis, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("CostAnalysisEnabled", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" costAnalysis: "); + builder.AppendLine("{"); + builder.Append(" enabled: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(CostAnalysis)) + { + builder.Append(" costAnalysis: "); + BicepSerializationHelpers.AppendChildObject(builder, CostAnalysis, options, 2, false, " costAnalysis: "); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerContainerServiceContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ManagedClusterMetricsProfile)} does not support writing '{options.Format}' format."); + } + } + + ManagedClusterMetricsProfile 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeManagedClusterMetricsProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ManagedClusterMetricsProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterMetricsProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterMetricsProfile.cs new file mode 100644 index 000000000000..32d90c17d3ff --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterMetricsProfile.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerService.Models +{ + /// The metrics profile for the ManagedCluster. + internal partial class ManagedClusterMetricsProfile + { + /// + /// 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 . + public ManagedClusterMetricsProfile() + { + } + + /// Initializes a new instance of . + /// The cost analysis configuration for the cluster. + /// Keeps track of any properties unknown to the library. + internal ManagedClusterMetricsProfile(ManagedClusterCostAnalysis costAnalysis, IDictionary serializedAdditionalRawData) + { + CostAnalysis = costAnalysis; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The cost analysis configuration for the cluster. + internal ManagedClusterCostAnalysis CostAnalysis { get; set; } + /// The Managed Cluster sku.tier must be set to 'Standard' or 'Premium' to enable this feature. Enabling this will add Kubernetes Namespace and Deployment details to the Cost Analysis views in the Azure portal. If not specified, the default is false. For more information see aka.ms/aks/docs/cost-analysis. + [WirePath("costAnalysis.enabled")] + public bool? CostAnalysisEnabled + { + get => CostAnalysis is null ? default : CostAnalysis.Enabled; + set + { + if (CostAnalysis is null) + CostAnalysis = new ManagedClusterCostAnalysis(); + CostAnalysis.Enabled = value; + } + } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNatGatewayProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNatGatewayProfile.Serialization.cs index 43784a0e924c..c61e40eea5fd 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNatGatewayProfile.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNatGatewayProfile.Serialization.cs @@ -42,7 +42,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("managedOutboundIPProfile"u8); writer.WriteObjectValue(ManagedOutboundIPProfile, options); } - if (Optional.IsCollectionDefined(EffectiveOutboundIPs)) + if (options.Format != "W" && Optional.IsCollectionDefined(EffectiveOutboundIPs)) { writer.WritePropertyName("effectiveOutboundIPs"u8); writer.WriteStartArray(); @@ -95,7 +95,7 @@ internal static ManagedClusterNatGatewayProfile DeserializeManagedClusterNatGate return null; } ManagedClusterManagedOutboundIPProfile managedOutboundIPProfile = default; - IList effectiveOutboundIPs = default; + IReadOnlyList effectiveOutboundIPs = default; int? idleTimeoutInMinutes = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNatGatewayProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNatGatewayProfile.cs index 047d979ffec0..70c6a33d445b 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNatGatewayProfile.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNatGatewayProfile.cs @@ -57,7 +57,7 @@ public ManagedClusterNatGatewayProfile() /// The effective outbound IP resources of the cluster NAT gateway. /// Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The default value is 4 minutes. /// Keeps track of any properties unknown to the library. - internal ManagedClusterNatGatewayProfile(ManagedClusterManagedOutboundIPProfile managedOutboundIPProfile, IList effectiveOutboundIPs, int? idleTimeoutInMinutes, IDictionary serializedAdditionalRawData) + internal ManagedClusterNatGatewayProfile(ManagedClusterManagedOutboundIPProfile managedOutboundIPProfile, IReadOnlyList effectiveOutboundIPs, int? idleTimeoutInMinutes, IDictionary serializedAdditionalRawData) { ManagedOutboundIPProfile = managedOutboundIPProfile; EffectiveOutboundIPs = effectiveOutboundIPs; @@ -82,7 +82,7 @@ public int? ManagedOutboundIPCount /// The effective outbound IP resources of the cluster NAT gateway. [WirePath("effectiveOutboundIPs")] - public IList EffectiveOutboundIPs { get; } + public IReadOnlyList EffectiveOutboundIPs { get; } /// Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The default value is 4 minutes. [WirePath("idleTimeoutInMinutes")] public int? IdleTimeoutInMinutes { get; set; } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNodeOSUpgradeChannel.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNodeOSUpgradeChannel.cs index 5fd9240d2cc8..662e9289216a 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNodeOSUpgradeChannel.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNodeOSUpgradeChannel.cs @@ -25,6 +25,7 @@ public ManagedClusterNodeOSUpgradeChannel(string value) private const string NoneValue = "None"; private const string UnmanagedValue = "Unmanaged"; private const string NodeImageValue = "NodeImage"; + private const string SecurityPatchValue = "SecurityPatch"; /// No attempt to update your machines OS will be made either by OS or by rolling VHDs. This means you are responsible for your security updates. public static ManagedClusterNodeOSUpgradeChannel None { get; } = new ManagedClusterNodeOSUpgradeChannel(NoneValue); @@ -32,6 +33,8 @@ public ManagedClusterNodeOSUpgradeChannel(string value) public static ManagedClusterNodeOSUpgradeChannel Unmanaged { get; } = new ManagedClusterNodeOSUpgradeChannel(UnmanagedValue); /// AKS will update the nodes with a newly patched VHD containing security fixes and bugfixes on a weekly cadence. With the VHD update machines will be rolling reimaged to that VHD following maintenance windows and surge settings. No extra VHD cost is incurred when choosing this option as AKS hosts the images. public static ManagedClusterNodeOSUpgradeChannel NodeImage { get; } = new ManagedClusterNodeOSUpgradeChannel(NodeImageValue); + /// AKS downloads and updates the nodes with tested security updates. These updates honor the maintenance window settings and produce a new VHD that is used on new nodes. On some occasions it's not possible to apply the updates in place, in such cases the existing nodes will also be re-imaged to the newly produced VHD in order to apply the changes. This option incurs an extra cost of hosting the new Security Patch VHDs in your resource group for just in time consumption. + public static ManagedClusterNodeOSUpgradeChannel SecurityPatch { get; } = new ManagedClusterNodeOSUpgradeChannel(SecurityPatchValue); /// Determines if two values are the same. public static bool operator ==(ManagedClusterNodeOSUpgradeChannel left, ManagedClusterNodeOSUpgradeChannel right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNodeResourceGroupProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNodeResourceGroupProfile.Serialization.cs new file mode 100644 index 000000000000..446baacf1314 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNodeResourceGroupProfile.Serialization.cs @@ -0,0 +1,166 @@ +// 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; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerService.Models +{ + internal partial class ManagedClusterNodeResourceGroupProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedClusterNodeResourceGroupProfile)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(RestrictionLevel)) + { + writer.WritePropertyName("restrictionLevel"u8); + writer.WriteStringValue(RestrictionLevel.Value.ToString()); + } + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ManagedClusterNodeResourceGroupProfile 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(ManagedClusterNodeResourceGroupProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeManagedClusterNodeResourceGroupProfile(document.RootElement, options); + } + + internal static ManagedClusterNodeResourceGroupProfile DeserializeManagedClusterNodeResourceGroupProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + RestrictionLevel? restrictionLevel = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("restrictionLevel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + restrictionLevel = new RestrictionLevel(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ManagedClusterNodeResourceGroupProfile(restrictionLevel, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RestrictionLevel), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" restrictionLevel: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(RestrictionLevel)) + { + builder.Append(" restrictionLevel: "); + builder.AppendLine($"'{RestrictionLevel.Value.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerContainerServiceContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ManagedClusterNodeResourceGroupProfile)} does not support writing '{options.Format}' format."); + } + } + + ManagedClusterNodeResourceGroupProfile 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeManagedClusterNodeResourceGroupProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ManagedClusterNodeResourceGroupProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNodeResourceGroupProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNodeResourceGroupProfile.cs new file mode 100644 index 000000000000..c81245ee27f2 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNodeResourceGroupProfile.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerService.Models +{ + /// Node resource group lockdown profile for a managed cluster. + internal partial class ManagedClusterNodeResourceGroupProfile + { + /// + /// 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 . + public ManagedClusterNodeResourceGroupProfile() + { + } + + /// Initializes a new instance of . + /// The restriction level applied to the cluster's node resource group. If not specified, the default is 'Unrestricted'. + /// Keeps track of any properties unknown to the library. + internal ManagedClusterNodeResourceGroupProfile(RestrictionLevel? restrictionLevel, IDictionary serializedAdditionalRawData) + { + RestrictionLevel = restrictionLevel; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The restriction level applied to the cluster's node resource group. If not specified, the default is 'Unrestricted'. + [WirePath("restrictionLevel")] + public RestrictionLevel? RestrictionLevel { get; set; } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfile.Serialization.cs index 470a1e292f7e..2cc94a5dde9d 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfile.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfile.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Linq; using System.Text; using System.Text.Json; using Azure.Core; @@ -55,6 +56,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("imageCleaner"u8); writer.WriteObjectValue(ImageCleaner, options); } + if (Optional.IsCollectionDefined(CustomCATrustCertificates)) + { + writer.WritePropertyName("customCATrustCertificates"u8); + writer.WriteStartArray(); + foreach (var item in CustomCATrustCertificates) + { + writer.WriteBase64StringValue(item, "D"); + } + writer.WriteEndArray(); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -96,6 +107,7 @@ internal static ManagedClusterSecurityProfile DeserializeManagedClusterSecurityP ManagedClusterSecurityProfileKeyVaultKms azureKeyVaultKms = default; ManagedClusterSecurityProfileWorkloadIdentity workloadIdentity = default; ManagedClusterSecurityProfileImageCleaner imageCleaner = default; + IList customCATrustCertificates = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -136,13 +148,33 @@ internal static ManagedClusterSecurityProfile DeserializeManagedClusterSecurityP imageCleaner = ManagedClusterSecurityProfileImageCleaner.DeserializeManagedClusterSecurityProfileImageCleaner(property.Value, options); continue; } + if (property.NameEquals("customCATrustCertificates"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetBytesFromBase64("D")); + } + customCATrustCertificates = array; + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterSecurityProfile(defender, azureKeyVaultKms, workloadIdentity, imageCleaner, serializedAdditionalRawData); + return new ManagedClusterSecurityProfile( + defender, + azureKeyVaultKms, + workloadIdentity, + imageCleaner, + customCATrustCertificates ?? new ChangeTrackingList(), + serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -219,6 +251,34 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CustomCATrustCertificates), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" customCATrustCertificates: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(CustomCATrustCertificates)) + { + if (CustomCATrustCertificates.Any()) + { + builder.Append(" customCATrustCertificates: "); + builder.AppendLine("["); + foreach (var item in CustomCATrustCertificates) + { + if (item == null) + { + builder.Append("null"); + continue; + } + builder.AppendLine($" '{item.ToString()}'"); + } + builder.AppendLine(" ]"); + } + } + } + builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfile.cs index 65d99a578005..9153021ea6fa 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfile.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfile.cs @@ -48,6 +48,7 @@ public partial class ManagedClusterSecurityProfile /// Initializes a new instance of . public ManagedClusterSecurityProfile() { + CustomCATrustCertificates = new ChangeTrackingList(); } /// Initializes a new instance of . @@ -55,13 +56,15 @@ public ManagedClusterSecurityProfile() /// Azure Key Vault [key management service](https://kubernetes.io/docs/tasks/administer-cluster/kms-provider/) settings for the security profile. /// Workload identity settings for the security profile. Workload identity enables Kubernetes applications to access Azure cloud resources securely with Azure AD. See https://aka.ms/aks/wi for more details. /// Image Cleaner settings for the security profile. + /// A list of up to 10 base64 encoded CAs that will be added to the trust store on all nodes in the cluster. For more information see [Custom CA Trust Certificates](https://learn.microsoft.com/en-us/azure/aks/custom-certificate-authority). /// Keeps track of any properties unknown to the library. - internal ManagedClusterSecurityProfile(ManagedClusterSecurityProfileDefender defender, ManagedClusterSecurityProfileKeyVaultKms azureKeyVaultKms, ManagedClusterSecurityProfileWorkloadIdentity workloadIdentity, ManagedClusterSecurityProfileImageCleaner imageCleaner, IDictionary serializedAdditionalRawData) + internal ManagedClusterSecurityProfile(ManagedClusterSecurityProfileDefender defender, ManagedClusterSecurityProfileKeyVaultKms azureKeyVaultKms, ManagedClusterSecurityProfileWorkloadIdentity workloadIdentity, ManagedClusterSecurityProfileImageCleaner imageCleaner, IList customCATrustCertificates, IDictionary serializedAdditionalRawData) { Defender = defender; AzureKeyVaultKms = azureKeyVaultKms; WorkloadIdentity = workloadIdentity; ImageCleaner = imageCleaner; + CustomCATrustCertificates = customCATrustCertificates; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -89,5 +92,8 @@ public bool? IsWorkloadIdentityEnabled /// Image Cleaner settings for the security profile. [WirePath("imageCleaner")] public ManagedClusterSecurityProfileImageCleaner ImageCleaner { get; set; } + /// A list of up to 10 base64 encoded CAs that will be added to the trust store on all nodes in the cluster. For more information see [Custom CA Trust Certificates](https://learn.microsoft.com/en-us/azure/aks/custom-certificate-authority). + [WirePath("customCATrustCertificates")] + public IList CustomCATrustCertificates { get; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NginxIngressControllerType.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NginxIngressControllerType.cs new file mode 100644 index 000000000000..d787a52f31a9 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NginxIngressControllerType.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerService.Models +{ + /// Ingress type for the default NginxIngressController custom resource. + public readonly partial struct NginxIngressControllerType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public NginxIngressControllerType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AnnotationControlledValue = "AnnotationControlled"; + private const string ExternalValue = "External"; + private const string InternalValue = "Internal"; + private const string NoneValue = "None"; + + /// The default NginxIngressController will be created. Users can edit the default NginxIngressController Custom Resource to configure load balancer annotations. + public static NginxIngressControllerType AnnotationControlled { get; } = new NginxIngressControllerType(AnnotationControlledValue); + /// The default NginxIngressController will be created and the operator will provision an external loadbalancer with it. Any annotation to make the default loadbalancer internal will be overwritten. + public static NginxIngressControllerType External { get; } = new NginxIngressControllerType(ExternalValue); + /// The default NginxIngressController will be created and the operator will provision an internal loadbalancer with it. Any annotation to make the default loadbalancer external will be overwritten. + public static NginxIngressControllerType Internal { get; } = new NginxIngressControllerType(InternalValue); + /// The default Ingress Controller will not be created. It will not be deleted by the system if it exists. Users should delete the default NginxIngressController Custom Resource manually if desired. + public static NginxIngressControllerType None { get; } = new NginxIngressControllerType(NoneValue); + /// Determines if two values are the same. + public static bool operator ==(NginxIngressControllerType left, NginxIngressControllerType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(NginxIngressControllerType left, NginxIngressControllerType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator NginxIngressControllerType(string value) => new NginxIngressControllerType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is NginxIngressControllerType other && Equals(other); + /// + public bool Equals(NginxIngressControllerType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/RestrictionLevel.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/RestrictionLevel.cs new file mode 100644 index 000000000000..df1e65439664 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/RestrictionLevel.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerService.Models +{ + /// The restriction level applied to the cluster's node resource group. If not specified, the default is 'Unrestricted'. + public readonly partial struct RestrictionLevel : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public RestrictionLevel(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnrestrictedValue = "Unrestricted"; + private const string ReadOnlyValue = "ReadOnly"; + + /// All RBAC permissions are allowed on the managed node resource group. + public static RestrictionLevel Unrestricted { get; } = new RestrictionLevel(UnrestrictedValue); + /// Only */read RBAC permissions allowed on the managed node resource group. + public static RestrictionLevel ReadOnly { get; } = new RestrictionLevel(ReadOnlyValue); + /// Determines if two values are the same. + public static bool operator ==(RestrictionLevel left, RestrictionLevel right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(RestrictionLevel left, RestrictionLevel right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator RestrictionLevel(string value) => new RestrictionLevel(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is RestrictionLevel other && Equals(other); + /// + public bool Equals(RestrictionLevel other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UndrainableNodeBehavior.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UndrainableNodeBehavior.cs new file mode 100644 index 000000000000..da9c4bac1342 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UndrainableNodeBehavior.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerService.Models +{ + /// Defines the behavior for undrainable nodes during upgrade. The most common cause of undrainable nodes is Pod Disruption Budgets (PDBs), but other issues, such as pod termination grace period is exceeding the remaining per-node drain timeout or pod is still being in a running state, can also cause undrainable nodes. + public readonly partial struct UndrainableNodeBehavior : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public UndrainableNodeBehavior(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CordonValue = "Cordon"; + private const string ScheduleValue = "Schedule"; + + /// AKS will cordon the blocked nodes and replace them with surge nodes during upgrade. The blocked nodes will be cordoned and replaced by surge nodes. The blocked nodes will have label 'kubernetes.azure.com/upgrade-status:Quarantined'. A surge node will be retained for each blocked node. A best-effort attempt will be made to delete all other surge nodes. If there are enough surge nodes to replace blocked nodes, then the upgrade operation and the managed cluster will be in failed state. Otherwise, the upgrade operation and the managed cluster will be in canceled state. + public static UndrainableNodeBehavior Cordon { get; } = new UndrainableNodeBehavior(CordonValue); + /// AKS will mark the blocked nodes schedulable, but the blocked nodes are not upgraded. A best-effort attempt will be made to delete all surge nodes. The upgrade operation and the managed cluster will be in failed state if there are any blocked nodes. + public static UndrainableNodeBehavior Schedule { get; } = new UndrainableNodeBehavior(ScheduleValue); + /// Determines if two values are the same. + public static bool operator ==(UndrainableNodeBehavior left, UndrainableNodeBehavior right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(UndrainableNodeBehavior left, UndrainableNodeBehavior right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator UndrainableNodeBehavior(string value) => new UndrainableNodeBehavior(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is UndrainableNodeBehavior other && Equals(other); + /// + public bool Equals(UndrainableNodeBehavior other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/OSOptionProfileResource.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/OSOptionProfileResource.Serialization.cs deleted file mode 100644 index c659a3d0bc65..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/OSOptionProfileResource.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 OSOptionProfileResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - OSOptionProfileData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerContainerServiceContext.Default); - - OSOptionProfileData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerContainerServiceContext.Default); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/AgentPoolsRestOperations.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/AgentPoolsRestOperations.cs index 4700f59edb16..3e0260f1dd45 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/AgentPoolsRestOperations.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/AgentPoolsRestOperations.cs @@ -32,7 +32,7 @@ public AgentPoolsRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-10-01"; + _apiVersion = apiVersion ?? "2025-03-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -328,7 +328,7 @@ public Response Get(string subscriptionId, string } } - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, ContainerServiceAgentPoolData data) + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, ContainerServiceAgentPoolData data, string ifMatch, string ifNoneMatch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -344,7 +344,7 @@ internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, return uri; } - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, ContainerServiceAgentPoolData data) + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, ContainerServiceAgentPoolData data, string ifMatch, string ifNoneMatch) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -361,6 +361,14 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r uri.AppendPath(agentPoolName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } + if (ifNoneMatch != null) + { + request.Headers.Add("If-None-Match", ifNoneMatch); + } request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); var content = new Utf8JsonRequestContent(); @@ -376,10 +384,12 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r /// The name of the managed cluster resource. /// The name of the agent pool. /// The agent pool to create or update. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, ContainerServiceAgentPoolData data, CancellationToken cancellationToken = default) + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, ContainerServiceAgentPoolData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -387,7 +397,7 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName, data); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName, data, ifMatch, ifNoneMatch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -405,10 +415,12 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re /// The name of the managed cluster resource. /// The name of the agent pool. /// The agent pool to create or update. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, ContainerServiceAgentPoolData data, CancellationToken cancellationToken = default) + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, ContainerServiceAgentPoolData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -416,7 +428,7 @@ public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName, data); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName, data, ifMatch, ifNoneMatch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -428,7 +440,7 @@ public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, bool? ignorePodDisruptionBudget, string ifMatch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -441,10 +453,14 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string uri.AppendPath("/agentPools/", false); uri.AppendPath(agentPoolName, true); uri.AppendQuery("api-version", _apiVersion, true); + if (ignorePodDisruptionBudget != null) + { + uri.AppendQuery("ignore-pod-disruption-budget", ignorePodDisruptionBudget.Value, true); + } return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, bool? ignorePodDisruptionBudget, string ifMatch) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -460,7 +476,15 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendPath("/agentPools/", false); uri.AppendPath(agentPoolName, true); uri.AppendQuery("api-version", _apiVersion, true); + if (ignorePodDisruptionBudget != null) + { + uri.AppendQuery("ignore-pod-disruption-budget", ignorePodDisruptionBudget.Value, true); + } request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); return message; @@ -471,17 +495,19 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG /// The name of the resource group. The name is case insensitive. /// The name of the managed cluster resource. /// The name of the agent pool. + /// ignore-pod-disruption-budget=true to delete those pods on a node without considering Pod Disruption Budget. + /// The request should only proceed if an entity matches this string. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, CancellationToken cancellationToken = default) + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, bool? ignorePodDisruptionBudget = null, string ifMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName, ignorePodDisruptionBudget, ifMatch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -498,17 +524,19 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr /// The name of the resource group. The name is case insensitive. /// The name of the managed cluster resource. /// The name of the agent pool. + /// ignore-pod-disruption-budget=true to delete those pods on a node without considering Pod Disruption Budget. + /// The request should only proceed if an entity matches this string. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, CancellationToken cancellationToken = default) + public Response Delete(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, bool? ignorePodDisruptionBudget = null, string ifMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName, ignorePodDisruptionBudget, ifMatch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -626,6 +654,106 @@ public Response GetUpgradeProfile(string subscripti } } + internal RequestUriBuilder CreateDeleteMachinesRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, AgentPoolDeleteMachinesParameter machines) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/agentPools/", false); + uri.AppendPath(agentPoolName, true); + uri.AppendPath("/deleteMachines", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteMachinesRequest(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, AgentPoolDeleteMachinesParameter machines) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/agentPools/", false); + uri.AppendPath(agentPoolName, true); + uri.AppendPath("/deleteMachines", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(machines, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Deletes specific machines in an agent pool. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed cluster resource. + /// The name of the agent pool. + /// A list of machines from the agent pool to be deleted. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteMachinesAsync(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, AgentPoolDeleteMachinesParameter machines, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); + Argument.AssertNotNull(machines, nameof(machines)); + + using var message = CreateDeleteMachinesRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName, machines); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes specific machines in an agent pool. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed cluster resource. + /// The name of the agent pool. + /// A list of machines from the agent pool to be deleted. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response DeleteMachines(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, AgentPoolDeleteMachinesParameter machines, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); + Argument.AssertNotNull(machines, nameof(machines)); + + using var message = CreateDeleteMachinesRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName, machines); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + internal RequestUriBuilder CreateGetAvailableAgentPoolVersionsRequestUri(string subscriptionId, string resourceGroupName, string resourceName) { var uri = new RawRequestUriBuilder(); diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/MachinesRestOperations.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/MachinesRestOperations.cs new file mode 100644 index 000000000000..0eea2b256112 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/MachinesRestOperations.cs @@ -0,0 +1,341 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ContainerService.Models; + +namespace Azure.ResourceManager.ContainerService +{ + internal partial class MachinesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of MachinesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public MachinesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-03-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/agentPools/", false); + uri.AppendPath(agentPoolName, true); + uri.AppendPath("/machines", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/agentPools/", false); + uri.AppendPath(agentPoolName, true); + uri.AppendPath("/machines", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets a list of machines in the specified agent pool. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed cluster resource. + /// The name of the agent pool. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MachineListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = MachineListResult.DeserializeMachineListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets a list of machines in the specified agent pool. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed cluster resource. + /// The name of the agent pool. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MachineListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = MachineListResult.DeserializeMachineListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, string machineName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/agentPools/", false); + uri.AppendPath(agentPoolName, true); + uri.AppendPath("/machines/", false); + uri.AppendPath(machineName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, string machineName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/agentPools/", false); + uri.AppendPath(agentPoolName, true); + uri.AppendPath("/machines/", false); + uri.AppendPath(machineName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a specific machine in the specified agent pool. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed cluster resource. + /// The name of the agent pool. + /// host name of the machine. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, string machineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); + Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName, machineName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MachineData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = MachineData.DeserializeMachineData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MachineData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a specific machine in the specified agent pool. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed cluster resource. + /// The name of the agent pool. + /// host name of the machine. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, string machineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); + Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName, machineName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MachineData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = MachineData.DeserializeMachineData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MachineData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets a list of machines in the specified agent pool. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed cluster resource. + /// The name of the agent pool. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, resourceName, agentPoolName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MachineListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = MachineListResult.DeserializeMachineListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets a list of machines in the specified agent pool. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed cluster resource. + /// The name of the agent pool. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, resourceName, agentPoolName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MachineListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = MachineListResult.DeserializeMachineListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/MaintenanceConfigurationsRestOperations.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/MaintenanceConfigurationsRestOperations.cs index 85c36138e890..9989f40bc38f 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/MaintenanceConfigurationsRestOperations.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/MaintenanceConfigurationsRestOperations.cs @@ -32,7 +32,7 @@ public MaintenanceConfigurationsRestOperations(HttpPipeline pipeline, string app { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-10-01"; + _apiVersion = apiVersion ?? "2025-03-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/ManagedClustersRestOperations.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/ManagedClustersRestOperations.cs index cd05eefd8423..ac1b79b78232 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/ManagedClustersRestOperations.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/ManagedClustersRestOperations.cs @@ -32,108 +32,10 @@ public ManagedClustersRestOperations(HttpPipeline pipeline, string applicationId { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-10-01"; + _apiVersion = apiVersion ?? "2025-03-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateGetOSOptionsRequestUri(string subscriptionId, AzureLocation location, ResourceType? resourceType) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ContainerService/locations/", false); - uri.AppendPath(location, true); - uri.AppendPath("/osOptions/default", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (resourceType != null) - { - uri.AppendQuery("resource-type", resourceType.Value, true); - } - return uri; - } - - internal HttpMessage CreateGetOSOptionsRequest(string subscriptionId, AzureLocation location, ResourceType? resourceType) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ContainerService/locations/", false); - uri.AppendPath(location, true); - uri.AppendPath("/osOptions/default", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (resourceType != null) - { - uri.AppendQuery("resource-type", resourceType.Value, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets supported OS options in the specified subscription. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the Azure region. - /// The resource type for which the OS options needs to be returned. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> GetOSOptionsAsync(string subscriptionId, AzureLocation location, ResourceType? resourceType = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateGetOSOptionsRequest(subscriptionId, location, resourceType); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - OSOptionProfileData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = OSOptionProfileData.DeserializeOSOptionProfileData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((OSOptionProfileData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets supported OS options in the specified subscription. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the Azure region. - /// The resource type for which the OS options needs to be returned. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response GetOSOptions(string subscriptionId, AzureLocation location, ResourceType? resourceType = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateGetOSOptionsRequest(subscriptionId, location, resourceType); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - OSOptionProfileData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = OSOptionProfileData.DeserializeOSOptionProfileData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((OSOptionProfileData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - internal RequestUriBuilder CreateListKubernetesVersionsRequestUri(string subscriptionId, AzureLocation location) { var uri = new RawRequestUriBuilder(); @@ -1000,7 +902,7 @@ public Response Get(string subscriptionId, s } } - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceManagedClusterData data) + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceManagedClusterData data, string ifMatch, string ifNoneMatch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -1014,7 +916,7 @@ internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, return uri; } - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceManagedClusterData data) + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceManagedClusterData data, string ifMatch, string ifNoneMatch) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -1029,6 +931,14 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r uri.AppendPath(resourceName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } + if (ifNoneMatch != null) + { + request.Headers.Add("If-None-Match", ifNoneMatch); + } request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); var content = new Utf8JsonRequestContent(); @@ -1043,17 +953,19 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r /// The name of the resource group. The name is case insensitive. /// The name of the managed cluster resource. /// The managed cluster to create or update. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceManagedClusterData data, CancellationToken cancellationToken = default) + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceManagedClusterData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, resourceName, data); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, resourceName, data, ifMatch, ifNoneMatch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -1070,17 +982,19 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re /// The name of the resource group. The name is case insensitive. /// The name of the managed cluster resource. /// The managed cluster to create or update. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceManagedClusterData data, CancellationToken cancellationToken = default) + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceManagedClusterData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, resourceName, data); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, resourceName, data, ifMatch, ifNoneMatch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -1092,7 +1006,7 @@ public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, } } - internal RequestUriBuilder CreateUpdateTagsRequestUri(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceTagsObject containerServiceTagsObject) + internal RequestUriBuilder CreateUpdateTagsRequestUri(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceTagsObject containerServiceTagsObject, string ifMatch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -1106,7 +1020,7 @@ internal RequestUriBuilder CreateUpdateTagsRequestUri(string subscriptionId, str return uri; } - internal HttpMessage CreateUpdateTagsRequest(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceTagsObject containerServiceTagsObject) + internal HttpMessage CreateUpdateTagsRequest(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceTagsObject containerServiceTagsObject, string ifMatch) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -1121,6 +1035,10 @@ internal HttpMessage CreateUpdateTagsRequest(string subscriptionId, string resou uri.AppendPath(resourceName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); var content = new Utf8JsonRequestContent(); @@ -1135,17 +1053,18 @@ internal HttpMessage CreateUpdateTagsRequest(string subscriptionId, string resou /// The name of the resource group. The name is case insensitive. /// The name of the managed cluster resource. /// Parameters supplied to the Update Managed Cluster Tags operation. + /// The request should only proceed if an entity matches this string. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task UpdateTagsAsync(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceTagsObject containerServiceTagsObject, CancellationToken cancellationToken = default) + public async Task UpdateTagsAsync(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceTagsObject containerServiceTagsObject, string ifMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); Argument.AssertNotNull(containerServiceTagsObject, nameof(containerServiceTagsObject)); - using var message = CreateUpdateTagsRequest(subscriptionId, resourceGroupName, resourceName, containerServiceTagsObject); + using var message = CreateUpdateTagsRequest(subscriptionId, resourceGroupName, resourceName, containerServiceTagsObject, ifMatch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -1161,17 +1080,18 @@ public async Task UpdateTagsAsync(string subscriptionId, string resour /// The name of the resource group. The name is case insensitive. /// The name of the managed cluster resource. /// Parameters supplied to the Update Managed Cluster Tags operation. + /// The request should only proceed if an entity matches this string. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response UpdateTags(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceTagsObject containerServiceTagsObject, CancellationToken cancellationToken = default) + public Response UpdateTags(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceTagsObject containerServiceTagsObject, string ifMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); Argument.AssertNotNull(containerServiceTagsObject, nameof(containerServiceTagsObject)); - using var message = CreateUpdateTagsRequest(subscriptionId, resourceGroupName, resourceName, containerServiceTagsObject); + using var message = CreateUpdateTagsRequest(subscriptionId, resourceGroupName, resourceName, containerServiceTagsObject, ifMatch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -1182,7 +1102,7 @@ public Response UpdateTags(string subscriptionId, string resourceGroupName, stri } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string resourceName) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string ifMatch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -1196,7 +1116,7 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string resourceName) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string resourceName, string ifMatch) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -1211,6 +1131,10 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendPath(resourceName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); return message; @@ -1220,16 +1144,17 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the managed cluster resource. + /// The request should only proceed if an entity matches this string. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string resourceName, string ifMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName, ifMatch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -1245,16 +1170,17 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the managed cluster resource. + /// The request should only proceed if an entity matches this string. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + public Response Delete(string subscriptionId, string resourceGroupName, string resourceName, string ifMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName, ifMatch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs index 69d51fb6d1d0..a7fb374690ec 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs @@ -32,7 +32,7 @@ public PrivateEndpointConnectionsRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-10-01"; + _apiVersion = apiVersion ?? "2025-03-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs index b7313ad968ed..d0827ab11f1a 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs @@ -32,7 +32,7 @@ public PrivateLinkResourcesRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-10-01"; + _apiVersion = apiVersion ?? "2025-03-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/ResolvePrivateLinkServiceIdRestOperations.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/ResolvePrivateLinkServiceIdRestOperations.cs index f7680dc72cdc..ab6d9cb29488 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/ResolvePrivateLinkServiceIdRestOperations.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/ResolvePrivateLinkServiceIdRestOperations.cs @@ -32,7 +32,7 @@ public ResolvePrivateLinkServiceIdRestOperations(HttpPipeline pipeline, string a { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-10-01"; + _apiVersion = apiVersion ?? "2025-03-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/SnapshotsRestOperations.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/SnapshotsRestOperations.cs index 54f88932263d..549caa1157c2 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/SnapshotsRestOperations.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/SnapshotsRestOperations.cs @@ -32,7 +32,7 @@ public SnapshotsRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-10-01"; + _apiVersion = apiVersion ?? "2025-03-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/TrustedAccessRoleBindingsRestOperations.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/TrustedAccessRoleBindingsRestOperations.cs index 0ac7e97fa71c..91f5d20898ee 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/TrustedAccessRoleBindingsRestOperations.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/TrustedAccessRoleBindingsRestOperations.cs @@ -32,7 +32,7 @@ public TrustedAccessRoleBindingsRestOperations(HttpPipeline pipeline, string app { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-10-01"; + _apiVersion = apiVersion ?? "2025-03-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/TrustedAccessRolesRestOperations.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/TrustedAccessRolesRestOperations.cs index 5e561646f440..59e1ca2608a9 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/TrustedAccessRolesRestOperations.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/TrustedAccessRolesRestOperations.cs @@ -32,7 +32,7 @@ public TrustedAccessRolesRestOperations(HttpPipeline pipeline, string applicatio { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-10-01"; + _apiVersion = apiVersion ?? "2025-03-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/autorest.md b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/autorest.md index c904c624099b..bb994b961d52 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/autorest.md +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/autorest.md @@ -8,7 +8,7 @@ azure-arm: true csharp: true library-name: ContainerService namespace: Azure.ResourceManager.ContainerService -require: https://github.com/Azure/azure-rest-api-specs/blob/8e674dd2a88ae73868c6fa7593a0ba4371e45991/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/readme.md #tag: package-2023-10 output-folder: $(this-folder)/Generated clear-output-folder: true diff --git a/sdk/storage/ci.yml b/sdk/storage/ci.yml index 2ca0501b60bd..4e749e6b85b1 100644 --- a/sdk/storage/ci.yml +++ b/sdk/storage/ci.yml @@ -12,6 +12,8 @@ trigger: - sdk/storage/Azure.Storage.DataMovement/ - sdk/storage/Azure.Storage.DataMovement.Blobs/ - sdk/storage/Azure.Storage.DataMovement.Files/ + exclude: + - sdk/storage/Azure.ResourceManager.Storage/ - sdk/storage/Azure.Storage.DataMovement.Blobs.Files.Shares/ exclude: - sdk/storage/Azure.ResourceManager.Storage/