From 519152f3601f5bf8b9f2d884802973cb9fbfeb60 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 24 Feb 2022 07:23:14 +0000 Subject: [PATCH] CodeGen from PR 17955 in Azure/azure-rest-api-specs Merge 6b1df82ccf273c334f7bb56cde0fc91374dcf41c into e1159223cc1d4627d328f2543e8e6cd1f334ec42 --- .../src/Generated/AgentPoolsOperations.cs | 21 +- .../src/Generated/ContainerServiceClient.cs | 8 +- .../src/Generated/IAgentPoolsOperations.cs | 4 +- .../src/Generated/IContainerServiceClient.cs | 5 + .../Generated/IManagedClustersOperations.cs | 9 +- .../src/Generated/ISnapshotsOperations.cs | 215 +++ .../Generated/ManagedClustersOperations.cs | 13 +- .../ManagedClustersOperationsExtensions.cs | 20 +- .../src/Generated/Models/AgentPool.cs | 81 +- ...gentPoolsUpgradeNodeImageVersionHeaders.cs | 54 + .../src/Generated/Models/AzureKeyVaultKms.cs | 73 + .../Models/ContainerServiceNetworkProfile.cs | 55 +- .../src/Generated/Models/CreationData.cs | 53 + .../src/Generated/Models/Format.cs | 30 + .../src/Generated/Models/IpFamily.cs | 22 + .../src/Generated/Models/ManagedCluster.cs | 52 +- .../ManagedClusterAPIServerAccessProfile.cs | 11 +- .../Models/ManagedClusterAgentPoolProfile.cs | 20 +- ...anagedClusterAgentPoolProfileProperties.cs | 81 +- .../ManagedClusterLoadBalancerProfile.cs | 12 +- ...erLoadBalancerProfileManagedOutboundIPs.cs | 33 +- .../Models/ManagedClusterOIDCIssuerProfile.cs | 62 + .../Models/ManagedClusterSecurityProfile.cs | 14 +- .../Models/ManagedClusterWindowsProfile.cs | 11 +- .../src/Generated/Models/NetworkPlugin.cs | 5 + .../Generated/Models/PublicNetworkAccess.cs | 22 + .../src/Generated/Models/Snapshot.cs | 142 ++ .../src/Generated/Models/SnapshotType.cs | 24 + .../Generated/Models/WindowsGmsaProfile.cs | 82 + .../src/Generated/Models/WorkloadRuntime.cs | 29 + .../SdkInfo_ContainerServiceClient.cs | 26 +- .../src/Generated/SnapshotsOperations.cs | 1674 +++++++++++++++++ .../SnapshotsOperationsExtensions.cs | 326 ++++ 33 files changed, 3228 insertions(+), 61 deletions(-) create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ISnapshotsOperations.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPoolsUpgradeNodeImageVersionHeaders.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AzureKeyVaultKms.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/CreationData.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/Format.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/IpFamily.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterOIDCIssuerProfile.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/PublicNetworkAccess.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/Snapshot.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/SnapshotType.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/WindowsGmsaProfile.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/WorkloadRuntime.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/SnapshotsOperations.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/SnapshotsOperationsExtensions.cs diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/AgentPoolsOperations.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/AgentPoolsOperations.cs index 57e020a86678..de3a02b4c0b5 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/AgentPoolsOperations.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/AgentPoolsOperations.cs @@ -1022,10 +1022,10 @@ internal AgentPoolsOperations(ContainerServiceClient client) /// /// The cancellation token. /// - public async Task> UpgradeNodeImageVersionWithHttpMessagesAsync(string resourceGroupName, string resourceName, string agentPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpgradeNodeImageVersionWithHttpMessagesAsync(string resourceGroupName, string resourceName, string agentPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginUpgradeNodeImageVersionWithHttpMessagesAsync(resourceGroupName, resourceName, agentPoolName, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginUpgradeNodeImageVersionWithHttpMessagesAsync(resourceGroupName, resourceName, agentPoolName, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -1537,7 +1537,7 @@ internal AgentPoolsOperations(ContainerServiceClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpgradeNodeImageVersionWithHttpMessagesAsync(string resourceGroupName, string resourceName, string agentPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginUpgradeNodeImageVersionWithHttpMessagesAsync(string resourceGroupName, string resourceName, string agentPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -1699,7 +1699,7 @@ internal AgentPoolsOperations(ContainerServiceClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1724,6 +1724,19 @@ internal AgentPoolsOperations(ContainerServiceClient client) throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ContainerServiceClient.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ContainerServiceClient.cs index 79b8567011fc..77c6ebb453c8 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ContainerServiceClient.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ContainerServiceClient.cs @@ -111,6 +111,11 @@ public partial class ContainerServiceClient : ServiceClient public virtual IResolvePrivateLinkServiceIdOperations ResolvePrivateLinkServiceId { get; private set; } + /// + /// Gets the ISnapshotsOperations. + /// + public virtual ISnapshotsOperations Snapshots { get; private set; } + /// /// Initializes a new instance of the ContainerServiceClient class. /// @@ -359,8 +364,9 @@ private void Initialize() PrivateEndpointConnections = new PrivateEndpointConnectionsOperations(this); PrivateLinkResources = new PrivateLinkResourcesOperations(this); ResolvePrivateLinkServiceId = new ResolvePrivateLinkServiceIdOperations(this); + Snapshots = new SnapshotsOperations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2021-07-01"; + ApiVersion = "2022-02-02-preview"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IAgentPoolsOperations.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IAgentPoolsOperations.cs index 7bf6c2693960..5b1585581467 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IAgentPoolsOperations.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IAgentPoolsOperations.cs @@ -225,7 +225,7 @@ public partial interface IAgentPoolsOperations /// /// Thrown when a required parameter is null /// - Task> UpgradeNodeImageVersionWithHttpMessagesAsync(string resourceGroupName, string resourceName, string agentPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpgradeNodeImageVersionWithHttpMessagesAsync(string resourceGroupName, string resourceName, string agentPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Creates or updates an agent pool in the specified managed cluster. /// @@ -316,7 +316,7 @@ public partial interface IAgentPoolsOperations /// /// Thrown when a required parameter is null /// - Task> BeginUpgradeNodeImageVersionWithHttpMessagesAsync(string resourceGroupName, string resourceName, string agentPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginUpgradeNodeImageVersionWithHttpMessagesAsync(string resourceGroupName, string resourceName, string agentPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets a list of agent pools in the specified managed cluster. /// diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IContainerServiceClient.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IContainerServiceClient.cs index 2b88f1d25012..4cad61894d05 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IContainerServiceClient.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IContainerServiceClient.cs @@ -106,5 +106,10 @@ public partial interface IContainerServiceClient : System.IDisposable /// IResolvePrivateLinkServiceIdOperations ResolvePrivateLinkServiceId { get; } + /// + /// Gets the ISnapshotsOperations. + /// + ISnapshotsOperations Snapshots { get; } + } } diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IManagedClustersOperations.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IManagedClustersOperations.cs index 23d59d0baea0..5a85746177f5 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IManagedClustersOperations.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IManagedClustersOperations.cs @@ -163,6 +163,13 @@ public partial interface IManagedClustersOperations /// /// server fqdn type for credentials to be returned /// + /// + /// Only apply to AAD clusters, specifies the format of returned + /// kubeconfig. Format 'azure' will return azure auth-provider + /// kubeconfig; format 'exec' will return exec format kubeconfig, which + /// requires kubelogin binary in the path. Possible values include: + /// 'azure', 'exec' + /// /// /// The headers that will be added to request. /// @@ -178,7 +185,7 @@ public partial interface IManagedClustersOperations /// /// Thrown when a required parameter is null /// - Task> ListClusterAdminCredentialsWithHttpMessagesAsync(string resourceGroupName, string resourceName, string serverFqdn = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListClusterAdminCredentialsWithHttpMessagesAsync(string resourceGroupName, string resourceName, string serverFqdn = default(string), string format = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists the user credentials of a managed cluster. /// diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ISnapshotsOperations.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ISnapshotsOperations.cs new file mode 100644 index 000000000000..8f2ccc2845ea --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ISnapshotsOperations.cs @@ -0,0 +1,215 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.ContainerService +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// SnapshotsOperations operations. + /// + public partial interface ISnapshotsOperations + { + /// + /// Gets a list of snapshots in the specified subscription. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists snapshots in the specified subscription and resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a snapshot. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a snapshot. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// The snapshot to create or update. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string resourceName, Snapshot parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates tags on a snapshot. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// Resource tags. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string resourceName, IDictionary tags = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a snapshot. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a list of snapshots in the specified subscription. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists snapshots in the specified subscription and resource group. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ManagedClustersOperations.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ManagedClustersOperations.cs index 1d51d037c289..8981e466c8bd 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ManagedClustersOperations.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ManagedClustersOperations.cs @@ -1082,6 +1082,12 @@ internal ManagedClustersOperations(ContainerServiceClient client) /// /// server fqdn type for credentials to be returned /// + /// + /// Only apply to AAD clusters, specifies the format of returned kubeconfig. + /// Format 'azure' will return azure auth-provider kubeconfig; format 'exec' + /// will return exec format kubeconfig, which requires kubelogin binary in the + /// path. Possible values include: 'azure', 'exec' + /// /// /// Headers that will be added to request. /// @@ -1103,7 +1109,7 @@ internal ManagedClustersOperations(ContainerServiceClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListClusterAdminCredentialsWithHttpMessagesAsync(string resourceGroupName, string resourceName, string serverFqdn = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListClusterAdminCredentialsWithHttpMessagesAsync(string resourceGroupName, string resourceName, string serverFqdn = default(string), string format = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -1153,6 +1159,7 @@ internal ManagedClustersOperations(ContainerServiceClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("resourceName", resourceName); tracingParameters.Add("serverFqdn", serverFqdn); + tracingParameters.Add("format", format); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListClusterAdminCredentials", tracingParameters); } @@ -1171,6 +1178,10 @@ internal ManagedClustersOperations(ContainerServiceClient client) { _queryParameters.Add(string.Format("server-fqdn={0}", System.Uri.EscapeDataString(serverFqdn))); } + if (format != null) + { + _queryParameters.Add(string.Format("format={0}", System.Uri.EscapeDataString(format))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ManagedClustersOperationsExtensions.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ManagedClustersOperationsExtensions.cs index 5a64e1e4c822..0a309b833a5b 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ManagedClustersOperationsExtensions.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ManagedClustersOperationsExtensions.cs @@ -242,9 +242,15 @@ public static ManagedClusterAccessProfile GetAccessProfile(this IManagedClusters /// /// server fqdn type for credentials to be returned /// - public static CredentialResults ListClusterAdminCredentials(this IManagedClustersOperations operations, string resourceGroupName, string resourceName, string serverFqdn = default(string)) + /// + /// Only apply to AAD clusters, specifies the format of returned kubeconfig. + /// Format 'azure' will return azure auth-provider kubeconfig; format 'exec' + /// will return exec format kubeconfig, which requires kubelogin binary in the + /// path. Possible values include: 'azure', 'exec' + /// + public static CredentialResults ListClusterAdminCredentials(this IManagedClustersOperations operations, string resourceGroupName, string resourceName, string serverFqdn = default(string), string format = default(string)) { - return operations.ListClusterAdminCredentialsAsync(resourceGroupName, resourceName, serverFqdn).GetAwaiter().GetResult(); + return operations.ListClusterAdminCredentialsAsync(resourceGroupName, resourceName, serverFqdn, format).GetAwaiter().GetResult(); } /// @@ -262,12 +268,18 @@ public static ManagedClusterAccessProfile GetAccessProfile(this IManagedClusters /// /// server fqdn type for credentials to be returned /// + /// + /// Only apply to AAD clusters, specifies the format of returned kubeconfig. + /// Format 'azure' will return azure auth-provider kubeconfig; format 'exec' + /// will return exec format kubeconfig, which requires kubelogin binary in the + /// path. Possible values include: 'azure', 'exec' + /// /// /// The cancellation token. /// - public static async Task ListClusterAdminCredentialsAsync(this IManagedClustersOperations operations, string resourceGroupName, string resourceName, string serverFqdn = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListClusterAdminCredentialsAsync(this IManagedClustersOperations operations, string resourceGroupName, string resourceName, string serverFqdn = default(string), string format = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListClusterAdminCredentialsWithHttpMessagesAsync(resourceGroupName, resourceName, serverFqdn, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListClusterAdminCredentialsWithHttpMessagesAsync(resourceGroupName, resourceName, serverFqdn, format, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPool.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPool.cs index 490bb7791c19..059f903d3f95 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPool.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPool.cs @@ -48,6 +48,10 @@ public AgentPool() /// 'Ephemeral' /// Possible values include: 'OS', /// 'Temporary' + /// Possible values include: + /// 'OCIContainer', 'WasmWasi' + /// Message of the day for Linux nodes, + /// base64-encoded. /// The ID of the subnet which agent pool /// nodes and optionally pods will join on startup. /// The ID of the subnet which pods will join @@ -77,8 +81,8 @@ public AgentPool() /// agentpool /// The current deployment or /// provisioning state. - /// Describes whether the Agent Pool is - /// Running or Stopped + /// Whether the Agent Pool is running or + /// stopped. /// The list of Availability zones to /// use for nodes. This can only be specified if the AgentPoolType /// property is 'VirtualMachineScaleSets'. @@ -114,7 +118,15 @@ public AgentPool() /// GPUInstanceProfile to be used to /// specify GPU MIG instance profile for supported GPU VM SKU. Possible /// values include: 'MIG1g', 'MIG2g', 'MIG3g', 'MIG4g', 'MIG7g' - public AgentPool(string id = default(string), string name = default(string), string type = default(string), int? count = default(int?), string vmSize = default(string), int? osDiskSizeGB = default(int?), string osDiskType = default(string), string kubeletDiskType = default(string), string vnetSubnetID = default(string), string podSubnetID = default(string), int? maxPods = default(int?), string osType = default(string), string osSKU = default(string), int? maxCount = default(int?), int? minCount = default(int?), bool? enableAutoScaling = default(bool?), string scaleDownMode = default(string), string agentPoolType = default(string), string mode = default(string), string orchestratorVersion = default(string), string nodeImageVersion = default(string), AgentPoolUpgradeSettings upgradeSettings = default(AgentPoolUpgradeSettings), string provisioningState = default(string), PowerState powerState = default(PowerState), IList availabilityZones = default(IList), bool? enableNodePublicIP = default(bool?), string nodePublicIPPrefixID = default(string), string scaleSetPriority = default(string), string scaleSetEvictionPolicy = default(string), double? spotMaxPrice = default(double?), IDictionary tags = default(IDictionary), IDictionary nodeLabels = default(IDictionary), IList nodeTaints = default(IList), string proximityPlacementGroupID = default(string), KubeletConfig kubeletConfig = default(KubeletConfig), LinuxOSConfig linuxOSConfig = default(LinuxOSConfig), bool? enableEncryptionAtHost = default(bool?), bool? enableUltraSSD = default(bool?), bool? enableFIPS = default(bool?), string gpuInstanceProfile = default(string)) + /// 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. + /// The fully qualified resource ID of the + /// Dedicated Host Group to provision virtual machines from, used only + /// in creation scenario and not allowed to changed once set. + public AgentPool(string id = default(string), string name = default(string), string type = default(string), int? count = default(int?), string vmSize = default(string), int? osDiskSizeGB = default(int?), string osDiskType = default(string), string kubeletDiskType = default(string), string workloadRuntime = default(string), string messageOfTheDay = default(string), string vnetSubnetID = default(string), string podSubnetID = default(string), int? maxPods = default(int?), string osType = default(string), string osSKU = default(string), int? maxCount = default(int?), int? minCount = default(int?), bool? enableAutoScaling = default(bool?), string scaleDownMode = default(string), string agentPoolType = default(string), string mode = default(string), string orchestratorVersion = default(string), string nodeImageVersion = default(string), AgentPoolUpgradeSettings upgradeSettings = default(AgentPoolUpgradeSettings), string provisioningState = default(string), PowerState powerState = default(PowerState), IList availabilityZones = default(IList), bool? enableNodePublicIP = default(bool?), string nodePublicIPPrefixID = default(string), string scaleSetPriority = default(string), string scaleSetEvictionPolicy = default(string), double? spotMaxPrice = default(double?), IDictionary tags = default(IDictionary), IDictionary nodeLabels = default(IDictionary), IList nodeTaints = default(IList), string proximityPlacementGroupID = default(string), KubeletConfig kubeletConfig = default(KubeletConfig), LinuxOSConfig linuxOSConfig = default(LinuxOSConfig), bool? enableEncryptionAtHost = default(bool?), bool? enableUltraSSD = default(bool?), bool? enableFIPS = default(bool?), string gpuInstanceProfile = default(string), CreationData creationData = default(CreationData), string capacityReservationGroupID = default(string), string hostGroupID = default(string)) : base(id, name, type) { Count = count; @@ -122,6 +134,8 @@ public AgentPool() OsDiskSizeGB = osDiskSizeGB; OsDiskType = osDiskType; KubeletDiskType = kubeletDiskType; + WorkloadRuntime = workloadRuntime; + MessageOfTheDay = messageOfTheDay; VnetSubnetID = vnetSubnetID; PodSubnetID = podSubnetID; MaxPods = maxPods; @@ -154,6 +168,9 @@ public AgentPool() EnableUltraSSD = enableUltraSSD; EnableFIPS = enableFIPS; GpuInstanceProfile = gpuInstanceProfile; + CreationData = creationData; + CapacityReservationGroupID = capacityReservationGroupID; + HostGroupID = hostGroupID; CustomInit(); } @@ -200,6 +217,25 @@ public AgentPool() [JsonProperty(PropertyName = "properties.kubeletDiskType")] public string KubeletDiskType { get; set; } + /// + /// Gets or sets possible values include: 'OCIContainer', 'WasmWasi' + /// + [JsonProperty(PropertyName = "properties.workloadRuntime")] + public string WorkloadRuntime { get; set; } + + /// + /// Gets or sets message of the day for Linux nodes, base64-encoded. + /// + /// + /// 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). + /// + [JsonProperty(PropertyName = "properties.messageOfTheDay")] + public string MessageOfTheDay { get; set; } + /// /// Gets or sets the ID of the subnet which agent pool nodes and /// optionally pods will join on startup. @@ -320,10 +356,17 @@ public AgentPool() public string ProvisioningState { get; private set; } /// - /// Gets describes whether the Agent Pool is Running or Stopped + /// Gets or sets whether the Agent Pool is running or stopped. /// + /// + /// 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 + /// [JsonProperty(PropertyName = "properties.powerState")] - public PowerState PowerState { get; private set; } + public PowerState PowerState { get; set; } /// /// Gets or sets the list of Availability zones to use for nodes. This @@ -469,6 +512,34 @@ public AgentPool() [JsonProperty(PropertyName = "properties.gpuInstanceProfile")] public string GpuInstanceProfile { get; set; } + /// + /// Gets or sets creationData to be used to specify the source Snapshot + /// ID if the node pool will be created/upgraded using a snapshot. + /// + [JsonProperty(PropertyName = "properties.creationData")] + public CreationData CreationData { get; set; } + + /// + /// Gets or sets AKS will associate the specified agent pool with the + /// Capacity Reservation Group. + /// + [JsonProperty(PropertyName = "properties.capacityReservationGroupID")] + public string CapacityReservationGroupID { get; set; } + + /// + /// Gets or sets the fully qualified resource ID of the Dedicated Host + /// Group to provision virtual machines from, used only in creation + /// scenario and not allowed to changed once set. + /// + /// + /// 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). + /// + [JsonProperty(PropertyName = "properties.hostGroupID")] + public string HostGroupID { get; set; } + /// /// Validate the object. /// diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPoolsUpgradeNodeImageVersionHeaders.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPoolsUpgradeNodeImageVersionHeaders.cs new file mode 100644 index 000000000000..6b8f401fe88f --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPoolsUpgradeNodeImageVersionHeaders.cs @@ -0,0 +1,54 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.ContainerService.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for UpgradeNodeImageVersion operation. + /// + public partial class AgentPoolsUpgradeNodeImageVersionHeaders + { + /// + /// Initializes a new instance of the + /// AgentPoolsUpgradeNodeImageVersionHeaders class. + /// + public AgentPoolsUpgradeNodeImageVersionHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AgentPoolsUpgradeNodeImageVersionHeaders class. + /// + /// URL to query for status of the + /// operation. + public AgentPoolsUpgradeNodeImageVersionHeaders(string azureAsyncOperation = default(string)) + { + AzureAsyncOperation = azureAsyncOperation; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets URL to query for status of the operation. + /// + [JsonProperty(PropertyName = "Azure-AsyncOperation")] + public string AzureAsyncOperation { get; set; } + + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AzureKeyVaultKms.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AzureKeyVaultKms.cs new file mode 100644 index 000000000000..27c90cf3d72d --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AzureKeyVaultKms.cs @@ -0,0 +1,73 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.ContainerService.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Azure Key Vault key management service settings for the security + /// profile. + /// + public partial class AzureKeyVaultKms + { + /// + /// Initializes a new instance of the AzureKeyVaultKms class. + /// + public AzureKeyVaultKms() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureKeyVaultKms class. + /// + /// Whether to enable Azure Key Vault key + /// management service. The default is false. + /// Identifier of Azure Key Vault key. See [key + /// identifier + /// format](https://docs.microsoft.com/en-us/azure/key-vault/general/about-keys-secrets-certificates#vault-name-and-object-name) + /// for more details. When Azure Key Vault key management service is + /// enabled, this field is required and must be a valid key identifier. + /// When Azure Key Vault key management service is disabled, leave the + /// field empty. + public AzureKeyVaultKms(bool? enabled = default(bool?), string keyId = default(string)) + { + Enabled = enabled; + KeyId = keyId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets whether to enable Azure Key Vault key management + /// service. The default is false. + /// + [JsonProperty(PropertyName = "enabled")] + public bool? Enabled { get; set; } + + /// + /// Gets or sets identifier of Azure Key Vault key. See [key identifier + /// format](https://docs.microsoft.com/en-us/azure/key-vault/general/about-keys-secrets-certificates#vault-name-and-object-name) + /// for more details. When Azure Key Vault key management service is + /// enabled, this field is required and must be a valid key identifier. + /// When Azure Key Vault key management service is disabled, leave the + /// field empty. + /// + [JsonProperty(PropertyName = "keyId")] + public string KeyId { get; set; } + + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ContainerServiceNetworkProfile.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ContainerServiceNetworkProfile.cs index 74371e2d92dd..108e7c801170 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ContainerServiceNetworkProfile.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ContainerServiceNetworkProfile.cs @@ -12,6 +12,8 @@ namespace Microsoft.Azure.Management.ContainerService.Models { using Microsoft.Rest; using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -33,8 +35,8 @@ public ContainerServiceNetworkProfile() /// class. /// /// Network plugin used for building the - /// Kubernetes network. Possible values include: 'azure', - /// 'kubenet' + /// Kubernetes network. Possible values include: 'azure', 'kubenet', + /// 'none' /// Network policy used for building the /// Kubernetes network. Possible values include: 'calico', /// 'azure' @@ -59,7 +61,13 @@ public ContainerServiceNetworkProfile() /// balancer. /// Profile of the cluster NAT /// gateway. - public ContainerServiceNetworkProfile(string networkPlugin = default(string), string networkPolicy = default(string), string networkMode = default(string), string podCidr = default(string), string serviceCidr = default(string), string dnsServiceIP = default(string), string dockerBridgeCidr = default(string), string outboundType = default(string), string loadBalancerSku = default(string), ManagedClusterLoadBalancerProfile loadBalancerProfile = default(ManagedClusterLoadBalancerProfile), ManagedClusterNATGatewayProfile natGatewayProfile = default(ManagedClusterNATGatewayProfile)) + /// The CIDR notation IP ranges from which to + /// assign pod IPs. + /// The CIDR notation IP ranges from which + /// to assign service cluster IPs. + /// The IP families used to specify IP + /// versions available to the cluster. + public ContainerServiceNetworkProfile(string networkPlugin = default(string), string networkPolicy = default(string), string networkMode = default(string), string podCidr = default(string), string serviceCidr = default(string), string dnsServiceIP = default(string), string dockerBridgeCidr = default(string), string outboundType = default(string), string loadBalancerSku = default(string), ManagedClusterLoadBalancerProfile loadBalancerProfile = default(ManagedClusterLoadBalancerProfile), ManagedClusterNATGatewayProfile natGatewayProfile = default(ManagedClusterNATGatewayProfile), IList podCidrs = default(IList), IList serviceCidrs = default(IList), IList ipFamilies = default(IList)) { NetworkPlugin = networkPlugin; NetworkPolicy = networkPolicy; @@ -72,6 +80,9 @@ public ContainerServiceNetworkProfile() LoadBalancerSku = loadBalancerSku; LoadBalancerProfile = loadBalancerProfile; NatGatewayProfile = natGatewayProfile; + PodCidrs = podCidrs; + ServiceCidrs = serviceCidrs; + IpFamilies = ipFamilies; CustomInit(); } @@ -82,7 +93,7 @@ public ContainerServiceNetworkProfile() /// /// Gets or sets network plugin used for building the Kubernetes - /// network. Possible values include: 'azure', 'kubenet' + /// network. Possible values include: 'azure', 'kubenet', 'none' /// [JsonProperty(PropertyName = "networkPlugin")] public string NetworkPlugin { get; set; } @@ -171,6 +182,42 @@ public ContainerServiceNetworkProfile() [JsonProperty(PropertyName = "natGatewayProfile")] public ManagedClusterNATGatewayProfile NatGatewayProfile { get; set; } + /// + /// Gets or sets the CIDR notation IP ranges from which to assign pod + /// IPs. + /// + /// + /// One IPv4 CIDR is expected for single-stack networking. Two CIDRs, + /// one for each IP family (IPv4/IPv6), is expected for dual-stack + /// networking. + /// + [JsonProperty(PropertyName = "podCidrs")] + public IList PodCidrs { get; set; } + + /// + /// Gets or sets the CIDR notation IP ranges from which to assign + /// service cluster IPs. + /// + /// + /// 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. + /// + [JsonProperty(PropertyName = "serviceCidrs")] + public IList ServiceCidrs { get; set; } + + /// + /// Gets or sets the IP families used to specify IP versions available + /// to the cluster. + /// + /// + /// 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. + /// + [JsonProperty(PropertyName = "ipFamilies")] + public IList IpFamilies { get; set; } + /// /// Validate the object. /// diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/CreationData.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/CreationData.cs new file mode 100644 index 000000000000..64cdf5b5fc75 --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/CreationData.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.ContainerService.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Data used when creating a target resource from a source resource. + /// + public partial class CreationData + { + /// + /// Initializes a new instance of the CreationData class. + /// + public CreationData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CreationData class. + /// + /// This is the ARM ID of the source + /// object to be used to create the target object. + public CreationData(string sourceResourceId = default(string)) + { + SourceResourceId = sourceResourceId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets this is the ARM ID of the source object to be used to + /// create the target object. + /// + [JsonProperty(PropertyName = "sourceResourceId")] + public string SourceResourceId { get; set; } + + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/Format.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/Format.cs new file mode 100644 index 000000000000..d2550ac1df32 --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/Format.cs @@ -0,0 +1,30 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.ContainerService.Models +{ + + /// + /// Defines values for Format. + /// + public static class Format + { + /// + /// Return azure auth-provider kubeconfig. This format is deprecated in + /// 1.22 and will be fully removed in 1.25. + /// + public const string Azure = "azure"; + /// + /// Return exec format kubeconfig. This format requires kubelogin + /// binary in the path. + /// + public const string Exec = "exec"; + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/IpFamily.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/IpFamily.cs new file mode 100644 index 000000000000..965f8846c9c8 --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/IpFamily.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.ContainerService.Models +{ + + /// + /// Defines values for IpFamily. + /// + public static class IpFamily + { + public const string IPv4 = "IPv4"; + public const string IPv6 = "IPv6"; + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedCluster.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedCluster.cs index 459e63efc010..d4a33933e256 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedCluster.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedCluster.cs @@ -50,7 +50,9 @@ public ManagedCluster() /// The max number of agent pools for the /// managed cluster. /// The version of Kubernetes the - /// Managed Cluster is running. + /// Managed Cluster is requested to run. + /// The version of Kubernetes + /// the Managed Cluster is running. /// The DNS prefix of the Managed /// Cluster. /// The FQDN subdomain of the private @@ -72,6 +74,8 @@ public ManagedCluster() /// add-on. /// The pod identity profile of the /// Managed Cluster. + /// The OIDC issuer profile of the + /// Managed Cluster. /// The name of the resource group /// containing agent pool nodes. /// Whether to enable Kubernetes Role-Based @@ -80,6 +84,8 @@ public ManagedCluster() /// enable Kubernetes pod security policy (preview). This feature is /// set for removal on October 15th, 2020. Learn more at /// aka.ms/aks/azpodpolicy. + /// Enable namespace as Azure + /// resource. /// The network configuration /// profile. /// The Azure Active Directory @@ -102,7 +108,9 @@ public ManagedCluster() /// cluster with HTTP proxy servers. /// Security profile for the managed /// cluster. - public ManagedCluster(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), ManagedClusterSKU sku = default(ManagedClusterSKU), ExtendedLocation extendedLocation = default(ExtendedLocation), ManagedClusterIdentity identity = default(ManagedClusterIdentity), string provisioningState = default(string), PowerState powerState = default(PowerState), int? maxAgentPools = default(int?), string kubernetesVersion = default(string), string dnsPrefix = default(string), string fqdnSubdomain = default(string), string fqdn = default(string), string privateFQDN = default(string), string azurePortalFQDN = default(string), IList agentPoolProfiles = default(IList), ContainerServiceLinuxProfile linuxProfile = default(ContainerServiceLinuxProfile), ManagedClusterWindowsProfile windowsProfile = default(ManagedClusterWindowsProfile), ManagedClusterServicePrincipalProfile servicePrincipalProfile = default(ManagedClusterServicePrincipalProfile), IDictionary addonProfiles = default(IDictionary), ManagedClusterPodIdentityProfile podIdentityProfile = default(ManagedClusterPodIdentityProfile), string nodeResourceGroup = default(string), bool? enableRBAC = default(bool?), bool? enablePodSecurityPolicy = default(bool?), ContainerServiceNetworkProfile networkProfile = default(ContainerServiceNetworkProfile), ManagedClusterAADProfile aadProfile = default(ManagedClusterAADProfile), ManagedClusterAutoUpgradeProfile autoUpgradeProfile = default(ManagedClusterAutoUpgradeProfile), ManagedClusterPropertiesAutoScalerProfile autoScalerProfile = default(ManagedClusterPropertiesAutoScalerProfile), ManagedClusterAPIServerAccessProfile apiServerAccessProfile = default(ManagedClusterAPIServerAccessProfile), string diskEncryptionSetID = default(string), IDictionary identityProfile = default(IDictionary), IList privateLinkResources = default(IList), bool? disableLocalAccounts = default(bool?), ManagedClusterHTTPProxyConfig httpProxyConfig = default(ManagedClusterHTTPProxyConfig), ManagedClusterSecurityProfile securityProfile = default(ManagedClusterSecurityProfile)) + /// PublicNetworkAccess of the + /// managedCluster + public ManagedCluster(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), ManagedClusterSKU sku = default(ManagedClusterSKU), ExtendedLocation extendedLocation = default(ExtendedLocation), ManagedClusterIdentity identity = default(ManagedClusterIdentity), string provisioningState = default(string), PowerState powerState = default(PowerState), int? maxAgentPools = default(int?), string kubernetesVersion = default(string), string currentKubernetesVersion = default(string), string dnsPrefix = default(string), string fqdnSubdomain = default(string), string fqdn = default(string), string privateFQDN = default(string), string azurePortalFQDN = default(string), IList agentPoolProfiles = default(IList), ContainerServiceLinuxProfile linuxProfile = default(ContainerServiceLinuxProfile), ManagedClusterWindowsProfile windowsProfile = default(ManagedClusterWindowsProfile), ManagedClusterServicePrincipalProfile servicePrincipalProfile = default(ManagedClusterServicePrincipalProfile), IDictionary addonProfiles = default(IDictionary), ManagedClusterPodIdentityProfile podIdentityProfile = default(ManagedClusterPodIdentityProfile), ManagedClusterOIDCIssuerProfile oidcIssuerProfile = default(ManagedClusterOIDCIssuerProfile), string nodeResourceGroup = default(string), bool? enableRBAC = default(bool?), bool? enablePodSecurityPolicy = default(bool?), bool? enableNamespaceResources = default(bool?), ContainerServiceNetworkProfile networkProfile = default(ContainerServiceNetworkProfile), ManagedClusterAADProfile aadProfile = default(ManagedClusterAADProfile), ManagedClusterAutoUpgradeProfile autoUpgradeProfile = default(ManagedClusterAutoUpgradeProfile), ManagedClusterPropertiesAutoScalerProfile autoScalerProfile = default(ManagedClusterPropertiesAutoScalerProfile), ManagedClusterAPIServerAccessProfile apiServerAccessProfile = default(ManagedClusterAPIServerAccessProfile), string diskEncryptionSetID = default(string), IDictionary identityProfile = default(IDictionary), IList privateLinkResources = default(IList), bool? disableLocalAccounts = default(bool?), ManagedClusterHTTPProxyConfig httpProxyConfig = default(ManagedClusterHTTPProxyConfig), ManagedClusterSecurityProfile securityProfile = default(ManagedClusterSecurityProfile), string publicNetworkAccess = default(string)) : base(location, id, name, type, tags) { Sku = sku; @@ -112,6 +120,7 @@ public ManagedCluster() PowerState = powerState; MaxAgentPools = maxAgentPools; KubernetesVersion = kubernetesVersion; + CurrentKubernetesVersion = currentKubernetesVersion; DnsPrefix = dnsPrefix; FqdnSubdomain = fqdnSubdomain; Fqdn = fqdn; @@ -123,9 +132,11 @@ public ManagedCluster() ServicePrincipalProfile = servicePrincipalProfile; AddonProfiles = addonProfiles; PodIdentityProfile = podIdentityProfile; + OidcIssuerProfile = oidcIssuerProfile; NodeResourceGroup = nodeResourceGroup; EnableRBAC = enableRBAC; EnablePodSecurityPolicy = enablePodSecurityPolicy; + EnableNamespaceResources = enableNamespaceResources; NetworkProfile = networkProfile; AadProfile = aadProfile; AutoUpgradeProfile = autoUpgradeProfile; @@ -137,6 +148,7 @@ public ManagedCluster() DisableLocalAccounts = disableLocalAccounts; HttpProxyConfig = httpProxyConfig; SecurityProfile = securityProfile; + PublicNetworkAccess = publicNetworkAccess; CustomInit(); } @@ -183,7 +195,7 @@ public ManagedCluster() /// /// Gets or sets the version of Kubernetes the Managed Cluster is - /// running. + /// requested to run. /// /// /// When you upgrade a supported AKS cluster, Kubernetes minor versions @@ -197,6 +209,12 @@ public ManagedCluster() [JsonProperty(PropertyName = "properties.kubernetesVersion")] public string KubernetesVersion { get; set; } + /// + /// Gets the version of Kubernetes the Managed Cluster is running. + /// + [JsonProperty(PropertyName = "properties.currentKubernetesVersion")] + public string CurrentKubernetesVersion { get; private set; } + /// /// Gets or sets the DNS prefix of the Managed Cluster. /// @@ -284,6 +302,12 @@ public ManagedCluster() [JsonProperty(PropertyName = "properties.podIdentityProfile")] public ManagedClusterPodIdentityProfile PodIdentityProfile { get; set; } + /// + /// Gets or sets the OIDC issuer profile of the Managed Cluster. + /// + [JsonProperty(PropertyName = "properties.oidcIssuerProfile")] + public ManagedClusterOIDCIssuerProfile OidcIssuerProfile { get; set; } + /// /// Gets or sets the name of the resource group containing agent pool /// nodes. @@ -306,6 +330,18 @@ public ManagedCluster() [JsonProperty(PropertyName = "properties.enablePodSecurityPolicy")] public bool? EnablePodSecurityPolicy { get; set; } + /// + /// Gets or sets enable namespace as Azure resource. + /// + /// + /// The default value is false. It can be enabled/disabled on creation + /// and updation of the managed cluster. See + /// [https://aka.ms/NamespaceARMResource](https://aka.ms/NamespaceARMResource) + /// for more details on Namespace as a ARM Resource. + /// + [JsonProperty(PropertyName = "properties.enableNamespaceResources")] + public bool? EnableNamespaceResources { get; set; } + /// /// Gets or sets the network configuration profile. /// @@ -386,6 +422,16 @@ public ManagedCluster() [JsonProperty(PropertyName = "properties.securityProfile")] public ManagedClusterSecurityProfile SecurityProfile { get; set; } + /// + /// Gets or sets publicNetworkAccess of the managedCluster + /// + /// + /// Allow or deny public network access for AKS. Possible values + /// include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "properties.publicNetworkAccess")] + public string PublicNetworkAccess { get; set; } + /// /// Validate the object. /// diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAPIServerAccessProfile.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAPIServerAccessProfile.cs index 25d25ef2cdfe..3051fdc5656a 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAPIServerAccessProfile.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAPIServerAccessProfile.cs @@ -41,12 +41,15 @@ public ManagedClusterAPIServerAccessProfile() /// cluster. /// Whether to create /// additional public FQDN for private cluster or not. - public ManagedClusterAPIServerAccessProfile(IList authorizedIPRanges = default(IList), bool? enablePrivateCluster = default(bool?), string privateDNSZone = default(string), bool? enablePrivateClusterPublicFQDN = default(bool?)) + /// Whether to disable run command for + /// the cluster or not. + public ManagedClusterAPIServerAccessProfile(IList authorizedIPRanges = default(IList), bool? enablePrivateCluster = default(bool?), string privateDNSZone = default(string), bool? enablePrivateClusterPublicFQDN = default(bool?), bool? disableRunCommand = default(bool?)) { AuthorizedIPRanges = authorizedIPRanges; EnablePrivateCluster = enablePrivateCluster; PrivateDNSZone = privateDNSZone; EnablePrivateClusterPublicFQDN = enablePrivateClusterPublicFQDN; + DisableRunCommand = disableRunCommand; CustomInit(); } @@ -98,5 +101,11 @@ public ManagedClusterAPIServerAccessProfile() [JsonProperty(PropertyName = "enablePrivateClusterPublicFQDN")] public bool? EnablePrivateClusterPublicFQDN { get; set; } + /// + /// Gets or sets whether to disable run command for the cluster or not. + /// + [JsonProperty(PropertyName = "disableRunCommand")] + public bool? DisableRunCommand { get; set; } + } } diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.cs index 70c5b5386759..114090bc0be8 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.cs @@ -45,6 +45,10 @@ public ManagedClusterAgentPoolProfile() /// 'Ephemeral' /// Possible values include: 'OS', /// 'Temporary' + /// Possible values include: + /// 'OCIContainer', 'WasmWasi' + /// Message of the day for Linux nodes, + /// base64-encoded. /// The ID of the subnet which agent pool /// nodes and optionally pods will join on startup. /// The ID of the subnet which pods will join @@ -74,8 +78,8 @@ public ManagedClusterAgentPoolProfile() /// agentpool /// The current deployment or /// provisioning state. - /// Describes whether the Agent Pool is - /// Running or Stopped + /// Whether the Agent Pool is running or + /// stopped. /// The list of Availability zones to /// use for nodes. This can only be specified if the AgentPoolType /// property is 'VirtualMachineScaleSets'. @@ -111,8 +115,16 @@ public ManagedClusterAgentPoolProfile() /// GPUInstanceProfile to be used to /// specify GPU MIG instance profile for supported GPU VM SKU. Possible /// values include: 'MIG1g', 'MIG2g', 'MIG3g', 'MIG4g', 'MIG7g' - public ManagedClusterAgentPoolProfile(string name, int? count = default(int?), string vmSize = default(string), int? osDiskSizeGB = default(int?), string osDiskType = default(string), string kubeletDiskType = default(string), string vnetSubnetID = default(string), string podSubnetID = default(string), int? maxPods = default(int?), string osType = default(string), string osSKU = default(string), int? maxCount = default(int?), int? minCount = default(int?), bool? enableAutoScaling = default(bool?), string scaleDownMode = default(string), string type = default(string), string mode = default(string), string orchestratorVersion = default(string), string nodeImageVersion = default(string), AgentPoolUpgradeSettings upgradeSettings = default(AgentPoolUpgradeSettings), string provisioningState = default(string), PowerState powerState = default(PowerState), IList availabilityZones = default(IList), bool? enableNodePublicIP = default(bool?), string nodePublicIPPrefixID = default(string), string scaleSetPriority = default(string), string scaleSetEvictionPolicy = default(string), double? spotMaxPrice = default(double?), IDictionary tags = default(IDictionary), IDictionary nodeLabels = default(IDictionary), IList nodeTaints = default(IList), string proximityPlacementGroupID = default(string), KubeletConfig kubeletConfig = default(KubeletConfig), LinuxOSConfig linuxOSConfig = default(LinuxOSConfig), bool? enableEncryptionAtHost = default(bool?), bool? enableUltraSSD = default(bool?), bool? enableFIPS = default(bool?), string gpuInstanceProfile = default(string)) - : base(count, vmSize, osDiskSizeGB, osDiskType, kubeletDiskType, vnetSubnetID, podSubnetID, maxPods, osType, osSKU, maxCount, minCount, enableAutoScaling, scaleDownMode, type, mode, orchestratorVersion, nodeImageVersion, upgradeSettings, provisioningState, powerState, availabilityZones, enableNodePublicIP, nodePublicIPPrefixID, scaleSetPriority, scaleSetEvictionPolicy, spotMaxPrice, tags, nodeLabels, nodeTaints, proximityPlacementGroupID, kubeletConfig, linuxOSConfig, enableEncryptionAtHost, enableUltraSSD, enableFIPS, gpuInstanceProfile) + /// 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. + /// The fully qualified resource ID of the + /// Dedicated Host Group to provision virtual machines from, used only + /// in creation scenario and not allowed to changed once set. + public ManagedClusterAgentPoolProfile(string name, int? count = default(int?), string vmSize = default(string), int? osDiskSizeGB = default(int?), string osDiskType = default(string), string kubeletDiskType = default(string), string workloadRuntime = default(string), string messageOfTheDay = default(string), string vnetSubnetID = default(string), string podSubnetID = default(string), int? maxPods = default(int?), string osType = default(string), string osSKU = default(string), int? maxCount = default(int?), int? minCount = default(int?), bool? enableAutoScaling = default(bool?), string scaleDownMode = default(string), string type = default(string), string mode = default(string), string orchestratorVersion = default(string), string nodeImageVersion = default(string), AgentPoolUpgradeSettings upgradeSettings = default(AgentPoolUpgradeSettings), string provisioningState = default(string), PowerState powerState = default(PowerState), IList availabilityZones = default(IList), bool? enableNodePublicIP = default(bool?), string nodePublicIPPrefixID = default(string), string scaleSetPriority = default(string), string scaleSetEvictionPolicy = default(string), double? spotMaxPrice = default(double?), IDictionary tags = default(IDictionary), IDictionary nodeLabels = default(IDictionary), IList nodeTaints = default(IList), string proximityPlacementGroupID = default(string), KubeletConfig kubeletConfig = default(KubeletConfig), LinuxOSConfig linuxOSConfig = default(LinuxOSConfig), bool? enableEncryptionAtHost = default(bool?), bool? enableUltraSSD = default(bool?), bool? enableFIPS = default(bool?), string gpuInstanceProfile = default(string), CreationData creationData = default(CreationData), string capacityReservationGroupID = default(string), string hostGroupID = default(string)) + : base(count, vmSize, osDiskSizeGB, osDiskType, kubeletDiskType, workloadRuntime, messageOfTheDay, vnetSubnetID, podSubnetID, maxPods, osType, osSKU, maxCount, minCount, enableAutoScaling, scaleDownMode, type, mode, orchestratorVersion, nodeImageVersion, upgradeSettings, provisioningState, powerState, availabilityZones, enableNodePublicIP, nodePublicIPPrefixID, scaleSetPriority, scaleSetEvictionPolicy, spotMaxPrice, tags, nodeLabels, nodeTaints, proximityPlacementGroupID, kubeletConfig, linuxOSConfig, enableEncryptionAtHost, enableUltraSSD, enableFIPS, gpuInstanceProfile, creationData, capacityReservationGroupID, hostGroupID) { Name = name; CustomInit(); diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfileProperties.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfileProperties.cs index a53077222929..7645140a2aa6 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfileProperties.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfileProperties.cs @@ -42,6 +42,10 @@ public ManagedClusterAgentPoolProfileProperties() /// 'Ephemeral' /// Possible values include: 'OS', /// 'Temporary' + /// Possible values include: + /// 'OCIContainer', 'WasmWasi' + /// Message of the day for Linux nodes, + /// base64-encoded. /// The ID of the subnet which agent pool /// nodes and optionally pods will join on startup. /// The ID of the subnet which pods will join @@ -71,8 +75,8 @@ public ManagedClusterAgentPoolProfileProperties() /// agentpool /// The current deployment or /// provisioning state. - /// Describes whether the Agent Pool is - /// Running or Stopped + /// Whether the Agent Pool is running or + /// stopped. /// The list of Availability zones to /// use for nodes. This can only be specified if the AgentPoolType /// property is 'VirtualMachineScaleSets'. @@ -108,13 +112,23 @@ public ManagedClusterAgentPoolProfileProperties() /// GPUInstanceProfile to be used to /// specify GPU MIG instance profile for supported GPU VM SKU. Possible /// values include: 'MIG1g', 'MIG2g', 'MIG3g', 'MIG4g', 'MIG7g' - public ManagedClusterAgentPoolProfileProperties(int? count = default(int?), string vmSize = default(string), int? osDiskSizeGB = default(int?), string osDiskType = default(string), string kubeletDiskType = default(string), string vnetSubnetID = default(string), string podSubnetID = default(string), int? maxPods = default(int?), string osType = default(string), string osSKU = default(string), int? maxCount = default(int?), int? minCount = default(int?), bool? enableAutoScaling = default(bool?), string scaleDownMode = default(string), string type = default(string), string mode = default(string), string orchestratorVersion = default(string), string nodeImageVersion = default(string), AgentPoolUpgradeSettings upgradeSettings = default(AgentPoolUpgradeSettings), string provisioningState = default(string), PowerState powerState = default(PowerState), IList availabilityZones = default(IList), bool? enableNodePublicIP = default(bool?), string nodePublicIPPrefixID = default(string), string scaleSetPriority = default(string), string scaleSetEvictionPolicy = default(string), double? spotMaxPrice = default(double?), IDictionary tags = default(IDictionary), IDictionary nodeLabels = default(IDictionary), IList nodeTaints = default(IList), string proximityPlacementGroupID = default(string), KubeletConfig kubeletConfig = default(KubeletConfig), LinuxOSConfig linuxOSConfig = default(LinuxOSConfig), bool? enableEncryptionAtHost = default(bool?), bool? enableUltraSSD = default(bool?), bool? enableFIPS = default(bool?), string gpuInstanceProfile = default(string)) + /// 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. + /// The fully qualified resource ID of the + /// Dedicated Host Group to provision virtual machines from, used only + /// in creation scenario and not allowed to changed once set. + public ManagedClusterAgentPoolProfileProperties(int? count = default(int?), string vmSize = default(string), int? osDiskSizeGB = default(int?), string osDiskType = default(string), string kubeletDiskType = default(string), string workloadRuntime = default(string), string messageOfTheDay = default(string), string vnetSubnetID = default(string), string podSubnetID = default(string), int? maxPods = default(int?), string osType = default(string), string osSKU = default(string), int? maxCount = default(int?), int? minCount = default(int?), bool? enableAutoScaling = default(bool?), string scaleDownMode = default(string), string type = default(string), string mode = default(string), string orchestratorVersion = default(string), string nodeImageVersion = default(string), AgentPoolUpgradeSettings upgradeSettings = default(AgentPoolUpgradeSettings), string provisioningState = default(string), PowerState powerState = default(PowerState), IList availabilityZones = default(IList), bool? enableNodePublicIP = default(bool?), string nodePublicIPPrefixID = default(string), string scaleSetPriority = default(string), string scaleSetEvictionPolicy = default(string), double? spotMaxPrice = default(double?), IDictionary tags = default(IDictionary), IDictionary nodeLabels = default(IDictionary), IList nodeTaints = default(IList), string proximityPlacementGroupID = default(string), KubeletConfig kubeletConfig = default(KubeletConfig), LinuxOSConfig linuxOSConfig = default(LinuxOSConfig), bool? enableEncryptionAtHost = default(bool?), bool? enableUltraSSD = default(bool?), bool? enableFIPS = default(bool?), string gpuInstanceProfile = default(string), CreationData creationData = default(CreationData), string capacityReservationGroupID = default(string), string hostGroupID = default(string)) { Count = count; VmSize = vmSize; OsDiskSizeGB = osDiskSizeGB; OsDiskType = osDiskType; KubeletDiskType = kubeletDiskType; + WorkloadRuntime = workloadRuntime; + MessageOfTheDay = messageOfTheDay; VnetSubnetID = vnetSubnetID; PodSubnetID = podSubnetID; MaxPods = maxPods; @@ -147,6 +161,9 @@ public ManagedClusterAgentPoolProfileProperties() EnableUltraSSD = enableUltraSSD; EnableFIPS = enableFIPS; GpuInstanceProfile = gpuInstanceProfile; + CreationData = creationData; + CapacityReservationGroupID = capacityReservationGroupID; + HostGroupID = hostGroupID; CustomInit(); } @@ -193,6 +210,25 @@ public ManagedClusterAgentPoolProfileProperties() [JsonProperty(PropertyName = "kubeletDiskType")] public string KubeletDiskType { get; set; } + /// + /// Gets or sets possible values include: 'OCIContainer', 'WasmWasi' + /// + [JsonProperty(PropertyName = "workloadRuntime")] + public string WorkloadRuntime { get; set; } + + /// + /// Gets or sets message of the day for Linux nodes, base64-encoded. + /// + /// + /// 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). + /// + [JsonProperty(PropertyName = "messageOfTheDay")] + public string MessageOfTheDay { get; set; } + /// /// Gets or sets the ID of the subnet which agent pool nodes and /// optionally pods will join on startup. @@ -313,10 +349,17 @@ public ManagedClusterAgentPoolProfileProperties() public string ProvisioningState { get; private set; } /// - /// Gets describes whether the Agent Pool is Running or Stopped + /// Gets or sets whether the Agent Pool is running or stopped. /// + /// + /// 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 + /// [JsonProperty(PropertyName = "powerState")] - public PowerState PowerState { get; private set; } + public PowerState PowerState { get; set; } /// /// Gets or sets the list of Availability zones to use for nodes. This @@ -462,6 +505,34 @@ public ManagedClusterAgentPoolProfileProperties() [JsonProperty(PropertyName = "gpuInstanceProfile")] public string GpuInstanceProfile { get; set; } + /// + /// Gets or sets creationData to be used to specify the source Snapshot + /// ID if the node pool will be created/upgraded using a snapshot. + /// + [JsonProperty(PropertyName = "creationData")] + public CreationData CreationData { get; set; } + + /// + /// Gets or sets AKS will associate the specified agent pool with the + /// Capacity Reservation Group. + /// + [JsonProperty(PropertyName = "capacityReservationGroupID")] + public string CapacityReservationGroupID { get; set; } + + /// + /// Gets or sets the fully qualified resource ID of the Dedicated Host + /// Group to provision virtual machines from, used only in creation + /// scenario and not allowed to changed once set. + /// + /// + /// 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). + /// + [JsonProperty(PropertyName = "hostGroupID")] + public string HostGroupID { get; set; } + /// /// Validate the object. /// diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfile.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfile.cs index fb6782d4bb34..2e12bba44cbb 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfile.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfile.cs @@ -49,7 +49,9 @@ public ManagedClusterLoadBalancerProfile() /// Desired outbound flow idle /// timeout in minutes. Allowed values are in the range of 4 to 120 /// (inclusive). The default value is 30 minutes. - public ManagedClusterLoadBalancerProfile(ManagedClusterLoadBalancerProfileManagedOutboundIPs managedOutboundIPs = default(ManagedClusterLoadBalancerProfileManagedOutboundIPs), ManagedClusterLoadBalancerProfileOutboundIPPrefixes outboundIPPrefixes = default(ManagedClusterLoadBalancerProfileOutboundIPPrefixes), ManagedClusterLoadBalancerProfileOutboundIPs outboundIPs = default(ManagedClusterLoadBalancerProfileOutboundIPs), IList effectiveOutboundIPs = default(IList), int? allocatedOutboundPorts = default(int?), int? idleTimeoutInMinutes = default(int?)) + /// Enable multiple + /// standard load balancers per AKS cluster or not. + public ManagedClusterLoadBalancerProfile(ManagedClusterLoadBalancerProfileManagedOutboundIPs managedOutboundIPs = default(ManagedClusterLoadBalancerProfileManagedOutboundIPs), ManagedClusterLoadBalancerProfileOutboundIPPrefixes outboundIPPrefixes = default(ManagedClusterLoadBalancerProfileOutboundIPPrefixes), ManagedClusterLoadBalancerProfileOutboundIPs outboundIPs = default(ManagedClusterLoadBalancerProfileOutboundIPs), IList effectiveOutboundIPs = default(IList), int? allocatedOutboundPorts = default(int?), int? idleTimeoutInMinutes = default(int?), bool? enableMultipleStandardLoadBalancers = default(bool?)) { ManagedOutboundIPs = managedOutboundIPs; OutboundIPPrefixes = outboundIPPrefixes; @@ -57,6 +59,7 @@ public ManagedClusterLoadBalancerProfile() EffectiveOutboundIPs = effectiveOutboundIPs; AllocatedOutboundPorts = allocatedOutboundPorts; IdleTimeoutInMinutes = idleTimeoutInMinutes; + EnableMultipleStandardLoadBalancers = enableMultipleStandardLoadBalancers; CustomInit(); } @@ -110,6 +113,13 @@ public ManagedClusterLoadBalancerProfile() [JsonProperty(PropertyName = "idleTimeoutInMinutes")] public int? IdleTimeoutInMinutes { get; set; } + /// + /// Gets or sets enable multiple standard load balancers per AKS + /// cluster or not. + /// + [JsonProperty(PropertyName = "enableMultipleStandardLoadBalancers")] + public bool? EnableMultipleStandardLoadBalancers { get; set; } + /// /// Validate the object. /// diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileManagedOutboundIPs.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileManagedOutboundIPs.cs index 6e60275cc155..e68974dcd9c6 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileManagedOutboundIPs.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileManagedOutboundIPs.cs @@ -32,13 +32,18 @@ public ManagedClusterLoadBalancerProfileManagedOutboundIPs() /// Initializes a new instance of the /// ManagedClusterLoadBalancerProfileManagedOutboundIPs class. /// - /// The desired number of outbound IPs + /// The desired number of IPv4 outbound IPs /// created/managed by Azure for the cluster load balancer. Allowed /// values must be in the range of 1 to 100 (inclusive). The default /// value is 1. - public ManagedClusterLoadBalancerProfileManagedOutboundIPs(int? count = default(int?)) + /// The desired number of IPv6 outbound IPs + /// created/managed by Azure for the cluster load balancer. Allowed + /// values must be in the range of 1 to 100 (inclusive). The default + /// value is 0 for single-stack and 1 for dual-stack. + public ManagedClusterLoadBalancerProfileManagedOutboundIPs(int? count = default(int?), int? countIPv6 = default(int?)) { Count = count; + CountIPv6 = countIPv6; CustomInit(); } @@ -48,13 +53,23 @@ public ManagedClusterLoadBalancerProfileManagedOutboundIPs() partial void CustomInit(); /// - /// Gets or sets the desired number of outbound IPs created/managed by - /// Azure for the cluster load balancer. Allowed values must be in the - /// range of 1 to 100 (inclusive). The default value is 1. + /// Gets or sets the desired number of IPv4 outbound IPs + /// created/managed by Azure for the cluster load balancer. Allowed + /// values must be in the range of 1 to 100 (inclusive). The default + /// value is 1. /// [JsonProperty(PropertyName = "count")] public int? Count { get; set; } + /// + /// Gets or sets the desired number of IPv6 outbound IPs + /// created/managed by Azure for the cluster load balancer. Allowed + /// values must be in the range of 1 to 100 (inclusive). The default + /// value is 0 for single-stack and 1 for dual-stack. + /// + [JsonProperty(PropertyName = "countIPv6")] + public int? CountIPv6 { get; set; } + /// /// Validate the object. /// @@ -71,6 +86,14 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.InclusiveMinimum, "Count", 1); } + if (CountIPv6 > 100) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "CountIPv6", 100); + } + if (CountIPv6 < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "CountIPv6", 0); + } } } } diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterOIDCIssuerProfile.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterOIDCIssuerProfile.cs new file mode 100644 index 000000000000..741365683c29 --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterOIDCIssuerProfile.cs @@ -0,0 +1,62 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.ContainerService.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The OIDC issuer profile of the Managed Cluster. + /// + public partial class ManagedClusterOIDCIssuerProfile + { + /// + /// Initializes a new instance of the ManagedClusterOIDCIssuerProfile + /// class. + /// + public ManagedClusterOIDCIssuerProfile() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ManagedClusterOIDCIssuerProfile + /// class. + /// + /// The OIDC issuer url of the Managed + /// Cluster. + /// Whether the OIDC issuer is enabled. + public ManagedClusterOIDCIssuerProfile(string issuerURL = default(string), bool? enabled = default(bool?)) + { + IssuerURL = issuerURL; + Enabled = enabled; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the OIDC issuer url of the Managed Cluster. + /// + [JsonProperty(PropertyName = "issuerURL")] + public string IssuerURL { get; private set; } + + /// + /// Gets or sets whether the OIDC issuer is enabled. + /// + [JsonProperty(PropertyName = "enabled")] + public bool? Enabled { get; set; } + + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterSecurityProfile.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterSecurityProfile.cs index aa5654dd20bc..abacde059be0 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterSecurityProfile.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterSecurityProfile.cs @@ -33,9 +33,13 @@ public ManagedClusterSecurityProfile() /// /// Azure Defender settings for the /// security profile. - public ManagedClusterSecurityProfile(ManagedClusterSecurityProfileAzureDefender azureDefender = default(ManagedClusterSecurityProfileAzureDefender)) + /// Azure Key Vault [key management + /// service](https://kubernetes.io/docs/tasks/administer-cluster/kms-provider/) + /// settings for the security profile. + public ManagedClusterSecurityProfile(ManagedClusterSecurityProfileAzureDefender azureDefender = default(ManagedClusterSecurityProfileAzureDefender), AzureKeyVaultKms azureKeyVaultKms = default(AzureKeyVaultKms)) { AzureDefender = azureDefender; + AzureKeyVaultKms = azureKeyVaultKms; CustomInit(); } @@ -50,5 +54,13 @@ public ManagedClusterSecurityProfile() [JsonProperty(PropertyName = "azureDefender")] public ManagedClusterSecurityProfileAzureDefender AzureDefender { get; set; } + /// + /// Gets or sets azure Key Vault [key management + /// service](https://kubernetes.io/docs/tasks/administer-cluster/kms-provider/) + /// settings for the security profile. + /// + [JsonProperty(PropertyName = "azureKeyVaultKms")] + public AzureKeyVaultKms AzureKeyVaultKms { get; set; } + } } diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterWindowsProfile.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterWindowsProfile.cs index 6ea892e90faa..54bc1bf9d27a 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterWindowsProfile.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterWindowsProfile.cs @@ -58,12 +58,15 @@ public ManagedClusterWindowsProfile() /// for more details. Possible values include: 'None', /// 'Windows_Server' /// Whether to enable CSI proxy. - public ManagedClusterWindowsProfile(string adminUsername, string adminPassword = default(string), string licenseType = default(string), bool? enableCSIProxy = default(bool?)) + /// The Windows gMSA Profile in the Managed + /// Cluster. + public ManagedClusterWindowsProfile(string adminUsername, string adminPassword = default(string), string licenseType = default(string), bool? enableCSIProxy = default(bool?), WindowsGmsaProfile gmsaProfile = default(WindowsGmsaProfile)) { AdminUsername = adminUsername; AdminPassword = adminPassword; LicenseType = licenseType; EnableCSIProxy = enableCSIProxy; + GmsaProfile = gmsaProfile; CustomInit(); } @@ -123,6 +126,12 @@ public ManagedClusterWindowsProfile() [JsonProperty(PropertyName = "enableCSIProxy")] public bool? EnableCSIProxy { get; set; } + /// + /// Gets or sets the Windows gMSA Profile in the Managed Cluster. + /// + [JsonProperty(PropertyName = "gmsaProfile")] + public WindowsGmsaProfile GmsaProfile { get; set; } + /// /// Validate the object. /// diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/NetworkPlugin.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/NetworkPlugin.cs index 199686c7fcf0..2f0f8ce18c82 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/NetworkPlugin.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/NetworkPlugin.cs @@ -28,5 +28,10 @@ public static class NetworkPlugin /// for more information. /// public const string Kubenet = "kubenet"; + /// + /// Do not use a network plugin. A custom CNI will need to be installed + /// after cluster creation for networking functionality. + /// + public const string None = "none"; } } diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/PublicNetworkAccess.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/PublicNetworkAccess.cs new file mode 100644 index 000000000000..2b42263c9c1e --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/PublicNetworkAccess.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.ContainerService.Models +{ + + /// + /// Defines values for PublicNetworkAccess. + /// + public static class PublicNetworkAccess + { + public const string Enabled = "Enabled"; + public const string Disabled = "Disabled"; + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/Snapshot.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/Snapshot.cs new file mode 100644 index 000000000000..8122f6172a5a --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/Snapshot.cs @@ -0,0 +1,142 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.ContainerService.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A node pool snapshot resource. + /// + [Rest.Serialization.JsonTransformation] + public partial class Snapshot : Resource + { + /// + /// Initializes a new instance of the Snapshot class. + /// + public Snapshot() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Snapshot class. + /// + /// Resource location + /// Resource Id + /// Resource name + /// Resource type + /// Resource tags + /// The system metadata relating to this + /// snapshot. + /// CreationData to be used to specify the + /// source agent pool resource ID to create this snapshot. + /// Possible values include: + /// 'NodePool' + /// The version of Kubernetes. + /// The version of node image. + /// Possible values include: 'Linux', + /// 'Windows' + /// Possible values include: 'Ubuntu', + /// 'CBLMariner' + /// The size of the VM. + /// Whether to use a FIPS-enabled OS. + public Snapshot(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), SystemData systemData = default(SystemData), CreationData creationData = default(CreationData), string snapshotType = default(string), string kubernetesVersion = default(string), string nodeImageVersion = default(string), string osType = default(string), string osSku = default(string), string vmSize = default(string), bool? enableFIPS = default(bool?)) + : base(location, id, name, type, tags) + { + SystemData = systemData; + CreationData = creationData; + SnapshotType = snapshotType; + KubernetesVersion = kubernetesVersion; + NodeImageVersion = nodeImageVersion; + OsType = osType; + OsSku = osSku; + VmSize = vmSize; + EnableFIPS = enableFIPS; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the system metadata relating to this snapshot. + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + + /// + /// Gets or sets creationData to be used to specify the source agent + /// pool resource ID to create this snapshot. + /// + [JsonProperty(PropertyName = "properties.creationData")] + public CreationData CreationData { get; set; } + + /// + /// Gets or sets possible values include: 'NodePool' + /// + [JsonProperty(PropertyName = "properties.snapshotType")] + public string SnapshotType { get; set; } + + /// + /// Gets the version of Kubernetes. + /// + [JsonProperty(PropertyName = "properties.kubernetesVersion")] + public string KubernetesVersion { get; private set; } + + /// + /// Gets the version of node image. + /// + [JsonProperty(PropertyName = "properties.nodeImageVersion")] + public string NodeImageVersion { get; private set; } + + /// + /// Gets possible values include: 'Linux', 'Windows' + /// + [JsonProperty(PropertyName = "properties.osType")] + public string OsType { get; private set; } + + /// + /// Gets possible values include: 'Ubuntu', 'CBLMariner' + /// + [JsonProperty(PropertyName = "properties.osSku")] + public string OsSku { get; private set; } + + /// + /// Gets the size of the VM. + /// + [JsonProperty(PropertyName = "properties.vmSize")] + public string VmSize { get; private set; } + + /// + /// Gets whether to use a FIPS-enabled OS. + /// + [JsonProperty(PropertyName = "properties.enableFIPS")] + public bool? EnableFIPS { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/SnapshotType.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/SnapshotType.cs new file mode 100644 index 000000000000..502c72d2b324 --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/SnapshotType.cs @@ -0,0 +1,24 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.ContainerService.Models +{ + + /// + /// Defines values for SnapshotType. + /// + public static class SnapshotType + { + /// + /// The snapshot is a snapshot of a node pool. + /// + public const string NodePool = "NodePool"; + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/WindowsGmsaProfile.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/WindowsGmsaProfile.cs new file mode 100644 index 000000000000..23899966abbd --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/WindowsGmsaProfile.cs @@ -0,0 +1,82 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.ContainerService.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Windows gMSA Profile in the managed cluster. + /// + public partial class WindowsGmsaProfile + { + /// + /// Initializes a new instance of the WindowsGmsaProfile class. + /// + public WindowsGmsaProfile() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WindowsGmsaProfile class. + /// + /// Whether to enable Windows gMSA. + /// Specifies the DNS server for Windows gMSA. + /// <br><br> Set it to empty if you have configured the DNS + /// server in the vnet which is used to create the managed + /// cluster. + /// Specifies the root domain name for + /// Windows gMSA. <br><br> Set it to empty if you have + /// configured the DNS server in the vnet which is used to create the + /// managed cluster. + public WindowsGmsaProfile(bool? enabled = default(bool?), string dnsServer = default(string), string rootDomainName = default(string)) + { + Enabled = enabled; + DnsServer = dnsServer; + RootDomainName = rootDomainName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets whether to enable Windows gMSA. + /// + /// + /// Specifies whether to enable Windows gMSA in the managed cluster. + /// + [JsonProperty(PropertyName = "enabled")] + public bool? Enabled { get; set; } + + /// + /// Gets or sets specifies the DNS server for Windows gMSA. + /// &lt;br&gt;&lt;br&gt; Set it to empty if you have + /// configured the DNS server in the vnet which is used to create the + /// managed cluster. + /// + [JsonProperty(PropertyName = "dnsServer")] + public string DnsServer { get; set; } + + /// + /// Gets or sets specifies the root domain name for Windows gMSA. + /// &lt;br&gt;&lt;br&gt; Set it to empty if you have + /// configured the DNS server in the vnet which is used to create the + /// managed cluster. + /// + [JsonProperty(PropertyName = "rootDomainName")] + public string RootDomainName { get; set; } + + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/WorkloadRuntime.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/WorkloadRuntime.cs new file mode 100644 index 000000000000..c8419098fc8a --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/WorkloadRuntime.cs @@ -0,0 +1,29 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.ContainerService.Models +{ + + /// + /// Defines values for WorkloadRuntime. + /// + public static class WorkloadRuntime + { + /// + /// Nodes will use Kubelet to run standard OCI container workloads. + /// + public const string OCIContainer = "OCIContainer"; + /// + /// Nodes will use Krustlet to run WASM workloads using the WASI + /// provider (Preview). + /// + public const string WasmWasi = "WasmWasi"; + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/SdkInfo_ContainerServiceClient.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/SdkInfo_ContainerServiceClient.cs index 278eafe1d436..1b4323dbb8fa 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/SdkInfo_ContainerServiceClient.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/SdkInfo_ContainerServiceClient.cs @@ -19,26 +19,16 @@ public static IEnumerable> ApiInfo_ContainerServic { return new Tuple[] { - new Tuple("ContainerService", "AgentPools", "2021-07-01"), - new Tuple("ContainerService", "MaintenanceConfigurations", "2021-07-01"), - new Tuple("ContainerService", "ManagedClusters", "2021-07-01"), - new Tuple("ContainerService", "Operations", "2021-07-01"), - new Tuple("ContainerService", "PrivateEndpointConnections", "2021-07-01"), - new Tuple("ContainerService", "PrivateLinkResources", "2021-07-01"), - new Tuple("ContainerService", "ResolvePrivateLinkServiceId", "2021-07-01"), + new Tuple("ContainerService", "AgentPools", "2022-02-02-preview"), + new Tuple("ContainerService", "MaintenanceConfigurations", "2022-02-02-preview"), + new Tuple("ContainerService", "ManagedClusters", "2022-02-02-preview"), + new Tuple("ContainerService", "Operations", "2022-02-02-preview"), + new Tuple("ContainerService", "PrivateEndpointConnections", "2022-02-02-preview"), + new Tuple("ContainerService", "PrivateLinkResources", "2022-02-02-preview"), + new Tuple("ContainerService", "ResolvePrivateLinkServiceId", "2022-02-02-preview"), + new Tuple("ContainerService", "Snapshots", "2022-02-02-preview"), }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "v2"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4413"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/containerservice/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=C:\\Users\\kaiqz\\github\\kaiqzhan\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "111fbceeeb7c2c4905b80fe2ab760e5564b3458a"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/SnapshotsOperations.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/SnapshotsOperations.cs new file mode 100644 index 000000000000..46fe53c1908a --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/SnapshotsOperations.cs @@ -0,0 +1,1674 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.ContainerService +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// SnapshotsOperations operations. + /// + internal partial class SnapshotsOperations : IServiceOperations, ISnapshotsOperations + { + /// + /// Initializes a new instance of the SnapshotsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal SnapshotsOperations(ContainerServiceClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the ContainerServiceClient + /// + public ContainerServiceClient Client { get; private set; } + + /// + /// Gets a list of snapshots in the specified subscription. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/snapshots").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists snapshots in the specified subscription and resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a snapshot. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (resourceName != null) + { + if (resourceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceName", 63); + } + if (resourceName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceName, "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates a snapshot. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// The snapshot to create or update. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string resourceName, Snapshot parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (resourceName != null) + { + if (resourceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceName", 63); + } + if (resourceName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceName, "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + } + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Updates tags on a snapshot. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// Resource tags. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string resourceName, IDictionary tags = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (resourceName != null) + { + if (resourceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceName", 63); + } + if (resourceName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceName, "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + } + } + TagsObject parameters = new TagsObject(); + if (tags != null) + { + parameters.Tags = tags; + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes a snapshot. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (resourceName != null) + { + if (resourceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceName", 63); + } + if (resourceName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceName, "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a list of snapshots in the specified subscription. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists snapshots in the specified subscription and resource group. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/SnapshotsOperationsExtensions.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/SnapshotsOperationsExtensions.cs new file mode 100644 index 000000000000..19acdf2cc6a8 --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/SnapshotsOperationsExtensions.cs @@ -0,0 +1,326 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.ContainerService +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for SnapshotsOperations. + /// + public static partial class SnapshotsOperationsExtensions + { + /// + /// Gets a list of snapshots in the specified subscription. + /// + /// + /// The operations group for this extension method. + /// + public static IPage List(this ISnapshotsOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Gets a list of snapshots in the specified subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this ISnapshotsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists snapshots in the specified subscription and resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + public static IPage ListByResourceGroup(this ISnapshotsOperations operations, string resourceGroupName) + { + return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Lists snapshots in the specified subscription and resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupAsync(this ISnapshotsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a snapshot. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + public static Snapshot Get(this ISnapshotsOperations operations, string resourceGroupName, string resourceName) + { + return operations.GetAsync(resourceGroupName, resourceName).GetAwaiter().GetResult(); + } + + /// + /// Gets a snapshot. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this ISnapshotsOperations operations, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates a snapshot. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// The snapshot to create or update. + /// + public static Snapshot CreateOrUpdate(this ISnapshotsOperations operations, string resourceGroupName, string resourceName, Snapshot parameters) + { + return operations.CreateOrUpdateAsync(resourceGroupName, resourceName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a snapshot. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// The snapshot to create or update. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this ISnapshotsOperations operations, string resourceGroupName, string resourceName, Snapshot parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, resourceName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates tags on a snapshot. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// Resource tags. + /// + public static Snapshot UpdateTags(this ISnapshotsOperations operations, string resourceGroupName, string resourceName, IDictionary tags = default(IDictionary)) + { + return operations.UpdateTagsAsync(resourceGroupName, resourceName, tags).GetAwaiter().GetResult(); + } + + /// + /// Updates tags on a snapshot. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// Resource tags. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateTagsAsync(this ISnapshotsOperations operations, string resourceGroupName, string resourceName, IDictionary tags = default(IDictionary), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, resourceName, tags, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a snapshot. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + public static void Delete(this ISnapshotsOperations operations, string resourceGroupName, string resourceName) + { + operations.DeleteAsync(resourceGroupName, resourceName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a snapshot. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this ISnapshotsOperations operations, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets a list of snapshots in the specified subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this ISnapshotsOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of snapshots in the specified subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this ISnapshotsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists snapshots in the specified subscription and resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByResourceGroupNext(this ISnapshotsOperations operations, string nextPageLink) + { + return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists snapshots in the specified subscription and resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupNextAsync(this ISnapshotsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +}