From b47c3bbc1b26796e9b120510333a5be69071b4eb Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Mon, 26 Oct 2020 03:33:33 +0000 Subject: [PATCH] Generated from 99a9f972af31acc28570db133942d7bbc57a892b --- .../src/Generated/AgentPoolsOperations.cs | 322 ++- .../AgentPoolsOperationsExtensions.cs | 104 + .../src/Generated/ContainerServiceClient.cs | 32 +- .../Generated/ContainerServicesOperations.cs | 1689 ---------------- .../ContainerServicesOperationsExtensions.cs | 547 ------ .../src/Generated/IAgentPoolsOperations.cs | 62 + .../src/Generated/IContainerServiceClient.cs | 25 +- .../Generated/IContainerServicesOperations.cs | 340 ---- .../Generated/IManagedClustersOperations.cs | 70 +- .../IOpenShiftManagedClustersOperations.cs | 345 ---- .../IPrivateLinkResourcesOperations.cs | 58 + .../IResolvePrivateLinkServiceIdOperations.cs | 59 + .../Generated/ManagedClustersOperations.cs | 420 +++- .../ManagedClustersOperationsExtensions.cs | 128 +- .../src/Generated/Models/AgentPool.cs | 25 +- ...enShiftAgentPoolProfileRole.cs => Code.cs} | 8 +- .../ContainerServiceAgentPoolProfile.cs | 290 --- .../Models/ContainerServiceCustomProfile.cs | 68 - .../Generated/Models/ContainerServiceModel.cs | 204 -- .../ContainerServiceOrchestratorProfile.cs | 85 - ...ContainerServiceServicePrincipalProfile.cs | 92 - .../Models/ContainerServiceWindowsProfile.cs | 95 - ...erviceOrchestratorTypes.cs => Expander.cs} | 12 +- .../src/Generated/Models/KeyVaultSecretRef.cs | 85 - .../src/Generated/Models/ManagedCluster.cs | 20 +- .../Models/ManagedClusterAgentPoolProfile.cs | 10 +- ...anagedClusterAgentPoolProfileProperties.cs | 25 +- .../ManagedClusterAutoUpgradeProfile.cs | 55 + ...nagedClusterPropertiesAutoScalerProfile.cs | 54 +- .../src/Generated/Models/NetworkProfile.cs | 68 - .../src/Generated/Models/OSDiskType.cs | 22 + .../Models/OpenShiftContainerServiceVMSize.cs | 53 - .../Models/OpenShiftManagedCluster.cs | 185 -- ...nShiftManagedClusterAADIdentityProvider.cs | 82 - ...OpenShiftManagedClusterAgentPoolProfile.cs | 142 -- ...ShiftManagedClusterBaseIdentityProvider.cs | 36 - ...OpenShiftManagedClusterIdentityProvider.cs | 62 - ...penShiftManagedClusterMasterPoolProfile.cs | 130 -- .../Models/OpenShiftRouterProfile.cs | 69 - .../Generated/Models/OrchestratorProfile.cs | 83 - .../Models/OrchestratorVersionProfile.cs | 117 -- .../OrchestratorVersionProfileListResult.cs | 109 -- .../src/Generated/Models/Page.cs | 2 +- .../src/Generated/Models/Page1.cs | 2 +- .../src/Generated/Models/PowerState.cs | 53 + .../Generated/Models/PrivateLinkResource.cs | 96 + ...e.cs => PrivateLinkResourcesListResult.cs} | 27 +- .../src/Generated/Models/PurchasePlan.cs | 80 - .../src/Generated/Models/UpgradeChannel.cs | 23 + .../OpenShiftManagedClustersOperations.cs | 1720 ----------------- ...hiftManagedClustersOperationsExtensions.cs | 547 ------ .../src/Generated/Operations.cs | 18 +- .../PrivateEndpointConnectionsOperations.cs | 40 +- .../PrivateLinkResourcesOperations.cs | 276 +++ ...rivateLinkResourcesOperationsExtensions.cs | 73 + .../ResolvePrivateLinkServiceIdOperations.cs | 290 +++ ...rivateLinkServiceIdOperationsExtensions.cs | 79 + .../SdkInfo_ContainerServiceClient.cs | 24 +- 58 files changed, 2244 insertions(+), 7593 deletions(-) delete mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ContainerServicesOperations.cs delete mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ContainerServicesOperationsExtensions.cs delete mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IContainerServicesOperations.cs delete mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IOpenShiftManagedClustersOperations.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IPrivateLinkResourcesOperations.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IResolvePrivateLinkServiceIdOperations.cs rename sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/{OpenShiftAgentPoolProfileRole.cs => Code.cs} (69%) delete mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ContainerServiceAgentPoolProfile.cs delete mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ContainerServiceCustomProfile.cs delete mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ContainerServiceModel.cs delete mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ContainerServiceOrchestratorProfile.cs delete mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ContainerServiceServicePrincipalProfile.cs delete mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ContainerServiceWindowsProfile.cs rename sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/{ContainerServiceOrchestratorTypes.cs => Expander.cs} (56%) delete mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/KeyVaultSecretRef.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAutoUpgradeProfile.cs delete mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/NetworkProfile.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OSDiskType.cs delete mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OpenShiftContainerServiceVMSize.cs delete mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OpenShiftManagedCluster.cs delete mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OpenShiftManagedClusterAADIdentityProvider.cs delete mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OpenShiftManagedClusterAgentPoolProfile.cs delete mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OpenShiftManagedClusterBaseIdentityProvider.cs delete mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OpenShiftManagedClusterIdentityProvider.cs delete mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OpenShiftManagedClusterMasterPoolProfile.cs delete mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OpenShiftRouterProfile.cs delete mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OrchestratorProfile.cs delete mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OrchestratorVersionProfile.cs delete mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OrchestratorVersionProfileListResult.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/PowerState.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/PrivateLinkResource.cs rename sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/{OpenShiftManagedClusterAuthProfile.cs => PrivateLinkResourcesListResult.cs} (51%) delete mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/PurchasePlan.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/UpgradeChannel.cs delete mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/OpenShiftManagedClustersOperations.cs delete mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/OpenShiftManagedClustersOperationsExtensions.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/PrivateLinkResourcesOperations.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/PrivateLinkResourcesOperationsExtensions.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ResolvePrivateLinkServiceIdOperations.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ResolvePrivateLinkServiceIdOperationsExtensions.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 4a5ecad46cda4..ccb0628f913b0 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/AgentPoolsOperations.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/AgentPoolsOperations.cs @@ -86,6 +86,10 @@ internal AgentPoolsOperations(ContainerServiceClient client) /// public async Task>> ListWithHttpMessagesAsync(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"); @@ -120,7 +124,6 @@ internal AgentPoolsOperations(ContainerServiceClient client) throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); } } - string apiVersion = "2020-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -128,7 +131,6 @@ internal AgentPoolsOperations(ContainerServiceClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("resourceName", resourceName); tracingParameters.Add("cancellationToken", cancellationToken); @@ -141,9 +143,9 @@ internal AgentPoolsOperations(ContainerServiceClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -251,7 +253,7 @@ internal AgentPoolsOperations(ContainerServiceClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -308,6 +310,10 @@ internal AgentPoolsOperations(ContainerServiceClient client) /// public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string resourceName, string agentPoolName, 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"); @@ -346,7 +352,6 @@ internal AgentPoolsOperations(ContainerServiceClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "agentPoolName"); } - string apiVersion = "2020-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -354,7 +359,6 @@ internal AgentPoolsOperations(ContainerServiceClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("resourceName", resourceName); tracingParameters.Add("agentPoolName", agentPoolName); @@ -369,9 +373,9 @@ internal AgentPoolsOperations(ContainerServiceClient client) _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); _url = _url.Replace("{agentPoolName}", System.Uri.EscapeDataString(agentPoolName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -596,6 +600,10 @@ internal AgentPoolsOperations(ContainerServiceClient client) /// public async Task> GetUpgradeProfileWithHttpMessagesAsync(string resourceGroupName, string resourceName, string agentPoolName, 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"); @@ -634,7 +642,6 @@ internal AgentPoolsOperations(ContainerServiceClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "agentPoolName"); } - string apiVersion = "2020-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -642,7 +649,6 @@ internal AgentPoolsOperations(ContainerServiceClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("resourceName", resourceName); tracingParameters.Add("agentPoolName", agentPoolName); @@ -657,9 +663,9 @@ internal AgentPoolsOperations(ContainerServiceClient client) _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); _url = _url.Replace("{agentPoolName}", System.Uri.EscapeDataString(agentPoolName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -821,6 +827,10 @@ internal AgentPoolsOperations(ContainerServiceClient client) /// public async Task> GetAvailableAgentPoolVersionsWithHttpMessagesAsync(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"); @@ -855,7 +865,6 @@ internal AgentPoolsOperations(ContainerServiceClient client) throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); } } - string apiVersion = "2020-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -863,7 +872,6 @@ internal AgentPoolsOperations(ContainerServiceClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("resourceName", resourceName); tracingParameters.Add("cancellationToken", cancellationToken); @@ -876,9 +884,9 @@ internal AgentPoolsOperations(ContainerServiceClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1005,6 +1013,34 @@ internal AgentPoolsOperations(ContainerServiceClient client) return _result; } + /// + /// Upgrade node image version of an agent pool to the latest. + /// + /// + /// Upgrade node image version of an agent pool to the latest. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// The name of the agent pool. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + 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); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + /// /// Creates or updates an agent pool. /// @@ -1046,6 +1082,10 @@ internal AgentPoolsOperations(ContainerServiceClient client) /// public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string resourceName, string agentPoolName, AgentPool 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"); @@ -1088,7 +1128,6 @@ internal AgentPoolsOperations(ContainerServiceClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2020-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1096,7 +1135,6 @@ internal AgentPoolsOperations(ContainerServiceClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("resourceName", resourceName); tracingParameters.Add("agentPoolName", agentPoolName); @@ -1112,9 +1150,9 @@ internal AgentPoolsOperations(ContainerServiceClient client) _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); _url = _url.Replace("{agentPoolName}", System.Uri.EscapeDataString(agentPoolName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1300,6 +1338,10 @@ internal AgentPoolsOperations(ContainerServiceClient client) /// public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string resourceName, string agentPoolName, 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"); @@ -1338,7 +1380,6 @@ internal AgentPoolsOperations(ContainerServiceClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "agentPoolName"); } - string apiVersion = "2020-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1346,7 +1387,6 @@ internal AgentPoolsOperations(ContainerServiceClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("resourceName", resourceName); tracingParameters.Add("agentPoolName", agentPoolName); @@ -1361,9 +1401,9 @@ internal AgentPoolsOperations(ContainerServiceClient client) _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); _url = _url.Replace("{agentPoolName}", System.Uri.EscapeDataString(agentPoolName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1472,6 +1512,236 @@ internal AgentPoolsOperations(ContainerServiceClient client) return _result; } + /// + /// Upgrade node image version of an agent pool to the latest. + /// + /// + /// Upgrade node image version of an agent pool to the latest. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// The name of the agent pool. + /// + /// + /// 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> BeginUpgradeNodeImageVersionWithHttpMessagesAsync(string resourceGroupName, string resourceName, string agentPoolName, 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 (agentPoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "agentPoolName"); + } + // 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("agentPoolName", agentPoolName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpgradeNodeImageVersion", 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/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion").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)); + _url = _url.Replace("{agentPoolName}", System.Uri.EscapeDataString(agentPoolName)); + 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("POST"); + _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 != 202) + { + 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 == 202) + { + _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 list of agent pools in the specified managed cluster. /// @@ -1630,7 +1900,7 @@ internal AgentPoolsOperations(ContainerServiceClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/AgentPoolsOperationsExtensions.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/AgentPoolsOperationsExtensions.cs index fac6394a3939e..e947c3f53ea6b 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/AgentPoolsOperationsExtensions.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/AgentPoolsOperationsExtensions.cs @@ -328,6 +328,58 @@ public static AgentPoolAvailableVersions GetAvailableAgentPoolVersions(this IAge } } + /// + /// Upgrade node image version of an agent pool to the latest. + /// + /// + /// Upgrade node image version of an agent pool to the latest. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// The name of the agent pool. + /// + public static AgentPool UpgradeNodeImageVersion(this IAgentPoolsOperations operations, string resourceGroupName, string resourceName, string agentPoolName) + { + return operations.UpgradeNodeImageVersionAsync(resourceGroupName, resourceName, agentPoolName).GetAwaiter().GetResult(); + } + + /// + /// Upgrade node image version of an agent pool to the latest. + /// + /// + /// Upgrade node image version of an agent pool to the latest. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// The name of the agent pool. + /// + /// + /// The cancellation token. + /// + public static async Task UpgradeNodeImageVersionAsync(this IAgentPoolsOperations operations, string resourceGroupName, string resourceName, string agentPoolName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpgradeNodeImageVersionWithHttpMessagesAsync(resourceGroupName, resourceName, agentPoolName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Creates or updates an agent pool. /// @@ -435,6 +487,58 @@ public static void BeginDelete(this IAgentPoolsOperations operations, string res (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, resourceName, agentPoolName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } + /// + /// Upgrade node image version of an agent pool to the latest. + /// + /// + /// Upgrade node image version of an agent pool to the latest. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// The name of the agent pool. + /// + public static AgentPool BeginUpgradeNodeImageVersion(this IAgentPoolsOperations operations, string resourceGroupName, string resourceName, string agentPoolName) + { + return operations.BeginUpgradeNodeImageVersionAsync(resourceGroupName, resourceName, agentPoolName).GetAwaiter().GetResult(); + } + + /// + /// Upgrade node image version of an agent pool to the latest. + /// + /// + /// Upgrade node image version of an agent pool to the latest. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// The name of the agent pool. + /// + /// + /// The cancellation token. + /// + public static async Task BeginUpgradeNodeImageVersionAsync(this IAgentPoolsOperations operations, string resourceGroupName, string resourceName, string agentPoolName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUpgradeNodeImageVersionWithHttpMessagesAsync(resourceGroupName, resourceName, agentPoolName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Gets a list of agent pools in the specified managed cluster. /// 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 b53e00facb1ec..0d45a2d5a5d69 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ContainerServiceClient.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ContainerServiceClient.cs @@ -53,6 +53,11 @@ public partial class ContainerServiceClient : ServiceClient public string SubscriptionId { get; set; } + /// + /// Client Api Version. + /// + public string ApiVersion { get; private set; } + /// /// The preferred language for the response. /// @@ -71,16 +76,6 @@ public partial class ContainerServiceClient : ServiceClient public bool? GenerateClientRequestId { get; set; } - /// - /// Gets the IOpenShiftManagedClustersOperations. - /// - public virtual IOpenShiftManagedClustersOperations OpenShiftManagedClusters { get; private set; } - - /// - /// Gets the IContainerServicesOperations. - /// - public virtual IContainerServicesOperations ContainerServices { get; private set; } - /// /// Gets the IOperations. /// @@ -101,6 +96,16 @@ public partial class ContainerServiceClient : ServiceClient public virtual IPrivateEndpointConnectionsOperations PrivateEndpointConnections { get; private set; } + /// + /// Gets the IPrivateLinkResourcesOperations. + /// + public virtual IPrivateLinkResourcesOperations PrivateLinkResources { get; private set; } + + /// + /// Gets the IResolvePrivateLinkServiceIdOperations. + /// + public virtual IResolvePrivateLinkServiceIdOperations ResolvePrivateLinkServiceId { get; private set; } + /// /// Initializes a new instance of the ContainerServiceClient class. /// @@ -342,13 +347,14 @@ public ContainerServiceClient(System.Uri baseUri, ServiceClientCredentials crede /// private void Initialize() { - OpenShiftManagedClusters = new OpenShiftManagedClustersOperations(this); - ContainerServices = new ContainerServicesOperations(this); Operations = new Operations(this); ManagedClusters = new ManagedClustersOperations(this); AgentPools = new AgentPoolsOperations(this); PrivateEndpointConnections = new PrivateEndpointConnectionsOperations(this); + PrivateLinkResources = new PrivateLinkResourcesOperations(this); + ResolvePrivateLinkServiceId = new ResolvePrivateLinkServiceIdOperations(this); BaseUri = new System.Uri("https://management.azure.com"); + ApiVersion = "2020-11-01"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; @@ -378,8 +384,6 @@ private void Initialize() new Iso8601TimeSpanConverter() } }; - SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("kind")); - DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("kind")); CustomInitialize(); DeserializationSettings.Converters.Add(new TransformationJsonConverter()); DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ContainerServicesOperations.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ContainerServicesOperations.cs deleted file mode 100644 index 564aab6846208..0000000000000 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ContainerServicesOperations.cs +++ /dev/null @@ -1,1689 +0,0 @@ -// -// 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; - - /// - /// ContainerServicesOperations operations. - /// - internal partial class ContainerServicesOperations : IServiceOperations, IContainerServicesOperations - { - /// - /// Initializes a new instance of the ContainerServicesOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal ContainerServicesOperations(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 container services in the specified subscription. - /// - /// - /// Gets a list of container services in the specified subscription. The - /// operation returns properties of each container service including state, - /// orchestrator, number of masters and agents, and FQDNs of masters and - /// agents. - /// - /// - /// 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. - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2017-07-01"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - 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/containerServices").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 container service. - /// - /// - /// Creates or updates a container service with the specified configuration of - /// orchestrator, masters, and agents. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - /// - /// Parameters supplied to the Create or Update a Container Service operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string containerServiceName, ContainerServiceModel parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, containerServiceName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets the properties of the specified container service. - /// - /// - /// Gets the properties of the specified container service in the specified - /// subscription and resource group. The operation returns the properties - /// including state, orchestrator, number of masters and agents, and FQDNs of - /// masters and agents. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// 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. - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string containerServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (containerServiceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "containerServiceName"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2017-07-01"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("containerServiceName", containerServiceName); - tracingParameters.Add("apiVersion", apiVersion); - 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/containerServices/{containerServiceName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{containerServiceName}", System.Uri.EscapeDataString(containerServiceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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; - } - - /// - /// Deletes the specified container service. - /// - /// - /// Deletes the specified container service in the specified subscription and - /// resource group. The operation does not delete other resources created as - /// part of creating a container service, including storage accounts, VMs, and - /// availability sets. All the other resources created with the container - /// service are part of the same resource group and can be deleted - /// individually. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string containerServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, containerServiceName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets a list of container services in the specified resource group. - /// - /// - /// Gets a list of container services in the specified subscription and - /// resource group. The operation returns properties of each container service - /// including state, orchestrator, number of masters and agents, and FQDNs of - /// masters and agents. - /// - /// - /// 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. - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2017-07-01"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("apiVersion", apiVersion); - 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/containerServices").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 list of supported orchestrators in the specified subscription. - /// - /// - /// Gets a list of supported orchestrators in the specified subscription. The - /// operation returns properties of each orchestrator including version, - /// available upgrades and whether that version or upgrades are in preview. - /// - /// - /// The name of a supported Azure region. - /// - /// - /// resource type for which the list of orchestrators needs to be returned - /// - /// - /// 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> ListOrchestratorsWithHttpMessagesAsync(string location, string resourceType = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (location == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); - } - string apiVersion = "2019-08-01"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("location", location); - tracingParameters.Add("resourceType", resourceType); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListOrchestrators", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/orchestrators").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (resourceType != null) - { - _queryParameters.Add(string.Format("resource-type={0}", System.Uri.EscapeDataString(resourceType))); - } - 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 container service. - /// - /// - /// Creates or updates a container service with the specified configuration of - /// orchestrator, masters, and agents. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - /// - /// Parameters supplied to the Create or Update a Container Service 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. - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string containerServiceName, ContainerServiceModel parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (containerServiceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "containerServiceName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2017-07-01"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("containerServiceName", containerServiceName); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", 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/containerServices/{containerServiceName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{containerServiceName}", System.Uri.EscapeDataString(containerServiceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 && (int)_statusCode != 202) - { - 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); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _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 the specified container service. - /// - /// - /// Deletes the specified container service in the specified subscription and - /// resource group. The operation does not delete other resources created as - /// part of creating a container service, including storage accounts, VMs, and - /// availability sets. All the other resources created with the container - /// service are part of the same resource group and can be deleted - /// individually. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - /// - /// 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. - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string containerServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (containerServiceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "containerServiceName"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2017-07-01"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("containerServiceName", containerServiceName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", 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/containerServices/{containerServiceName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{containerServiceName}", System.Uri.EscapeDataString(containerServiceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 != 202 && (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 container services in the specified subscription. - /// - /// - /// Gets a list of container services in the specified subscription. The - /// operation returns properties of each container service including state, - /// orchestrator, number of masters and agents, and FQDNs of masters and - /// agents. - /// - /// - /// 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. - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - 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; - } - - /// - /// Gets a list of container services in the specified resource group. - /// - /// - /// Gets a list of container services in the specified subscription and - /// resource group. The operation returns properties of each container service - /// including state, orchestrator, number of masters and agents, and FQDNs of - /// masters and agents. - /// - /// - /// 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. - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - 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/ContainerServicesOperationsExtensions.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ContainerServicesOperationsExtensions.cs deleted file mode 100644 index bea8a4a2c4b8e..0000000000000 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ContainerServicesOperationsExtensions.cs +++ /dev/null @@ -1,547 +0,0 @@ -// -// 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.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for ContainerServicesOperations. - /// - public static partial class ContainerServicesOperationsExtensions - { - /// - /// Gets a list of container services in the specified subscription. - /// - /// - /// Gets a list of container services in the specified subscription. The - /// operation returns properties of each container service including state, - /// orchestrator, number of masters and agents, and FQDNs of masters and - /// agents. - /// - /// - /// The operations group for this extension method. - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - public static IPage List(this IContainerServicesOperations operations) - { - return operations.ListAsync().GetAwaiter().GetResult(); - } - - /// - /// Gets a list of container services in the specified subscription. - /// - /// - /// Gets a list of container services in the specified subscription. The - /// operation returns properties of each container service including state, - /// orchestrator, number of masters and agents, and FQDNs of masters and - /// agents. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - public static async Task> ListAsync(this IContainerServicesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates a container service. - /// - /// - /// Creates or updates a container service with the specified configuration of - /// orchestrator, masters, and agents. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - /// - /// Parameters supplied to the Create or Update a Container Service operation. - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - public static ContainerServiceModel CreateOrUpdate(this IContainerServicesOperations operations, string resourceGroupName, string containerServiceName, ContainerServiceModel parameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, containerServiceName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a container service. - /// - /// - /// Creates or updates a container service with the specified configuration of - /// orchestrator, masters, and agents. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - /// - /// Parameters supplied to the Create or Update a Container Service operation. - /// - /// - /// The cancellation token. - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - public static async Task CreateOrUpdateAsync(this IContainerServicesOperations operations, string resourceGroupName, string containerServiceName, ContainerServiceModel parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, containerServiceName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the properties of the specified container service. - /// - /// - /// Gets the properties of the specified container service in the specified - /// subscription and resource group. The operation returns the properties - /// including state, orchestrator, number of masters and agents, and FQDNs of - /// masters and agents. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - public static ContainerServiceModel Get(this IContainerServicesOperations operations, string resourceGroupName, string containerServiceName) - { - return operations.GetAsync(resourceGroupName, containerServiceName).GetAwaiter().GetResult(); - } - - /// - /// Gets the properties of the specified container service. - /// - /// - /// Gets the properties of the specified container service in the specified - /// subscription and resource group. The operation returns the properties - /// including state, orchestrator, number of masters and agents, and FQDNs of - /// masters and agents. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - /// - /// The cancellation token. - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - public static async Task GetAsync(this IContainerServicesOperations operations, string resourceGroupName, string containerServiceName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, containerServiceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes the specified container service. - /// - /// - /// Deletes the specified container service in the specified subscription and - /// resource group. The operation does not delete other resources created as - /// part of creating a container service, including storage accounts, VMs, and - /// availability sets. All the other resources created with the container - /// service are part of the same resource group and can be deleted - /// individually. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - public static void Delete(this IContainerServicesOperations operations, string resourceGroupName, string containerServiceName) - { - operations.DeleteAsync(resourceGroupName, containerServiceName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified container service. - /// - /// - /// Deletes the specified container service in the specified subscription and - /// resource group. The operation does not delete other resources created as - /// part of creating a container service, including storage accounts, VMs, and - /// availability sets. All the other resources created with the container - /// service are part of the same resource group and can be deleted - /// individually. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - /// - /// The cancellation token. - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - public static async Task DeleteAsync(this IContainerServicesOperations operations, string resourceGroupName, string containerServiceName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, containerServiceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets a list of container services in the specified resource group. - /// - /// - /// Gets a list of container services in the specified subscription and - /// resource group. The operation returns properties of each container service - /// including state, orchestrator, number of masters and agents, and FQDNs of - /// masters and agents. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - public static IPage ListByResourceGroup(this IContainerServicesOperations operations, string resourceGroupName) - { - return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); - } - - /// - /// Gets a list of container services in the specified resource group. - /// - /// - /// Gets a list of container services in the specified subscription and - /// resource group. The operation returns properties of each container service - /// including state, orchestrator, number of masters and agents, and FQDNs of - /// masters and agents. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The cancellation token. - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - public static async Task> ListByResourceGroupAsync(this IContainerServicesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a list of supported orchestrators in the specified subscription. - /// - /// - /// Gets a list of supported orchestrators in the specified subscription. The - /// operation returns properties of each orchestrator including version, - /// available upgrades and whether that version or upgrades are in preview. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of a supported Azure region. - /// - /// - /// resource type for which the list of orchestrators needs to be returned - /// - public static OrchestratorVersionProfileListResult ListOrchestrators(this IContainerServicesOperations operations, string location, string resourceType = default(string)) - { - return operations.ListOrchestratorsAsync(location, resourceType).GetAwaiter().GetResult(); - } - - /// - /// Gets a list of supported orchestrators in the specified subscription. - /// - /// - /// Gets a list of supported orchestrators in the specified subscription. The - /// operation returns properties of each orchestrator including version, - /// available upgrades and whether that version or upgrades are in preview. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of a supported Azure region. - /// - /// - /// resource type for which the list of orchestrators needs to be returned - /// - /// - /// The cancellation token. - /// - public static async Task ListOrchestratorsAsync(this IContainerServicesOperations operations, string location, string resourceType = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListOrchestratorsWithHttpMessagesAsync(location, resourceType, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates a container service. - /// - /// - /// Creates or updates a container service with the specified configuration of - /// orchestrator, masters, and agents. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - /// - /// Parameters supplied to the Create or Update a Container Service operation. - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - public static ContainerServiceModel BeginCreateOrUpdate(this IContainerServicesOperations operations, string resourceGroupName, string containerServiceName, ContainerServiceModel parameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, containerServiceName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a container service. - /// - /// - /// Creates or updates a container service with the specified configuration of - /// orchestrator, masters, and agents. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - /// - /// Parameters supplied to the Create or Update a Container Service operation. - /// - /// - /// The cancellation token. - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - public static async Task BeginCreateOrUpdateAsync(this IContainerServicesOperations operations, string resourceGroupName, string containerServiceName, ContainerServiceModel parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, containerServiceName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes the specified container service. - /// - /// - /// Deletes the specified container service in the specified subscription and - /// resource group. The operation does not delete other resources created as - /// part of creating a container service, including storage accounts, VMs, and - /// availability sets. All the other resources created with the container - /// service are part of the same resource group and can be deleted - /// individually. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - public static void BeginDelete(this IContainerServicesOperations operations, string resourceGroupName, string containerServiceName) - { - operations.BeginDeleteAsync(resourceGroupName, containerServiceName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified container service. - /// - /// - /// Deletes the specified container service in the specified subscription and - /// resource group. The operation does not delete other resources created as - /// part of creating a container service, including storage accounts, VMs, and - /// availability sets. All the other resources created with the container - /// service are part of the same resource group and can be deleted - /// individually. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - /// - /// The cancellation token. - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - public static async Task BeginDeleteAsync(this IContainerServicesOperations operations, string resourceGroupName, string containerServiceName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, containerServiceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets a list of container services in the specified subscription. - /// - /// - /// Gets a list of container services in the specified subscription. The - /// operation returns properties of each container service including state, - /// orchestrator, number of masters and agents, and FQDNs of masters and - /// agents. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - public static IPage ListNext(this IContainerServicesOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets a list of container services in the specified subscription. - /// - /// - /// Gets a list of container services in the specified subscription. The - /// operation returns properties of each container service including state, - /// orchestrator, number of masters and agents, and FQDNs of masters and - /// agents. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - public static async Task> ListNextAsync(this IContainerServicesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a list of container services in the specified resource group. - /// - /// - /// Gets a list of container services in the specified subscription and - /// resource group. The operation returns properties of each container service - /// including state, orchestrator, number of masters and agents, and FQDNs of - /// masters and agents. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - public static IPage ListByResourceGroupNext(this IContainerServicesOperations operations, string nextPageLink) - { - return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets a list of container services in the specified resource group. - /// - /// - /// Gets a list of container services in the specified subscription and - /// resource group. The operation returns properties of each container service - /// including state, orchestrator, number of masters and agents, and FQDNs of - /// masters and agents. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - public static async Task> ListByResourceGroupNextAsync(this IContainerServicesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} 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 40bf792cb96bc..7c2a6be303d51 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IAgentPoolsOperations.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IAgentPoolsOperations.cs @@ -208,6 +208,37 @@ public partial interface IAgentPoolsOperations /// Task> GetAvailableAgentPoolVersionsWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Upgrade node image version of an agent pool to the latest. + /// + /// + /// Upgrade node image version of an agent pool to the latest. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// The name of the agent pool. + /// + /// + /// 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> UpgradeNodeImageVersionWithHttpMessagesAsync(string resourceGroupName, string resourceName, string agentPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Creates or updates an agent pool. /// /// @@ -271,6 +302,37 @@ public partial interface IAgentPoolsOperations /// Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string resourceName, string agentPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Upgrade node image version of an agent pool to the latest. + /// + /// + /// Upgrade node image version of an agent pool to the latest. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// The name of the agent pool. + /// + /// + /// 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> 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 8f78954b872fc..9b684521d420d 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IContainerServiceClient.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IContainerServiceClient.cs @@ -47,6 +47,11 @@ public partial interface IContainerServiceClient : System.IDisposable /// string SubscriptionId { get; set; } + /// + /// Client Api Version. + /// + string ApiVersion { get; } + /// /// The preferred language for the response. /// @@ -66,16 +71,6 @@ public partial interface IContainerServiceClient : System.IDisposable bool? GenerateClientRequestId { get; set; } - /// - /// Gets the IOpenShiftManagedClustersOperations. - /// - IOpenShiftManagedClustersOperations OpenShiftManagedClusters { get; } - - /// - /// Gets the IContainerServicesOperations. - /// - IContainerServicesOperations ContainerServices { get; } - /// /// Gets the IOperations. /// @@ -96,5 +91,15 @@ public partial interface IContainerServiceClient : System.IDisposable /// IPrivateEndpointConnectionsOperations PrivateEndpointConnections { get; } + /// + /// Gets the IPrivateLinkResourcesOperations. + /// + IPrivateLinkResourcesOperations PrivateLinkResources { get; } + + /// + /// Gets the IResolvePrivateLinkServiceIdOperations. + /// + IResolvePrivateLinkServiceIdOperations ResolvePrivateLinkServiceId { get; } + } } diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IContainerServicesOperations.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IContainerServicesOperations.cs deleted file mode 100644 index a081424bad6c6..0000000000000 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IContainerServicesOperations.cs +++ /dev/null @@ -1,340 +0,0 @@ -// -// 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; - - /// - /// ContainerServicesOperations operations. - /// - public partial interface IContainerServicesOperations - { - /// - /// Gets a list of container services in the specified subscription. - /// - /// - /// Gets a list of container services in the specified subscription. - /// The operation returns properties of each container service - /// including state, orchestrator, number of masters and agents, and - /// FQDNs of masters and agents. - /// - /// - /// 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 - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates or updates a container service. - /// - /// - /// Creates or updates a container service with the specified - /// configuration of orchestrator, masters, and agents. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - /// - /// Parameters supplied to the Create or Update a Container Service - /// 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 - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string containerServiceName, ContainerServiceModel parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets the properties of the specified container service. - /// - /// - /// Gets the properties of the specified container service in the - /// specified subscription and resource group. The operation returns - /// the properties including state, orchestrator, number of masters and - /// agents, and FQDNs of masters and agents. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// 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 - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - Task> GetWithHttpMessagesAsync(string resourceGroupName, string containerServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes the specified container service. - /// - /// - /// Deletes the specified container service in the specified - /// subscription and resource group. The operation does not delete - /// other resources created as part of creating a container service, - /// including storage accounts, VMs, and availability sets. All the - /// other resources created with the container service are part of the - /// same resource group and can be deleted individually. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - /// - /// 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 - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string containerServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets a list of container services in the specified resource group. - /// - /// - /// Gets a list of container services in the specified subscription and - /// resource group. The operation returns properties of each container - /// service including state, orchestrator, number of masters and - /// agents, and FQDNs of masters and agents. - /// - /// - /// 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 - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets a list of supported orchestrators in the specified - /// subscription. - /// - /// - /// Gets a list of supported orchestrators in the specified - /// subscription. The operation returns properties of each orchestrator - /// including version, available upgrades and whether that version or - /// upgrades are in preview. - /// - /// - /// The name of a supported Azure region. - /// - /// - /// resource type for which the list of orchestrators needs to be - /// returned - /// - /// - /// 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> ListOrchestratorsWithHttpMessagesAsync(string location, string resourceType = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates or updates a container service. - /// - /// - /// Creates or updates a container service with the specified - /// configuration of orchestrator, masters, and agents. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - /// - /// Parameters supplied to the Create or Update a Container Service - /// 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 - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string containerServiceName, ContainerServiceModel parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes the specified container service. - /// - /// - /// Deletes the specified container service in the specified - /// subscription and resource group. The operation does not delete - /// other resources created as part of creating a container service, - /// including storage accounts, VMs, and availability sets. All the - /// other resources created with the container service are part of the - /// same resource group and can be deleted individually. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - /// - /// 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 - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string containerServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets a list of container services in the specified subscription. - /// - /// - /// Gets a list of container services in the specified subscription. - /// The operation returns properties of each container service - /// including state, orchestrator, number of masters and agents, and - /// FQDNs of masters and agents. - /// - /// - /// 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 - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets a list of container services in the specified resource group. - /// - /// - /// Gets a list of container services in the specified subscription and - /// resource group. The operation returns properties of each container - /// service including state, orchestrator, number of masters and - /// agents, and FQDNs of masters and agents. - /// - /// - /// 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 - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} 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 7c90c0b4370a4..c52b4bd29ef41 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IManagedClustersOperations.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IManagedClustersOperations.cs @@ -430,10 +430,10 @@ public partial interface IManagedClustersOperations /// Task RotateClusterCertificatesWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Upgrade node image version of an agent pool to the latest. + /// Stop Managed Cluster /// /// - /// Upgrade node image version of an agent pool to the latest. + /// Stops a Running Managed Cluster /// /// /// The name of the resource group. @@ -441,9 +441,6 @@ public partial interface IManagedClustersOperations /// /// The name of the managed cluster resource. /// - /// - /// The name of the agent pool. - /// /// /// The headers that will be added to request. /// @@ -453,13 +450,35 @@ public partial interface IManagedClustersOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response + /// + /// Thrown when a required parameter is null + /// + Task StopWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Start Managed Cluster + /// + /// + /// Starts a Stopped Managed Cluster + /// + /// + /// 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> UpgradeNodeImageVersionWithHttpMessagesAsync(string resourceGroupName, string resourceName, string agentPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task StartWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Creates or updates a managed cluster. /// @@ -634,10 +653,10 @@ public partial interface IManagedClustersOperations /// Task BeginRotateClusterCertificatesWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Upgrade node image version of an agent pool to the latest. + /// Stop Managed Cluster /// /// - /// Upgrade node image version of an agent pool to the latest. + /// Stops a Running Managed Cluster /// /// /// The name of the resource group. @@ -645,9 +664,6 @@ public partial interface IManagedClustersOperations /// /// The name of the managed cluster resource. /// - /// - /// The name of the agent pool. - /// /// /// The headers that will be added to request. /// @@ -657,13 +673,35 @@ public partial interface IManagedClustersOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response + /// + /// Thrown when a required parameter is null + /// + Task BeginStopWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Start Managed Cluster + /// + /// + /// Starts a Stopped Managed Cluster + /// + /// + /// 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> BeginUpgradeNodeImageVersionWithHttpMessagesAsync(string resourceGroupName, string resourceName, string agentPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task BeginStartWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets a list of managed clusters in the specified subscription. /// diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IOpenShiftManagedClustersOperations.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IOpenShiftManagedClustersOperations.cs deleted file mode 100644 index 50a414c1f49ab..0000000000000 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IOpenShiftManagedClustersOperations.cs +++ /dev/null @@ -1,345 +0,0 @@ -// -// 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; - - /// - /// OpenShiftManagedClustersOperations operations. - /// - public partial interface IOpenShiftManagedClustersOperations - { - /// - /// Gets a list of OpenShift managed clusters in the specified - /// subscription. - /// - /// - /// Gets a list of OpenShift managed clusters in the specified - /// subscription. The operation returns properties of each OpenShift - /// managed cluster. - /// - /// - /// 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 OpenShift managed clusters in the specified subscription and - /// resource group. - /// - /// - /// Lists OpenShift managed clusters in the specified subscription and - /// resource group. The operation returns properties of each OpenShift - /// managed cluster. - /// - /// - /// 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 OpenShift managed cluster. - /// - /// - /// Gets the details of the managed OpenShift cluster with a specified - /// resource group and name. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the OpenShift 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 an OpenShift managed cluster. - /// - /// - /// Creates or updates a OpenShift managed cluster with the specified - /// configuration for agents and OpenShift version. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the OpenShift managed cluster resource. - /// - /// - /// Parameters supplied to the Create or Update an OpenShift Managed - /// Cluster 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> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string resourceName, OpenShiftManagedCluster parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Updates tags on an OpenShift managed cluster. - /// - /// - /// Updates an OpenShift managed cluster with the specified tags. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the OpenShift 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 an OpenShift managed cluster. - /// - /// - /// Deletes the OpenShift managed cluster with a specified resource - /// group and name. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the OpenShift 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)); - /// - /// Creates or updates an OpenShift managed cluster. - /// - /// - /// Creates or updates a OpenShift managed cluster with the specified - /// configuration for agents and OpenShift version. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the OpenShift managed cluster resource. - /// - /// - /// Parameters supplied to the Create or Update an OpenShift Managed - /// Cluster 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> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string resourceName, OpenShiftManagedCluster parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Updates tags on an OpenShift managed cluster. - /// - /// - /// Updates an OpenShift managed cluster with the specified tags. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the OpenShift 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> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string resourceName, IDictionary tags = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes an OpenShift managed cluster. - /// - /// - /// Deletes the OpenShift managed cluster with a specified resource - /// group and name. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the OpenShift 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 BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets a list of OpenShift managed clusters in the specified - /// subscription. - /// - /// - /// Gets a list of OpenShift managed clusters in the specified - /// subscription. The operation returns properties of each OpenShift - /// managed cluster. - /// - /// - /// 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 OpenShift managed clusters in the specified subscription and - /// resource group. - /// - /// - /// Lists OpenShift managed clusters in the specified subscription and - /// resource group. The operation returns properties of each OpenShift - /// managed cluster. - /// - /// - /// 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/IPrivateLinkResourcesOperations.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IPrivateLinkResourcesOperations.cs new file mode 100644 index 0000000000000..21e62d6e697d3 --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IPrivateLinkResourcesOperations.cs @@ -0,0 +1,58 @@ +// +// 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; + + /// + /// PrivateLinkResourcesOperations operations. + /// + public partial interface IPrivateLinkResourcesOperations + { + /// + /// Gets a list of private link resources in the specified managed + /// cluster. + /// + /// + /// Gets a list of private link resources in the specified managed + /// cluster. The operation returns properties of each private link + /// resource. + /// + /// + /// 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> ListWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IResolvePrivateLinkServiceIdOperations.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IResolvePrivateLinkServiceIdOperations.cs new file mode 100644 index 0000000000000..6d0a46c660b50 --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IResolvePrivateLinkServiceIdOperations.cs @@ -0,0 +1,59 @@ +// +// 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; + + /// + /// ResolvePrivateLinkServiceIdOperations operations. + /// + public partial interface IResolvePrivateLinkServiceIdOperations + { + /// + /// Gets the private link service ID for the specified managed cluster. + /// + /// + /// Gets the private link service ID the specified managed cluster. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// Parameters (name, groupId) supplied in order to resolve a private + /// link service ID. + /// + /// + /// 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> POSTWithHttpMessagesAsync(string resourceGroupName, string resourceName, PrivateLinkResource parameters, 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 a7a6108f31b6b..211712d901f40 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ManagedClustersOperations.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ManagedClustersOperations.cs @@ -80,11 +80,14 @@ internal ManagedClustersOperations(ContainerServiceClient client) /// 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"); } - string apiVersion = "2020-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -92,7 +95,6 @@ internal ManagedClustersOperations(ContainerServiceClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -101,9 +103,9 @@ internal ManagedClustersOperations(ContainerServiceClient client) var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -211,7 +213,7 @@ internal ManagedClustersOperations(ContainerServiceClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -263,6 +265,10 @@ internal ManagedClustersOperations(ContainerServiceClient client) /// 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"); @@ -278,7 +284,6 @@ internal ManagedClustersOperations(ContainerServiceClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } - string apiVersion = "2020-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -286,7 +291,6 @@ internal ManagedClustersOperations(ContainerServiceClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); @@ -297,9 +301,9 @@ internal ManagedClustersOperations(ContainerServiceClient client) _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -407,7 +411,7 @@ internal ManagedClustersOperations(ContainerServiceClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -462,6 +466,10 @@ internal ManagedClustersOperations(ContainerServiceClient client) /// public async Task> GetUpgradeProfileWithHttpMessagesAsync(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"); @@ -496,7 +504,6 @@ internal ManagedClustersOperations(ContainerServiceClient client) throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); } } - string apiVersion = "2020-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -504,7 +511,6 @@ internal ManagedClustersOperations(ContainerServiceClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("resourceName", resourceName); tracingParameters.Add("cancellationToken", cancellationToken); @@ -517,9 +523,9 @@ internal ManagedClustersOperations(ContainerServiceClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -691,6 +697,10 @@ internal ManagedClustersOperations(ContainerServiceClient client) [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] public async Task> GetAccessProfileWithHttpMessagesAsync(string resourceGroupName, string resourceName, string roleName, 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"); @@ -729,7 +739,6 @@ internal ManagedClustersOperations(ContainerServiceClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "roleName"); } - string apiVersion = "2020-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -737,7 +746,6 @@ internal ManagedClustersOperations(ContainerServiceClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("resourceName", resourceName); tracingParameters.Add("roleName", roleName); @@ -752,9 +760,9 @@ internal ManagedClustersOperations(ContainerServiceClient client) _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); _url = _url.Replace("{roleName}", System.Uri.EscapeDataString(roleName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -917,6 +925,10 @@ internal ManagedClustersOperations(ContainerServiceClient client) /// public async Task> ListClusterAdminCredentialsWithHttpMessagesAsync(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"); @@ -951,7 +963,6 @@ internal ManagedClustersOperations(ContainerServiceClient client) throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); } } - string apiVersion = "2020-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -959,7 +970,6 @@ internal ManagedClustersOperations(ContainerServiceClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("resourceName", resourceName); tracingParameters.Add("cancellationToken", cancellationToken); @@ -972,9 +982,9 @@ internal ManagedClustersOperations(ContainerServiceClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1137,6 +1147,10 @@ internal ManagedClustersOperations(ContainerServiceClient client) /// public async Task> ListClusterUserCredentialsWithHttpMessagesAsync(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"); @@ -1171,7 +1185,6 @@ internal ManagedClustersOperations(ContainerServiceClient client) throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); } } - string apiVersion = "2020-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1179,7 +1192,6 @@ internal ManagedClustersOperations(ContainerServiceClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("resourceName", resourceName); tracingParameters.Add("cancellationToken", cancellationToken); @@ -1192,9 +1204,9 @@ internal ManagedClustersOperations(ContainerServiceClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1357,6 +1369,10 @@ internal ManagedClustersOperations(ContainerServiceClient client) /// public async Task> ListClusterMonitoringUserCredentialsWithHttpMessagesAsync(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"); @@ -1391,7 +1407,6 @@ internal ManagedClustersOperations(ContainerServiceClient client) throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); } } - string apiVersion = "2020-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1399,7 +1414,6 @@ internal ManagedClustersOperations(ContainerServiceClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("resourceName", resourceName); tracingParameters.Add("cancellationToken", cancellationToken); @@ -1412,9 +1426,9 @@ internal ManagedClustersOperations(ContainerServiceClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1577,6 +1591,10 @@ internal ManagedClustersOperations(ContainerServiceClient client) /// 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"); @@ -1611,7 +1629,6 @@ internal ManagedClustersOperations(ContainerServiceClient client) throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); } } - string apiVersion = "2020-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1619,7 +1636,6 @@ internal ManagedClustersOperations(ContainerServiceClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("resourceName", resourceName); tracingParameters.Add("cancellationToken", cancellationToken); @@ -1632,9 +1648,9 @@ internal ManagedClustersOperations(ContainerServiceClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1927,10 +1943,10 @@ internal ManagedClustersOperations(ContainerServiceClient client) } /// - /// Upgrade node image version of an agent pool to the latest. + /// Stop Managed Cluster /// /// - /// Upgrade node image version of an agent pool to the latest. + /// Stops a Running Managed Cluster /// /// /// The name of the resource group. @@ -1938,8 +1954,30 @@ internal ManagedClustersOperations(ContainerServiceClient client) /// /// The name of the managed cluster resource. /// - /// - /// The name of the agent pool. + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task StopWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginStopWithHttpMessagesAsync(resourceGroupName, resourceName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Start Managed Cluster + /// + /// + /// Starts a Stopped Managed Cluster + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. /// /// /// The headers that will be added to request. @@ -1947,10 +1985,10 @@ internal ManagedClustersOperations(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 StartWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginUpgradeNodeImageVersionWithHttpMessagesAsync(resourceGroupName, resourceName, agentPoolName, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginStartWithHttpMessagesAsync(resourceGroupName, resourceName, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -1993,6 +2031,10 @@ internal ManagedClustersOperations(ContainerServiceClient client) /// public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string resourceName, ManagedCluster 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"); @@ -2035,7 +2077,6 @@ internal ManagedClustersOperations(ContainerServiceClient client) { parameters.Validate(); } - string apiVersion = "2020-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2043,7 +2084,6 @@ internal ManagedClustersOperations(ContainerServiceClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("resourceName", resourceName); tracingParameters.Add("parameters", parameters); @@ -2057,9 +2097,9 @@ internal ManagedClustersOperations(ContainerServiceClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2248,6 +2288,10 @@ internal ManagedClustersOperations(ContainerServiceClient client) /// public async Task> BeginUpdateTagsWithHttpMessagesAsync(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"); @@ -2282,7 +2326,6 @@ internal ManagedClustersOperations(ContainerServiceClient client) throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); } } - string apiVersion = "2020-07-01"; TagsObject parameters = new TagsObject(); if (tags != null) { @@ -2295,7 +2338,6 @@ internal ManagedClustersOperations(ContainerServiceClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("resourceName", resourceName); tracingParameters.Add("parameters", parameters); @@ -2309,9 +2351,9 @@ internal ManagedClustersOperations(ContainerServiceClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2476,6 +2518,10 @@ internal ManagedClustersOperations(ContainerServiceClient client) /// public async Task BeginDeleteWithHttpMessagesAsync(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"); @@ -2510,7 +2556,6 @@ internal ManagedClustersOperations(ContainerServiceClient client) throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); } } - string apiVersion = "2020-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2518,7 +2563,6 @@ internal ManagedClustersOperations(ContainerServiceClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("resourceName", resourceName); tracingParameters.Add("cancellationToken", cancellationToken); @@ -2531,9 +2575,9 @@ internal ManagedClustersOperations(ContainerServiceClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2678,6 +2722,10 @@ internal ManagedClustersOperations(ContainerServiceClient client) /// public async Task BeginResetServicePrincipalProfileWithHttpMessagesAsync(string resourceGroupName, string resourceName, ManagedClusterServicePrincipalProfile 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"); @@ -2720,7 +2768,6 @@ internal ManagedClustersOperations(ContainerServiceClient client) { parameters.Validate(); } - string apiVersion = "2020-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2728,7 +2775,6 @@ internal ManagedClustersOperations(ContainerServiceClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("resourceName", resourceName); tracingParameters.Add("parameters", parameters); @@ -2742,9 +2788,9 @@ internal ManagedClustersOperations(ContainerServiceClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2895,6 +2941,10 @@ internal ManagedClustersOperations(ContainerServiceClient client) /// public async Task BeginResetAADProfileWithHttpMessagesAsync(string resourceGroupName, string resourceName, ManagedClusterAADProfile 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"); @@ -2933,7 +2983,6 @@ internal ManagedClustersOperations(ContainerServiceClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2020-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2941,7 +2990,6 @@ internal ManagedClustersOperations(ContainerServiceClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("resourceName", resourceName); tracingParameters.Add("parameters", parameters); @@ -2955,9 +3003,9 @@ internal ManagedClustersOperations(ContainerServiceClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -3104,6 +3152,10 @@ internal ManagedClustersOperations(ContainerServiceClient client) /// public async Task BeginRotateClusterCertificatesWithHttpMessagesAsync(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"); @@ -3138,7 +3190,6 @@ internal ManagedClustersOperations(ContainerServiceClient client) throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); } } - string apiVersion = "2020-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3146,7 +3197,6 @@ internal ManagedClustersOperations(ContainerServiceClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("resourceName", resourceName); tracingParameters.Add("cancellationToken", cancellationToken); @@ -3159,9 +3209,9 @@ internal ManagedClustersOperations(ContainerServiceClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -3271,10 +3321,10 @@ internal ManagedClustersOperations(ContainerServiceClient client) } /// - /// Upgrade node image version of an agent pool to the latest. + /// Stop Managed Cluster /// /// - /// Upgrade node image version of an agent pool to the latest. + /// Stops a Running Managed Cluster /// /// /// The name of the resource group. @@ -3282,9 +3332,6 @@ internal ManagedClustersOperations(ContainerServiceClient client) /// /// The name of the managed cluster resource. /// - /// - /// The name of the agent pool. - /// /// /// Headers that will be added to request. /// @@ -3294,9 +3341,6 @@ internal ManagedClustersOperations(ContainerServiceClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -3306,8 +3350,12 @@ internal ManagedClustersOperations(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 BeginStopWithHttpMessagesAsync(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"); @@ -3342,11 +3390,6 @@ internal ManagedClustersOperations(ContainerServiceClient client) 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 (agentPoolName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "agentPoolName"); - } - string apiVersion = "2020-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3354,24 +3397,21 @@ internal ManagedClustersOperations(ContainerServiceClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("resourceName", resourceName); - tracingParameters.Add("agentPoolName", agentPoolName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpgradeNodeImageVersion", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginStop", 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/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop").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)); - _url = _url.Replace("{agentPoolName}", System.Uri.EscapeDataString(agentPoolName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -3431,7 +3471,7 @@ internal ManagedClustersOperations(ContainerServiceClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -3466,31 +3506,213 @@ internal ManagedClustersOperations(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")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 202) + if (_shouldTrace) { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Start Managed Cluster + /// + /// + /// Starts a Stopped Managed Cluster + /// + /// + /// 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 BeginStartWithHttpMessagesAsync(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) { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - catch (JsonException ex) + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (resourceName != null) + { + if (resourceName.Length > 63) { - _httpRequest.Dispose(); - if (_httpResponse != null) + 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, "BeginStart", 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/managedClusters/{resourceName}/start").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("POST"); + _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)) { - _httpResponse.Dispose(); + _httpRequest.Headers.Remove(_header.Key); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + _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 != 202 && (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); @@ -3656,7 +3878,7 @@ internal ManagedClustersOperations(ContainerServiceClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -3833,7 +4055,7 @@ internal ManagedClustersOperations(ContainerServiceClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { 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 a152a225467d8..dbbdd70909ea4 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ManagedClustersOperationsExtensions.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ManagedClustersOperationsExtensions.cs @@ -702,10 +702,10 @@ public static void RotateClusterCertificates(this IManagedClustersOperations ope } /// - /// Upgrade node image version of an agent pool to the latest. + /// Stop Managed Cluster /// /// - /// Upgrade node image version of an agent pool to the latest. + /// Stops a Running Managed Cluster /// /// /// The operations group for this extension method. @@ -716,19 +716,39 @@ public static void RotateClusterCertificates(this IManagedClustersOperations ope /// /// The name of the managed cluster resource. /// - /// - /// The name of the agent pool. + public static void Stop(this IManagedClustersOperations operations, string resourceGroupName, string resourceName) + { + operations.StopAsync(resourceGroupName, resourceName).GetAwaiter().GetResult(); + } + + /// + /// Stop Managed Cluster + /// + /// + /// Stops a Running Managed Cluster + /// + /// + /// 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 AgentPool UpgradeNodeImageVersion(this IManagedClustersOperations operations, string resourceGroupName, string resourceName, string agentPoolName) + public static async Task StopAsync(this IManagedClustersOperations operations, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken)) { - return operations.UpgradeNodeImageVersionAsync(resourceGroupName, resourceName, agentPoolName).GetAwaiter().GetResult(); + (await operations.StopWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Upgrade node image version of an agent pool to the latest. + /// Start Managed Cluster /// /// - /// Upgrade node image version of an agent pool to the latest. + /// Starts a Stopped Managed Cluster /// /// /// The operations group for this extension method. @@ -739,18 +759,32 @@ public static AgentPool UpgradeNodeImageVersion(this IManagedClustersOperations /// /// The name of the managed cluster resource. /// - /// - /// The name of the agent pool. + public static void Start(this IManagedClustersOperations operations, string resourceGroupName, string resourceName) + { + operations.StartAsync(resourceGroupName, resourceName).GetAwaiter().GetResult(); + } + + /// + /// Start Managed Cluster + /// + /// + /// Starts a Stopped Managed Cluster + /// + /// + /// 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 UpgradeNodeImageVersionAsync(this IManagedClustersOperations operations, string resourceGroupName, string resourceName, string agentPoolName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task StartAsync(this IManagedClustersOperations operations, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.UpgradeNodeImageVersionWithHttpMessagesAsync(resourceGroupName, resourceName, agentPoolName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + (await operations.StartWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -1048,10 +1082,10 @@ public static void BeginRotateClusterCertificates(this IManagedClustersOperation } /// - /// Upgrade node image version of an agent pool to the latest. + /// Stop Managed Cluster /// /// - /// Upgrade node image version of an agent pool to the latest. + /// Stops a Running Managed Cluster /// /// /// The operations group for this extension method. @@ -1062,19 +1096,39 @@ public static void BeginRotateClusterCertificates(this IManagedClustersOperation /// /// The name of the managed cluster resource. /// - /// - /// The name of the agent pool. + public static void BeginStop(this IManagedClustersOperations operations, string resourceGroupName, string resourceName) + { + operations.BeginStopAsync(resourceGroupName, resourceName).GetAwaiter().GetResult(); + } + + /// + /// Stop Managed Cluster + /// + /// + /// Stops a Running Managed Cluster + /// + /// + /// 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 AgentPool BeginUpgradeNodeImageVersion(this IManagedClustersOperations operations, string resourceGroupName, string resourceName, string agentPoolName) + public static async Task BeginStopAsync(this IManagedClustersOperations operations, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken)) { - return operations.BeginUpgradeNodeImageVersionAsync(resourceGroupName, resourceName, agentPoolName).GetAwaiter().GetResult(); + (await operations.BeginStopWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Upgrade node image version of an agent pool to the latest. + /// Start Managed Cluster /// /// - /// Upgrade node image version of an agent pool to the latest. + /// Starts a Stopped Managed Cluster /// /// /// The operations group for this extension method. @@ -1085,18 +1139,32 @@ public static AgentPool BeginUpgradeNodeImageVersion(this IManagedClustersOperat /// /// The name of the managed cluster resource. /// - /// - /// The name of the agent pool. + public static void BeginStart(this IManagedClustersOperations operations, string resourceGroupName, string resourceName) + { + operations.BeginStartAsync(resourceGroupName, resourceName).GetAwaiter().GetResult(); + } + + /// + /// Start Managed Cluster + /// + /// + /// Starts a Stopped Managed Cluster + /// + /// + /// 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 BeginUpgradeNodeImageVersionAsync(this IManagedClustersOperations operations, string resourceGroupName, string resourceName, string agentPoolName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginStartAsync(this IManagedClustersOperations operations, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginUpgradeNodeImageVersionWithHttpMessagesAsync(resourceGroupName, resourceName, agentPoolName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + (await operations.BeginStartWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// 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 6fa595e91f0c7..71fa1233f70d6 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 @@ -102,6 +102,10 @@ public AgentPool() /// the disk size for every machine in this master/agent pool. If you /// specify 0, it will apply the default osDisk size according to the /// vmSize specified. + /// OS disk type to be used for machines in a + /// given agent pool. Allowed values are 'Ephemeral' and 'Managed'. + /// Defaults to 'Managed'. May not be changed after creation. Possible + /// values include: 'Managed', 'Ephemeral' /// VNet SubnetID specifies the VNet's /// subnet identifier. /// Maximum number of pods that can run on a @@ -127,6 +131,8 @@ public AgentPool() /// agentpool /// The current deployment or /// provisioning state, which only appears in the response. + /// Describes whether the Agent Pool is + /// Running or Stopped /// Availability zones for nodes. Must /// use VirtualMachineScaleSets AgentPoolType. /// Enable public IP for nodes @@ -149,12 +155,13 @@ public AgentPool() /// create and scale. For example, key=value:NoSchedule. /// The ID for Proximity /// Placement Group. - 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 vnetSubnetID = default(string), int? maxPods = default(int?), string osType = default(string), int? maxCount = default(int?), int? minCount = default(int?), bool? enableAutoScaling = default(bool?), string agentPoolType = default(string), string mode = default(string), string orchestratorVersion = default(string), string nodeImageVersion = default(string), AgentPoolUpgradeSettings upgradeSettings = default(AgentPoolUpgradeSettings), string provisioningState = default(string), IList availabilityZones = default(IList), bool? enableNodePublicIP = default(bool?), 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)) + 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 vnetSubnetID = default(string), int? maxPods = default(int?), string osType = default(string), int? maxCount = default(int?), int? minCount = default(int?), bool? enableAutoScaling = default(bool?), 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 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)) : base(id, name, type) { Count = count; VmSize = vmSize; OsDiskSizeGB = osDiskSizeGB; + OsDiskType = osDiskType; VnetSubnetID = vnetSubnetID; MaxPods = maxPods; OsType = osType; @@ -167,6 +174,7 @@ public AgentPool() NodeImageVersion = nodeImageVersion; UpgradeSettings = upgradeSettings; ProvisioningState = provisioningState; + PowerState = powerState; AvailabilityZones = availabilityZones; EnableNodePublicIP = enableNodePublicIP; ScaleSetPriority = scaleSetPriority; @@ -262,6 +270,15 @@ public AgentPool() [JsonProperty(PropertyName = "properties.osDiskSizeGB")] public int? OsDiskSizeGB { get; set; } + /// + /// Gets or sets OS disk type to be used for machines in a given agent + /// pool. Allowed values are 'Ephemeral' and 'Managed'. Defaults to + /// 'Managed'. May not be changed after creation. Possible values + /// include: 'Managed', 'Ephemeral' + /// + [JsonProperty(PropertyName = "properties.osDiskType")] + public string OsDiskType { get; set; } + /// /// Gets or sets vNet SubnetID specifies the VNet's subnet identifier. /// @@ -341,6 +358,12 @@ public AgentPool() [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; private set; } + /// + /// Gets describes whether the Agent Pool is Running or Stopped + /// + [JsonProperty(PropertyName = "properties.powerState")] + public PowerState PowerState { get; private set; } + /// /// Gets or sets availability zones for nodes. Must use /// VirtualMachineScaleSets AgentPoolType. diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OpenShiftAgentPoolProfileRole.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/Code.cs similarity index 69% rename from sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OpenShiftAgentPoolProfileRole.cs rename to sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/Code.cs index 574ca4f71add4..fcfc7f251aff5 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OpenShiftAgentPoolProfileRole.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/Code.cs @@ -12,11 +12,11 @@ namespace Microsoft.Azure.Management.ContainerService.Models { /// - /// Defines values for OpenShiftAgentPoolProfileRole. + /// Defines values for Code. /// - public static class OpenShiftAgentPoolProfileRole + public static class Code { - public const string Compute = "compute"; - public const string Infra = "infra"; + public const string Running = "Running"; + public const string Stopped = "Stopped"; } } diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ContainerServiceAgentPoolProfile.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ContainerServiceAgentPoolProfile.cs deleted file mode 100644 index 6374adafb497e..0000000000000 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ContainerServiceAgentPoolProfile.cs +++ /dev/null @@ -1,290 +0,0 @@ -// -// 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 Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Profile for the container service agent pool. - /// - public partial class ContainerServiceAgentPoolProfile - { - /// - /// Initializes a new instance of the ContainerServiceAgentPoolProfile - /// class. - /// - public ContainerServiceAgentPoolProfile() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ContainerServiceAgentPoolProfile - /// class. - /// - /// Unique name of the agent pool profile in the - /// context of the subscription and resource group. - /// Size of agent VMs. Possible values include: - /// 'Standard_A1', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', - /// 'Standard_A2', 'Standard_A2_v2', 'Standard_A2m_v2', 'Standard_A3', - /// 'Standard_A4', 'Standard_A4_v2', 'Standard_A4m_v2', 'Standard_A5', - /// 'Standard_A6', 'Standard_A7', 'Standard_A8', 'Standard_A8_v2', - /// 'Standard_A8m_v2', 'Standard_A9', 'Standard_B2ms', 'Standard_B2s', - /// 'Standard_B4ms', 'Standard_B8ms', 'Standard_D1', 'Standard_D11', - /// 'Standard_D11_v2', 'Standard_D11_v2_Promo', 'Standard_D12', - /// 'Standard_D12_v2', 'Standard_D12_v2_Promo', 'Standard_D13', - /// 'Standard_D13_v2', 'Standard_D13_v2_Promo', 'Standard_D14', - /// 'Standard_D14_v2', 'Standard_D14_v2_Promo', 'Standard_D15_v2', - /// 'Standard_D16_v3', 'Standard_D16s_v3', 'Standard_D1_v2', - /// 'Standard_D2', 'Standard_D2_v2', 'Standard_D2_v2_Promo', - /// 'Standard_D2_v3', 'Standard_D2s_v3', 'Standard_D3', - /// 'Standard_D32_v3', 'Standard_D32s_v3', 'Standard_D3_v2', - /// 'Standard_D3_v2_Promo', 'Standard_D4', 'Standard_D4_v2', - /// 'Standard_D4_v2_Promo', 'Standard_D4_v3', 'Standard_D4s_v3', - /// 'Standard_D5_v2', 'Standard_D5_v2_Promo', 'Standard_D64_v3', - /// 'Standard_D64s_v3', 'Standard_D8_v3', 'Standard_D8s_v3', - /// 'Standard_DS1', 'Standard_DS11', 'Standard_DS11_v2', - /// 'Standard_DS11_v2_Promo', 'Standard_DS12', 'Standard_DS12_v2', - /// 'Standard_DS12_v2_Promo', 'Standard_DS13', 'Standard_DS13-2_v2', - /// 'Standard_DS13-4_v2', 'Standard_DS13_v2', 'Standard_DS13_v2_Promo', - /// 'Standard_DS14', 'Standard_DS14-4_v2', 'Standard_DS14-8_v2', - /// 'Standard_DS14_v2', 'Standard_DS14_v2_Promo', 'Standard_DS15_v2', - /// 'Standard_DS1_v2', 'Standard_DS2', 'Standard_DS2_v2', - /// 'Standard_DS2_v2_Promo', 'Standard_DS3', 'Standard_DS3_v2', - /// 'Standard_DS3_v2_Promo', 'Standard_DS4', 'Standard_DS4_v2', - /// 'Standard_DS4_v2_Promo', 'Standard_DS5_v2', - /// 'Standard_DS5_v2_Promo', 'Standard_E16_v3', 'Standard_E16s_v3', - /// 'Standard_E2_v3', 'Standard_E2s_v3', 'Standard_E32-16s_v3', - /// 'Standard_E32-8s_v3', 'Standard_E32_v3', 'Standard_E32s_v3', - /// 'Standard_E4_v3', 'Standard_E4s_v3', 'Standard_E64-16s_v3', - /// 'Standard_E64-32s_v3', 'Standard_E64_v3', 'Standard_E64s_v3', - /// 'Standard_E8_v3', 'Standard_E8s_v3', 'Standard_F1', 'Standard_F16', - /// 'Standard_F16s', 'Standard_F16s_v2', 'Standard_F1s', 'Standard_F2', - /// 'Standard_F2s', 'Standard_F2s_v2', 'Standard_F32s_v2', - /// 'Standard_F4', 'Standard_F4s', 'Standard_F4s_v2', - /// 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_F8', - /// 'Standard_F8s', 'Standard_F8s_v2', 'Standard_G1', 'Standard_G2', - /// 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', - /// 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS4-4', - /// 'Standard_GS4-8', 'Standard_GS5', 'Standard_GS5-16', - /// 'Standard_GS5-8', 'Standard_H16', 'Standard_H16m', - /// 'Standard_H16mr', 'Standard_H16r', 'Standard_H8', 'Standard_H8m', - /// 'Standard_L16s', 'Standard_L32s', 'Standard_L4s', 'Standard_L8s', - /// 'Standard_M128-32ms', 'Standard_M128-64ms', 'Standard_M128ms', - /// 'Standard_M128s', 'Standard_M64-16ms', 'Standard_M64-32ms', - /// 'Standard_M64ms', 'Standard_M64s', 'Standard_NC12', - /// 'Standard_NC12s_v2', 'Standard_NC12s_v3', 'Standard_NC24', - /// 'Standard_NC24r', 'Standard_NC24rs_v2', 'Standard_NC24rs_v3', - /// 'Standard_NC24s_v2', 'Standard_NC24s_v3', 'Standard_NC6', - /// 'Standard_NC6s_v2', 'Standard_NC6s_v3', 'Standard_ND12s', - /// 'Standard_ND24rs', 'Standard_ND24s', 'Standard_ND6s', - /// 'Standard_NV12', 'Standard_NV24', 'Standard_NV6' - /// Number of agents (VMs) to host docker - /// containers. Allowed values must be in the range of 1 to 100 - /// (inclusive). The default value is 1. - /// OS Disk Size in GB to be used to specify - /// the disk size for every machine in this master/agent pool. If you - /// specify 0, it will apply the default osDisk size according to the - /// vmSize specified. - /// DNS prefix to be used to create the FQDN - /// for the agent pool. - /// FQDN for the agent pool. - /// Ports number array used to expose on this agent - /// pool. The default opened ports are different based on your choice - /// of orchestrator. - /// Storage profile specifies what kind of - /// storage used. Choose from StorageAccount and ManagedDisks. Leave it - /// empty, we will choose for you based on the orchestrator choice. - /// Possible values include: 'StorageAccount', 'ManagedDisks' - /// VNet SubnetID specifies the VNet's - /// subnet identifier. - /// OsType to be used to specify os type. Choose - /// from Linux and Windows. Default to Linux. Possible values include: - /// 'Linux', 'Windows' - public ContainerServiceAgentPoolProfile(string name, string vmSize, int? count = default(int?), int? osDiskSizeGB = default(int?), string dnsPrefix = default(string), string fqdn = default(string), IList ports = default(IList), string storageProfile = default(string), string vnetSubnetID = default(string), string osType = default(string)) - { - Name = name; - Count = count; - VmSize = vmSize; - OsDiskSizeGB = osDiskSizeGB; - DnsPrefix = dnsPrefix; - Fqdn = fqdn; - Ports = ports; - StorageProfile = storageProfile; - VnetSubnetID = vnetSubnetID; - OsType = osType; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets unique name of the agent pool profile in the context - /// of the subscription and resource group. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets number of agents (VMs) to host docker containers. - /// 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 size of agent VMs. Possible values include: - /// 'Standard_A1', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', - /// 'Standard_A2', 'Standard_A2_v2', 'Standard_A2m_v2', 'Standard_A3', - /// 'Standard_A4', 'Standard_A4_v2', 'Standard_A4m_v2', 'Standard_A5', - /// 'Standard_A6', 'Standard_A7', 'Standard_A8', 'Standard_A8_v2', - /// 'Standard_A8m_v2', 'Standard_A9', 'Standard_B2ms', 'Standard_B2s', - /// 'Standard_B4ms', 'Standard_B8ms', 'Standard_D1', 'Standard_D11', - /// 'Standard_D11_v2', 'Standard_D11_v2_Promo', 'Standard_D12', - /// 'Standard_D12_v2', 'Standard_D12_v2_Promo', 'Standard_D13', - /// 'Standard_D13_v2', 'Standard_D13_v2_Promo', 'Standard_D14', - /// 'Standard_D14_v2', 'Standard_D14_v2_Promo', 'Standard_D15_v2', - /// 'Standard_D16_v3', 'Standard_D16s_v3', 'Standard_D1_v2', - /// 'Standard_D2', 'Standard_D2_v2', 'Standard_D2_v2_Promo', - /// 'Standard_D2_v3', 'Standard_D2s_v3', 'Standard_D3', - /// 'Standard_D32_v3', 'Standard_D32s_v3', 'Standard_D3_v2', - /// 'Standard_D3_v2_Promo', 'Standard_D4', 'Standard_D4_v2', - /// 'Standard_D4_v2_Promo', 'Standard_D4_v3', 'Standard_D4s_v3', - /// 'Standard_D5_v2', 'Standard_D5_v2_Promo', 'Standard_D64_v3', - /// 'Standard_D64s_v3', 'Standard_D8_v3', 'Standard_D8s_v3', - /// 'Standard_DS1', 'Standard_DS11', 'Standard_DS11_v2', - /// 'Standard_DS11_v2_Promo', 'Standard_DS12', 'Standard_DS12_v2', - /// 'Standard_DS12_v2_Promo', 'Standard_DS13', 'Standard_DS13-2_v2', - /// 'Standard_DS13-4_v2', 'Standard_DS13_v2', 'Standard_DS13_v2_Promo', - /// 'Standard_DS14', 'Standard_DS14-4_v2', 'Standard_DS14-8_v2', - /// 'Standard_DS14_v2', 'Standard_DS14_v2_Promo', 'Standard_DS15_v2', - /// 'Standard_DS1_v2', 'Standard_DS2', 'Standard_DS2_v2', - /// 'Standard_DS2_v2_Promo', 'Standard_DS3', 'Standard_DS3_v2', - /// 'Standard_DS3_v2_Promo', 'Standard_DS4', 'Standard_DS4_v2', - /// 'Standard_DS4_v2_Promo', 'Standard_DS5_v2', - /// 'Standard_DS5_v2_Promo', 'Standard_E16_v3', 'Standard_E16s_v3', - /// 'Standard_E2_v3', 'Standard_E2s_v3', 'Standard_E32-16s_v3', - /// 'Standard_E32-8s_v3', 'Standard_E32_v3', 'Standard_E32s_v3', - /// 'Standard_E4_v3', 'Standard_E4s_v3', 'Standard_E64-16s_v3', - /// 'Standard_E64-32s_v3', 'Standard_E64_v3', 'Standard_E64s_v3', - /// 'Standard_E8_v3', 'Standard_E8s_v3', 'Standard_F1', 'Standard_F16', - /// 'Standard_F16s', 'Standard_F16s_v2', 'Standard_F1s', 'Standard_F2', - /// 'Standard_F2s', 'Standard_F2s_v2', 'Standard_F32s_v2', - /// 'Standard_F4', 'Standard_F4s', 'Standard_F4s_v2', - /// 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_F8', - /// 'Standard_F8s', 'Standard_F8s_v2', 'Standard_G1', 'Standard_G2', - /// 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', - /// 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS4-4', - /// 'Standard_GS4-8', 'Standard_GS5', 'Standard_GS5-16', - /// 'Standard_GS5-8', 'Standard_H16', 'Standard_H16m', - /// 'Standard_H16mr', 'Standard_H16r', 'Standard_H8', 'Standard_H8m', - /// 'Standard_L16s', 'Standard_L32s', 'Standard_L4s', 'Standard_L8s', - /// 'Standard_M128-32ms', 'Standard_M128-64ms', 'Standard_M128ms', - /// 'Standard_M128s', 'Standard_M64-16ms', 'Standard_M64-32ms', - /// 'Standard_M64ms', 'Standard_M64s', 'Standard_NC12', - /// 'Standard_NC12s_v2', 'Standard_NC12s_v3', 'Standard_NC24', - /// 'Standard_NC24r', 'Standard_NC24rs_v2', 'Standard_NC24rs_v3', - /// 'Standard_NC24s_v2', 'Standard_NC24s_v3', 'Standard_NC6', - /// 'Standard_NC6s_v2', 'Standard_NC6s_v3', 'Standard_ND12s', - /// 'Standard_ND24rs', 'Standard_ND24s', 'Standard_ND6s', - /// 'Standard_NV12', 'Standard_NV24', 'Standard_NV6' - /// - [JsonProperty(PropertyName = "vmSize")] - public string VmSize { get; set; } - - /// - /// Gets or sets OS Disk Size in GB to be used to specify the disk size - /// for every machine in this master/agent pool. If you specify 0, it - /// will apply the default osDisk size according to the vmSize - /// specified. - /// - [JsonProperty(PropertyName = "osDiskSizeGB")] - public int? OsDiskSizeGB { get; set; } - - /// - /// Gets or sets DNS prefix to be used to create the FQDN for the agent - /// pool. - /// - [JsonProperty(PropertyName = "dnsPrefix")] - public string DnsPrefix { get; set; } - - /// - /// Gets FQDN for the agent pool. - /// - [JsonProperty(PropertyName = "fqdn")] - public string Fqdn { get; private set; } - - /// - /// Gets or sets ports number array used to expose on this agent pool. - /// The default opened ports are different based on your choice of - /// orchestrator. - /// - [JsonProperty(PropertyName = "ports")] - public IList Ports { get; set; } - - /// - /// Gets or sets storage profile specifies what kind of storage used. - /// Choose from StorageAccount and ManagedDisks. Leave it empty, we - /// will choose for you based on the orchestrator choice. Possible - /// values include: 'StorageAccount', 'ManagedDisks' - /// - [JsonProperty(PropertyName = "storageProfile")] - public string StorageProfile { get; set; } - - /// - /// Gets or sets vNet SubnetID specifies the VNet's subnet identifier. - /// - [JsonProperty(PropertyName = "vnetSubnetID")] - public string VnetSubnetID { get; set; } - - /// - /// Gets or sets osType to be used to specify os type. Choose from - /// Linux and Windows. Default to Linux. Possible values include: - /// 'Linux', 'Windows' - /// - [JsonProperty(PropertyName = "osType")] - public string OsType { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); - } - if (VmSize == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "VmSize"); - } - if (Count > 100) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Count", 100); - } - if (Count < 1) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Count", 1); - } - } - } -} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ContainerServiceCustomProfile.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ContainerServiceCustomProfile.cs deleted file mode 100644 index e93206ba780ba..0000000000000 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ContainerServiceCustomProfile.cs +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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 Newtonsoft.Json; - using System.Linq; - - /// - /// Properties to configure a custom container service cluster. - /// - public partial class ContainerServiceCustomProfile - { - /// - /// Initializes a new instance of the ContainerServiceCustomProfile - /// class. - /// - public ContainerServiceCustomProfile() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ContainerServiceCustomProfile - /// class. - /// - /// The name of the custom orchestrator to - /// use. - public ContainerServiceCustomProfile(string orchestrator) - { - Orchestrator = orchestrator; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of the custom orchestrator to use. - /// - [JsonProperty(PropertyName = "orchestrator")] - public string Orchestrator { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Orchestrator == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Orchestrator"); - } - } - } -} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ContainerServiceModel.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ContainerServiceModel.cs deleted file mode 100644 index b3a03246ab979..0000000000000 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ContainerServiceModel.cs +++ /dev/null @@ -1,204 +0,0 @@ -// -// 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; - - /// - /// Container service. - /// - [Rest.Serialization.JsonTransformation] - public partial class ContainerServiceModel : Resource - { - /// - /// Initializes a new instance of the ContainerServiceModel class. - /// - public ContainerServiceModel() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ContainerServiceModel class. - /// - /// Resource location - /// Profile for the container service - /// orchestrator. - /// Profile for the container service - /// master. - /// Profile for Linux VMs in the container - /// service cluster. - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - /// The current deployment or - /// provisioning state, which only appears in the response. - /// Properties to configure a custom - /// container service cluster. - /// Information about a service - /// principal identity for the cluster to use for manipulating Azure - /// APIs. Exact one of secret or keyVaultSecretRef need to be - /// specified. - /// Properties of the agent - /// pool. - /// Profile for Windows VMs in the - /// container service cluster. - /// Profile for diagnostics in the - /// container service cluster. - public ContainerServiceModel(string location, ContainerServiceOrchestratorProfile orchestratorProfile, ContainerServiceMasterProfile masterProfile, ContainerServiceLinuxProfile linuxProfile, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string provisioningState = default(string), ContainerServiceCustomProfile customProfile = default(ContainerServiceCustomProfile), ContainerServiceServicePrincipalProfile servicePrincipalProfile = default(ContainerServiceServicePrincipalProfile), IList agentPoolProfiles = default(IList), ContainerServiceWindowsProfile windowsProfile = default(ContainerServiceWindowsProfile), ContainerServiceDiagnosticsProfile diagnosticsProfile = default(ContainerServiceDiagnosticsProfile)) - : base(location, id, name, type, tags) - { - ProvisioningState = provisioningState; - OrchestratorProfile = orchestratorProfile; - CustomProfile = customProfile; - ServicePrincipalProfile = servicePrincipalProfile; - MasterProfile = masterProfile; - AgentPoolProfiles = agentPoolProfiles; - WindowsProfile = windowsProfile; - LinuxProfile = linuxProfile; - DiagnosticsProfile = diagnosticsProfile; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the current deployment or provisioning state, which only - /// appears in the response. - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } - - /// - /// Gets or sets profile for the container service orchestrator. - /// - [JsonProperty(PropertyName = "properties.orchestratorProfile")] - public ContainerServiceOrchestratorProfile OrchestratorProfile { get; set; } - - /// - /// Gets or sets properties to configure a custom container service - /// cluster. - /// - [JsonProperty(PropertyName = "properties.customProfile")] - public ContainerServiceCustomProfile CustomProfile { get; set; } - - /// - /// Gets or sets information about a service principal identity for the - /// cluster to use for manipulating Azure APIs. Exact one of secret or - /// keyVaultSecretRef need to be specified. - /// - [JsonProperty(PropertyName = "properties.servicePrincipalProfile")] - public ContainerServiceServicePrincipalProfile ServicePrincipalProfile { get; set; } - - /// - /// Gets or sets profile for the container service master. - /// - [JsonProperty(PropertyName = "properties.masterProfile")] - public ContainerServiceMasterProfile MasterProfile { get; set; } - - /// - /// Gets or sets properties of the agent pool. - /// - [JsonProperty(PropertyName = "properties.agentPoolProfiles")] - public IList AgentPoolProfiles { get; set; } - - /// - /// Gets or sets profile for Windows VMs in the container service - /// cluster. - /// - [JsonProperty(PropertyName = "properties.windowsProfile")] - public ContainerServiceWindowsProfile WindowsProfile { get; set; } - - /// - /// Gets or sets profile for Linux VMs in the container service - /// cluster. - /// - [JsonProperty(PropertyName = "properties.linuxProfile")] - public ContainerServiceLinuxProfile LinuxProfile { get; set; } - - /// - /// Gets or sets profile for diagnostics in the container service - /// cluster. - /// - [JsonProperty(PropertyName = "properties.diagnosticsProfile")] - public ContainerServiceDiagnosticsProfile DiagnosticsProfile { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public override void Validate() - { - base.Validate(); - if (OrchestratorProfile == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "OrchestratorProfile"); - } - if (MasterProfile == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "MasterProfile"); - } - if (LinuxProfile == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "LinuxProfile"); - } - if (OrchestratorProfile != null) - { - OrchestratorProfile.Validate(); - } - if (CustomProfile != null) - { - CustomProfile.Validate(); - } - if (ServicePrincipalProfile != null) - { - ServicePrincipalProfile.Validate(); - } - if (MasterProfile != null) - { - MasterProfile.Validate(); - } - if (AgentPoolProfiles != null) - { - foreach (var element in AgentPoolProfiles) - { - if (element != null) - { - element.Validate(); - } - } - } - if (WindowsProfile != null) - { - WindowsProfile.Validate(); - } - if (LinuxProfile != null) - { - LinuxProfile.Validate(); - } - if (DiagnosticsProfile != null) - { - DiagnosticsProfile.Validate(); - } - } - } -} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ContainerServiceOrchestratorProfile.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ContainerServiceOrchestratorProfile.cs deleted file mode 100644 index 92e081c319aad..0000000000000 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ContainerServiceOrchestratorProfile.cs +++ /dev/null @@ -1,85 +0,0 @@ -// -// 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 Newtonsoft.Json; - using System.Linq; - - /// - /// Profile for the container service orchestrator. - /// - public partial class ContainerServiceOrchestratorProfile - { - /// - /// Initializes a new instance of the - /// ContainerServiceOrchestratorProfile class. - /// - public ContainerServiceOrchestratorProfile() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// ContainerServiceOrchestratorProfile class. - /// - /// The orchestrator to use to manage - /// container service cluster resources. Valid values are Kubernetes, - /// Swarm, DCOS, DockerCE and Custom. Possible values include: - /// 'Kubernetes', 'Swarm', 'DCOS', 'DockerCE', 'Custom' - /// The version of the orchestrator - /// to use. You can specify the major.minor.patch part of the actual - /// version.For example, you can specify version as "1.6.11". - public ContainerServiceOrchestratorProfile(string orchestratorType, string orchestratorVersion = default(string)) - { - OrchestratorType = orchestratorType; - OrchestratorVersion = orchestratorVersion; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the orchestrator to use to manage container service - /// cluster resources. Valid values are Kubernetes, Swarm, DCOS, - /// DockerCE and Custom. Possible values include: 'Kubernetes', - /// 'Swarm', 'DCOS', 'DockerCE', 'Custom' - /// - [JsonProperty(PropertyName = "orchestratorType")] - public string OrchestratorType { get; set; } - - /// - /// Gets or sets the version of the orchestrator to use. You can - /// specify the major.minor.patch part of the actual version.For - /// example, you can specify version as "1.6.11". - /// - [JsonProperty(PropertyName = "orchestratorVersion")] - public string OrchestratorVersion { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (OrchestratorType == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "OrchestratorType"); - } - } - } -} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ContainerServiceServicePrincipalProfile.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ContainerServiceServicePrincipalProfile.cs deleted file mode 100644 index 51aca5b4915c7..0000000000000 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ContainerServiceServicePrincipalProfile.cs +++ /dev/null @@ -1,92 +0,0 @@ -// -// 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 Newtonsoft.Json; - using System.Linq; - - /// - /// Information about a service principal identity for the cluster to use - /// for manipulating Azure APIs. Either secret or keyVaultSecretRef must be - /// specified. - /// - public partial class ContainerServiceServicePrincipalProfile - { - /// - /// Initializes a new instance of the - /// ContainerServiceServicePrincipalProfile class. - /// - public ContainerServiceServicePrincipalProfile() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// ContainerServiceServicePrincipalProfile class. - /// - /// The ID for the service principal. - /// The secret password associated with the - /// service principal in plain text. - /// Reference to a secret stored in - /// Azure Key Vault. - public ContainerServiceServicePrincipalProfile(string clientId, string secret = default(string), KeyVaultSecretRef keyVaultSecretRef = default(KeyVaultSecretRef)) - { - ClientId = clientId; - Secret = secret; - KeyVaultSecretRef = keyVaultSecretRef; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the ID for the service principal. - /// - [JsonProperty(PropertyName = "clientId")] - public string ClientId { get; set; } - - /// - /// Gets or sets the secret password associated with the service - /// principal in plain text. - /// - [JsonProperty(PropertyName = "secret")] - public string Secret { get; set; } - - /// - /// Gets or sets reference to a secret stored in Azure Key Vault. - /// - [JsonProperty(PropertyName = "keyVaultSecretRef")] - public KeyVaultSecretRef KeyVaultSecretRef { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (ClientId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ClientId"); - } - if (KeyVaultSecretRef != null) - { - KeyVaultSecretRef.Validate(); - } - } - } -} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ContainerServiceWindowsProfile.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ContainerServiceWindowsProfile.cs deleted file mode 100644 index 6ac80c9f17ad2..0000000000000 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ContainerServiceWindowsProfile.cs +++ /dev/null @@ -1,95 +0,0 @@ -// -// 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 Newtonsoft.Json; - using System.Linq; - - /// - /// Profile for Windows VMs in the container service cluster. - /// - public partial class ContainerServiceWindowsProfile - { - /// - /// Initializes a new instance of the ContainerServiceWindowsProfile - /// class. - /// - public ContainerServiceWindowsProfile() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ContainerServiceWindowsProfile - /// class. - /// - /// The administrator username to use for - /// Windows VMs. - /// The administrator password to use for - /// Windows VMs. - public ContainerServiceWindowsProfile(string adminUsername, string adminPassword) - { - AdminUsername = adminUsername; - AdminPassword = adminPassword; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the administrator username to use for Windows VMs. - /// - [JsonProperty(PropertyName = "adminUsername")] - public string AdminUsername { get; set; } - - /// - /// Gets or sets the administrator password to use for Windows VMs. - /// - [JsonProperty(PropertyName = "adminPassword")] - public string AdminPassword { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (AdminUsername == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "AdminUsername"); - } - if (AdminPassword == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "AdminPassword"); - } - if (AdminUsername != null) - { - if (!System.Text.RegularExpressions.Regex.IsMatch(AdminUsername, "^[a-zA-Z0-9]+([._]?[a-zA-Z0-9]+)*$")) - { - throw new ValidationException(ValidationRules.Pattern, "AdminUsername", "^[a-zA-Z0-9]+([._]?[a-zA-Z0-9]+)*$"); - } - } - if (AdminPassword != null) - { - if (!System.Text.RegularExpressions.Regex.IsMatch(AdminPassword, "^(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%\\^&\\*\\(\\)])[a-zA-Z\\d!@#$%\\^&\\*\\(\\)]{12,123}$")) - { - throw new ValidationException(ValidationRules.Pattern, "AdminPassword", "^(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%\\^&\\*\\(\\)])[a-zA-Z\\d!@#$%\\^&\\*\\(\\)]{12,123}$"); - } - } - } - } -} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ContainerServiceOrchestratorTypes.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/Expander.cs similarity index 56% rename from sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ContainerServiceOrchestratorTypes.cs rename to sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/Expander.cs index 5df4eeee76414..f8ba01bcb1b9b 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ContainerServiceOrchestratorTypes.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/Expander.cs @@ -12,14 +12,12 @@ namespace Microsoft.Azure.Management.ContainerService.Models { /// - /// Defines values for ContainerServiceOrchestratorTypes. + /// Defines values for Expander. /// - public static class ContainerServiceOrchestratorTypes + public static class Expander { - public const string Kubernetes = "Kubernetes"; - public const string Swarm = "Swarm"; - public const string DCOS = "DCOS"; - public const string DockerCE = "DockerCE"; - public const string Custom = "Custom"; + public const string LeastWaste = "least-waste"; + public const string MostPods = "most-pods"; + public const string Random = "random"; } } diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/KeyVaultSecretRef.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/KeyVaultSecretRef.cs deleted file mode 100644 index 25a0fdc259b5b..0000000000000 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/KeyVaultSecretRef.cs +++ /dev/null @@ -1,85 +0,0 @@ -// -// 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 Newtonsoft.Json; - using System.Linq; - - /// - /// Reference to a secret stored in Azure Key Vault. - /// - public partial class KeyVaultSecretRef - { - /// - /// Initializes a new instance of the KeyVaultSecretRef class. - /// - public KeyVaultSecretRef() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the KeyVaultSecretRef class. - /// - /// Key vault identifier. - /// The secret name. - /// The secret version. - public KeyVaultSecretRef(string vaultID, string secretName, string version = default(string)) - { - VaultID = vaultID; - SecretName = secretName; - Version = version; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets key vault identifier. - /// - [JsonProperty(PropertyName = "vaultID")] - public string VaultID { get; set; } - - /// - /// Gets or sets the secret name. - /// - [JsonProperty(PropertyName = "secretName")] - public string SecretName { get; set; } - - /// - /// Gets or sets the secret version. - /// - [JsonProperty(PropertyName = "version")] - public string Version { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (VaultID == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "VaultID"); - } - if (SecretName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "SecretName"); - } - } - } -} 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 09c0a914bfa84..fdc586861a2a8 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 @@ -41,6 +41,8 @@ public ManagedCluster() /// Resource tags /// The current deployment or /// provisioning state, which only appears in the response. + /// Represents the Power State of the + /// cluster /// The max number of agent pools for the /// managed cluster. /// Version of Kubernetes specified @@ -72,6 +74,8 @@ public ManagedCluster() /// configuration. /// Profile of Azure Active Directory /// configuration. + /// Profile of auto upgrade + /// configuration. /// Parameters to be applied to the /// cluster-autoscaler when enabled /// Access profile for managed @@ -83,10 +87,11 @@ public ManagedCluster() /// The identity of the managed cluster, if /// configured. /// The managed cluster SKU. - public ManagedCluster(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string provisioningState = default(string), int? maxAgentPools = default(int?), string kubernetesVersion = default(string), string dnsPrefix = default(string), string fqdn = default(string), string privateFQDN = default(string), IList agentPoolProfiles = default(IList), ContainerServiceLinuxProfile linuxProfile = default(ContainerServiceLinuxProfile), ManagedClusterWindowsProfile windowsProfile = default(ManagedClusterWindowsProfile), ManagedClusterServicePrincipalProfile servicePrincipalProfile = default(ManagedClusterServicePrincipalProfile), IDictionary addonProfiles = default(IDictionary), string nodeResourceGroup = default(string), bool? enableRBAC = default(bool?), bool? enablePodSecurityPolicy = default(bool?), ContainerServiceNetworkProfile networkProfile = default(ContainerServiceNetworkProfile), ManagedClusterAADProfile aadProfile = default(ManagedClusterAADProfile), ManagedClusterPropertiesAutoScalerProfile autoScalerProfile = default(ManagedClusterPropertiesAutoScalerProfile), ManagedClusterAPIServerAccessProfile apiServerAccessProfile = default(ManagedClusterAPIServerAccessProfile), string diskEncryptionSetID = default(string), IDictionary identityProfile = default(IDictionary), ManagedClusterIdentity identity = default(ManagedClusterIdentity), ManagedClusterSKU sku = default(ManagedClusterSKU)) + public ManagedCluster(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string provisioningState = default(string), PowerState powerState = default(PowerState), int? maxAgentPools = default(int?), string kubernetesVersion = default(string), string dnsPrefix = default(string), string fqdn = default(string), string privateFQDN = default(string), IList agentPoolProfiles = default(IList), ContainerServiceLinuxProfile linuxProfile = default(ContainerServiceLinuxProfile), ManagedClusterWindowsProfile windowsProfile = default(ManagedClusterWindowsProfile), ManagedClusterServicePrincipalProfile servicePrincipalProfile = default(ManagedClusterServicePrincipalProfile), IDictionary addonProfiles = default(IDictionary), 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), ManagedClusterIdentity identity = default(ManagedClusterIdentity), ManagedClusterSKU sku = default(ManagedClusterSKU)) : base(location, id, name, type, tags) { ProvisioningState = provisioningState; + PowerState = powerState; MaxAgentPools = maxAgentPools; KubernetesVersion = kubernetesVersion; DnsPrefix = dnsPrefix; @@ -102,6 +107,7 @@ public ManagedCluster() EnablePodSecurityPolicy = enablePodSecurityPolicy; NetworkProfile = networkProfile; AadProfile = aadProfile; + AutoUpgradeProfile = autoUpgradeProfile; AutoScalerProfile = autoScalerProfile; ApiServerAccessProfile = apiServerAccessProfile; DiskEncryptionSetID = diskEncryptionSetID; @@ -123,6 +129,12 @@ public ManagedCluster() [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; private set; } + /// + /// Gets represents the Power State of the cluster + /// + [JsonProperty(PropertyName = "properties.powerState")] + public PowerState PowerState { get; private set; } + /// /// Gets the max number of agent pools for the managed cluster. /// @@ -222,6 +234,12 @@ public ManagedCluster() [JsonProperty(PropertyName = "properties.aadProfile")] public ManagedClusterAADProfile AadProfile { get; set; } + /// + /// Gets or sets profile of auto upgrade configuration. + /// + [JsonProperty(PropertyName = "properties.autoUpgradeProfile")] + public ManagedClusterAutoUpgradeProfile AutoUpgradeProfile { get; set; } + /// /// Gets or sets parameters to be applied to the cluster-autoscaler /// when enabled 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 fe1f89d386bc8..dde6436b015b2 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 @@ -99,6 +99,10 @@ public ManagedClusterAgentPoolProfile() /// the disk size for every machine in this master/agent pool. If you /// specify 0, it will apply the default osDisk size according to the /// vmSize specified. + /// OS disk type to be used for machines in a + /// given agent pool. Allowed values are 'Ephemeral' and 'Managed'. + /// Defaults to 'Managed'. May not be changed after creation. Possible + /// values include: 'Managed', 'Ephemeral' /// VNet SubnetID specifies the VNet's /// subnet identifier. /// Maximum number of pods that can run on a @@ -124,6 +128,8 @@ public ManagedClusterAgentPoolProfile() /// agentpool /// The current deployment or /// provisioning state, which only appears in the response. + /// Describes whether the Agent Pool is + /// Running or Stopped /// Availability zones for nodes. Must /// use VirtualMachineScaleSets AgentPoolType. /// Enable public IP for nodes @@ -146,8 +152,8 @@ public ManagedClusterAgentPoolProfile() /// create and scale. For example, key=value:NoSchedule. /// The ID for Proximity /// Placement Group. - public ManagedClusterAgentPoolProfile(string name, int? count = default(int?), string vmSize = default(string), int? osDiskSizeGB = default(int?), string vnetSubnetID = default(string), int? maxPods = default(int?), string osType = default(string), int? maxCount = default(int?), int? minCount = default(int?), bool? enableAutoScaling = default(bool?), string type = default(string), string mode = default(string), string orchestratorVersion = default(string), string nodeImageVersion = default(string), AgentPoolUpgradeSettings upgradeSettings = default(AgentPoolUpgradeSettings), string provisioningState = default(string), IList availabilityZones = default(IList), bool? enableNodePublicIP = default(bool?), 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)) - : base(count, vmSize, osDiskSizeGB, vnetSubnetID, maxPods, osType, maxCount, minCount, enableAutoScaling, type, mode, orchestratorVersion, nodeImageVersion, upgradeSettings, provisioningState, availabilityZones, enableNodePublicIP, scaleSetPriority, scaleSetEvictionPolicy, spotMaxPrice, tags, nodeLabels, nodeTaints, proximityPlacementGroupID) + public ManagedClusterAgentPoolProfile(string name, int? count = default(int?), string vmSize = default(string), int? osDiskSizeGB = default(int?), string osDiskType = default(string), string vnetSubnetID = default(string), int? maxPods = default(int?), string osType = default(string), int? maxCount = default(int?), int? minCount = default(int?), bool? enableAutoScaling = default(bool?), 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 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)) + : base(count, vmSize, osDiskSizeGB, osDiskType, vnetSubnetID, maxPods, osType, maxCount, minCount, enableAutoScaling, type, mode, orchestratorVersion, nodeImageVersion, upgradeSettings, provisioningState, powerState, availabilityZones, enableNodePublicIP, scaleSetPriority, scaleSetEvictionPolicy, spotMaxPrice, tags, nodeLabels, nodeTaints, proximityPlacementGroupID) { 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 f2b7ff21fa52a..aa1db67818095 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 @@ -96,6 +96,10 @@ public ManagedClusterAgentPoolProfileProperties() /// the disk size for every machine in this master/agent pool. If you /// specify 0, it will apply the default osDisk size according to the /// vmSize specified. + /// OS disk type to be used for machines in a + /// given agent pool. Allowed values are 'Ephemeral' and 'Managed'. + /// Defaults to 'Managed'. May not be changed after creation. Possible + /// values include: 'Managed', 'Ephemeral' /// VNet SubnetID specifies the VNet's /// subnet identifier. /// Maximum number of pods that can run on a @@ -121,6 +125,8 @@ public ManagedClusterAgentPoolProfileProperties() /// agentpool /// The current deployment or /// provisioning state, which only appears in the response. + /// Describes whether the Agent Pool is + /// Running or Stopped /// Availability zones for nodes. Must /// use VirtualMachineScaleSets AgentPoolType. /// Enable public IP for nodes @@ -143,11 +149,12 @@ public ManagedClusterAgentPoolProfileProperties() /// create and scale. For example, key=value:NoSchedule. /// The ID for Proximity /// Placement Group. - public ManagedClusterAgentPoolProfileProperties(int? count = default(int?), string vmSize = default(string), int? osDiskSizeGB = default(int?), string vnetSubnetID = default(string), int? maxPods = default(int?), string osType = default(string), int? maxCount = default(int?), int? minCount = default(int?), bool? enableAutoScaling = default(bool?), string type = default(string), string mode = default(string), string orchestratorVersion = default(string), string nodeImageVersion = default(string), AgentPoolUpgradeSettings upgradeSettings = default(AgentPoolUpgradeSettings), string provisioningState = default(string), IList availabilityZones = default(IList), bool? enableNodePublicIP = default(bool?), 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)) + public ManagedClusterAgentPoolProfileProperties(int? count = default(int?), string vmSize = default(string), int? osDiskSizeGB = default(int?), string osDiskType = default(string), string vnetSubnetID = default(string), int? maxPods = default(int?), string osType = default(string), int? maxCount = default(int?), int? minCount = default(int?), bool? enableAutoScaling = default(bool?), 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 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)) { Count = count; VmSize = vmSize; OsDiskSizeGB = osDiskSizeGB; + OsDiskType = osDiskType; VnetSubnetID = vnetSubnetID; MaxPods = maxPods; OsType = osType; @@ -160,6 +167,7 @@ public ManagedClusterAgentPoolProfileProperties() NodeImageVersion = nodeImageVersion; UpgradeSettings = upgradeSettings; ProvisioningState = provisioningState; + PowerState = powerState; AvailabilityZones = availabilityZones; EnableNodePublicIP = enableNodePublicIP; ScaleSetPriority = scaleSetPriority; @@ -255,6 +263,15 @@ public ManagedClusterAgentPoolProfileProperties() [JsonProperty(PropertyName = "osDiskSizeGB")] public int? OsDiskSizeGB { get; set; } + /// + /// Gets or sets OS disk type to be used for machines in a given agent + /// pool. Allowed values are 'Ephemeral' and 'Managed'. Defaults to + /// 'Managed'. May not be changed after creation. Possible values + /// include: 'Managed', 'Ephemeral' + /// + [JsonProperty(PropertyName = "osDiskType")] + public string OsDiskType { get; set; } + /// /// Gets or sets vNet SubnetID specifies the VNet's subnet identifier. /// @@ -334,6 +351,12 @@ public ManagedClusterAgentPoolProfileProperties() [JsonProperty(PropertyName = "provisioningState")] public string ProvisioningState { get; private set; } + /// + /// Gets describes whether the Agent Pool is Running or Stopped + /// + [JsonProperty(PropertyName = "powerState")] + public PowerState PowerState { get; private set; } + /// /// Gets or sets availability zones for nodes. Must use /// VirtualMachineScaleSets AgentPoolType. diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAutoUpgradeProfile.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAutoUpgradeProfile.cs new file mode 100644 index 0000000000000..acb4260dfa402 --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAutoUpgradeProfile.cs @@ -0,0 +1,55 @@ +// +// 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; + + /// + /// Auto upgrade profile for a managed cluster. + /// + public partial class ManagedClusterAutoUpgradeProfile + { + /// + /// Initializes a new instance of the ManagedClusterAutoUpgradeProfile + /// class. + /// + public ManagedClusterAutoUpgradeProfile() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ManagedClusterAutoUpgradeProfile + /// class. + /// + /// upgrade channel for auto upgrade. + /// Possible values include: 'rapid', 'stable', 'patch' + public ManagedClusterAutoUpgradeProfile(string upgradeChannel = default(string)) + { + UpgradeChannel = upgradeChannel; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets upgrade channel for auto upgrade. Possible values + /// include: 'rapid', 'stable', 'patch' + /// + [JsonProperty(PropertyName = "upgradeChannel")] + public string UpgradeChannel { get; set; } + + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterPropertiesAutoScalerProfile.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterPropertiesAutoScalerProfile.cs index a379f5ed844f5..dad6dbd5a33ec 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterPropertiesAutoScalerProfile.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterPropertiesAutoScalerProfile.cs @@ -31,9 +31,17 @@ public ManagedClusterPropertiesAutoScalerProfile() /// Initializes a new instance of the /// ManagedClusterPropertiesAutoScalerProfile class. /// - public ManagedClusterPropertiesAutoScalerProfile(string balanceSimilarNodeGroups = default(string), string scanInterval = default(string), string scaleDownDelayAfterAdd = default(string), string scaleDownDelayAfterDelete = default(string), string scaleDownDelayAfterFailure = default(string), string scaleDownUnneededTime = default(string), string scaleDownUnreadyTime = default(string), string scaleDownUtilizationThreshold = default(string), string maxGracefulTerminationSec = default(string)) + /// Possible values include: 'least-waste', + /// 'most-pods', 'random' + public ManagedClusterPropertiesAutoScalerProfile(string balanceSimilarNodeGroups = default(string), string expander = default(string), string maxEmptyBulkDelete = default(string), string maxGracefulTerminationSec = default(string), string maxTotalUnreadyPercentage = default(string), string newPodScaleUpDelay = default(string), string okTotalUnreadyCount = default(string), string scanInterval = default(string), string scaleDownDelayAfterAdd = default(string), string scaleDownDelayAfterDelete = default(string), string scaleDownDelayAfterFailure = default(string), string scaleDownUnneededTime = default(string), string scaleDownUnreadyTime = default(string), string scaleDownUtilizationThreshold = default(string), string skipNodesWithLocalStorage = default(string), string skipNodesWithSystemPods = default(string)) { BalanceSimilarNodeGroups = balanceSimilarNodeGroups; + Expander = expander; + MaxEmptyBulkDelete = maxEmptyBulkDelete; + MaxGracefulTerminationSec = maxGracefulTerminationSec; + MaxTotalUnreadyPercentage = maxTotalUnreadyPercentage; + NewPodScaleUpDelay = newPodScaleUpDelay; + OkTotalUnreadyCount = okTotalUnreadyCount; ScanInterval = scanInterval; ScaleDownDelayAfterAdd = scaleDownDelayAfterAdd; ScaleDownDelayAfterDelete = scaleDownDelayAfterDelete; @@ -41,7 +49,8 @@ public ManagedClusterPropertiesAutoScalerProfile() ScaleDownUnneededTime = scaleDownUnneededTime; ScaleDownUnreadyTime = scaleDownUnreadyTime; ScaleDownUtilizationThreshold = scaleDownUtilizationThreshold; - MaxGracefulTerminationSec = maxGracefulTerminationSec; + SkipNodesWithLocalStorage = skipNodesWithLocalStorage; + SkipNodesWithSystemPods = skipNodesWithSystemPods; CustomInit(); } @@ -55,6 +64,38 @@ public ManagedClusterPropertiesAutoScalerProfile() [JsonProperty(PropertyName = "balance-similar-node-groups")] public string BalanceSimilarNodeGroups { get; set; } + /// + /// Gets or sets possible values include: 'least-waste', 'most-pods', + /// 'random' + /// + [JsonProperty(PropertyName = "expander")] + public string Expander { get; set; } + + /// + /// + [JsonProperty(PropertyName = "max-empty-bulk-delete")] + public string MaxEmptyBulkDelete { get; set; } + + /// + /// + [JsonProperty(PropertyName = "max-graceful-termination-sec")] + public string MaxGracefulTerminationSec { get; set; } + + /// + /// + [JsonProperty(PropertyName = "max-total-unready-percentage")] + public string MaxTotalUnreadyPercentage { get; set; } + + /// + /// + [JsonProperty(PropertyName = "new-pod-scale-up-delay")] + public string NewPodScaleUpDelay { get; set; } + + /// + /// + [JsonProperty(PropertyName = "ok-total-unready-count")] + public string OkTotalUnreadyCount { get; set; } + /// /// [JsonProperty(PropertyName = "scan-interval")] @@ -92,8 +133,13 @@ public ManagedClusterPropertiesAutoScalerProfile() /// /// - [JsonProperty(PropertyName = "max-graceful-termination-sec")] - public string MaxGracefulTerminationSec { get; set; } + [JsonProperty(PropertyName = "skip-nodes-with-local-storage")] + public string SkipNodesWithLocalStorage { get; set; } + + /// + /// + [JsonProperty(PropertyName = "skip-nodes-with-system-pods")] + public string SkipNodesWithSystemPods { get; set; } } } diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/NetworkProfile.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/NetworkProfile.cs deleted file mode 100644 index b6048318edc13..0000000000000 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/NetworkProfile.cs +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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; - - /// - /// Represents the OpenShift networking configuration - /// - public partial class NetworkProfile - { - /// - /// Initializes a new instance of the NetworkProfile class. - /// - public NetworkProfile() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the NetworkProfile class. - /// - /// CIDR for the OpenShift Vnet. - /// CIDR of the Vnet to peer. - /// ID of the Vnet created for OSA - /// cluster. - public NetworkProfile(string vnetCidr = default(string), string peerVnetId = default(string), string vnetId = default(string)) - { - VnetCidr = vnetCidr; - PeerVnetId = peerVnetId; - VnetId = vnetId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets CIDR for the OpenShift Vnet. - /// - [JsonProperty(PropertyName = "vnetCidr")] - public string VnetCidr { get; set; } - - /// - /// Gets or sets CIDR of the Vnet to peer. - /// - [JsonProperty(PropertyName = "peerVnetId")] - public string PeerVnetId { get; set; } - - /// - /// Gets or sets ID of the Vnet created for OSA cluster. - /// - [JsonProperty(PropertyName = "vnetId")] - public string VnetId { get; set; } - - } -} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OSDiskType.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OSDiskType.cs new file mode 100644 index 0000000000000..6e51e4062eaa3 --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OSDiskType.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 OSDiskType. + /// + public static class OSDiskType + { + public const string Managed = "Managed"; + public const string Ephemeral = "Ephemeral"; + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OpenShiftContainerServiceVMSize.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OpenShiftContainerServiceVMSize.cs deleted file mode 100644 index 0d653547c949c..0000000000000 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OpenShiftContainerServiceVMSize.cs +++ /dev/null @@ -1,53 +0,0 @@ -// -// 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 OpenShiftContainerServiceVMSize. - /// - public static class OpenShiftContainerServiceVMSize - { - public const string StandardD2sV3 = "Standard_D2s_v3"; - public const string StandardD4sV3 = "Standard_D4s_v3"; - public const string StandardD8sV3 = "Standard_D8s_v3"; - public const string StandardD16sV3 = "Standard_D16s_v3"; - public const string StandardD32sV3 = "Standard_D32s_v3"; - public const string StandardD64sV3 = "Standard_D64s_v3"; - public const string StandardDS4V2 = "Standard_DS4_v2"; - public const string StandardDS5V2 = "Standard_DS5_v2"; - public const string StandardF8sV2 = "Standard_F8s_v2"; - public const string StandardF16sV2 = "Standard_F16s_v2"; - public const string StandardF32sV2 = "Standard_F32s_v2"; - public const string StandardF64sV2 = "Standard_F64s_v2"; - public const string StandardF72sV2 = "Standard_F72s_v2"; - public const string StandardF8s = "Standard_F8s"; - public const string StandardF16s = "Standard_F16s"; - public const string StandardE4sV3 = "Standard_E4s_v3"; - public const string StandardE8sV3 = "Standard_E8s_v3"; - public const string StandardE16sV3 = "Standard_E16s_v3"; - public const string StandardE20sV3 = "Standard_E20s_v3"; - public const string StandardE32sV3 = "Standard_E32s_v3"; - public const string StandardE64sV3 = "Standard_E64s_v3"; - public const string StandardGS2 = "Standard_GS2"; - public const string StandardGS3 = "Standard_GS3"; - public const string StandardGS4 = "Standard_GS4"; - public const string StandardGS5 = "Standard_GS5"; - public const string StandardDS12V2 = "Standard_DS12_v2"; - public const string StandardDS13V2 = "Standard_DS13_v2"; - public const string StandardDS14V2 = "Standard_DS14_v2"; - public const string StandardDS15V2 = "Standard_DS15_v2"; - public const string StandardL4s = "Standard_L4s"; - public const string StandardL8s = "Standard_L8s"; - public const string StandardL16s = "Standard_L16s"; - public const string StandardL32s = "Standard_L32s"; - } -} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OpenShiftManagedCluster.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OpenShiftManagedCluster.cs deleted file mode 100644 index fd9eb0ea52817..0000000000000 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OpenShiftManagedCluster.cs +++ /dev/null @@ -1,185 +0,0 @@ -// -// 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; - - /// - /// OpenShift Managed cluster. - /// - [Rest.Serialization.JsonTransformation] - public partial class OpenShiftManagedCluster : Resource - { - /// - /// Initializes a new instance of the OpenShiftManagedCluster class. - /// - public OpenShiftManagedCluster() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the OpenShiftManagedCluster class. - /// - /// Resource location - /// Version of OpenShift specified when - /// creating the cluster. - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - /// Define the resource plan as required by ARM for - /// billing purposes - /// The current deployment or - /// provisioning state, which only appears in the response. - /// Version of OpenShift specified when - /// creating the cluster. - /// Service generated FQDN for OpenShift - /// API server. - /// Service generated FQDN for OpenShift API server - /// loadbalancer internal hostname. - /// Configuration for OpenShift - /// networking. - /// Configuration for OpenShift - /// router(s). - /// Configuration for OpenShift master - /// VMs. - /// Configuration of OpenShift cluster - /// VMs. - /// Configures OpenShift - /// authentication. - public OpenShiftManagedCluster(string location, string openShiftVersion, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), PurchasePlan plan = default(PurchasePlan), string provisioningState = default(string), string clusterVersion = default(string), string publicHostname = default(string), string fqdn = default(string), NetworkProfile networkProfile = default(NetworkProfile), IList routerProfiles = default(IList), OpenShiftManagedClusterMasterPoolProfile masterPoolProfile = default(OpenShiftManagedClusterMasterPoolProfile), IList agentPoolProfiles = default(IList), OpenShiftManagedClusterAuthProfile authProfile = default(OpenShiftManagedClusterAuthProfile)) - : base(location, id, name, type, tags) - { - Plan = plan; - ProvisioningState = provisioningState; - OpenShiftVersion = openShiftVersion; - ClusterVersion = clusterVersion; - PublicHostname = publicHostname; - Fqdn = fqdn; - NetworkProfile = networkProfile; - RouterProfiles = routerProfiles; - MasterPoolProfile = masterPoolProfile; - AgentPoolProfiles = agentPoolProfiles; - AuthProfile = authProfile; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets define the resource plan as required by ARM for - /// billing purposes - /// - [JsonProperty(PropertyName = "plan")] - public PurchasePlan Plan { get; set; } - - /// - /// Gets the current deployment or provisioning state, which only - /// appears in the response. - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } - - /// - /// Gets or sets version of OpenShift specified when creating the - /// cluster. - /// - [JsonProperty(PropertyName = "properties.openShiftVersion")] - public string OpenShiftVersion { get; set; } - - /// - /// Gets version of OpenShift specified when creating the cluster. - /// - [JsonProperty(PropertyName = "properties.clusterVersion")] - public string ClusterVersion { get; private set; } - - /// - /// Gets service generated FQDN for OpenShift API server. - /// - [JsonProperty(PropertyName = "properties.publicHostname")] - public string PublicHostname { get; private set; } - - /// - /// Gets service generated FQDN for OpenShift API server loadbalancer - /// internal hostname. - /// - [JsonProperty(PropertyName = "properties.fqdn")] - public string Fqdn { get; private set; } - - /// - /// Gets or sets configuration for OpenShift networking. - /// - [JsonProperty(PropertyName = "properties.networkProfile")] - public NetworkProfile NetworkProfile { get; set; } - - /// - /// Gets or sets configuration for OpenShift router(s). - /// - [JsonProperty(PropertyName = "properties.routerProfiles")] - public IList RouterProfiles { get; set; } - - /// - /// Gets or sets configuration for OpenShift master VMs. - /// - [JsonProperty(PropertyName = "properties.masterPoolProfile")] - public OpenShiftManagedClusterMasterPoolProfile MasterPoolProfile { get; set; } - - /// - /// Gets or sets configuration of OpenShift cluster VMs. - /// - [JsonProperty(PropertyName = "properties.agentPoolProfiles")] - public IList AgentPoolProfiles { get; set; } - - /// - /// Gets or sets configures OpenShift authentication. - /// - [JsonProperty(PropertyName = "properties.authProfile")] - public OpenShiftManagedClusterAuthProfile AuthProfile { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public override void Validate() - { - base.Validate(); - if (OpenShiftVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "OpenShiftVersion"); - } - if (MasterPoolProfile != null) - { - MasterPoolProfile.Validate(); - } - if (AgentPoolProfiles != null) - { - foreach (var element in AgentPoolProfiles) - { - if (element != null) - { - element.Validate(); - } - } - } - } - } -} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OpenShiftManagedClusterAADIdentityProvider.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OpenShiftManagedClusterAADIdentityProvider.cs deleted file mode 100644 index 2a7a57e11a6fe..0000000000000 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OpenShiftManagedClusterAADIdentityProvider.cs +++ /dev/null @@ -1,82 +0,0 @@ -// -// 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 the Identity provider for MS AAD. - /// - [Newtonsoft.Json.JsonObject("AADIdentityProvider")] - public partial class OpenShiftManagedClusterAADIdentityProvider : OpenShiftManagedClusterBaseIdentityProvider - { - /// - /// Initializes a new instance of the - /// OpenShiftManagedClusterAADIdentityProvider class. - /// - public OpenShiftManagedClusterAADIdentityProvider() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// OpenShiftManagedClusterAADIdentityProvider class. - /// - /// The clientId password associated with the - /// provider. - /// The secret password associated with the - /// provider. - /// The tenantId associated with the - /// provider. - /// The groupId to be granted - /// cluster admin role. - public OpenShiftManagedClusterAADIdentityProvider(string clientId = default(string), string secret = default(string), string tenantId = default(string), string customerAdminGroupId = default(string)) - { - ClientId = clientId; - Secret = secret; - TenantId = tenantId; - CustomerAdminGroupId = customerAdminGroupId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the clientId password associated with the provider. - /// - [JsonProperty(PropertyName = "clientId")] - public string ClientId { get; set; } - - /// - /// Gets or sets the secret password associated with the provider. - /// - [JsonProperty(PropertyName = "secret")] - public string Secret { get; set; } - - /// - /// Gets or sets the tenantId associated with the provider. - /// - [JsonProperty(PropertyName = "tenantId")] - public string TenantId { get; set; } - - /// - /// Gets or sets the groupId to be granted cluster admin role. - /// - [JsonProperty(PropertyName = "customerAdminGroupId")] - public string CustomerAdminGroupId { get; set; } - - } -} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OpenShiftManagedClusterAgentPoolProfile.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OpenShiftManagedClusterAgentPoolProfile.cs deleted file mode 100644 index 49276b1bd7d8e..0000000000000 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OpenShiftManagedClusterAgentPoolProfile.cs +++ /dev/null @@ -1,142 +0,0 @@ -// -// 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 Newtonsoft.Json; - using System.Linq; - - /// - /// Defines the configuration of the OpenShift cluster VMs. - /// - public partial class OpenShiftManagedClusterAgentPoolProfile - { - /// - /// Initializes a new instance of the - /// OpenShiftManagedClusterAgentPoolProfile class. - /// - public OpenShiftManagedClusterAgentPoolProfile() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// OpenShiftManagedClusterAgentPoolProfile class. - /// - /// Unique name of the pool profile in the context - /// of the subscription and resource group. - /// Number of agents (VMs) to host docker - /// containers. - /// Size of agent VMs. Possible values include: - /// 'Standard_D2s_v3', 'Standard_D4s_v3', 'Standard_D8s_v3', - /// 'Standard_D16s_v3', 'Standard_D32s_v3', 'Standard_D64s_v3', - /// 'Standard_DS4_v2', 'Standard_DS5_v2', 'Standard_F8s_v2', - /// 'Standard_F16s_v2', 'Standard_F32s_v2', 'Standard_F64s_v2', - /// 'Standard_F72s_v2', 'Standard_F8s', 'Standard_F16s', - /// 'Standard_E4s_v3', 'Standard_E8s_v3', 'Standard_E16s_v3', - /// 'Standard_E20s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', - /// 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', - /// 'Standard_DS12_v2', 'Standard_DS13_v2', 'Standard_DS14_v2', - /// 'Standard_DS15_v2', 'Standard_L4s', 'Standard_L8s', - /// 'Standard_L16s', 'Standard_L32s' - /// Subnet CIDR for the peering. - /// OsType to be used to specify os type. Choose - /// from Linux and Windows. Default to Linux. Possible values include: - /// 'Linux', 'Windows' - /// Define the role of the AgentPoolProfile. - /// Possible values include: 'compute', 'infra' - public OpenShiftManagedClusterAgentPoolProfile(string name, int count, string vmSize, string subnetCidr = default(string), string osType = default(string), string role = default(string)) - { - Name = name; - Count = count; - VmSize = vmSize; - SubnetCidr = subnetCidr; - OsType = osType; - Role = role; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets unique name of the pool profile in the context of the - /// subscription and resource group. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets number of agents (VMs) to host docker containers. - /// - [JsonProperty(PropertyName = "count")] - public int Count { get; set; } - - /// - /// Gets or sets size of agent VMs. Possible values include: - /// 'Standard_D2s_v3', 'Standard_D4s_v3', 'Standard_D8s_v3', - /// 'Standard_D16s_v3', 'Standard_D32s_v3', 'Standard_D64s_v3', - /// 'Standard_DS4_v2', 'Standard_DS5_v2', 'Standard_F8s_v2', - /// 'Standard_F16s_v2', 'Standard_F32s_v2', 'Standard_F64s_v2', - /// 'Standard_F72s_v2', 'Standard_F8s', 'Standard_F16s', - /// 'Standard_E4s_v3', 'Standard_E8s_v3', 'Standard_E16s_v3', - /// 'Standard_E20s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', - /// 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', - /// 'Standard_DS12_v2', 'Standard_DS13_v2', 'Standard_DS14_v2', - /// 'Standard_DS15_v2', 'Standard_L4s', 'Standard_L8s', - /// 'Standard_L16s', 'Standard_L32s' - /// - [JsonProperty(PropertyName = "vmSize")] - public string VmSize { get; set; } - - /// - /// Gets or sets subnet CIDR for the peering. - /// - [JsonProperty(PropertyName = "subnetCidr")] - public string SubnetCidr { get; set; } - - /// - /// Gets or sets osType to be used to specify os type. Choose from - /// Linux and Windows. Default to Linux. Possible values include: - /// 'Linux', 'Windows' - /// - [JsonProperty(PropertyName = "osType")] - public string OsType { get; set; } - - /// - /// Gets or sets define the role of the AgentPoolProfile. Possible - /// values include: 'compute', 'infra' - /// - [JsonProperty(PropertyName = "role")] - public string Role { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); - } - if (VmSize == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "VmSize"); - } - } - } -} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OpenShiftManagedClusterBaseIdentityProvider.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OpenShiftManagedClusterBaseIdentityProvider.cs deleted file mode 100644 index b552dc1ca60cf..0000000000000 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OpenShiftManagedClusterBaseIdentityProvider.cs +++ /dev/null @@ -1,36 +0,0 @@ -// -// 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 System.Linq; - - /// - /// Structure for any Identity provider. - /// - public partial class OpenShiftManagedClusterBaseIdentityProvider - { - /// - /// Initializes a new instance of the - /// OpenShiftManagedClusterBaseIdentityProvider class. - /// - public OpenShiftManagedClusterBaseIdentityProvider() - { - CustomInit(); - } - - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - } -} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OpenShiftManagedClusterIdentityProvider.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OpenShiftManagedClusterIdentityProvider.cs deleted file mode 100644 index de17e44dd57ca..0000000000000 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OpenShiftManagedClusterIdentityProvider.cs +++ /dev/null @@ -1,62 +0,0 @@ -// -// 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 the configuration of the identity providers to be used in the - /// OpenShift cluster. - /// - public partial class OpenShiftManagedClusterIdentityProvider - { - /// - /// Initializes a new instance of the - /// OpenShiftManagedClusterIdentityProvider class. - /// - public OpenShiftManagedClusterIdentityProvider() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// OpenShiftManagedClusterIdentityProvider class. - /// - /// Name of the provider. - /// Configuration of the provider. - public OpenShiftManagedClusterIdentityProvider(string name = default(string), OpenShiftManagedClusterBaseIdentityProvider provider = default(OpenShiftManagedClusterBaseIdentityProvider)) - { - Name = name; - Provider = provider; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets name of the provider. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets configuration of the provider. - /// - [JsonProperty(PropertyName = "provider")] - public OpenShiftManagedClusterBaseIdentityProvider Provider { get; set; } - - } -} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OpenShiftManagedClusterMasterPoolProfile.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OpenShiftManagedClusterMasterPoolProfile.cs deleted file mode 100644 index 5568527bc6238..0000000000000 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OpenShiftManagedClusterMasterPoolProfile.cs +++ /dev/null @@ -1,130 +0,0 @@ -// -// 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 Newtonsoft.Json; - using System.Linq; - - /// - /// OpenShiftManagedClusterMaterPoolProfile contains configuration for - /// OpenShift master VMs. - /// - public partial class OpenShiftManagedClusterMasterPoolProfile - { - /// - /// Initializes a new instance of the - /// OpenShiftManagedClusterMasterPoolProfile class. - /// - public OpenShiftManagedClusterMasterPoolProfile() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// OpenShiftManagedClusterMasterPoolProfile class. - /// - /// Number of masters (VMs) to host docker - /// containers. The default value is 3. - /// Size of agent VMs. Possible values include: - /// 'Standard_D2s_v3', 'Standard_D4s_v3', 'Standard_D8s_v3', - /// 'Standard_D16s_v3', 'Standard_D32s_v3', 'Standard_D64s_v3', - /// 'Standard_DS4_v2', 'Standard_DS5_v2', 'Standard_F8s_v2', - /// 'Standard_F16s_v2', 'Standard_F32s_v2', 'Standard_F64s_v2', - /// 'Standard_F72s_v2', 'Standard_F8s', 'Standard_F16s', - /// 'Standard_E4s_v3', 'Standard_E8s_v3', 'Standard_E16s_v3', - /// 'Standard_E20s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', - /// 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', - /// 'Standard_DS12_v2', 'Standard_DS13_v2', 'Standard_DS14_v2', - /// 'Standard_DS15_v2', 'Standard_L4s', 'Standard_L8s', - /// 'Standard_L16s', 'Standard_L32s' - /// Unique name of the master pool profile in the - /// context of the subscription and resource group. - /// Subnet CIDR for the peering. - /// OsType to be used to specify os type. Choose - /// from Linux and Windows. Default to Linux. Possible values include: - /// 'Linux', 'Windows' - public OpenShiftManagedClusterMasterPoolProfile(int count, string vmSize, string name = default(string), string subnetCidr = default(string), string osType = default(string)) - { - Name = name; - Count = count; - VmSize = vmSize; - SubnetCidr = subnetCidr; - OsType = osType; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets unique name of the master pool profile in the context - /// of the subscription and resource group. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets number of masters (VMs) to host docker containers. The - /// default value is 3. - /// - [JsonProperty(PropertyName = "count")] - public int Count { get; set; } - - /// - /// Gets or sets size of agent VMs. Possible values include: - /// 'Standard_D2s_v3', 'Standard_D4s_v3', 'Standard_D8s_v3', - /// 'Standard_D16s_v3', 'Standard_D32s_v3', 'Standard_D64s_v3', - /// 'Standard_DS4_v2', 'Standard_DS5_v2', 'Standard_F8s_v2', - /// 'Standard_F16s_v2', 'Standard_F32s_v2', 'Standard_F64s_v2', - /// 'Standard_F72s_v2', 'Standard_F8s', 'Standard_F16s', - /// 'Standard_E4s_v3', 'Standard_E8s_v3', 'Standard_E16s_v3', - /// 'Standard_E20s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', - /// 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', - /// 'Standard_DS12_v2', 'Standard_DS13_v2', 'Standard_DS14_v2', - /// 'Standard_DS15_v2', 'Standard_L4s', 'Standard_L8s', - /// 'Standard_L16s', 'Standard_L32s' - /// - [JsonProperty(PropertyName = "vmSize")] - public string VmSize { get; set; } - - /// - /// Gets or sets subnet CIDR for the peering. - /// - [JsonProperty(PropertyName = "subnetCidr")] - public string SubnetCidr { get; set; } - - /// - /// Gets or sets osType to be used to specify os type. Choose from - /// Linux and Windows. Default to Linux. Possible values include: - /// 'Linux', 'Windows' - /// - [JsonProperty(PropertyName = "osType")] - public string OsType { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (VmSize == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "VmSize"); - } - } - } -} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OpenShiftRouterProfile.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OpenShiftRouterProfile.cs deleted file mode 100644 index bc985a75d8de8..0000000000000 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OpenShiftRouterProfile.cs +++ /dev/null @@ -1,69 +0,0 @@ -// -// 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; - - /// - /// Represents an OpenShift router - /// - public partial class OpenShiftRouterProfile - { - /// - /// Initializes a new instance of the OpenShiftRouterProfile class. - /// - public OpenShiftRouterProfile() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the OpenShiftRouterProfile class. - /// - /// Name of the router profile. - /// DNS subdomain for OpenShift - /// router. - /// Auto-allocated FQDN for the OpenShift - /// router. - public OpenShiftRouterProfile(string name = default(string), string publicSubdomain = default(string), string fqdn = default(string)) - { - Name = name; - PublicSubdomain = publicSubdomain; - Fqdn = fqdn; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets name of the router profile. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets DNS subdomain for OpenShift router. - /// - [JsonProperty(PropertyName = "publicSubdomain")] - public string PublicSubdomain { get; private set; } - - /// - /// Gets auto-allocated FQDN for the OpenShift router. - /// - [JsonProperty(PropertyName = "fqdn")] - public string Fqdn { get; private set; } - - } -} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OrchestratorProfile.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OrchestratorProfile.cs deleted file mode 100644 index 1628d4cda06ba..0000000000000 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OrchestratorProfile.cs +++ /dev/null @@ -1,83 +0,0 @@ -// -// 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 Newtonsoft.Json; - using System.Linq; - - /// - /// Contains information about orchestrator. - /// - public partial class OrchestratorProfile - { - /// - /// Initializes a new instance of the OrchestratorProfile class. - /// - public OrchestratorProfile() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the OrchestratorProfile class. - /// - /// Orchestrator version (major, - /// minor, patch). - /// Orchestrator type. - /// Whether Kubernetes version is currently in - /// preview. - public OrchestratorProfile(string orchestratorVersion, string orchestratorType = default(string), bool? isPreview = default(bool?)) - { - OrchestratorType = orchestratorType; - OrchestratorVersion = orchestratorVersion; - IsPreview = isPreview; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets orchestrator type. - /// - [JsonProperty(PropertyName = "orchestratorType")] - public string OrchestratorType { get; set; } - - /// - /// Gets or sets orchestrator version (major, minor, patch). - /// - [JsonProperty(PropertyName = "orchestratorVersion")] - public string OrchestratorVersion { get; set; } - - /// - /// Gets or sets whether Kubernetes version is currently in preview. - /// - [JsonProperty(PropertyName = "isPreview")] - public bool? IsPreview { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (OrchestratorVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "OrchestratorVersion"); - } - } - } -} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OrchestratorVersionProfile.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OrchestratorVersionProfile.cs deleted file mode 100644 index 9edf7e175de69..0000000000000 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OrchestratorVersionProfile.cs +++ /dev/null @@ -1,117 +0,0 @@ -// -// 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 Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The profile of an orchestrator and its available versions. - /// - public partial class OrchestratorVersionProfile - { - /// - /// Initializes a new instance of the OrchestratorVersionProfile class. - /// - public OrchestratorVersionProfile() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the OrchestratorVersionProfile class. - /// - /// Orchestrator type. - /// Orchestrator version (major, - /// minor, patch). - /// Installed by default if version is - /// not specified. - /// Whether Kubernetes version is currently in - /// preview. - /// The list of available upgrade - /// versions. - public OrchestratorVersionProfile(string orchestratorType, string orchestratorVersion, bool? defaultProperty = default(bool?), bool? isPreview = default(bool?), IList upgrades = default(IList)) - { - OrchestratorType = orchestratorType; - OrchestratorVersion = orchestratorVersion; - DefaultProperty = defaultProperty; - IsPreview = isPreview; - Upgrades = upgrades; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets orchestrator type. - /// - [JsonProperty(PropertyName = "orchestratorType")] - public string OrchestratorType { get; set; } - - /// - /// Gets or sets orchestrator version (major, minor, patch). - /// - [JsonProperty(PropertyName = "orchestratorVersion")] - public string OrchestratorVersion { get; set; } - - /// - /// Gets or sets installed by default if version is not specified. - /// - [JsonProperty(PropertyName = "default")] - public bool? DefaultProperty { get; set; } - - /// - /// Gets or sets whether Kubernetes version is currently in preview. - /// - [JsonProperty(PropertyName = "isPreview")] - public bool? IsPreview { get; set; } - - /// - /// Gets or sets the list of available upgrade versions. - /// - [JsonProperty(PropertyName = "upgrades")] - public IList Upgrades { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (OrchestratorType == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "OrchestratorType"); - } - if (OrchestratorVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "OrchestratorVersion"); - } - if (Upgrades != null) - { - foreach (var element in Upgrades) - { - if (element != null) - { - element.Validate(); - } - } - } - } - } -} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OrchestratorVersionProfileListResult.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OrchestratorVersionProfileListResult.cs deleted file mode 100644 index 1b6b79cb525c4..0000000000000 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OrchestratorVersionProfileListResult.cs +++ /dev/null @@ -1,109 +0,0 @@ -// -// 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; - - /// - /// The list of versions for supported orchestrators. - /// - [Rest.Serialization.JsonTransformation] - public partial class OrchestratorVersionProfileListResult - { - /// - /// Initializes a new instance of the - /// OrchestratorVersionProfileListResult class. - /// - public OrchestratorVersionProfileListResult() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// OrchestratorVersionProfileListResult class. - /// - /// List of orchestrator version - /// profiles. - /// Id of the orchestrator version profile list - /// result. - /// Name of the orchestrator version profile list - /// result. - /// Type of the orchestrator version profile list - /// result. - public OrchestratorVersionProfileListResult(IList orchestrators, string id = default(string), string name = default(string), string type = default(string)) - { - Id = id; - Name = name; - Type = type; - Orchestrators = orchestrators; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets id of the orchestrator version profile list result. - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } - - /// - /// Gets name of the orchestrator version profile list result. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } - - /// - /// Gets type of the orchestrator version profile list result. - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - - /// - /// Gets or sets list of orchestrator version profiles. - /// - [JsonProperty(PropertyName = "properties.orchestrators")] - public IList Orchestrators { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Orchestrators == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Orchestrators"); - } - if (Orchestrators != null) - { - foreach (var element in Orchestrators) - { - if (element != null) - { - element.Validate(); - } - } - } - } - } -} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/Page.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/Page.cs index 98d1c735adfb5..b3544b8d9dc9f 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/Page.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/Page.cs @@ -26,7 +26,7 @@ public class Page : IPage /// /// Gets the link to the next page. /// - [JsonProperty("nextLink")] + [JsonProperty("")] public string NextPageLink { get; private set; } [JsonProperty("value")] diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/Page1.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/Page1.cs index 12800e406b6ed..dcebab5291e6a 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/Page1.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/Page1.cs @@ -26,7 +26,7 @@ public class Page1 : IPage /// /// Gets the link to the next page. /// - [JsonProperty("")] + [JsonProperty("nextLink")] public string NextPageLink { get; private set; } [JsonProperty("value")] diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/PowerState.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/PowerState.cs new file mode 100644 index 0000000000000..bc3c17706c5b6 --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/PowerState.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; + + /// + /// Describes the Power State of the cluster + /// + public partial class PowerState + { + /// + /// Initializes a new instance of the PowerState class. + /// + public PowerState() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PowerState class. + /// + /// Tells whether the cluster is Running or Stopped. + /// Possible values include: 'Running', 'Stopped' + public PowerState(string code = default(string)) + { + Code = code; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets tells whether the cluster is Running or Stopped. + /// Possible values include: 'Running', 'Stopped' + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; set; } + + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/PrivateLinkResource.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/PrivateLinkResource.cs new file mode 100644 index 0000000000000..a765914f95036 --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/PrivateLinkResource.cs @@ -0,0 +1,96 @@ +// +// 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.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A private link resource + /// + public partial class PrivateLinkResource + { + /// + /// Initializes a new instance of the PrivateLinkResource class. + /// + public PrivateLinkResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateLinkResource class. + /// + /// The ID of the private link resource. + /// The name of the private link resource. + /// The resource type. + /// The group ID of the resource. + /// RequiredMembers of the + /// resource + /// The private link service ID of + /// the resource, this field is exposed only to NRP internally. + public PrivateLinkResource(string id = default(string), string name = default(string), string type = default(string), string groupId = default(string), IList requiredMembers = default(IList), string privateLinkServiceID = default(string)) + { + Id = id; + Name = name; + Type = type; + GroupId = groupId; + RequiredMembers = requiredMembers; + PrivateLinkServiceID = privateLinkServiceID; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the ID of the private link resource. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets or sets the name of the private link resource. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the resource type. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + /// + /// Gets or sets the group ID of the resource. + /// + [JsonProperty(PropertyName = "groupId")] + public string GroupId { get; set; } + + /// + /// Gets or sets requiredMembers of the resource + /// + [JsonProperty(PropertyName = "requiredMembers")] + public IList RequiredMembers { get; set; } + + /// + /// Gets the private link service ID of the resource, this field is + /// exposed only to NRP internally. + /// + [JsonProperty(PropertyName = "privateLinkServiceID")] + public string PrivateLinkServiceID { get; private set; } + + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OpenShiftManagedClusterAuthProfile.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/PrivateLinkResourcesListResult.cs similarity index 51% rename from sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OpenShiftManagedClusterAuthProfile.cs rename to sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/PrivateLinkResourcesListResult.cs index 744333264090b..87267651779d9 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OpenShiftManagedClusterAuthProfile.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/PrivateLinkResourcesListResult.cs @@ -16,28 +16,27 @@ namespace Microsoft.Azure.Management.ContainerService.Models using System.Linq; /// - /// Defines all possible authentication profiles for the OpenShift cluster. + /// A list of private link resources /// - public partial class OpenShiftManagedClusterAuthProfile + public partial class PrivateLinkResourcesListResult { /// - /// Initializes a new instance of the - /// OpenShiftManagedClusterAuthProfile class. + /// Initializes a new instance of the PrivateLinkResourcesListResult + /// class. /// - public OpenShiftManagedClusterAuthProfile() + public PrivateLinkResourcesListResult() { CustomInit(); } /// - /// Initializes a new instance of the - /// OpenShiftManagedClusterAuthProfile class. + /// Initializes a new instance of the PrivateLinkResourcesListResult + /// class. /// - /// Type of authentication profile to - /// use. - public OpenShiftManagedClusterAuthProfile(IList identityProviders = default(IList)) + /// The collection value. + public PrivateLinkResourcesListResult(IList value = default(IList)) { - IdentityProviders = identityProviders; + Value = value; CustomInit(); } @@ -47,10 +46,10 @@ public OpenShiftManagedClusterAuthProfile() partial void CustomInit(); /// - /// Gets or sets type of authentication profile to use. + /// Gets or sets the collection value. /// - [JsonProperty(PropertyName = "identityProviders")] - public IList IdentityProviders { get; set; } + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } } } diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/PurchasePlan.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/PurchasePlan.cs deleted file mode 100644 index 1652d53115674..0000000000000 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/PurchasePlan.cs +++ /dev/null @@ -1,80 +0,0 @@ -// -// 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; - - /// - /// Used for establishing the purchase context of any 3rd Party artifact - /// through MarketPlace. - /// - public partial class PurchasePlan - { - /// - /// Initializes a new instance of the PurchasePlan class. - /// - public PurchasePlan() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the PurchasePlan class. - /// - /// The plan ID. - /// Specifies the product of the image from the - /// marketplace. This is the same value as Offer under the - /// imageReference element. - /// The promotion code. - /// The plan ID. - public PurchasePlan(string name = default(string), string product = default(string), string promotionCode = default(string), string publisher = default(string)) - { - Name = name; - Product = product; - PromotionCode = promotionCode; - Publisher = publisher; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the plan ID. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets specifies the product of the image from the - /// marketplace. This is the same value as Offer under the - /// imageReference element. - /// - [JsonProperty(PropertyName = "product")] - public string Product { get; set; } - - /// - /// Gets or sets the promotion code. - /// - [JsonProperty(PropertyName = "promotionCode")] - public string PromotionCode { get; set; } - - /// - /// Gets or sets the plan ID. - /// - [JsonProperty(PropertyName = "publisher")] - public string Publisher { get; set; } - - } -} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/UpgradeChannel.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/UpgradeChannel.cs new file mode 100644 index 0000000000000..9eec2b7772e21 --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/UpgradeChannel.cs @@ -0,0 +1,23 @@ +// +// 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 UpgradeChannel. + /// + public static class UpgradeChannel + { + public const string Rapid = "rapid"; + public const string Stable = "stable"; + public const string Patch = "patch"; + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/OpenShiftManagedClustersOperations.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/OpenShiftManagedClustersOperations.cs deleted file mode 100644 index 88ceffb58c7dc..0000000000000 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/OpenShiftManagedClustersOperations.cs +++ /dev/null @@ -1,1720 +0,0 @@ -// -// 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; - - /// - /// OpenShiftManagedClustersOperations operations. - /// - internal partial class OpenShiftManagedClustersOperations : IServiceOperations, IOpenShiftManagedClustersOperations - { - /// - /// Initializes a new instance of the OpenShiftManagedClustersOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal OpenShiftManagedClustersOperations(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 OpenShift managed clusters in the specified subscription. - /// - /// - /// Gets a list of OpenShift managed clusters in the specified subscription. - /// The operation returns properties of each OpenShift managed cluster. - /// - /// - /// 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.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2019-04-30"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - 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/openShiftManagedClusters").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 OpenShift managed clusters in the specified subscription and resource - /// group. - /// - /// - /// Lists OpenShift managed clusters in the specified subscription and resource - /// group. The operation returns properties of each OpenShift managed cluster. - /// - /// - /// 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.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); - } - } - string apiVersion = "2019-04-30"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - 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/openShiftManagedClusters").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 OpenShift managed cluster. - /// - /// - /// Gets the details of the managed OpenShift cluster with a specified resource - /// group and name. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the OpenShift 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.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"); - } - string apiVersion = "2019-04-30"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - 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/openShiftManagedClusters/{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 (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 an OpenShift managed cluster. - /// - /// - /// Creates or updates a OpenShift managed cluster with the specified - /// configuration for agents and OpenShift version. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the OpenShift managed cluster resource. - /// - /// - /// Parameters supplied to the Create or Update an OpenShift Managed Cluster - /// operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string resourceName, OpenShiftManagedCluster parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, resourceName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Updates tags on an OpenShift managed cluster. - /// - /// - /// Updates an OpenShift managed cluster with the specified tags. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the OpenShift managed cluster resource. - /// - /// - /// Resource tags. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string resourceName, IDictionary tags = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, resourceName, tags, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes an OpenShift managed cluster. - /// - /// - /// Deletes the OpenShift managed cluster with a specified resource group and - /// name. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the OpenShift managed cluster resource. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, resourceName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Creates or updates an OpenShift managed cluster. - /// - /// - /// Creates or updates a OpenShift managed cluster with the specified - /// configuration for agents and OpenShift version. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the OpenShift managed cluster resource. - /// - /// - /// Parameters supplied to the Create or Update an OpenShift Managed Cluster - /// 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> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string resourceName, OpenShiftManagedCluster parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } - string apiVersion = "2019-04-30"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("resourceName", resourceName); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", 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/openShiftManagedClusters/{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 (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 an OpenShift managed cluster. - /// - /// - /// Updates an OpenShift managed cluster with the specified tags. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the OpenShift 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> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string resourceName, IDictionary tags = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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"); - } - string apiVersion = "2019-04-30"; - 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("apiVersion", apiVersion); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("resourceName", resourceName); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", 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/openShiftManagedClusters/{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 (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 an OpenShift managed cluster. - /// - /// - /// Deletes the OpenShift managed cluster with a specified resource group and - /// name. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the OpenShift 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 BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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"); - } - string apiVersion = "2019-04-30"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("resourceName", resourceName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", 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/openShiftManagedClusters/{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 (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 != 202 && (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 OpenShift managed clusters in the specified subscription. - /// - /// - /// Gets a list of OpenShift managed clusters in the specified subscription. - /// The operation returns properties of each OpenShift managed cluster. - /// - /// - /// 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 OpenShift managed clusters in the specified subscription and resource - /// group. - /// - /// - /// Lists OpenShift managed clusters in the specified subscription and resource - /// group. The operation returns properties of each OpenShift managed cluster. - /// - /// - /// 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/OpenShiftManagedClustersOperationsExtensions.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/OpenShiftManagedClustersOperationsExtensions.cs deleted file mode 100644 index 37a2d108e3e68..0000000000000 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/OpenShiftManagedClustersOperationsExtensions.cs +++ /dev/null @@ -1,547 +0,0 @@ -// -// 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 OpenShiftManagedClustersOperations. - /// - public static partial class OpenShiftManagedClustersOperationsExtensions - { - /// - /// Gets a list of OpenShift managed clusters in the specified subscription. - /// - /// - /// Gets a list of OpenShift managed clusters in the specified subscription. - /// The operation returns properties of each OpenShift managed cluster. - /// - /// - /// The operations group for this extension method. - /// - public static IPage List(this IOpenShiftManagedClustersOperations operations) - { - return operations.ListAsync().GetAwaiter().GetResult(); - } - - /// - /// Gets a list of OpenShift managed clusters in the specified subscription. - /// - /// - /// Gets a list of OpenShift managed clusters in the specified subscription. - /// The operation returns properties of each OpenShift managed cluster. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IOpenShiftManagedClustersOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists OpenShift managed clusters in the specified subscription and resource - /// group. - /// - /// - /// Lists OpenShift managed clusters in the specified subscription and resource - /// group. The operation returns properties of each OpenShift managed cluster. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - public static IPage ListByResourceGroup(this IOpenShiftManagedClustersOperations operations, string resourceGroupName) - { - return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); - } - - /// - /// Lists OpenShift managed clusters in the specified subscription and resource - /// group. - /// - /// - /// Lists OpenShift managed clusters in the specified subscription and resource - /// group. The operation returns properties of each OpenShift managed cluster. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this IOpenShiftManagedClustersOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a OpenShift managed cluster. - /// - /// - /// Gets the details of the managed OpenShift cluster with a specified resource - /// group and name. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the OpenShift managed cluster resource. - /// - public static OpenShiftManagedCluster Get(this IOpenShiftManagedClustersOperations operations, string resourceGroupName, string resourceName) - { - return operations.GetAsync(resourceGroupName, resourceName).GetAwaiter().GetResult(); - } - - /// - /// Gets a OpenShift managed cluster. - /// - /// - /// Gets the details of the managed OpenShift cluster with a specified resource - /// group and name. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the OpenShift managed cluster resource. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IOpenShiftManagedClustersOperations 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 an OpenShift managed cluster. - /// - /// - /// Creates or updates a OpenShift managed cluster with the specified - /// configuration for agents and OpenShift version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the OpenShift managed cluster resource. - /// - /// - /// Parameters supplied to the Create or Update an OpenShift Managed Cluster - /// operation. - /// - public static OpenShiftManagedCluster CreateOrUpdate(this IOpenShiftManagedClustersOperations operations, string resourceGroupName, string resourceName, OpenShiftManagedCluster parameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, resourceName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates an OpenShift managed cluster. - /// - /// - /// Creates or updates a OpenShift managed cluster with the specified - /// configuration for agents and OpenShift version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the OpenShift managed cluster resource. - /// - /// - /// Parameters supplied to the Create or Update an OpenShift Managed Cluster - /// operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IOpenShiftManagedClustersOperations operations, string resourceGroupName, string resourceName, OpenShiftManagedCluster parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, resourceName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Updates tags on an OpenShift managed cluster. - /// - /// - /// Updates an OpenShift managed cluster with the specified tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the OpenShift managed cluster resource. - /// - /// - /// Resource tags. - /// - public static OpenShiftManagedCluster UpdateTags(this IOpenShiftManagedClustersOperations operations, string resourceGroupName, string resourceName, IDictionary tags = default(IDictionary)) - { - return operations.UpdateTagsAsync(resourceGroupName, resourceName, tags).GetAwaiter().GetResult(); - } - - /// - /// Updates tags on an OpenShift managed cluster. - /// - /// - /// Updates an OpenShift managed cluster with the specified tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the OpenShift managed cluster resource. - /// - /// - /// Resource tags. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateTagsAsync(this IOpenShiftManagedClustersOperations 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 an OpenShift managed cluster. - /// - /// - /// Deletes the OpenShift managed cluster with a specified resource group and - /// name. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the OpenShift managed cluster resource. - /// - public static void Delete(this IOpenShiftManagedClustersOperations operations, string resourceGroupName, string resourceName) - { - operations.DeleteAsync(resourceGroupName, resourceName).GetAwaiter().GetResult(); - } - - /// - /// Deletes an OpenShift managed cluster. - /// - /// - /// Deletes the OpenShift managed cluster with a specified resource group and - /// name. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the OpenShift managed cluster resource. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IOpenShiftManagedClustersOperations operations, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Creates or updates an OpenShift managed cluster. - /// - /// - /// Creates or updates a OpenShift managed cluster with the specified - /// configuration for agents and OpenShift version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the OpenShift managed cluster resource. - /// - /// - /// Parameters supplied to the Create or Update an OpenShift Managed Cluster - /// operation. - /// - public static OpenShiftManagedCluster BeginCreateOrUpdate(this IOpenShiftManagedClustersOperations operations, string resourceGroupName, string resourceName, OpenShiftManagedCluster parameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, resourceName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates an OpenShift managed cluster. - /// - /// - /// Creates or updates a OpenShift managed cluster with the specified - /// configuration for agents and OpenShift version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the OpenShift managed cluster resource. - /// - /// - /// Parameters supplied to the Create or Update an OpenShift Managed Cluster - /// operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IOpenShiftManagedClustersOperations operations, string resourceGroupName, string resourceName, OpenShiftManagedCluster parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, resourceName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Updates tags on an OpenShift managed cluster. - /// - /// - /// Updates an OpenShift managed cluster with the specified tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the OpenShift managed cluster resource. - /// - /// - /// Resource tags. - /// - public static OpenShiftManagedCluster BeginUpdateTags(this IOpenShiftManagedClustersOperations operations, string resourceGroupName, string resourceName, IDictionary tags = default(IDictionary)) - { - return operations.BeginUpdateTagsAsync(resourceGroupName, resourceName, tags).GetAwaiter().GetResult(); - } - - /// - /// Updates tags on an OpenShift managed cluster. - /// - /// - /// Updates an OpenShift managed cluster with the specified tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the OpenShift managed cluster resource. - /// - /// - /// Resource tags. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateTagsAsync(this IOpenShiftManagedClustersOperations operations, string resourceGroupName, string resourceName, IDictionary tags = default(IDictionary), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, resourceName, tags, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes an OpenShift managed cluster. - /// - /// - /// Deletes the OpenShift managed cluster with a specified resource group and - /// name. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the OpenShift managed cluster resource. - /// - public static void BeginDelete(this IOpenShiftManagedClustersOperations operations, string resourceGroupName, string resourceName) - { - operations.BeginDeleteAsync(resourceGroupName, resourceName).GetAwaiter().GetResult(); - } - - /// - /// Deletes an OpenShift managed cluster. - /// - /// - /// Deletes the OpenShift managed cluster with a specified resource group and - /// name. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the OpenShift managed cluster resource. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IOpenShiftManagedClustersOperations operations, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets a list of OpenShift managed clusters in the specified subscription. - /// - /// - /// Gets a list of OpenShift managed clusters in the specified subscription. - /// The operation returns properties of each OpenShift managed cluster. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IOpenShiftManagedClustersOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets a list of OpenShift managed clusters in the specified subscription. - /// - /// - /// Gets a list of OpenShift managed clusters in the specified subscription. - /// The operation returns properties of each OpenShift managed cluster. - /// - /// - /// 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 IOpenShiftManagedClustersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists OpenShift managed clusters in the specified subscription and resource - /// group. - /// - /// - /// Lists OpenShift managed clusters in the specified subscription and resource - /// group. The operation returns properties of each OpenShift managed cluster. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByResourceGroupNext(this IOpenShiftManagedClustersOperations operations, string nextPageLink) - { - return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists OpenShift managed clusters in the specified subscription and resource - /// group. - /// - /// - /// Lists OpenShift managed clusters in the specified subscription and resource - /// group. The operation returns properties of each OpenShift managed cluster. - /// - /// - /// 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 IOpenShiftManagedClustersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Operations.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Operations.cs index 9aa03fa35215e..7b6fe467ca55d 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Operations.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Operations.cs @@ -65,12 +65,21 @@ internal Operations(ContainerServiceClient client) /// /// 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)) { - string apiVersion = "2020-07-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -78,7 +87,6 @@ internal Operations(ContainerServiceClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -86,9 +94,9 @@ internal Operations(ContainerServiceClient client) var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.ContainerService/operations").ToString(); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -196,7 +204,7 @@ internal Operations(ContainerServiceClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/PrivateEndpointConnectionsOperations.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/PrivateEndpointConnectionsOperations.cs index 4a6f473035d38..b25f88e5a7ba5 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/PrivateEndpointConnectionsOperations.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/PrivateEndpointConnectionsOperations.cs @@ -88,6 +88,10 @@ internal PrivateEndpointConnectionsOperations(ContainerServiceClient client) /// public async Task> ListWithHttpMessagesAsync(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"); @@ -122,7 +126,6 @@ internal PrivateEndpointConnectionsOperations(ContainerServiceClient client) throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); } } - string apiVersion = "2020-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -130,7 +133,6 @@ internal PrivateEndpointConnectionsOperations(ContainerServiceClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("resourceName", resourceName); tracingParameters.Add("cancellationToken", cancellationToken); @@ -143,9 +145,9 @@ internal PrivateEndpointConnectionsOperations(ContainerServiceClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -311,6 +313,10 @@ internal PrivateEndpointConnectionsOperations(ContainerServiceClient client) /// public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string resourceName, string privateEndpointConnectionName, 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"); @@ -349,7 +355,6 @@ internal PrivateEndpointConnectionsOperations(ContainerServiceClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); } - string apiVersion = "2020-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -357,7 +362,6 @@ internal PrivateEndpointConnectionsOperations(ContainerServiceClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("resourceName", resourceName); tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); @@ -372,9 +376,9 @@ internal PrivateEndpointConnectionsOperations(ContainerServiceClient client) _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -542,6 +546,10 @@ internal PrivateEndpointConnectionsOperations(ContainerServiceClient client) /// public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string resourceName, string privateEndpointConnectionName, PrivateEndpointConnection 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"); @@ -588,7 +596,6 @@ internal PrivateEndpointConnectionsOperations(ContainerServiceClient client) { parameters.Validate(); } - string apiVersion = "2020-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -596,7 +603,6 @@ internal PrivateEndpointConnectionsOperations(ContainerServiceClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("resourceName", resourceName); tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); @@ -612,9 +618,9 @@ internal PrivateEndpointConnectionsOperations(ContainerServiceClient client) _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -810,6 +816,10 @@ internal PrivateEndpointConnectionsOperations(ContainerServiceClient client) /// public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string resourceName, string privateEndpointConnectionName, 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"); @@ -848,7 +858,6 @@ internal PrivateEndpointConnectionsOperations(ContainerServiceClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); } - string apiVersion = "2020-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -856,7 +865,6 @@ internal PrivateEndpointConnectionsOperations(ContainerServiceClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("resourceName", resourceName); tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); @@ -871,9 +879,9 @@ internal PrivateEndpointConnectionsOperations(ContainerServiceClient client) _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/PrivateLinkResourcesOperations.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/PrivateLinkResourcesOperations.cs new file mode 100644 index 0000000000000..8df9653557bde --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/PrivateLinkResourcesOperations.cs @@ -0,0 +1,276 @@ +// +// 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; + + /// + /// PrivateLinkResourcesOperations operations. + /// + internal partial class PrivateLinkResourcesOperations : IServiceOperations, IPrivateLinkResourcesOperations + { + /// + /// Initializes a new instance of the PrivateLinkResourcesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal PrivateLinkResourcesOperations(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 private link resources in the specified managed cluster. + /// + /// + /// Gets a list of private link resources in the specified managed cluster. The + /// operation returns properties of each private link resource. + /// + /// + /// 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> ListWithHttpMessagesAsync(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, "List", 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/managedClusters/{resourceName}/privateLinkResources").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; + } + + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/PrivateLinkResourcesOperationsExtensions.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/PrivateLinkResourcesOperationsExtensions.cs new file mode 100644 index 0000000000000..24229e29bd676 --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/PrivateLinkResourcesOperationsExtensions.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 +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for PrivateLinkResourcesOperations. + /// + public static partial class PrivateLinkResourcesOperationsExtensions + { + /// + /// Gets a list of private link resources in the specified managed cluster. + /// + /// + /// Gets a list of private link resources in the specified managed cluster. The + /// operation returns properties of each private link resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + public static PrivateLinkResourcesListResult List(this IPrivateLinkResourcesOperations operations, string resourceGroupName, string resourceName) + { + return operations.ListAsync(resourceGroupName, resourceName).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of private link resources in the specified managed cluster. + /// + /// + /// Gets a list of private link resources in the specified managed cluster. The + /// operation returns properties of each private link resource. + /// + /// + /// 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 ListAsync(this IPrivateLinkResourcesOperations operations, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ResolvePrivateLinkServiceIdOperations.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ResolvePrivateLinkServiceIdOperations.cs new file mode 100644 index 0000000000000..51a047506bb87 --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ResolvePrivateLinkServiceIdOperations.cs @@ -0,0 +1,290 @@ +// +// 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; + + /// + /// ResolvePrivateLinkServiceIdOperations operations. + /// + internal partial class ResolvePrivateLinkServiceIdOperations : IServiceOperations, IResolvePrivateLinkServiceIdOperations + { + /// + /// Initializes a new instance of the ResolvePrivateLinkServiceIdOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ResolvePrivateLinkServiceIdOperations(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 the private link service ID for the specified managed cluster. + /// + /// + /// Gets the private link service ID the specified managed cluster. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// Parameters (name, groupId) supplied in order to resolve a private link + /// service ID. + /// + /// + /// 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> POSTWithHttpMessagesAsync(string resourceGroupName, string resourceName, PrivateLinkResource 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"); + } + // 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, "POST", 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/managedClusters/{resourceName}/resolvePrivateLinkServiceId").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("POST"); + _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; + } + + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ResolvePrivateLinkServiceIdOperationsExtensions.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ResolvePrivateLinkServiceIdOperationsExtensions.cs new file mode 100644 index 0000000000000..90c268c348846 --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ResolvePrivateLinkServiceIdOperationsExtensions.cs @@ -0,0 +1,79 @@ +// +// 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.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ResolvePrivateLinkServiceIdOperations. + /// + public static partial class ResolvePrivateLinkServiceIdOperationsExtensions + { + /// + /// Gets the private link service ID for the specified managed cluster. + /// + /// + /// Gets the private link service ID the specified managed cluster. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// Parameters (name, groupId) supplied in order to resolve a private link + /// service ID. + /// + public static PrivateLinkResource POST(this IResolvePrivateLinkServiceIdOperations operations, string resourceGroupName, string resourceName, PrivateLinkResource parameters) + { + return operations.POSTAsync(resourceGroupName, resourceName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Gets the private link service ID for the specified managed cluster. + /// + /// + /// Gets the private link service ID the specified managed cluster. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// Parameters (name, groupId) supplied in order to resolve a private link + /// service ID. + /// + /// + /// The cancellation token. + /// + public static async Task POSTAsync(this IResolvePrivateLinkServiceIdOperations operations, string resourceGroupName, string resourceName, PrivateLinkResource parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.POSTWithHttpMessagesAsync(resourceGroupName, resourceName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} 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 bb2cb6f0ea604..d97c4fdb256f1 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,14 @@ public static IEnumerable> ApiInfo_ContainerServic { return new Tuple[] { - new Tuple("ContainerService", "AgentPools", "2020-07-01"), - new Tuple("ContainerService", "ContainerServices", "2017-07-01"), - new Tuple("ContainerService", "ContainerServices", "2019-08-01"), - new Tuple("ContainerService", "ManagedClusters", "2020-07-01"), - new Tuple("ContainerService", "OpenShiftManagedClusters", "2019-04-30"), - new Tuple("ContainerService", "Operations", "2020-07-01"), - new Tuple("ContainerService", "PrivateEndpointConnections", "2020-07-01"), + new Tuple("ContainerService", "AgentPools", "2020-11-01"), + new Tuple("ContainerService", "ManagedClusters", "2020-11-01"), + new Tuple("ContainerService", "Operations", "2020-11-01"), + new Tuple("ContainerService", "PrivateEndpointConnections", "2020-11-01"), + new Tuple("ContainerService", "PrivateLinkResources", "2020-11-01"), + new Tuple("ContainerService", "ResolvePrivateLinkServiceId", "2020-11-01"), }.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\\abelch\\src\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "122829cebe6e4177e9eb6ff349071d3e2034b0e7"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } -