From ff6829f0a045d26118f9a4c1eb754f9547ab16ec Mon Sep 17 00:00:00 2001 From: Kosta Bizetic Date: Wed, 24 Jan 2018 11:47:02 +0100 Subject: [PATCH 1/2] Added support for Autotuning API --- .../DatabaseAutomaticTuningOperations.cs | 476 ++++++++ ...baseAutomaticTuningOperationsExtensions.cs | 127 ++ .../IDatabaseAutomaticTuningOperations.cs | 90 ++ .../IServerAutomaticTuningOperations.cs | 84 ++ .../Generated/ISqlManagementClient.cs | 10 + .../Models/AutomaticTuningDisabledReason.cs | 90 ++ .../Generated/Models/AutomaticTuningMode.cs | 72 ++ .../Models/AutomaticTuningOptionModeActual.cs | 60 + .../AutomaticTuningOptionModeDesired.cs | 66 + .../Models/AutomaticTuningOptions.cs | 86 ++ .../Models/AutomaticTuningServerMode.cs | 66 + .../Models/AutomaticTuningServerOptions.cs | 85 ++ .../Models/AutomaticTuningServerReason.cs | 66 + .../Models/DatabaseAutomaticTuning.cs | 80 ++ .../Generated/Models/ServerAutomaticTuning.cs | 80 ++ .../Generated/SdkInfo_SqlManagementClient.cs | 2 + .../ServerAutomaticTuningOperations.cs | 458 +++++++ ...rverAutomaticTuningOperationsExtensions.cs | 115 ++ .../Generated/SqlManagementClient.cs | 12 + .../AutomaticTuningOperationsTests.cs | 152 +++ .../TestSetDatabaseAutotuningSettings.json | 1071 +++++++++++++++++ .../TestSetServerAutotuningSettings.json | 693 +++++++++++ src/SDKs/_metadata/sql_resource-manager.txt | 11 +- 23 files changed, 4045 insertions(+), 7 deletions(-) create mode 100644 src/SDKs/SqlManagement/Management.Sql/Generated/DatabaseAutomaticTuningOperations.cs create mode 100644 src/SDKs/SqlManagement/Management.Sql/Generated/DatabaseAutomaticTuningOperationsExtensions.cs create mode 100644 src/SDKs/SqlManagement/Management.Sql/Generated/IDatabaseAutomaticTuningOperations.cs create mode 100644 src/SDKs/SqlManagement/Management.Sql/Generated/IServerAutomaticTuningOperations.cs create mode 100644 src/SDKs/SqlManagement/Management.Sql/Generated/Models/AutomaticTuningDisabledReason.cs create mode 100644 src/SDKs/SqlManagement/Management.Sql/Generated/Models/AutomaticTuningMode.cs create mode 100644 src/SDKs/SqlManagement/Management.Sql/Generated/Models/AutomaticTuningOptionModeActual.cs create mode 100644 src/SDKs/SqlManagement/Management.Sql/Generated/Models/AutomaticTuningOptionModeDesired.cs create mode 100644 src/SDKs/SqlManagement/Management.Sql/Generated/Models/AutomaticTuningOptions.cs create mode 100644 src/SDKs/SqlManagement/Management.Sql/Generated/Models/AutomaticTuningServerMode.cs create mode 100644 src/SDKs/SqlManagement/Management.Sql/Generated/Models/AutomaticTuningServerOptions.cs create mode 100644 src/SDKs/SqlManagement/Management.Sql/Generated/Models/AutomaticTuningServerReason.cs create mode 100644 src/SDKs/SqlManagement/Management.Sql/Generated/Models/DatabaseAutomaticTuning.cs create mode 100644 src/SDKs/SqlManagement/Management.Sql/Generated/Models/ServerAutomaticTuning.cs create mode 100644 src/SDKs/SqlManagement/Management.Sql/Generated/ServerAutomaticTuningOperations.cs create mode 100644 src/SDKs/SqlManagement/Management.Sql/Generated/ServerAutomaticTuningOperationsExtensions.cs create mode 100644 src/SDKs/SqlManagement/Sql.Tests/AutomaticTuningOperationsTests.cs create mode 100644 src/SDKs/SqlManagement/Sql.Tests/SessionRecords/Sql.Tests.AutomaticTuningOperationsTests/TestSetDatabaseAutotuningSettings.json create mode 100644 src/SDKs/SqlManagement/Sql.Tests/SessionRecords/Sql.Tests.AutomaticTuningOperationsTests/TestSetServerAutotuningSettings.json diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/DatabaseAutomaticTuningOperations.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/DatabaseAutomaticTuningOperations.cs new file mode 100644 index 000000000000..4c469aa37322 --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/DatabaseAutomaticTuningOperations.cs @@ -0,0 +1,476 @@ +// +// 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; + + /// + /// DatabaseAutomaticTuningOperations operations. + /// + internal partial class DatabaseAutomaticTuningOperations : IServiceOperations, IDatabaseAutomaticTuningOperations + { + /// + /// Initializes a new instance of the DatabaseAutomaticTuningOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal DatabaseAutomaticTuningOperations(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 a database's automatic tuning. + /// + /// + /// 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 server. + /// + /// + /// The name of the database. + /// + /// + /// 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 serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serverName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); + } + if (databaseName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2015-05-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("serverName", serverName); + tracingParameters.Add("databaseName", databaseName); + 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/servers/{serverName}/databases/{databaseName}/automaticTuning/current").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); + _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _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; + } + + /// + /// Update automatic tuning properties for target database. + /// + /// + /// 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 server. + /// + /// + /// The name of the database. + /// + /// + /// The requested automatic tuning 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> UpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, DatabaseAutomaticTuning parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serverName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); + } + if (databaseName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2015-05-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("serverName", serverName); + tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Update", 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/servers/{serverName}/databases/{databaseName}/automaticTuning/current").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); + _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _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) + { + 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/src/SDKs/SqlManagement/Management.Sql/Generated/DatabaseAutomaticTuningOperationsExtensions.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/DatabaseAutomaticTuningOperationsExtensions.cs new file mode 100644 index 000000000000..3943430ae5d1 --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/DatabaseAutomaticTuningOperationsExtensions.cs @@ -0,0 +1,127 @@ +// +// 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 DatabaseAutomaticTuningOperations. + /// + public static partial class DatabaseAutomaticTuningOperationsExtensions + { + /// + /// Gets a database's automatic tuning. + /// + /// + /// 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 server. + /// + /// + /// The name of the database. + /// + public static DatabaseAutomaticTuning Get(this IDatabaseAutomaticTuningOperations operations, string resourceGroupName, string serverName, string databaseName) + { + return operations.GetAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult(); + } + + /// + /// Gets a database's automatic tuning. + /// + /// + /// 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 server. + /// + /// + /// The name of the database. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IDatabaseAutomaticTuningOperations operations, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Update automatic tuning properties for target database. + /// + /// + /// 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 server. + /// + /// + /// The name of the database. + /// + /// + /// The requested automatic tuning resource state. + /// + public static DatabaseAutomaticTuning Update(this IDatabaseAutomaticTuningOperations operations, string resourceGroupName, string serverName, string databaseName, DatabaseAutomaticTuning parameters) + { + return operations.UpdateAsync(resourceGroupName, serverName, databaseName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Update automatic tuning properties for target database. + /// + /// + /// 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 server. + /// + /// + /// The name of the database. + /// + /// + /// The requested automatic tuning resource state. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IDatabaseAutomaticTuningOperations operations, string resourceGroupName, string serverName, string databaseName, DatabaseAutomaticTuning parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/IDatabaseAutomaticTuningOperations.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/IDatabaseAutomaticTuningOperations.cs new file mode 100644 index 000000000000..1cf9a3edf38a --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/IDatabaseAutomaticTuningOperations.cs @@ -0,0 +1,90 @@ +// +// 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; + + /// + /// DatabaseAutomaticTuningOperations operations. + /// + public partial interface IDatabaseAutomaticTuningOperations + { + /// + /// Gets a database's automatic tuning. + /// + /// + /// 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 server. + /// + /// + /// The name of the database. + /// + /// + /// 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 serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update automatic tuning properties for target database. + /// + /// + /// 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 server. + /// + /// + /// The name of the database. + /// + /// + /// The requested automatic tuning 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 serverName, string databaseName, DatabaseAutomaticTuning parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/IServerAutomaticTuningOperations.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/IServerAutomaticTuningOperations.cs new file mode 100644 index 000000000000..e83383e9953d --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/IServerAutomaticTuningOperations.cs @@ -0,0 +1,84 @@ +// +// 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; + + /// + /// ServerAutomaticTuningOperations operations. + /// + public partial interface IServerAutomaticTuningOperations + { + /// + /// Retrieves server automatic tuning options. + /// + /// + /// 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 server. + /// + /// + /// 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 serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update automatic tuning options on server. + /// + /// + /// 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 server. + /// + /// + /// The requested automatic tuning 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 serverName, ServerAutomaticTuning parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/ISqlManagementClient.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/ISqlManagementClient.cs index b9b7474da9a7..f4a82e4f0db5 100644 --- a/src/SDKs/SqlManagement/Management.Sql/Generated/ISqlManagementClient.cs +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/ISqlManagementClient.cs @@ -206,6 +206,11 @@ public partial interface ISqlManagementClient : System.IDisposable /// IDatabaseBlobAuditingPoliciesOperations DatabaseBlobAuditingPolicies { get; } + /// + /// Gets the IDatabaseAutomaticTuningOperations. + /// + IDatabaseAutomaticTuningOperations DatabaseAutomaticTuning { get; } + /// /// Gets the IEncryptionProtectorsOperations. /// @@ -256,6 +261,11 @@ public partial interface ISqlManagementClient : System.IDisposable /// IDatabaseOperations DatabaseOperations { get; } + /// + /// Gets the IServerAutomaticTuningOperations. + /// + IServerAutomaticTuningOperations ServerAutomaticTuning { get; } + /// /// Gets the IServerDnsAliasesOperations. /// diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/AutomaticTuningDisabledReason.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/AutomaticTuningDisabledReason.cs new file mode 100644 index 000000000000..ef0742c301c1 --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/AutomaticTuningDisabledReason.cs @@ -0,0 +1,90 @@ +// +// 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 Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for AutomaticTuningDisabledReason. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum AutomaticTuningDisabledReason + { + [EnumMember(Value = "Default")] + Default, + [EnumMember(Value = "Disabled")] + Disabled, + [EnumMember(Value = "AutoConfigured")] + AutoConfigured, + [EnumMember(Value = "InheritedFromServer")] + InheritedFromServer, + [EnumMember(Value = "QueryStoreOff")] + QueryStoreOff, + [EnumMember(Value = "QueryStoreReadOnly")] + QueryStoreReadOnly, + [EnumMember(Value = "NotSupported")] + NotSupported + } + internal static class AutomaticTuningDisabledReasonEnumExtension + { + internal static string ToSerializedValue(this AutomaticTuningDisabledReason? value) + { + return value == null ? null : ((AutomaticTuningDisabledReason)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this AutomaticTuningDisabledReason value) + { + switch( value ) + { + case AutomaticTuningDisabledReason.Default: + return "Default"; + case AutomaticTuningDisabledReason.Disabled: + return "Disabled"; + case AutomaticTuningDisabledReason.AutoConfigured: + return "AutoConfigured"; + case AutomaticTuningDisabledReason.InheritedFromServer: + return "InheritedFromServer"; + case AutomaticTuningDisabledReason.QueryStoreOff: + return "QueryStoreOff"; + case AutomaticTuningDisabledReason.QueryStoreReadOnly: + return "QueryStoreReadOnly"; + case AutomaticTuningDisabledReason.NotSupported: + return "NotSupported"; + } + return null; + } + + internal static AutomaticTuningDisabledReason? ParseAutomaticTuningDisabledReason(this string value) + { + switch( value ) + { + case "Default": + return AutomaticTuningDisabledReason.Default; + case "Disabled": + return AutomaticTuningDisabledReason.Disabled; + case "AutoConfigured": + return AutomaticTuningDisabledReason.AutoConfigured; + case "InheritedFromServer": + return AutomaticTuningDisabledReason.InheritedFromServer; + case "QueryStoreOff": + return AutomaticTuningDisabledReason.QueryStoreOff; + case "QueryStoreReadOnly": + return AutomaticTuningDisabledReason.QueryStoreReadOnly; + case "NotSupported": + return AutomaticTuningDisabledReason.NotSupported; + } + return null; + } + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/AutomaticTuningMode.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/AutomaticTuningMode.cs new file mode 100644 index 000000000000..3daede0a27e9 --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/AutomaticTuningMode.cs @@ -0,0 +1,72 @@ +// +// 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 Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for AutomaticTuningMode. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum AutomaticTuningMode + { + [EnumMember(Value = "Inherit")] + Inherit, + [EnumMember(Value = "Custom")] + Custom, + [EnumMember(Value = "Auto")] + Auto, + [EnumMember(Value = "Unspecified")] + Unspecified + } + internal static class AutomaticTuningModeEnumExtension + { + internal static string ToSerializedValue(this AutomaticTuningMode? value) + { + return value == null ? null : ((AutomaticTuningMode)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this AutomaticTuningMode value) + { + switch( value ) + { + case AutomaticTuningMode.Inherit: + return "Inherit"; + case AutomaticTuningMode.Custom: + return "Custom"; + case AutomaticTuningMode.Auto: + return "Auto"; + case AutomaticTuningMode.Unspecified: + return "Unspecified"; + } + return null; + } + + internal static AutomaticTuningMode? ParseAutomaticTuningMode(this string value) + { + switch( value ) + { + case "Inherit": + return AutomaticTuningMode.Inherit; + case "Custom": + return AutomaticTuningMode.Custom; + case "Auto": + return AutomaticTuningMode.Auto; + case "Unspecified": + return AutomaticTuningMode.Unspecified; + } + return null; + } + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/AutomaticTuningOptionModeActual.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/AutomaticTuningOptionModeActual.cs new file mode 100644 index 000000000000..8c50d8f3a037 --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/AutomaticTuningOptionModeActual.cs @@ -0,0 +1,60 @@ +// +// 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 Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for AutomaticTuningOptionModeActual. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum AutomaticTuningOptionModeActual + { + [EnumMember(Value = "Off")] + Off, + [EnumMember(Value = "On")] + On + } + internal static class AutomaticTuningOptionModeActualEnumExtension + { + internal static string ToSerializedValue(this AutomaticTuningOptionModeActual? value) + { + return value == null ? null : ((AutomaticTuningOptionModeActual)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this AutomaticTuningOptionModeActual value) + { + switch( value ) + { + case AutomaticTuningOptionModeActual.Off: + return "Off"; + case AutomaticTuningOptionModeActual.On: + return "On"; + } + return null; + } + + internal static AutomaticTuningOptionModeActual? ParseAutomaticTuningOptionModeActual(this string value) + { + switch( value ) + { + case "Off": + return AutomaticTuningOptionModeActual.Off; + case "On": + return AutomaticTuningOptionModeActual.On; + } + return null; + } + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/AutomaticTuningOptionModeDesired.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/AutomaticTuningOptionModeDesired.cs new file mode 100644 index 000000000000..8c3fb55ba2f0 --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/AutomaticTuningOptionModeDesired.cs @@ -0,0 +1,66 @@ +// +// 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 Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for AutomaticTuningOptionModeDesired. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum AutomaticTuningOptionModeDesired + { + [EnumMember(Value = "Off")] + Off, + [EnumMember(Value = "On")] + On, + [EnumMember(Value = "Default")] + Default + } + internal static class AutomaticTuningOptionModeDesiredEnumExtension + { + internal static string ToSerializedValue(this AutomaticTuningOptionModeDesired? value) + { + return value == null ? null : ((AutomaticTuningOptionModeDesired)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this AutomaticTuningOptionModeDesired value) + { + switch( value ) + { + case AutomaticTuningOptionModeDesired.Off: + return "Off"; + case AutomaticTuningOptionModeDesired.On: + return "On"; + case AutomaticTuningOptionModeDesired.Default: + return "Default"; + } + return null; + } + + internal static AutomaticTuningOptionModeDesired? ParseAutomaticTuningOptionModeDesired(this string value) + { + switch( value ) + { + case "Off": + return AutomaticTuningOptionModeDesired.Off; + case "On": + return AutomaticTuningOptionModeDesired.On; + case "Default": + return AutomaticTuningOptionModeDesired.Default; + } + return null; + } + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/AutomaticTuningOptions.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/AutomaticTuningOptions.cs new file mode 100644 index 000000000000..60cebfb41fb1 --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/AutomaticTuningOptions.cs @@ -0,0 +1,86 @@ +// +// 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; + + /// + /// Automatic tuning properties for individual advisors. + /// + public partial class AutomaticTuningOptions + { + /// + /// Initializes a new instance of the AutomaticTuningOptions class. + /// + public AutomaticTuningOptions() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AutomaticTuningOptions class. + /// + /// Automatic tuning option desired state. + /// Possible values include: 'Off', 'On', 'Default' + /// Automatic tuning option actual state. + /// Possible values include: 'Off', 'On' + /// Reason code if desired and actual state + /// are different. + /// Reason description if desired and actual + /// state are different. Possible values include: 'Default', + /// 'Disabled', 'AutoConfigured', 'InheritedFromServer', + /// 'QueryStoreOff', 'QueryStoreReadOnly', 'NotSupported' + public AutomaticTuningOptions(AutomaticTuningOptionModeDesired? desiredState = default(AutomaticTuningOptionModeDesired?), AutomaticTuningOptionModeActual? actualState = default(AutomaticTuningOptionModeActual?), int? reasonCode = default(int?), AutomaticTuningDisabledReason? reasonDesc = default(AutomaticTuningDisabledReason?)) + { + DesiredState = desiredState; + ActualState = actualState; + ReasonCode = reasonCode; + ReasonDesc = reasonDesc; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets automatic tuning option desired state. Possible values + /// include: 'Off', 'On', 'Default' + /// + [JsonProperty(PropertyName = "desiredState")] + public AutomaticTuningOptionModeDesired? DesiredState { get; set; } + + /// + /// Gets automatic tuning option actual state. Possible values include: + /// 'Off', 'On' + /// + [JsonProperty(PropertyName = "actualState")] + public AutomaticTuningOptionModeActual? ActualState { get; private set; } + + /// + /// Gets reason code if desired and actual state are different. + /// + [JsonProperty(PropertyName = "reasonCode")] + public int? ReasonCode { get; private set; } + + /// + /// Gets reason description if desired and actual state are different. + /// Possible values include: 'Default', 'Disabled', 'AutoConfigured', + /// 'InheritedFromServer', 'QueryStoreOff', 'QueryStoreReadOnly', + /// 'NotSupported' + /// + [JsonProperty(PropertyName = "reasonDesc")] + public AutomaticTuningDisabledReason? ReasonDesc { get; private set; } + + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/AutomaticTuningServerMode.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/AutomaticTuningServerMode.cs new file mode 100644 index 000000000000..36fd8bf4f8fb --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/AutomaticTuningServerMode.cs @@ -0,0 +1,66 @@ +// +// 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 Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for AutomaticTuningServerMode. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum AutomaticTuningServerMode + { + [EnumMember(Value = "Custom")] + Custom, + [EnumMember(Value = "Auto")] + Auto, + [EnumMember(Value = "Unspecified")] + Unspecified + } + internal static class AutomaticTuningServerModeEnumExtension + { + internal static string ToSerializedValue(this AutomaticTuningServerMode? value) + { + return value == null ? null : ((AutomaticTuningServerMode)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this AutomaticTuningServerMode value) + { + switch( value ) + { + case AutomaticTuningServerMode.Custom: + return "Custom"; + case AutomaticTuningServerMode.Auto: + return "Auto"; + case AutomaticTuningServerMode.Unspecified: + return "Unspecified"; + } + return null; + } + + internal static AutomaticTuningServerMode? ParseAutomaticTuningServerMode(this string value) + { + switch( value ) + { + case "Custom": + return AutomaticTuningServerMode.Custom; + case "Auto": + return AutomaticTuningServerMode.Auto; + case "Unspecified": + return AutomaticTuningServerMode.Unspecified; + } + return null; + } + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/AutomaticTuningServerOptions.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/AutomaticTuningServerOptions.cs new file mode 100644 index 000000000000..258c466fc0f3 --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/AutomaticTuningServerOptions.cs @@ -0,0 +1,85 @@ +// +// 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; + + /// + /// Automatic tuning properties for individual advisors. + /// + public partial class AutomaticTuningServerOptions + { + /// + /// Initializes a new instance of the AutomaticTuningServerOptions + /// class. + /// + public AutomaticTuningServerOptions() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AutomaticTuningServerOptions + /// class. + /// + /// Automatic tuning option desired state. + /// Possible values include: 'Off', 'On', 'Default' + /// Automatic tuning option actual state. + /// Possible values include: 'Off', 'On' + /// Reason code if desired and actual state + /// are different. + /// Reason description if desired and actual + /// state are different. Possible values include: 'Default', + /// 'Disabled', 'AutoConfigured' + public AutomaticTuningServerOptions(AutomaticTuningOptionModeDesired? desiredState = default(AutomaticTuningOptionModeDesired?), AutomaticTuningOptionModeActual? actualState = default(AutomaticTuningOptionModeActual?), int? reasonCode = default(int?), AutomaticTuningServerReason? reasonDesc = default(AutomaticTuningServerReason?)) + { + DesiredState = desiredState; + ActualState = actualState; + ReasonCode = reasonCode; + ReasonDesc = reasonDesc; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets automatic tuning option desired state. Possible values + /// include: 'Off', 'On', 'Default' + /// + [JsonProperty(PropertyName = "desiredState")] + public AutomaticTuningOptionModeDesired? DesiredState { get; set; } + + /// + /// Gets automatic tuning option actual state. Possible values include: + /// 'Off', 'On' + /// + [JsonProperty(PropertyName = "actualState")] + public AutomaticTuningOptionModeActual? ActualState { get; private set; } + + /// + /// Gets reason code if desired and actual state are different. + /// + [JsonProperty(PropertyName = "reasonCode")] + public int? ReasonCode { get; private set; } + + /// + /// Gets reason description if desired and actual state are different. + /// Possible values include: 'Default', 'Disabled', 'AutoConfigured' + /// + [JsonProperty(PropertyName = "reasonDesc")] + public AutomaticTuningServerReason? ReasonDesc { get; private set; } + + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/AutomaticTuningServerReason.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/AutomaticTuningServerReason.cs new file mode 100644 index 000000000000..348d15e28f3f --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/AutomaticTuningServerReason.cs @@ -0,0 +1,66 @@ +// +// 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 Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for AutomaticTuningServerReason. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum AutomaticTuningServerReason + { + [EnumMember(Value = "Default")] + Default, + [EnumMember(Value = "Disabled")] + Disabled, + [EnumMember(Value = "AutoConfigured")] + AutoConfigured + } + internal static class AutomaticTuningServerReasonEnumExtension + { + internal static string ToSerializedValue(this AutomaticTuningServerReason? value) + { + return value == null ? null : ((AutomaticTuningServerReason)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this AutomaticTuningServerReason value) + { + switch( value ) + { + case AutomaticTuningServerReason.Default: + return "Default"; + case AutomaticTuningServerReason.Disabled: + return "Disabled"; + case AutomaticTuningServerReason.AutoConfigured: + return "AutoConfigured"; + } + return null; + } + + internal static AutomaticTuningServerReason? ParseAutomaticTuningServerReason(this string value) + { + switch( value ) + { + case "Default": + return AutomaticTuningServerReason.Default; + case "Disabled": + return AutomaticTuningServerReason.Disabled; + case "AutoConfigured": + return AutomaticTuningServerReason.AutoConfigured; + } + return null; + } + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/DatabaseAutomaticTuning.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/DatabaseAutomaticTuning.cs new file mode 100644 index 000000000000..04f86400b7db --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/DatabaseAutomaticTuning.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.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Database-level Automatic Tuning. + /// + [Rest.Serialization.JsonTransformation] + public partial class DatabaseAutomaticTuning : ProxyResource + { + /// + /// Initializes a new instance of the DatabaseAutomaticTuning class. + /// + public DatabaseAutomaticTuning() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DatabaseAutomaticTuning class. + /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// Automatic tuning desired state. Possible + /// values include: 'Inherit', 'Custom', 'Auto', 'Unspecified' + /// Automatic tuning actual state. Possible + /// values include: 'Inherit', 'Custom', 'Auto', 'Unspecified' + /// Automatic tuning options definition. + public DatabaseAutomaticTuning(string id = default(string), string name = default(string), string type = default(string), AutomaticTuningMode? desiredState = default(AutomaticTuningMode?), AutomaticTuningMode? actualState = default(AutomaticTuningMode?), IDictionary options = default(IDictionary)) + : base(id, name, type) + { + DesiredState = desiredState; + ActualState = actualState; + Options = options; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets automatic tuning desired state. Possible values + /// include: 'Inherit', 'Custom', 'Auto', 'Unspecified' + /// + [JsonProperty(PropertyName = "properties.desiredState")] + public AutomaticTuningMode? DesiredState { get; set; } + + /// + /// Gets automatic tuning actual state. Possible values include: + /// 'Inherit', 'Custom', 'Auto', 'Unspecified' + /// + [JsonProperty(PropertyName = "properties.actualState")] + public AutomaticTuningMode? ActualState { get; private set; } + + /// + /// Gets or sets automatic tuning options definition. + /// + [JsonProperty(PropertyName = "properties.options")] + public IDictionary Options { get; set; } + + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/ServerAutomaticTuning.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/ServerAutomaticTuning.cs new file mode 100644 index 000000000000..c6e4efcc5095 --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/ServerAutomaticTuning.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.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Server-level Automatic Tuning. + /// + [Rest.Serialization.JsonTransformation] + public partial class ServerAutomaticTuning : ProxyResource + { + /// + /// Initializes a new instance of the ServerAutomaticTuning class. + /// + public ServerAutomaticTuning() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ServerAutomaticTuning class. + /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// Automatic tuning desired state. Possible + /// values include: 'Custom', 'Auto', 'Unspecified' + /// Automatic tuning actual state. Possible + /// values include: 'Custom', 'Auto', 'Unspecified' + /// Automatic tuning options definition. + public ServerAutomaticTuning(string id = default(string), string name = default(string), string type = default(string), AutomaticTuningServerMode? desiredState = default(AutomaticTuningServerMode?), AutomaticTuningServerMode? actualState = default(AutomaticTuningServerMode?), IDictionary options = default(IDictionary)) + : base(id, name, type) + { + DesiredState = desiredState; + ActualState = actualState; + Options = options; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets automatic tuning desired state. Possible values + /// include: 'Custom', 'Auto', 'Unspecified' + /// + [JsonProperty(PropertyName = "properties.desiredState")] + public AutomaticTuningServerMode? DesiredState { get; set; } + + /// + /// Gets automatic tuning actual state. Possible values include: + /// 'Custom', 'Auto', 'Unspecified' + /// + [JsonProperty(PropertyName = "properties.actualState")] + public AutomaticTuningServerMode? ActualState { get; private set; } + + /// + /// Gets or sets automatic tuning options definition. + /// + [JsonProperty(PropertyName = "properties.options")] + public IDictionary Options { get; set; } + + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/SdkInfo_SqlManagementClient.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/SdkInfo_SqlManagementClient.cs index 0379cae94614..d53069a04da3 100644 --- a/src/SDKs/SqlManagement/Management.Sql/Generated/SdkInfo_SqlManagementClient.cs +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/SdkInfo_SqlManagementClient.cs @@ -16,6 +16,7 @@ public static IEnumerable> ApiInfo_SqlManagementCl new Tuple("Sql", "Capabilities", "2014-04-01"), new Tuple("Sql", "DataMaskingPolicies", "2014-04-01"), new Tuple("Sql", "DataMaskingRules", "2014-04-01"), + new Tuple("Sql", "DatabaseAutomaticTuning", "2015-05-01-preview"), new Tuple("Sql", "DatabaseBlobAuditingPolicies", "2015-05-01-preview"), new Tuple("Sql", "DatabaseOperations", "2017-03-01-preview"), new Tuple("Sql", "DatabaseThreatDetectionPolicies", "2014-04-01"), @@ -35,6 +36,7 @@ public static IEnumerable> ApiInfo_SqlManagementCl new Tuple("Sql", "ReplicationLinks", "2014-04-01"), new Tuple("Sql", "RestorableDroppedDatabases", "2014-04-01"), new Tuple("Sql", "RestorePoints", "2014-04-01"), + new Tuple("Sql", "ServerAutomaticTuning", "2017-03-01-preview"), new Tuple("Sql", "ServerAzureADAdministrators", "2014-04-01"), new Tuple("Sql", "ServerCommunicationLinks", "2014-04-01"), new Tuple("Sql", "ServerConnectionPolicies", "2014-04-01"), diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/ServerAutomaticTuningOperations.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/ServerAutomaticTuningOperations.cs new file mode 100644 index 000000000000..53f679eaf559 --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/ServerAutomaticTuningOperations.cs @@ -0,0 +1,458 @@ +// +// 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; + + /// + /// ServerAutomaticTuningOperations operations. + /// + internal partial class ServerAutomaticTuningOperations : IServiceOperations, IServerAutomaticTuningOperations + { + /// + /// Initializes a new instance of the ServerAutomaticTuningOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ServerAutomaticTuningOperations(SqlManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the SqlManagementClient + /// + public SqlManagementClient Client { get; private set; } + + /// + /// Retrieves server automatic tuning options. + /// + /// + /// 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 server. + /// + /// + /// 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 serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serverName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2017-03-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("serverName", serverName); + 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/servers/{serverName}/automaticTuning/current").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); + _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; + } + + /// + /// Update automatic tuning options on server. + /// + /// + /// 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 server. + /// + /// + /// The requested automatic tuning 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> UpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, ServerAutomaticTuning parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serverName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2017-03-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("serverName", serverName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Update", 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/servers/{serverName}/automaticTuning/current").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); + _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) + { + 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/src/SDKs/SqlManagement/Management.Sql/Generated/ServerAutomaticTuningOperationsExtensions.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/ServerAutomaticTuningOperationsExtensions.cs new file mode 100644 index 000000000000..cba107402402 --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/ServerAutomaticTuningOperationsExtensions.cs @@ -0,0 +1,115 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Sql +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ServerAutomaticTuningOperations. + /// + public static partial class ServerAutomaticTuningOperationsExtensions + { + /// + /// Retrieves server automatic tuning options. + /// + /// + /// 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 server. + /// + public static ServerAutomaticTuning Get(this IServerAutomaticTuningOperations operations, string resourceGroupName, string serverName) + { + return operations.GetAsync(resourceGroupName, serverName).GetAwaiter().GetResult(); + } + + /// + /// Retrieves server automatic tuning options. + /// + /// + /// 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 server. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IServerAutomaticTuningOperations operations, string resourceGroupName, string serverName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serverName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Update automatic tuning options on server. + /// + /// + /// 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 server. + /// + /// + /// The requested automatic tuning resource state. + /// + public static ServerAutomaticTuning Update(this IServerAutomaticTuningOperations operations, string resourceGroupName, string serverName, ServerAutomaticTuning parameters) + { + return operations.UpdateAsync(resourceGroupName, serverName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Update automatic tuning options on server. + /// + /// + /// 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 server. + /// + /// + /// The requested automatic tuning resource state. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IServerAutomaticTuningOperations operations, string resourceGroupName, string serverName, ServerAutomaticTuning parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, serverName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/SqlManagementClient.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/SqlManagementClient.cs index bc3fd3caeeed..81121d49a79f 100644 --- a/src/SDKs/SqlManagement/Management.Sql/Generated/SqlManagementClient.cs +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/SqlManagementClient.cs @@ -211,6 +211,11 @@ public partial class SqlManagementClient : ServiceClient, I /// public virtual IDatabaseBlobAuditingPoliciesOperations DatabaseBlobAuditingPolicies { get; private set; } + /// + /// Gets the IDatabaseAutomaticTuningOperations. + /// + public virtual IDatabaseAutomaticTuningOperations DatabaseAutomaticTuning { get; private set; } + /// /// Gets the IEncryptionProtectorsOperations. /// @@ -261,6 +266,11 @@ public partial class SqlManagementClient : ServiceClient, I /// public virtual IDatabaseOperations DatabaseOperations { get; private set; } + /// + /// Gets the IServerAutomaticTuningOperations. + /// + public virtual IServerAutomaticTuningOperations ServerAutomaticTuning { get; private set; } + /// /// Gets the IServerDnsAliasesOperations. /// @@ -495,6 +505,7 @@ private void Initialize() ServerUsages = new ServerUsagesOperations(this); DatabaseUsages = new DatabaseUsagesOperations(this); DatabaseBlobAuditingPolicies = new DatabaseBlobAuditingPoliciesOperations(this); + DatabaseAutomaticTuning = new DatabaseAutomaticTuningOperations(this); EncryptionProtectors = new EncryptionProtectorsOperations(this); FailoverGroups = new FailoverGroupsOperations(this); Operations = new Operations(this); @@ -505,6 +516,7 @@ private void Initialize() SubscriptionUsages = new SubscriptionUsagesOperations(this); VirtualNetworkRules = new VirtualNetworkRulesOperations(this); DatabaseOperations = new DatabaseOperations(this); + ServerAutomaticTuning = new ServerAutomaticTuningOperations(this); ServerDnsAliases = new ServerDnsAliasesOperations(this); BaseUri = new System.Uri("https://management.azure.com"); AcceptLanguage = "en-US"; diff --git a/src/SDKs/SqlManagement/Sql.Tests/AutomaticTuningOperationsTests.cs b/src/SDKs/SqlManagement/Sql.Tests/AutomaticTuningOperationsTests.cs new file mode 100644 index 000000000000..6b4380ed3333 --- /dev/null +++ b/src/SDKs/SqlManagement/Sql.Tests/AutomaticTuningOperationsTests.cs @@ -0,0 +1,152 @@ +using Microsoft.Azure.Management.ResourceManager.Models; +using Microsoft.Azure.Management.Sql; +using Microsoft.Azure.Management.Sql.Models; +using System; +using System.Collections.Generic; +using System.Text; +using Xunit; + +namespace Sql.Tests +{ + public class AutomaticTuningOperationsTests + { + [Fact] + public void TestSetServerAutotuningSettings() + { + using (SqlManagementTestContext context = new SqlManagementTestContext(this)) + { + ResourceGroup resourceGroup = context.CreateResourceGroup(); + Server server = context.CreateServer(resourceGroup); + SqlManagementClient sqlClient = context.GetClient(); + + // Set server autotuning options Custom + ServerAutomaticTuning parameters = new ServerAutomaticTuning() { + DesiredState = AutomaticTuningServerMode.Custom, + Options = new Dictionary() + { + {"createIndex", new AutomaticTuningServerOptions() {DesiredState=AutomaticTuningOptionModeDesired.On} }, + {"dropIndex", new AutomaticTuningServerOptions() {DesiredState=AutomaticTuningOptionModeDesired.Off} }, + {"forceLastGoodPlan", new AutomaticTuningServerOptions() {DesiredState=AutomaticTuningOptionModeDesired.On} } + } + }; + + var resultUpdate = sqlClient.ServerAutomaticTuning.UpdateWithHttpMessagesAsync(resourceGroup.Name, server.Name, parameters).GetAwaiter().GetResult(); + + Assert.True(resultUpdate.Response.IsSuccessStatusCode); + + var resultGet = sqlClient.ServerAutomaticTuning.GetWithHttpMessagesAsync(resourceGroup.Name, server.Name).GetAwaiter().GetResult(); + + Assert.True(resultGet.Response.IsSuccessStatusCode); + Assert.Equal(AutomaticTuningServerMode.Custom, resultGet.Body.DesiredState); + Assert.Equal(AutomaticTuningOptionModeDesired.On, resultGet.Body.Options["createIndex"].DesiredState); + Assert.Equal(AutomaticTuningOptionModeDesired.Off, resultGet.Body.Options["dropIndex"].DesiredState); + Assert.Equal(AutomaticTuningOptionModeDesired.On, resultGet.Body.Options["forceLastGoodPlan"].DesiredState); + + // Set server autotuning options Auto + parameters = new ServerAutomaticTuning() + { + DesiredState = AutomaticTuningServerMode.Auto, + Options = new Dictionary() + { + {"createIndex", new AutomaticTuningServerOptions() {DesiredState=AutomaticTuningOptionModeDesired.Default} }, + {"dropIndex", new AutomaticTuningServerOptions() {DesiredState=AutomaticTuningOptionModeDesired.Default} }, + {"forceLastGoodPlan", new AutomaticTuningServerOptions() {DesiredState=AutomaticTuningOptionModeDesired.On} } + } + }; + + resultUpdate = sqlClient.ServerAutomaticTuning.UpdateWithHttpMessagesAsync(resourceGroup.Name, server.Name, parameters).GetAwaiter().GetResult(); + + Assert.True(resultUpdate.Response.IsSuccessStatusCode); + + resultGet = sqlClient.ServerAutomaticTuning.GetWithHttpMessagesAsync(resourceGroup.Name, server.Name).GetAwaiter().GetResult(); + + Assert.True(resultGet.Response.IsSuccessStatusCode); + Assert.Equal(AutomaticTuningServerMode.Auto, resultGet.Body.DesiredState); + Assert.Equal(AutomaticTuningOptionModeDesired.Default, resultGet.Body.Options["createIndex"].DesiredState); + Assert.Equal(AutomaticTuningOptionModeDesired.Default, resultGet.Body.Options["dropIndex"].DesiredState); + Assert.Equal(AutomaticTuningOptionModeDesired.On, resultGet.Body.Options["forceLastGoodPlan"].DesiredState); + } + } + + [Fact] + public void TestSetDatabaseAutotuningSettings() + { + using (SqlManagementTestContext context = new SqlManagementTestContext(this)) + { + ResourceGroup resourceGroup = context.CreateResourceGroup(); + Server server = context.CreateServer(resourceGroup); + SqlManagementClient sqlClient = context.GetClient(); + + // Create database + string dbName = SqlManagementTestUtilities.GenerateName(); + var db1 = sqlClient.Databases.CreateOrUpdate(resourceGroup.Name, server.Name, dbName, new Database() + { + Location = server.Location, + }); + + // Set server autotuning options Inherit + DatabaseAutomaticTuning parameters = new DatabaseAutomaticTuning() + { + DesiredState = AutomaticTuningMode.Inherit, + Options = new Dictionary() + { + {"createIndex", new AutomaticTuningOptions() {DesiredState=AutomaticTuningOptionModeDesired.Default} }, + {"dropIndex", new AutomaticTuningOptions() {DesiredState=AutomaticTuningOptionModeDesired.On} }, + {"forceLastGoodPlan", new AutomaticTuningOptions() {DesiredState=AutomaticTuningOptionModeDesired.Default} } + } + }; + + var resultUpdate = sqlClient.DatabaseAutomaticTuning.UpdateWithHttpMessagesAsync(resourceGroup.Name, server.Name, db1.Name, parameters).GetAwaiter().GetResult(); + + Assert.True(resultUpdate.Response.IsSuccessStatusCode); + + var resultGet = sqlClient.DatabaseAutomaticTuning.GetWithHttpMessagesAsync(resourceGroup.Name, server.Name, db1.Name).GetAwaiter().GetResult(); + + Assert.True(resultGet.Response.IsSuccessStatusCode); + Assert.Equal(AutomaticTuningMode.Inherit, resultGet.Body.DesiredState); + Assert.Equal(AutomaticTuningOptionModeDesired.Default, resultGet.Body.Options["createIndex"].DesiredState); + Assert.Equal(AutomaticTuningOptionModeDesired.On, resultGet.Body.Options["dropIndex"].DesiredState); + Assert.Equal(AutomaticTuningOptionModeDesired.Default, resultGet.Body.Options["forceLastGoodPlan"].DesiredState); + + // Set server autotuning options Custom + parameters = new DatabaseAutomaticTuning() + { + DesiredState = AutomaticTuningMode.Custom, + Options = new Dictionary() + { + {"createIndex", new AutomaticTuningOptions() {DesiredState=AutomaticTuningOptionModeDesired.On} }, + {"dropIndex", new AutomaticTuningOptions() {DesiredState=AutomaticTuningOptionModeDesired.Off} }, + {"forceLastGoodPlan", new AutomaticTuningOptions() {DesiredState=AutomaticTuningOptionModeDesired.Off} } + } + }; + + resultUpdate = sqlClient.DatabaseAutomaticTuning.UpdateWithHttpMessagesAsync(resourceGroup.Name, server.Name, db1.Name, parameters).GetAwaiter().GetResult(); + + Assert.True(resultUpdate.Response.IsSuccessStatusCode); + + resultGet = sqlClient.DatabaseAutomaticTuning.GetWithHttpMessagesAsync(resourceGroup.Name, server.Name, db1.Name).GetAwaiter().GetResult(); + + Assert.True(resultGet.Response.IsSuccessStatusCode); + Assert.Equal(AutomaticTuningMode.Custom, resultGet.Body.DesiredState); + Assert.Equal(AutomaticTuningOptionModeDesired.On, resultGet.Body.Options["createIndex"].DesiredState); + Assert.Equal(AutomaticTuningOptionModeDesired.Off, resultGet.Body.Options["dropIndex"].DesiredState); + Assert.Equal(AutomaticTuningOptionModeDesired.Off, resultGet.Body.Options["forceLastGoodPlan"].DesiredState); + + // Set server autotuning options Auto + parameters = new DatabaseAutomaticTuning() + { + DesiredState = AutomaticTuningMode.Auto + }; + + resultUpdate = sqlClient.DatabaseAutomaticTuning.UpdateWithHttpMessagesAsync(resourceGroup.Name, server.Name, db1.Name, parameters).GetAwaiter().GetResult(); + + Assert.True(resultUpdate.Response.IsSuccessStatusCode); + + resultGet = sqlClient.DatabaseAutomaticTuning.GetWithHttpMessagesAsync(resourceGroup.Name, server.Name, db1.Name).GetAwaiter().GetResult(); + + Assert.True(resultGet.Response.IsSuccessStatusCode); + Assert.Equal(AutomaticTuningMode.Auto, resultGet.Body.DesiredState); + } + } + } +} diff --git a/src/SDKs/SqlManagement/Sql.Tests/SessionRecords/Sql.Tests.AutomaticTuningOperationsTests/TestSetDatabaseAutotuningSettings.json b/src/SDKs/SqlManagement/Sql.Tests/SessionRecords/Sql.Tests.AutomaticTuningOperationsTests/TestSetDatabaseAutotuningSettings.json new file mode 100644 index 000000000000..a2dd72e4a8f2 --- /dev/null +++ b/src/SDKs/SqlManagement/Sql.Tests/SessionRecords/Sql.Tests.AutomaticTuningOperationsTests/TestSetDatabaseAutotuningSettings.json @@ -0,0 +1,1071 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourcegroups/sqlcrudtest-1170?api-version=2017-05-10", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNzQxZmQwZjUtOWNiOC00NDJjLTkxYzMtM2VmNGNhMjMxYzJhL3Jlc291cmNlZ3JvdXBzL3NxbGNydWR0ZXN0LTExNzA/YXBpLXZlcnNpb249MjAxNy0wNS0xMA==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"Japan East\",\r\n \"tags\": {\r\n \"sqlcrudtest-1170\": \"2018-01-23 17:19:03Z\"\r\n }\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "99" + ], + "x-ms-client-request-id": [ + "4e806ae6-c5f4-4f83-a4d1-4413bc0b5443" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25815.04", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.6.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourceGroups/sqlcrudtest-1170\",\r\n \"name\": \"sqlcrudtest-1170\",\r\n \"location\": \"japaneast\",\r\n \"tags\": {\r\n \"sqlcrudtest-1170\": \"2018-01-23 17:19:03Z\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "239" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 23 Jan 2018 17:19:06 GMT" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1197" + ], + "x-ms-request-id": [ + "2003b497-a059-44f0-8bfd-5d7a8a4d27a5" + ], + "x-ms-correlation-request-id": [ + "2003b497-a059-44f0-8bfd-5d7a8a4d27a5" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180123T171906Z:2003b497-a059-44f0-8bfd-5d7a8a4d27a5" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourceGroups/sqlcrudtest-1170/providers/Microsoft.Sql/servers/sqlcrudtest-378?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNzQxZmQwZjUtOWNiOC00NDJjLTkxYzMtM2VmNGNhMjMxYzJhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTExNzAvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC0zNzg/YXBpLXZlcnNpb249MjAxNS0wNS0wMS1wcmV2aWV3", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"administratorLogin\": \"dummylogin\",\r\n \"administratorLoginPassword\": \"Un53cuRE!\",\r\n \"version\": \"12.0\"\r\n },\r\n \"tags\": {},\r\n \"location\": \"Japan East\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "184" + ], + "x-ms-client-request-id": [ + "4b5f4c95-3bb0-492f-909f-1120314ce48e" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25815.04", + "Microsoft.Azure.Management.Sql.SqlManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"operation\": \"UpsertLogicalServer\",\r\n \"startTime\": \"2018-01-23T17:19:13.99Z\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "73" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 23 Jan 2018 17:19:11 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourceGroups/sqlcrudtest-1170/providers/Microsoft.Sql/locations/japaneast/serverOperationResults/7fd5f3e8-0dff-4b62-8562-586ffd9720f2?api-version=2015-05-01-preview" + ], + "Retry-After": [ + "1" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourceGroups/sqlcrudtest-1170/providers/Microsoft.Sql/locations/japaneast/serverAzureAsyncOperation/7fd5f3e8-0dff-4b62-8562-586ffd9720f2?api-version=2015-05-01-preview" + ], + "x-ms-request-id": [ + "7fd5f3e8-0dff-4b62-8562-586ffd9720f2" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1196" + ], + "x-ms-correlation-request-id": [ + "9fe998c0-7d31-42bb-b69d-3f0b285396aa" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180123T171911Z:9fe998c0-7d31-42bb-b69d-3f0b285396aa" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourceGroups/sqlcrudtest-1170/providers/Microsoft.Sql/locations/japaneast/serverAzureAsyncOperation/7fd5f3e8-0dff-4b62-8562-586ffd9720f2?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNzQxZmQwZjUtOWNiOC00NDJjLTkxYzMtM2VmNGNhMjMxYzJhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTExNzAvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbG9jYXRpb25zL2phcGFuZWFzdC9zZXJ2ZXJBenVyZUFzeW5jT3BlcmF0aW9uLzdmZDVmM2U4LTBkZmYtNGI2Mi04NTYyLTU4NmZmZDk3MjBmMj9hcGktdmVyc2lvbj0yMDE1LTA1LTAxLXByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25815.04", + "Microsoft.Azure.Management.Sql.SqlManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"name\": \"7fd5f3e8-0dff-4b62-8562-586ffd9720f2\",\r\n \"status\": \"InProgress\",\r\n \"startTime\": \"2018-01-23T17:19:13.99Z\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 23 Jan 2018 17:19:21 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Retry-After": [ + "20" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "43fbb1f4-b563-408a-8c94-ee22ef5800a9" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14836" + ], + "x-ms-correlation-request-id": [ + "e528da6b-24c8-4074-a9fc-a2b096649ff2" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180123T171922Z:e528da6b-24c8-4074-a9fc-a2b096649ff2" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourceGroups/sqlcrudtest-1170/providers/Microsoft.Sql/locations/japaneast/serverAzureAsyncOperation/7fd5f3e8-0dff-4b62-8562-586ffd9720f2?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNzQxZmQwZjUtOWNiOC00NDJjLTkxYzMtM2VmNGNhMjMxYzJhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTExNzAvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbG9jYXRpb25zL2phcGFuZWFzdC9zZXJ2ZXJBenVyZUFzeW5jT3BlcmF0aW9uLzdmZDVmM2U4LTBkZmYtNGI2Mi04NTYyLTU4NmZmZDk3MjBmMj9hcGktdmVyc2lvbj0yMDE1LTA1LTAxLXByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25815.04", + "Microsoft.Azure.Management.Sql.SqlManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"name\": \"7fd5f3e8-0dff-4b62-8562-586ffd9720f2\",\r\n \"status\": \"InProgress\",\r\n \"startTime\": \"2018-01-23T17:19:13.99Z\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 23 Jan 2018 17:19:42 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Retry-After": [ + "20" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "e1921244-80f7-4992-9e7c-95813dd70dbd" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14835" + ], + "x-ms-correlation-request-id": [ + "db8f5f03-56b2-471c-ae06-0abc3d48d9cf" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180123T171942Z:db8f5f03-56b2-471c-ae06-0abc3d48d9cf" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourceGroups/sqlcrudtest-1170/providers/Microsoft.Sql/locations/japaneast/serverAzureAsyncOperation/7fd5f3e8-0dff-4b62-8562-586ffd9720f2?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNzQxZmQwZjUtOWNiOC00NDJjLTkxYzMtM2VmNGNhMjMxYzJhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTExNzAvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbG9jYXRpb25zL2phcGFuZWFzdC9zZXJ2ZXJBenVyZUFzeW5jT3BlcmF0aW9uLzdmZDVmM2U4LTBkZmYtNGI2Mi04NTYyLTU4NmZmZDk3MjBmMj9hcGktdmVyc2lvbj0yMDE1LTA1LTAxLXByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25815.04", + "Microsoft.Azure.Management.Sql.SqlManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"name\": \"7fd5f3e8-0dff-4b62-8562-586ffd9720f2\",\r\n \"status\": \"Succeeded\",\r\n \"startTime\": \"2018-01-23T17:19:13.99Z\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 23 Jan 2018 17:20:02 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Retry-After": [ + "15" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "ed739475-ff87-4d95-bf10-ff3e7e447546" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14845" + ], + "x-ms-correlation-request-id": [ + "166063e0-0d2a-4d39-93ba-f40d61ed9a2f" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180123T172002Z:166063e0-0d2a-4d39-93ba-f40d61ed9a2f" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourceGroups/sqlcrudtest-1170/providers/Microsoft.Sql/servers/sqlcrudtest-378?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNzQxZmQwZjUtOWNiOC00NDJjLTkxYzMtM2VmNGNhMjMxYzJhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTExNzAvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC0zNzg/YXBpLXZlcnNpb249MjAxNS0wNS0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25815.04", + "Microsoft.Azure.Management.Sql.SqlManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"kind\": \"v12.0\",\r\n \"properties\": {\r\n \"administratorLogin\": \"dummylogin\",\r\n \"version\": \"12.0\",\r\n \"state\": \"Ready\",\r\n \"fullyQualifiedDomainName\": \"sqlcrudtest-378.database.windows.net\"\r\n },\r\n \"location\": \"japaneast\",\r\n \"tags\": {},\r\n \"id\": \"/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourceGroups/sqlcrudtest-1170/providers/Microsoft.Sql/servers/sqlcrudtest-378\",\r\n \"name\": \"sqlcrudtest-378\",\r\n \"type\": \"Microsoft.Sql/servers\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 23 Jan 2018 17:20:02 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "4db54470-5d54-48a6-9174-aa0ca95340d0" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14844" + ], + "x-ms-correlation-request-id": [ + "2d0bb384-857e-475b-a3d9-caf15562ce15" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180123T172003Z:2d0bb384-857e-475b-a3d9-caf15562ce15" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourceGroups/sqlcrudtest-1170/providers/Microsoft.Sql/servers/sqlcrudtest-378/databases/sqlcrudtest-8315?api-version=2014-04-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNzQxZmQwZjUtOWNiOC00NDJjLTkxYzMtM2VmNGNhMjMxYzJhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTExNzAvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC0zNzgvZGF0YWJhc2VzL3NxbGNydWR0ZXN0LTgzMTU/YXBpLXZlcnNpb249MjAxNC0wNC0wMQ==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"japaneast\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "31" + ], + "x-ms-client-request-id": [ + "66b6183c-4396-48a4-923d-996d876a3de7" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25815.04", + "Microsoft.Azure.Management.Sql.SqlManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"operation\": \"CreateLogicalDatabase\",\r\n \"startTime\": \"2018-01-23T18:20:05.713+01:00\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "80" + ], + "Content-Type": [ + "application/json; odata=minimalmetadata; streaming=true; charset=utf-8" + ], + "Cache-Control": [ + "no-store, no-cache" + ], + "Date": [ + "Tue, 23 Jan 2018 17:20:06 GMT" + ], + "Location": [ + "https://management.azure.com/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourceGroups/sqlcrudtest-1170/providers/Microsoft.Sql/servers/sqlcrudtest-378/databases/sqlcrudtest-8315/operationResults/a08bf198-4ed6-49ad-b842-6cab6c5fc2c3?api-version=2014-04-01-Preview" + ], + "Retry-After": [ + "30" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "a08bf198-4ed6-49ad-b842-6cab6c5fc2c3" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Preference-Applied": [ + "return-content" + ], + "DataServiceVersion": [ + "3.0;" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourceGroups/sqlcrudtest-1170/providers/Microsoft.Sql/servers/sqlcrudtest-378/databases/sqlcrudtest-8315/azureAsyncOperation/a08bf198-4ed6-49ad-b842-6cab6c5fc2c3?api-version=2014-04-01-Preview" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1195" + ], + "x-ms-correlation-request-id": [ + "94530696-d5fd-4480-9d6d-8b4fc09f286c" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180123T172007Z:94530696-d5fd-4480-9d6d-8b4fc09f286c" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourceGroups/sqlcrudtest-1170/providers/Microsoft.Sql/servers/sqlcrudtest-378/databases/sqlcrudtest-8315/azureAsyncOperation/a08bf198-4ed6-49ad-b842-6cab6c5fc2c3?api-version=2014-04-01-Preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNzQxZmQwZjUtOWNiOC00NDJjLTkxYzMtM2VmNGNhMjMxYzJhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTExNzAvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC0zNzgvZGF0YWJhc2VzL3NxbGNydWR0ZXN0LTgzMTUvYXp1cmVBc3luY09wZXJhdGlvbi9hMDhiZjE5OC00ZWQ2LTQ5YWQtYjg0Mi02Y2FiNmM1ZmMyYzM/YXBpLXZlcnNpb249MjAxNC0wNC0wMS1QcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25815.04", + "Microsoft.Azure.Management.Sql.SqlManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"operationId\": \"a08bf198-4ed6-49ad-b842-6cab6c5fc2c3\",\r\n \"status\": \"InProgress\",\r\n \"error\": null\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; odata=minimalmetadata; streaming=true; charset=utf-8" + ], + "Cache-Control": [ + "no-store, no-cache" + ], + "Date": [ + "Tue, 23 Jan 2018 17:20:36 GMT" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "2f63239b-d16c-4eb6-8e67-6916b914f338" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "DataServiceVersion": [ + "3.0;" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourceGroups/sqlcrudtest-1170/providers/Microsoft.Sql/servers/sqlcrudtest-378/databases/sqlcrudtest-8315/azureAsyncOperation/a08bf198-4ed6-49ad-b842-6cab6c5fc2c3?api-version=2014-04-01-Preview" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14842" + ], + "x-ms-correlation-request-id": [ + "f192f487-3fa6-4e92-8a3b-43465534a0d3" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180123T172037Z:f192f487-3fa6-4e92-8a3b-43465534a0d3" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourceGroups/sqlcrudtest-1170/providers/Microsoft.Sql/servers/sqlcrudtest-378/databases/sqlcrudtest-8315/azureAsyncOperation/a08bf198-4ed6-49ad-b842-6cab6c5fc2c3?api-version=2014-04-01-Preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNzQxZmQwZjUtOWNiOC00NDJjLTkxYzMtM2VmNGNhMjMxYzJhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTExNzAvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC0zNzgvZGF0YWJhc2VzL3NxbGNydWR0ZXN0LTgzMTUvYXp1cmVBc3luY09wZXJhdGlvbi9hMDhiZjE5OC00ZWQ2LTQ5YWQtYjg0Mi02Y2FiNmM1ZmMyYzM/YXBpLXZlcnNpb249MjAxNC0wNC0wMS1QcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25815.04", + "Microsoft.Azure.Management.Sql.SqlManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"operationId\": \"a08bf198-4ed6-49ad-b842-6cab6c5fc2c3\",\r\n \"status\": \"Succeeded\",\r\n \"error\": null\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; odata=minimalmetadata; streaming=true; charset=utf-8" + ], + "Cache-Control": [ + "no-store, no-cache" + ], + "Date": [ + "Tue, 23 Jan 2018 17:21:07 GMT" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "d6e95c20-5464-4771-8aa6-5f28f8a6ab30" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "DataServiceVersion": [ + "3.0;" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourceGroups/sqlcrudtest-1170/providers/Microsoft.Sql/servers/sqlcrudtest-378/databases/sqlcrudtest-8315/azureAsyncOperation/a08bf198-4ed6-49ad-b842-6cab6c5fc2c3?api-version=2014-04-01-Preview" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14840" + ], + "x-ms-correlation-request-id": [ + "77d994e2-54d9-40f3-a4db-3f997f909bf3" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180123T172108Z:77d994e2-54d9-40f3-a4db-3f997f909bf3" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourceGroups/sqlcrudtest-1170/providers/Microsoft.Sql/servers/sqlcrudtest-378/databases/sqlcrudtest-8315?api-version=2014-04-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNzQxZmQwZjUtOWNiOC00NDJjLTkxYzMtM2VmNGNhMjMxYzJhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTExNzAvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC0zNzgvZGF0YWJhc2VzL3NxbGNydWR0ZXN0LTgzMTU/YXBpLXZlcnNpb249MjAxNC0wNC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25815.04", + "Microsoft.Azure.Management.Sql.SqlManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourceGroups/sqlcrudtest-1170/providers/Microsoft.Sql/servers/sqlcrudtest-378/databases/sqlcrudtest-8315\",\r\n \"name\": \"sqlcrudtest-8315\",\r\n \"type\": \"Microsoft.Sql/servers/databases\",\r\n \"location\": \"Japan East\",\r\n \"kind\": \"v12.0,user\",\r\n \"properties\": {\r\n \"databaseId\": \"bccd6f74-f7fe-48dc-9624-f71e9af06b1d\",\r\n \"edition\": \"Standard\",\r\n \"status\": \"Online\",\r\n \"serviceLevelObjective\": \"S0\",\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"maxSizeBytes\": \"268435456000\",\r\n \"creationDate\": \"2018-01-23T17:20:05.947Z\",\r\n \"currentServiceObjectiveId\": \"f1173c43-91bd-4aaa-973c-54e79e15235b\",\r\n \"requestedServiceObjectiveId\": \"f1173c43-91bd-4aaa-973c-54e79e15235b\",\r\n \"requestedServiceObjectiveName\": \"S0\",\r\n \"sampleName\": null,\r\n \"defaultSecondaryLocation\": \"Japan West\",\r\n \"earliestRestoreDate\": \"2018-01-23T17:50:41.17Z\",\r\n \"elasticPoolName\": null,\r\n \"containmentState\": 2,\r\n \"readScale\": \"Disabled\",\r\n \"failoverGroupId\": null,\r\n \"zoneRedundant\": false,\r\n \"isUpgradeRequested\": false\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; odata=minimalmetadata; streaming=true; charset=utf-8" + ], + "Cache-Control": [ + "no-store, no-cache" + ], + "Date": [ + "Tue, 23 Jan 2018 17:21:08 GMT" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "628da151-8bae-4d30-9dd1-9785bc0f7298" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "DataServiceVersion": [ + "3.0;" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14839" + ], + "x-ms-correlation-request-id": [ + "eed16d50-8112-4145-89b6-3f5e8192ee66" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180123T172108Z:eed16d50-8112-4145-89b6-3f5e8192ee66" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourceGroups/sqlcrudtest-1170/providers/Microsoft.Sql/servers/sqlcrudtest-378/databases/sqlcrudtest-8315/automaticTuning/current?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNzQxZmQwZjUtOWNiOC00NDJjLTkxYzMtM2VmNGNhMjMxYzJhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTExNzAvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC0zNzgvZGF0YWJhc2VzL3NxbGNydWR0ZXN0LTgzMTUvYXV0b21hdGljVHVuaW5nL2N1cnJlbnQ/YXBpLXZlcnNpb249MjAxNS0wNS0wMS1wcmV2aWV3", + "RequestMethod": "PATCH", + "RequestBody": "{\r\n \"properties\": {\r\n \"desiredState\": \"Inherit\",\r\n \"options\": {\r\n \"createIndex\": {\r\n \"desiredState\": \"Default\"\r\n },\r\n \"dropIndex\": {\r\n \"desiredState\": \"On\"\r\n },\r\n \"forceLastGoodPlan\": {\r\n \"desiredState\": \"Default\"\r\n }\r\n }\r\n }\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "290" + ], + "x-ms-client-request-id": [ + "77b19370-fc61-4020-9de5-b364d14a8044" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25815.04", + "Microsoft.Azure.Management.Sql.SqlManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"desiredState\": \"Inherit\",\r\n \"actualState\": \"Unspecified\",\r\n \"options\": {\r\n \"forceLastGoodPlan\": {\r\n \"desiredState\": \"Default\",\r\n \"actualState\": \"Off\",\r\n \"reasonCode\": 3,\r\n \"reasonDesc\": \"InheritedFromServer\"\r\n },\r\n \"createIndex\": {\r\n \"desiredState\": \"Default\",\r\n \"actualState\": \"Off\",\r\n \"reasonCode\": 3,\r\n \"reasonDesc\": \"InheritedFromServer\"\r\n },\r\n \"dropIndex\": {\r\n \"desiredState\": \"On\",\r\n \"actualState\": \"On\"\r\n },\r\n \"maintainIndex\": {\r\n \"desiredState\": \"Default\",\r\n \"actualState\": \"Off\",\r\n \"reasonCode\": 3,\r\n \"reasonDesc\": \"InheritedFromServer\"\r\n }\r\n }\r\n },\r\n \"id\": \"/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourceGroups/sqlcrudtest-1170/providers/Microsoft.Sql/servers/sqlcrudtest-378/databases/sqlcrudtest-8315/automaticTuning/current\",\r\n \"name\": \"current\",\r\n \"type\": \"Microsoft.Sql/servers/databases/automaticTuning\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 23 Jan 2018 17:21:10 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "5ef37a3b-741b-4e2f-8ffe-b584b5fcdd16" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1194" + ], + "x-ms-correlation-request-id": [ + "9544547a-b009-4fbd-b9fe-54ec420f7e65" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180123T172110Z:9544547a-b009-4fbd-b9fe-54ec420f7e65" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourceGroups/sqlcrudtest-1170/providers/Microsoft.Sql/servers/sqlcrudtest-378/databases/sqlcrudtest-8315/automaticTuning/current?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNzQxZmQwZjUtOWNiOC00NDJjLTkxYzMtM2VmNGNhMjMxYzJhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTExNzAvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC0zNzgvZGF0YWJhc2VzL3NxbGNydWR0ZXN0LTgzMTUvYXV0b21hdGljVHVuaW5nL2N1cnJlbnQ/YXBpLXZlcnNpb249MjAxNS0wNS0wMS1wcmV2aWV3", + "RequestMethod": "PATCH", + "RequestBody": "{\r\n \"properties\": {\r\n \"desiredState\": \"Custom\",\r\n \"options\": {\r\n \"createIndex\": {\r\n \"desiredState\": \"On\"\r\n },\r\n \"dropIndex\": {\r\n \"desiredState\": \"Off\"\r\n },\r\n \"forceLastGoodPlan\": {\r\n \"desiredState\": \"Off\"\r\n }\r\n }\r\n }\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "281" + ], + "x-ms-client-request-id": [ + "1ec47636-2c1a-447d-b0f4-257cea640703" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25815.04", + "Microsoft.Azure.Management.Sql.SqlManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"desiredState\": \"Custom\",\r\n \"actualState\": \"Custom\",\r\n \"options\": {\r\n \"forceLastGoodPlan\": {\r\n \"desiredState\": \"Off\",\r\n \"actualState\": \"Off\"\r\n },\r\n \"createIndex\": {\r\n \"desiredState\": \"On\",\r\n \"actualState\": \"On\"\r\n },\r\n \"dropIndex\": {\r\n \"desiredState\": \"Off\",\r\n \"actualState\": \"Off\"\r\n },\r\n \"maintainIndex\": {\r\n \"desiredState\": \"Off\",\r\n \"actualState\": \"Off\"\r\n }\r\n }\r\n },\r\n \"id\": \"/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourceGroups/sqlcrudtest-1170/providers/Microsoft.Sql/servers/sqlcrudtest-378/databases/sqlcrudtest-8315/automaticTuning/current\",\r\n \"name\": \"current\",\r\n \"type\": \"Microsoft.Sql/servers/databases/automaticTuning\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 23 Jan 2018 17:21:11 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "7144ddb5-57b2-40e3-94c8-56c272f75348" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1193" + ], + "x-ms-correlation-request-id": [ + "c2fd8fa1-f44d-4163-9298-a5e8a8228de3" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180123T172111Z:c2fd8fa1-f44d-4163-9298-a5e8a8228de3" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourceGroups/sqlcrudtest-1170/providers/Microsoft.Sql/servers/sqlcrudtest-378/databases/sqlcrudtest-8315/automaticTuning/current?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNzQxZmQwZjUtOWNiOC00NDJjLTkxYzMtM2VmNGNhMjMxYzJhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTExNzAvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC0zNzgvZGF0YWJhc2VzL3NxbGNydWR0ZXN0LTgzMTUvYXV0b21hdGljVHVuaW5nL2N1cnJlbnQ/YXBpLXZlcnNpb249MjAxNS0wNS0wMS1wcmV2aWV3", + "RequestMethod": "PATCH", + "RequestBody": "{\r\n \"properties\": {\r\n \"desiredState\": \"Auto\"\r\n }\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "56" + ], + "x-ms-client-request-id": [ + "1b282c1d-a6b6-463f-8191-bc3a1713841a" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25815.04", + "Microsoft.Azure.Management.Sql.SqlManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"desiredState\": \"Auto\",\r\n \"actualState\": \"Auto\",\r\n \"options\": {\r\n \"forceLastGoodPlan\": {\r\n \"desiredState\": \"Off\",\r\n \"actualState\": \"Off\"\r\n },\r\n \"createIndex\": {\r\n \"desiredState\": \"On\",\r\n \"actualState\": \"On\"\r\n },\r\n \"dropIndex\": {\r\n \"desiredState\": \"Off\",\r\n \"actualState\": \"Off\"\r\n },\r\n \"maintainIndex\": {\r\n \"desiredState\": \"Off\",\r\n \"actualState\": \"Off\"\r\n }\r\n }\r\n },\r\n \"id\": \"/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourceGroups/sqlcrudtest-1170/providers/Microsoft.Sql/servers/sqlcrudtest-378/databases/sqlcrudtest-8315/automaticTuning/current\",\r\n \"name\": \"current\",\r\n \"type\": \"Microsoft.Sql/servers/databases/automaticTuning\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 23 Jan 2018 17:21:12 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "454b3737-2930-4f7e-a0eb-59d2ef9cd7ea" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1192" + ], + "x-ms-correlation-request-id": [ + "be8d0029-7d8e-4086-ac94-864e512d6cd1" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180123T172112Z:be8d0029-7d8e-4086-ac94-864e512d6cd1" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourceGroups/sqlcrudtest-1170/providers/Microsoft.Sql/servers/sqlcrudtest-378/databases/sqlcrudtest-8315/automaticTuning/current?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNzQxZmQwZjUtOWNiOC00NDJjLTkxYzMtM2VmNGNhMjMxYzJhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTExNzAvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC0zNzgvZGF0YWJhc2VzL3NxbGNydWR0ZXN0LTgzMTUvYXV0b21hdGljVHVuaW5nL2N1cnJlbnQ/YXBpLXZlcnNpb249MjAxNS0wNS0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "fb0bdb51-c89e-48fe-82b9-ed7d93a969bb" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25815.04", + "Microsoft.Azure.Management.Sql.SqlManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"desiredState\": \"Inherit\",\r\n \"actualState\": \"Unspecified\",\r\n \"options\": {\r\n \"forceLastGoodPlan\": {\r\n \"desiredState\": \"Default\",\r\n \"actualState\": \"Off\",\r\n \"reasonCode\": 3,\r\n \"reasonDesc\": \"InheritedFromServer\"\r\n },\r\n \"createIndex\": {\r\n \"desiredState\": \"Default\",\r\n \"actualState\": \"Off\",\r\n \"reasonCode\": 3,\r\n \"reasonDesc\": \"InheritedFromServer\"\r\n },\r\n \"dropIndex\": {\r\n \"desiredState\": \"On\",\r\n \"actualState\": \"On\"\r\n },\r\n \"maintainIndex\": {\r\n \"desiredState\": \"Default\",\r\n \"actualState\": \"Off\",\r\n \"reasonCode\": 3,\r\n \"reasonDesc\": \"InheritedFromServer\"\r\n }\r\n }\r\n },\r\n \"id\": \"/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourceGroups/sqlcrudtest-1170/providers/Microsoft.Sql/servers/sqlcrudtest-378/databases/sqlcrudtest-8315/automaticTuning/current\",\r\n \"name\": \"current\",\r\n \"type\": \"Microsoft.Sql/servers/databases/automaticTuning\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 23 Jan 2018 17:21:10 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "31d8129b-be50-4426-8f7a-d8a4c8d76301" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14838" + ], + "x-ms-correlation-request-id": [ + "576e337b-c781-422e-91c4-92c08e17f1d2" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180123T172111Z:576e337b-c781-422e-91c4-92c08e17f1d2" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourceGroups/sqlcrudtest-1170/providers/Microsoft.Sql/servers/sqlcrudtest-378/databases/sqlcrudtest-8315/automaticTuning/current?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNzQxZmQwZjUtOWNiOC00NDJjLTkxYzMtM2VmNGNhMjMxYzJhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTExNzAvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC0zNzgvZGF0YWJhc2VzL3NxbGNydWR0ZXN0LTgzMTUvYXV0b21hdGljVHVuaW5nL2N1cnJlbnQ/YXBpLXZlcnNpb249MjAxNS0wNS0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "9cf90b20-ef39-4c3f-a055-9b3d76794ee2" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25815.04", + "Microsoft.Azure.Management.Sql.SqlManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"desiredState\": \"Custom\",\r\n \"actualState\": \"Custom\",\r\n \"options\": {\r\n \"forceLastGoodPlan\": {\r\n \"desiredState\": \"Off\",\r\n \"actualState\": \"Off\"\r\n },\r\n \"createIndex\": {\r\n \"desiredState\": \"On\",\r\n \"actualState\": \"On\"\r\n },\r\n \"dropIndex\": {\r\n \"desiredState\": \"Off\",\r\n \"actualState\": \"Off\"\r\n },\r\n \"maintainIndex\": {\r\n \"desiredState\": \"Off\",\r\n \"actualState\": \"Off\"\r\n }\r\n }\r\n },\r\n \"id\": \"/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourceGroups/sqlcrudtest-1170/providers/Microsoft.Sql/servers/sqlcrudtest-378/databases/sqlcrudtest-8315/automaticTuning/current\",\r\n \"name\": \"current\",\r\n \"type\": \"Microsoft.Sql/servers/databases/automaticTuning\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 23 Jan 2018 17:21:11 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "b5f8cac9-655f-418b-b040-6a0486cf3ffa" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14837" + ], + "x-ms-correlation-request-id": [ + "01389414-31aa-4b72-842c-682328657faf" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180123T172112Z:01389414-31aa-4b72-842c-682328657faf" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourceGroups/sqlcrudtest-1170/providers/Microsoft.Sql/servers/sqlcrudtest-378/databases/sqlcrudtest-8315/automaticTuning/current?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNzQxZmQwZjUtOWNiOC00NDJjLTkxYzMtM2VmNGNhMjMxYzJhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTExNzAvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC0zNzgvZGF0YWJhc2VzL3NxbGNydWR0ZXN0LTgzMTUvYXV0b21hdGljVHVuaW5nL2N1cnJlbnQ/YXBpLXZlcnNpb249MjAxNS0wNS0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "9c2c734c-fef5-4ddd-bc97-a17646be659f" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25815.04", + "Microsoft.Azure.Management.Sql.SqlManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"desiredState\": \"Auto\",\r\n \"actualState\": \"Auto\",\r\n \"options\": {\r\n \"forceLastGoodPlan\": {\r\n \"desiredState\": \"Off\",\r\n \"actualState\": \"Off\"\r\n },\r\n \"createIndex\": {\r\n \"desiredState\": \"On\",\r\n \"actualState\": \"On\"\r\n },\r\n \"dropIndex\": {\r\n \"desiredState\": \"Off\",\r\n \"actualState\": \"Off\"\r\n },\r\n \"maintainIndex\": {\r\n \"desiredState\": \"Off\",\r\n \"actualState\": \"Off\"\r\n }\r\n }\r\n },\r\n \"id\": \"/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourceGroups/sqlcrudtest-1170/providers/Microsoft.Sql/servers/sqlcrudtest-378/databases/sqlcrudtest-8315/automaticTuning/current\",\r\n \"name\": \"current\",\r\n \"type\": \"Microsoft.Sql/servers/databases/automaticTuning\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 23 Jan 2018 17:21:12 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "ce791a8b-f9c1-48c8-be28-bef7682a5be0" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14836" + ], + "x-ms-correlation-request-id": [ + "0c9be24f-895a-4afc-8a76-ebea07ee709e" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180123T172112Z:0c9be24f-895a-4afc-8a76-ebea07ee709e" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourcegroups/sqlcrudtest-1170?api-version=2017-05-10", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNzQxZmQwZjUtOWNiOC00NDJjLTkxYzMtM2VmNGNhMjMxYzJhL3Jlc291cmNlZ3JvdXBzL3NxbGNydWR0ZXN0LTExNzA/YXBpLXZlcnNpb249MjAxNy0wNS0xMA==", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "276e6d18-4c17-4126-acca-7b84cb178b5c" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25815.04", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.6.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 23 Jan 2018 17:21:16 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1TUUxDUlVEVEVTVDoyRDExNzAtSkFQQU5FQVNUIiwiam9iTG9jYXRpb24iOiJqYXBhbmVhc3QifQ?api-version=2017-05-10" + ], + "Retry-After": [ + "15" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1192" + ], + "x-ms-request-id": [ + "8888f69d-0f0a-4bf1-9e5c-8584e4d993b1" + ], + "x-ms-correlation-request-id": [ + "8888f69d-0f0a-4bf1-9e5c-8584e4d993b1" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180123T172117Z:8888f69d-0f0a-4bf1-9e5c-8584e4d993b1" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 202 + } + ], + "Names": { + "CreateResourceGroup": [ + "sqlcrudtest-1170" + ], + "CreateServer": [ + "sqlcrudtest-378" + ], + "TestSetDatabaseAutotuningSettings": [ + "sqlcrudtest-8315" + ] + }, + "Variables": { + "SubscriptionId": "741fd0f5-9cb8-442c-91c3-3ef4ca231c2a", + "DefaultLocation": "Japan East" + } +} \ No newline at end of file diff --git a/src/SDKs/SqlManagement/Sql.Tests/SessionRecords/Sql.Tests.AutomaticTuningOperationsTests/TestSetServerAutotuningSettings.json b/src/SDKs/SqlManagement/Sql.Tests/SessionRecords/Sql.Tests.AutomaticTuningOperationsTests/TestSetServerAutotuningSettings.json new file mode 100644 index 000000000000..1a0a9f0546c1 --- /dev/null +++ b/src/SDKs/SqlManagement/Sql.Tests/SessionRecords/Sql.Tests.AutomaticTuningOperationsTests/TestSetServerAutotuningSettings.json @@ -0,0 +1,693 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourcegroups/sqlcrudtest-6066?api-version=2017-05-10", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNzQxZmQwZjUtOWNiOC00NDJjLTkxYzMtM2VmNGNhMjMxYzJhL3Jlc291cmNlZ3JvdXBzL3NxbGNydWR0ZXN0LTYwNjY/YXBpLXZlcnNpb249MjAxNy0wNS0xMA==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"Japan East\",\r\n \"tags\": {\r\n \"sqlcrudtest-6066\": \"2018-01-23 17:21:24Z\"\r\n }\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "99" + ], + "x-ms-client-request-id": [ + "416d3665-7233-406b-9174-c36da3da6864" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25815.04", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.6.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourceGroups/sqlcrudtest-6066\",\r\n \"name\": \"sqlcrudtest-6066\",\r\n \"location\": \"japaneast\",\r\n \"tags\": {\r\n \"sqlcrudtest-6066\": \"2018-01-23 17:21:24Z\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "239" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 23 Jan 2018 17:21:25 GMT" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1191" + ], + "x-ms-request-id": [ + "7eb355f2-cd3d-43bc-8e22-60974aff01d7" + ], + "x-ms-correlation-request-id": [ + "7eb355f2-cd3d-43bc-8e22-60974aff01d7" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180123T172126Z:7eb355f2-cd3d-43bc-8e22-60974aff01d7" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourceGroups/sqlcrudtest-6066/providers/Microsoft.Sql/servers/sqlcrudtest-1658?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNzQxZmQwZjUtOWNiOC00NDJjLTkxYzMtM2VmNGNhMjMxYzJhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTYwNjYvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC0xNjU4P2FwaS12ZXJzaW9uPTIwMTUtMDUtMDEtcHJldmlldw==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"administratorLogin\": \"dummylogin\",\r\n \"administratorLoginPassword\": \"Un53cuRE!\",\r\n \"version\": \"12.0\"\r\n },\r\n \"tags\": {},\r\n \"location\": \"Japan East\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "184" + ], + "x-ms-client-request-id": [ + "cfae6c1a-a762-4ead-a348-e03b975b6d5b" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25815.04", + "Microsoft.Azure.Management.Sql.SqlManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"operation\": \"UpsertLogicalServer\",\r\n \"startTime\": \"2018-01-23T17:21:34.09Z\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "73" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 23 Jan 2018 17:21:32 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourceGroups/sqlcrudtest-6066/providers/Microsoft.Sql/locations/japaneast/serverOperationResults/9d6ab656-7206-488f-af78-2855548b6db0?api-version=2015-05-01-preview" + ], + "Retry-After": [ + "1" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourceGroups/sqlcrudtest-6066/providers/Microsoft.Sql/locations/japaneast/serverAzureAsyncOperation/9d6ab656-7206-488f-af78-2855548b6db0?api-version=2015-05-01-preview" + ], + "x-ms-request-id": [ + "9d6ab656-7206-488f-af78-2855548b6db0" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1196" + ], + "x-ms-correlation-request-id": [ + "6190a34f-3125-4015-aeb0-5675b9f17851" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180123T172132Z:6190a34f-3125-4015-aeb0-5675b9f17851" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourceGroups/sqlcrudtest-6066/providers/Microsoft.Sql/locations/japaneast/serverAzureAsyncOperation/9d6ab656-7206-488f-af78-2855548b6db0?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNzQxZmQwZjUtOWNiOC00NDJjLTkxYzMtM2VmNGNhMjMxYzJhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTYwNjYvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbG9jYXRpb25zL2phcGFuZWFzdC9zZXJ2ZXJBenVyZUFzeW5jT3BlcmF0aW9uLzlkNmFiNjU2LTcyMDYtNDg4Zi1hZjc4LTI4NTU1NDhiNmRiMD9hcGktdmVyc2lvbj0yMDE1LTA1LTAxLXByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25815.04", + "Microsoft.Azure.Management.Sql.SqlManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"name\": \"9d6ab656-7206-488f-af78-2855548b6db0\",\r\n \"status\": \"InProgress\",\r\n \"startTime\": \"2018-01-23T17:21:34.09Z\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 23 Jan 2018 17:21:42 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Retry-After": [ + "20" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "8e8da213-5ac3-4dd7-a375-544df967568d" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14734" + ], + "x-ms-correlation-request-id": [ + "7d3c111e-95b7-475f-9f15-dd0f8cfd98ca" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180123T172142Z:7d3c111e-95b7-475f-9f15-dd0f8cfd98ca" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourceGroups/sqlcrudtest-6066/providers/Microsoft.Sql/locations/japaneast/serverAzureAsyncOperation/9d6ab656-7206-488f-af78-2855548b6db0?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNzQxZmQwZjUtOWNiOC00NDJjLTkxYzMtM2VmNGNhMjMxYzJhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTYwNjYvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbG9jYXRpb25zL2phcGFuZWFzdC9zZXJ2ZXJBenVyZUFzeW5jT3BlcmF0aW9uLzlkNmFiNjU2LTcyMDYtNDg4Zi1hZjc4LTI4NTU1NDhiNmRiMD9hcGktdmVyc2lvbj0yMDE1LTA1LTAxLXByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25815.04", + "Microsoft.Azure.Management.Sql.SqlManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"name\": \"9d6ab656-7206-488f-af78-2855548b6db0\",\r\n \"status\": \"InProgress\",\r\n \"startTime\": \"2018-01-23T17:21:34.09Z\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 23 Jan 2018 17:22:02 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Retry-After": [ + "20" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "b8d0a6df-e69e-4e54-9f0b-a38304fb3a97" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14733" + ], + "x-ms-correlation-request-id": [ + "64f12cbc-6d5e-4804-8d14-703e5f08381c" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180123T172203Z:64f12cbc-6d5e-4804-8d14-703e5f08381c" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourceGroups/sqlcrudtest-6066/providers/Microsoft.Sql/locations/japaneast/serverAzureAsyncOperation/9d6ab656-7206-488f-af78-2855548b6db0?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNzQxZmQwZjUtOWNiOC00NDJjLTkxYzMtM2VmNGNhMjMxYzJhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTYwNjYvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbG9jYXRpb25zL2phcGFuZWFzdC9zZXJ2ZXJBenVyZUFzeW5jT3BlcmF0aW9uLzlkNmFiNjU2LTcyMDYtNDg4Zi1hZjc4LTI4NTU1NDhiNmRiMD9hcGktdmVyc2lvbj0yMDE1LTA1LTAxLXByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25815.04", + "Microsoft.Azure.Management.Sql.SqlManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"name\": \"9d6ab656-7206-488f-af78-2855548b6db0\",\r\n \"status\": \"Succeeded\",\r\n \"startTime\": \"2018-01-23T17:21:34.09Z\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 23 Jan 2018 17:22:22 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Retry-After": [ + "15" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "b0f7b336-e511-472a-b156-60f47795e0fb" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14732" + ], + "x-ms-correlation-request-id": [ + "fa2acdef-5a29-4ccc-922c-2c1f6ab66b1c" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180123T172223Z:fa2acdef-5a29-4ccc-922c-2c1f6ab66b1c" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourceGroups/sqlcrudtest-6066/providers/Microsoft.Sql/servers/sqlcrudtest-1658?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNzQxZmQwZjUtOWNiOC00NDJjLTkxYzMtM2VmNGNhMjMxYzJhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTYwNjYvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC0xNjU4P2FwaS12ZXJzaW9uPTIwMTUtMDUtMDEtcHJldmlldw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25815.04", + "Microsoft.Azure.Management.Sql.SqlManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"kind\": \"v12.0\",\r\n \"properties\": {\r\n \"administratorLogin\": \"dummylogin\",\r\n \"version\": \"12.0\",\r\n \"state\": \"Ready\",\r\n \"fullyQualifiedDomainName\": \"sqlcrudtest-1658.database.windows.net\"\r\n },\r\n \"location\": \"japaneast\",\r\n \"tags\": {},\r\n \"id\": \"/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourceGroups/sqlcrudtest-6066/providers/Microsoft.Sql/servers/sqlcrudtest-1658\",\r\n \"name\": \"sqlcrudtest-1658\",\r\n \"type\": \"Microsoft.Sql/servers\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 23 Jan 2018 17:22:23 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "9b852586-6555-4d29-a510-94adc1f6a05f" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14731" + ], + "x-ms-correlation-request-id": [ + "2b85d286-5797-4a32-a810-c4115040f87a" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180123T172223Z:2b85d286-5797-4a32-a810-c4115040f87a" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourceGroups/sqlcrudtest-6066/providers/Microsoft.Sql/servers/sqlcrudtest-1658/automaticTuning/current?api-version=2017-03-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNzQxZmQwZjUtOWNiOC00NDJjLTkxYzMtM2VmNGNhMjMxYzJhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTYwNjYvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC0xNjU4L2F1dG9tYXRpY1R1bmluZy9jdXJyZW50P2FwaS12ZXJzaW9uPTIwMTctMDMtMDEtcHJldmlldw==", + "RequestMethod": "PATCH", + "RequestBody": "{\r\n \"properties\": {\r\n \"desiredState\": \"Custom\",\r\n \"options\": {\r\n \"createIndex\": {\r\n \"desiredState\": \"On\"\r\n },\r\n \"dropIndex\": {\r\n \"desiredState\": \"Off\"\r\n },\r\n \"forceLastGoodPlan\": {\r\n \"desiredState\": \"On\"\r\n }\r\n }\r\n }\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "280" + ], + "x-ms-client-request-id": [ + "496b61e5-16de-4d2a-9949-9d22f4cd1330" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25815.04", + "Microsoft.Azure.Management.Sql.SqlManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"desiredState\": \"Custom\",\r\n \"actualState\": \"Custom\",\r\n \"options\": {\r\n \"createIndex\": {\r\n \"desiredState\": \"On\",\r\n \"actualState\": \"On\"\r\n },\r\n \"dropIndex\": {\r\n \"desiredState\": \"Off\",\r\n \"actualState\": \"Off\"\r\n },\r\n \"forceLastGoodPlan\": {\r\n \"desiredState\": \"On\",\r\n \"actualState\": \"On\"\r\n },\r\n \"maintainIndex\": {\r\n \"desiredState\": \"Off\",\r\n \"actualState\": \"Off\"\r\n }\r\n }\r\n },\r\n \"id\": \"/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourceGroups/sqlcrudtest-6066/providers/Microsoft.Sql/servers/sqlcrudtest-1658/automaticTuning/current\",\r\n \"name\": \"current\",\r\n \"type\": \"Microsoft.Sql/servers/automaticTuning\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 23 Jan 2018 17:22:25 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "60290e94-bdd6-434f-93a8-a3930addbdb9" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1195" + ], + "x-ms-correlation-request-id": [ + "2120f551-b001-40a1-98fa-865fee05523a" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180123T172225Z:2120f551-b001-40a1-98fa-865fee05523a" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourceGroups/sqlcrudtest-6066/providers/Microsoft.Sql/servers/sqlcrudtest-1658/automaticTuning/current?api-version=2017-03-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNzQxZmQwZjUtOWNiOC00NDJjLTkxYzMtM2VmNGNhMjMxYzJhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTYwNjYvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC0xNjU4L2F1dG9tYXRpY1R1bmluZy9jdXJyZW50P2FwaS12ZXJzaW9uPTIwMTctMDMtMDEtcHJldmlldw==", + "RequestMethod": "PATCH", + "RequestBody": "{\r\n \"properties\": {\r\n \"desiredState\": \"Auto\",\r\n \"options\": {\r\n \"createIndex\": {\r\n \"desiredState\": \"Default\"\r\n },\r\n \"dropIndex\": {\r\n \"desiredState\": \"Default\"\r\n },\r\n \"forceLastGoodPlan\": {\r\n \"desiredState\": \"On\"\r\n }\r\n }\r\n }\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "287" + ], + "x-ms-client-request-id": [ + "ce0d88e8-4f16-4854-bf6d-90a69334301b" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25815.04", + "Microsoft.Azure.Management.Sql.SqlManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"desiredState\": \"Auto\",\r\n \"actualState\": \"Auto\",\r\n \"options\": {\r\n \"createIndex\": {\r\n \"desiredState\": \"Default\",\r\n \"actualState\": \"On\",\r\n \"reasonCode\": 2,\r\n \"reasonDesc\": \"AutoConfigured\"\r\n },\r\n \"dropIndex\": {\r\n \"desiredState\": \"Default\",\r\n \"actualState\": \"Off\",\r\n \"reasonCode\": 2,\r\n \"reasonDesc\": \"AutoConfigured\"\r\n },\r\n \"forceLastGoodPlan\": {\r\n \"desiredState\": \"On\",\r\n \"actualState\": \"On\"\r\n },\r\n \"maintainIndex\": {\r\n \"desiredState\": \"Off\",\r\n \"actualState\": \"Off\"\r\n }\r\n }\r\n },\r\n \"id\": \"/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourceGroups/sqlcrudtest-6066/providers/Microsoft.Sql/servers/sqlcrudtest-1658/automaticTuning/current\",\r\n \"name\": \"current\",\r\n \"type\": \"Microsoft.Sql/servers/automaticTuning\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 23 Jan 2018 17:22:26 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "e1168e00-8ef8-4b8b-889e-9e13e057ab1d" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1194" + ], + "x-ms-correlation-request-id": [ + "132ef994-9a89-40d5-9d81-32af46c2d00b" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180123T172226Z:132ef994-9a89-40d5-9d81-32af46c2d00b" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourceGroups/sqlcrudtest-6066/providers/Microsoft.Sql/servers/sqlcrudtest-1658/automaticTuning/current?api-version=2017-03-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNzQxZmQwZjUtOWNiOC00NDJjLTkxYzMtM2VmNGNhMjMxYzJhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTYwNjYvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC0xNjU4L2F1dG9tYXRpY1R1bmluZy9jdXJyZW50P2FwaS12ZXJzaW9uPTIwMTctMDMtMDEtcHJldmlldw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "9617b395-fcae-4f12-8bd8-bdcec828b1b5" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25815.04", + "Microsoft.Azure.Management.Sql.SqlManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"desiredState\": \"Custom\",\r\n \"actualState\": \"Custom\",\r\n \"options\": {\r\n \"createIndex\": {\r\n \"desiredState\": \"On\",\r\n \"actualState\": \"On\"\r\n },\r\n \"dropIndex\": {\r\n \"desiredState\": \"Off\",\r\n \"actualState\": \"Off\"\r\n },\r\n \"forceLastGoodPlan\": {\r\n \"desiredState\": \"On\",\r\n \"actualState\": \"On\"\r\n },\r\n \"maintainIndex\": {\r\n \"desiredState\": \"Off\",\r\n \"actualState\": \"Off\"\r\n }\r\n }\r\n },\r\n \"id\": \"/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourceGroups/sqlcrudtest-6066/providers/Microsoft.Sql/servers/sqlcrudtest-1658/automaticTuning/current\",\r\n \"name\": \"current\",\r\n \"type\": \"Microsoft.Sql/servers/automaticTuning\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 23 Jan 2018 17:22:25 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "00995ef1-e506-4001-a181-692dc1355849" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14729" + ], + "x-ms-correlation-request-id": [ + "cba898c7-a630-4632-b612-91ef3efb843b" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180123T172225Z:cba898c7-a630-4632-b612-91ef3efb843b" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourceGroups/sqlcrudtest-6066/providers/Microsoft.Sql/servers/sqlcrudtest-1658/automaticTuning/current?api-version=2017-03-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNzQxZmQwZjUtOWNiOC00NDJjLTkxYzMtM2VmNGNhMjMxYzJhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTYwNjYvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC0xNjU4L2F1dG9tYXRpY1R1bmluZy9jdXJyZW50P2FwaS12ZXJzaW9uPTIwMTctMDMtMDEtcHJldmlldw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "92ac3864-3de1-4a24-adaf-1fd640c2d31c" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25815.04", + "Microsoft.Azure.Management.Sql.SqlManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"desiredState\": \"Auto\",\r\n \"actualState\": \"Auto\",\r\n \"options\": {\r\n \"createIndex\": {\r\n \"desiredState\": \"Default\",\r\n \"actualState\": \"On\",\r\n \"reasonCode\": 2,\r\n \"reasonDesc\": \"AutoConfigured\"\r\n },\r\n \"dropIndex\": {\r\n \"desiredState\": \"Default\",\r\n \"actualState\": \"Off\",\r\n \"reasonCode\": 2,\r\n \"reasonDesc\": \"AutoConfigured\"\r\n },\r\n \"forceLastGoodPlan\": {\r\n \"desiredState\": \"On\",\r\n \"actualState\": \"On\"\r\n },\r\n \"maintainIndex\": {\r\n \"desiredState\": \"Off\",\r\n \"actualState\": \"Off\"\r\n }\r\n }\r\n },\r\n \"id\": \"/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourceGroups/sqlcrudtest-6066/providers/Microsoft.Sql/servers/sqlcrudtest-1658/automaticTuning/current\",\r\n \"name\": \"current\",\r\n \"type\": \"Microsoft.Sql/servers/automaticTuning\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 23 Jan 2018 17:22:26 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "d3d98edd-547e-48f5-b046-5458e73ffd79" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14728" + ], + "x-ms-correlation-request-id": [ + "0314f288-8ce6-4a8a-ae5d-97f56af919be" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180123T172226Z:0314f288-8ce6-4a8a-ae5d-97f56af919be" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/resourcegroups/sqlcrudtest-6066?api-version=2017-05-10", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNzQxZmQwZjUtOWNiOC00NDJjLTkxYzMtM2VmNGNhMjMxYzJhL3Jlc291cmNlZ3JvdXBzL3NxbGNydWR0ZXN0LTYwNjY/YXBpLXZlcnNpb249MjAxNy0wNS0xMA==", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "cf8ede25-f13b-412a-bebc-823647d3fe62" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25815.04", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.6.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 23 Jan 2018 17:22:30 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/741fd0f5-9cb8-442c-91c3-3ef4ca231c2a/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1TUUxDUlVEVEVTVDoyRDYwNjYtSkFQQU5FQVNUIiwiam9iTG9jYXRpb24iOiJqYXBhbmVhc3QifQ?api-version=2017-05-10" + ], + "Retry-After": [ + "15" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1196" + ], + "x-ms-request-id": [ + "ab5f38c6-4e56-48a6-b32b-c28fdf2c5c15" + ], + "x-ms-correlation-request-id": [ + "ab5f38c6-4e56-48a6-b32b-c28fdf2c5c15" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180123T172230Z:ab5f38c6-4e56-48a6-b32b-c28fdf2c5c15" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 202 + } + ], + "Names": { + "CreateResourceGroup": [ + "sqlcrudtest-6066" + ], + "CreateServer": [ + "sqlcrudtest-1658" + ] + }, + "Variables": { + "DefaultLocation": "Japan East", + "SubscriptionId": "741fd0f5-9cb8-442c-91c3-3ef4ca231c2a" + } +} \ No newline at end of file diff --git a/src/SDKs/_metadata/sql_resource-manager.txt b/src/SDKs/_metadata/sql_resource-manager.txt index 0615c192b67a..79d4ebdf7ffb 100644 --- a/src/SDKs/_metadata/sql_resource-manager.txt +++ b/src/SDKs/_metadata/sql_resource-manager.txt @@ -1,14 +1,11 @@ - -Type dsc to start/install the DS Consolidated Console - -2017-12-15 19:11:44 UTC +2017-12-28 15:27:27 UTC 1) azure-rest-api-specs repository information -GitHub user: Azure +GitHub user: kosta-bizetic Branch: current -Commit: f6866d839b3a2f595a8407fc1a7758ec562dd46b +Commit: 23b7b48cf251dbe1a6dbbf749a6bb0c1b5bbbe2e 2) AutoRest information Requested version: latest -Bootstrapper version: C:\Users\jaredmoo\AppData\Roaming\npm `-- autorest@2.0.4215 +Bootstrapper version: C:\Users\v-kobize\AppData\Roaming\npm `-- autorest@2.0.4215 Latest installed version: From 55e96026419efe4e960c92214feabc6c5ab4bb62 Mon Sep 17 00:00:00 2001 From: Kosta Bizetic Date: Wed, 31 Jan 2018 12:08:28 +0100 Subject: [PATCH 2/2] Metadata change in sql_resource-manager.txt --- src/SDKs/_metadata/sql_resource-manager.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/SDKs/_metadata/sql_resource-manager.txt b/src/SDKs/_metadata/sql_resource-manager.txt index 79d4ebdf7ffb..e94eaf180402 100644 --- a/src/SDKs/_metadata/sql_resource-manager.txt +++ b/src/SDKs/_metadata/sql_resource-manager.txt @@ -1,11 +1,11 @@ -2017-12-28 15:27:27 UTC +2018-01-31 10:51:15 UTC 1) azure-rest-api-specs repository information GitHub user: kosta-bizetic -Branch: current -Commit: 23b7b48cf251dbe1a6dbbf749a6bb0c1b5bbbe2e +Branch: master +Commit: fb9e1b2a7561e7bd7d697011bd063964f2521861 2) AutoRest information Requested version: latest -Bootstrapper version: C:\Users\v-kobize\AppData\Roaming\npm `-- autorest@2.0.4215 +Bootstrapper version: C:\Users\v-kobize\AppData\Roaming\npm `-- autorest@2.0.4245 Latest installed version: