From 4cea3647e0801cafc794e998bac663250ba50fc4 Mon Sep 17 00:00:00 2001 From: John Paul Kee Date: Tue, 9 Jul 2019 15:19:03 -0700 Subject: [PATCH 1/3] initialize instance pool .net sdk client and recorded tests --- .../src/Generated/IInstancePoolsOperations.cs | 309 +++ .../Generated/IManagedInstancesOperations.cs | 60 +- .../src/Generated/ISqlManagementClient.cs | 20 +- .../src/Generated/IUsagesOperations.cs | 80 + .../src/Generated/InstancePoolsOperations.cs | 1646 ++++++++++++++ .../InstancePoolsOperationsExtensions.cs | 469 ++++ .../Generated/ManagedInstancesOperations.cs | 234 +- .../ManagedInstancesOperationsExtensions.cs | 108 +- .../src/Generated/Models/Database.cs | 43 +- .../src/Generated/Models/DatabaseEdition.cs | 3 + .../src/Generated/Models/DatabaseStatus.cs | 2 + .../src/Generated/Models/DatabaseUpdate.cs | 9 +- .../src/Generated/Models/ElasticPool.cs | 25 + .../Generated/Models/ElasticPoolEdition.cs | 2 + .../src/Generated/Models/ImportRequest.cs | 42 +- .../src/Generated/Models/InstancePool.cs | 117 + .../Models/InstancePoolLicenseType.cs | 22 + .../Generated/Models/InstancePoolUpdate.cs | 53 + .../src/Generated/Models/Name.cs | 59 + .../Models/RecommendedElasticPool.cs | 5 +- .../src/Generated/Models/Usage.cs | 99 + .../Generated/SdkInfo_SqlManagementClient.cs | 4 +- .../src/Generated/SqlManagementClient.cs | 58 +- .../src/Generated/UsagesOperations.cs | 431 ++++ .../Generated/UsagesOperationsExtensions.cs | 109 + .../tests/InstancePoolCrudScenarioTests.cs | 148 ++ .../TestCreateUpdateGetDropInstancePool.json | 1968 +++++++++++++++++ .../Utilities/SqlManagementTestUtilities.cs | 35 +- 28 files changed, 5893 insertions(+), 267 deletions(-) create mode 100644 sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/IInstancePoolsOperations.cs create mode 100644 sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/IUsagesOperations.cs create mode 100644 sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/InstancePoolsOperations.cs create mode 100644 sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/InstancePoolsOperationsExtensions.cs create mode 100644 sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/InstancePool.cs create mode 100644 sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/InstancePoolLicenseType.cs create mode 100644 sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/InstancePoolUpdate.cs create mode 100644 sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/Name.cs create mode 100644 sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/Usage.cs create mode 100644 sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/UsagesOperations.cs create mode 100644 sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/UsagesOperationsExtensions.cs create mode 100644 sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/tests/InstancePoolCrudScenarioTests.cs create mode 100644 sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/tests/SessionRecords/Sql.Tests.InstancePoolCrudScenarioTests/TestCreateUpdateGetDropInstancePool.json diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/IInstancePoolsOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/IInstancePoolsOperations.cs new file mode 100644 index 000000000000..b032fe50e3ee --- /dev/null +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/IInstancePoolsOperations.cs @@ -0,0 +1,309 @@ +// +// 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.Sql +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// InstancePoolsOperations operations. + /// + public partial interface IInstancePoolsOperations + { + /// + /// Gets an instance pool. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the instance pool to be retrieved. + /// + /// + /// 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 instancePoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates an instance pool. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the instance pool to be created or updated. + /// + /// + /// The requested instance pool resource state. + /// + /// + /// 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 instancePoolName, InstancePool parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes an instance pool + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the instance pool to be deleted + /// + /// + /// 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 instancePoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates an instance pool. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the instance pool to be updated. + /// + /// + /// The requested instance pool resource state. + /// + /// + /// 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> UpdateWithHttpMessagesAsync(string resourceGroupName, string instancePoolName, InstancePoolUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a list of instance pools in the resource group + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// 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 list of all instance pools in the subscription. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates an instance pool. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the instance pool to be created or updated. + /// + /// + /// The requested instance pool resource state. + /// + /// + /// 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 instancePoolName, InstancePool parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes an instance pool + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the instance pool to be deleted + /// + /// + /// 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 instancePoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates an instance pool. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the instance pool to be updated. + /// + /// + /// The requested instance pool resource state. + /// + /// + /// 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> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string instancePoolName, InstancePoolUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a list of instance pools in the resource group + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a list of all instance pools in the subscription. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/IManagedInstancesOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/IManagedInstancesOperations.cs index 779b1fbbfc31..8bee1df38ef8 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/IManagedInstancesOperations.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/IManagedInstancesOperations.cs @@ -24,13 +24,16 @@ namespace Microsoft.Azure.Management.Sql public partial interface IManagedInstancesOperations { /// - /// Gets a list of managed instances in a resource group. + /// Gets a list of all managed instances in an instance pool. /// /// /// The name of the resource group that contains the resource. You can /// obtain this value from the Azure Resource Manager API or the /// portal. /// + /// + /// The instance pool name. + /// /// /// The headers that will be added to request. /// @@ -46,18 +49,15 @@ public partial interface IManagedInstancesOperations /// /// Thrown when a required parameter is null /// - Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByInstancePoolWithHttpMessagesAsync(string resourceGroupName, string instancePoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets a managed instance. + /// Gets a list of managed instances in a resource group. /// /// /// The name of the resource group that contains the resource. You can /// obtain this value from the Azure Resource Manager API or the /// portal. /// - /// - /// The name of the managed instance. - /// /// /// The headers that will be added to request. /// @@ -73,9 +73,9 @@ public partial interface IManagedInstancesOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates a managed instance. + /// Gets a managed instance. /// /// /// The name of the resource group that contains the resource. You can @@ -85,9 +85,6 @@ public partial interface IManagedInstancesOperations /// /// The name of the managed instance. /// - /// - /// The requested managed instance resource state. - /// /// /// The headers that will be added to request. /// @@ -103,9 +100,9 @@ public partial interface IManagedInstancesOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, ManagedInstance parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes a managed instance. + /// Creates or updates a managed instance. /// /// /// The name of the resource group that contains the resource. You can @@ -115,6 +112,9 @@ public partial interface IManagedInstancesOperations /// /// The name of the managed instance. /// + /// + /// The requested managed instance resource state. + /// /// /// The headers that will be added to request. /// @@ -124,12 +124,15 @@ public partial interface IManagedInstancesOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, ManagedInstance parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Updates a managed instance. + /// Deletes a managed instance. /// /// /// The name of the resource group that contains the resource. You can @@ -139,9 +142,6 @@ public partial interface IManagedInstancesOperations /// /// The name of the managed instance. /// - /// - /// The requested managed instance resource state. - /// /// /// The headers that will be added to request. /// @@ -151,23 +151,23 @@ public partial interface IManagedInstancesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, ManagedInstanceUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets a list of all managed instances in an instance pool. + /// Updates a managed instance. /// /// /// The name of the resource group that contains the resource. You can /// obtain this value from the Azure Resource Manager API or the /// portal. /// - /// - /// The instance pool name. + /// + /// The name of the managed instance. + /// + /// + /// The requested managed instance resource state. /// /// /// The headers that will be added to request. @@ -184,7 +184,7 @@ public partial interface IManagedInstancesOperations /// /// Thrown when a required parameter is null /// - Task>> ListByInstancePoolWithHttpMessagesAsync(string resourceGroupName, string instancePoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, ManagedInstanceUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets a list of all managed instances in the subscription. /// @@ -289,7 +289,7 @@ public partial interface IManagedInstancesOperations /// Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, ManagedInstanceUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets a list of managed instances in a resource group. + /// Gets a list of all managed instances in an instance pool. /// /// /// The NextLink from the previous successful call to List operation. @@ -309,9 +309,9 @@ public partial interface IManagedInstancesOperations /// /// Thrown when a required parameter is null /// - Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByInstancePoolNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets a list of all managed instances in an instance pool. + /// Gets a list of managed instances in a resource group. /// /// /// The NextLink from the previous successful call to List operation. @@ -331,7 +331,7 @@ public partial interface IManagedInstancesOperations /// /// Thrown when a required parameter is null /// - Task>> ListByInstancePoolNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets a list of all managed instances in the subscription. /// diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/ISqlManagementClient.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/ISqlManagementClient.cs index e6313e934175..5b66d4e9f264 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/ISqlManagementClient.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/ISqlManagementClient.cs @@ -197,11 +197,6 @@ public partial interface ISqlManagementClient : System.IDisposable /// IFailoverGroupsOperations FailoverGroups { get; } - /// - /// Gets the IManagedInstancesOperations. - /// - IManagedInstancesOperations ManagedInstances { get; } - /// /// Gets the IOperations. /// @@ -467,5 +462,20 @@ public partial interface ISqlManagementClient : System.IDisposable /// IManagedDatabaseSensitivityLabelsOperations ManagedDatabaseSensitivityLabels { get; } + /// + /// Gets the IInstancePoolsOperations. + /// + IInstancePoolsOperations InstancePools { get; } + + /// + /// Gets the IUsagesOperations. + /// + IUsagesOperations Usages { get; } + + /// + /// Gets the IManagedInstancesOperations. + /// + IManagedInstancesOperations ManagedInstances { get; } + } } diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/IUsagesOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/IUsagesOperations.cs new file mode 100644 index 000000000000..44f93d890c7e --- /dev/null +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/IUsagesOperations.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.Sql +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// UsagesOperations operations. + /// + public partial interface IUsagesOperations + { + /// + /// Gets all instance pool usage metrics + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the instance pool to be retrieved. + /// + /// + /// Optional request parameter to include managed instance usages + /// within the instance 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>> ListByInstancePoolWithHttpMessagesAsync(string resourceGroupName, string instancePoolName, bool? expandChildren = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets all instance pool usage metrics + /// + /// + /// 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>> ListByInstancePoolNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/InstancePoolsOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/InstancePoolsOperations.cs new file mode 100644 index 000000000000..c8d461ed5c3a --- /dev/null +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/InstancePoolsOperations.cs @@ -0,0 +1,1646 @@ +// +// 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.Sql +{ + 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; + + /// + /// InstancePoolsOperations operations. + /// + internal partial class InstancePoolsOperations : IServiceOperations, IInstancePoolsOperations + { + /// + /// Initializes a new instance of the InstancePoolsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal InstancePoolsOperations(SqlManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the SqlManagementClient + /// + public SqlManagementClient Client { get; private set; } + + /// + /// Gets an instance pool. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the instance pool to be retrieved. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string instancePoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (instancePoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instancePoolName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-06-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("instancePoolName", instancePoolName); + 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.Sql/instancePools/{instancePoolName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{instancePoolName}", System.Uri.EscapeDataString(instancePoolName)); + _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 an instance pool. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the instance pool to be created or updated. + /// + /// + /// The requested instance pool resource state. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string instancePoolName, InstancePool parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, instancePoolName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes an instance pool + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the instance pool to be deleted + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string instancePoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, instancePoolName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Updates an instance pool. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the instance pool to be updated. + /// + /// + /// The requested instance pool resource state. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string instancePoolName, InstancePoolUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, instancePoolName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a list of instance pools in the resource group + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-06-01-preview"; + // 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.Sql/instancePools").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 all instance pools in the subscription. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-06-01-preview"; + // 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.Sql/instancePools").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 an instance pool. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the instance pool to be created or updated. + /// + /// + /// The requested instance pool resource state. + /// + /// + /// 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 instancePoolName, InstancePool parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (instancePoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instancePoolName"); + } + 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 = "2018-06-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("instancePoolName", instancePoolName); + 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.Sql/instancePools/{instancePoolName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{instancePoolName}", System.Uri.EscapeDataString(instancePoolName)); + _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); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes an instance pool + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the instance pool to be deleted + /// + /// + /// 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 instancePoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (instancePoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instancePoolName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-06-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("instancePoolName", instancePoolName); + 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.Sql/instancePools/{instancePoolName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{instancePoolName}", System.Uri.EscapeDataString(instancePoolName)); + _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 != 200 && (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; + } + + /// + /// Updates an instance pool. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the instance pool to be updated. + /// + /// + /// The requested instance pool resource state. + /// + /// + /// 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> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string instancePoolName, InstancePoolUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (instancePoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instancePoolName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-06-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("instancePoolName", instancePoolName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", 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.Sql/instancePools/{instancePoolName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{instancePoolName}", System.Uri.EscapeDataString(instancePoolName)); + _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("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 && (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); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a list of instance pools in the resource group + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a list of all instance pools in the subscription. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/InstancePoolsOperationsExtensions.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/InstancePoolsOperationsExtensions.cs new file mode 100644 index 000000000000..f797e401c962 --- /dev/null +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/InstancePoolsOperationsExtensions.cs @@ -0,0 +1,469 @@ +// +// 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.Sql +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for InstancePoolsOperations. + /// + public static partial class InstancePoolsOperationsExtensions + { + /// + /// Gets an instance pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the instance pool to be retrieved. + /// + public static InstancePool Get(this IInstancePoolsOperations operations, string resourceGroupName, string instancePoolName) + { + return operations.GetAsync(resourceGroupName, instancePoolName).GetAwaiter().GetResult(); + } + + /// + /// Gets an instance pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the instance pool to be retrieved. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IInstancePoolsOperations operations, string resourceGroupName, string instancePoolName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, instancePoolName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates an instance pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the instance pool to be created or updated. + /// + /// + /// The requested instance pool resource state. + /// + public static InstancePool CreateOrUpdate(this IInstancePoolsOperations operations, string resourceGroupName, string instancePoolName, InstancePool parameters) + { + return operations.CreateOrUpdateAsync(resourceGroupName, instancePoolName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates an instance pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the instance pool to be created or updated. + /// + /// + /// The requested instance pool resource state. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IInstancePoolsOperations operations, string resourceGroupName, string instancePoolName, InstancePool parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, instancePoolName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes an instance pool + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the instance pool to be deleted + /// + public static void Delete(this IInstancePoolsOperations operations, string resourceGroupName, string instancePoolName) + { + operations.DeleteAsync(resourceGroupName, instancePoolName).GetAwaiter().GetResult(); + } + + /// + /// Deletes an instance pool + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the instance pool to be deleted + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IInstancePoolsOperations operations, string resourceGroupName, string instancePoolName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, instancePoolName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Updates an instance pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the instance pool to be updated. + /// + /// + /// The requested instance pool resource state. + /// + public static InstancePool Update(this IInstancePoolsOperations operations, string resourceGroupName, string instancePoolName, InstancePoolUpdate parameters) + { + return operations.UpdateAsync(resourceGroupName, instancePoolName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates an instance pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the instance pool to be updated. + /// + /// + /// The requested instance pool resource state. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IInstancePoolsOperations operations, string resourceGroupName, string instancePoolName, InstancePoolUpdate parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, instancePoolName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a list of instance pools in the resource group + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + public static IPage ListByResourceGroup(this IInstancePoolsOperations operations, string resourceGroupName) + { + return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of instance pools in the resource group + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupAsync(this IInstancePoolsOperations 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 all instance pools in the subscription. + /// + /// + /// The operations group for this extension method. + /// + public static IPage List(this IInstancePoolsOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Gets a list of all instance pools in the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IInstancePoolsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates an instance pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the instance pool to be created or updated. + /// + /// + /// The requested instance pool resource state. + /// + public static InstancePool BeginCreateOrUpdate(this IInstancePoolsOperations operations, string resourceGroupName, string instancePoolName, InstancePool parameters) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, instancePoolName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates an instance pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the instance pool to be created or updated. + /// + /// + /// The requested instance pool resource state. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this IInstancePoolsOperations operations, string resourceGroupName, string instancePoolName, InstancePool parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, instancePoolName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes an instance pool + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the instance pool to be deleted + /// + public static void BeginDelete(this IInstancePoolsOperations operations, string resourceGroupName, string instancePoolName) + { + operations.BeginDeleteAsync(resourceGroupName, instancePoolName).GetAwaiter().GetResult(); + } + + /// + /// Deletes an instance pool + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the instance pool to be deleted + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IInstancePoolsOperations operations, string resourceGroupName, string instancePoolName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, instancePoolName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Updates an instance pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the instance pool to be updated. + /// + /// + /// The requested instance pool resource state. + /// + public static InstancePool BeginUpdate(this IInstancePoolsOperations operations, string resourceGroupName, string instancePoolName, InstancePoolUpdate parameters) + { + return operations.BeginUpdateAsync(resourceGroupName, instancePoolName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates an instance pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the instance pool to be updated. + /// + /// + /// The requested instance pool resource state. + /// + /// + /// The cancellation token. + /// + public static async Task BeginUpdateAsync(this IInstancePoolsOperations operations, string resourceGroupName, string instancePoolName, InstancePoolUpdate parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, instancePoolName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a list of instance pools in the resource group + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByResourceGroupNext(this IInstancePoolsOperations operations, string nextPageLink) + { + return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of instance pools in the resource group + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupNextAsync(this IInstancePoolsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a list of all instance pools in the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IInstancePoolsOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of all instance pools in the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IInstancePoolsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/ManagedInstancesOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/ManagedInstancesOperations.cs index 8136af88031c..feb4e676b092 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/ManagedInstancesOperations.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/ManagedInstancesOperations.cs @@ -51,12 +51,15 @@ internal ManagedInstancesOperations(SqlManagementClient client) public SqlManagementClient Client { get; private set; } /// - /// Gets a list of managed instances in a resource group. + /// Gets a list of all managed instances in an instance pool. /// /// /// The name of the resource group that contains the resource. You can obtain /// this value from the Azure Resource Manager API or the portal. /// + /// + /// The instance pool name. + /// /// /// Headers that will be added to request. /// @@ -78,17 +81,21 @@ internal ManagedInstancesOperations(SqlManagementClient 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>> ListByInstancePoolWithHttpMessagesAsync(string resourceGroupName, string instancePoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (instancePoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instancePoolName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2015-05-01-preview"; + string apiVersion = "2018-06-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -97,14 +104,16 @@ internal ManagedInstancesOperations(SqlManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("instancePoolName", instancePoolName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByInstancePool", 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.Sql/managedInstances").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}/managedInstances").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{instancePoolName}", System.Uri.EscapeDataString(instancePoolName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -237,15 +246,12 @@ internal ManagedInstancesOperations(SqlManagementClient client) } /// - /// Gets a managed instance. + /// Gets a list of managed instances in a resource group. /// /// /// The name of the resource group that contains the resource. You can obtain /// this value from the Azure Resource Manager API or the portal. /// - /// - /// The name of the managed instance. - /// /// /// Headers that will be added to request. /// @@ -267,21 +273,17 @@ internal ManagedInstancesOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (managedInstanceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "managedInstanceName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2015-05-01-preview"; + string apiVersion = "2018-06-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -290,16 +292,14 @@ internal ManagedInstancesOperations(SqlManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("managedInstanceName", managedInstanceName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + 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.Sql/managedInstances/{managedInstanceName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{managedInstanceName}", System.Uri.EscapeDataString(managedInstanceName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -399,7 +399,7 @@ internal ManagedInstancesOperations(SqlManagementClient 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")) @@ -412,7 +412,7 @@ internal ManagedInstancesOperations(SqlManagementClient 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) { @@ -432,56 +432,7 @@ internal ManagedInstancesOperations(SqlManagementClient client) } /// - /// Creates or updates a managed instance. - /// - /// - /// The name of the resource group that contains the resource. You can obtain - /// this value from the Azure Resource Manager API or the portal. - /// - /// - /// The name of the managed instance. - /// - /// - /// The requested managed instance resource state. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, ManagedInstance parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, managedInstanceName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes a managed instance. - /// - /// - /// The name of the resource group that contains the resource. You can obtain - /// this value from the Azure Resource Manager API or the portal. - /// - /// - /// The name of the managed instance. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, managedInstanceName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Updates a managed instance. + /// Gets a managed instance. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -490,32 +441,6 @@ internal ManagedInstancesOperations(SqlManagementClient client) /// /// The name of the managed instance. /// - /// - /// The requested managed instance resource state. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, ManagedInstanceUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, managedInstanceName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets a list of all managed instances in an instance pool. - /// - /// - /// The name of the resource group that contains the resource. You can obtain - /// this value from the Azure Resource Manager API or the portal. - /// - /// - /// The instance pool name. - /// /// /// Headers that will be added to request. /// @@ -537,21 +462,21 @@ internal ManagedInstancesOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByInstancePoolWithHttpMessagesAsync(string resourceGroupName, string instancePoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (instancePoolName == null) + if (managedInstanceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instancePoolName"); + throw new ValidationException(ValidationRules.CannotBeNull, "managedInstanceName"); } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2015-05-01-preview"; + string apiVersion = "2018-06-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -560,16 +485,16 @@ internal ManagedInstancesOperations(SqlManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("instancePoolName", instancePoolName); + tracingParameters.Add("managedInstanceName", managedInstanceName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByInstancePool", 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.Sql/instancePools/{instancePoolName}/managedInstances").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{instancePoolName}", System.Uri.EscapeDataString(instancePoolName)); + _url = _url.Replace("{managedInstanceName}", System.Uri.EscapeDataString(managedInstanceName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -669,7 +594,7 @@ internal ManagedInstancesOperations(SqlManagementClient 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")) @@ -682,7 +607,7 @@ internal ManagedInstancesOperations(SqlManagementClient 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) { @@ -701,6 +626,81 @@ internal ManagedInstancesOperations(SqlManagementClient client) return _result; } + /// + /// Creates or updates a managed instance. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// The requested managed instance resource state. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, ManagedInstance parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, managedInstanceName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes a managed instance. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, managedInstanceName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Updates a managed instance. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// The requested managed instance resource state. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, ManagedInstanceUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, managedInstanceName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + /// /// Gets a list of all managed instances in the subscription. /// @@ -731,7 +731,7 @@ internal ManagedInstancesOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2015-05-01-preview"; + string apiVersion = "2018-06-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -933,7 +933,7 @@ internal ManagedInstancesOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2015-05-01-preview"; + string apiVersion = "2018-06-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1150,7 +1150,7 @@ internal ManagedInstancesOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2015-05-01-preview"; + string apiVersion = "2018-06-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1334,7 +1334,7 @@ internal ManagedInstancesOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2015-05-01-preview"; + string apiVersion = "2018-06-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1492,7 +1492,7 @@ internal ManagedInstancesOperations(SqlManagementClient client) } /// - /// Gets a list of managed instances in a resource group. + /// Gets a list of all managed instances in an instance pool. /// /// /// The NextLink from the previous successful call to List operation. @@ -1518,7 +1518,7 @@ internal ManagedInstancesOperations(SqlManagementClient 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>> ListByInstancePoolNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -1533,7 +1533,7 @@ internal ManagedInstancesOperations(SqlManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByInstancePoolNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -1665,7 +1665,7 @@ internal ManagedInstancesOperations(SqlManagementClient client) } /// - /// Gets a list of all managed instances in an instance pool. + /// Gets a list of managed instances in a resource group. /// /// /// The NextLink from the previous successful call to List operation. @@ -1691,7 +1691,7 @@ internal ManagedInstancesOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByInstancePoolNextWithHttpMessagesAsync(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) { @@ -1706,7 +1706,7 @@ internal ManagedInstancesOperations(SqlManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByInstancePoolNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/ManagedInstancesOperationsExtensions.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/ManagedInstancesOperationsExtensions.cs index 2877fb5abf37..bb99ab823b71 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/ManagedInstancesOperationsExtensions.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/ManagedInstancesOperationsExtensions.cs @@ -21,6 +21,48 @@ namespace Microsoft.Azure.Management.Sql /// public static partial class ManagedInstancesOperationsExtensions { + /// + /// Gets a list of all managed instances in an instance pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The instance pool name. + /// + public static IPage ListByInstancePool(this IManagedInstancesOperations operations, string resourceGroupName, string instancePoolName) + { + return operations.ListByInstancePoolAsync(resourceGroupName, instancePoolName).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of all managed instances in an instance pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The instance pool name. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByInstancePoolAsync(this IManagedInstancesOperations operations, string resourceGroupName, string instancePoolName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByInstancePoolWithHttpMessagesAsync(resourceGroupName, instancePoolName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Gets a list of managed instances in a resource group. /// @@ -234,48 +276,6 @@ public static ManagedInstance Update(this IManagedInstancesOperations operations } } - /// - /// Gets a list of all managed instances in an instance pool. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group that contains the resource. You can obtain - /// this value from the Azure Resource Manager API or the portal. - /// - /// - /// The instance pool name. - /// - public static IPage ListByInstancePool(this IManagedInstancesOperations operations, string resourceGroupName, string instancePoolName) - { - return operations.ListByInstancePoolAsync(resourceGroupName, instancePoolName).GetAwaiter().GetResult(); - } - - /// - /// Gets a list of all managed instances in an instance pool. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group that contains the resource. You can obtain - /// this value from the Azure Resource Manager API or the portal. - /// - /// - /// The instance pool name. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByInstancePoolAsync(this IManagedInstancesOperations operations, string resourceGroupName, string instancePoolName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByInstancePoolWithHttpMessagesAsync(resourceGroupName, instancePoolName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Gets a list of all managed instances in the subscription. /// @@ -440,7 +440,7 @@ public static ManagedInstance BeginUpdate(this IManagedInstancesOperations opera } /// - /// Gets a list of managed instances in a resource group. + /// Gets a list of all managed instances in an instance pool. /// /// /// The operations group for this extension method. @@ -448,13 +448,13 @@ public static ManagedInstance BeginUpdate(this IManagedInstancesOperations opera /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListByResourceGroupNext(this IManagedInstancesOperations operations, string nextPageLink) + public static IPage ListByInstancePoolNext(this IManagedInstancesOperations operations, string nextPageLink) { - return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + return operations.ListByInstancePoolNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// - /// Gets a list of managed instances in a resource group. + /// Gets a list of all managed instances in an instance pool. /// /// /// The operations group for this extension method. @@ -465,16 +465,16 @@ public static IPage ListByResourceGroupNext(this IManagedInstan /// /// The cancellation token. /// - public static async Task> ListByResourceGroupNextAsync(this IManagedInstancesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByInstancePoolNextAsync(this IManagedInstancesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByInstancePoolNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets a list of all managed instances in an instance pool. + /// Gets a list of managed instances in a resource group. /// /// /// The operations group for this extension method. @@ -482,13 +482,13 @@ public static IPage ListByResourceGroupNext(this IManagedInstan /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListByInstancePoolNext(this IManagedInstancesOperations operations, string nextPageLink) + public static IPage ListByResourceGroupNext(this IManagedInstancesOperations operations, string nextPageLink) { - return operations.ListByInstancePoolNextAsync(nextPageLink).GetAwaiter().GetResult(); + return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// - /// Gets a list of all managed instances in an instance pool. + /// Gets a list of managed instances in a resource group. /// /// /// The operations group for this extension method. @@ -499,9 +499,9 @@ public static IPage ListByInstancePoolNext(this IManagedInstanc /// /// The cancellation token. /// - public static async Task> ListByInstancePoolNextAsync(this IManagedInstancesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByResourceGroupNextAsync(this IManagedInstancesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByInstancePoolNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/Database.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/Database.cs index 7b9e77a9f164..65cd43634080 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/Database.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/Database.cs @@ -39,7 +39,22 @@ public Database() /// Resource name. /// Resource type. /// Resource tags. - /// The name and tier of the SKU. + /// The database SKU. + /// + /// The list of SKUs may vary by region and support offer. To determine + /// the SKUs (including the SKU name, tier/edition, family, and + /// capacity) that are available to your subscription in an Azure + /// region, use the `Capabilities_ListByLocation` REST API or one of + /// the following commands: + /// + /// ```azurecli + /// az sql db list-editions -l <location> -o table + /// ```` + /// + /// ```powershell + /// Get-AzSqlServerServiceObjective -Location <location> + /// ```` + /// /// Kind of database. This is metadata used for the /// Azure portal experience. /// Resource that manages the database. @@ -99,8 +114,9 @@ public Database() /// include: 'Online', 'Restoring', 'RecoveryPending', 'Recovering', /// 'Suspect', 'Offline', 'Standby', 'Shutdown', 'EmergencyMode', /// 'AutoClosed', 'Copying', 'Creating', 'Inaccessible', - /// 'OfflineSecondary', 'Pausing', 'Paused', 'Resuming', - /// 'Scaling' + /// 'OfflineSecondary', 'Pausing', 'Paused', 'Resuming', 'Scaling', + /// 'OfflineChangingDwPerformanceTiers', + /// 'OnlineChangingDwPerformanceTiers' /// The ID of the database. /// The creation date of the database /// (ISO8601 format). @@ -197,7 +213,22 @@ public Database() partial void CustomInit(); /// - /// Gets or sets the name and tier of the SKU. + /// Gets or sets the database SKU. + /// + /// The list of SKUs may vary by region and support offer. To determine + /// the SKUs (including the SKU name, tier/edition, family, and + /// capacity) that are available to your subscription in an Azure + /// region, use the `Capabilities_ListByLocation` REST API or one of + /// the following commands: + /// + /// ```azurecli + /// az sql db list-editions -l &lt;location&gt; -o table + /// ```` + /// + /// ```powershell + /// Get-AzSqlServerServiceObjective -Location &lt;location&gt; + /// ```` + /// /// [JsonProperty(PropertyName = "sku")] public Sku Sku { get; set; } @@ -299,7 +330,9 @@ public Database() /// 'Restoring', 'RecoveryPending', 'Recovering', 'Suspect', 'Offline', /// 'Standby', 'Shutdown', 'EmergencyMode', 'AutoClosed', 'Copying', /// 'Creating', 'Inaccessible', 'OfflineSecondary', 'Pausing', - /// 'Paused', 'Resuming', 'Scaling' + /// 'Paused', 'Resuming', 'Scaling', + /// 'OfflineChangingDwPerformanceTiers', + /// 'OnlineChangingDwPerformanceTiers' /// [JsonProperty(PropertyName = "properties.status")] public string Status { get; private set; } diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/DatabaseEdition.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/DatabaseEdition.cs index 229fc958e7fd..61860575afdd 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/DatabaseEdition.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/DatabaseEdition.cs @@ -27,5 +27,8 @@ public static class DatabaseEdition public const string DataWarehouse = "DataWarehouse"; public const string System = "System"; public const string System2 = "System2"; + public const string GeneralPurpose = "GeneralPurpose"; + public const string BusinessCritical = "BusinessCritical"; + public const string Hyperscale = "Hyperscale"; } } diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/DatabaseStatus.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/DatabaseStatus.cs index b9c5f5d1cf44..f0e777bf25fa 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/DatabaseStatus.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/DatabaseStatus.cs @@ -34,5 +34,7 @@ public static class DatabaseStatus public const string Paused = "Paused"; public const string Resuming = "Resuming"; public const string Scaling = "Scaling"; + public const string OfflineChangingDwPerformanceTiers = "OfflineChangingDwPerformanceTiers"; + public const string OnlineChangingDwPerformanceTiers = "OnlineChangingDwPerformanceTiers"; } } diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/DatabaseUpdate.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/DatabaseUpdate.cs index b81fe2e8cc02..2648a46634ce 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/DatabaseUpdate.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/DatabaseUpdate.cs @@ -91,8 +91,9 @@ public DatabaseUpdate() /// include: 'Online', 'Restoring', 'RecoveryPending', 'Recovering', /// 'Suspect', 'Offline', 'Standby', 'Shutdown', 'EmergencyMode', /// 'AutoClosed', 'Copying', 'Creating', 'Inaccessible', - /// 'OfflineSecondary', 'Pausing', 'Paused', 'Resuming', - /// 'Scaling' + /// 'OfflineSecondary', 'Pausing', 'Paused', 'Resuming', 'Scaling', + /// 'OfflineChangingDwPerformanceTiers', + /// 'OnlineChangingDwPerformanceTiers' /// The ID of the database. /// The creation date of the database /// (ISO8601 format). @@ -277,7 +278,9 @@ public DatabaseUpdate() /// 'Restoring', 'RecoveryPending', 'Recovering', 'Suspect', 'Offline', /// 'Standby', 'Shutdown', 'EmergencyMode', 'AutoClosed', 'Copying', /// 'Creating', 'Inaccessible', 'OfflineSecondary', 'Pausing', - /// 'Paused', 'Resuming', 'Scaling' + /// 'Paused', 'Resuming', 'Scaling', + /// 'OfflineChangingDwPerformanceTiers', + /// 'OnlineChangingDwPerformanceTiers' /// [JsonProperty(PropertyName = "properties.status")] public string Status { get; private set; } diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/ElasticPool.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/ElasticPool.cs index 5d7584a4f3b1..9e5d861d81d0 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/ElasticPool.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/ElasticPool.cs @@ -39,6 +39,18 @@ public ElasticPool() /// Resource name. /// Resource type. /// Resource tags. + /// The elastic pool SKU. + /// + /// The list of SKUs may vary by region and support offer. To determine + /// the SKUs (including the SKU name, tier/edition, family, and + /// capacity) that are available to your subscription in an Azure + /// region, use the `Capabilities_ListByLocation` REST API or the + /// following command: + /// + /// ```azurecli + /// az sql elastic-pool list-editions -l <location> -o table + /// ```` + /// /// Kind of elastic pool. This is metadata used for /// the Azure portal experience. /// The state of the elastic pool. Possible values @@ -75,6 +87,19 @@ public ElasticPool() partial void CustomInit(); /// + /// Gets or sets the elastic pool SKU. + /// + /// The list of SKUs may vary by region and support offer. To determine + /// the SKUs (including the SKU name, tier/edition, family, and + /// capacity) that are available to your subscription in an Azure + /// region, use the `Capabilities_ListByLocation` REST API or the + /// following command: + /// + /// ```azurecli + /// az sql elastic-pool list-editions -l &lt;location&gt; -o + /// table + /// ```` + /// /// [JsonProperty(PropertyName = "sku")] public Sku Sku { get; set; } diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/ElasticPoolEdition.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/ElasticPoolEdition.cs index 562c26d49883..4ce546476901 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/ElasticPoolEdition.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/ElasticPoolEdition.cs @@ -19,5 +19,7 @@ public static class ElasticPoolEdition public const string Basic = "Basic"; public const string Standard = "Standard"; public const string Premium = "Premium"; + public const string GeneralPurpose = "GeneralPurpose"; + public const string BusinessCritical = "BusinessCritical"; } } diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/ImportRequest.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/ImportRequest.cs index 74dacdbcdabb..c33dde0409a7 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/ImportRequest.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/ImportRequest.cs @@ -43,9 +43,24 @@ public ImportRequest() /// The name of the database to /// import. /// The edition for the database being created. - /// Possible values include: 'Web', 'Business', 'Basic', 'Standard', + /// + /// The list of SKUs may vary by region and support offer. To determine + /// the SKUs (including the SKU name, tier/edition, family, and + /// capacity) that are available to your subscription in an Azure + /// region, use the `Capabilities_ListByLocation` REST API or one of + /// the following commands: + /// + /// ```azurecli + /// az sql db list-editions -l <location> -o table + /// ```` + /// + /// ```powershell + /// Get-AzSqlServerServiceObjective -Location <location> + /// ```` + /// . Possible values include: 'Web', 'Business', 'Basic', 'Standard', /// 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', - /// 'System', 'System2' + /// 'System', 'System2', 'GeneralPurpose', 'BusinessCritical', + /// 'Hyperscale' /// The name of the service /// objective to assign to the database. Possible values include: /// 'System', 'System0', 'System1', 'System2', 'System3', 'System4', @@ -84,10 +99,25 @@ public ImportRequest() public string DatabaseName { get; set; } /// - /// Gets or sets the edition for the database being created. Possible - /// values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', - /// 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', - /// 'System2' + /// Gets or sets the edition for the database being created. + /// + /// The list of SKUs may vary by region and support offer. To determine + /// the SKUs (including the SKU name, tier/edition, family, and + /// capacity) that are available to your subscription in an Azure + /// region, use the `Capabilities_ListByLocation` REST API or one of + /// the following commands: + /// + /// ```azurecli + /// az sql db list-editions -l &lt;location&gt; -o table + /// ```` + /// + /// ```powershell + /// Get-AzSqlServerServiceObjective -Location &lt;location&gt; + /// ```` + /// . Possible values include: 'Web', 'Business', 'Basic', 'Standard', + /// 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', + /// 'System', 'System2', 'GeneralPurpose', 'BusinessCritical', + /// 'Hyperscale' /// [JsonProperty(PropertyName = "edition")] public string Edition { get; set; } diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/InstancePool.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/InstancePool.cs new file mode 100644 index 000000000000..c174f85c08ac --- /dev/null +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/InstancePool.cs @@ -0,0 +1,117 @@ +// +// 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.Sql.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// An Azure SQL instance pool. + /// + [Rest.Serialization.JsonTransformation] + public partial class InstancePool : TrackedResource + { + /// + /// Initializes a new instance of the InstancePool class. + /// + public InstancePool() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the InstancePool class. + /// + /// Resource location. + /// Resource ID of the subnet to place this + /// instance pool in. + /// Count of vCores belonging to this instance + /// pool. + /// The license type. Possible values are + /// 'LicenseIncluded' (price for SQL license is included) and + /// 'BasePrice' (without SQL license price). Possible values include: + /// 'LicenseIncluded', 'BasePrice' + /// Resource ID. + /// Resource name. + /// Resource type. + /// Resource tags. + /// The name and tier of the SKU. + public InstancePool(string location, string subnetId, int vCores, string licenseType, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), Sku sku = default(Sku)) + : base(location, id, name, type, tags) + { + Sku = sku; + SubnetId = subnetId; + VCores = vCores; + LicenseType = licenseType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the name and tier of the SKU. + /// + [JsonProperty(PropertyName = "sku")] + public Sku Sku { get; set; } + + /// + /// Gets or sets resource ID of the subnet to place this instance pool + /// in. + /// + [JsonProperty(PropertyName = "properties.subnetId")] + public string SubnetId { get; set; } + + /// + /// Gets or sets count of vCores belonging to this instance pool. + /// + [JsonProperty(PropertyName = "properties.vCores")] + public int VCores { get; set; } + + /// + /// Gets or sets the license type. Possible values are + /// 'LicenseIncluded' (price for SQL license is included) and + /// 'BasePrice' (without SQL license price). Possible values include: + /// 'LicenseIncluded', 'BasePrice' + /// + [JsonProperty(PropertyName = "properties.licenseType")] + public string LicenseType { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + if (SubnetId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "SubnetId"); + } + if (LicenseType == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "LicenseType"); + } + if (Sku != null) + { + Sku.Validate(); + } + } + } +} diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/InstancePoolLicenseType.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/InstancePoolLicenseType.cs new file mode 100644 index 000000000000..b4371565f980 --- /dev/null +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/InstancePoolLicenseType.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.Sql.Models +{ + + /// + /// Defines values for InstancePoolLicenseType. + /// + public static class InstancePoolLicenseType + { + public const string LicenseIncluded = "LicenseIncluded"; + public const string BasePrice = "BasePrice"; + } +} diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/InstancePoolUpdate.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/InstancePoolUpdate.cs new file mode 100644 index 000000000000..3880870e0ea5 --- /dev/null +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/InstancePoolUpdate.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.Sql.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// An update to an Instance pool. + /// + public partial class InstancePoolUpdate + { + /// + /// Initializes a new instance of the InstancePoolUpdate class. + /// + public InstancePoolUpdate() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the InstancePoolUpdate class. + /// + /// Resource tags. + public InstancePoolUpdate(IDictionary tags = default(IDictionary)) + { + Tags = tags; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets resource tags. + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + } +} diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/Name.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/Name.cs new file mode 100644 index 000000000000..a020564ede68 --- /dev/null +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/Name.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.Sql.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// ARM Usage Name + /// + public partial class Name + { + /// + /// Initializes a new instance of the Name class. + /// + public Name() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Name class. + /// + /// Usage name value + /// Usage name localized value. + public Name(string value = default(string), string localizedValue = default(string)) + { + Value = value; + LocalizedValue = localizedValue; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets usage name value + /// + [JsonProperty(PropertyName = "value")] + public string Value { get; set; } + + /// + /// Gets or sets usage name localized value. + /// + [JsonProperty(PropertyName = "localizedValue")] + public string LocalizedValue { get; set; } + + } +} diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/RecommendedElasticPool.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/RecommendedElasticPool.cs index 9ab5bc7e1859..64bc89c9d26f 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/RecommendedElasticPool.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/RecommendedElasticPool.cs @@ -40,7 +40,7 @@ public RecommendedElasticPool() /// The edition of the recommended /// elastic pool. The ElasticPoolEdition enumeration contains all the /// valid editions. Possible values include: 'Basic', 'Standard', - /// 'Premium' + /// 'Premium', 'GeneralPurpose', 'BusinessCritical' /// The DTU for the recommended elastic pool. /// The minimum DTU for the /// database. @@ -83,7 +83,8 @@ public RecommendedElasticPool() /// /// Gets the edition of the recommended elastic pool. The /// ElasticPoolEdition enumeration contains all the valid editions. - /// Possible values include: 'Basic', 'Standard', 'Premium' + /// Possible values include: 'Basic', 'Standard', 'Premium', + /// 'GeneralPurpose', 'BusinessCritical' /// [JsonProperty(PropertyName = "properties.databaseEdition")] public string DatabaseEdition { get; private set; } diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/Usage.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/Usage.cs new file mode 100644 index 000000000000..7895ec71d6b5 --- /dev/null +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/Models/Usage.cs @@ -0,0 +1,99 @@ +// +// 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.Sql.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// ARM usage. + /// + public partial class Usage + { + /// + /// Initializes a new instance of the Usage class. + /// + public Usage() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Usage class. + /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// Usage unit. + /// Usage current value. + /// Usage limit. + /// Usage requested limit. + public Usage(string id = default(string), Name name = default(Name), string type = default(string), string unit = default(string), int? currentValue = default(int?), int? limit = default(int?), int? requestedLimit = default(int?)) + { + Id = id; + Name = name; + Type = type; + Unit = unit; + CurrentValue = currentValue; + Limit = limit; + RequestedLimit = requestedLimit; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets resource ID. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets resource name. + /// + [JsonProperty(PropertyName = "name")] + public Name Name { get; private set; } + + /// + /// Gets resource type. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets usage unit. + /// + [JsonProperty(PropertyName = "unit")] + public string Unit { get; private set; } + + /// + /// Gets usage current value. + /// + [JsonProperty(PropertyName = "currentValue")] + public int? CurrentValue { get; private set; } + + /// + /// Gets usage limit. + /// + [JsonProperty(PropertyName = "limit")] + public int? Limit { get; private set; } + + /// + /// Gets usage requested limit. + /// + [JsonProperty(PropertyName = "requestedLimit")] + public int? RequestedLimit { get; private set; } + + } +} diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/SdkInfo_SqlManagementClient.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/SdkInfo_SqlManagementClient.cs index bf5a63564ab7..c7096f1dc5ad 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/SdkInfo_SqlManagementClient.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/SdkInfo_SqlManagementClient.cs @@ -46,6 +46,7 @@ public static IEnumerable> ApiInfo_SqlManagementCl new Tuple("Sql", "FirewallRules", "2014-04-01"), new Tuple("Sql", "GeoBackupPolicies", "2014-04-01"), new Tuple("Sql", "InstanceFailoverGroups", "2017-10-01-preview"), + new Tuple("Sql", "InstancePools", "2018-06-01-preview"), new Tuple("Sql", "JobAgents", "2017-03-01-preview"), new Tuple("Sql", "JobCredentials", "2017-03-01-preview"), new Tuple("Sql", "JobExecutions", "2017-03-01-preview"), @@ -67,7 +68,7 @@ public static IEnumerable> ApiInfo_SqlManagementCl new Tuple("Sql", "ManagedInstanceKeys", "2017-10-01-preview"), new Tuple("Sql", "ManagedInstanceTdeCertificates", "2017-10-01-preview"), new Tuple("Sql", "ManagedInstanceVulnerabilityAssessments", "2018-06-01-preview"), - new Tuple("Sql", "ManagedInstances", "2015-05-01-preview"), + new Tuple("Sql", "ManagedInstances", "2018-06-01-preview"), new Tuple("Sql", "ManagedRestorableDroppedDatabaseBackupShortTermRetentionPolicies", "2017-03-01-preview"), new Tuple("Sql", "ManagedServerSecurityAlertPolicies", "2017-03-01-preview"), new Tuple("Sql", "Operations", "2015-05-01-preview"), @@ -100,6 +101,7 @@ public static IEnumerable> ApiInfo_SqlManagementCl new Tuple("Sql", "TdeCertificates", "2017-10-01-preview"), new Tuple("Sql", "TransparentDataEncryptionActivities", "2014-04-01"), new Tuple("Sql", "TransparentDataEncryptions", "2014-04-01"), + new Tuple("Sql", "Usages", "2018-06-01-preview"), new Tuple("Sql", "VirtualClusters", "2015-05-01-preview"), new Tuple("Sql", "VirtualNetworkRules", "2015-05-01-preview"), }.AsEnumerable(); diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/SqlManagementClient.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/SqlManagementClient.cs index e7e84318508d..93bab727da9b 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/SqlManagementClient.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/SqlManagementClient.cs @@ -202,11 +202,6 @@ public partial class SqlManagementClient : ServiceClient, I /// public virtual IFailoverGroupsOperations FailoverGroups { get; private set; } - /// - /// Gets the IManagedInstancesOperations. - /// - public virtual IManagedInstancesOperations ManagedInstances { get; private set; } - /// /// Gets the IOperations. /// @@ -473,17 +468,19 @@ public partial class SqlManagementClient : ServiceClient, I public virtual IManagedDatabaseSensitivityLabelsOperations ManagedDatabaseSensitivityLabels { get; private set; } /// - /// Initializes a new instance of the SqlManagementClient class. + /// Gets the IInstancePoolsOperations. /// - /// - /// HttpClient to be used - /// - /// - /// True: will dispose the provided httpClient on calling SqlManagementClient.Dispose(). False: will not dispose provided httpClient - protected SqlManagementClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) - { - Initialize(); - } + public virtual IInstancePoolsOperations InstancePools { get; private set; } + + /// + /// Gets the IUsagesOperations. + /// + public virtual IUsagesOperations Usages { get; private set; } + + /// + /// Gets the IManagedInstancesOperations. + /// + public virtual IManagedInstancesOperations ManagedInstances { get; private set; } /// /// Initializes a new instance of the SqlManagementClient class. @@ -580,33 +577,6 @@ public SqlManagementClient(ServiceClientCredentials credentials, params Delegati } } - /// - /// Initializes a new instance of the SqlManagementClient class. - /// - /// - /// Required. Credentials needed for the client to connect to Azure. - /// - /// - /// HttpClient to be used - /// - /// - /// True: will dispose the provided httpClient on calling SqlManagementClient.Dispose(). False: will not dispose provided httpClient - /// - /// Thrown when a required parameter is null - /// - public SqlManagementClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) - { - if (credentials == null) - { - throw new System.ArgumentNullException("credentials"); - } - Credentials = credentials; - if (Credentials != null) - { - Credentials.InitializeServiceClient(this); - } - } - /// /// Initializes a new instance of the SqlManagementClient class. /// @@ -739,7 +709,6 @@ private void Initialize() DatabaseAutomaticTuning = new DatabaseAutomaticTuningOperations(this); EncryptionProtectors = new EncryptionProtectorsOperations(this); FailoverGroups = new FailoverGroupsOperations(this); - ManagedInstances = new ManagedInstancesOperations(this); Operations = new Operations(this); ServerKeys = new ServerKeysOperations(this); SyncAgents = new SyncAgentsOperations(this); @@ -793,6 +762,9 @@ private void Initialize() ManagedInstanceVulnerabilityAssessments = new ManagedInstanceVulnerabilityAssessmentsOperations(this); ServerVulnerabilityAssessments = new ServerVulnerabilityAssessmentsOperations(this); ManagedDatabaseSensitivityLabels = new ManagedDatabaseSensitivityLabelsOperations(this); + InstancePools = new InstancePoolsOperations(this); + Usages = new UsagesOperations(this); + ManagedInstances = new ManagedInstancesOperations(this); BaseUri = new System.Uri("https://management.azure.com"); AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/UsagesOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/UsagesOperations.cs new file mode 100644 index 000000000000..1744c63f95b7 --- /dev/null +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/UsagesOperations.cs @@ -0,0 +1,431 @@ +// +// 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.Sql +{ + 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; + + /// + /// UsagesOperations operations. + /// + internal partial class UsagesOperations : IServiceOperations, IUsagesOperations + { + /// + /// Initializes a new instance of the UsagesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal UsagesOperations(SqlManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the SqlManagementClient + /// + public SqlManagementClient Client { get; private set; } + + /// + /// Gets all instance pool usage metrics + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the instance pool to be retrieved. + /// + /// + /// Optional request parameter to include managed instance usages within the + /// instance 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>> ListByInstancePoolWithHttpMessagesAsync(string resourceGroupName, string instancePoolName, bool? expandChildren = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (instancePoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instancePoolName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-06-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("instancePoolName", instancePoolName); + tracingParameters.Add("expandChildren", expandChildren); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByInstancePool", 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.Sql/instancePools/{instancePoolName}/usages").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{instancePoolName}", System.Uri.EscapeDataString(instancePoolName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (expandChildren != null) + { + _queryParameters.Add(string.Format("expandChildren={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(expandChildren, Client.SerializationSettings).Trim('"')))); + } + 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 all instance pool usage metrics + /// + /// + /// 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>> ListByInstancePoolNextWithHttpMessagesAsync(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, "ListByInstancePoolNext", 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/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/UsagesOperationsExtensions.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/UsagesOperationsExtensions.cs new file mode 100644 index 000000000000..446fd93cc838 --- /dev/null +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Generated/UsagesOperationsExtensions.cs @@ -0,0 +1,109 @@ +// +// 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.Sql +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for UsagesOperations. + /// + public static partial class UsagesOperationsExtensions + { + /// + /// Gets all instance pool usage metrics + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the instance pool to be retrieved. + /// + /// + /// Optional request parameter to include managed instance usages within the + /// instance pool. + /// + public static IPage ListByInstancePool(this IUsagesOperations operations, string resourceGroupName, string instancePoolName, bool? expandChildren = default(bool?)) + { + return operations.ListByInstancePoolAsync(resourceGroupName, instancePoolName, expandChildren).GetAwaiter().GetResult(); + } + + /// + /// Gets all instance pool usage metrics + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the instance pool to be retrieved. + /// + /// + /// Optional request parameter to include managed instance usages within the + /// instance pool. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByInstancePoolAsync(this IUsagesOperations operations, string resourceGroupName, string instancePoolName, bool? expandChildren = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByInstancePoolWithHttpMessagesAsync(resourceGroupName, instancePoolName, expandChildren, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets all instance pool usage metrics + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByInstancePoolNext(this IUsagesOperations operations, string nextPageLink) + { + return operations.ListByInstancePoolNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all instance pool usage metrics + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByInstancePoolNextAsync(this IUsagesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByInstancePoolNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/tests/InstancePoolCrudScenarioTests.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/tests/InstancePoolCrudScenarioTests.cs new file mode 100644 index 000000000000..fb4db1df30f1 --- /dev/null +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/tests/InstancePoolCrudScenarioTests.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using Microsoft.Azure.Management.Sql; +using Microsoft.Azure.Management.Sql.Models; +using System.Collections.Generic; +using System.Linq; +using Xunit; + +namespace Sql.Tests +{ + public class InstancePoolCrudScenarioTests + { + [Fact] + public void TestCreateUpdateGetDropInstancePool() + { + using (SqlManagementTestContext context = new SqlManagementTestContext(this)) + { + SqlManagementClient sqlClient = context.GetClient(); + + // Setup + string subscriptionId = "2e7fe4bd-90c7-454e-8bb6-dc44649f27b2"; + string resourceGroupName = "sqlcrudtest-5294"; + string instancePoolName = "sqlcl-crudtestinstancepool-dotnetsdk1"; + string subnetId = $"/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/instancepoolnetsdkcanadacentral/providers/Microsoft.Network/virtualNetworks/vnet-instancepoolnetsdkcanadacentral/subnets/InstancePool"; + string location = "canadacentral"; + int instancePoolVCores = 32; + var tags1 = new Dictionary() + { + {"tagKey1", "TagValue1"} + }; + var tags2 = new Dictionary() + { + {"tagKey2", "TagValue2"} + }; + + // Create an instance pool + var instancePool = sqlClient.InstancePools.CreateOrUpdate( + resourceGroupName, + instancePoolName, + parameters: new InstancePool() + { + LicenseType = "LicenseIncluded", + Sku = new Sku() + { + Name = "GP_Gen5", + Tier = "GeneralPurpose", + Family = "Gen5" + }, + SubnetId = subnetId, + Tags = tags1, + VCores = instancePoolVCores, + Location = location + }); + + SqlManagementTestUtilities.ValidateInstancePool( + instancePool, + instancePoolName, vCores: instancePoolVCores, subnetId: subnetId, location: location, tags: tags1); + + // Update the instance pool tags + instancePool = sqlClient.InstancePools.Update( + resourceGroupName, + instancePoolName, + parameters: new InstancePoolUpdate(tags: tags2)); + + SqlManagementTestUtilities.ValidateInstancePool( + instancePool, + instancePoolName, vCores: instancePoolVCores, subnetId: subnetId, location: location, tags: tags2); + + // Get the instance pool + instancePool = sqlClient.InstancePools.Get( + resourceGroupName, + instancePoolName); + + SqlManagementTestUtilities.ValidateInstancePool( + instancePool, + instancePoolName, vCores: instancePoolVCores, subnetId: subnetId, location: location, tags: tags2); + + // Get the resource group instance pools + var instancePoolsRg = sqlClient.InstancePools.ListByResourceGroup(resourceGroupName); + Assert.NotNull(instancePoolsRg); + + // Gets all instance pools in sub + var instancePoolsSub = sqlClient.InstancePools.List(); + Assert.NotNull(instancePoolsSub); + + // Verify usage + var instancePoolUsage = sqlClient.Usages.ListByInstancePool(resourceGroupName, instancePoolName, true).ToList(); + SqlManagementTestUtilities.ValidateInstancePoolUsage(instancePoolUsage[0], + currentValue: 0, limit: instancePoolVCores, requestedLimit: null, usageName: "VCore utilization"); + SqlManagementTestUtilities.ValidateInstancePoolUsage(instancePoolUsage[1], + currentValue: 0, limit: 8192, requestedLimit: null, usageName: "Storage utilization"); + SqlManagementTestUtilities.ValidateInstancePoolUsage(instancePoolUsage[2], + currentValue: 0, limit: 100, requestedLimit: null, usageName: "Database utilization"); + + var instanceParams = new ManagedInstance + { + AdministratorLogin = "cloudsa", + AdministratorLoginPassword = "Yukon900!", + InstancePoolId = instancePool.Id, + Location = location, + PublicDataEndpointEnabled = true, + Sku = new Sku + { + Name = "GP_Gen5", + Tier = "GeneralPurpose", + Family = "Gen5" + }, + StorageSizeInGB = 32, + SubnetId = instancePool.SubnetId, + VCores = 2, + Tags = tags1 + }; + + // Create instance 1 in pool + var instance1 = sqlClient.ManagedInstances.CreateOrUpdate(resourceGroupName, "netsdk-instance-in-pool-1-cc", parameters: instanceParams); + SqlManagementTestUtilities.ValidateManagedInstance(instance1, "netsdk-instance-in-pool-1-cc", "cloudsa", tags1, location, instancePool.Id); + + // Create instance 2 in pool + var instance2 = sqlClient.ManagedInstances.CreateOrUpdate(resourceGroupName, "netsdk-instance-in-pool-2-cc", parameters: instanceParams); + SqlManagementTestUtilities.ValidateManagedInstance(instance2, "netsdk-instance-in-pool-2-cc", "cloudsa", tags1, location, instancePool.Id); + + // Gets instances in an instance pool + var instances = sqlClient.ManagedInstances.ListByInstancePool(resourceGroupName, instancePoolName); + instances = sqlClient.ManagedInstances.ListByInstancePool(resourceGroupName, instancePoolName); + Assert.Equal(2, instances.Count()); + + // Validate instance pool usage + instancePoolUsage = sqlClient.Usages.ListByInstancePool(resourceGroupName, instancePoolName, true).ToList(); + SqlManagementTestUtilities.ValidateInstancePoolUsage(instancePoolUsage[0], + currentValue: 4, limit: instancePoolVCores, requestedLimit: null, usageName: "VCore utilization"); + SqlManagementTestUtilities.ValidateInstancePoolUsage(instancePoolUsage[1], + currentValue: 64, limit: 8192, requestedLimit: null, usageName: "Storage utilization"); + SqlManagementTestUtilities.ValidateInstancePoolUsage(instancePoolUsage[2], + currentValue: 0, limit: 100, requestedLimit: null, usageName: "Database utilization"); + + // Delete the instances in the instance pool + foreach (var instance in instances) + { + sqlClient.ManagedInstances.Delete(resourceGroupName, instance.Name); + } + + // Delete the instance pool + sqlClient.InstancePools.Delete(resourceGroupName, instancePool.Name); + } + } + } +} diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/tests/SessionRecords/Sql.Tests.InstancePoolCrudScenarioTests/TestCreateUpdateGetDropInstancePool.json b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/tests/SessionRecords/Sql.Tests.InstancePoolCrudScenarioTests/TestCreateUpdateGetDropInstancePool.json new file mode 100644 index 000000000000..c9ae7aab6a67 --- /dev/null +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/tests/SessionRecords/Sql.Tests.InstancePoolCrudScenarioTests/TestCreateUpdateGetDropInstancePool.json @@ -0,0 +1,1968 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/instancePools/sqlcl-crudtestinstancepool-dotnetsdk1?api-version=2018-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMmU3ZmU0YmQtOTBjNy00NTRlLThiYjYtZGM0NDY0OWYyN2IyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTUyOTQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvaW5zdGFuY2VQb29scy9zcWxjbC1jcnVkdGVzdGluc3RhbmNlcG9vbC1kb3RuZXRzZGsxP2FwaS12ZXJzaW9uPTIwMTgtMDYtMDEtcHJldmlldw==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"sku\": {\r\n \"name\": \"GP_Gen5\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen5\"\r\n },\r\n \"properties\": {\r\n \"subnetId\": \"/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/instancepoolnetsdkcanadacentral/providers/Microsoft.Network/virtualNetworks/vnet-instancepoolnetsdkcanadacentral/subnets/InstancePool\",\r\n \"vCores\": 32,\r\n \"licenseType\": \"LicenseIncluded\"\r\n },\r\n \"location\": \"canadacentral\",\r\n \"tags\": {\r\n \"tagKey1\": \"TagValue1\"\r\n }\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "26cfd1b6-72e0-4dea-9249-f8ca8d28c563" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.00001.0", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.31.0.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "480" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 09 Jul 2019 22:10:16 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/locations/canadacentral/instancePoolOperationResults/c34961c3-b74b-43b3-97c8-9fe0655811ac?api-version=2018-06-01-preview" + ], + "Retry-After": [ + "60" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/locations/canadacentral/instancePoolAzureAsyncOperation/c34961c3-b74b-43b3-97c8-9fe0655811ac?api-version=2018-06-01-preview" + ], + "x-ms-request-id": [ + "30a7e87b-a806-401f-b73a-618cf7a2c6ba" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-correlation-request-id": [ + "8c422431-df24-45ab-9b43-6e51efaa978c" + ], + "x-ms-routing-request-id": [ + "WESTUS:20190709T221017Z:8c422431-df24-45ab-9b43-6e51efaa978c" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Content-Length": [ + "78" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"operation\": \"UpsertInstancePoolAsync\",\r\n \"startTime\": \"2019-07-09T22:10:17.017Z\"\r\n}", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/locations/canadacentral/instancePoolAzureAsyncOperation/c34961c3-b74b-43b3-97c8-9fe0655811ac?api-version=2018-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMmU3ZmU0YmQtOTBjNy00NTRlLThiYjYtZGM0NDY0OWYyN2IyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTUyOTQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbG9jYXRpb25zL2NhbmFkYWNlbnRyYWwvaW5zdGFuY2VQb29sQXp1cmVBc3luY09wZXJhdGlvbi9jMzQ5NjFjMy1iNzRiLTQzYjMtOTdjOC05ZmUwNjU1ODExYWM/YXBpLXZlcnNpb249MjAxOC0wNi0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.00001.0", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.31.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 09 Jul 2019 22:11:17 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "60" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "38366258-bf79-4ee4-a128-7679262aac05" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11999" + ], + "x-ms-correlation-request-id": [ + "61741ad9-a77a-450f-8bf4-b334fea6c04a" + ], + "x-ms-routing-request-id": [ + "WESTUS:20190709T221118Z:61741ad9-a77a-450f-8bf4-b334fea6c04a" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Content-Length": [ + "107" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"name\": \"c34961c3-b74b-43b3-97c8-9fe0655811ac\",\r\n \"status\": \"Succeeded\",\r\n \"startTime\": \"2019-07-09T22:10:17.017Z\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/instancePools/sqlcl-crudtestinstancepool-dotnetsdk1?api-version=2018-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMmU3ZmU0YmQtOTBjNy00NTRlLThiYjYtZGM0NDY0OWYyN2IyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTUyOTQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvaW5zdGFuY2VQb29scy9zcWxjbC1jcnVkdGVzdGluc3RhbmNlcG9vbC1kb3RuZXRzZGsxP2FwaS12ZXJzaW9uPTIwMTgtMDYtMDEtcHJldmlldw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.00001.0", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.31.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 09 Jul 2019 22:11:17 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "89dbbb15-9e8d-470d-833c-e2e997dd57b5" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11998" + ], + "x-ms-correlation-request-id": [ + "4f6db02a-8cee-47db-b495-a9b14d8ea90f" + ], + "x-ms-routing-request-id": [ + "WESTUS:20190709T221118Z:4f6db02a-8cee-47db-b495-a9b14d8ea90f" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Content-Length": [ + "648" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"sku\": {\r\n \"name\": \"GP_Gen5\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen5\"\r\n },\r\n \"properties\": {\r\n \"subnetId\": \"/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/instancepoolnetsdkcanadacentral/providers/Microsoft.Network/virtualNetworks/vnet-instancepoolnetsdkcanadacentral/subnets/InstancePool\",\r\n \"vCores\": 32,\r\n \"licenseType\": \"LicenseIncluded\"\r\n },\r\n \"location\": \"canadacentral\",\r\n \"tags\": {\r\n \"tagKey1\": \"TagValue1\"\r\n },\r\n \"id\": \"/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/instancePools/sqlcl-crudtestinstancepool-dotnetsdk1\",\r\n \"name\": \"sqlcl-crudtestinstancepool-dotnetsdk1\",\r\n \"type\": \"Microsoft.Sql/instancePools\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/instancePools/sqlcl-crudtestinstancepool-dotnetsdk1?api-version=2018-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMmU3ZmU0YmQtOTBjNy00NTRlLThiYjYtZGM0NDY0OWYyN2IyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTUyOTQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvaW5zdGFuY2VQb29scy9zcWxjbC1jcnVkdGVzdGluc3RhbmNlcG9vbC1kb3RuZXRzZGsxP2FwaS12ZXJzaW9uPTIwMTgtMDYtMDEtcHJldmlldw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.00001.0", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.31.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 09 Jul 2019 22:12:19 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "1298f78c-b789-446b-b610-92daa78266e0" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11985" + ], + "x-ms-correlation-request-id": [ + "d8fc71d7-7b4d-4b96-ad8e-dceca6f62fc9" + ], + "x-ms-routing-request-id": [ + "WESTUS:20190709T221219Z:d8fc71d7-7b4d-4b96-ad8e-dceca6f62fc9" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Content-Length": [ + "648" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"sku\": {\r\n \"name\": \"GP_Gen5\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen5\"\r\n },\r\n \"properties\": {\r\n \"subnetId\": \"/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/instancepoolnetsdkcanadacentral/providers/Microsoft.Network/virtualNetworks/vnet-instancepoolnetsdkcanadacentral/subnets/InstancePool\",\r\n \"vCores\": 32,\r\n \"licenseType\": \"LicenseIncluded\"\r\n },\r\n \"location\": \"canadacentral\",\r\n \"tags\": {\r\n \"tagKey2\": \"TagValue2\"\r\n },\r\n \"id\": \"/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/instancePools/sqlcl-crudtestinstancepool-dotnetsdk1\",\r\n \"name\": \"sqlcl-crudtestinstancepool-dotnetsdk1\",\r\n \"type\": \"Microsoft.Sql/instancePools\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/instancePools/sqlcl-crudtestinstancepool-dotnetsdk1?api-version=2018-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMmU3ZmU0YmQtOTBjNy00NTRlLThiYjYtZGM0NDY0OWYyN2IyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTUyOTQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvaW5zdGFuY2VQb29scy9zcWxjbC1jcnVkdGVzdGluc3RhbmNlcG9vbC1kb3RuZXRzZGsxP2FwaS12ZXJzaW9uPTIwMTgtMDYtMDEtcHJldmlldw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "dc8fac1a-fdfe-4e75-ad55-6ed769d95893" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.00001.0", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.31.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 09 Jul 2019 22:12:19 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "eb783d2c-f5a7-404e-bea6-68714ffac505" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11984" + ], + "x-ms-correlation-request-id": [ + "4339ba0f-40e3-4a2f-a258-91ffd93c99cc" + ], + "x-ms-routing-request-id": [ + "WESTUS:20190709T221219Z:4339ba0f-40e3-4a2f-a258-91ffd93c99cc" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Content-Length": [ + "648" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"sku\": {\r\n \"name\": \"GP_Gen5\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen5\"\r\n },\r\n \"properties\": {\r\n \"subnetId\": \"/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/instancepoolnetsdkcanadacentral/providers/Microsoft.Network/virtualNetworks/vnet-instancepoolnetsdkcanadacentral/subnets/InstancePool\",\r\n \"vCores\": 32,\r\n \"licenseType\": \"LicenseIncluded\"\r\n },\r\n \"location\": \"canadacentral\",\r\n \"tags\": {\r\n \"tagKey2\": \"TagValue2\"\r\n },\r\n \"id\": \"/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/instancePools/sqlcl-crudtestinstancepool-dotnetsdk1\",\r\n \"name\": \"sqlcl-crudtestinstancepool-dotnetsdk1\",\r\n \"type\": \"Microsoft.Sql/instancePools\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/instancePools/sqlcl-crudtestinstancepool-dotnetsdk1?api-version=2018-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMmU3ZmU0YmQtOTBjNy00NTRlLThiYjYtZGM0NDY0OWYyN2IyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTUyOTQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvaW5zdGFuY2VQb29scy9zcWxjbC1jcnVkdGVzdGluc3RhbmNlcG9vbC1kb3RuZXRzZGsxP2FwaS12ZXJzaW9uPTIwMTgtMDYtMDEtcHJldmlldw==", + "RequestMethod": "PATCH", + "RequestBody": "{\r\n \"tags\": {\r\n \"tagKey2\": \"TagValue2\"\r\n }\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "dc98a8be-d629-4a3a-a580-6075d9f392b8" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.00001.0", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.31.0.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "50" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 09 Jul 2019 22:11:18 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/locations/canadacentral/instancePoolOperationResults/96e11289-13c5-4234-9c5c-09050ad5aae9?api-version=2018-06-01-preview" + ], + "Retry-After": [ + "60" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/locations/canadacentral/instancePoolAzureAsyncOperation/96e11289-13c5-4234-9c5c-09050ad5aae9?api-version=2018-06-01-preview" + ], + "x-ms-request-id": [ + "bb1ad43d-d147-4b09-bf52-7cd3fc74caa0" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-correlation-request-id": [ + "d404b92a-676b-4e6e-95df-72e368dcffac" + ], + "x-ms-routing-request-id": [ + "WESTUS:20190709T221118Z:d404b92a-676b-4e6e-95df-72e368dcffac" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Content-Length": [ + "78" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"operation\": \"UpsertInstancePoolAsync\",\r\n \"startTime\": \"2019-07-09T22:11:18.847Z\"\r\n}", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/locations/canadacentral/instancePoolAzureAsyncOperation/96e11289-13c5-4234-9c5c-09050ad5aae9?api-version=2018-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMmU3ZmU0YmQtOTBjNy00NTRlLThiYjYtZGM0NDY0OWYyN2IyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTUyOTQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbG9jYXRpb25zL2NhbmFkYWNlbnRyYWwvaW5zdGFuY2VQb29sQXp1cmVBc3luY09wZXJhdGlvbi85NmUxMTI4OS0xM2M1LTQyMzQtOWM1Yy0wOTA1MGFkNWFhZTk/YXBpLXZlcnNpb249MjAxOC0wNi0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.00001.0", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.31.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 09 Jul 2019 22:12:18 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "60" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "b0d32964-851b-44ab-be2b-221b02cb5a47" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11986" + ], + "x-ms-correlation-request-id": [ + "ffbc240f-a919-4736-bfa0-24f495b33fec" + ], + "x-ms-routing-request-id": [ + "WESTUS:20190709T221219Z:ffbc240f-a919-4736-bfa0-24f495b33fec" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Content-Length": [ + "107" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"name\": \"96e11289-13c5-4234-9c5c-09050ad5aae9\",\r\n \"status\": \"Succeeded\",\r\n \"startTime\": \"2019-07-09T22:11:18.847Z\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/instancePools?api-version=2018-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMmU3ZmU0YmQtOTBjNy00NTRlLThiYjYtZGM0NDY0OWYyN2IyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTUyOTQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvaW5zdGFuY2VQb29scz9hcGktdmVyc2lvbj0yMDE4LTA2LTAxLXByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "70eb9235-fd5a-4b8a-92e3-fa2dfbf4c952" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.00001.0", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.31.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 09 Jul 2019 22:12:19 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "9653434d-12f4-4182-a8f8-6a6449cb659d" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11983" + ], + "x-ms-correlation-request-id": [ + "772ed6e3-ab57-4289-99c2-2333bc6dafeb" + ], + "x-ms-routing-request-id": [ + "WESTUS:20190709T221220Z:772ed6e3-ab57-4289-99c2-2333bc6dafeb" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Content-Length": [ + "660" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"sku\": {\r\n \"name\": \"GP_Gen5\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen5\"\r\n },\r\n \"properties\": {\r\n \"subnetId\": \"/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/instancepoolnetsdkcanadacentral/providers/Microsoft.Network/virtualNetworks/vnet-instancepoolnetsdkcanadacentral/subnets/InstancePool\",\r\n \"vCores\": 32,\r\n \"licenseType\": \"LicenseIncluded\"\r\n },\r\n \"location\": \"canadacentral\",\r\n \"tags\": {\r\n \"tagKey2\": \"TagValue2\"\r\n },\r\n \"id\": \"/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/instancePools/sqlcl-crudtestinstancepool-dotnetsdk1\",\r\n \"name\": \"sqlcl-crudtestinstancepool-dotnetsdk1\",\r\n \"type\": \"Microsoft.Sql/instancePools\"\r\n }\r\n ]\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/providers/Microsoft.Sql/instancePools?api-version=2018-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMmU3ZmU0YmQtOTBjNy00NTRlLThiYjYtZGM0NDY0OWYyN2IyL3Byb3ZpZGVycy9NaWNyb3NvZnQuU3FsL2luc3RhbmNlUG9vbHM/YXBpLXZlcnNpb249MjAxOC0wNi0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "30db88de-01bd-4977-a25d-630c454ef5c4" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.00001.0", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.31.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 09 Jul 2019 22:12:19 GMT" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-original-request-ids": [ + "39a60494-4d2c-432e-83dc-088c12253f1c", + "9b09e957-c591-4d42-88a0-f4ab619536b1" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11982" + ], + "x-ms-request-id": [ + "9725d64f-94d0-4cf3-8456-4bd0b9dbcb42" + ], + "x-ms-correlation-request-id": [ + "9725d64f-94d0-4cf3-8456-4bd0b9dbcb42" + ], + "x-ms-routing-request-id": [ + "WESTUS:20190709T221220Z:9725d64f-94d0-4cf3-8456-4bd0b9dbcb42" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Content-Length": [ + "1244" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"sku\": {\r\n \"name\": \"GP_Gen5\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen5\"\r\n },\r\n \"properties\": {\r\n \"subnetId\": \"/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/instancepoolnetsdkcanadacentral/providers/Microsoft.Network/virtualNetworks/vnet-instancepoolnetsdkcanadacentral/subnets/InstancePool\",\r\n \"vCores\": 32,\r\n \"licenseType\": \"LicenseIncluded\"\r\n },\r\n \"location\": \"canadacentral\",\r\n \"tags\": {\r\n \"tagKey2\": \"TagValue2\"\r\n },\r\n \"id\": \"/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/instancePools/sqlcl-crudtestinstancepool-dotnetsdk1\",\r\n \"name\": \"sqlcl-crudtestinstancepool-dotnetsdk1\",\r\n \"type\": \"Microsoft.Sql/instancePools\"\r\n },\r\n {\r\n \"sku\": {\r\n \"name\": \"GP_Gen5\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen5\"\r\n },\r\n \"properties\": {\r\n \"subnetId\": \"/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/instancepoolnetsdkcanadacentral/providers/Microsoft.Network/virtualNetworks/vnet-netsdk-jp/subnets/InstancePool\",\r\n \"vCores\": 16,\r\n \"licenseType\": \"LicenseIncluded\"\r\n },\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {\r\n \"tagKey2\": \"TagValue2\"\r\n },\r\n \"id\": \"/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/instancepoolnetsdkcanadacentral/providers/Microsoft.Sql/instancePools/netsdk-jp\",\r\n \"name\": \"netsdk-jp\",\r\n \"type\": \"Microsoft.Sql/instancePools\"\r\n }\r\n ]\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/instancePools/sqlcl-crudtestinstancepool-dotnetsdk1/usages?expandChildren=true&api-version=2018-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMmU3ZmU0YmQtOTBjNy00NTRlLThiYjYtZGM0NDY0OWYyN2IyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTUyOTQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvaW5zdGFuY2VQb29scy9zcWxjbC1jcnVkdGVzdGluc3RhbmNlcG9vbC1kb3RuZXRzZGsxL3VzYWdlcz9leHBhbmRDaGlsZHJlbj10cnVlJmFwaS12ZXJzaW9uPTIwMTgtMDYtMDEtcHJldmlldw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "3d8188df-dc89-4509-86ce-715d4ba03dd6" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.00001.0", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.31.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 09 Jul 2019 22:12:19 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "5db9624f-7593-47da-85c3-acd39ab8015d" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11981" + ], + "x-ms-correlation-request-id": [ + "f5f49ce0-ab01-4c3c-a46a-1921e4ae8e16" + ], + "x-ms-routing-request-id": [ + "WESTUS:20190709T221220Z:f5f49ce0-ab01-4c3c-a46a-1921e4ae8e16" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Content-Length": [ + "1113" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/instancePools/sqlcl-crudtestinstancepool-dotnetsdk1/usages/vcore_utilization\",\r\n \"name\": {\r\n \"value\": \"VCore utilization\",\r\n \"localizedValue\": \"VCore utilization\"\r\n },\r\n \"type\": \"Microsoft.Sql/instancePools/usages\",\r\n \"unit\": \"VCores\",\r\n \"currentValue\": 0,\r\n \"limit\": 32\r\n },\r\n {\r\n \"id\": \"/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/instancePools/sqlcl-crudtestinstancepool-dotnetsdk1/usages/storage_utilization\",\r\n \"name\": {\r\n \"value\": \"Storage utilization\",\r\n \"localizedValue\": \"Storage utilization\"\r\n },\r\n \"type\": \"Microsoft.Sql/instancePools/usages\",\r\n \"unit\": \"Gigabytes\",\r\n \"currentValue\": 0,\r\n \"limit\": 8192\r\n },\r\n {\r\n \"id\": \"/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/instancePools/sqlcl-crudtestinstancepool-dotnetsdk1/usages/database_utilization\",\r\n \"name\": {\r\n \"value\": \"Database utilization\",\r\n \"localizedValue\": \"Database utilization\"\r\n },\r\n \"type\": \"Microsoft.Sql/instancePools/usages\",\r\n \"unit\": \"Number Of Databases\",\r\n \"currentValue\": 0,\r\n \"limit\": 100\r\n }\r\n ]\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/instancePools/sqlcl-crudtestinstancepool-dotnetsdk1/usages?expandChildren=true&api-version=2018-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMmU3ZmU0YmQtOTBjNy00NTRlLThiYjYtZGM0NDY0OWYyN2IyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTUyOTQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvaW5zdGFuY2VQb29scy9zcWxjbC1jcnVkdGVzdGluc3RhbmNlcG9vbC1kb3RuZXRzZGsxL3VzYWdlcz9leHBhbmRDaGlsZHJlbj10cnVlJmFwaS12ZXJzaW9uPTIwMTgtMDYtMDEtcHJldmlldw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "6f1e8472-12f5-41d2-b6b6-938d5648a12f" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.00001.0", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.31.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 09 Jul 2019 22:17:27 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "cb6b821f-c35e-43bd-8179-c8cc9fcc24a1" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11995" + ], + "x-ms-correlation-request-id": [ + "b9d26a95-bd91-43dd-8402-60cb3abda605" + ], + "x-ms-routing-request-id": [ + "WESTUS:20190709T221728Z:b9d26a95-bd91-43dd-8402-60cb3abda605" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Content-Length": [ + "3622" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/instancePools/sqlcl-crudtestinstancepool-dotnetsdk1/usages/vcore_utilization\",\r\n \"name\": {\r\n \"value\": \"VCore utilization\",\r\n \"localizedValue\": \"VCore utilization\"\r\n },\r\n \"type\": \"Microsoft.Sql/instancePools/usages\",\r\n \"unit\": \"VCores\",\r\n \"currentValue\": 4,\r\n \"limit\": 32\r\n },\r\n {\r\n \"id\": \"/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/instancePools/sqlcl-crudtestinstancepool-dotnetsdk1/usages/storage_utilization\",\r\n \"name\": {\r\n \"value\": \"Storage utilization\",\r\n \"localizedValue\": \"Storage utilization\"\r\n },\r\n \"type\": \"Microsoft.Sql/instancePools/usages\",\r\n \"unit\": \"Gigabytes\",\r\n \"currentValue\": 64,\r\n \"limit\": 8192\r\n },\r\n {\r\n \"id\": \"/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/instancePools/sqlcl-crudtestinstancepool-dotnetsdk1/usages/database_utilization\",\r\n \"name\": {\r\n \"value\": \"Database utilization\",\r\n \"localizedValue\": \"Database utilization\"\r\n },\r\n \"type\": \"Microsoft.Sql/instancePools/usages\",\r\n \"unit\": \"Number Of Databases\",\r\n \"currentValue\": 0,\r\n \"limit\": 100\r\n },\r\n {\r\n \"id\": \"/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/instancePools/sqlcl-crudtestinstancepool-dotnetsdk1/managedInstances/netsdk-instance-in-pool-1-cc/usages/vcore_utilization\",\r\n \"name\": {\r\n \"value\": \"VCore utilization\",\r\n \"localizedValue\": \"VCore utilization\"\r\n },\r\n \"type\": \"Microsoft.Sql/instancePools/managedInstances/usages\",\r\n \"unit\": \"VCores\",\r\n \"limit\": 2\r\n },\r\n {\r\n \"id\": \"/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/instancePools/sqlcl-crudtestinstancepool-dotnetsdk1/managedInstances/netsdk-instance-in-pool-2-cc/usages/vcore_utilization\",\r\n \"name\": {\r\n \"value\": \"VCore utilization\",\r\n \"localizedValue\": \"VCore utilization\"\r\n },\r\n \"type\": \"Microsoft.Sql/instancePools/managedInstances/usages\",\r\n \"unit\": \"VCores\",\r\n \"limit\": 2\r\n },\r\n {\r\n \"id\": \"/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/instancePools/sqlcl-crudtestinstancepool-dotnetsdk1/managedInstances/netsdk-instance-in-pool-1-cc/usages/storage_utilization\",\r\n \"name\": {\r\n \"value\": \"Storage utilization\",\r\n \"localizedValue\": \"Storage utilization\"\r\n },\r\n \"type\": \"Microsoft.Sql/instancePools/managedInstances/usages\",\r\n \"unit\": \"Gigabytes\",\r\n \"limit\": 32\r\n },\r\n {\r\n \"id\": \"/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/instancePools/sqlcl-crudtestinstancepool-dotnetsdk1/managedInstances/netsdk-instance-in-pool-2-cc/usages/storage_utilization\",\r\n \"name\": {\r\n \"value\": \"Storage utilization\",\r\n \"localizedValue\": \"Storage utilization\"\r\n },\r\n \"type\": \"Microsoft.Sql/instancePools/managedInstances/usages\",\r\n \"unit\": \"Gigabytes\",\r\n \"limit\": 32\r\n },\r\n {\r\n \"id\": \"/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/instancePools/sqlcl-crudtestinstancepool-dotnetsdk1/managedInstances/netsdk-instance-in-pool-1-cc/usages/database_utilization\",\r\n \"name\": {\r\n \"value\": \"Database utilization\",\r\n \"localizedValue\": \"Database utilization\"\r\n },\r\n \"type\": \"Microsoft.Sql/instancePools/managedInstances/usages\",\r\n \"unit\": \"Number Of Databases\",\r\n \"currentValue\": 0,\r\n \"limit\": 100\r\n },\r\n {\r\n \"id\": \"/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/instancePools/sqlcl-crudtestinstancepool-dotnetsdk1/managedInstances/netsdk-instance-in-pool-2-cc/usages/database_utilization\",\r\n \"name\": {\r\n \"value\": \"Database utilization\",\r\n \"localizedValue\": \"Database utilization\"\r\n },\r\n \"type\": \"Microsoft.Sql/instancePools/managedInstances/usages\",\r\n \"unit\": \"Number Of Databases\",\r\n \"currentValue\": 0,\r\n \"limit\": 100\r\n }\r\n ]\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/managedInstances/netsdk-instance-in-pool-1-cc?api-version=2018-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMmU3ZmU0YmQtOTBjNy00NTRlLThiYjYtZGM0NDY0OWYyN2IyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTUyOTQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXRzZGstaW5zdGFuY2UtaW4tcG9vbC0xLWNjP2FwaS12ZXJzaW9uPTIwMTgtMDYtMDEtcHJldmlldw==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"sku\": {\r\n \"name\": \"GP_Gen5\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen5\"\r\n },\r\n \"properties\": {\r\n \"administratorLogin\": \"cloudsa\",\r\n \"administratorLoginPassword\": \"Yukon900!\",\r\n \"subnetId\": \"/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/instancepoolnetsdkcanadacentral/providers/Microsoft.Network/virtualNetworks/vnet-instancepoolnetsdkcanadacentral/subnets/InstancePool\",\r\n \"vCores\": 2,\r\n \"storageSizeInGB\": 32,\r\n \"publicDataEndpointEnabled\": true,\r\n \"instancePoolId\": \"/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/instancePools/sqlcl-crudtestinstancepool-dotnetsdk1\"\r\n },\r\n \"location\": \"canadacentral\",\r\n \"tags\": {\r\n \"tagKey1\": \"TagValue1\"\r\n }\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "239e8543-7b18-410e-bd8c-3667f8518fa7" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.00001.0", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.31.0.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "780" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 09 Jul 2019 22:12:21 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/locations/canadacentral/managedInstanceOperationResults/d772433c-a68a-4702-8e6a-759c16b0f628?api-version=2018-06-01-preview" + ], + "Retry-After": [ + "60" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/locations/canadacentral/managedInstanceAzureAsyncOperation/d772433c-a68a-4702-8e6a-759c16b0f628?api-version=2018-06-01-preview" + ], + "x-ms-request-id": [ + "d772433c-a68a-4702-8e6a-759c16b0f628" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1198" + ], + "x-ms-correlation-request-id": [ + "99107264-9265-4732-951f-0b87c2f6a817" + ], + "x-ms-routing-request-id": [ + "WESTUS:20190709T221222Z:99107264-9265-4732-951f-0b87c2f6a817" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Content-Length": [ + "74" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"operation\": \"UpsertManagedServer\",\r\n \"startTime\": \"2019-07-09T22:12:22.117Z\"\r\n}", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/locations/canadacentral/managedInstanceAzureAsyncOperation/d772433c-a68a-4702-8e6a-759c16b0f628?api-version=2018-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMmU3ZmU0YmQtOTBjNy00NTRlLThiYjYtZGM0NDY0OWYyN2IyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTUyOTQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbG9jYXRpb25zL2NhbmFkYWNlbnRyYWwvbWFuYWdlZEluc3RhbmNlQXp1cmVBc3luY09wZXJhdGlvbi9kNzcyNDMzYy1hNjhhLTQ3MDItOGU2YS03NTljMTZiMGY2Mjg/YXBpLXZlcnNpb249MjAxOC0wNi0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.00001.0", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.31.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 09 Jul 2019 22:13:22 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "60" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "0d6a3f19-8ed0-4860-a2ae-9c61254002b2" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11980" + ], + "x-ms-correlation-request-id": [ + "ca524f60-d276-477f-ae3c-c4dd63461476" + ], + "x-ms-routing-request-id": [ + "WESTUS:20190709T221322Z:ca524f60-d276-477f-ae3c-c4dd63461476" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Content-Length": [ + "108" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"name\": \"d772433c-a68a-4702-8e6a-759c16b0f628\",\r\n \"status\": \"InProgress\",\r\n \"startTime\": \"2019-07-09T22:12:22.117Z\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/locations/canadacentral/managedInstanceAzureAsyncOperation/d772433c-a68a-4702-8e6a-759c16b0f628?api-version=2018-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMmU3ZmU0YmQtOTBjNy00NTRlLThiYjYtZGM0NDY0OWYyN2IyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTUyOTQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbG9jYXRpb25zL2NhbmFkYWNlbnRyYWwvbWFuYWdlZEluc3RhbmNlQXp1cmVBc3luY09wZXJhdGlvbi9kNzcyNDMzYy1hNjhhLTQ3MDItOGU2YS03NTljMTZiMGY2Mjg/YXBpLXZlcnNpb249MjAxOC0wNi0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.00001.0", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.31.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 09 Jul 2019 22:14:23 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "60" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "457c18c3-60e8-4e3f-89e6-80b86ba6a2c0" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11999" + ], + "x-ms-correlation-request-id": [ + "72a7e83c-494e-4202-9e31-091969f776d3" + ], + "x-ms-routing-request-id": [ + "WESTUS:20190709T221423Z:72a7e83c-494e-4202-9e31-091969f776d3" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Content-Length": [ + "107" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"name\": \"d772433c-a68a-4702-8e6a-759c16b0f628\",\r\n \"status\": \"Succeeded\",\r\n \"startTime\": \"2019-07-09T22:12:22.117Z\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/managedInstances/netsdk-instance-in-pool-1-cc?api-version=2018-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMmU3ZmU0YmQtOTBjNy00NTRlLThiYjYtZGM0NDY0OWYyN2IyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTUyOTQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXRzZGstaW5zdGFuY2UtaW4tcG9vbC0xLWNjP2FwaS12ZXJzaW9uPTIwMTgtMDYtMDEtcHJldmlldw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.00001.0", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.31.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 09 Jul 2019 22:14:23 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "19c98131-f851-47a5-8d13-125ad48f2d01" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11998" + ], + "x-ms-correlation-request-id": [ + "2ee75336-f298-4d38-b8bd-9beea6687dc2" + ], + "x-ms-routing-request-id": [ + "WESTUS:20190709T221423Z:2ee75336-f298-4d38-b8bd-9beea6687dc2" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Content-Length": [ + "1107" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"sku\": {\r\n \"name\": \"GP_Gen5\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen5\",\r\n \"capacity\": 2\r\n },\r\n \"properties\": {\r\n \"fullyQualifiedDomainName\": \"netsdk-instance-in-pool-1-cc.3c422db8fe2b.database.windows.net\",\r\n \"administratorLogin\": \"cloudsa\",\r\n \"subnetId\": \"/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/instancepoolnetsdkcanadacentral/providers/Microsoft.Network/virtualNetworks/vnet-instancepoolnetsdkcanadacentral/subnets/InstancePool\",\r\n \"state\": \"Ready\",\r\n \"licenseType\": \"LicenseIncluded\",\r\n \"vCores\": 2,\r\n \"storageSizeInGB\": 32,\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"dnsZone\": \"3c422db8fe2b\",\r\n \"publicDataEndpointEnabled\": true,\r\n \"timezoneId\": \"UTC\",\r\n \"instancePoolId\": \"/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/instancePools/sqlcl-crudtestinstancepool-dotnetsdk1\"\r\n },\r\n \"location\": \"canadacentral\",\r\n \"tags\": {\r\n \"tagKey1\": \"TagValue1\"\r\n },\r\n \"id\": \"/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/managedInstances/netsdk-instance-in-pool-1-cc\",\r\n \"name\": \"netsdk-instance-in-pool-1-cc\",\r\n \"type\": \"Microsoft.Sql/managedInstances\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/managedInstances/netsdk-instance-in-pool-2-cc?api-version=2018-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMmU3ZmU0YmQtOTBjNy00NTRlLThiYjYtZGM0NDY0OWYyN2IyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTUyOTQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXRzZGstaW5zdGFuY2UtaW4tcG9vbC0yLWNjP2FwaS12ZXJzaW9uPTIwMTgtMDYtMDEtcHJldmlldw==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"sku\": {\r\n \"name\": \"GP_Gen5\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen5\"\r\n },\r\n \"properties\": {\r\n \"administratorLogin\": \"cloudsa\",\r\n \"administratorLoginPassword\": \"Yukon900!\",\r\n \"subnetId\": \"/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/instancepoolnetsdkcanadacentral/providers/Microsoft.Network/virtualNetworks/vnet-instancepoolnetsdkcanadacentral/subnets/InstancePool\",\r\n \"vCores\": 2,\r\n \"storageSizeInGB\": 32,\r\n \"publicDataEndpointEnabled\": true,\r\n \"instancePoolId\": \"/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/instancePools/sqlcl-crudtestinstancepool-dotnetsdk1\"\r\n },\r\n \"location\": \"canadacentral\",\r\n \"tags\": {\r\n \"tagKey1\": \"TagValue1\"\r\n }\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "69c972b4-2cf2-4ab4-a199-7e8cd351aea6" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.00001.0", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.31.0.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "780" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 09 Jul 2019 22:14:25 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/locations/canadacentral/managedInstanceOperationResults/59d31a27-51fd-462b-8622-bf6086f0b3c6?api-version=2018-06-01-preview" + ], + "Retry-After": [ + "60" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/locations/canadacentral/managedInstanceAzureAsyncOperation/59d31a27-51fd-462b-8622-bf6086f0b3c6?api-version=2018-06-01-preview" + ], + "x-ms-request-id": [ + "59d31a27-51fd-462b-8622-bf6086f0b3c6" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-correlation-request-id": [ + "def72464-12f3-41db-aa76-d79f07602c0b" + ], + "x-ms-routing-request-id": [ + "WESTUS:20190709T221425Z:def72464-12f3-41db-aa76-d79f07602c0b" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Content-Length": [ + "73" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"operation\": \"UpsertManagedServer\",\r\n \"startTime\": \"2019-07-09T22:14:25.19Z\"\r\n}", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/locations/canadacentral/managedInstanceAzureAsyncOperation/59d31a27-51fd-462b-8622-bf6086f0b3c6?api-version=2018-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMmU3ZmU0YmQtOTBjNy00NTRlLThiYjYtZGM0NDY0OWYyN2IyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTUyOTQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbG9jYXRpb25zL2NhbmFkYWNlbnRyYWwvbWFuYWdlZEluc3RhbmNlQXp1cmVBc3luY09wZXJhdGlvbi81OWQzMWEyNy01MWZkLTQ2MmItODYyMi1iZjYwODZmMGIzYzY/YXBpLXZlcnNpb249MjAxOC0wNi0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.00001.0", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.31.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 09 Jul 2019 22:15:25 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "60" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "08c89ea5-30bf-4e65-af4a-345ced2c75b4" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11999" + ], + "x-ms-correlation-request-id": [ + "970270fc-3e47-4a00-a6cc-092e40d9ff96" + ], + "x-ms-routing-request-id": [ + "WESTUS:20190709T221526Z:970270fc-3e47-4a00-a6cc-092e40d9ff96" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Content-Length": [ + "107" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"name\": \"59d31a27-51fd-462b-8622-bf6086f0b3c6\",\r\n \"status\": \"InProgress\",\r\n \"startTime\": \"2019-07-09T22:14:25.19Z\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/locations/canadacentral/managedInstanceAzureAsyncOperation/59d31a27-51fd-462b-8622-bf6086f0b3c6?api-version=2018-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMmU3ZmU0YmQtOTBjNy00NTRlLThiYjYtZGM0NDY0OWYyN2IyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTUyOTQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbG9jYXRpb25zL2NhbmFkYWNlbnRyYWwvbWFuYWdlZEluc3RhbmNlQXp1cmVBc3luY09wZXJhdGlvbi81OWQzMWEyNy01MWZkLTQ2MmItODYyMi1iZjYwODZmMGIzYzY/YXBpLXZlcnNpb249MjAxOC0wNi0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.00001.0", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.31.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 09 Jul 2019 22:16:25 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "60" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "43f36857-f460-4a58-87d4-f458e42a73ed" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11998" + ], + "x-ms-correlation-request-id": [ + "4b1055d2-88a8-482a-826c-2a5bf8e83b8e" + ], + "x-ms-routing-request-id": [ + "WESTUS:20190709T221626Z:4b1055d2-88a8-482a-826c-2a5bf8e83b8e" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Content-Length": [ + "107" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"name\": \"59d31a27-51fd-462b-8622-bf6086f0b3c6\",\r\n \"status\": \"InProgress\",\r\n \"startTime\": \"2019-07-09T22:14:25.19Z\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/locations/canadacentral/managedInstanceAzureAsyncOperation/59d31a27-51fd-462b-8622-bf6086f0b3c6?api-version=2018-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMmU3ZmU0YmQtOTBjNy00NTRlLThiYjYtZGM0NDY0OWYyN2IyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTUyOTQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbG9jYXRpb25zL2NhbmFkYWNlbnRyYWwvbWFuYWdlZEluc3RhbmNlQXp1cmVBc3luY09wZXJhdGlvbi81OWQzMWEyNy01MWZkLTQ2MmItODYyMi1iZjYwODZmMGIzYzY/YXBpLXZlcnNpb249MjAxOC0wNi0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.00001.0", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.31.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 09 Jul 2019 22:17:27 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "60" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "58971e92-ca99-41ef-b487-36cd442cd201" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11999" + ], + "x-ms-correlation-request-id": [ + "e961b809-3be5-4b07-bb8f-bc651dfdc7a0" + ], + "x-ms-routing-request-id": [ + "WESTUS:20190709T221727Z:e961b809-3be5-4b07-bb8f-bc651dfdc7a0" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Content-Length": [ + "106" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"name\": \"59d31a27-51fd-462b-8622-bf6086f0b3c6\",\r\n \"status\": \"Succeeded\",\r\n \"startTime\": \"2019-07-09T22:14:25.19Z\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/managedInstances/netsdk-instance-in-pool-2-cc?api-version=2018-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMmU3ZmU0YmQtOTBjNy00NTRlLThiYjYtZGM0NDY0OWYyN2IyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTUyOTQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXRzZGstaW5zdGFuY2UtaW4tcG9vbC0yLWNjP2FwaS12ZXJzaW9uPTIwMTgtMDYtMDEtcHJldmlldw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.00001.0", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.31.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 09 Jul 2019 22:17:27 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "953477fa-b688-4011-9cf8-b980134db59e" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11998" + ], + "x-ms-correlation-request-id": [ + "b7a8d63e-d445-4795-b48c-5df097dac0b0" + ], + "x-ms-routing-request-id": [ + "WESTUS:20190709T221727Z:b7a8d63e-d445-4795-b48c-5df097dac0b0" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Content-Length": [ + "1107" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"sku\": {\r\n \"name\": \"GP_Gen5\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen5\",\r\n \"capacity\": 2\r\n },\r\n \"properties\": {\r\n \"fullyQualifiedDomainName\": \"netsdk-instance-in-pool-2-cc.3c422db8fe2b.database.windows.net\",\r\n \"administratorLogin\": \"cloudsa\",\r\n \"subnetId\": \"/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/instancepoolnetsdkcanadacentral/providers/Microsoft.Network/virtualNetworks/vnet-instancepoolnetsdkcanadacentral/subnets/InstancePool\",\r\n \"state\": \"Ready\",\r\n \"licenseType\": \"LicenseIncluded\",\r\n \"vCores\": 2,\r\n \"storageSizeInGB\": 32,\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"dnsZone\": \"3c422db8fe2b\",\r\n \"publicDataEndpointEnabled\": true,\r\n \"timezoneId\": \"UTC\",\r\n \"instancePoolId\": \"/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/instancePools/sqlcl-crudtestinstancepool-dotnetsdk1\"\r\n },\r\n \"location\": \"canadacentral\",\r\n \"tags\": {\r\n \"tagKey1\": \"TagValue1\"\r\n },\r\n \"id\": \"/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/managedInstances/netsdk-instance-in-pool-2-cc\",\r\n \"name\": \"netsdk-instance-in-pool-2-cc\",\r\n \"type\": \"Microsoft.Sql/managedInstances\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/instancePools/sqlcl-crudtestinstancepool-dotnetsdk1/managedInstances?api-version=2018-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMmU3ZmU0YmQtOTBjNy00NTRlLThiYjYtZGM0NDY0OWYyN2IyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTUyOTQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvaW5zdGFuY2VQb29scy9zcWxjbC1jcnVkdGVzdGluc3RhbmNlcG9vbC1kb3RuZXRzZGsxL21hbmFnZWRJbnN0YW5jZXM/YXBpLXZlcnNpb249MjAxOC0wNi0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "411bd972-a24a-4f4d-afec-7802ebd305ba" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.00001.0", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.31.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 09 Jul 2019 22:17:27 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "8c902259-cefd-454e-a7ba-00c94c6fdd61" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11997" + ], + "x-ms-correlation-request-id": [ + "230fa550-2896-43a6-bde0-d68d2debdcb3" + ], + "x-ms-routing-request-id": [ + "WESTUS:20190709T221727Z:230fa550-2896-43a6-bde0-d68d2debdcb3" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Content-Length": [ + "2227" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"sku\": {\r\n \"name\": \"GP_Gen5\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen5\",\r\n \"capacity\": 2\r\n },\r\n \"properties\": {\r\n \"fullyQualifiedDomainName\": \"netsdk-instance-in-pool-1-cc.3c422db8fe2b.database.windows.net\",\r\n \"administratorLogin\": \"cloudsa\",\r\n \"subnetId\": \"/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/instancepoolnetsdkcanadacentral/providers/Microsoft.Network/virtualNetworks/vnet-instancepoolnetsdkcanadacentral/subnets/InstancePool\",\r\n \"state\": \"Ready\",\r\n \"licenseType\": \"LicenseIncluded\",\r\n \"vCores\": 2,\r\n \"storageSizeInGB\": 32,\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"dnsZone\": \"3c422db8fe2b\",\r\n \"publicDataEndpointEnabled\": true,\r\n \"timezoneId\": \"UTC\",\r\n \"instancePoolId\": \"/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/instancePools/sqlcl-crudtestinstancepool-dotnetsdk1\"\r\n },\r\n \"location\": \"canadacentral\",\r\n \"tags\": {\r\n \"tagKey1\": \"TagValue1\"\r\n },\r\n \"id\": \"/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/managedInstances/netsdk-instance-in-pool-1-cc\",\r\n \"name\": \"netsdk-instance-in-pool-1-cc\",\r\n \"type\": \"Microsoft.Sql/managedInstances\"\r\n },\r\n {\r\n \"sku\": {\r\n \"name\": \"GP_Gen5\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen5\",\r\n \"capacity\": 2\r\n },\r\n \"properties\": {\r\n \"fullyQualifiedDomainName\": \"netsdk-instance-in-pool-2-cc.3c422db8fe2b.database.windows.net\",\r\n \"administratorLogin\": \"cloudsa\",\r\n \"subnetId\": \"/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/instancepoolnetsdkcanadacentral/providers/Microsoft.Network/virtualNetworks/vnet-instancepoolnetsdkcanadacentral/subnets/InstancePool\",\r\n \"state\": \"Ready\",\r\n \"licenseType\": \"LicenseIncluded\",\r\n \"vCores\": 2,\r\n \"storageSizeInGB\": 32,\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"dnsZone\": \"3c422db8fe2b\",\r\n \"publicDataEndpointEnabled\": true,\r\n \"timezoneId\": \"UTC\",\r\n \"instancePoolId\": \"/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/instancePools/sqlcl-crudtestinstancepool-dotnetsdk1\"\r\n },\r\n \"location\": \"canadacentral\",\r\n \"tags\": {\r\n \"tagKey1\": \"TagValue1\"\r\n },\r\n \"id\": \"/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/managedInstances/netsdk-instance-in-pool-2-cc\",\r\n \"name\": \"netsdk-instance-in-pool-2-cc\",\r\n \"type\": \"Microsoft.Sql/managedInstances\"\r\n }\r\n ]\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/instancePools/sqlcl-crudtestinstancepool-dotnetsdk1/managedInstances?api-version=2018-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMmU3ZmU0YmQtOTBjNy00NTRlLThiYjYtZGM0NDY0OWYyN2IyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTUyOTQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvaW5zdGFuY2VQb29scy9zcWxjbC1jcnVkdGVzdGluc3RhbmNlcG9vbC1kb3RuZXRzZGsxL21hbmFnZWRJbnN0YW5jZXM/YXBpLXZlcnNpb249MjAxOC0wNi0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "a191be57-6240-4c47-bce4-b81cbc769dc6" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.00001.0", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.31.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 09 Jul 2019 22:17:27 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "7a6e4700-5fca-4c00-98ae-4b5b8e764541" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11996" + ], + "x-ms-correlation-request-id": [ + "53353262-1d7f-4625-aab0-2b82361a34ff" + ], + "x-ms-routing-request-id": [ + "WESTUS:20190709T221727Z:53353262-1d7f-4625-aab0-2b82361a34ff" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Content-Length": [ + "2227" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"sku\": {\r\n \"name\": \"GP_Gen5\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen5\",\r\n \"capacity\": 2\r\n },\r\n \"properties\": {\r\n \"fullyQualifiedDomainName\": \"netsdk-instance-in-pool-1-cc.3c422db8fe2b.database.windows.net\",\r\n \"administratorLogin\": \"cloudsa\",\r\n \"subnetId\": \"/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/instancepoolnetsdkcanadacentral/providers/Microsoft.Network/virtualNetworks/vnet-instancepoolnetsdkcanadacentral/subnets/InstancePool\",\r\n \"state\": \"Ready\",\r\n \"licenseType\": \"LicenseIncluded\",\r\n \"vCores\": 2,\r\n \"storageSizeInGB\": 32,\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"dnsZone\": \"3c422db8fe2b\",\r\n \"publicDataEndpointEnabled\": true,\r\n \"timezoneId\": \"UTC\",\r\n \"instancePoolId\": \"/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/instancePools/sqlcl-crudtestinstancepool-dotnetsdk1\"\r\n },\r\n \"location\": \"canadacentral\",\r\n \"tags\": {\r\n \"tagKey1\": \"TagValue1\"\r\n },\r\n \"id\": \"/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/managedInstances/netsdk-instance-in-pool-1-cc\",\r\n \"name\": \"netsdk-instance-in-pool-1-cc\",\r\n \"type\": \"Microsoft.Sql/managedInstances\"\r\n },\r\n {\r\n \"sku\": {\r\n \"name\": \"GP_Gen5\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen5\",\r\n \"capacity\": 2\r\n },\r\n \"properties\": {\r\n \"fullyQualifiedDomainName\": \"netsdk-instance-in-pool-2-cc.3c422db8fe2b.database.windows.net\",\r\n \"administratorLogin\": \"cloudsa\",\r\n \"subnetId\": \"/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/instancepoolnetsdkcanadacentral/providers/Microsoft.Network/virtualNetworks/vnet-instancepoolnetsdkcanadacentral/subnets/InstancePool\",\r\n \"state\": \"Ready\",\r\n \"licenseType\": \"LicenseIncluded\",\r\n \"vCores\": 2,\r\n \"storageSizeInGB\": 32,\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"dnsZone\": \"3c422db8fe2b\",\r\n \"publicDataEndpointEnabled\": true,\r\n \"timezoneId\": \"UTC\",\r\n \"instancePoolId\": \"/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/instancePools/sqlcl-crudtestinstancepool-dotnetsdk1\"\r\n },\r\n \"location\": \"canadacentral\",\r\n \"tags\": {\r\n \"tagKey1\": \"TagValue1\"\r\n },\r\n \"id\": \"/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/managedInstances/netsdk-instance-in-pool-2-cc\",\r\n \"name\": \"netsdk-instance-in-pool-2-cc\",\r\n \"type\": \"Microsoft.Sql/managedInstances\"\r\n }\r\n ]\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/managedInstances/netsdk-instance-in-pool-1-cc?api-version=2018-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMmU3ZmU0YmQtOTBjNy00NTRlLThiYjYtZGM0NDY0OWYyN2IyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTUyOTQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXRzZGstaW5zdGFuY2UtaW4tcG9vbC0xLWNjP2FwaS12ZXJzaW9uPTIwMTgtMDYtMDEtcHJldmlldw==", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "775480f0-286c-427f-8c93-d870f75ee86c" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.00001.0", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.31.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 09 Jul 2019 22:17:28 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/locations/canadacentral/managedInstanceOperationResults/a870fc7b-cd8b-4ce3-b8be-dedfe34253c1?api-version=2018-06-01-preview" + ], + "Retry-After": [ + "15" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/locations/canadacentral/managedInstanceAzureAsyncOperation/a870fc7b-cd8b-4ce3-b8be-dedfe34253c1?api-version=2018-06-01-preview" + ], + "x-ms-request-id": [ + "a870fc7b-cd8b-4ce3-b8be-dedfe34253c1" + ], + "x-ms-ratelimit-remaining-subscription-deletes": [ + "14999" + ], + "x-ms-correlation-request-id": [ + "f60a28fb-459d-44da-b778-bb900de1d4f6" + ], + "x-ms-routing-request-id": [ + "WESTUS:20190709T221728Z:f60a28fb-459d-44da-b778-bb900de1d4f6" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Content-Length": [ + "71" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"operation\": \"DropManagedServer\",\r\n \"startTime\": \"2019-07-09T22:17:28.47Z\"\r\n}", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/locations/canadacentral/managedInstanceAzureAsyncOperation/a870fc7b-cd8b-4ce3-b8be-dedfe34253c1?api-version=2018-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMmU3ZmU0YmQtOTBjNy00NTRlLThiYjYtZGM0NDY0OWYyN2IyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTUyOTQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbG9jYXRpb25zL2NhbmFkYWNlbnRyYWwvbWFuYWdlZEluc3RhbmNlQXp1cmVBc3luY09wZXJhdGlvbi9hODcwZmM3Yi1jZDhiLTRjZTMtYjhiZS1kZWRmZTM0MjUzYzE/YXBpLXZlcnNpb249MjAxOC0wNi0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.00001.0", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.31.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 09 Jul 2019 22:17:43 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "15" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "5a54e727-fe43-44f4-aff7-cf52f6ff9b1d" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11994" + ], + "x-ms-correlation-request-id": [ + "e5d669c3-b5ce-400a-bd97-d31f84b1ac24" + ], + "x-ms-routing-request-id": [ + "WESTUS:20190709T221743Z:e5d669c3-b5ce-400a-bd97-d31f84b1ac24" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Content-Length": [ + "106" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"name\": \"a870fc7b-cd8b-4ce3-b8be-dedfe34253c1\",\r\n \"status\": \"Succeeded\",\r\n \"startTime\": \"2019-07-09T22:17:28.47Z\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/locations/canadacentral/managedInstanceOperationResults/a870fc7b-cd8b-4ce3-b8be-dedfe34253c1?api-version=2018-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMmU3ZmU0YmQtOTBjNy00NTRlLThiYjYtZGM0NDY0OWYyN2IyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTUyOTQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbG9jYXRpb25zL2NhbmFkYWNlbnRyYWwvbWFuYWdlZEluc3RhbmNlT3BlcmF0aW9uUmVzdWx0cy9hODcwZmM3Yi1jZDhiLTRjZTMtYjhiZS1kZWRmZTM0MjUzYzE/YXBpLXZlcnNpb249MjAxOC0wNi0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.00001.0", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.31.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 09 Jul 2019 22:17:43 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "6ee38bbf-c773-4f30-ae6b-4d9a7d96f551" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11993" + ], + "x-ms-correlation-request-id": [ + "0fc5116f-74e1-417d-9723-34d533e1019c" + ], + "x-ms-routing-request-id": [ + "WESTUS:20190709T221743Z:0fc5116f-74e1-417d-9723-34d533e1019c" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/managedInstances/netsdk-instance-in-pool-2-cc?api-version=2018-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMmU3ZmU0YmQtOTBjNy00NTRlLThiYjYtZGM0NDY0OWYyN2IyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTUyOTQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXRzZGstaW5zdGFuY2UtaW4tcG9vbC0yLWNjP2FwaS12ZXJzaW9uPTIwMTgtMDYtMDEtcHJldmlldw==", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "51a4bb97-ebad-434e-8f07-545d4f16a446" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.00001.0", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.31.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 09 Jul 2019 22:17:43 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/locations/canadacentral/managedInstanceOperationResults/4d8d54ab-97eb-4ab0-a432-37abf5ef5b88?api-version=2018-06-01-preview" + ], + "Retry-After": [ + "15" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/locations/canadacentral/managedInstanceAzureAsyncOperation/4d8d54ab-97eb-4ab0-a432-37abf5ef5b88?api-version=2018-06-01-preview" + ], + "x-ms-request-id": [ + "4d8d54ab-97eb-4ab0-a432-37abf5ef5b88" + ], + "x-ms-ratelimit-remaining-subscription-deletes": [ + "14998" + ], + "x-ms-correlation-request-id": [ + "04e824df-1740-4310-beed-76b0f80e215f" + ], + "x-ms-routing-request-id": [ + "WESTUS:20190709T221744Z:04e824df-1740-4310-beed-76b0f80e215f" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Content-Length": [ + "71" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"operation\": \"DropManagedServer\",\r\n \"startTime\": \"2019-07-09T22:17:44.08Z\"\r\n}", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/locations/canadacentral/managedInstanceAzureAsyncOperation/4d8d54ab-97eb-4ab0-a432-37abf5ef5b88?api-version=2018-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMmU3ZmU0YmQtOTBjNy00NTRlLThiYjYtZGM0NDY0OWYyN2IyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTUyOTQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbG9jYXRpb25zL2NhbmFkYWNlbnRyYWwvbWFuYWdlZEluc3RhbmNlQXp1cmVBc3luY09wZXJhdGlvbi80ZDhkNTRhYi05N2ViLTRhYjAtYTQzMi0zN2FiZjVlZjViODg/YXBpLXZlcnNpb249MjAxOC0wNi0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.00001.0", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.31.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 09 Jul 2019 22:17:58 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "15" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "51a5a608-584e-4321-b932-aeb4b986e285" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11992" + ], + "x-ms-correlation-request-id": [ + "353fb1e9-0563-4e1f-9bb4-14876dab8c0f" + ], + "x-ms-routing-request-id": [ + "WESTUS:20190709T221759Z:353fb1e9-0563-4e1f-9bb4-14876dab8c0f" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Content-Length": [ + "106" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"name\": \"4d8d54ab-97eb-4ab0-a432-37abf5ef5b88\",\r\n \"status\": \"Succeeded\",\r\n \"startTime\": \"2019-07-09T22:17:44.08Z\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/locations/canadacentral/managedInstanceOperationResults/4d8d54ab-97eb-4ab0-a432-37abf5ef5b88?api-version=2018-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMmU3ZmU0YmQtOTBjNy00NTRlLThiYjYtZGM0NDY0OWYyN2IyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTUyOTQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbG9jYXRpb25zL2NhbmFkYWNlbnRyYWwvbWFuYWdlZEluc3RhbmNlT3BlcmF0aW9uUmVzdWx0cy80ZDhkNTRhYi05N2ViLTRhYjAtYTQzMi0zN2FiZjVlZjViODg/YXBpLXZlcnNpb249MjAxOC0wNi0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.00001.0", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.31.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 09 Jul 2019 22:17:58 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "1882effb-06b5-4377-b701-493e3d2518e5" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11991" + ], + "x-ms-correlation-request-id": [ + "eb759076-441c-4caf-98ea-a851793a5a25" + ], + "x-ms-routing-request-id": [ + "WESTUS:20190709T221759Z:eb759076-441c-4caf-98ea-a851793a5a25" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/instancePools/sqlcl-crudtestinstancepool-dotnetsdk1?api-version=2018-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMmU3ZmU0YmQtOTBjNy00NTRlLThiYjYtZGM0NDY0OWYyN2IyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTUyOTQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvaW5zdGFuY2VQb29scy9zcWxjbC1jcnVkdGVzdGluc3RhbmNlcG9vbC1kb3RuZXRzZGsxP2FwaS12ZXJzaW9uPTIwMTgtMDYtMDEtcHJldmlldw==", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "1989d988-922e-4a63-9aa2-ce891f625ef2" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.00001.0", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.31.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 09 Jul 2019 22:17:59 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/locations/canadacentral/instancePoolOperationResults/8c5b6872-31ad-4cf1-84f4-29b87744d09c?api-version=2018-06-01-preview" + ], + "Retry-After": [ + "15" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/locations/canadacentral/instancePoolAzureAsyncOperation/8c5b6872-31ad-4cf1-84f4-29b87744d09c?api-version=2018-06-01-preview" + ], + "x-ms-request-id": [ + "3730a90b-346f-43df-8a12-ecd095383f22" + ], + "x-ms-ratelimit-remaining-subscription-deletes": [ + "14997" + ], + "x-ms-correlation-request-id": [ + "a449350e-f764-4442-8462-726409de3e6e" + ], + "x-ms-routing-request-id": [ + "WESTUS:20190709T221800Z:a449350e-f764-4442-8462-726409de3e6e" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Content-Length": [ + "71" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"operation\": \"DropInstancePool\",\r\n \"startTime\": \"2019-07-09T22:17:59.907Z\"\r\n}", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/locations/canadacentral/instancePoolAzureAsyncOperation/8c5b6872-31ad-4cf1-84f4-29b87744d09c?api-version=2018-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMmU3ZmU0YmQtOTBjNy00NTRlLThiYjYtZGM0NDY0OWYyN2IyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTUyOTQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbG9jYXRpb25zL2NhbmFkYWNlbnRyYWwvaW5zdGFuY2VQb29sQXp1cmVBc3luY09wZXJhdGlvbi84YzViNjg3Mi0zMWFkLTRjZjEtODRmNC0yOWI4Nzc0NGQwOWM/YXBpLXZlcnNpb249MjAxOC0wNi0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.00001.0", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.31.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 09 Jul 2019 22:18:15 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "15" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "9f5aa52a-92c3-487f-b4d0-17b905b92eca" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11990" + ], + "x-ms-correlation-request-id": [ + "3ddfef78-8990-4c81-b970-f351d32b43a1" + ], + "x-ms-routing-request-id": [ + "WESTUS:20190709T221815Z:3ddfef78-8990-4c81-b970-f351d32b43a1" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Content-Length": [ + "107" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"name\": \"8c5b6872-31ad-4cf1-84f4-29b87744d09c\",\r\n \"status\": \"Succeeded\",\r\n \"startTime\": \"2019-07-09T22:17:59.907Z\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/2e7fe4bd-90c7-454e-8bb6-dc44649f27b2/resourceGroups/sqlcrudtest-5294/providers/Microsoft.Sql/locations/canadacentral/instancePoolOperationResults/8c5b6872-31ad-4cf1-84f4-29b87744d09c?api-version=2018-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMmU3ZmU0YmQtOTBjNy00NTRlLThiYjYtZGM0NDY0OWYyN2IyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTUyOTQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbG9jYXRpb25zL2NhbmFkYWNlbnRyYWwvaW5zdGFuY2VQb29sT3BlcmF0aW9uUmVzdWx0cy84YzViNjg3Mi0zMWFkLTRjZjEtODRmNC0yOWI4Nzc0NGQwOWM/YXBpLXZlcnNpb249MjAxOC0wNi0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.00001.0", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.31.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 09 Jul 2019 22:18:15 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "70137046-0b83-489d-8338-1268e66db600" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11989" + ], + "x-ms-correlation-request-id": [ + "5d1047f4-74fa-4536-bac5-491d5f1dcd73" + ], + "x-ms-routing-request-id": [ + "WESTUS:20190709T221815Z:5d1047f4-74fa-4536-bac5-491d5f1dcd73" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "", + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "2e7fe4bd-90c7-454e-8bb6-dc44649f27b2" + } +} \ No newline at end of file diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/tests/Utilities/SqlManagementTestUtilities.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/tests/Utilities/SqlManagementTestUtilities.cs index 7a09de9d70f0..5c9e2aa98790 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/tests/Utilities/SqlManagementTestUtilities.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/tests/Utilities/SqlManagementTestUtilities.cs @@ -88,13 +88,46 @@ public static void ValidateServer(Server actual, string name, string login, stri Assert.Equal(location.ToLower().Replace(" ", ""), actual.Location.ToLower().Replace(" ", "")); } - public static void ValidateManagedInstance(ManagedInstance actual, string name, string login, Dictionary tags, string location) + public static void ValidateInstancePool( + InstancePool actual, string name, int vCores, string subnetId, string location, Dictionary tags) + { + Assert.NotNull(actual); + + Assert.Equal(name, actual.Name); + Assert.Equal(vCores, actual.VCores); + Assert.Equal(subnetId, actual.SubnetId); + SqlManagementTestUtilities.AssertCollection(tags, actual.Tags); + + // Location is being returned two different ways across different APIs. + Assert.Equal(location.ToLower().Replace(" ", ""), actual.Location.ToLower().Replace(" ", "")); + } + + public static void ValidateInstancePoolUsage( + Usage actual, + int? currentValue, + int? limit, + int? requestedLimit, + string usageName) + { + Assert.NotNull(actual); + Assert.Equal(currentValue, actual.CurrentValue); + Assert.Equal(limit, actual.Limit); + Assert.Equal(requestedLimit, actual.RequestedLimit); + Assert.Equal(usageName, actual.Name.Value); + } + + public static void ValidateManagedInstance(ManagedInstance actual, string name, string login, Dictionary tags, string location, string instancePoolId = null) { Assert.NotNull(actual); Assert.Equal(name, actual.Name); Assert.Equal(login, actual.AdministratorLogin); SqlManagementTestUtilities.AssertCollection(tags, actual.Tags); + if (instancePoolId != null) + { + Assert.Equal(actual.InstancePoolId, instancePoolId); + } + // Location is being returned two different ways across different APIs. Assert.Equal(location.ToLower().Replace(" ", ""), actual.Location.ToLower().Replace(" ", "")); } From 36a6ecbdd98ba22507ae0c5e2558b2699ed2bcb6 Mon Sep 17 00:00:00 2001 From: John Paul Kee Date: Thu, 11 Jul 2019 07:58:50 -0700 Subject: [PATCH 2/3] Update version and package release notes, added sql_resource_manager.txt to eng/mgmt/mgmtmetadata as per instructions --- eng/mgmt/mgmtmetadata/sql_resource-manager.txt | 14 ++++++++++++++ .../src/Microsoft.Azure.Management.Sql.csproj | 6 ++++-- .../src/generate.ps1 | 2 +- 3 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 eng/mgmt/mgmtmetadata/sql_resource-manager.txt diff --git a/eng/mgmt/mgmtmetadata/sql_resource-manager.txt b/eng/mgmt/mgmtmetadata/sql_resource-manager.txt new file mode 100644 index 000000000000..3cadae5c5788 --- /dev/null +++ b/eng/mgmt/mgmtmetadata/sql_resource-manager.txt @@ -0,0 +1,14 @@ +Installing AutoRest version: latest +AutoRest installed successfully. +Commencing code generation +Generating CSharp code +Executing AutoRest command +cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/sql/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=. +2019-07-10 21:39:05 UTC +Azure-rest-api-specs repository information +GitHub fork: Azure +Branch: master +Commit: 5701f7db0dea3570327e6e92799d82b8197399b8 +AutoRest information +Requested version: latest +Bootstrapper version: autorest@2.0.4283 diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Microsoft.Azure.Management.Sql.csproj b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Microsoft.Azure.Management.Sql.csproj index af4c84210d90..ea6a1259d9f3 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Microsoft.Azure.Management.Sql.csproj +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/Microsoft.Azure.Management.Sql.csproj @@ -7,12 +7,14 @@ Microsoft.Azure.Management.Sql Azure SQL Management SDK library Microsoft.Azure.Management.Sql - 1.31.0-preview + 1.32.0-preview Microsoft Azure SQL Management;SQL;SQL Management; diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/generate.ps1 b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/generate.ps1 index 63ad06a5515d..91d815294167 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/generate.ps1 +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.SqlManagement/src/generate.ps1 @@ -1 +1 @@ -Start-AutoRestCodeGeneration -ResourceProvider "sql/resource-manager" -AutoRestVersion "latest" +Start-AutoRestCodeGeneration -ResourceProvider "sql/resource-manager" -AutoRestVersion "latest" -SdkRepoRootPath "." From 0ff753cf7b70d67fb01e480fddd6739e9aa2b35e Mon Sep 17 00:00:00 2001 From: John Paul Kee Date: Thu, 11 Jul 2019 08:30:00 -0700 Subject: [PATCH 3/3] Update sql_resource_manager.txt file --- eng/mgmt/mgmtmetadata/sql_resource-manager.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/mgmt/mgmtmetadata/sql_resource-manager.txt b/eng/mgmt/mgmtmetadata/sql_resource-manager.txt index 3cadae5c5788..24150085be04 100644 --- a/eng/mgmt/mgmtmetadata/sql_resource-manager.txt +++ b/eng/mgmt/mgmtmetadata/sql_resource-manager.txt @@ -4,11 +4,11 @@ Commencing code generation Generating CSharp code Executing AutoRest command cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/sql/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=. -2019-07-10 21:39:05 UTC +2019-07-11 15:27:39 UTC Azure-rest-api-specs repository information GitHub fork: Azure Branch: master -Commit: 5701f7db0dea3570327e6e92799d82b8197399b8 +Commit: 808cfe2da58aa6f1d93bed748004dfb97268e6e3 AutoRest information Requested version: latest Bootstrapper version: autorest@2.0.4283