From 2c5dc5b824c71a00d90f545ca5c406ef15e332b7 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 2 Jun 2021 00:55:17 +0000 Subject: [PATCH] CodeGen from PR 14614 in Azure/azure-rest-api-specs Merge d0c2f6e79a9de61a07e4fee9d64219a91a33bf8b into 808938d19ab8904ff2aa75d09f29f0b334fecca2 --- .../src/Generated/AgentPoolsOperations.cs | 326 ++- .../AgentPoolsOperationsExtensions.cs | 104 + .../src/Generated/ContainerServiceClient.cs | 38 +- .../Generated/ContainerServicesOperations.cs | 1689 --------------- .../ContainerServicesOperationsExtensions.cs | 547 ----- .../src/Generated/IAgentPoolsOperations.cs | 62 + .../src/Generated/IContainerServiceClient.cs | 30 +- .../Generated/IContainerServicesOperations.cs | 340 --- .../IMaintenanceConfigurationsOperations.cs | 183 ++ .../Generated/IManagedClustersOperations.cs | 240 ++- .../IOpenShiftManagedClustersOperations.cs | 345 --- .../IPrivateLinkResourcesOperations.cs | 58 + .../IResolvePrivateLinkServiceIdOperations.cs | 59 + ...=> MaintenanceConfigurationsOperations.cs} | 983 ++------- ...nanceConfigurationsOperationsExtensions.cs | 280 +++ .../Generated/ManagedClustersOperations.cs | 1870 ++++++++++++++--- .../ManagedClustersOperationsExtensions.cs | 420 +++- .../src/Generated/Models/AgentPool.cs | 276 +-- ...enShiftAgentPoolProfileRole.cs => Code.cs} | 8 +- .../ContainerServiceAgentPoolProfile.cs | 290 --- .../Generated/Models/ContainerServiceModel.cs | 204 -- .../ContainerServiceOrchestratorProfile.cs | 85 - ...ContainerServiceServicePrincipalProfile.cs | 92 - .../Models/ContainerServiceWindowsProfile.cs | 95 - ...eOrchestratorTypes.cs => CreatedByType.cs} | 13 +- .../Generated/Models/EndpointDependency.cs | 63 + .../src/Generated/Models/EndpointDetail.cs | 76 + .../src/Generated/Models/Expander.cs | 24 + ...dentityProvider.cs => ExtendedLocation.cs} | 31 +- .../Generated/Models/ExtendedLocationTypes.cs | 21 + .../Generated/Models/GPUInstanceProfile.cs | 25 + .../src/Generated/Models/KubeletConfig.cs | 165 ++ .../src/Generated/Models/KubeletDiskType.cs | 22 + .../src/Generated/Models/LinuxOSConfig.cs | 80 + .../Models/MaintenanceConfiguration.cs | 81 + .../src/Generated/Models/ManagedCluster.cs | 88 +- .../ManagedClusterAPIServerAccessProfile.cs | 21 +- .../Models/ManagedClusterAgentPoolProfile.cs | 104 +- ...anagedClusterAgentPoolProfileProperties.cs | 276 +-- .../ManagedClusterAutoUpgradeProfile.cs | 56 + .../Models/ManagedClusterHTTPProxyConfig.cs | 83 + .../Models/ManagedClusterPodIdentity.cs | 115 + .../ManagedClusterPodIdentityException.cs | 91 + .../ManagedClusterPodIdentityProfile.cs | 82 + ...nagedClusterPodIdentityProvisioningInfo.cs | 50 + ...agedClusterPodIdentityProvisioningState.cs | 24 + ...nagedClusterPropertiesAutoScalerProfile.cs | 60 +- .../Models/ManagedClusterWindowsProfile.cs | 72 +- .../src/Generated/Models/NetworkProfile.cs | 68 - .../src/Generated/Models/OSDiskType.cs | 22 + ...rofileListResult.cs => OSOptionProfile.cs} | 49 +- ...ceCustomProfile.cs => OSOptionProperty.cs} | 38 +- .../src/Generated/Models/OSSKU.cs | 22 + .../Models/OpenShiftContainerServiceVMSize.cs | 53 - .../Models/OpenShiftManagedCluster.cs | 185 -- ...nShiftManagedClusterAADIdentityProvider.cs | 82 - ...OpenShiftManagedClusterAgentPoolProfile.cs | 142 -- ...ShiftManagedClusterBaseIdentityProvider.cs | 36 - ...penShiftManagedClusterMasterPoolProfile.cs | 130 -- .../Models/OpenShiftRouterProfile.cs | 69 - .../Generated/Models/OrchestratorProfile.cs | 83 - .../Models/OrchestratorVersionProfile.cs | 117 -- .../Models/OutboundEnvironmentEndpoint.cs | 67 + .../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 - ...VaultSecretRef.cs => RunCommandRequest.cs} | 53 +- .../src/Generated/Models/RunCommandResult.cs | 103 + .../src/Generated/Models/SysctlConfig.cs | 291 +++ .../src/Generated/Models/SystemData.cs | 103 + .../src/Generated/Models/TimeInWeek.cs | 64 + .../src/Generated/Models/TimeSpan.cs | 59 + .../src/Generated/Models/UpgradeChannel.cs | 25 + .../src/Generated/Models/WeekDay.cs | 27 + ...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 | 25 +- 85 files changed, 6947 insertions(+), 6896 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 create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IMaintenanceConfigurationsOperations.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/{OpenShiftManagedClustersOperations.cs => MaintenanceConfigurationsOperations.cs} (55%) create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/MaintenanceConfigurationsOperationsExtensions.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/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 => CreatedByType.cs} (56%) create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/EndpointDependency.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/EndpointDetail.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/Expander.cs rename sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/{OpenShiftManagedClusterIdentityProvider.cs => ExtendedLocation.cs} (51%) create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ExtendedLocationTypes.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/GPUInstanceProfile.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/KubeletConfig.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/KubeletDiskType.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/LinuxOSConfig.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/MaintenanceConfiguration.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAutoUpgradeProfile.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterHTTPProxyConfig.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterPodIdentity.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterPodIdentityException.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProfile.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProvisioningInfo.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProvisioningState.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 rename sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/{OrchestratorVersionProfileListResult.cs => OSOptionProfile.cs} (56%) rename sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/{ContainerServiceCustomProfile.cs => OSOptionProperty.cs} (58%) create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OSSKU.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/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 create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OutboundEnvironmentEndpoint.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 rename sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/{KeyVaultSecretRef.cs => RunCommandRequest.cs} (51%) create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/RunCommandResult.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/SysctlConfig.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/SystemData.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/TimeInWeek.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/TimeSpan.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/UpgradeChannel.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/WeekDay.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..8d6d6cc7178b0 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,10 @@ internal AgentPoolsOperations(ContainerServiceClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2020-07-01"; + if (parameters != null) + { + parameters.Validate(); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1096,7 +1139,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 +1154,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 +1342,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 +1384,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 +1391,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 +1405,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 +1516,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 +1904,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..8ec676a4cb842 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. /// @@ -91,6 +86,11 @@ public partial class ContainerServiceClient : ServiceClient public virtual IManagedClustersOperations ManagedClusters { get; private set; } + /// + /// Gets the IMaintenanceConfigurationsOperations. + /// + public virtual IMaintenanceConfigurationsOperations MaintenanceConfigurations { get; private set; } + /// /// Gets the IAgentPoolsOperations. /// @@ -101,6 +101,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 +352,15 @@ 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); + MaintenanceConfigurations = new MaintenanceConfigurationsOperations(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 = "2021-05-01"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; @@ -378,8 +390,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..2b88f1d250124 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. /// @@ -86,6 +81,11 @@ public partial interface IContainerServiceClient : System.IDisposable /// IManagedClustersOperations ManagedClusters { get; } + /// + /// Gets the IMaintenanceConfigurationsOperations. + /// + IMaintenanceConfigurationsOperations MaintenanceConfigurations { get; } + /// /// Gets the IAgentPoolsOperations. /// @@ -96,5 +96,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/IMaintenanceConfigurationsOperations.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IMaintenanceConfigurationsOperations.cs new file mode 100644 index 0000000000000..62bad8341fd2f --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IMaintenanceConfigurationsOperations.cs @@ -0,0 +1,183 @@ +// +// 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; + + /// + /// MaintenanceConfigurationsOperations operations. + /// + public partial interface IMaintenanceConfigurationsOperations + { + /// + /// Gets a list of maintenance configurations in the specified managed + /// cluster. + /// + /// + /// Gets a list of maintenance configurations in the specified managed + /// cluster. The operation returns properties of each maintenance + /// configuration. + /// + /// + /// 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>> ListByManagedClusterWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the maintenance configuration. + /// + /// + /// Gets the details of maintenance configurations by managed cluster + /// and resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// The name of the maintenance configuration. + /// + /// + /// 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, string configName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a maintenance configurations. + /// + /// + /// Creates or updates a maintenance configuration in the specified + /// managed cluster. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// The name of the maintenance configuration. + /// + /// + /// Parameters supplied to the Create or Update a default maintenance + /// configuration. + /// + /// + /// 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, string configName, MaintenanceConfiguration parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a maintenance configuration. + /// + /// + /// Deletes the maintenance configuration in the specified managed + /// cluster. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// The name of the maintenance configuration. + /// + /// + /// 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, string configName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a list of maintenance configurations in the specified managed + /// cluster. + /// + /// + /// Gets a list of maintenance configurations in the specified managed + /// cluster. The operation returns properties of each maintenance + /// configuration. + /// + /// + /// 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>> ListByManagedClusterNextWithHttpMessagesAsync(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..c706deee97e17 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IManagedClustersOperations.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IManagedClustersOperations.cs @@ -23,6 +23,34 @@ namespace Microsoft.Azure.Management.ContainerService /// public partial interface IManagedClustersOperations { + /// + /// Gets supported OS options in the specified subscription. + /// + /// + /// Gets supported OS options in the specified subscription. + /// + /// + /// The name of a supported Azure region. + /// + /// + /// resource type for which the OS options 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> GetOSOptionsWithHttpMessagesAsync(string location, string resourceType = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets a list of managed clusters in the specified subscription. /// @@ -430,10 +458,92 @@ 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 + /// + /// + /// Stops a Running 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 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 StartWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Run Command against Managed Kubernetes Service + /// + /// + /// Submit a command to run against managed kubernetes service, it will + /// create a pod to run the command. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// Parameters supplied to the RunCommand 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> RunCommandWithHttpMessagesAsync(string resourceGroupName, string resourceName, RunCommandRequest requestPayload, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get command result. /// /// - /// Upgrade node image version of an agent pool to the latest. + /// Get command result from previous runCommand invoke. /// /// /// The name of the resource group. @@ -441,8 +551,8 @@ public partial interface IManagedClustersOperations /// /// The name of the managed cluster resource. /// - /// - /// The name of the agent pool. + /// + /// Id of the command request. /// /// /// The headers that will be added to request. @@ -459,7 +569,38 @@ public partial interface IManagedClustersOperations /// /// Thrown when a required parameter is null /// - Task> UpgradeNodeImageVersionWithHttpMessagesAsync(string resourceGroupName, string resourceName, string agentPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetCommandResultWithHttpMessagesAsync(string resourceGroupName, string resourceName, string commandId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a list of egress endpoints (network endpoints of all outbound + /// dependencies) in the specified managed cluster. + /// + /// + /// Gets a list of egress endpoints (network endpoints of all outbound + /// dependencies) in the specified managed cluster. The operation + /// returns properties of each egress endpoint. + /// + /// + /// 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>> ListOutboundNetworkDependenciesEndpointsWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Creates or updates a managed cluster. /// @@ -634,10 +775,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,8 +786,59 @@ 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. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 BeginStartWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Run Command against Managed Kubernetes Service + /// + /// + /// Submit a command to run against managed kubernetes service, it will + /// create a pod to run the command. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// Parameters supplied to the RunCommand operation. /// /// /// The headers that will be added to request. @@ -663,7 +855,7 @@ public partial interface IManagedClustersOperations /// /// Thrown when a required parameter is null /// - Task> BeginUpgradeNodeImageVersionWithHttpMessagesAsync(string resourceGroupName, string resourceName, string agentPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginRunCommandWithHttpMessagesAsync(string resourceGroupName, string resourceName, RunCommandRequest requestPayload, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets a list of managed clusters in the specified subscription. /// @@ -717,5 +909,33 @@ public partial interface IManagedClustersOperations /// Thrown when a required parameter is null /// Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a list of egress endpoints (network endpoints of all outbound + /// dependencies) in the specified managed cluster. + /// + /// + /// Gets a list of egress endpoints (network endpoints of all outbound + /// dependencies) in the specified managed cluster. The operation + /// returns properties of each egress endpoint. + /// + /// + /// 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>> ListOutboundNetworkDependenciesEndpointsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } 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/OpenShiftManagedClustersOperations.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/MaintenanceConfigurationsOperations.cs similarity index 55% rename from sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/OpenShiftManagedClustersOperations.cs rename to sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/MaintenanceConfigurationsOperations.cs index 88ceffb58c7dc..1a3152a8731ee 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/OpenShiftManagedClustersOperations.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/MaintenanceConfigurationsOperations.cs @@ -23,12 +23,12 @@ namespace Microsoft.Azure.Management.ContainerService using System.Threading.Tasks; /// - /// OpenShiftManagedClustersOperations operations. + /// MaintenanceConfigurationsOperations operations. /// - internal partial class OpenShiftManagedClustersOperations : IServiceOperations, IOpenShiftManagedClustersOperations + internal partial class MaintenanceConfigurationsOperations : IServiceOperations, IMaintenanceConfigurationsOperations { /// - /// Initializes a new instance of the OpenShiftManagedClustersOperations class. + /// Initializes a new instance of the MaintenanceConfigurationsOperations class. /// /// /// Reference to the service client. @@ -36,7 +36,7 @@ internal partial class OpenShiftManagedClustersOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal OpenShiftManagedClustersOperations(ContainerServiceClient client) + internal MaintenanceConfigurationsOperations(ContainerServiceClient client) { if (client == null) { @@ -51,12 +51,18 @@ internal OpenShiftManagedClustersOperations(ContainerServiceClient client) public ContainerServiceClient Client { get; private set; } /// - /// Gets a list of OpenShift managed clusters in the specified subscription. + /// Gets a list of maintenance configurations in the specified managed cluster. /// /// - /// Gets a list of OpenShift managed clusters in the specified subscription. - /// The operation returns properties of each OpenShift managed cluster. + /// Gets a list of maintenance configurations in the specified managed cluster. + /// The operation returns properties of each maintenance configuration. /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// /// /// Headers that will be added to request. /// @@ -78,13 +84,46 @@ internal OpenShiftManagedClustersOperations(ContainerServiceClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByManagedClusterWithHttpMessagesAsync(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"); } - string apiVersion = "2019-04-30"; + 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; @@ -92,18 +131,21 @@ internal OpenShiftManagedClustersOperations(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); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByManagedCluster", 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(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations").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) + 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) { @@ -198,7 +240,7 @@ internal OpenShiftManagedClustersOperations(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")) @@ -211,7 +253,7 @@ internal OpenShiftManagedClustersOperations(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) { @@ -231,16 +273,21 @@ internal OpenShiftManagedClustersOperations(ContainerServiceClient client) } /// - /// Lists OpenShift managed clusters in the specified subscription and resource - /// group. + /// Gets the maintenance configuration. /// /// - /// Lists OpenShift managed clusters in the specified subscription and resource - /// group. The operation returns properties of each OpenShift managed cluster. + /// Gets the details of maintenance configurations by managed cluster and + /// resource group. /// /// /// The name of the resource group. /// + /// + /// The name of the managed cluster resource. + /// + /// + /// The name of the maintenance configuration. + /// /// /// Headers that will be added to request. /// @@ -262,8 +309,12 @@ internal OpenShiftManagedClustersOperations(ContainerServiceClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string resourceName, string configName, 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"); @@ -279,7 +330,29 @@ internal OpenShiftManagedClustersOperations(ContainerServiceClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } - string apiVersion = "2019-04-30"; + 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 (configName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configName"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -287,20 +360,23 @@ internal OpenShiftManagedClustersOperations(ContainerServiceClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("configName", configName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + 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").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}").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("{configName}", System.Uri.EscapeDataString(configName)); 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) { @@ -395,7 +471,7 @@ internal OpenShiftManagedClustersOperations(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")) @@ -408,7 +484,7 @@ internal OpenShiftManagedClustersOperations(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) { @@ -428,17 +504,24 @@ internal OpenShiftManagedClustersOperations(ContainerServiceClient client) } /// - /// Gets a OpenShift managed cluster. + /// Creates or updates a maintenance configurations. /// /// - /// Gets the details of the managed OpenShift cluster with a specified resource - /// group and name. + /// Creates or updates a maintenance configuration in the specified managed + /// cluster. /// /// /// The name of the resource group. /// /// - /// The name of the OpenShift managed cluster resource. + /// The name of the managed cluster resource. + /// + /// + /// The name of the maintenance configuration. + /// + /// + /// Parameters supplied to the Create or Update a default maintenance + /// configuration. /// /// /// Headers that will be added to request. @@ -461,8 +544,12 @@ internal OpenShiftManagedClustersOperations(ContainerServiceClient client) /// /// 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)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string resourceName, string configName, MaintenanceConfiguration 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"); @@ -482,7 +569,29 @@ internal OpenShiftManagedClustersOperations(ContainerServiceClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); } - string apiVersion = "2019-04-30"; + 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 (configName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -490,22 +599,24 @@ internal OpenShiftManagedClustersOperations(ContainerServiceClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("configName", configName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}").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("{configName}", System.Uri.EscapeDataString(configName)); 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) { @@ -514,7 +625,7 @@ internal OpenShiftManagedClustersOperations(ContainerServiceClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -545,6 +656,12 @@ internal OpenShiftManagedClustersOperations(ContainerServiceClient client) // 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) { @@ -600,7 +717,7 @@ internal OpenShiftManagedClustersOperations(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")) @@ -613,7 +730,7 @@ internal OpenShiftManagedClustersOperations(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) { @@ -633,105 +750,19 @@ internal OpenShiftManagedClustersOperations(ContainerServiceClient client) } /// - /// 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. + /// Deletes a maintenance configuration. /// /// - /// Creates or updates a OpenShift managed cluster with the specified - /// configuration for agents and OpenShift version. + /// Deletes the maintenance configuration in the specified managed cluster. /// /// /// The name of the resource group. /// /// - /// The name of the OpenShift managed cluster resource. + /// The name of the managed cluster resource. /// - /// - /// Parameters supplied to the Create or Update an OpenShift Managed Cluster - /// operation. + /// + /// The name of the maintenance configuration. /// /// /// Headers that will be added to request. @@ -742,9 +773,6 @@ internal OpenShiftManagedClustersOperations(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 /// @@ -754,8 +782,12 @@ internal OpenShiftManagedClustersOperations(ContainerServiceClient client) /// /// 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)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string resourceName, string configName, 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"); @@ -775,15 +807,25 @@ internal OpenShiftManagedClustersOperations(ContainerServiceClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); } - if (parameters == null) + if (resourceName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + 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) + if (configName == null) { - parameters.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "configName"); } - string apiVersion = "2019-04-30"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -791,23 +833,23 @@ internal OpenShiftManagedClustersOperations(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); + tracingParameters.Add("configName", configName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}").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("{configName}", System.Uri.EscapeDataString(configName)); 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) { @@ -816,7 +858,7 @@ internal OpenShiftManagedClustersOperations(ContainerServiceClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -847,12 +889,6 @@ internal OpenShiftManagedClustersOperations(ContainerServiceClient client) // 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) { @@ -873,7 +909,7 @@ internal OpenShiftManagedClustersOperations(ContainerServiceClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -908,629 +944,13 @@ internal OpenShiftManagedClustersOperations(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 == 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); @@ -1539,12 +959,11 @@ internal OpenShiftManagedClustersOperations(ContainerServiceClient client) } /// - /// Lists OpenShift managed clusters in the specified subscription and resource - /// group. + /// Gets a list of maintenance configurations in the specified managed cluster. /// /// - /// Lists OpenShift managed clusters in the specified subscription and resource - /// group. The operation returns properties of each OpenShift managed cluster. + /// Gets a list of maintenance configurations in the specified managed cluster. + /// The operation returns properties of each maintenance configuration. /// /// /// The NextLink from the previous successful call to List operation. @@ -1570,7 +989,7 @@ internal OpenShiftManagedClustersOperations(ContainerServiceClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByManagedClusterNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -1585,7 +1004,7 @@ internal OpenShiftManagedClustersOperations(ContainerServiceClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByManagedClusterNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -1684,7 +1103,7 @@ internal OpenShiftManagedClustersOperations(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")) @@ -1697,7 +1116,7 @@ internal OpenShiftManagedClustersOperations(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/MaintenanceConfigurationsOperationsExtensions.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/MaintenanceConfigurationsOperationsExtensions.cs new file mode 100644 index 0000000000000..5a782430b384c --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/MaintenanceConfigurationsOperationsExtensions.cs @@ -0,0 +1,280 @@ +// +// 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 MaintenanceConfigurationsOperations. + /// + public static partial class MaintenanceConfigurationsOperationsExtensions + { + /// + /// Gets a list of maintenance configurations in the specified managed cluster. + /// + /// + /// Gets a list of maintenance configurations in the specified managed cluster. + /// The operation returns properties of each maintenance configuration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + public static IPage ListByManagedCluster(this IMaintenanceConfigurationsOperations operations, string resourceGroupName, string resourceName) + { + return operations.ListByManagedClusterAsync(resourceGroupName, resourceName).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of maintenance configurations in the specified managed cluster. + /// + /// + /// Gets a list of maintenance configurations in the specified managed cluster. + /// The operation returns properties of each maintenance configuration. + /// + /// + /// 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> ListByManagedClusterAsync(this IMaintenanceConfigurationsOperations operations, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByManagedClusterWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the maintenance configuration. + /// + /// + /// Gets the details of maintenance configurations by managed cluster and + /// resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// The name of the maintenance configuration. + /// + public static MaintenanceConfiguration Get(this IMaintenanceConfigurationsOperations operations, string resourceGroupName, string resourceName, string configName) + { + return operations.GetAsync(resourceGroupName, resourceName, configName).GetAwaiter().GetResult(); + } + + /// + /// Gets the maintenance configuration. + /// + /// + /// Gets the details of maintenance configurations by managed cluster and + /// resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// The name of the maintenance configuration. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IMaintenanceConfigurationsOperations operations, string resourceGroupName, string resourceName, string configName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, resourceName, configName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates a maintenance configurations. + /// + /// + /// Creates or updates a maintenance configuration in the specified managed + /// cluster. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// The name of the maintenance configuration. + /// + /// + /// Parameters supplied to the Create or Update a default maintenance + /// configuration. + /// + public static MaintenanceConfiguration CreateOrUpdate(this IMaintenanceConfigurationsOperations operations, string resourceGroupName, string resourceName, string configName, MaintenanceConfiguration parameters) + { + return operations.CreateOrUpdateAsync(resourceGroupName, resourceName, configName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a maintenance configurations. + /// + /// + /// Creates or updates a maintenance configuration in the specified managed + /// cluster. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// The name of the maintenance configuration. + /// + /// + /// Parameters supplied to the Create or Update a default maintenance + /// configuration. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IMaintenanceConfigurationsOperations operations, string resourceGroupName, string resourceName, string configName, MaintenanceConfiguration parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, resourceName, configName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a maintenance configuration. + /// + /// + /// Deletes the maintenance configuration in the specified managed cluster. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// The name of the maintenance configuration. + /// + public static void Delete(this IMaintenanceConfigurationsOperations operations, string resourceGroupName, string resourceName, string configName) + { + operations.DeleteAsync(resourceGroupName, resourceName, configName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a maintenance configuration. + /// + /// + /// Deletes the maintenance configuration in the specified managed cluster. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// The name of the maintenance configuration. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IMaintenanceConfigurationsOperations operations, string resourceGroupName, string resourceName, string configName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, resourceName, configName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets a list of maintenance configurations in the specified managed cluster. + /// + /// + /// Gets a list of maintenance configurations in the specified managed cluster. + /// The operation returns properties of each maintenance configuration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByManagedClusterNext(this IMaintenanceConfigurationsOperations operations, string nextPageLink) + { + return operations.ListByManagedClusterNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of maintenance configurations in the specified managed cluster. + /// + /// + /// Gets a list of maintenance configurations in the specified managed cluster. + /// The operation returns properties of each maintenance configuration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByManagedClusterNextAsync(this IMaintenanceConfigurationsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByManagedClusterNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} 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..645de3b469b79 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ManagedClustersOperations.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ManagedClustersOperations.cs @@ -50,6 +50,204 @@ internal ManagedClustersOperations(ContainerServiceClient client) /// public ContainerServiceClient Client { get; private set; } + /// + /// Gets supported OS options in the specified subscription. + /// + /// + /// Gets supported OS options in the specified subscription. + /// + /// + /// The name of a supported Azure region. + /// + /// + /// resource type for which the OS options 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> GetOSOptionsWithHttpMessagesAsync(string location, string resourceType = default(string), 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 (location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "location"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("location", location); + tracingParameters.Add("resourceType", resourceType); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetOSOptions", 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}/osOptions/default").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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; + } + /// /// Gets a list of managed clusters in the specified subscription. /// @@ -80,11 +278,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 +293,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 +301,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 +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) { @@ -263,6 +463,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 +482,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 +489,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 +499,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 +609,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 +664,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 +702,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 +709,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 +721,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 +895,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 +937,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 +944,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 +958,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 +1123,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 +1161,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 +1168,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 +1180,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 +1345,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 +1383,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 +1390,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 +1402,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 +1567,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 +1605,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 +1612,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 +1624,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 +1789,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 +1827,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 +1834,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 +1846,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 +2141,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 +2152,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,19 +2183,19 @@ 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); } /// - /// Creates or updates a managed cluster. + /// Run Command against Managed Kubernetes Service /// /// - /// Creates or updates a managed cluster with the specified configuration for - /// agents and Kubernetes version. + /// Submit a command to run against managed kubernetes service, it will create + /// a pod to run the command. /// /// /// The name of the resource group. @@ -1967,8 +2203,36 @@ internal ManagedClustersOperations(ContainerServiceClient client) /// /// The name of the managed cluster resource. /// - /// - /// Parameters supplied to the Create or Update a Managed Cluster operation. + /// + /// Parameters supplied to the RunCommand operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> RunCommandWithHttpMessagesAsync(string resourceGroupName, string resourceName, RunCommandRequest requestPayload, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginRunCommandWithHttpMessagesAsync(resourceGroupName, resourceName, requestPayload, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get command result. + /// + /// + /// Get command result from previous runCommand invoke. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// Id of the command request. /// /// /// Headers that will be added to request. @@ -1991,8 +2255,12 @@ internal ManagedClustersOperations(ContainerServiceClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string resourceName, ManagedCluster parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetCommandResultWithHttpMessagesAsync(string resourceGroupName, string resourceName, string commandId, 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"); @@ -2027,15 +2295,10 @@ 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 (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) + if (commandId == null) { - parameters.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "commandId"); } - string apiVersion = "2020-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2043,23 +2306,23 @@ 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); + tracingParameters.Add("commandId", commandId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetCommandResult", 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}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/commandResults/{commandId}").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("{commandId}", System.Uri.EscapeDataString(commandId)); 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) { @@ -2068,7 +2331,7 @@ internal ManagedClustersOperations(ContainerServiceClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -2099,14 +2362,8 @@ internal ManagedClustersOperations(ContainerServiceClient client) // 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) + // Set Credentials + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); @@ -2125,7 +2382,7 @@ internal ManagedClustersOperations(ContainerServiceClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -2160,7 +2417,7 @@ 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")) @@ -2173,7 +2430,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) { @@ -2185,23 +2442,1142 @@ internal ManagedClustersOperations(ContainerServiceClient client) throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a list of egress endpoints (network endpoints of all outbound + /// dependencies) in the specified managed cluster. + /// + /// + /// Gets a list of egress endpoints (network endpoints of all outbound + /// dependencies) in the specified managed cluster. The operation returns + /// properties of each egress endpoint. + /// + /// + /// 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>> ListOutboundNetworkDependenciesEndpointsWithHttpMessagesAsync(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, "ListOutboundNetworkDependenciesEndpoints", 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}/outboundNetworkDependenciesEndpoints").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 == 201) + if ((int)_statusCode == 200) { _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) + { + _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 managed cluster. + /// + /// + /// Creates or updates a managed cluster with the specified configuration for + /// agents and Kubernetes version. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// Parameters supplied to the Create or Update a 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, 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"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (resourceName != null) + { + if (resourceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceName", 63); + } + if (resourceName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceName, "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + } + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "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/managedClusters/{resourceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Updates tags on a managed cluster. + /// + /// + /// Updates a managed cluster with the specified tags. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// Resource tags. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> 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"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (resourceName != null) + { + if (resourceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceName", 63); + } + if (resourceName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceName, "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + } + } + TagsObject parameters = new TagsObject(); + if (tags != null) + { + parameters.Tags = tags; + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "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/managedClusters/{resourceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes a managed cluster. + /// + /// + /// Deletes the managed cluster with a specified resource group and name. + /// + /// + /// 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 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"); + } + 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, "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/managedClusters/{resourceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 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; + } + + /// + /// Reset Service Principal Profile of a managed cluster. + /// + /// + /// Update the service principal Profile for a managed cluster. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// Parameters supplied to the Reset Service Principal Profile operation for a + /// Managed Cluster. + /// + /// + /// 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 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"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (resourceName != null) + { + if (resourceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceName", 63); + } + if (resourceName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceName, "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + } + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginResetServicePrincipalProfile", 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}/resetServicePrincipalProfile").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 && (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); } - catch (JsonException ex) + _httpRequest.Dispose(); + if (_httpResponse != null) { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + _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) { @@ -2211,10 +3587,10 @@ internal ManagedClustersOperations(ContainerServiceClient client) } /// - /// Updates tags on a managed cluster. + /// Reset AAD Profile of a managed cluster. /// /// - /// Updates a managed cluster with the specified tags. + /// Update the AAD Profile for a managed cluster. /// /// /// The name of the resource group. @@ -2222,8 +3598,9 @@ internal ManagedClustersOperations(ContainerServiceClient client) /// /// The name of the managed cluster resource. /// - /// - /// Resource tags. + /// + /// Parameters supplied to the Reset AAD Profile operation for a Managed + /// Cluster. /// /// /// Headers that will be added to request. @@ -2234,9 +3611,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 /// @@ -2246,8 +3620,12 @@ internal ManagedClustersOperations(ContainerServiceClient client) /// /// 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)) + 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"); @@ -2282,11 +3660,9 @@ 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) + if (parameters == null) { - parameters.Tags = tags; + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -2295,23 +3671,22 @@ 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); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginResetAADProfile", 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}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile").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) + 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) { @@ -2320,7 +3695,7 @@ internal ManagedClustersOperations(ContainerServiceClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -2377,7 +3752,7 @@ internal ManagedClustersOperations(ContainerServiceClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -2412,31 +3787,13 @@ 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 == 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); @@ -2445,10 +3802,10 @@ internal ManagedClustersOperations(ContainerServiceClient client) } /// - /// Deletes a managed cluster. + /// Rotate certificates of a managed cluster. /// /// - /// Deletes the managed cluster with a specified resource group and name. + /// Rotate certificates of a managed cluster. /// /// /// The name of the resource group. @@ -2474,8 +3831,12 @@ internal ManagedClustersOperations(ContainerServiceClient client) /// /// 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)) + 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"); @@ -2510,7 +3871,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,22 +3878,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("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginRotateClusterCertificates", 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}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates").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) + 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) { @@ -2542,7 +3901,7 @@ internal ManagedClustersOperations(ContainerServiceClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -2643,10 +4002,10 @@ internal ManagedClustersOperations(ContainerServiceClient client) } /// - /// Reset Service Principal Profile of a managed cluster. + /// Stop Managed Cluster /// /// - /// Update the service principal Profile for a managed cluster. + /// Stops a Running Managed Cluster /// /// /// The name of the resource group. @@ -2654,10 +4013,6 @@ internal ManagedClustersOperations(ContainerServiceClient client) /// /// The name of the managed cluster resource. /// - /// - /// Parameters supplied to the Reset Service Principal Profile operation for a - /// Managed Cluster. - /// /// /// Headers that will be added to request. /// @@ -2676,8 +4031,12 @@ internal ManagedClustersOperations(ContainerServiceClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginResetServicePrincipalProfileWithHttpMessagesAsync(string resourceGroupName, string resourceName, ManagedClusterServicePrincipalProfile parameters, 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"); @@ -2712,15 +4071,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 (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } - string apiVersion = "2020-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2728,23 +4078,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("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginResetServicePrincipalProfile", 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}/resetServicePrincipalProfile").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)); 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) { @@ -2784,12 +4132,6 @@ internal ManagedClustersOperations(ContainerServiceClient client) // 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) { @@ -2810,7 +4152,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 @@ -2860,10 +4202,10 @@ internal ManagedClustersOperations(ContainerServiceClient client) } /// - /// Reset AAD Profile of a managed cluster. + /// Start Managed Cluster /// /// - /// Update the AAD Profile for a managed cluster. + /// Starts a Stopped Managed Cluster /// /// /// The name of the resource group. @@ -2871,10 +4213,6 @@ internal ManagedClustersOperations(ContainerServiceClient client) /// /// The name of the managed cluster resource. /// - /// - /// Parameters supplied to the Reset AAD Profile operation for a Managed - /// Cluster. - /// /// /// Headers that will be added to request. /// @@ -2893,8 +4231,12 @@ internal ManagedClustersOperations(ContainerServiceClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginResetAADProfileWithHttpMessagesAsync(string resourceGroupName, string resourceName, ManagedClusterAADProfile parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + 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"); @@ -2929,11 +4271,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 (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - string apiVersion = "2020-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2941,23 +4278,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("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginResetAADProfile", tracingParameters); + 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}/resetAADProfile").ToString(); + 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 (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) { @@ -2997,12 +4332,6 @@ internal ManagedClustersOperations(ContainerServiceClient client) // 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) { @@ -3023,7 +4352,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 @@ -3073,10 +4402,11 @@ internal ManagedClustersOperations(ContainerServiceClient client) } /// - /// Rotate certificates of a managed cluster. + /// Run Command against Managed Kubernetes Service /// /// - /// Rotate certificates of a managed cluster. + /// Submit a command to run against managed kubernetes service, it will create + /// a pod to run the command. /// /// /// The name of the resource group. @@ -3084,6 +4414,9 @@ internal ManagedClustersOperations(ContainerServiceClient client) /// /// The name of the managed cluster resource. /// + /// + /// Parameters supplied to the RunCommand operation. + /// /// /// Headers that will be added to request. /// @@ -3093,6 +4426,9 @@ 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 /// @@ -3102,8 +4438,12 @@ internal ManagedClustersOperations(ContainerServiceClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginRotateClusterCertificatesWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginRunCommandWithHttpMessagesAsync(string resourceGroupName, string resourceName, RunCommandRequest requestPayload, 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 +4478,14 @@ 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"; + if (requestPayload == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "requestPayload"); + } + if (requestPayload != null) + { + requestPayload.Validate(); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3146,22 +4493,22 @@ 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("requestPayload", requestPayload); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRotateClusterCertificates", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginRunCommand", 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}/rotateClusterCertificates").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand").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) + 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) { @@ -3201,6 +4548,12 @@ internal ManagedClustersOperations(ContainerServiceClient client) // Serialize Request string _requestContent = null; + if(requestPayload != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(requestPayload, 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) { @@ -3221,7 +4574,7 @@ internal ManagedClustersOperations(ContainerServiceClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -3256,13 +4609,31 @@ 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 == 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); @@ -3271,19 +4642,14 @@ internal ManagedClustersOperations(ContainerServiceClient client) } /// - /// Upgrade node image version of an agent pool to the latest. + /// Gets a list of managed clusters in the specified subscription. /// /// - /// Upgrade node image version of an agent pool to the latest. + /// Gets a list of managed clusters in the specified subscription. The + /// operation returns properties of each managed cluster. /// - /// - /// The name of the resource group. - /// - /// - /// The name of the managed cluster resource. - /// - /// - /// The name of the agent pool. + /// + /// The NextLink from the previous successful call to List operation. /// /// /// Headers that will be added to request. @@ -3306,47 +4672,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>> ListNextWithHttpMessagesAsync(string nextPageLink, 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 (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) + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "agentPoolName"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } - string apiVersion = "2020-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3354,25 +4685,14 @@ 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("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpgradeNodeImageVersion", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", 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)); + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); 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); @@ -3380,7 +4700,7 @@ internal ManagedClustersOperations(ContainerServiceClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -3431,7 +4751,7 @@ internal ManagedClustersOperations(ContainerServiceClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -3466,7 +4786,7 @@ 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")) @@ -3474,12 +4794,12 @@ internal ManagedClustersOperations(ContainerServiceClient client) _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response - if ((int)_statusCode == 202) + if ((int)_statusCode == 200) { _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) { @@ -3499,11 +4819,11 @@ internal ManagedClustersOperations(ContainerServiceClient client) } /// - /// Gets a list of managed clusters in the specified subscription. + /// Lists managed clusters in the specified subscription and resource group. /// /// - /// Gets a list of managed clusters in the specified subscription. The - /// operation returns properties of each managed cluster. + /// Lists managed clusters in the specified subscription and resource group. + /// The operation returns properties of each managed cluster. /// /// /// The NextLink from the previous successful call to List operation. @@ -3529,7 +4849,7 @@ internal ManagedClustersOperations(ContainerServiceClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -3544,7 +4864,7 @@ internal ManagedClustersOperations(ContainerServiceClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -3656,7 +4976,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) { @@ -3676,11 +4996,13 @@ internal ManagedClustersOperations(ContainerServiceClient client) } /// - /// Lists managed clusters in the specified subscription and resource group. + /// Gets a list of egress endpoints (network endpoints of all outbound + /// dependencies) in the specified managed cluster. /// /// - /// Lists managed clusters in the specified subscription and resource group. - /// The operation returns properties of each managed cluster. + /// Gets a list of egress endpoints (network endpoints of all outbound + /// dependencies) in the specified managed cluster. The operation returns + /// properties of each egress endpoint. /// /// /// The NextLink from the previous successful call to List operation. @@ -3706,7 +5028,7 @@ internal ManagedClustersOperations(ContainerServiceClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListOutboundNetworkDependenciesEndpointsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -3721,7 +5043,7 @@ internal ManagedClustersOperations(ContainerServiceClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListOutboundNetworkDependenciesEndpointsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -3820,7 +5142,7 @@ 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")) @@ -3833,7 +5155,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..eb05a2b5757dd 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ManagedClustersOperationsExtensions.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ManagedClustersOperationsExtensions.cs @@ -23,6 +23,52 @@ namespace Microsoft.Azure.Management.ContainerService /// public static partial class ManagedClustersOperationsExtensions { + /// + /// Gets supported OS options in the specified subscription. + /// + /// + /// Gets supported OS options in the specified subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of a supported Azure region. + /// + /// + /// resource type for which the OS options needs to be returned + /// + public static OSOptionProfile GetOSOptions(this IManagedClustersOperations operations, string location, string resourceType = default(string)) + { + return operations.GetOSOptionsAsync(location, resourceType).GetAwaiter().GetResult(); + } + + /// + /// Gets supported OS options in the specified subscription. + /// + /// + /// Gets supported OS options in the specified subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of a supported Azure region. + /// + /// + /// resource type for which the OS options needs to be returned + /// + /// + /// The cancellation token. + /// + public static async Task GetOSOptionsAsync(this IManagedClustersOperations operations, string location, string resourceType = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetOSOptionsWithHttpMessagesAsync(location, resourceType, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Gets a list of managed clusters in the specified subscription. /// @@ -702,10 +748,150 @@ public static void RotateClusterCertificates(this IManagedClustersOperations ope } /// - /// Upgrade node image version of an agent pool to the latest. + /// 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. + /// + 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 async Task StopAsync(this IManagedClustersOperations operations, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.StopWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// 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. + /// + 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 StartAsync(this IManagedClustersOperations operations, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.StartWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Run Command against Managed Kubernetes Service + /// + /// + /// Submit a command to run against managed kubernetes service, it will create + /// a pod to run the command. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// Parameters supplied to the RunCommand operation. + /// + public static RunCommandResult RunCommand(this IManagedClustersOperations operations, string resourceGroupName, string resourceName, RunCommandRequest requestPayload) + { + return operations.RunCommandAsync(resourceGroupName, resourceName, requestPayload).GetAwaiter().GetResult(); + } + + /// + /// Run Command against Managed Kubernetes Service + /// + /// + /// Submit a command to run against managed kubernetes service, it will create + /// a pod to run the command. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// Parameters supplied to the RunCommand operation. + /// + /// + /// The cancellation token. + /// + public static async Task RunCommandAsync(this IManagedClustersOperations operations, string resourceGroupName, string resourceName, RunCommandRequest requestPayload, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.RunCommandWithHttpMessagesAsync(resourceGroupName, resourceName, requestPayload, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get command result. /// /// - /// Upgrade node image version of an agent pool to the latest. + /// Get command result from previous runCommand invoke. /// /// /// The operations group for this extension method. @@ -716,19 +902,19 @@ public static void RotateClusterCertificates(this IManagedClustersOperations ope /// /// The name of the managed cluster resource. /// - /// - /// The name of the agent pool. + /// + /// Id of the command request. /// - public static AgentPool UpgradeNodeImageVersion(this IManagedClustersOperations operations, string resourceGroupName, string resourceName, string agentPoolName) + public static RunCommandResult GetCommandResult(this IManagedClustersOperations operations, string resourceGroupName, string resourceName, string commandId) { - return operations.UpgradeNodeImageVersionAsync(resourceGroupName, resourceName, agentPoolName).GetAwaiter().GetResult(); + return operations.GetCommandResultAsync(resourceGroupName, resourceName, commandId).GetAwaiter().GetResult(); } /// - /// Upgrade node image version of an agent pool to the latest. + /// Get command result. /// /// - /// Upgrade node image version of an agent pool to the latest. + /// Get command result from previous runCommand invoke. /// /// /// The operations group for this extension method. @@ -739,15 +925,67 @@ public static AgentPool UpgradeNodeImageVersion(this IManagedClustersOperations /// /// The name of the managed cluster resource. /// - /// - /// The name of the agent pool. + /// + /// Id of the command request. /// /// /// 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 GetCommandResultAsync(this IManagedClustersOperations operations, string resourceGroupName, string resourceName, string commandId, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.UpgradeNodeImageVersionWithHttpMessagesAsync(resourceGroupName, resourceName, agentPoolName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetCommandResultWithHttpMessagesAsync(resourceGroupName, resourceName, commandId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a list of egress endpoints (network endpoints of all outbound + /// dependencies) in the specified managed cluster. + /// + /// + /// Gets a list of egress endpoints (network endpoints of all outbound + /// dependencies) in the specified managed cluster. The operation returns + /// properties of each egress endpoint. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + public static IPage ListOutboundNetworkDependenciesEndpoints(this IManagedClustersOperations operations, string resourceGroupName, string resourceName) + { + return operations.ListOutboundNetworkDependenciesEndpointsAsync(resourceGroupName, resourceName).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of egress endpoints (network endpoints of all outbound + /// dependencies) in the specified managed cluster. + /// + /// + /// Gets a list of egress endpoints (network endpoints of all outbound + /// dependencies) in the specified managed cluster. The operation returns + /// properties of each egress endpoint. + /// + /// + /// 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> ListOutboundNetworkDependenciesEndpointsAsync(this IManagedClustersOperations operations, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListOutboundNetworkDependenciesEndpointsWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -1048,10 +1286,97 @@ public static void BeginRotateClusterCertificates(this IManagedClustersOperation } /// - /// Upgrade node image version of an agent pool to the latest. + /// 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. + /// + 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 async Task BeginStopAsync(this IManagedClustersOperations operations, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginStopWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// 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. + /// + 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 BeginStartAsync(this IManagedClustersOperations operations, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginStartWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Run Command against Managed Kubernetes Service /// /// - /// Upgrade node image version of an agent pool to the latest. + /// Submit a command to run against managed kubernetes service, it will create + /// a pod to run the command. /// /// /// The operations group for this extension method. @@ -1062,19 +1387,20 @@ public static void BeginRotateClusterCertificates(this IManagedClustersOperation /// /// The name of the managed cluster resource. /// - /// - /// The name of the agent pool. + /// + /// Parameters supplied to the RunCommand operation. /// - public static AgentPool BeginUpgradeNodeImageVersion(this IManagedClustersOperations operations, string resourceGroupName, string resourceName, string agentPoolName) + public static RunCommandResult BeginRunCommand(this IManagedClustersOperations operations, string resourceGroupName, string resourceName, RunCommandRequest requestPayload) { - return operations.BeginUpgradeNodeImageVersionAsync(resourceGroupName, resourceName, agentPoolName).GetAwaiter().GetResult(); + return operations.BeginRunCommandAsync(resourceGroupName, resourceName, requestPayload).GetAwaiter().GetResult(); } /// - /// Upgrade node image version of an agent pool to the latest. + /// Run Command against Managed Kubernetes Service /// /// - /// Upgrade node image version of an agent pool to the latest. + /// Submit a command to run against managed kubernetes service, it will create + /// a pod to run the command. /// /// /// The operations group for this extension method. @@ -1085,15 +1411,15 @@ public static AgentPool BeginUpgradeNodeImageVersion(this IManagedClustersOperat /// /// The name of the managed cluster resource. /// - /// - /// The name of the agent pool. + /// + /// Parameters supplied to the RunCommand operation. /// /// /// 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 BeginRunCommandAsync(this IManagedClustersOperations operations, string resourceGroupName, string resourceName, RunCommandRequest requestPayload, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginUpgradeNodeImageVersionWithHttpMessagesAsync(resourceGroupName, resourceName, agentPoolName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginRunCommandWithHttpMessagesAsync(resourceGroupName, resourceName, requestPayload, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -1183,5 +1509,51 @@ public static IPage ListByResourceGroupNext(this IManagedCluster } } + /// + /// Gets a list of egress endpoints (network endpoints of all outbound + /// dependencies) in the specified managed cluster. + /// + /// + /// Gets a list of egress endpoints (network endpoints of all outbound + /// dependencies) in the specified managed cluster. The operation returns + /// properties of each egress endpoint. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListOutboundNetworkDependenciesEndpointsNext(this IManagedClustersOperations operations, string nextPageLink) + { + return operations.ListOutboundNetworkDependenciesEndpointsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of egress endpoints (network endpoints of all outbound + /// dependencies) in the specified managed cluster. + /// + /// + /// Gets a list of egress endpoints (network endpoints of all outbound + /// dependencies) in the specified managed cluster. The operation returns + /// properties of each egress endpoint. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListOutboundNetworkDependenciesEndpointsNextAsync(this IManagedClustersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListOutboundNetworkDependenciesEndpointsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } } diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPool.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPool.cs index 6fa595e91f0c7..374816d9f19d0 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 @@ -40,75 +40,38 @@ public AgentPool() /// resource. /// Resource type /// Number of agents (VMs) to host docker - /// containers. Allowed values must be in the range of 0 to 100 - /// (inclusive) for user pools and in the range of 1 to 100 (inclusive) - /// for system pools. The default value is 1. - /// 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' + /// containers. Allowed values must be in the range of 0 to 1000 + /// (inclusive) for user pools and in the range of 1 to 1000 + /// (inclusive) for system pools. The default value is 1. + /// Size of agent VMs. /// 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. + /// OS disk type to be used for machines in a + /// given agent pool. Allowed values are 'Ephemeral' and 'Managed'. If + /// unspecified, defaults to 'Ephemeral' when the VM supports ephemeral + /// OS and has a cache disk larger than the requested OSDiskSizeGB. + /// Otherwise, defaults to 'Managed'. May not be changed after + /// creation. Possible values include: 'Managed', 'Ephemeral' + /// KubeletDiskType determines the + /// placement of emptyDir volumes, container runtime data root, and + /// Kubelet ephemeral storage. Currently allows one value, OS, + /// resulting in Kubelet using the OS disk for data. Possible values + /// include: 'OS', 'Temporary' /// VNet SubnetID specifies the VNet's - /// subnet identifier. + /// subnet identifier for nodes and maybe pods + /// Pod SubnetID specifies the VNet's subnet + /// identifier for pods. /// Maximum number of pods that can run on a /// node. /// OsType to be used to specify os type. Choose /// from Linux and Windows. Default to Linux. Possible values include: /// 'Linux', 'Windows' + /// OsSKU to be used to specify os sku. Choose from + /// Ubuntu(default) and CBLMariner for Linux OSType. Not applicable to + /// Windows OSType. Possible values include: 'Ubuntu', + /// 'CBLMariner' /// Maximum number of nodes for /// auto-scaling /// Minimum number of nodes for @@ -127,9 +90,13 @@ 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 + /// Public IP Prefix ID. VM nodes + /// use IPs assigned from this Public IP Prefix. /// ScaleSetPriority to be used to /// specify virtual machine scale set priority. Default to regular. /// Possible values include: 'Spot', 'Regular' @@ -149,15 +116,31 @@ 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)) + /// KubeletConfig specifies the + /// configuration of kubelet on agent nodes. + /// LinuxOSConfig specifies the OS + /// configuration of linux agent nodes. + /// Whether to enable + /// EncryptionAtHost + /// Whether to enable UltraSSD + /// Whether to use FIPS enabled OS + /// GPUInstanceProfile to be used to + /// specify GPU MIG instance profile for supported GPU VM SKU. + /// Supported values are MIG1g, MIG2g, MIG3g, MIG4g and MIG7g. Possible + /// values include: 'MIG1g', 'MIG2g', 'MIG3g', 'MIG4g', 'MIG7g' + public AgentPool(string id = default(string), string name = default(string), string type = default(string), int? count = default(int?), string vmSize = default(string), int? osDiskSizeGB = default(int?), string osDiskType = default(string), string kubeletDiskType = default(string), string vnetSubnetID = default(string), string podSubnetID = default(string), int? maxPods = default(int?), string osType = default(string), string osSKU = default(string), int? maxCount = default(int?), int? minCount = default(int?), bool? enableAutoScaling = default(bool?), string agentPoolType = default(string), string mode = default(string), string orchestratorVersion = default(string), string nodeImageVersion = default(string), AgentPoolUpgradeSettings upgradeSettings = default(AgentPoolUpgradeSettings), string provisioningState = default(string), PowerState powerState = default(PowerState), IList availabilityZones = default(IList), bool? enableNodePublicIP = default(bool?), string nodePublicIPPrefixID = default(string), string scaleSetPriority = default(string), string scaleSetEvictionPolicy = default(string), double? spotMaxPrice = default(double?), IDictionary tags = default(IDictionary), IDictionary nodeLabels = default(IDictionary), IList nodeTaints = default(IList), string proximityPlacementGroupID = default(string), KubeletConfig kubeletConfig = default(KubeletConfig), LinuxOSConfig linuxOSConfig = default(LinuxOSConfig), bool? enableEncryptionAtHost = default(bool?), bool? enableUltraSSD = default(bool?), bool? enableFIPS = default(bool?), string gpuInstanceProfile = default(string)) : base(id, name, type) { Count = count; VmSize = vmSize; OsDiskSizeGB = osDiskSizeGB; + OsDiskType = osDiskType; + KubeletDiskType = kubeletDiskType; VnetSubnetID = vnetSubnetID; + PodSubnetID = podSubnetID; MaxPods = maxPods; OsType = osType; + OsSKU = osSKU; MaxCount = maxCount; MinCount = minCount; EnableAutoScaling = enableAutoScaling; @@ -167,8 +150,10 @@ public AgentPool() NodeImageVersion = nodeImageVersion; UpgradeSettings = upgradeSettings; ProvisioningState = provisioningState; + PowerState = powerState; AvailabilityZones = availabilityZones; EnableNodePublicIP = enableNodePublicIP; + NodePublicIPPrefixID = nodePublicIPPrefixID; ScaleSetPriority = scaleSetPriority; ScaleSetEvictionPolicy = scaleSetEvictionPolicy; SpotMaxPrice = spotMaxPrice; @@ -176,6 +161,12 @@ public AgentPool() NodeLabels = nodeLabels; NodeTaints = nodeTaints; ProximityPlacementGroupID = proximityPlacementGroupID; + KubeletConfig = kubeletConfig; + LinuxOSConfig = linuxOSConfig; + EnableEncryptionAtHost = enableEncryptionAtHost; + EnableUltraSSD = enableUltraSSD; + EnableFIPS = enableFIPS; + GpuInstanceProfile = gpuInstanceProfile; CustomInit(); } @@ -186,69 +177,15 @@ public AgentPool() /// /// Gets or sets number of agents (VMs) to host docker containers. - /// Allowed values must be in the range of 0 to 100 (inclusive) for - /// user pools and in the range of 1 to 100 (inclusive) for system + /// Allowed values must be in the range of 0 to 1000 (inclusive) for + /// user pools and in the range of 1 to 1000 (inclusive) for system /// pools. The default value is 1. /// [JsonProperty(PropertyName = "properties.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' + /// Gets or sets size of agent VMs. /// [JsonProperty(PropertyName = "properties.vmSize")] public string VmSize { get; set; } @@ -263,11 +200,39 @@ public AgentPool() public int? OsDiskSizeGB { get; set; } /// - /// Gets or sets vNet SubnetID specifies the VNet's subnet identifier. + /// Gets or sets OS disk type to be used for machines in a given agent + /// pool. Allowed values are 'Ephemeral' and 'Managed'. If unspecified, + /// defaults to 'Ephemeral' when the VM supports ephemeral OS and has a + /// cache disk larger than the requested OSDiskSizeGB. Otherwise, + /// 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 kubeletDiskType determines the placement of emptyDir + /// volumes, container runtime data root, and Kubelet ephemeral + /// storage. Currently allows one value, OS, resulting in Kubelet using + /// the OS disk for data. Possible values include: 'OS', 'Temporary' + /// + [JsonProperty(PropertyName = "properties.kubeletDiskType")] + public string KubeletDiskType { get; set; } + + /// + /// Gets or sets vNet SubnetID specifies the VNet's subnet identifier + /// for nodes and maybe pods /// [JsonProperty(PropertyName = "properties.vnetSubnetID")] public string VnetSubnetID { get; set; } + /// + /// Gets or sets pod SubnetID specifies the VNet's subnet identifier + /// for pods. + /// + [JsonProperty(PropertyName = "properties.podSubnetID")] + public string PodSubnetID { get; set; } + /// /// Gets or sets maximum number of pods that can run on a node. /// @@ -282,6 +247,14 @@ public AgentPool() [JsonProperty(PropertyName = "properties.osType")] public string OsType { get; set; } + /// + /// Gets or sets osSKU to be used to specify os sku. Choose from + /// Ubuntu(default) and CBLMariner for Linux OSType. Not applicable to + /// Windows OSType. Possible values include: 'Ubuntu', 'CBLMariner' + /// + [JsonProperty(PropertyName = "properties.osSKU")] + public string OsSKU { get; set; } + /// /// Gets or sets maximum number of nodes for auto-scaling /// @@ -341,6 +314,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. @@ -354,6 +333,13 @@ public AgentPool() [JsonProperty(PropertyName = "properties.enableNodePublicIP")] public bool? EnableNodePublicIP { get; set; } + /// + /// Gets or sets public IP Prefix ID. VM nodes use IPs assigned from + /// this Public IP Prefix. + /// + [JsonProperty(PropertyName = "properties.nodePublicIPPrefixID")] + public string NodePublicIPPrefixID { get; set; } + /// /// Gets or sets scaleSetPriority to be used to specify virtual machine /// scale set priority. Default to regular. Possible values include: @@ -406,5 +392,59 @@ public AgentPool() [JsonProperty(PropertyName = "properties.proximityPlacementGroupID")] public string ProximityPlacementGroupID { get; set; } + /// + /// Gets or sets kubeletConfig specifies the configuration of kubelet + /// on agent nodes. + /// + [JsonProperty(PropertyName = "properties.kubeletConfig")] + public KubeletConfig KubeletConfig { get; set; } + + /// + /// Gets or sets linuxOSConfig specifies the OS configuration of linux + /// agent nodes. + /// + [JsonProperty(PropertyName = "properties.linuxOSConfig")] + public LinuxOSConfig LinuxOSConfig { get; set; } + + /// + /// Gets or sets whether to enable EncryptionAtHost + /// + [JsonProperty(PropertyName = "properties.enableEncryptionAtHost")] + public bool? EnableEncryptionAtHost { get; set; } + + /// + /// Gets or sets whether to enable UltraSSD + /// + [JsonProperty(PropertyName = "properties.enableUltraSSD")] + public bool? EnableUltraSSD { get; set; } + + /// + /// Gets or sets whether to use FIPS enabled OS + /// + [JsonProperty(PropertyName = "properties.enableFIPS")] + public bool? EnableFIPS { get; set; } + + /// + /// Gets or sets gPUInstanceProfile to be used to specify GPU MIG + /// instance profile for supported GPU VM SKU. Supported values are + /// MIG1g, MIG2g, MIG3g, MIG4g and MIG7g. Possible values include: + /// 'MIG1g', 'MIG2g', 'MIG3g', 'MIG4g', 'MIG7g' + /// + [JsonProperty(PropertyName = "properties.gpuInstanceProfile")] + public string GpuInstanceProfile { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (KubeletConfig != null) + { + KubeletConfig.Validate(); + } + } } } 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/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/CreatedByType.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/CreatedByType.cs index 5df4eeee76414..640ae38ab17ea 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ContainerServiceOrchestratorTypes.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/CreatedByType.cs @@ -12,14 +12,13 @@ namespace Microsoft.Azure.Management.ContainerService.Models { /// - /// Defines values for ContainerServiceOrchestratorTypes. + /// Defines values for CreatedByType. /// - public static class ContainerServiceOrchestratorTypes + public static class CreatedByType { - 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 User = "User"; + public const string Application = "Application"; + public const string ManagedIdentity = "ManagedIdentity"; + public const string Key = "Key"; } } diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/EndpointDependency.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/EndpointDependency.cs new file mode 100644 index 0000000000000..9671184faefdd --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/EndpointDependency.cs @@ -0,0 +1,63 @@ +// +// 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 domain name that AKS agent nodes are reaching at. + /// + public partial class EndpointDependency + { + /// + /// Initializes a new instance of the EndpointDependency class. + /// + public EndpointDependency() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the EndpointDependency class. + /// + /// The domain name of the dependency. + /// The Ports and Protocols used when + /// connecting to domainName. + public EndpointDependency(string domainName = default(string), IList endpointDetails = default(IList)) + { + DomainName = domainName; + EndpointDetails = endpointDetails; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the domain name of the dependency. + /// + [JsonProperty(PropertyName = "domainName")] + public string DomainName { get; set; } + + /// + /// Gets or sets the Ports and Protocols used when connecting to + /// domainName. + /// + [JsonProperty(PropertyName = "endpointDetails")] + public IList EndpointDetails { get; set; } + + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/EndpointDetail.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/EndpointDetail.cs new file mode 100644 index 0000000000000..0af07b5d2feb9 --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/EndpointDetail.cs @@ -0,0 +1,76 @@ +// +// 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; + + /// + /// connect information from the AKS agent nodes to a single endpoint. + /// + public partial class EndpointDetail + { + /// + /// Initializes a new instance of the EndpointDetail class. + /// + public EndpointDetail() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the EndpointDetail class. + /// + /// An IP Address that Domain Name currently + /// resolves to. + /// The port an endpoint is connected to. + /// The protocol used for connection + /// Description of the detail + public EndpointDetail(string ipAddress = default(string), int? port = default(int?), string protocol = default(string), string description = default(string)) + { + IpAddress = ipAddress; + Port = port; + Protocol = protocol; + Description = description; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets an IP Address that Domain Name currently resolves to. + /// + [JsonProperty(PropertyName = "ipAddress")] + public string IpAddress { get; set; } + + /// + /// Gets or sets the port an endpoint is connected to. + /// + [JsonProperty(PropertyName = "port")] + public int? Port { get; set; } + + /// + /// Gets or sets the protocol used for connection + /// + [JsonProperty(PropertyName = "protocol")] + public string Protocol { get; set; } + + /// + /// Gets or sets description of the detail + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/Expander.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/Expander.cs new file mode 100644 index 0000000000000..45956be653a7b --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/Expander.cs @@ -0,0 +1,24 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.ContainerService.Models +{ + + /// + /// Defines values for Expander. + /// + public static class Expander + { + public const string LeastWaste = "least-waste"; + public const string MostPods = "most-pods"; + public const string Priority = "priority"; + public const string Random = "random"; + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OpenShiftManagedClusterIdentityProvider.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ExtendedLocation.cs similarity index 51% rename from sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OpenShiftManagedClusterIdentityProvider.cs rename to sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ExtendedLocation.cs index de17e44dd57ca..e07ba84fad18a 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OpenShiftManagedClusterIdentityProvider.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ExtendedLocation.cs @@ -14,30 +14,28 @@ namespace Microsoft.Azure.Management.ContainerService.Models using System.Linq; /// - /// Defines the configuration of the identity providers to be used in the - /// OpenShift cluster. + /// The complex type of the extended location. /// - public partial class OpenShiftManagedClusterIdentityProvider + public partial class ExtendedLocation { /// - /// Initializes a new instance of the - /// OpenShiftManagedClusterIdentityProvider class. + /// Initializes a new instance of the ExtendedLocation class. /// - public OpenShiftManagedClusterIdentityProvider() + public ExtendedLocation() { CustomInit(); } /// - /// Initializes a new instance of the - /// OpenShiftManagedClusterIdentityProvider class. + /// Initializes a new instance of the ExtendedLocation class. /// - /// Name of the provider. - /// Configuration of the provider. - public OpenShiftManagedClusterIdentityProvider(string name = default(string), OpenShiftManagedClusterBaseIdentityProvider provider = default(OpenShiftManagedClusterBaseIdentityProvider)) + /// The name of the extended location. + /// The type of the extended location. Possible + /// values include: 'EdgeZone' + public ExtendedLocation(string name = default(string), string type = default(string)) { Name = name; - Provider = provider; + Type = type; CustomInit(); } @@ -47,16 +45,17 @@ public OpenShiftManagedClusterIdentityProvider() partial void CustomInit(); /// - /// Gets or sets name of the provider. + /// Gets or sets the name of the extended location. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// Gets or sets configuration of the provider. + /// Gets or sets the type of the extended location. Possible values + /// include: 'EdgeZone' /// - [JsonProperty(PropertyName = "provider")] - public OpenShiftManagedClusterBaseIdentityProvider Provider { get; set; } + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } } } diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ExtendedLocationTypes.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ExtendedLocationTypes.cs new file mode 100644 index 0000000000000..e46ac4f66b97b --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ExtendedLocationTypes.cs @@ -0,0 +1,21 @@ +// +// 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 ExtendedLocationTypes. + /// + public static class ExtendedLocationTypes + { + public const string EdgeZone = "EdgeZone"; + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/GPUInstanceProfile.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/GPUInstanceProfile.cs new file mode 100644 index 0000000000000..1b9f50bdc5f08 --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/GPUInstanceProfile.cs @@ -0,0 +1,25 @@ +// +// 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 GPUInstanceProfile. + /// + public static class GPUInstanceProfile + { + public const string MIG1g = "MIG1g"; + public const string MIG2g = "MIG2g"; + public const string MIG3g = "MIG3g"; + public const string MIG4g = "MIG4g"; + public const string MIG7g = "MIG7g"; + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/KubeletConfig.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/KubeletConfig.cs new file mode 100644 index 0000000000000..bf4ba82aeecb3 --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/KubeletConfig.cs @@ -0,0 +1,165 @@ +// +// 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; + + /// + /// Kubelet configurations of agent nodes. + /// + public partial class KubeletConfig + { + /// + /// Initializes a new instance of the KubeletConfig class. + /// + public KubeletConfig() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the KubeletConfig class. + /// + /// CPU Manager policy to use. + /// Enable CPU CFS quota enforcement for + /// containers that specify CPU limits. + /// Sets CPU CFS quota period + /// value. + /// The percent of disk usage after + /// which image garbage collection is always run. + /// The percent of disk usage before + /// which image garbage collection is never run. + /// Topology Manager policy to + /// use. + /// Allowlist of unsafe sysctls or + /// unsafe sysctl patterns (ending in `*`). + /// If set to true it will make the Kubelet + /// fail to start if swap is enabled on the node. + /// The maximum size (e.g. 10Mi) of + /// container log file before it is rotated. + /// The maximum number of container + /// log files that can be present for a container. The number must be ≥ + /// 2. + /// The maximum number of processes per + /// pod. + public KubeletConfig(string cpuManagerPolicy = default(string), bool? cpuCfsQuota = default(bool?), string cpuCfsQuotaPeriod = default(string), int? imageGcHighThreshold = default(int?), int? imageGcLowThreshold = default(int?), string topologyManagerPolicy = default(string), IList allowedUnsafeSysctls = default(IList), bool? failSwapOn = default(bool?), int? containerLogMaxSizeMB = default(int?), int? containerLogMaxFiles = default(int?), int? podMaxPids = default(int?)) + { + CpuManagerPolicy = cpuManagerPolicy; + CpuCfsQuota = cpuCfsQuota; + CpuCfsQuotaPeriod = cpuCfsQuotaPeriod; + ImageGcHighThreshold = imageGcHighThreshold; + ImageGcLowThreshold = imageGcLowThreshold; + TopologyManagerPolicy = topologyManagerPolicy; + AllowedUnsafeSysctls = allowedUnsafeSysctls; + FailSwapOn = failSwapOn; + ContainerLogMaxSizeMB = containerLogMaxSizeMB; + ContainerLogMaxFiles = containerLogMaxFiles; + PodMaxPids = podMaxPids; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets CPU Manager policy to use. + /// + [JsonProperty(PropertyName = "cpuManagerPolicy")] + public string CpuManagerPolicy { get; set; } + + /// + /// Gets or sets enable CPU CFS quota enforcement for containers that + /// specify CPU limits. + /// + [JsonProperty(PropertyName = "cpuCfsQuota")] + public bool? CpuCfsQuota { get; set; } + + /// + /// Gets or sets sets CPU CFS quota period value. + /// + [JsonProperty(PropertyName = "cpuCfsQuotaPeriod")] + public string CpuCfsQuotaPeriod { get; set; } + + /// + /// Gets or sets the percent of disk usage after which image garbage + /// collection is always run. + /// + [JsonProperty(PropertyName = "imageGcHighThreshold")] + public int? ImageGcHighThreshold { get; set; } + + /// + /// Gets or sets the percent of disk usage before which image garbage + /// collection is never run. + /// + [JsonProperty(PropertyName = "imageGcLowThreshold")] + public int? ImageGcLowThreshold { get; set; } + + /// + /// Gets or sets topology Manager policy to use. + /// + [JsonProperty(PropertyName = "topologyManagerPolicy")] + public string TopologyManagerPolicy { get; set; } + + /// + /// Gets or sets allowlist of unsafe sysctls or unsafe sysctl patterns + /// (ending in `*`). + /// + [JsonProperty(PropertyName = "allowedUnsafeSysctls")] + public IList AllowedUnsafeSysctls { get; set; } + + /// + /// Gets or sets if set to true it will make the Kubelet fail to start + /// if swap is enabled on the node. + /// + [JsonProperty(PropertyName = "failSwapOn")] + public bool? FailSwapOn { get; set; } + + /// + /// Gets or sets the maximum size (e.g. 10Mi) of container log file + /// before it is rotated. + /// + [JsonProperty(PropertyName = "containerLogMaxSizeMB")] + public int? ContainerLogMaxSizeMB { get; set; } + + /// + /// Gets or sets the maximum number of container log files that can be + /// present for a container. The number must be ≥ 2. + /// + [JsonProperty(PropertyName = "containerLogMaxFiles")] + public int? ContainerLogMaxFiles { get; set; } + + /// + /// Gets or sets the maximum number of processes per pod. + /// + [JsonProperty(PropertyName = "podMaxPids")] + public int? PodMaxPids { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ContainerLogMaxFiles < 2) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "ContainerLogMaxFiles", 2); + } + } + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/KubeletDiskType.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/KubeletDiskType.cs new file mode 100644 index 0000000000000..cc58b14b73ce2 --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/KubeletDiskType.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 KubeletDiskType. + /// + public static class KubeletDiskType + { + public const string OS = "OS"; + public const string Temporary = "Temporary"; + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/LinuxOSConfig.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/LinuxOSConfig.cs new file mode 100644 index 0000000000000..39130f4f96f90 --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/LinuxOSConfig.cs @@ -0,0 +1,80 @@ +// +// 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; + + /// + /// OS configurations of Linux agent nodes. + /// + public partial class LinuxOSConfig + { + /// + /// Initializes a new instance of the LinuxOSConfig class. + /// + public LinuxOSConfig() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LinuxOSConfig class. + /// + /// Sysctl settings for Linux agent + /// nodes. + /// Transparent Huge Page + /// enabled configuration. + /// Transparent Huge Page + /// defrag configuration. + /// SwapFileSizeMB specifies size in MB of + /// a swap file will be created on each node. + public LinuxOSConfig(SysctlConfig sysctls = default(SysctlConfig), string transparentHugePageEnabled = default(string), string transparentHugePageDefrag = default(string), int? swapFileSizeMB = default(int?)) + { + Sysctls = sysctls; + TransparentHugePageEnabled = transparentHugePageEnabled; + TransparentHugePageDefrag = transparentHugePageDefrag; + SwapFileSizeMB = swapFileSizeMB; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets sysctl settings for Linux agent nodes. + /// + [JsonProperty(PropertyName = "sysctls")] + public SysctlConfig Sysctls { get; set; } + + /// + /// Gets or sets transparent Huge Page enabled configuration. + /// + [JsonProperty(PropertyName = "transparentHugePageEnabled")] + public string TransparentHugePageEnabled { get; set; } + + /// + /// Gets or sets transparent Huge Page defrag configuration. + /// + [JsonProperty(PropertyName = "transparentHugePageDefrag")] + public string TransparentHugePageDefrag { get; set; } + + /// + /// Gets or sets swapFileSizeMB specifies size in MB of a swap file + /// will be created on each node. + /// + [JsonProperty(PropertyName = "swapFileSizeMB")] + public int? SwapFileSizeMB { get; set; } + + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/MaintenanceConfiguration.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/MaintenanceConfiguration.cs new file mode 100644 index 0000000000000..9b9513b0fc4b6 --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/MaintenanceConfiguration.cs @@ -0,0 +1,81 @@ +// +// 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; + + /// + /// maintenance configuration. + /// + [Rest.Serialization.JsonTransformation] + public partial class MaintenanceConfiguration : SubResource + { + /// + /// Initializes a new instance of the MaintenanceConfiguration class. + /// + public MaintenanceConfiguration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MaintenanceConfiguration class. + /// + /// Resource ID. + /// The name of the resource that is unique within a + /// resource group. This name can be used to access the + /// resource. + /// Resource type + /// The system meta data relating to this + /// resource. + /// Weekday time slots allowed to + /// upgrade. + /// Time slots on which upgrade is not + /// allowed. + public MaintenanceConfiguration(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), IList timeInWeek = default(IList), IList notAllowedTime = default(IList)) + : base(id, name, type) + { + SystemData = systemData; + TimeInWeek = timeInWeek; + NotAllowedTime = notAllowedTime; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the system meta data relating to this resource. + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + + /// + /// Gets or sets weekday time slots allowed to upgrade. + /// + [JsonProperty(PropertyName = "properties.timeInWeek")] + public IList TimeInWeek { get; set; } + + /// + /// Gets or sets time slots on which upgrade is not allowed. + /// + [JsonProperty(PropertyName = "properties.notAllowedTime")] + public IList NotAllowedTime { get; set; } + + } +} 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..03c983bc97aa9 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,14 +41,20 @@ 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 /// when creating the managed cluster. /// DNS prefix specified when creating the /// managed cluster. + /// FQDN subdomain specified when creating + /// private cluster with custom private dns zone. /// FQDN for the master pool. /// FQDN of private cluster. + /// FQDN for the master pool which used + /// by proxy config. /// Properties of the agent /// pool. /// Profile for Linux VMs in the container @@ -60,6 +66,8 @@ public ManagedCluster() /// APIs. /// Profile of managed cluster /// add-on. + /// Profile of managed cluster pod + /// identity. /// Name of the resource group /// containing agent pool nodes. /// Whether to enable Kubernetes Role-Based @@ -72,6 +80,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 @@ -80,34 +90,52 @@ public ManagedCluster() /// set to use for enabling encryption at rest. /// Identities associated with the /// cluster. + /// Private link resources + /// associated with the cluster. + /// If set to true, getting static + /// credential will be disabled for this cluster. Expected to only be + /// used for AAD clusters. + /// Configurations for provisioning the + /// cluster with HTTP proxy servers. /// 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)) + /// The extended location of the Virtual + /// Machine. + 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 fqdnSubdomain = default(string), string fqdn = default(string), string privateFQDN = default(string), string azurePortalFQDN = default(string), IList agentPoolProfiles = default(IList), ContainerServiceLinuxProfile linuxProfile = default(ContainerServiceLinuxProfile), ManagedClusterWindowsProfile windowsProfile = default(ManagedClusterWindowsProfile), ManagedClusterServicePrincipalProfile servicePrincipalProfile = default(ManagedClusterServicePrincipalProfile), IDictionary addonProfiles = default(IDictionary), ManagedClusterPodIdentityProfile podIdentityProfile = default(ManagedClusterPodIdentityProfile), string nodeResourceGroup = default(string), bool? enableRBAC = default(bool?), bool? enablePodSecurityPolicy = default(bool?), ContainerServiceNetworkProfile networkProfile = default(ContainerServiceNetworkProfile), ManagedClusterAADProfile aadProfile = default(ManagedClusterAADProfile), ManagedClusterAutoUpgradeProfile autoUpgradeProfile = default(ManagedClusterAutoUpgradeProfile), ManagedClusterPropertiesAutoScalerProfile autoScalerProfile = default(ManagedClusterPropertiesAutoScalerProfile), ManagedClusterAPIServerAccessProfile apiServerAccessProfile = default(ManagedClusterAPIServerAccessProfile), string diskEncryptionSetID = default(string), IDictionary identityProfile = default(IDictionary), IList privateLinkResources = default(IList), bool? disableLocalAccounts = default(bool?), ManagedClusterHTTPProxyConfig httpProxyConfig = default(ManagedClusterHTTPProxyConfig), ManagedClusterIdentity identity = default(ManagedClusterIdentity), ManagedClusterSKU sku = default(ManagedClusterSKU), ExtendedLocation extendedLocation = default(ExtendedLocation)) : base(location, id, name, type, tags) { ProvisioningState = provisioningState; + PowerState = powerState; MaxAgentPools = maxAgentPools; KubernetesVersion = kubernetesVersion; DnsPrefix = dnsPrefix; + FqdnSubdomain = fqdnSubdomain; Fqdn = fqdn; PrivateFQDN = privateFQDN; + AzurePortalFQDN = azurePortalFQDN; AgentPoolProfiles = agentPoolProfiles; LinuxProfile = linuxProfile; WindowsProfile = windowsProfile; ServicePrincipalProfile = servicePrincipalProfile; AddonProfiles = addonProfiles; + PodIdentityProfile = podIdentityProfile; NodeResourceGroup = nodeResourceGroup; EnableRBAC = enableRBAC; EnablePodSecurityPolicy = enablePodSecurityPolicy; NetworkProfile = networkProfile; AadProfile = aadProfile; + AutoUpgradeProfile = autoUpgradeProfile; AutoScalerProfile = autoScalerProfile; ApiServerAccessProfile = apiServerAccessProfile; DiskEncryptionSetID = diskEncryptionSetID; IdentityProfile = identityProfile; + PrivateLinkResources = privateLinkResources; + DisableLocalAccounts = disableLocalAccounts; + HttpProxyConfig = httpProxyConfig; Identity = identity; Sku = sku; + ExtendedLocation = extendedLocation; CustomInit(); } @@ -123,6 +151,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. /// @@ -143,6 +177,13 @@ public ManagedCluster() [JsonProperty(PropertyName = "properties.dnsPrefix")] public string DnsPrefix { get; set; } + /// + /// Gets or sets FQDN subdomain specified when creating private cluster + /// with custom private dns zone. + /// + [JsonProperty(PropertyName = "properties.fqdnSubdomain")] + public string FqdnSubdomain { get; set; } + /// /// Gets FQDN for the master pool. /// @@ -155,6 +196,12 @@ public ManagedCluster() [JsonProperty(PropertyName = "properties.privateFQDN")] public string PrivateFQDN { get; private set; } + /// + /// Gets FQDN for the master pool which used by proxy config. + /// + [JsonProperty(PropertyName = "properties.azurePortalFQDN")] + public string AzurePortalFQDN { get; private set; } + /// /// Gets or sets properties of the agent pool. /// @@ -188,6 +235,12 @@ public ManagedCluster() [JsonProperty(PropertyName = "properties.addonProfiles")] public IDictionary AddonProfiles { get; set; } + /// + /// Gets or sets profile of managed cluster pod identity. + /// + [JsonProperty(PropertyName = "properties.podIdentityProfile")] + public ManagedClusterPodIdentityProfile PodIdentityProfile { get; set; } + /// /// Gets or sets name of the resource group containing agent pool /// nodes. @@ -222,6 +275,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 @@ -248,6 +307,27 @@ public ManagedCluster() [JsonProperty(PropertyName = "properties.identityProfile")] public IDictionary IdentityProfile { get; set; } + /// + /// Gets or sets private link resources associated with the cluster. + /// + [JsonProperty(PropertyName = "properties.privateLinkResources")] + public IList PrivateLinkResources { get; set; } + + /// + /// Gets or sets if set to true, getting static credential will be + /// disabled for this cluster. Expected to only be used for AAD + /// clusters. + /// + [JsonProperty(PropertyName = "properties.disableLocalAccounts")] + public bool? DisableLocalAccounts { get; set; } + + /// + /// Gets or sets configurations for provisioning the cluster with HTTP + /// proxy servers. + /// + [JsonProperty(PropertyName = "properties.httpProxyConfig")] + public ManagedClusterHTTPProxyConfig HttpProxyConfig { get; set; } + /// /// Gets or sets the identity of the managed cluster, if configured. /// @@ -260,6 +340,12 @@ public ManagedCluster() [JsonProperty(PropertyName = "sku")] public ManagedClusterSKU Sku { get; set; } + /// + /// Gets or sets the extended location of the Virtual Machine. + /// + [JsonProperty(PropertyName = "extendedLocation")] + public ExtendedLocation ExtendedLocation { get; set; } + /// /// Validate the object. /// diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAPIServerAccessProfile.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAPIServerAccessProfile.cs index a950f33365d19..e8899793da894 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAPIServerAccessProfile.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAPIServerAccessProfile.cs @@ -37,10 +37,16 @@ public ManagedClusterAPIServerAccessProfile() /// API server. /// Whether to create the cluster as /// a private cluster or not. - public ManagedClusterAPIServerAccessProfile(IList authorizedIPRanges = default(IList), bool? enablePrivateCluster = default(bool?)) + /// Private dns zone mode for private + /// cluster. + /// Whether to create + /// additional public FQDN for private cluster or not. + public ManagedClusterAPIServerAccessProfile(IList authorizedIPRanges = default(IList), bool? enablePrivateCluster = default(bool?), string privateDNSZone = default(string), bool? enablePrivateClusterPublicFQDN = default(bool?)) { AuthorizedIPRanges = authorizedIPRanges; EnablePrivateCluster = enablePrivateCluster; + PrivateDNSZone = privateDNSZone; + EnablePrivateClusterPublicFQDN = enablePrivateClusterPublicFQDN; CustomInit(); } @@ -62,5 +68,18 @@ public ManagedClusterAPIServerAccessProfile() [JsonProperty(PropertyName = "enablePrivateCluster")] public bool? EnablePrivateCluster { get; set; } + /// + /// Gets or sets private dns zone mode for private cluster. + /// + [JsonProperty(PropertyName = "privateDNSZone")] + public string PrivateDNSZone { get; set; } + + /// + /// Gets or sets whether to create additional public FQDN for private + /// cluster or not. + /// + [JsonProperty(PropertyName = "enablePrivateClusterPublicFQDN")] + public bool? EnablePrivateClusterPublicFQDN { get; set; } + } } diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.cs index fe1f89d386bc8..514666e6f7366 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 @@ -37,75 +37,38 @@ public ManagedClusterAgentPoolProfile() /// Unique name of the agent pool profile in the /// context of the subscription and resource group. /// Number of agents (VMs) to host docker - /// containers. Allowed values must be in the range of 0 to 100 - /// (inclusive) for user pools and in the range of 1 to 100 (inclusive) - /// for system pools. The default value is 1. - /// 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' + /// containers. Allowed values must be in the range of 0 to 1000 + /// (inclusive) for user pools and in the range of 1 to 1000 + /// (inclusive) for system pools. The default value is 1. + /// Size of agent VMs. /// 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. + /// OS disk type to be used for machines in a + /// given agent pool. Allowed values are 'Ephemeral' and 'Managed'. If + /// unspecified, defaults to 'Ephemeral' when the VM supports ephemeral + /// OS and has a cache disk larger than the requested OSDiskSizeGB. + /// Otherwise, defaults to 'Managed'. May not be changed after + /// creation. Possible values include: 'Managed', 'Ephemeral' + /// KubeletDiskType determines the + /// placement of emptyDir volumes, container runtime data root, and + /// Kubelet ephemeral storage. Currently allows one value, OS, + /// resulting in Kubelet using the OS disk for data. Possible values + /// include: 'OS', 'Temporary' /// VNet SubnetID specifies the VNet's - /// subnet identifier. + /// subnet identifier for nodes and maybe pods + /// Pod SubnetID specifies the VNet's subnet + /// identifier for pods. /// Maximum number of pods that can run on a /// node. /// OsType to be used to specify os type. Choose /// from Linux and Windows. Default to Linux. Possible values include: /// 'Linux', 'Windows' + /// OsSKU to be used to specify os sku. Choose from + /// Ubuntu(default) and CBLMariner for Linux OSType. Not applicable to + /// Windows OSType. Possible values include: 'Ubuntu', + /// 'CBLMariner' /// Maximum number of nodes for /// auto-scaling /// Minimum number of nodes for @@ -124,9 +87,13 @@ 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 + /// Public IP Prefix ID. VM nodes + /// use IPs assigned from this Public IP Prefix. /// ScaleSetPriority to be used to /// specify virtual machine scale set priority. Default to regular. /// Possible values include: 'Spot', 'Regular' @@ -146,8 +113,20 @@ 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) + /// KubeletConfig specifies the + /// configuration of kubelet on agent nodes. + /// LinuxOSConfig specifies the OS + /// configuration of linux agent nodes. + /// Whether to enable + /// EncryptionAtHost + /// Whether to enable UltraSSD + /// Whether to use FIPS enabled OS + /// GPUInstanceProfile to be used to + /// specify GPU MIG instance profile for supported GPU VM SKU. + /// Supported values are MIG1g, MIG2g, MIG3g, MIG4g and MIG7g. Possible + /// values include: 'MIG1g', 'MIG2g', 'MIG3g', 'MIG4g', 'MIG7g' + public ManagedClusterAgentPoolProfile(string name, int? count = default(int?), string vmSize = default(string), int? osDiskSizeGB = default(int?), string osDiskType = default(string), string kubeletDiskType = default(string), string vnetSubnetID = default(string), string podSubnetID = default(string), int? maxPods = default(int?), string osType = default(string), string osSKU = default(string), int? maxCount = default(int?), int? minCount = default(int?), bool? enableAutoScaling = default(bool?), string type = default(string), string mode = default(string), string orchestratorVersion = default(string), string nodeImageVersion = default(string), AgentPoolUpgradeSettings upgradeSettings = default(AgentPoolUpgradeSettings), string provisioningState = default(string), PowerState powerState = default(PowerState), IList availabilityZones = default(IList), bool? enableNodePublicIP = default(bool?), string nodePublicIPPrefixID = default(string), string scaleSetPriority = default(string), string scaleSetEvictionPolicy = default(string), double? spotMaxPrice = default(double?), IDictionary tags = default(IDictionary), IDictionary nodeLabels = default(IDictionary), IList nodeTaints = default(IList), string proximityPlacementGroupID = default(string), KubeletConfig kubeletConfig = default(KubeletConfig), LinuxOSConfig linuxOSConfig = default(LinuxOSConfig), bool? enableEncryptionAtHost = default(bool?), bool? enableUltraSSD = default(bool?), bool? enableFIPS = default(bool?), string gpuInstanceProfile = default(string)) + : base(count, vmSize, osDiskSizeGB, osDiskType, kubeletDiskType, vnetSubnetID, podSubnetID, maxPods, osType, osSKU, maxCount, minCount, enableAutoScaling, type, mode, orchestratorVersion, nodeImageVersion, upgradeSettings, provisioningState, powerState, availabilityZones, enableNodePublicIP, nodePublicIPPrefixID, scaleSetPriority, scaleSetEvictionPolicy, spotMaxPrice, tags, nodeLabels, nodeTaints, proximityPlacementGroupID, kubeletConfig, linuxOSConfig, enableEncryptionAtHost, enableUltraSSD, enableFIPS, gpuInstanceProfile) { Name = name; CustomInit(); @@ -171,8 +150,9 @@ public ManagedClusterAgentPoolProfile() /// /// Thrown if validation fails /// - public virtual void Validate() + public override void Validate() { + base.Validate(); if (Name == null) { throw new ValidationException(ValidationRules.CannotBeNull, "Name"); 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..eee7330aab380 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 @@ -34,75 +34,38 @@ public ManagedClusterAgentPoolProfileProperties() /// ManagedClusterAgentPoolProfileProperties class. /// /// Number of agents (VMs) to host docker - /// containers. Allowed values must be in the range of 0 to 100 - /// (inclusive) for user pools and in the range of 1 to 100 (inclusive) - /// for system pools. The default value is 1. - /// 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' + /// containers. Allowed values must be in the range of 0 to 1000 + /// (inclusive) for user pools and in the range of 1 to 1000 + /// (inclusive) for system pools. The default value is 1. + /// Size of agent VMs. /// 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. + /// OS disk type to be used for machines in a + /// given agent pool. Allowed values are 'Ephemeral' and 'Managed'. If + /// unspecified, defaults to 'Ephemeral' when the VM supports ephemeral + /// OS and has a cache disk larger than the requested OSDiskSizeGB. + /// Otherwise, defaults to 'Managed'. May not be changed after + /// creation. Possible values include: 'Managed', 'Ephemeral' + /// KubeletDiskType determines the + /// placement of emptyDir volumes, container runtime data root, and + /// Kubelet ephemeral storage. Currently allows one value, OS, + /// resulting in Kubelet using the OS disk for data. Possible values + /// include: 'OS', 'Temporary' /// VNet SubnetID specifies the VNet's - /// subnet identifier. + /// subnet identifier for nodes and maybe pods + /// Pod SubnetID specifies the VNet's subnet + /// identifier for pods. /// Maximum number of pods that can run on a /// node. /// OsType to be used to specify os type. Choose /// from Linux and Windows. Default to Linux. Possible values include: /// 'Linux', 'Windows' + /// OsSKU to be used to specify os sku. Choose from + /// Ubuntu(default) and CBLMariner for Linux OSType. Not applicable to + /// Windows OSType. Possible values include: 'Ubuntu', + /// 'CBLMariner' /// Maximum number of nodes for /// auto-scaling /// Minimum number of nodes for @@ -121,9 +84,13 @@ 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 + /// Public IP Prefix ID. VM nodes + /// use IPs assigned from this Public IP Prefix. /// ScaleSetPriority to be used to /// specify virtual machine scale set priority. Default to regular. /// Possible values include: 'Spot', 'Regular' @@ -143,14 +110,30 @@ 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)) + /// KubeletConfig specifies the + /// configuration of kubelet on agent nodes. + /// LinuxOSConfig specifies the OS + /// configuration of linux agent nodes. + /// Whether to enable + /// EncryptionAtHost + /// Whether to enable UltraSSD + /// Whether to use FIPS enabled OS + /// GPUInstanceProfile to be used to + /// specify GPU MIG instance profile for supported GPU VM SKU. + /// Supported values are MIG1g, MIG2g, MIG3g, MIG4g and MIG7g. Possible + /// values include: 'MIG1g', 'MIG2g', 'MIG3g', 'MIG4g', 'MIG7g' + public ManagedClusterAgentPoolProfileProperties(int? count = default(int?), string vmSize = default(string), int? osDiskSizeGB = default(int?), string osDiskType = default(string), string kubeletDiskType = default(string), string vnetSubnetID = default(string), string podSubnetID = default(string), int? maxPods = default(int?), string osType = default(string), string osSKU = default(string), int? maxCount = default(int?), int? minCount = default(int?), bool? enableAutoScaling = default(bool?), string type = default(string), string mode = default(string), string orchestratorVersion = default(string), string nodeImageVersion = default(string), AgentPoolUpgradeSettings upgradeSettings = default(AgentPoolUpgradeSettings), string provisioningState = default(string), PowerState powerState = default(PowerState), IList availabilityZones = default(IList), bool? enableNodePublicIP = default(bool?), string nodePublicIPPrefixID = default(string), string scaleSetPriority = default(string), string scaleSetEvictionPolicy = default(string), double? spotMaxPrice = default(double?), IDictionary tags = default(IDictionary), IDictionary nodeLabels = default(IDictionary), IList nodeTaints = default(IList), string proximityPlacementGroupID = default(string), KubeletConfig kubeletConfig = default(KubeletConfig), LinuxOSConfig linuxOSConfig = default(LinuxOSConfig), bool? enableEncryptionAtHost = default(bool?), bool? enableUltraSSD = default(bool?), bool? enableFIPS = default(bool?), string gpuInstanceProfile = default(string)) { Count = count; VmSize = vmSize; OsDiskSizeGB = osDiskSizeGB; + OsDiskType = osDiskType; + KubeletDiskType = kubeletDiskType; VnetSubnetID = vnetSubnetID; + PodSubnetID = podSubnetID; MaxPods = maxPods; OsType = osType; + OsSKU = osSKU; MaxCount = maxCount; MinCount = minCount; EnableAutoScaling = enableAutoScaling; @@ -160,8 +143,10 @@ public ManagedClusterAgentPoolProfileProperties() NodeImageVersion = nodeImageVersion; UpgradeSettings = upgradeSettings; ProvisioningState = provisioningState; + PowerState = powerState; AvailabilityZones = availabilityZones; EnableNodePublicIP = enableNodePublicIP; + NodePublicIPPrefixID = nodePublicIPPrefixID; ScaleSetPriority = scaleSetPriority; ScaleSetEvictionPolicy = scaleSetEvictionPolicy; SpotMaxPrice = spotMaxPrice; @@ -169,6 +154,12 @@ public ManagedClusterAgentPoolProfileProperties() NodeLabels = nodeLabels; NodeTaints = nodeTaints; ProximityPlacementGroupID = proximityPlacementGroupID; + KubeletConfig = kubeletConfig; + LinuxOSConfig = linuxOSConfig; + EnableEncryptionAtHost = enableEncryptionAtHost; + EnableUltraSSD = enableUltraSSD; + EnableFIPS = enableFIPS; + GpuInstanceProfile = gpuInstanceProfile; CustomInit(); } @@ -179,69 +170,15 @@ public ManagedClusterAgentPoolProfileProperties() /// /// Gets or sets number of agents (VMs) to host docker containers. - /// Allowed values must be in the range of 0 to 100 (inclusive) for - /// user pools and in the range of 1 to 100 (inclusive) for system + /// Allowed values must be in the range of 0 to 1000 (inclusive) for + /// user pools and in the range of 1 to 1000 (inclusive) for system /// pools. The default value is 1. /// [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' + /// Gets or sets size of agent VMs. /// [JsonProperty(PropertyName = "vmSize")] public string VmSize { get; set; } @@ -256,11 +193,39 @@ public ManagedClusterAgentPoolProfileProperties() public int? OsDiskSizeGB { get; set; } /// - /// Gets or sets vNet SubnetID specifies the VNet's subnet identifier. + /// Gets or sets OS disk type to be used for machines in a given agent + /// pool. Allowed values are 'Ephemeral' and 'Managed'. If unspecified, + /// defaults to 'Ephemeral' when the VM supports ephemeral OS and has a + /// cache disk larger than the requested OSDiskSizeGB. Otherwise, + /// 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 kubeletDiskType determines the placement of emptyDir + /// volumes, container runtime data root, and Kubelet ephemeral + /// storage. Currently allows one value, OS, resulting in Kubelet using + /// the OS disk for data. Possible values include: 'OS', 'Temporary' + /// + [JsonProperty(PropertyName = "kubeletDiskType")] + public string KubeletDiskType { get; set; } + + /// + /// Gets or sets vNet SubnetID specifies the VNet's subnet identifier + /// for nodes and maybe pods /// [JsonProperty(PropertyName = "vnetSubnetID")] public string VnetSubnetID { get; set; } + /// + /// Gets or sets pod SubnetID specifies the VNet's subnet identifier + /// for pods. + /// + [JsonProperty(PropertyName = "podSubnetID")] + public string PodSubnetID { get; set; } + /// /// Gets or sets maximum number of pods that can run on a node. /// @@ -275,6 +240,14 @@ public ManagedClusterAgentPoolProfileProperties() [JsonProperty(PropertyName = "osType")] public string OsType { get; set; } + /// + /// Gets or sets osSKU to be used to specify os sku. Choose from + /// Ubuntu(default) and CBLMariner for Linux OSType. Not applicable to + /// Windows OSType. Possible values include: 'Ubuntu', 'CBLMariner' + /// + [JsonProperty(PropertyName = "osSKU")] + public string OsSKU { get; set; } + /// /// Gets or sets maximum number of nodes for auto-scaling /// @@ -334,6 +307,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. @@ -347,6 +326,13 @@ public ManagedClusterAgentPoolProfileProperties() [JsonProperty(PropertyName = "enableNodePublicIP")] public bool? EnableNodePublicIP { get; set; } + /// + /// Gets or sets public IP Prefix ID. VM nodes use IPs assigned from + /// this Public IP Prefix. + /// + [JsonProperty(PropertyName = "nodePublicIPPrefixID")] + public string NodePublicIPPrefixID { get; set; } + /// /// Gets or sets scaleSetPriority to be used to specify virtual machine /// scale set priority. Default to regular. Possible values include: @@ -399,5 +385,59 @@ public ManagedClusterAgentPoolProfileProperties() [JsonProperty(PropertyName = "proximityPlacementGroupID")] public string ProximityPlacementGroupID { get; set; } + /// + /// Gets or sets kubeletConfig specifies the configuration of kubelet + /// on agent nodes. + /// + [JsonProperty(PropertyName = "kubeletConfig")] + public KubeletConfig KubeletConfig { get; set; } + + /// + /// Gets or sets linuxOSConfig specifies the OS configuration of linux + /// agent nodes. + /// + [JsonProperty(PropertyName = "linuxOSConfig")] + public LinuxOSConfig LinuxOSConfig { get; set; } + + /// + /// Gets or sets whether to enable EncryptionAtHost + /// + [JsonProperty(PropertyName = "enableEncryptionAtHost")] + public bool? EnableEncryptionAtHost { get; set; } + + /// + /// Gets or sets whether to enable UltraSSD + /// + [JsonProperty(PropertyName = "enableUltraSSD")] + public bool? EnableUltraSSD { get; set; } + + /// + /// Gets or sets whether to use FIPS enabled OS + /// + [JsonProperty(PropertyName = "enableFIPS")] + public bool? EnableFIPS { get; set; } + + /// + /// Gets or sets gPUInstanceProfile to be used to specify GPU MIG + /// instance profile for supported GPU VM SKU. Supported values are + /// MIG1g, MIG2g, MIG3g, MIG4g and MIG7g. Possible values include: + /// 'MIG1g', 'MIG2g', 'MIG3g', 'MIG4g', 'MIG7g' + /// + [JsonProperty(PropertyName = "gpuInstanceProfile")] + public string GpuInstanceProfile { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (KubeletConfig != null) + { + KubeletConfig.Validate(); + } + } } } 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..ab1acbb822a66 --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAutoUpgradeProfile.cs @@ -0,0 +1,56 @@ +// +// 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', 'node-image', + /// 'none' + 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', 'node-image', 'none' + /// + [JsonProperty(PropertyName = "upgradeChannel")] + public string UpgradeChannel { get; set; } + + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterHTTPProxyConfig.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterHTTPProxyConfig.cs new file mode 100644 index 0000000000000..bc275f6c6eff1 --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterHTTPProxyConfig.cs @@ -0,0 +1,83 @@ +// +// 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; + + /// + /// Configurations for provisioning the cluster with HTTP proxy servers. + /// + public partial class ManagedClusterHTTPProxyConfig + { + /// + /// Initializes a new instance of the ManagedClusterHTTPProxyConfig + /// class. + /// + public ManagedClusterHTTPProxyConfig() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ManagedClusterHTTPProxyConfig + /// class. + /// + /// HTTP proxy server endpoint to use. + /// HTTPS proxy server endpoint to + /// use. + /// Endpoints that should not go through + /// proxy. + /// Alternative CA cert to use for connecting + /// to proxy servers. + public ManagedClusterHTTPProxyConfig(string httpProxy = default(string), string httpsProxy = default(string), IList noProxy = default(IList), string trustedCa = default(string)) + { + HttpProxy = httpProxy; + HttpsProxy = httpsProxy; + NoProxy = noProxy; + TrustedCa = trustedCa; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets HTTP proxy server endpoint to use. + /// + [JsonProperty(PropertyName = "httpProxy")] + public string HttpProxy { get; set; } + + /// + /// Gets or sets HTTPS proxy server endpoint to use. + /// + [JsonProperty(PropertyName = "httpsProxy")] + public string HttpsProxy { get; set; } + + /// + /// Gets or sets endpoints that should not go through proxy. + /// + [JsonProperty(PropertyName = "noProxy")] + public IList NoProxy { get; set; } + + /// + /// Gets or sets alternative CA cert to use for connecting to proxy + /// servers. + /// + [JsonProperty(PropertyName = "trustedCa")] + public string TrustedCa { get; set; } + + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterPodIdentity.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterPodIdentity.cs new file mode 100644 index 0000000000000..96c4aec10f75f --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterPodIdentity.cs @@ -0,0 +1,115 @@ +// +// 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; + + public partial class ManagedClusterPodIdentity + { + /// + /// Initializes a new instance of the ManagedClusterPodIdentity class. + /// + public ManagedClusterPodIdentity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ManagedClusterPodIdentity class. + /// + /// Name of the pod identity. + /// Namespace of the pod + /// identity. + /// Information of the user assigned + /// identity. + /// Binding selector to use for the + /// AzureIdentityBinding resource. + /// The current provisioning state of + /// the pod identity. Possible values include: 'Assigned', 'Updating', + /// 'Deleting', 'Failed' + public ManagedClusterPodIdentity(string name, string namespaceProperty, UserAssignedIdentity identity, string bindingSelector = default(string), string provisioningState = default(string), ManagedClusterPodIdentityProvisioningInfo provisioningInfo = default(ManagedClusterPodIdentityProvisioningInfo)) + { + Name = name; + NamespaceProperty = namespaceProperty; + BindingSelector = bindingSelector; + Identity = identity; + ProvisioningState = provisioningState; + ProvisioningInfo = provisioningInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of the pod identity. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets namespace of the pod identity. + /// + [JsonProperty(PropertyName = "namespace")] + public string NamespaceProperty { get; set; } + + /// + /// Gets or sets binding selector to use for the AzureIdentityBinding + /// resource. + /// + [JsonProperty(PropertyName = "bindingSelector")] + public string BindingSelector { get; set; } + + /// + /// Gets or sets information of the user assigned identity. + /// + [JsonProperty(PropertyName = "identity")] + public UserAssignedIdentity Identity { get; set; } + + /// + /// Gets the current provisioning state of the pod identity. Possible + /// values include: 'Assigned', 'Updating', 'Deleting', 'Failed' + /// + [JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "provisioningInfo")] + public ManagedClusterPodIdentityProvisioningInfo ProvisioningInfo { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + } + if (NamespaceProperty == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "NamespaceProperty"); + } + if (Identity == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Identity"); + } + } + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterPodIdentityException.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterPodIdentityException.cs new file mode 100644 index 0000000000000..e5e4fa42981db --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterPodIdentityException.cs @@ -0,0 +1,91 @@ +// +// 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; + + public partial class ManagedClusterPodIdentityException + { + /// + /// Initializes a new instance of the + /// ManagedClusterPodIdentityException class. + /// + public ManagedClusterPodIdentityException() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ManagedClusterPodIdentityException class. + /// + /// Name of the pod identity exception. + /// Namespace of the pod identity + /// exception. + /// Pod labels to match. + public ManagedClusterPodIdentityException(string name, string namespaceProperty, IDictionary podLabels) + { + Name = name; + NamespaceProperty = namespaceProperty; + PodLabels = podLabels; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of the pod identity exception. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets namespace of the pod identity exception. + /// + [JsonProperty(PropertyName = "namespace")] + public string NamespaceProperty { get; set; } + + /// + /// Gets or sets pod labels to match. + /// + [JsonProperty(PropertyName = "podLabels")] + public IDictionary PodLabels { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + } + if (NamespaceProperty == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "NamespaceProperty"); + } + if (PodLabels == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "PodLabels"); + } + } + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProfile.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProfile.cs new file mode 100644 index 0000000000000..1be250791f5d8 --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProfile.cs @@ -0,0 +1,82 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.ContainerService.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class ManagedClusterPodIdentityProfile + { + /// + /// Initializes a new instance of the ManagedClusterPodIdentityProfile + /// class. + /// + public ManagedClusterPodIdentityProfile() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ManagedClusterPodIdentityProfile + /// class. + /// + /// Whether the pod identity addon is + /// enabled. + /// Customer consent for + /// enabling AAD pod identity addon in cluster using Kubenet network + /// plugin. + /// User assigned pod identity + /// settings. + /// User assigned pod + /// identity exception settings. + public ManagedClusterPodIdentityProfile(bool? enabled = default(bool?), bool? allowNetworkPluginKubenet = default(bool?), IList userAssignedIdentities = default(IList), IList userAssignedIdentityExceptions = default(IList)) + { + Enabled = enabled; + AllowNetworkPluginKubenet = allowNetworkPluginKubenet; + UserAssignedIdentities = userAssignedIdentities; + UserAssignedIdentityExceptions = userAssignedIdentityExceptions; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets whether the pod identity addon is enabled. + /// + [JsonProperty(PropertyName = "enabled")] + public bool? Enabled { get; set; } + + /// + /// Gets or sets customer consent for enabling AAD pod identity addon + /// in cluster using Kubenet network plugin. + /// + [JsonProperty(PropertyName = "allowNetworkPluginKubenet")] + public bool? AllowNetworkPluginKubenet { get; set; } + + /// + /// Gets or sets user assigned pod identity settings. + /// + [JsonProperty(PropertyName = "userAssignedIdentities")] + public IList UserAssignedIdentities { get; set; } + + /// + /// Gets or sets user assigned pod identity exception settings. + /// + [JsonProperty(PropertyName = "userAssignedIdentityExceptions")] + public IList UserAssignedIdentityExceptions { get; set; } + + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProvisioningInfo.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProvisioningInfo.cs new file mode 100644 index 0000000000000..ef8c4e6081991 --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProvisioningInfo.cs @@ -0,0 +1,50 @@ +// +// 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; + + public partial class ManagedClusterPodIdentityProvisioningInfo + { + /// + /// Initializes a new instance of the + /// ManagedClusterPodIdentityProvisioningInfo class. + /// + public ManagedClusterPodIdentityProvisioningInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ManagedClusterPodIdentityProvisioningInfo class. + /// + /// Pod identity assignment error (if any). + public ManagedClusterPodIdentityProvisioningInfo(CloudError error = default(CloudError)) + { + Error = error; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets pod identity assignment error (if any). + /// + [JsonProperty(PropertyName = "error")] + public CloudError Error { get; set; } + + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProvisioningState.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProvisioningState.cs new file mode 100644 index 0000000000000..fce2cbf097061 --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProvisioningState.cs @@ -0,0 +1,24 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.ContainerService.Models +{ + + /// + /// Defines values for ManagedClusterPodIdentityProvisioningState. + /// + public static class ManagedClusterPodIdentityProvisioningState + { + public const string Assigned = "Assigned"; + public const string Updating = "Updating"; + public const string Deleting = "Deleting"; + public const string Failed = "Failed"; + } +} 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..61ae6f6a20f6f 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,18 @@ 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', 'priority', 'random' + public ManagedClusterPropertiesAutoScalerProfile(string balanceSimilarNodeGroups = default(string), string expander = default(string), string maxEmptyBulkDelete = default(string), string maxGracefulTerminationSec = default(string), string maxNodeProvisionTime = 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; + MaxNodeProvisionTime = maxNodeProvisionTime; + MaxTotalUnreadyPercentage = maxTotalUnreadyPercentage; + NewPodScaleUpDelay = newPodScaleUpDelay; + OkTotalUnreadyCount = okTotalUnreadyCount; ScanInterval = scanInterval; ScaleDownDelayAfterAdd = scaleDownDelayAfterAdd; ScaleDownDelayAfterDelete = scaleDownDelayAfterDelete; @@ -41,7 +50,8 @@ public ManagedClusterPropertiesAutoScalerProfile() ScaleDownUnneededTime = scaleDownUnneededTime; ScaleDownUnreadyTime = scaleDownUnreadyTime; ScaleDownUtilizationThreshold = scaleDownUtilizationThreshold; - MaxGracefulTerminationSec = maxGracefulTerminationSec; + SkipNodesWithLocalStorage = skipNodesWithLocalStorage; + SkipNodesWithSystemPods = skipNodesWithSystemPods; CustomInit(); } @@ -55,6 +65,43 @@ public ManagedClusterPropertiesAutoScalerProfile() [JsonProperty(PropertyName = "balance-similar-node-groups")] public string BalanceSimilarNodeGroups { get; set; } + /// + /// Gets or sets possible values include: 'least-waste', 'most-pods', + /// 'priority', '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-node-provision-time")] + public string MaxNodeProvisionTime { 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 +139,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/ManagedClusterWindowsProfile.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterWindowsProfile.cs index 9855f66a76830..03fe067357658 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterWindowsProfile.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterWindowsProfile.cs @@ -32,19 +32,37 @@ public ManagedClusterWindowsProfile() /// Initializes a new instance of the ManagedClusterWindowsProfile /// class. /// - /// The administrator username to use for - /// Windows VMs. - /// The administrator password to use for - /// Windows VMs. + /// Specifies the name of the administrator + /// account. <br><br> **restriction:** Cannot end in "." + /// <br><br> **Disallowed values:** "administrator", + /// "admin", "user", "user1", "test", "user2", "test1", "user3", + /// "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", + /// "backup", "console", "david", "guest", "john", "owner", "root", + /// "server", "sql", "support", "support_388945a0", "sys", "test2", + /// "test3", "user4", "user5". <br><br> **Minimum-length:** + /// 1 character <br><br> **Max-length:** 20 + /// characters + /// Specifies the password of the + /// administrator account. <br><br> **Minimum-length:** 8 + /// characters <br><br> **Max-length:** 123 characters + /// <br><br> **Complexity requirements:** 3 out of 4 + /// conditions below need to be fulfilled <br> Has lower + /// characters <br>Has upper characters <br> Has a digit + /// <br> Has a special character (Regex match [\W_]) + /// <br><br> **Disallowed values:** "abc@123", "P@$$w0rd", + /// "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", + /// "Password1", "Password22", "iloveyou!" /// The licenseType to use for Windows VMs. /// Windows_Server is used to enable Azure Hybrid User Benefits for /// Windows VMs. Possible values include: 'None', /// 'Windows_Server' - public ManagedClusterWindowsProfile(string adminUsername, string adminPassword = default(string), string licenseType = default(string)) + /// Whether to enable CSI proxy. + public ManagedClusterWindowsProfile(string adminUsername, string adminPassword = default(string), string licenseType = default(string), bool? enableCSIProxy = default(bool?)) { AdminUsername = adminUsername; AdminPassword = adminPassword; LicenseType = licenseType; + EnableCSIProxy = enableCSIProxy; CustomInit(); } @@ -54,13 +72,33 @@ public ManagedClusterWindowsProfile() partial void CustomInit(); /// - /// Gets or sets the administrator username to use for Windows VMs. + /// Gets or sets specifies the name of the administrator account. + /// &lt;br&gt;&lt;br&gt; **restriction:** Cannot end in + /// "." &lt;br&gt;&lt;br&gt; **Disallowed values:** + /// "administrator", "admin", "user", "user1", "test", "user2", + /// "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", + /// "admin2", "aspnet", "backup", "console", "david", "guest", "john", + /// "owner", "root", "server", "sql", "support", "support_388945a0", + /// "sys", "test2", "test3", "user4", "user5". + /// &lt;br&gt;&lt;br&gt; **Minimum-length:** 1 + /// character &lt;br&gt;&lt;br&gt; **Max-length:** 20 + /// characters /// [JsonProperty(PropertyName = "adminUsername")] public string AdminUsername { get; set; } /// - /// Gets or sets the administrator password to use for Windows VMs. + /// Gets or sets specifies the password of the administrator account. + /// &lt;br&gt;&lt;br&gt; **Minimum-length:** 8 + /// characters &lt;br&gt;&lt;br&gt; **Max-length:** 123 + /// characters &lt;br&gt;&lt;br&gt; **Complexity + /// requirements:** 3 out of 4 conditions below need to be fulfilled + /// &lt;br&gt; Has lower characters &lt;br&gt;Has upper + /// characters &lt;br&gt; Has a digit &lt;br&gt; Has a + /// special character (Regex match [\W_]) + /// &lt;br&gt;&lt;br&gt; **Disallowed values:** + /// "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", + /// "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" /// [JsonProperty(PropertyName = "adminPassword")] public string AdminPassword { get; set; } @@ -73,6 +111,12 @@ public ManagedClusterWindowsProfile() [JsonProperty(PropertyName = "licenseType")] public string LicenseType { get; set; } + /// + /// Gets or sets whether to enable CSI proxy. + /// + [JsonProperty(PropertyName = "enableCSIProxy")] + public bool? EnableCSIProxy { get; set; } + /// /// Validate the object. /// @@ -85,20 +129,6 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.CannotBeNull, "AdminUsername"); } - 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/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/OrchestratorVersionProfileListResult.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OSOptionProfile.cs similarity index 56% rename from sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OrchestratorVersionProfileListResult.cs rename to sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OSOptionProfile.cs index 1b6b79cb525c4..6dea645214c56 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OrchestratorVersionProfileListResult.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OSOptionProfile.cs @@ -18,38 +18,33 @@ namespace Microsoft.Azure.Management.ContainerService.Models using System.Linq; /// - /// The list of versions for supported orchestrators. + /// The OS option profile. /// [Rest.Serialization.JsonTransformation] - public partial class OrchestratorVersionProfileListResult + public partial class OSOptionProfile { /// - /// Initializes a new instance of the - /// OrchestratorVersionProfileListResult class. + /// Initializes a new instance of the OSOptionProfile class. /// - public OrchestratorVersionProfileListResult() + public OSOptionProfile() { CustomInit(); } /// - /// Initializes a new instance of the - /// OrchestratorVersionProfileListResult class. + /// Initializes a new instance of the OSOptionProfile 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)) + /// The list of OS option + /// properties. + /// Id of the OS option profile. + /// Name of the OS option profile. + /// Type of the OS option profile. + public OSOptionProfile(IList osOptionPropertyList, string id = default(string), string name = default(string), string type = default(string)) { Id = id; Name = name; Type = type; - Orchestrators = orchestrators; + OsOptionPropertyList = osOptionPropertyList; CustomInit(); } @@ -59,28 +54,28 @@ public OrchestratorVersionProfileListResult() partial void CustomInit(); /// - /// Gets id of the orchestrator version profile list result. + /// Gets id of the OS option profile. /// [JsonProperty(PropertyName = "id")] public string Id { get; private set; } /// - /// Gets name of the orchestrator version profile list result. + /// Gets name of the OS option profile. /// [JsonProperty(PropertyName = "name")] public string Name { get; private set; } /// - /// Gets type of the orchestrator version profile list result. + /// Gets type of the OS option profile. /// [JsonProperty(PropertyName = "type")] public string Type { get; private set; } /// - /// Gets or sets list of orchestrator version profiles. + /// Gets or sets the list of OS option properties. /// - [JsonProperty(PropertyName = "properties.orchestrators")] - public IList Orchestrators { get; set; } + [JsonProperty(PropertyName = "properties.osOptionPropertyList")] + public IList OsOptionPropertyList { get; set; } /// /// Validate the object. @@ -90,13 +85,13 @@ public OrchestratorVersionProfileListResult() /// public virtual void Validate() { - if (Orchestrators == null) + if (OsOptionPropertyList == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Orchestrators"); + throw new ValidationException(ValidationRules.CannotBeNull, "OsOptionPropertyList"); } - if (Orchestrators != null) + if (OsOptionPropertyList != null) { - foreach (var element in Orchestrators) + foreach (var element in OsOptionPropertyList) { if (element != null) { diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ContainerServiceCustomProfile.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OSOptionProperty.cs similarity index 58% rename from sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ContainerServiceCustomProfile.cs rename to sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OSOptionProperty.cs index e93206ba780ba..cf2515a88224c 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ContainerServiceCustomProfile.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OSOptionProperty.cs @@ -15,28 +15,28 @@ namespace Microsoft.Azure.Management.ContainerService.Models using System.Linq; /// - /// Properties to configure a custom container service cluster. + /// OS option property. /// - public partial class ContainerServiceCustomProfile + public partial class OSOptionProperty { /// - /// Initializes a new instance of the ContainerServiceCustomProfile - /// class. + /// Initializes a new instance of the OSOptionProperty class. /// - public ContainerServiceCustomProfile() + public OSOptionProperty() { CustomInit(); } /// - /// Initializes a new instance of the ContainerServiceCustomProfile - /// class. + /// Initializes a new instance of the OSOptionProperty class. /// - /// The name of the custom orchestrator to - /// use. - public ContainerServiceCustomProfile(string orchestrator) + /// OS type. + /// Whether FIPS image is + /// enabled. + public OSOptionProperty(string osType, bool enableFipsImage) { - Orchestrator = orchestrator; + OsType = osType; + EnableFipsImage = enableFipsImage; CustomInit(); } @@ -46,10 +46,16 @@ public ContainerServiceCustomProfile(string orchestrator) partial void CustomInit(); /// - /// Gets or sets the name of the custom orchestrator to use. + /// Gets or sets OS type. /// - [JsonProperty(PropertyName = "orchestrator")] - public string Orchestrator { get; set; } + [JsonProperty(PropertyName = "os-type")] + public string OsType { get; set; } + + /// + /// Gets or sets whether FIPS image is enabled. + /// + [JsonProperty(PropertyName = "enable-fips-image")] + public bool EnableFipsImage { get; set; } /// /// Validate the object. @@ -59,9 +65,9 @@ public ContainerServiceCustomProfile(string orchestrator) /// public virtual void Validate() { - if (Orchestrator == null) + if (OsType == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Orchestrator"); + throw new ValidationException(ValidationRules.CannotBeNull, "OsType"); } } } diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OSSKU.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OSSKU.cs new file mode 100644 index 0000000000000..f6ded12604b1a --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OSSKU.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 OSSKU. + /// + public static class OSSKU + { + public const string Ubuntu = "Ubuntu"; + public const string CBLMariner = "CBLMariner"; + } +} 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/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/OutboundEnvironmentEndpoint.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OutboundEnvironmentEndpoint.cs new file mode 100644 index 0000000000000..e2753287908bb --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/OutboundEnvironmentEndpoint.cs @@ -0,0 +1,67 @@ +// +// 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; + + /// + /// Egress endpoints which AKS agent nodes connect to for common purpose. + /// + public partial class OutboundEnvironmentEndpoint + { + /// + /// Initializes a new instance of the OutboundEnvironmentEndpoint + /// class. + /// + public OutboundEnvironmentEndpoint() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OutboundEnvironmentEndpoint + /// class. + /// + /// The category of endpoints accessed by the + /// AKS agent node, e.g. azure-resource-management, apiserver, + /// etc. + /// The endpoints that AKS agent nodes connect + /// to + public OutboundEnvironmentEndpoint(string category = default(string), IList endpoints = default(IList)) + { + Category = category; + Endpoints = endpoints; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the category of endpoints accessed by the AKS agent + /// node, e.g. azure-resource-management, apiserver, etc. + /// + [JsonProperty(PropertyName = "category")] + public string Category { get; set; } + + /// + /// Gets or sets the endpoints that AKS agent nodes connect to + /// + [JsonProperty(PropertyName = "endpoints")] + public IList Endpoints { get; set; } + + } +} 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/KeyVaultSecretRef.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/RunCommandRequest.cs similarity index 51% rename from sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/KeyVaultSecretRef.cs rename to sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/RunCommandRequest.cs index 25a0fdc259b5b..aa0aaed12ebbf 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/KeyVaultSecretRef.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/RunCommandRequest.cs @@ -15,29 +15,31 @@ namespace Microsoft.Azure.Management.ContainerService.Models using System.Linq; /// - /// Reference to a secret stored in Azure Key Vault. + /// run command request /// - public partial class KeyVaultSecretRef + public partial class RunCommandRequest { /// - /// Initializes a new instance of the KeyVaultSecretRef class. + /// Initializes a new instance of the RunCommandRequest class. /// - public KeyVaultSecretRef() + public RunCommandRequest() { CustomInit(); } /// - /// Initializes a new instance of the KeyVaultSecretRef class. + /// Initializes a new instance of the RunCommandRequest class. /// - /// Key vault identifier. - /// The secret name. - /// The secret version. - public KeyVaultSecretRef(string vaultID, string secretName, string version = default(string)) + /// command to run. + /// base64 encoded zip file, contains files + /// required by the command + /// AuthToken issued for AKS AAD Server + /// App. + public RunCommandRequest(string command, string context = default(string), string clusterToken = default(string)) { - VaultID = vaultID; - SecretName = secretName; - Version = version; + Command = command; + Context = context; + ClusterToken = clusterToken; CustomInit(); } @@ -47,22 +49,23 @@ public KeyVaultSecretRef() partial void CustomInit(); /// - /// Gets or sets key vault identifier. + /// Gets or sets command to run. /// - [JsonProperty(PropertyName = "vaultID")] - public string VaultID { get; set; } + [JsonProperty(PropertyName = "command")] + public string Command { get; set; } /// - /// Gets or sets the secret name. + /// Gets or sets base64 encoded zip file, contains files required by + /// the command /// - [JsonProperty(PropertyName = "secretName")] - public string SecretName { get; set; } + [JsonProperty(PropertyName = "context")] + public string Context { get; set; } /// - /// Gets or sets the secret version. + /// Gets or sets authToken issued for AKS AAD Server App. /// - [JsonProperty(PropertyName = "version")] - public string Version { get; set; } + [JsonProperty(PropertyName = "clusterToken")] + public string ClusterToken { get; set; } /// /// Validate the object. @@ -72,13 +75,9 @@ public KeyVaultSecretRef() /// public virtual void Validate() { - if (VaultID == null) + if (Command == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "VaultID"); - } - if (SecretName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "SecretName"); + throw new ValidationException(ValidationRules.CannotBeNull, "Command"); } } } diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/RunCommandResult.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/RunCommandResult.cs new file mode 100644 index 0000000000000..142c017ff1454 --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/RunCommandResult.cs @@ -0,0 +1,103 @@ +// +// 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.Linq; + + /// + /// run command result. + /// + [Rest.Serialization.JsonTransformation] + public partial class RunCommandResult + { + /// + /// Initializes a new instance of the RunCommandResult class. + /// + public RunCommandResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RunCommandResult class. + /// + /// command id. + /// provisioning State + /// exit code of the command + /// time when the command started. + /// time when the command finished. + /// command output. + /// explain why provisioningState is set to failed + /// (if so). + public RunCommandResult(string id = default(string), string provisioningState = default(string), int? exitCode = default(int?), System.DateTime? startedAt = default(System.DateTime?), System.DateTime? finishedAt = default(System.DateTime?), string logs = default(string), string reason = default(string)) + { + Id = id; + ProvisioningState = provisioningState; + ExitCode = exitCode; + StartedAt = startedAt; + FinishedAt = finishedAt; + Logs = logs; + Reason = reason; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets command id. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets provisioning State + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets exit code of the command + /// + [JsonProperty(PropertyName = "properties.exitCode")] + public int? ExitCode { get; private set; } + + /// + /// Gets time when the command started. + /// + [JsonProperty(PropertyName = "properties.startedAt")] + public System.DateTime? StartedAt { get; private set; } + + /// + /// Gets time when the command finished. + /// + [JsonProperty(PropertyName = "properties.finishedAt")] + public System.DateTime? FinishedAt { get; private set; } + + /// + /// Gets command output. + /// + [JsonProperty(PropertyName = "properties.logs")] + public string Logs { get; private set; } + + /// + /// Gets explain why provisioningState is set to failed (if so). + /// + [JsonProperty(PropertyName = "properties.reason")] + public string Reason { get; private set; } + + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/SysctlConfig.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/SysctlConfig.cs new file mode 100644 index 0000000000000..c97dba97e866f --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/SysctlConfig.cs @@ -0,0 +1,291 @@ +// +// 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; + + /// + /// Sysctl settings for Linux agent nodes. + /// + public partial class SysctlConfig + { + /// + /// Initializes a new instance of the SysctlConfig class. + /// + public SysctlConfig() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SysctlConfig class. + /// + /// Sysctl setting + /// net.core.somaxconn. + /// Sysctl setting + /// net.core.netdev_max_backlog. + /// Sysctl setting + /// net.core.rmem_default. + /// Sysctl setting + /// net.core.rmem_max. + /// Sysctl setting + /// net.core.wmem_default. + /// Sysctl setting + /// net.core.wmem_max. + /// Sysctl setting + /// net.core.optmem_max. + /// Sysctl setting + /// net.ipv4.tcp_max_syn_backlog. + /// Sysctl setting + /// net.ipv4.tcp_max_tw_buckets. + /// Sysctl setting + /// net.ipv4.tcp_fin_timeout. + /// Sysctl setting + /// net.ipv4.tcp_keepalive_time. + /// Sysctl setting + /// net.ipv4.tcp_keepalive_probes. + /// Sysctl setting + /// net.ipv4.tcp_keepalive_intvl. + /// Sysctl setting + /// net.ipv4.tcp_tw_reuse. + /// Sysctl setting + /// net.ipv4.ip_local_port_range. + /// Sysctl setting + /// net.ipv4.neigh.default.gc_thresh1. + /// Sysctl setting + /// net.ipv4.neigh.default.gc_thresh2. + /// Sysctl setting + /// net.ipv4.neigh.default.gc_thresh3. + /// Sysctl setting + /// net.netfilter.nf_conntrack_max. + /// Sysctl setting + /// net.netfilter.nf_conntrack_buckets. + /// Sysctl setting + /// fs.inotify.max_user_watches. + /// Sysctl setting fs.file-max. + /// Sysctl setting fs.aio-max-nr. + /// Sysctl setting fs.nr_open. + /// Sysctl setting + /// kernel.threads-max. + /// Sysctl setting + /// vm.max_map_count. + /// Sysctl setting vm.swappiness. + /// Sysctl setting + /// vm.vfs_cache_pressure. + public SysctlConfig(int? netCoreSomaxconn = default(int?), int? netCoreNetdevMaxBacklog = default(int?), int? netCoreRmemDefault = default(int?), int? netCoreRmemMax = default(int?), int? netCoreWmemDefault = default(int?), int? netCoreWmemMax = default(int?), int? netCoreOptmemMax = default(int?), int? netIpv4TcpMaxSynBacklog = default(int?), int? netIpv4TcpMaxTwBuckets = default(int?), int? netIpv4TcpFinTimeout = default(int?), int? netIpv4TcpKeepaliveTime = default(int?), int? netIpv4TcpKeepaliveProbes = default(int?), int? netIpv4TcpkeepaliveIntvl = default(int?), bool? netIpv4TcpTwReuse = default(bool?), string netIpv4IpLocalPortRange = default(string), int? netIpv4NeighDefaultGcThresh1 = default(int?), int? netIpv4NeighDefaultGcThresh2 = default(int?), int? netIpv4NeighDefaultGcThresh3 = default(int?), int? netNetfilterNfConntrackMax = default(int?), int? netNetfilterNfConntrackBuckets = default(int?), int? fsInotifyMaxUserWatches = default(int?), int? fsFileMax = default(int?), int? fsAioMaxNr = default(int?), int? fsNrOpen = default(int?), int? kernelThreadsMax = default(int?), int? vmMaxMapCount = default(int?), int? vmSwappiness = default(int?), int? vmVfsCachePressure = default(int?)) + { + NetCoreSomaxconn = netCoreSomaxconn; + NetCoreNetdevMaxBacklog = netCoreNetdevMaxBacklog; + NetCoreRmemDefault = netCoreRmemDefault; + NetCoreRmemMax = netCoreRmemMax; + NetCoreWmemDefault = netCoreWmemDefault; + NetCoreWmemMax = netCoreWmemMax; + NetCoreOptmemMax = netCoreOptmemMax; + NetIpv4TcpMaxSynBacklog = netIpv4TcpMaxSynBacklog; + NetIpv4TcpMaxTwBuckets = netIpv4TcpMaxTwBuckets; + NetIpv4TcpFinTimeout = netIpv4TcpFinTimeout; + NetIpv4TcpKeepaliveTime = netIpv4TcpKeepaliveTime; + NetIpv4TcpKeepaliveProbes = netIpv4TcpKeepaliveProbes; + NetIpv4TcpkeepaliveIntvl = netIpv4TcpkeepaliveIntvl; + NetIpv4TcpTwReuse = netIpv4TcpTwReuse; + NetIpv4IpLocalPortRange = netIpv4IpLocalPortRange; + NetIpv4NeighDefaultGcThresh1 = netIpv4NeighDefaultGcThresh1; + NetIpv4NeighDefaultGcThresh2 = netIpv4NeighDefaultGcThresh2; + NetIpv4NeighDefaultGcThresh3 = netIpv4NeighDefaultGcThresh3; + NetNetfilterNfConntrackMax = netNetfilterNfConntrackMax; + NetNetfilterNfConntrackBuckets = netNetfilterNfConntrackBuckets; + FsInotifyMaxUserWatches = fsInotifyMaxUserWatches; + FsFileMax = fsFileMax; + FsAioMaxNr = fsAioMaxNr; + FsNrOpen = fsNrOpen; + KernelThreadsMax = kernelThreadsMax; + VmMaxMapCount = vmMaxMapCount; + VmSwappiness = vmSwappiness; + VmVfsCachePressure = vmVfsCachePressure; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets sysctl setting net.core.somaxconn. + /// + [JsonProperty(PropertyName = "netCoreSomaxconn")] + public int? NetCoreSomaxconn { get; set; } + + /// + /// Gets or sets sysctl setting net.core.netdev_max_backlog. + /// + [JsonProperty(PropertyName = "netCoreNetdevMaxBacklog")] + public int? NetCoreNetdevMaxBacklog { get; set; } + + /// + /// Gets or sets sysctl setting net.core.rmem_default. + /// + [JsonProperty(PropertyName = "netCoreRmemDefault")] + public int? NetCoreRmemDefault { get; set; } + + /// + /// Gets or sets sysctl setting net.core.rmem_max. + /// + [JsonProperty(PropertyName = "netCoreRmemMax")] + public int? NetCoreRmemMax { get; set; } + + /// + /// Gets or sets sysctl setting net.core.wmem_default. + /// + [JsonProperty(PropertyName = "netCoreWmemDefault")] + public int? NetCoreWmemDefault { get; set; } + + /// + /// Gets or sets sysctl setting net.core.wmem_max. + /// + [JsonProperty(PropertyName = "netCoreWmemMax")] + public int? NetCoreWmemMax { get; set; } + + /// + /// Gets or sets sysctl setting net.core.optmem_max. + /// + [JsonProperty(PropertyName = "netCoreOptmemMax")] + public int? NetCoreOptmemMax { get; set; } + + /// + /// Gets or sets sysctl setting net.ipv4.tcp_max_syn_backlog. + /// + [JsonProperty(PropertyName = "netIpv4TcpMaxSynBacklog")] + public int? NetIpv4TcpMaxSynBacklog { get; set; } + + /// + /// Gets or sets sysctl setting net.ipv4.tcp_max_tw_buckets. + /// + [JsonProperty(PropertyName = "netIpv4TcpMaxTwBuckets")] + public int? NetIpv4TcpMaxTwBuckets { get; set; } + + /// + /// Gets or sets sysctl setting net.ipv4.tcp_fin_timeout. + /// + [JsonProperty(PropertyName = "netIpv4TcpFinTimeout")] + public int? NetIpv4TcpFinTimeout { get; set; } + + /// + /// Gets or sets sysctl setting net.ipv4.tcp_keepalive_time. + /// + [JsonProperty(PropertyName = "netIpv4TcpKeepaliveTime")] + public int? NetIpv4TcpKeepaliveTime { get; set; } + + /// + /// Gets or sets sysctl setting net.ipv4.tcp_keepalive_probes. + /// + [JsonProperty(PropertyName = "netIpv4TcpKeepaliveProbes")] + public int? NetIpv4TcpKeepaliveProbes { get; set; } + + /// + /// Gets or sets sysctl setting net.ipv4.tcp_keepalive_intvl. + /// + [JsonProperty(PropertyName = "netIpv4TcpkeepaliveIntvl")] + public int? NetIpv4TcpkeepaliveIntvl { get; set; } + + /// + /// Gets or sets sysctl setting net.ipv4.tcp_tw_reuse. + /// + [JsonProperty(PropertyName = "netIpv4TcpTwReuse")] + public bool? NetIpv4TcpTwReuse { get; set; } + + /// + /// Gets or sets sysctl setting net.ipv4.ip_local_port_range. + /// + [JsonProperty(PropertyName = "netIpv4IpLocalPortRange")] + public string NetIpv4IpLocalPortRange { get; set; } + + /// + /// Gets or sets sysctl setting net.ipv4.neigh.default.gc_thresh1. + /// + [JsonProperty(PropertyName = "netIpv4NeighDefaultGcThresh1")] + public int? NetIpv4NeighDefaultGcThresh1 { get; set; } + + /// + /// Gets or sets sysctl setting net.ipv4.neigh.default.gc_thresh2. + /// + [JsonProperty(PropertyName = "netIpv4NeighDefaultGcThresh2")] + public int? NetIpv4NeighDefaultGcThresh2 { get; set; } + + /// + /// Gets or sets sysctl setting net.ipv4.neigh.default.gc_thresh3. + /// + [JsonProperty(PropertyName = "netIpv4NeighDefaultGcThresh3")] + public int? NetIpv4NeighDefaultGcThresh3 { get; set; } + + /// + /// Gets or sets sysctl setting net.netfilter.nf_conntrack_max. + /// + [JsonProperty(PropertyName = "netNetfilterNfConntrackMax")] + public int? NetNetfilterNfConntrackMax { get; set; } + + /// + /// Gets or sets sysctl setting net.netfilter.nf_conntrack_buckets. + /// + [JsonProperty(PropertyName = "netNetfilterNfConntrackBuckets")] + public int? NetNetfilterNfConntrackBuckets { get; set; } + + /// + /// Gets or sets sysctl setting fs.inotify.max_user_watches. + /// + [JsonProperty(PropertyName = "fsInotifyMaxUserWatches")] + public int? FsInotifyMaxUserWatches { get; set; } + + /// + /// Gets or sets sysctl setting fs.file-max. + /// + [JsonProperty(PropertyName = "fsFileMax")] + public int? FsFileMax { get; set; } + + /// + /// Gets or sets sysctl setting fs.aio-max-nr. + /// + [JsonProperty(PropertyName = "fsAioMaxNr")] + public int? FsAioMaxNr { get; set; } + + /// + /// Gets or sets sysctl setting fs.nr_open. + /// + [JsonProperty(PropertyName = "fsNrOpen")] + public int? FsNrOpen { get; set; } + + /// + /// Gets or sets sysctl setting kernel.threads-max. + /// + [JsonProperty(PropertyName = "kernelThreadsMax")] + public int? KernelThreadsMax { get; set; } + + /// + /// Gets or sets sysctl setting vm.max_map_count. + /// + [JsonProperty(PropertyName = "vmMaxMapCount")] + public int? VmMaxMapCount { get; set; } + + /// + /// Gets or sets sysctl setting vm.swappiness. + /// + [JsonProperty(PropertyName = "vmSwappiness")] + public int? VmSwappiness { get; set; } + + /// + /// Gets or sets sysctl setting vm.vfs_cache_pressure. + /// + [JsonProperty(PropertyName = "vmVfsCachePressure")] + public int? VmVfsCachePressure { get; set; } + + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/SystemData.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/SystemData.cs new file mode 100644 index 0000000000000..c976358c93d4e --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/SystemData.cs @@ -0,0 +1,103 @@ +// +// 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; + + /// + /// Metadata pertaining to creation and last modification of the resource. + /// + public partial class SystemData + { + /// + /// Initializes a new instance of the SystemData class. + /// + public SystemData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SystemData class. + /// + /// The identity that created the + /// resource. + /// The type of identity that created the + /// resource. Possible values include: 'User', 'Application', + /// 'ManagedIdentity', 'Key' + /// The timestamp of resource creation + /// (UTC). + /// The identity that last modified the + /// resource. + /// The type of identity that last + /// modified the resource. Possible values include: 'User', + /// 'Application', 'ManagedIdentity', 'Key' + /// The type of identity that last + /// modified the resource. + public SystemData(string createdBy = default(string), string createdByType = default(string), System.DateTime? createdAt = default(System.DateTime?), string lastModifiedBy = default(string), string lastModifiedByType = default(string), System.DateTime? lastModifiedAt = default(System.DateTime?)) + { + CreatedBy = createdBy; + CreatedByType = createdByType; + CreatedAt = createdAt; + LastModifiedBy = lastModifiedBy; + LastModifiedByType = lastModifiedByType; + LastModifiedAt = lastModifiedAt; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the identity that created the resource. + /// + [JsonProperty(PropertyName = "createdBy")] + public string CreatedBy { get; set; } + + /// + /// Gets or sets the type of identity that created the resource. + /// Possible values include: 'User', 'Application', 'ManagedIdentity', + /// 'Key' + /// + [JsonProperty(PropertyName = "createdByType")] + public string CreatedByType { get; set; } + + /// + /// Gets or sets the timestamp of resource creation (UTC). + /// + [JsonProperty(PropertyName = "createdAt")] + public System.DateTime? CreatedAt { get; set; } + + /// + /// Gets or sets the identity that last modified the resource. + /// + [JsonProperty(PropertyName = "lastModifiedBy")] + public string LastModifiedBy { get; set; } + + /// + /// Gets or sets the type of identity that last modified the resource. + /// Possible values include: 'User', 'Application', 'ManagedIdentity', + /// 'Key' + /// + [JsonProperty(PropertyName = "lastModifiedByType")] + public string LastModifiedByType { get; set; } + + /// + /// Gets or sets the type of identity that last modified the resource. + /// + [JsonProperty(PropertyName = "lastModifiedAt")] + public System.DateTime? LastModifiedAt { get; set; } + + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/TimeInWeek.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/TimeInWeek.cs new file mode 100644 index 0000000000000..31ea9dc9f2b36 --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/TimeInWeek.cs @@ -0,0 +1,64 @@ +// +// 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; + + /// + /// Time in a week. + /// + public partial class TimeInWeek + { + /// + /// Initializes a new instance of the TimeInWeek class. + /// + public TimeInWeek() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TimeInWeek class. + /// + /// A day in a week. Possible values include: + /// 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', + /// 'Saturday' + /// hour slots in a day. + public TimeInWeek(string day = default(string), IList hourSlots = default(IList)) + { + Day = day; + HourSlots = hourSlots; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a day in a week. Possible values include: 'Sunday', + /// 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' + /// + [JsonProperty(PropertyName = "day")] + public string Day { get; set; } + + /// + /// Gets or sets hour slots in a day. + /// + [JsonProperty(PropertyName = "hourSlots")] + public IList HourSlots { get; set; } + + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/TimeSpan.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/TimeSpan.cs new file mode 100644 index 0000000000000..9a096d658997f --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/TimeSpan.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.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The time span with start and end properties. + /// + public partial class TimeSpan + { + /// + /// Initializes a new instance of the TimeSpan class. + /// + public TimeSpan() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TimeSpan class. + /// + /// The start of a time span + /// The end of a time span + public TimeSpan(System.DateTime? start = default(System.DateTime?), System.DateTime? end = default(System.DateTime?)) + { + Start = start; + End = end; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the start of a time span + /// + [JsonProperty(PropertyName = "start")] + public System.DateTime? Start { get; set; } + + /// + /// Gets or sets the end of a time span + /// + [JsonProperty(PropertyName = "end")] + public System.DateTime? End { 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..b02b008e0db79 --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/UpgradeChannel.cs @@ -0,0 +1,25 @@ +// +// 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"; + public const string NodeImage = "node-image"; + public const string None = "none"; + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/WeekDay.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/WeekDay.cs new file mode 100644 index 0000000000000..e0238baf21225 --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/WeekDay.cs @@ -0,0 +1,27 @@ +// +// 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 WeekDay. + /// + public static class WeekDay + { + public const string Sunday = "Sunday"; + public const string Monday = "Monday"; + public const string Tuesday = "Tuesday"; + public const string Wednesday = "Wednesday"; + public const string Thursday = "Thursday"; + public const string Friday = "Friday"; + public const string Saturday = "Saturday"; + } +} 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..4fb03c776b6e7 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,15 @@ 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", "2021-05-01"), + new Tuple("ContainerService", "MaintenanceConfigurations", "2021-05-01"), + new Tuple("ContainerService", "ManagedClusters", "2021-05-01"), + new Tuple("ContainerService", "Operations", "2021-05-01"), + new Tuple("ContainerService", "PrivateEndpointConnections", "2021-05-01"), + new Tuple("ContainerService", "PrivateLinkResources", "2021-05-01"), + new Tuple("ContainerService", "ResolvePrivateLinkServiceId", "2021-05-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 } } -