From 3d3c39888cd3b76800a31dc992ae789db00c8a5a Mon Sep 17 00:00:00 2001 From: Bogdan Ostojic Date: Thu, 31 Mar 2022 17:46:47 +0200 Subject: [PATCH 01/10] initial generate --- ...DistributedAvailabilityGroupsOperations.cs | 10 +- .../EndpointCertificatesOperations.cs | 626 ++++++++ ...ndpointCertificatesOperationsExtensions.cs | 149 ++ .../IEndpointCertificatesOperations.cs | 106 ++ ...agedDatabaseSensitivityLabelsOperations.cs | 151 +- .../IManagedServerDnsAliasesOperations.cs | 281 ++++ .../Generated/IReplicationLinksOperations.cs | 135 +- .../Generated/ISensitivityLabelsOperations.cs | 103 +- .../IServerTrustCertificatesOperations.cs | 52 +- .../src/Generated/ISqlManagementClient.cs | 60 +- ...eRecommendedSensitivityLabelsOperations.cs | 2 +- ...agedDatabaseSensitivityLabelsOperations.cs | 881 ++++++++--- ...seSensitivityLabelsOperationsExtensions.cs | 300 ++-- .../ManagedServerDnsAliasesOperations.cs | 1340 +++++++++++++++++ ...gedServerDnsAliasesOperationsExtensions.cs | 433 ++++++ .../src/Generated/Models/Database.cs | 13 +- .../src/Generated/Models/DatabaseIdentity.cs | 12 +- .../src/Generated/Models/DatabaseUpdate.cs | 13 +- .../src/Generated/Models/Delegation.cs | 63 - .../Generated/Models/EndpointCertificate.cs | 58 + .../Generated/Models/ManagedServerDnsAlias.cs | 59 + .../ManagedServerDnsAliasAcquisition.cs | 70 + ...rs.cs => ManagedServerDnsAliasCreation.cs} | 28 +- .../RecommendedSensitivityLabelsOperations.cs | 2 +- .../Generated/ReplicationLinksOperations.cs | 539 +++---- .../ReplicationLinksOperationsExtensions.cs | 252 +--- .../Generated/SdkInfo_SqlManagementClient.cs | 27 +- .../Generated/SensitivityLabelsOperations.cs | 773 +++++++--- .../SensitivityLabelsOperationsExtensions.cs | 192 ++- .../ServerTrustCertificatesOperations.cs | 168 +-- ...erTrustCertificatesOperationsExtensions.cs | 100 +- .../src/Generated/SqlManagementClient.cs | 72 +- 32 files changed, 5397 insertions(+), 1673 deletions(-) create mode 100644 sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/EndpointCertificatesOperations.cs create mode 100644 sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/EndpointCertificatesOperationsExtensions.cs create mode 100644 sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IEndpointCertificatesOperations.cs create mode 100644 sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IManagedServerDnsAliasesOperations.cs create mode 100644 sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ManagedServerDnsAliasesOperations.cs create mode 100644 sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ManagedServerDnsAliasesOperationsExtensions.cs delete mode 100644 sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/Delegation.cs create mode 100644 sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/EndpointCertificate.cs create mode 100644 sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/ManagedServerDnsAlias.cs create mode 100644 sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/ManagedServerDnsAliasAcquisition.cs rename sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/{UnlinkParameters.cs => ManagedServerDnsAliasCreation.cs} (53%) diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/DistributedAvailabilityGroupsOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/DistributedAvailabilityGroupsOperations.cs index 9b1a283e74ef..8772ac496998 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/DistributedAvailabilityGroupsOperations.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/DistributedAvailabilityGroupsOperations.cs @@ -95,7 +95,7 @@ internal DistributedAvailabilityGroupsOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-05-01-preview"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -297,7 +297,7 @@ internal DistributedAvailabilityGroupsOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-05-01-preview"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -595,7 +595,7 @@ internal DistributedAvailabilityGroupsOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-05-01-preview"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -822,7 +822,7 @@ internal DistributedAvailabilityGroupsOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-05-01-preview"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1015,7 +1015,7 @@ internal DistributedAvailabilityGroupsOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-05-01-preview"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/EndpointCertificatesOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/EndpointCertificatesOperations.cs new file mode 100644 index 000000000000..cd4ba3e5558f --- /dev/null +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/EndpointCertificatesOperations.cs @@ -0,0 +1,626 @@ +// +// 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; + + /// + /// EndpointCertificatesOperations operations. + /// + internal partial class EndpointCertificatesOperations : IServiceOperations, IEndpointCertificatesOperations + { + /// + /// Initializes a new instance of the EndpointCertificatesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal EndpointCertificatesOperations(SqlManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the SqlManagementClient + /// + public SqlManagementClient Client { get; private set; } + + /// + /// List certificates used on endpoints on the target instance. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// 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>> ListByInstanceWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (managedInstanceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "managedInstanceName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2021-11-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("managedInstanceName", managedInstanceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByInstance", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/endpointCertificates").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{managedInstanceName}", System.Uri.EscapeDataString(managedInstanceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a certificate used on the endpoint with the given id. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// Type of the endpoint whose certificate the customer is looking for. + /// + /// + /// 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 managedInstanceName, string endpointType, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (managedInstanceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "managedInstanceName"); + } + if (endpointType == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "endpointType"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2021-11-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("managedInstanceName", managedInstanceName); + tracingParameters.Add("endpointType", endpointType); + 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/managedInstances/{managedInstanceName}/endpointCertificates/{endpointType}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{managedInstanceName}", System.Uri.EscapeDataString(managedInstanceName)); + _url = _url.Replace("{endpointType}", System.Uri.EscapeDataString(endpointType)); + _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; + } + + /// + /// List certificates used on endpoints on the target instance. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByInstanceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByInstanceNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/EndpointCertificatesOperationsExtensions.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/EndpointCertificatesOperationsExtensions.cs new file mode 100644 index 000000000000..09699a3ed969 --- /dev/null +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/EndpointCertificatesOperationsExtensions.cs @@ -0,0 +1,149 @@ +// +// 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 EndpointCertificatesOperations. + /// + public static partial class EndpointCertificatesOperationsExtensions + { + /// + /// List certificates used on endpoints on the target instance. + /// + /// + /// 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 managed instance. + /// + public static IPage ListByInstance(this IEndpointCertificatesOperations operations, string resourceGroupName, string managedInstanceName) + { + return operations.ListByInstanceAsync(resourceGroupName, managedInstanceName).GetAwaiter().GetResult(); + } + + /// + /// List certificates used on endpoints on the target instance. + /// + /// + /// 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 managed instance. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByInstanceAsync(this IEndpointCertificatesOperations operations, string resourceGroupName, string managedInstanceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByInstanceWithHttpMessagesAsync(resourceGroupName, managedInstanceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a certificate used on the endpoint with the given id. + /// + /// + /// 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 managed instance. + /// + /// + /// Type of the endpoint whose certificate the customer is looking for. + /// + public static EndpointCertificate Get(this IEndpointCertificatesOperations operations, string resourceGroupName, string managedInstanceName, string endpointType) + { + return operations.GetAsync(resourceGroupName, managedInstanceName, endpointType).GetAwaiter().GetResult(); + } + + /// + /// Gets a certificate used on the endpoint with the given id. + /// + /// + /// 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 managed instance. + /// + /// + /// Type of the endpoint whose certificate the customer is looking for. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IEndpointCertificatesOperations operations, string resourceGroupName, string managedInstanceName, string endpointType, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, managedInstanceName, endpointType, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List certificates used on endpoints on the target instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByInstanceNext(this IEndpointCertificatesOperations operations, string nextPageLink) + { + return operations.ListByInstanceNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List certificates used on endpoints on the target instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByInstanceNextAsync(this IEndpointCertificatesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByInstanceNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IEndpointCertificatesOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IEndpointCertificatesOperations.cs new file mode 100644 index 000000000000..20e057aa266a --- /dev/null +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IEndpointCertificatesOperations.cs @@ -0,0 +1,106 @@ +// +// 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; + + /// + /// EndpointCertificatesOperations operations. + /// + public partial interface IEndpointCertificatesOperations + { + /// + /// List certificates used on endpoints on the target instance. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByInstanceWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a certificate used on the endpoint with the given id. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// Type of the endpoint whose certificate the customer is looking for. + /// + /// + /// 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 managedInstanceName, string endpointType, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List certificates used on endpoints on the target instance. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByInstanceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IManagedDatabaseSensitivityLabelsOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IManagedDatabaseSensitivityLabelsOperations.cs index be59cc99b7bc..e26cac97ec6b 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IManagedDatabaseSensitivityLabelsOperations.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IManagedDatabaseSensitivityLabelsOperations.cs @@ -25,7 +25,7 @@ namespace Microsoft.Azure.Management.Sql public partial interface IManagedDatabaseSensitivityLabelsOperations { /// - /// Gets the sensitivity label of a given column + /// Gets the sensitivity labels of a given database /// /// /// The name of the resource group that contains the resource. You can @@ -38,18 +38,12 @@ public partial interface IManagedDatabaseSensitivityLabelsOperations /// /// The name of the database. /// - /// - /// The name of the schema. - /// - /// - /// The name of the table. + /// + /// OData parameters to apply to the operation. /// - /// - /// The name of the column. + /// /// - /// - /// The source of the sensitivity label. Possible values include: - /// 'current', 'recommended' + /// /// /// /// The headers that will be added to request. @@ -66,9 +60,10 @@ public partial interface IManagedDatabaseSensitivityLabelsOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListCurrentByDatabaseWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates the sensitivity label of a given column + /// Update sensitivity labels of a given database using an operations + /// batch. /// /// /// The name of the resource group that contains the resource. You can @@ -81,17 +76,42 @@ public partial interface IManagedDatabaseSensitivityLabelsOperations /// /// The name of the database. /// - /// - /// The name of the schema. + /// /// - /// - /// The name of the table. + /// + /// The headers that will be added to request. /// - /// - /// The name of the column. + /// + /// The cancellation token. /// - /// - /// The column sensitivity label resource. + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task UpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, SensitivityLabelUpdateList parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the sensitivity labels of a given 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 managed instance. + /// + /// + /// The name of the database. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// + /// + /// Specifies whether to include disabled recommendations or not. /// /// /// The headers that will be added to request. @@ -108,9 +128,9 @@ public partial interface IManagedDatabaseSensitivityLabelsOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabel parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListRecommendedByDatabaseWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), bool? includeDisabledRecommendations = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes the sensitivity label of a given column + /// Gets the sensitivity label of a given column /// /// /// The name of the resource group that contains the resource. You can @@ -132,6 +152,10 @@ public partial interface IManagedDatabaseSensitivityLabelsOperations /// /// The name of the column. /// + /// + /// The source of the sensitivity label. Possible values include: + /// 'current', 'recommended' + /// /// /// The headers that will be added to request. /// @@ -141,12 +165,15 @@ public partial interface IManagedDatabaseSensitivityLabelsOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Disables sensitivity recommendations on a given column + /// Creates or updates the sensitivity label of a given column /// /// /// The name of the resource group that contains the resource. You can @@ -168,6 +195,9 @@ public partial interface IManagedDatabaseSensitivityLabelsOperations /// /// The name of the column. /// + /// + /// The column sensitivity label resource. + /// /// /// The headers that will be added to request. /// @@ -177,13 +207,15 @@ public partial interface IManagedDatabaseSensitivityLabelsOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - Task DisableRecommendationWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabel parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Enables sensitivity recommendations on a given column - /// (recommendations are enabled by default on all columns) + /// Deletes the sensitivity label of a given column /// /// /// The name of the resource group that contains the resource. You can @@ -217,9 +249,9 @@ public partial interface IManagedDatabaseSensitivityLabelsOperations /// /// Thrown when a required parameter is null /// - Task EnableRecommendationWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the sensitivity labels of a given database + /// Disables sensitivity recommendations on a given column /// /// /// The name of the resource group that contains the resource. You can @@ -232,12 +264,14 @@ public partial interface IManagedDatabaseSensitivityLabelsOperations /// /// The name of the database. /// - /// - /// OData parameters to apply to the operation. + /// + /// The name of the schema. /// - /// + /// + /// The name of the table. /// - /// + /// + /// The name of the column. /// /// /// The headers that will be added to request. @@ -248,16 +282,13 @@ public partial interface IManagedDatabaseSensitivityLabelsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - Task>> ListCurrentByDatabaseWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DisableRecommendationWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Update sensitivity labels of a given database using an operations - /// batch. + /// Enables sensitivity recommendations on a given column + /// (recommendations are enabled by default on all columns) /// /// /// The name of the resource group that contains the resource. You can @@ -270,7 +301,14 @@ public partial interface IManagedDatabaseSensitivityLabelsOperations /// /// The name of the database. /// - /// + /// + /// The name of the schema. + /// + /// + /// The name of the table. + /// + /// + /// The name of the column. /// /// /// The headers that will be added to request. @@ -284,7 +322,7 @@ public partial interface IManagedDatabaseSensitivityLabelsOperations /// /// Thrown when a required parameter is null /// - Task UpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, SensitivityLabelUpdateList parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task EnableRecommendationWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets the sensitivity labels of a given database /// @@ -302,11 +340,6 @@ public partial interface IManagedDatabaseSensitivityLabelsOperations /// /// OData parameters to apply to the operation. /// - /// - /// - /// - /// Specifies whether to include disabled recommendations or not. - /// /// /// The headers that will be added to request. /// @@ -322,7 +355,7 @@ public partial interface IManagedDatabaseSensitivityLabelsOperations /// /// Thrown when a required parameter is null /// - Task>> ListRecommendedByDatabaseWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), bool? includeDisabledRecommendations = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets the sensitivity labels of a given database /// @@ -367,5 +400,27 @@ public partial interface IManagedDatabaseSensitivityLabelsOperations /// Thrown when a required parameter is null /// Task>> ListRecommendedByDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the sensitivity labels of a given database + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IManagedServerDnsAliasesOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IManagedServerDnsAliasesOperations.cs new file mode 100644 index 000000000000..fc03aa062c0d --- /dev/null +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IManagedServerDnsAliasesOperations.cs @@ -0,0 +1,281 @@ +// +// 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; + + /// + /// ManagedServerDnsAliasesOperations operations. + /// + public partial interface IManagedServerDnsAliasesOperations + { + /// + /// Gets a list of managed server DNS aliases for a managed 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 managed instance. + /// + /// + /// 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>> ListByManagedInstanceWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a server DNS alias. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// 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 managedInstanceName, string dnsAliasName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates a managed server DNS alias. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string dnsAliasName, ManagedServerDnsAliasCreation parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the managed server DNS alias with the given name. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string dnsAliasName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Acquires managed server DNS alias from another managed 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 managed instance. + /// + /// + /// + /// + /// + /// + /// 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> AcquireWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string dnsAliasName, ManagedServerDnsAliasAcquisition parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates a managed server DNS alias. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string dnsAliasName, ManagedServerDnsAliasCreation parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the managed server DNS alias with the given name. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string dnsAliasName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Acquires managed server DNS alias from another managed 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 managed instance. + /// + /// + /// + /// + /// + /// + /// 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> BeginAcquireWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string dnsAliasName, ManagedServerDnsAliasAcquisition parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a list of managed server DNS aliases for a managed server. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByManagedInstanceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IReplicationLinksOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IReplicationLinksOperations.cs index 8e46eb06c69a..f7b71ae0811b 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IReplicationLinksOperations.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IReplicationLinksOperations.cs @@ -24,8 +24,7 @@ namespace Microsoft.Azure.Management.Sql public partial interface IReplicationLinksOperations { /// - /// Deletes a database replication link. Cannot be done during - /// failover. + /// Gets a list of replication links on database. /// /// /// The name of the resource group that contains the resource. You can @@ -36,11 +35,7 @@ public partial interface IReplicationLinksOperations /// The name of the server. /// /// - /// The name of the database that has the replication link to be - /// dropped. - /// - /// - /// The ID of the replication link to be deleted. + /// The name of the database. /// /// /// The headers that will be added to request. @@ -51,10 +46,13 @@ public partial interface IReplicationLinksOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets a replication link. /// @@ -89,8 +87,7 @@ public partial interface IReplicationLinksOperations /// Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Sets which replica database is primary by failing over from the - /// current primary replica database. + /// Deletes the replication link. /// /// /// The name of the resource group that contains the resource. You can @@ -101,11 +98,9 @@ public partial interface IReplicationLinksOperations /// The name of the server. /// /// - /// The name of the database that has the replication link to be failed - /// over. + /// The name of the database. /// /// - /// The ID of the replication link to be failed over. /// /// /// The headers that will be added to request. @@ -119,11 +114,9 @@ public partial interface IReplicationLinksOperations /// /// Thrown when a required parameter is null /// - Task FailoverWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Sets which replica database is primary by failing over from the - /// current primary replica database. This operation might result in - /// data loss. + /// Fails over from the current primary server to this server. /// /// /// The name of the resource group that contains the resource. You can @@ -134,11 +127,10 @@ public partial interface IReplicationLinksOperations /// The name of the server. /// /// - /// The name of the database that has the replication link to be failed - /// over. + /// The name of the database. /// /// - /// The ID of the replication link to be failed over. + /// The name of the replication link. /// /// /// The headers that will be added to request. @@ -149,46 +141,16 @@ public partial interface IReplicationLinksOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task FailoverAllowDataLossWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes a database replication link in forced or friendly way. - /// - /// - /// 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 that has the replication link to be failed - /// over. - /// - /// - /// The ID of the replication link to be failed over. - /// - /// - /// The required parameters for unlinking replication link. - /// - /// - /// 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 UnlinkWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, UnlinkParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> FailoverWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets a list of replication links on database. + /// Fails over from the current primary server to this server allowing + /// data loss. /// /// /// The name of the resource group that contains the resource. You can @@ -201,6 +163,9 @@ public partial interface IReplicationLinksOperations /// /// The name of the database. /// + /// + /// The name of the replication link. + /// /// /// The headers that will be added to request. /// @@ -216,7 +181,7 @@ public partial interface IReplicationLinksOperations /// /// Thrown when a required parameter is null /// - Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> FailoverAllowDataLossWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets a list of replication links. /// @@ -245,8 +210,7 @@ public partial interface IReplicationLinksOperations /// Task>> ListByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Sets which replica database is primary by failing over from the - /// current primary replica database. + /// Fails over from the current primary server to this server. /// /// /// The name of the resource group that contains the resource. You can @@ -257,11 +221,10 @@ public partial interface IReplicationLinksOperations /// The name of the server. /// /// - /// The name of the database that has the replication link to be failed - /// over. + /// The name of the database. /// /// - /// The ID of the replication link to be failed over. + /// The name of the replication link. /// /// /// The headers that will be added to request. @@ -272,13 +235,15 @@ public partial interface IReplicationLinksOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - Task BeginFailoverWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginFailoverWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Sets which replica database is primary by failing over from the - /// current primary replica database. This operation might result in + /// Fails over from the current primary server to this server allowing /// data loss. /// /// @@ -290,11 +255,10 @@ public partial interface IReplicationLinksOperations /// The name of the server. /// /// - /// The name of the database that has the replication link to be failed - /// over. + /// The name of the database. /// /// - /// The ID of the replication link to be failed over. + /// The name of the replication link. /// /// /// The headers that will be added to request. @@ -305,44 +269,13 @@ public partial interface IReplicationLinksOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginFailoverAllowDataLossWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes a database replication link in forced or friendly way. - /// - /// - /// 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 that has the replication link to be failed - /// over. - /// - /// - /// The ID of the replication link to be failed over. - /// - /// - /// The required parameters for unlinking replication link. - /// - /// - /// 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 BeginUnlinkWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, UnlinkParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginFailoverAllowDataLossWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets a list of replication links on database. /// diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ISensitivityLabelsOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ISensitivityLabelsOperations.cs index ad73f817a983..9eabc21a7070 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ISensitivityLabelsOperations.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ISensitivityLabelsOperations.cs @@ -130,8 +130,7 @@ public partial interface ISensitivityLabelsOperations /// Task>> ListRecommendedByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), bool? includeDisabledRecommendations = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Enables sensitivity recommendations on a given column - /// (recommendations are enabled by default on all columns) + /// Gets the sensitivity label of a given column /// /// /// The name of the resource group that contains the resource. You can @@ -153,6 +152,10 @@ public partial interface ISensitivityLabelsOperations /// /// The name of the column. /// + /// + /// The source of the sensitivity label. Possible values include: + /// 'current', 'recommended' + /// /// /// The headers that will be added to request. /// @@ -162,12 +165,15 @@ public partial interface ISensitivityLabelsOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - Task EnableRecommendationWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Disables sensitivity recommendations on a given column + /// Creates or updates the sensitivity label of a given column /// /// /// The name of the resource group that contains the resource. You can @@ -189,6 +195,9 @@ public partial interface ISensitivityLabelsOperations /// /// The name of the column. /// + /// + /// The column sensitivity label resource. + /// /// /// The headers that will be added to request. /// @@ -198,12 +207,15 @@ public partial interface ISensitivityLabelsOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - Task DisableRecommendationWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabel parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the sensitivity label of a given column + /// Deletes the sensitivity label of a given column /// /// /// The name of the resource group that contains the resource. You can @@ -225,10 +237,6 @@ public partial interface ISensitivityLabelsOperations /// /// The name of the column. /// - /// - /// The source of the sensitivity label. Possible values include: - /// 'current', 'recommended' - /// /// /// The headers that will be added to request. /// @@ -238,15 +246,12 @@ public partial interface ISensitivityLabelsOperations /// /// 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, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates the sensitivity label of a given column + /// Disables sensitivity recommendations on a given column /// /// /// The name of the resource group that contains the resource. You can @@ -268,9 +273,6 @@ public partial interface ISensitivityLabelsOperations /// /// The name of the column. /// - /// - /// The column sensitivity label resource. - /// /// /// The headers that will be added to request. /// @@ -280,15 +282,13 @@ public partial interface ISensitivityLabelsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabel parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DisableRecommendationWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes the sensitivity label of a given column + /// Enables sensitivity recommendations on a given column + /// (recommendations are enabled by default on all columns) /// /// /// The name of the resource group that contains the resource. You can @@ -322,7 +322,40 @@ public partial interface ISensitivityLabelsOperations /// /// Thrown when a required parameter is null /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task EnableRecommendationWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the sensitivity labels of a given 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. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets the sensitivity labels of a given database /// @@ -367,5 +400,27 @@ public partial interface ISensitivityLabelsOperations /// Thrown when a required parameter is null /// Task>> ListRecommendedByDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the sensitivity labels of a given database + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IServerTrustCertificatesOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IServerTrustCertificatesOperations.cs index b1c9bfe90233..9b6f8195aa51 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IServerTrustCertificatesOperations.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IServerTrustCertificatesOperations.cs @@ -24,8 +24,8 @@ namespace Microsoft.Azure.Management.Sql public partial interface IServerTrustCertificatesOperations { /// - /// Gets a server trust certificate that was uploaded from box to Sql - /// Managed Instance. + /// Gets a list of server trust certificates that were uploaded from + /// box to the given Sql Managed Instance. /// /// /// The name of the resource group that contains the resource. You can @@ -35,9 +35,6 @@ public partial interface IServerTrustCertificatesOperations /// /// The name of the managed instance. /// - /// - /// Name of of the certificate to get. - /// /// /// The headers that will be added to request. /// @@ -53,10 +50,10 @@ public partial interface IServerTrustCertificatesOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string certificateName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByInstanceWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Uploads a server trust certificate from box to Sql Managed - /// Instance. + /// Gets a server trust certificate that was uploaded from box to Sql + /// Managed Instance. /// /// /// The name of the resource group that contains the resource. You can @@ -67,10 +64,7 @@ public partial interface IServerTrustCertificatesOperations /// The name of the managed instance. /// /// - /// Name of of the certificate to upload. - /// - /// - /// The server trust certificate info. + /// Name of of the certificate to get. /// /// /// The headers that will be added to request. @@ -87,10 +81,10 @@ public partial interface IServerTrustCertificatesOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string certificateName, ServerTrustCertificate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string certificateName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes a server trust certificate that was uploaded from box to - /// Sql Managed Instance. + /// Uploads a server trust certificate from box to Sql Managed + /// Instance. /// /// /// The name of the resource group that contains the resource. You can @@ -101,7 +95,10 @@ public partial interface IServerTrustCertificatesOperations /// The name of the managed instance. /// /// - /// Name of of the certificate to delete. + /// Name of of the certificate to upload. + /// + /// + /// The server trust certificate info. /// /// /// The headers that will be added to request. @@ -112,14 +109,16 @@ public partial interface IServerTrustCertificatesOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string certificateName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string certificateName, ServerTrustCertificate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets a list of the server trust certificates which are used for - /// secure communication between SQL On-Prem instance and the given Sql - /// Managed Instance + /// Deletes a server trust certificate that was uploaded from box to + /// Sql Managed Instance. /// /// /// The name of the resource group that contains the resource. You can @@ -129,6 +128,9 @@ public partial interface IServerTrustCertificatesOperations /// /// The name of the managed instance. /// + /// + /// Name of of the certificate to delete. + /// /// /// The headers that will be added to request. /// @@ -138,13 +140,10 @@ public partial interface IServerTrustCertificatesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - Task>> ListByInstanceWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string certificateName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Uploads a server trust certificate from box to Sql Managed /// Instance. @@ -208,9 +207,8 @@ public partial interface IServerTrustCertificatesOperations /// Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string certificateName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets a list of the server trust certificates which are used for - /// secure communication between SQL On-Prem instance and the given Sql - /// Managed Instance + /// Gets a list of server trust certificates that were uploaded from + /// box to the given Sql Managed Instance. /// /// /// The NextLink from the previous successful call to List operation. diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ISqlManagementClient.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ISqlManagementClient.cs index 3b58b88bad90..62839edc27de 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ISqlManagementClient.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ISqlManagementClient.cs @@ -97,11 +97,6 @@ public partial interface ISqlManagementClient : System.IDisposable /// IElasticPoolsOperations ElasticPools { get; } - /// - /// Gets the IReplicationLinksOperations. - /// - IReplicationLinksOperations ReplicationLinks { get; } - /// /// Gets the IServerCommunicationLinksOperations. /// @@ -342,16 +337,6 @@ public partial interface ISqlManagementClient : System.IDisposable /// IManagedDatabaseSecurityEventsOperations ManagedDatabaseSecurityEvents { get; } - /// - /// Gets the IManagedDatabaseSensitivityLabelsOperations. - /// - IManagedDatabaseSensitivityLabelsOperations ManagedDatabaseSensitivityLabels { get; } - - /// - /// Gets the IManagedDatabaseRecommendedSensitivityLabelsOperations. - /// - IManagedDatabaseRecommendedSensitivityLabelsOperations ManagedDatabaseRecommendedSensitivityLabels { get; } - /// /// Gets the IManagedDatabaseTablesOperations. /// @@ -462,16 +447,6 @@ public partial interface ISqlManagementClient : System.IDisposable /// IRestorePointsOperations RestorePoints { get; } - /// - /// Gets the ISensitivityLabelsOperations. - /// - ISensitivityLabelsOperations SensitivityLabels { get; } - - /// - /// Gets the IRecommendedSensitivityLabelsOperations. - /// - IRecommendedSensitivityLabelsOperations RecommendedSensitivityLabels { get; } - /// /// Gets the IServerAdvisorsOperations. /// @@ -672,5 +647,40 @@ public partial interface ISqlManagementClient : System.IDisposable /// IIPv6FirewallRulesOperations IPv6FirewallRules { get; } + /// + /// Gets the IReplicationLinksOperations. + /// + IReplicationLinksOperations ReplicationLinks { get; } + + /// + /// Gets the IManagedDatabaseSensitivityLabelsOperations. + /// + IManagedDatabaseSensitivityLabelsOperations ManagedDatabaseSensitivityLabels { get; } + + /// + /// Gets the IManagedDatabaseRecommendedSensitivityLabelsOperations. + /// + IManagedDatabaseRecommendedSensitivityLabelsOperations ManagedDatabaseRecommendedSensitivityLabels { get; } + + /// + /// Gets the IManagedServerDnsAliasesOperations. + /// + IManagedServerDnsAliasesOperations ManagedServerDnsAliases { get; } + + /// + /// Gets the ISensitivityLabelsOperations. + /// + ISensitivityLabelsOperations SensitivityLabels { get; } + + /// + /// Gets the IRecommendedSensitivityLabelsOperations. + /// + IRecommendedSensitivityLabelsOperations RecommendedSensitivityLabels { get; } + + /// + /// Gets the IEndpointCertificatesOperations. + /// + IEndpointCertificatesOperations EndpointCertificates { get; } + } } diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ManagedDatabaseRecommendedSensitivityLabelsOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ManagedDatabaseRecommendedSensitivityLabelsOperations.cs index 83420a3c4ec1..6f91a482fea0 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ManagedDatabaseRecommendedSensitivityLabelsOperations.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ManagedDatabaseRecommendedSensitivityLabelsOperations.cs @@ -106,7 +106,7 @@ internal ManagedDatabaseRecommendedSensitivityLabelsOperations(SqlManagementClie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01-preview"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ManagedDatabaseSensitivityLabelsOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ManagedDatabaseSensitivityLabelsOperations.cs index 2ad06b5467fb..d33105436921 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ManagedDatabaseSensitivityLabelsOperations.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ManagedDatabaseSensitivityLabelsOperations.cs @@ -52,7 +52,433 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) public SqlManagementClient Client { get; private set; } /// - /// Gets the sensitivity label of a given column + /// Gets the sensitivity labels of a given 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 managed instance. + /// + /// + /// The name of the database. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// + /// + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListCurrentByDatabaseWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (managedInstanceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "managedInstanceName"); + } + if (databaseName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2021-11-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("odataQuery", odataQuery); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("managedInstanceName", managedInstanceName); + tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("count", count); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListCurrentByDatabase", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/currentSensitivityLabels").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{managedInstanceName}", System.Uri.EscapeDataString(managedInstanceName)); + _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (odataQuery != null) + { + var _odataFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_odataFilter)) + { + _queryParameters.Add(_odataFilter); + } + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + if (count != null) + { + _queryParameters.Add(string.Format("$count={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(count, Client.SerializationSettings).Trim('"')))); + } + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Update sensitivity labels of a given database using an operations batch. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// The 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 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 managedInstanceName, string databaseName, SensitivityLabelUpdateList parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (managedInstanceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "managedInstanceName"); + } + if (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 = "2021-11-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("managedInstanceName", managedInstanceName); + 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/managedInstances/{managedInstanceName}/databases/{databaseName}/currentSensitivityLabels").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{managedInstanceName}", System.Uri.EscapeDataString(managedInstanceName)); + _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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets the sensitivity labels of a given database /// /// /// The name of the resource group that contains the resource. You can obtain @@ -64,18 +490,13 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) /// /// The name of the database. /// - /// - /// The name of the schema. - /// - /// - /// The name of the table. + /// + /// OData parameters to apply to the operation. /// - /// - /// The name of the column. + /// /// - /// - /// The source of the sensitivity label. Possible values include: 'current', - /// 'recommended' + /// + /// Specifies whether to include disabled recommendations or not. /// /// /// Headers that will be added to request. @@ -98,7 +519,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListRecommendedByDatabaseWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), bool? includeDisabledRecommendations = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -112,23 +533,11 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); } - if (schemaName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "schemaName"); - } - if (tableName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); - } - if (columnName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "columnName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01-preview"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -136,29 +545,40 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("odataQuery", odataQuery); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("managedInstanceName", managedInstanceName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("schemaName", schemaName); - tracingParameters.Add("tableName", tableName); - tracingParameters.Add("columnName", columnName); - tracingParameters.Add("sensitivityLabelSource", sensitivityLabelSource); + tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("includeDisabledRecommendations", includeDisabledRecommendations); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListRecommendedByDatabase", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/recommendedSensitivityLabels").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{managedInstanceName}", System.Uri.EscapeDataString(managedInstanceName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{schemaName}", System.Uri.EscapeDataString(schemaName)); - _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); - _url = _url.Replace("{columnName}", System.Uri.EscapeDataString(columnName)); - _url = _url.Replace("{sensitivityLabelSource}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(sensitivityLabelSource, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (odataQuery != null) + { + var _odataFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_odataFilter)) + { + _queryParameters.Add(_odataFilter); + } + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + if (includeDisabledRecommendations != null) + { + _queryParameters.Add(string.Format("includeDisabledRecommendations={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(includeDisabledRecommendations, Client.SerializationSettings).Trim('"')))); + } if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -256,7 +676,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -269,7 +689,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -289,7 +709,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) } /// - /// Creates or updates the sensitivity label of a given column + /// Gets the sensitivity label of a given column /// /// /// The name of the resource group that contains the resource. You can obtain @@ -310,8 +730,9 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) /// /// The name of the column. /// - /// - /// The column sensitivity label resource. + /// + /// The source of the sensitivity label. Possible values include: 'current', + /// 'recommended' /// /// /// Headers that will be added to request. @@ -334,7 +755,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabel parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -360,16 +781,11 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "columnName"); } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string sensitivityLabelSource = "current"; - string apiVersion = "2020-11-01-preview"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -384,10 +800,9 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) tracingParameters.Add("tableName", tableName); tracingParameters.Add("columnName", columnName); tracingParameters.Add("sensitivityLabelSource", sensitivityLabelSource); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -398,7 +813,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) _url = _url.Replace("{schemaName}", System.Uri.EscapeDataString(schemaName)); _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); _url = _url.Replace("{columnName}", System.Uri.EscapeDataString(columnName)); - _url = _url.Replace("{sensitivityLabelSource}", System.Uri.EscapeDataString(sensitivityLabelSource)); + _url = _url.Replace("{sensitivityLabelSource}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(sensitivityLabelSource, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -412,7 +827,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -443,12 +858,6 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) // Serialize Request string _requestContent = null; - if(parameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -469,7 +878,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -529,24 +938,6 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -555,7 +946,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) } /// - /// Deletes the sensitivity label of a given column + /// Creates or updates the sensitivity label of a given column /// /// /// The name of the resource group that contains the resource. You can obtain @@ -576,6 +967,9 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) /// /// The name of the column. /// + /// + /// The column sensitivity label resource. + /// /// /// Headers that will be added to request. /// @@ -585,6 +979,9 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -594,7 +991,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabel parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -620,12 +1017,16 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "columnName"); } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } string sensitivityLabelSource = "current"; - string apiVersion = "2020-11-01-preview"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -640,9 +1041,10 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) tracingParameters.Add("tableName", tableName); tracingParameters.Add("columnName", columnName); tracingParameters.Add("sensitivityLabelSource", sensitivityLabelSource); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -667,7 +1069,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -698,6 +1100,12 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) // Serialize Request string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -718,7 +1126,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -748,17 +1156,53 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) _httpRequest.Dispose(); if (_httpResponse != null) { - _httpResponse.Dispose(); + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { @@ -768,7 +1212,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) } /// - /// Disables sensitivity recommendations on a given column + /// Deletes the sensitivity label of a given column /// /// /// The name of the resource group that contains the resource. You can obtain @@ -807,7 +1251,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DisableRecommendationWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -837,8 +1281,8 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string sensitivityLabelSource = "recommended"; - string apiVersion = "2020-11-01-preview"; + string sensitivityLabelSource = "current"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -855,11 +1299,11 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) tracingParameters.Add("sensitivityLabelSource", sensitivityLabelSource); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DisableRecommendation", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/disable").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{managedInstanceName}", System.Uri.EscapeDataString(managedInstanceName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); @@ -880,7 +1324,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -981,8 +1425,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) } /// - /// Enables sensitivity recommendations on a given column (recommendations are - /// enabled by default on all columns) + /// Disables sensitivity recommendations on a given column /// /// /// The name of the resource group that contains the resource. You can obtain @@ -1021,7 +1464,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task EnableRecommendationWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DisableRecommendationWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1052,7 +1495,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } string sensitivityLabelSource = "recommended"; - string apiVersion = "2020-11-01-preview"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1069,11 +1512,11 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) tracingParameters.Add("sensitivityLabelSource", sensitivityLabelSource); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "EnableRecommendation", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DisableRecommendation", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/enable").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/disable").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{managedInstanceName}", System.Uri.EscapeDataString(managedInstanceName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); @@ -1195,7 +1638,8 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) } /// - /// Gets the sensitivity labels of a given database + /// Enables sensitivity recommendations on a given column (recommendations are + /// enabled by default on all columns) /// /// /// The name of the resource group that contains the resource. You can obtain @@ -1207,12 +1651,14 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) /// /// The name of the database. /// - /// - /// OData parameters to apply to the operation. + /// + /// The name of the schema. /// - /// + /// + /// The name of the table. /// - /// + /// + /// The name of the column. /// /// /// Headers that will be added to request. @@ -1223,9 +1669,6 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -1235,7 +1678,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListCurrentByDatabaseWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task EnableRecommendationWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1249,11 +1692,24 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); } + if (schemaName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "schemaName"); + } + if (tableName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); + } + if (columnName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "columnName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01-preview"; + string sensitivityLabelSource = "recommended"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1261,40 +1717,29 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("managedInstanceName", managedInstanceName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("skipToken", skipToken); - tracingParameters.Add("count", count); + tracingParameters.Add("schemaName", schemaName); + tracingParameters.Add("tableName", tableName); + tracingParameters.Add("columnName", columnName); + tracingParameters.Add("sensitivityLabelSource", sensitivityLabelSource); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListCurrentByDatabase", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "EnableRecommendation", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/currentSensitivityLabels").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/enable").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{managedInstanceName}", System.Uri.EscapeDataString(managedInstanceName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _url = _url.Replace("{schemaName}", System.Uri.EscapeDataString(schemaName)); + _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); + _url = _url.Replace("{columnName}", System.Uri.EscapeDataString(columnName)); + _url = _url.Replace("{sensitivityLabelSource}", System.Uri.EscapeDataString(sensitivityLabelSource)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (odataQuery != null) - { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) - { - _queryParameters.Add(_odataFilter); - } - } - if (skipToken != null) - { - _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); - } - if (count != null) - { - _queryParameters.Add(string.Format("$count={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(count, Client.SerializationSettings).Trim('"')))); - } if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1306,7 +1751,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1392,31 +1837,13 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _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); @@ -1425,7 +1852,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) } /// - /// Update sensitivity labels of a given database using an operations batch. + /// Gets the sensitivity labels of a given database /// /// /// The name of the resource group that contains the resource. You can obtain @@ -1437,7 +1864,8 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) /// /// The name of the database. /// - /// + /// + /// OData parameters to apply to the operation. /// /// /// Headers that will be added to request. @@ -1448,6 +1876,9 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -1457,7 +1888,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task UpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, SensitivityLabelUpdateList parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1471,15 +1902,11 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) { 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 = "2020-11-01-preview"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1487,22 +1914,30 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("odataQuery", odataQuery); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("managedInstanceName", managedInstanceName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByDatabase", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/currentSensitivityLabels").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/sensitivityLabels").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{managedInstanceName}", System.Uri.EscapeDataString(managedInstanceName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (odataQuery != null) + { + var _odataFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_odataFilter)) + { + _queryParameters.Add(_odataFilter); + } + } if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1514,7 +1949,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1545,12 +1980,6 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) // Serialize Request string _requestContent = null; - if(parameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -1606,13 +2035,31 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _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); @@ -1623,23 +2070,8 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) /// /// Gets the sensitivity labels of a given 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 managed instance. - /// - /// - /// The name of the database. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// - /// - /// Specifies whether to include disabled recommendations or not. + /// + /// The NextLink from the previous successful call to List operation. /// /// /// Headers that will be added to request. @@ -1662,25 +2094,12 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListRecommendedByDatabaseWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), bool? includeDisabledRecommendations = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListCurrentByDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (managedInstanceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "managedInstanceName"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (Client.SubscriptionId == null) + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } - string apiVersion = "2020-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1688,44 +2107,14 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("managedInstanceName", managedInstanceName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("skipToken", skipToken); - tracingParameters.Add("includeDisabledRecommendations", includeDisabledRecommendations); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListRecommendedByDatabase", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListCurrentByDatabaseNext", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/recommendedSensitivityLabels").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{managedInstanceName}", System.Uri.EscapeDataString(managedInstanceName)); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); List _queryParameters = new List(); - if (odataQuery != null) - { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) - { - _queryParameters.Add(_odataFilter); - } - } - if (skipToken != null) - { - _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); - } - if (includeDisabledRecommendations != null) - { - _queryParameters.Add(string.Format("includeDisabledRecommendations={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(includeDisabledRecommendations, Client.SerializationSettings).Trim('"')))); - } - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -1878,7 +2267,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListCurrentByDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListRecommendedByDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -1893,7 +2282,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListCurrentByDatabaseNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListRecommendedByDatabaseNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -2051,7 +2440,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListRecommendedByDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -2066,7 +2455,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListRecommendedByDatabaseNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByDatabaseNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ManagedDatabaseSensitivityLabelsOperationsExtensions.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ManagedDatabaseSensitivityLabelsOperationsExtensions.cs index c69fc7581d30..2eb5b2e95234 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ManagedDatabaseSensitivityLabelsOperationsExtensions.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ManagedDatabaseSensitivityLabelsOperationsExtensions.cs @@ -23,7 +23,7 @@ namespace Microsoft.Azure.Management.Sql public static partial class ManagedDatabaseSensitivityLabelsOperationsExtensions { /// - /// Gets the sensitivity label of a given column + /// Gets the sensitivity labels of a given database /// /// /// The operations group for this extension method. @@ -38,26 +38,20 @@ public static partial class ManagedDatabaseSensitivityLabelsOperationsExtensions /// /// The name of the database. /// - /// - /// The name of the schema. - /// - /// - /// The name of the table. + /// + /// OData parameters to apply to the operation. /// - /// - /// The name of the column. + /// /// - /// - /// The source of the sensitivity label. Possible values include: 'current', - /// 'recommended' + /// /// - public static SensitivityLabel Get(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource) + public static IPage ListCurrentByDatabase(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), bool? count = default(bool?)) { - return operations.GetAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, sensitivityLabelSource).GetAwaiter().GetResult(); + return operations.ListCurrentByDatabaseAsync(resourceGroupName, managedInstanceName, databaseName, odataQuery, skipToken, count).GetAwaiter().GetResult(); } /// - /// Gets the sensitivity label of a given column + /// Gets the sensitivity labels of a given database /// /// /// The operations group for this extension method. @@ -72,32 +66,26 @@ public static SensitivityLabel Get(this IManagedDatabaseSensitivityLabelsOperati /// /// The name of the database. /// - /// - /// The name of the schema. - /// - /// - /// The name of the table. + /// + /// OData parameters to apply to the operation. /// - /// - /// The name of the column. + /// /// - /// - /// The source of the sensitivity label. Possible values include: 'current', - /// 'recommended' + /// /// /// /// The cancellation token. /// - public static async Task GetAsync(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListCurrentByDatabaseAsync(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), bool? count = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, sensitivityLabelSource, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListCurrentByDatabaseWithHttpMessagesAsync(resourceGroupName, managedInstanceName, databaseName, odataQuery, skipToken, count, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Creates or updates the sensitivity label of a given column + /// Update sensitivity labels of a given database using an operations batch. /// /// /// The operations group for this extension method. @@ -112,25 +100,41 @@ public static SensitivityLabel Get(this IManagedDatabaseSensitivityLabelsOperati /// /// The name of the database. /// - /// - /// The name of the schema. + /// /// - /// - /// The name of the table. + public static void Update(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, SensitivityLabelUpdateList parameters) + { + operations.UpdateAsync(resourceGroupName, managedInstanceName, databaseName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Update sensitivity labels of a given database using an operations batch. + /// + /// + /// The operations group for this extension method. /// - /// - /// The name of the column. + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// The name of the database. /// /// - /// The column sensitivity label resource. /// - public static SensitivityLabel CreateOrUpdate(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabel parameters) + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, SensitivityLabelUpdateList parameters, CancellationToken cancellationToken = default(CancellationToken)) { - return operations.CreateOrUpdateAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, parameters).GetAwaiter().GetResult(); + (await operations.UpdateWithHttpMessagesAsync(resourceGroupName, managedInstanceName, databaseName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Creates or updates the sensitivity label of a given column + /// Gets the sensitivity labels of a given database /// /// /// The operations group for this extension method. @@ -145,31 +149,56 @@ public static SensitivityLabel CreateOrUpdate(this IManagedDatabaseSensitivityLa /// /// The name of the database. /// - /// - /// The name of the schema. + /// + /// OData parameters to apply to the operation. /// - /// - /// The name of the table. + /// /// - /// - /// The name of the column. + /// + /// Specifies whether to include disabled recommendations or not. /// - /// - /// The column sensitivity label resource. + public static IPage ListRecommendedByDatabase(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), bool? includeDisabledRecommendations = default(bool?)) + { + return operations.ListRecommendedByDatabaseAsync(resourceGroupName, managedInstanceName, databaseName, odataQuery, skipToken, includeDisabledRecommendations).GetAwaiter().GetResult(); + } + + /// + /// Gets the sensitivity labels of a given 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 managed instance. + /// + /// + /// The name of the database. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// + /// + /// Specifies whether to include disabled recommendations or not. /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabel parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListRecommendedByDatabaseAsync(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), bool? includeDisabledRecommendations = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListRecommendedByDatabaseWithHttpMessagesAsync(resourceGroupName, managedInstanceName, databaseName, odataQuery, skipToken, includeDisabledRecommendations, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Deletes the sensitivity label of a given column + /// Gets the sensitivity label of a given column /// /// /// The operations group for this extension method. @@ -193,13 +222,17 @@ public static SensitivityLabel CreateOrUpdate(this IManagedDatabaseSensitivityLa /// /// The name of the column. /// - public static void Delete(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName) + /// + /// The source of the sensitivity label. Possible values include: 'current', + /// 'recommended' + /// + public static SensitivityLabel Get(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource) { - operations.DeleteAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, sensitivityLabelSource).GetAwaiter().GetResult(); } /// - /// Deletes the sensitivity label of a given column + /// Gets the sensitivity label of a given column /// /// /// The operations group for this extension method. @@ -223,16 +256,23 @@ public static void Delete(this IManagedDatabaseSensitivityLabelsOperations opera /// /// The name of the column. /// + /// + /// The source of the sensitivity label. Possible values include: 'current', + /// 'recommended' + /// /// /// The cancellation token. /// - public static async Task DeleteAsync(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, sensitivityLabelSource, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Disables sensitivity recommendations on a given column + /// Creates or updates the sensitivity label of a given column /// /// /// The operations group for this extension method. @@ -256,13 +296,16 @@ public static void Delete(this IManagedDatabaseSensitivityLabelsOperations opera /// /// The name of the column. /// - public static void DisableRecommendation(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName) + /// + /// The column sensitivity label resource. + /// + public static SensitivityLabel CreateOrUpdate(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabel parameters) { - operations.DisableRecommendationAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName).GetAwaiter().GetResult(); + return operations.CreateOrUpdateAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, parameters).GetAwaiter().GetResult(); } /// - /// Disables sensitivity recommendations on a given column + /// Creates or updates the sensitivity label of a given column /// /// /// The operations group for this extension method. @@ -286,17 +329,22 @@ public static void DisableRecommendation(this IManagedDatabaseSensitivityLabelsO /// /// The name of the column. /// + /// + /// The column sensitivity label resource. + /// /// /// The cancellation token. /// - public static async Task DisableRecommendationAsync(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabel parameters, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DisableRecommendationWithHttpMessagesAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Enables sensitivity recommendations on a given column (recommendations are - /// enabled by default on all columns) + /// Deletes the sensitivity label of a given column /// /// /// The operations group for this extension method. @@ -320,14 +368,13 @@ public static void DisableRecommendation(this IManagedDatabaseSensitivityLabelsO /// /// The name of the column. /// - public static void EnableRecommendation(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName) + public static void Delete(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName) { - operations.EnableRecommendationAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName).GetAwaiter().GetResult(); + operations.DeleteAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName).GetAwaiter().GetResult(); } /// - /// Enables sensitivity recommendations on a given column (recommendations are - /// enabled by default on all columns) + /// Deletes the sensitivity label of a given column /// /// /// The operations group for this extension method. @@ -354,13 +401,13 @@ public static void EnableRecommendation(this IManagedDatabaseSensitivityLabelsOp /// /// The cancellation token. /// - public static async Task EnableRecommendationAsync(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteAsync(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.EnableRecommendationWithHttpMessagesAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Gets the sensitivity labels of a given database + /// Disables sensitivity recommendations on a given column /// /// /// The operations group for this extension method. @@ -375,20 +422,22 @@ public static void EnableRecommendation(this IManagedDatabaseSensitivityLabelsOp /// /// The name of the database. /// - /// - /// OData parameters to apply to the operation. + /// + /// The name of the schema. /// - /// + /// + /// The name of the table. /// - /// + /// + /// The name of the column. /// - public static IPage ListCurrentByDatabase(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), bool? count = default(bool?)) + public static void DisableRecommendation(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName) { - return operations.ListCurrentByDatabaseAsync(resourceGroupName, managedInstanceName, databaseName, odataQuery, skipToken, count).GetAwaiter().GetResult(); + operations.DisableRecommendationAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName).GetAwaiter().GetResult(); } /// - /// Gets the sensitivity labels of a given database + /// Disables sensitivity recommendations on a given column /// /// /// The operations group for this extension method. @@ -403,26 +452,26 @@ public static void EnableRecommendation(this IManagedDatabaseSensitivityLabelsOp /// /// The name of the database. /// - /// - /// OData parameters to apply to the operation. + /// + /// The name of the schema. /// - /// + /// + /// The name of the table. /// - /// + /// + /// The name of the column. /// /// /// The cancellation token. /// - public static async Task> ListCurrentByDatabaseAsync(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), bool? count = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DisableRecommendationAsync(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListCurrentByDatabaseWithHttpMessagesAsync(resourceGroupName, managedInstanceName, databaseName, odataQuery, skipToken, count, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + (await operations.DisableRecommendationWithHttpMessagesAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Update sensitivity labels of a given database using an operations batch. + /// Enables sensitivity recommendations on a given column (recommendations are + /// enabled by default on all columns) /// /// /// The operations group for this extension method. @@ -437,15 +486,23 @@ public static void EnableRecommendation(this IManagedDatabaseSensitivityLabelsOp /// /// The name of the database. /// - /// + /// + /// The name of the schema. /// - public static void Update(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, SensitivityLabelUpdateList parameters) + /// + /// The name of the table. + /// + /// + /// The name of the column. + /// + public static void EnableRecommendation(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName) { - operations.UpdateAsync(resourceGroupName, managedInstanceName, databaseName, parameters).GetAwaiter().GetResult(); + operations.EnableRecommendationAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName).GetAwaiter().GetResult(); } /// - /// Update sensitivity labels of a given database using an operations batch. + /// Enables sensitivity recommendations on a given column (recommendations are + /// enabled by default on all columns) /// /// /// The operations group for this extension method. @@ -460,14 +517,21 @@ public static void Update(this IManagedDatabaseSensitivityLabelsOperations opera /// /// The name of the database. /// - /// + /// + /// The name of the schema. + /// + /// + /// The name of the table. + /// + /// + /// The name of the column. /// /// /// The cancellation token. /// - public static async Task UpdateAsync(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, SensitivityLabelUpdateList parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task EnableRecommendationAsync(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.UpdateWithHttpMessagesAsync(resourceGroupName, managedInstanceName, databaseName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.EnableRecommendationWithHttpMessagesAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -489,14 +553,9 @@ public static void Update(this IManagedDatabaseSensitivityLabelsOperations opera /// /// OData parameters to apply to the operation. /// - /// - /// - /// - /// Specifies whether to include disabled recommendations or not. - /// - public static IPage ListRecommendedByDatabase(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), bool? includeDisabledRecommendations = default(bool?)) + public static IPage ListByDatabase(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery)) { - return operations.ListRecommendedByDatabaseAsync(resourceGroupName, managedInstanceName, databaseName, odataQuery, skipToken, includeDisabledRecommendations).GetAwaiter().GetResult(); + return operations.ListByDatabaseAsync(resourceGroupName, managedInstanceName, databaseName, odataQuery).GetAwaiter().GetResult(); } /// @@ -518,17 +577,12 @@ public static void Update(this IManagedDatabaseSensitivityLabelsOperations opera /// /// OData parameters to apply to the operation. /// - /// - /// - /// - /// Specifies whether to include disabled recommendations or not. - /// /// /// The cancellation token. /// - public static async Task> ListRecommendedByDatabaseAsync(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), bool? includeDisabledRecommendations = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByDatabaseAsync(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListRecommendedByDatabaseWithHttpMessagesAsync(resourceGroupName, managedInstanceName, databaseName, odataQuery, skipToken, includeDisabledRecommendations, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByDatabaseWithHttpMessagesAsync(resourceGroupName, managedInstanceName, databaseName, odataQuery, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -602,5 +656,39 @@ public static IPage ListRecommendedByDatabaseNext(this IManage } } + /// + /// Gets the sensitivity labels of a given database + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByDatabaseNext(this IManagedDatabaseSensitivityLabelsOperations operations, string nextPageLink) + { + return operations.ListByDatabaseNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the sensitivity labels of a given database + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByDatabaseNextAsync(this IManagedDatabaseSensitivityLabelsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByDatabaseNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } } diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ManagedServerDnsAliasesOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ManagedServerDnsAliasesOperations.cs new file mode 100644 index 000000000000..48534021d2f5 --- /dev/null +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ManagedServerDnsAliasesOperations.cs @@ -0,0 +1,1340 @@ +// +// 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; + + /// + /// ManagedServerDnsAliasesOperations operations. + /// + internal partial class ManagedServerDnsAliasesOperations : IServiceOperations, IManagedServerDnsAliasesOperations + { + /// + /// Initializes a new instance of the ManagedServerDnsAliasesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ManagedServerDnsAliasesOperations(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 list of managed server DNS aliases for a managed 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 managed instance. + /// + /// + /// 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>> ListByManagedInstanceWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (managedInstanceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "managedInstanceName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2021-11-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("managedInstanceName", managedInstanceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByManagedInstance", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{managedInstanceName}", System.Uri.EscapeDataString(managedInstanceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a server DNS alias. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// + /// + /// Headers that will be added to request. + /// + /// + /// 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 managedInstanceName, string dnsAliasName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (managedInstanceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "managedInstanceName"); + } + if (dnsAliasName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "dnsAliasName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2021-11-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("managedInstanceName", managedInstanceName); + tracingParameters.Add("dnsAliasName", dnsAliasName); + 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/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{managedInstanceName}", System.Uri.EscapeDataString(managedInstanceName)); + _url = _url.Replace("{dnsAliasName}", System.Uri.EscapeDataString(dnsAliasName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates a managed server DNS alias. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string dnsAliasName, ManagedServerDnsAliasCreation parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, managedInstanceName, dnsAliasName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes the managed server DNS alias with the given name. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string dnsAliasName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, managedInstanceName, dnsAliasName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Acquires managed server DNS alias from another managed 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 managed instance. + /// + /// + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> AcquireWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string dnsAliasName, ManagedServerDnsAliasAcquisition parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginAcquireWithHttpMessagesAsync(resourceGroupName, managedInstanceName, dnsAliasName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Creates a managed server DNS alias. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// + /// + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string dnsAliasName, ManagedServerDnsAliasCreation parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (managedInstanceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "managedInstanceName"); + } + if (dnsAliasName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "dnsAliasName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2021-11-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("managedInstanceName", managedInstanceName); + tracingParameters.Add("dnsAliasName", dnsAliasName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{managedInstanceName}", System.Uri.EscapeDataString(managedInstanceName)); + _url = _url.Replace("{dnsAliasName}", System.Uri.EscapeDataString(dnsAliasName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes the managed server DNS alias with the given name. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string dnsAliasName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (managedInstanceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "managedInstanceName"); + } + if (dnsAliasName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "dnsAliasName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2021-11-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("managedInstanceName", managedInstanceName); + tracingParameters.Add("dnsAliasName", dnsAliasName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{managedInstanceName}", System.Uri.EscapeDataString(managedInstanceName)); + _url = _url.Replace("{dnsAliasName}", System.Uri.EscapeDataString(dnsAliasName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Acquires managed server DNS alias from another managed 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 managed instance. + /// + /// + /// + /// + /// + /// + /// 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> BeginAcquireWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string dnsAliasName, ManagedServerDnsAliasAcquisition parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (managedInstanceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "managedInstanceName"); + } + if (dnsAliasName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "dnsAliasName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2021-11-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("managedInstanceName", managedInstanceName); + tracingParameters.Add("dnsAliasName", dnsAliasName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginAcquire", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}/acquire").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{managedInstanceName}", System.Uri.EscapeDataString(managedInstanceName)); + _url = _url.Replace("{dnsAliasName}", System.Uri.EscapeDataString(dnsAliasName)); + _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("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a list of managed server DNS aliases for a managed server. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByManagedInstanceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByManagedInstanceNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ManagedServerDnsAliasesOperationsExtensions.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ManagedServerDnsAliasesOperationsExtensions.cs new file mode 100644 index 000000000000..196f59d94251 --- /dev/null +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ManagedServerDnsAliasesOperationsExtensions.cs @@ -0,0 +1,433 @@ +// +// 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 ManagedServerDnsAliasesOperations. + /// + public static partial class ManagedServerDnsAliasesOperationsExtensions + { + /// + /// Gets a list of managed server DNS aliases for a managed 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 managed instance. + /// + public static IPage ListByManagedInstance(this IManagedServerDnsAliasesOperations operations, string resourceGroupName, string managedInstanceName) + { + return operations.ListByManagedInstanceAsync(resourceGroupName, managedInstanceName).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of managed server DNS aliases for a managed 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 managed instance. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByManagedInstanceAsync(this IManagedServerDnsAliasesOperations operations, string resourceGroupName, string managedInstanceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByManagedInstanceWithHttpMessagesAsync(resourceGroupName, managedInstanceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a server DNS alias. + /// + /// + /// 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 managed instance. + /// + /// + /// + public static ManagedServerDnsAlias Get(this IManagedServerDnsAliasesOperations operations, string resourceGroupName, string managedInstanceName, string dnsAliasName) + { + return operations.GetAsync(resourceGroupName, managedInstanceName, dnsAliasName).GetAwaiter().GetResult(); + } + + /// + /// Gets a server DNS alias. + /// + /// + /// 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 managed instance. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IManagedServerDnsAliasesOperations operations, string resourceGroupName, string managedInstanceName, string dnsAliasName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, managedInstanceName, dnsAliasName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates a managed server DNS alias. + /// + /// + /// 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 managed instance. + /// + /// + /// + /// + /// + public static ManagedServerDnsAlias CreateOrUpdate(this IManagedServerDnsAliasesOperations operations, string resourceGroupName, string managedInstanceName, string dnsAliasName, ManagedServerDnsAliasCreation parameters) + { + return operations.CreateOrUpdateAsync(resourceGroupName, managedInstanceName, dnsAliasName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates a managed server DNS alias. + /// + /// + /// 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 managed instance. + /// + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IManagedServerDnsAliasesOperations operations, string resourceGroupName, string managedInstanceName, string dnsAliasName, ManagedServerDnsAliasCreation parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, managedInstanceName, dnsAliasName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the managed server DNS alias with the given name. + /// + /// + /// 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 managed instance. + /// + /// + /// + public static void Delete(this IManagedServerDnsAliasesOperations operations, string resourceGroupName, string managedInstanceName, string dnsAliasName) + { + operations.DeleteAsync(resourceGroupName, managedInstanceName, dnsAliasName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the managed server DNS alias with the given name. + /// + /// + /// 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 managed instance. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IManagedServerDnsAliasesOperations operations, string resourceGroupName, string managedInstanceName, string dnsAliasName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, managedInstanceName, dnsAliasName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Acquires managed server DNS alias from another managed 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 managed instance. + /// + /// + /// + /// + /// + public static ManagedServerDnsAlias Acquire(this IManagedServerDnsAliasesOperations operations, string resourceGroupName, string managedInstanceName, string dnsAliasName, ManagedServerDnsAliasAcquisition parameters) + { + return operations.AcquireAsync(resourceGroupName, managedInstanceName, dnsAliasName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Acquires managed server DNS alias from another managed 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 managed instance. + /// + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task AcquireAsync(this IManagedServerDnsAliasesOperations operations, string resourceGroupName, string managedInstanceName, string dnsAliasName, ManagedServerDnsAliasAcquisition parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.AcquireWithHttpMessagesAsync(resourceGroupName, managedInstanceName, dnsAliasName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates a managed server DNS alias. + /// + /// + /// 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 managed instance. + /// + /// + /// + /// + /// + public static ManagedServerDnsAlias BeginCreateOrUpdate(this IManagedServerDnsAliasesOperations operations, string resourceGroupName, string managedInstanceName, string dnsAliasName, ManagedServerDnsAliasCreation parameters) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, managedInstanceName, dnsAliasName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates a managed server DNS alias. + /// + /// + /// 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 managed instance. + /// + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this IManagedServerDnsAliasesOperations operations, string resourceGroupName, string managedInstanceName, string dnsAliasName, ManagedServerDnsAliasCreation parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, managedInstanceName, dnsAliasName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the managed server DNS alias with the given name. + /// + /// + /// 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 managed instance. + /// + /// + /// + public static void BeginDelete(this IManagedServerDnsAliasesOperations operations, string resourceGroupName, string managedInstanceName, string dnsAliasName) + { + operations.BeginDeleteAsync(resourceGroupName, managedInstanceName, dnsAliasName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the managed server DNS alias with the given name. + /// + /// + /// 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 managed instance. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IManagedServerDnsAliasesOperations operations, string resourceGroupName, string managedInstanceName, string dnsAliasName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, managedInstanceName, dnsAliasName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Acquires managed server DNS alias from another managed 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 managed instance. + /// + /// + /// + /// + /// + public static ManagedServerDnsAlias BeginAcquire(this IManagedServerDnsAliasesOperations operations, string resourceGroupName, string managedInstanceName, string dnsAliasName, ManagedServerDnsAliasAcquisition parameters) + { + return operations.BeginAcquireAsync(resourceGroupName, managedInstanceName, dnsAliasName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Acquires managed server DNS alias from another managed 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 managed instance. + /// + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task BeginAcquireAsync(this IManagedServerDnsAliasesOperations operations, string resourceGroupName, string managedInstanceName, string dnsAliasName, ManagedServerDnsAliasAcquisition parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginAcquireWithHttpMessagesAsync(resourceGroupName, managedInstanceName, dnsAliasName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a list of managed server DNS aliases for a managed server. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByManagedInstanceNext(this IManagedServerDnsAliasesOperations operations, string nextPageLink) + { + return operations.ListByManagedInstanceNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of managed server DNS aliases for a managed server. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByManagedInstanceNextAsync(this IManagedServerDnsAliasesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByManagedInstanceNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/Database.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/Database.cs index c5c3c64c7a2f..f282d44290f1 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/Database.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/Database.cs @@ -206,9 +206,6 @@ public Database() /// for this database. /// The Client id used for cross tenant /// per database CMK scenario - /// The Primary - /// Delegated Identity Client id used for per database CMK - for - /// internal use only /// The resource identifier of the /// source associated with the create operation of this database. /// @@ -236,7 +233,7 @@ public Database() /// “x-ms-authorization-auxiliary” header see /// https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/authenticate-multi-tenant /// - public Database(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), Sku sku = default(Sku), string kind = default(string), string managedBy = default(string), DatabaseIdentity identity = default(DatabaseIdentity), string createMode = default(string), string collation = default(string), long? maxSizeBytes = default(long?), string sampleName = default(string), string elasticPoolId = default(string), string sourceDatabaseId = default(string), string status = default(string), System.Guid? databaseId = default(System.Guid?), System.DateTime? creationDate = default(System.DateTime?), string currentServiceObjectiveName = default(string), string requestedServiceObjectiveName = default(string), string defaultSecondaryLocation = default(string), string failoverGroupId = default(string), System.DateTime? restorePointInTime = default(System.DateTime?), System.DateTime? sourceDatabaseDeletionDate = default(System.DateTime?), string recoveryServicesRecoveryPointId = default(string), string longTermRetentionBackupResourceId = default(string), string recoverableDatabaseId = default(string), string restorableDroppedDatabaseId = default(string), string catalogCollation = default(string), bool? zoneRedundant = default(bool?), string licenseType = default(string), long? maxLogSizeBytes = default(long?), System.DateTime? earliestRestoreDate = default(System.DateTime?), string readScale = default(string), int? highAvailabilityReplicaCount = default(int?), string secondaryType = default(string), Sku currentSku = default(Sku), int? autoPauseDelay = default(int?), string currentBackupStorageRedundancy = default(string), string requestedBackupStorageRedundancy = default(string), double? minCapacity = default(double?), System.DateTime? pausedDate = default(System.DateTime?), System.DateTime? resumedDate = default(System.DateTime?), string maintenanceConfigurationId = default(string), bool? isLedgerOn = default(bool?), bool? isInfraEncryptionEnabled = default(bool?), System.Guid? federatedClientId = default(System.Guid?), System.Guid? primaryDelegatedIdentityClientId = default(System.Guid?), string sourceResourceId = default(string)) + public Database(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), Sku sku = default(Sku), string kind = default(string), string managedBy = default(string), DatabaseIdentity identity = default(DatabaseIdentity), string createMode = default(string), string collation = default(string), long? maxSizeBytes = default(long?), string sampleName = default(string), string elasticPoolId = default(string), string sourceDatabaseId = default(string), string status = default(string), System.Guid? databaseId = default(System.Guid?), System.DateTime? creationDate = default(System.DateTime?), string currentServiceObjectiveName = default(string), string requestedServiceObjectiveName = default(string), string defaultSecondaryLocation = default(string), string failoverGroupId = default(string), System.DateTime? restorePointInTime = default(System.DateTime?), System.DateTime? sourceDatabaseDeletionDate = default(System.DateTime?), string recoveryServicesRecoveryPointId = default(string), string longTermRetentionBackupResourceId = default(string), string recoverableDatabaseId = default(string), string restorableDroppedDatabaseId = default(string), string catalogCollation = default(string), bool? zoneRedundant = default(bool?), string licenseType = default(string), long? maxLogSizeBytes = default(long?), System.DateTime? earliestRestoreDate = default(System.DateTime?), string readScale = default(string), int? highAvailabilityReplicaCount = default(int?), string secondaryType = default(string), Sku currentSku = default(Sku), int? autoPauseDelay = default(int?), string currentBackupStorageRedundancy = default(string), string requestedBackupStorageRedundancy = default(string), double? minCapacity = default(double?), System.DateTime? pausedDate = default(System.DateTime?), System.DateTime? resumedDate = default(System.DateTime?), string maintenanceConfigurationId = default(string), bool? isLedgerOn = default(bool?), bool? isInfraEncryptionEnabled = default(bool?), System.Guid? federatedClientId = default(System.Guid?), string sourceResourceId = default(string)) : base(location, id, name, type, tags) { Sku = sku; @@ -281,7 +278,6 @@ public Database() IsLedgerOn = isLedgerOn; IsInfraEncryptionEnabled = isInfraEncryptionEnabled; FederatedClientId = federatedClientId; - PrimaryDelegatedIdentityClientId = primaryDelegatedIdentityClientId; SourceResourceId = sourceResourceId; CustomInit(); } @@ -644,13 +640,6 @@ public Database() [JsonProperty(PropertyName = "properties.federatedClientId")] public System.Guid? FederatedClientId { get; set; } - /// - /// Gets or sets the Primary Delegated Identity Client id used for per - /// database CMK - for internal use only - /// - [JsonProperty(PropertyName = "properties.primaryDelegatedIdentityClientId")] - public System.Guid? PrimaryDelegatedIdentityClientId { get; set; } - /// /// Gets or sets the resource identifier of the source associated with /// the create operation of this database. diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/DatabaseIdentity.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/DatabaseIdentity.cs index 32e614559602..56dc6a20bea4 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/DatabaseIdentity.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/DatabaseIdentity.cs @@ -37,14 +37,11 @@ public DatabaseIdentity() /// id. /// The resource ids of the user /// assigned identities to use - /// Resources delegated to the - /// database - Internal Use Only - public DatabaseIdentity(string type = default(string), System.Guid? tenantId = default(System.Guid?), IDictionary userAssignedIdentities = default(IDictionary), IDictionary delegatedResources = default(IDictionary)) + public DatabaseIdentity(string type = default(string), System.Guid? tenantId = default(System.Guid?), IDictionary userAssignedIdentities = default(IDictionary)) { Type = type; TenantId = tenantId; UserAssignedIdentities = userAssignedIdentities; - DelegatedResources = delegatedResources; CustomInit(); } @@ -73,12 +70,5 @@ public DatabaseIdentity() [JsonProperty(PropertyName = "userAssignedIdentities")] public IDictionary UserAssignedIdentities { get; set; } - /// - /// Gets or sets resources delegated to the database - Internal Use - /// Only - /// - [JsonProperty(PropertyName = "delegatedResources")] - public IDictionary DelegatedResources { get; set; } - } } diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/DatabaseUpdate.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/DatabaseUpdate.cs index 7f880478b16a..fad5a1679c9c 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/DatabaseUpdate.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/DatabaseUpdate.cs @@ -182,11 +182,8 @@ public DatabaseUpdate() /// for this database. /// The Client id used for cross tenant /// per database CMK scenario - /// The Primary - /// Delegated Identity Client id used for per database CMK - for - /// internal use only /// Resource tags. - public DatabaseUpdate(Sku sku = default(Sku), DatabaseIdentity identity = default(DatabaseIdentity), string createMode = default(string), string collation = default(string), long? maxSizeBytes = default(long?), string sampleName = default(string), string elasticPoolId = default(string), string sourceDatabaseId = default(string), string status = default(string), System.Guid? databaseId = default(System.Guid?), System.DateTime? creationDate = default(System.DateTime?), string currentServiceObjectiveName = default(string), string requestedServiceObjectiveName = default(string), string defaultSecondaryLocation = default(string), string failoverGroupId = default(string), System.DateTime? restorePointInTime = default(System.DateTime?), System.DateTime? sourceDatabaseDeletionDate = default(System.DateTime?), string recoveryServicesRecoveryPointId = default(string), string longTermRetentionBackupResourceId = default(string), string recoverableDatabaseId = default(string), string restorableDroppedDatabaseId = default(string), string catalogCollation = default(string), bool? zoneRedundant = default(bool?), string licenseType = default(string), long? maxLogSizeBytes = default(long?), System.DateTime? earliestRestoreDate = default(System.DateTime?), string readScale = default(string), int? highAvailabilityReplicaCount = default(int?), string secondaryType = default(string), Sku currentSku = default(Sku), int? autoPauseDelay = default(int?), string currentBackupStorageRedundancy = default(string), string requestedBackupStorageRedundancy = default(string), double? minCapacity = default(double?), System.DateTime? pausedDate = default(System.DateTime?), System.DateTime? resumedDate = default(System.DateTime?), string maintenanceConfigurationId = default(string), bool? isLedgerOn = default(bool?), bool? isInfraEncryptionEnabled = default(bool?), System.Guid? federatedClientId = default(System.Guid?), System.Guid? primaryDelegatedIdentityClientId = default(System.Guid?), IDictionary tags = default(IDictionary)) + public DatabaseUpdate(Sku sku = default(Sku), DatabaseIdentity identity = default(DatabaseIdentity), string createMode = default(string), string collation = default(string), long? maxSizeBytes = default(long?), string sampleName = default(string), string elasticPoolId = default(string), string sourceDatabaseId = default(string), string status = default(string), System.Guid? databaseId = default(System.Guid?), System.DateTime? creationDate = default(System.DateTime?), string currentServiceObjectiveName = default(string), string requestedServiceObjectiveName = default(string), string defaultSecondaryLocation = default(string), string failoverGroupId = default(string), System.DateTime? restorePointInTime = default(System.DateTime?), System.DateTime? sourceDatabaseDeletionDate = default(System.DateTime?), string recoveryServicesRecoveryPointId = default(string), string longTermRetentionBackupResourceId = default(string), string recoverableDatabaseId = default(string), string restorableDroppedDatabaseId = default(string), string catalogCollation = default(string), bool? zoneRedundant = default(bool?), string licenseType = default(string), long? maxLogSizeBytes = default(long?), System.DateTime? earliestRestoreDate = default(System.DateTime?), string readScale = default(string), int? highAvailabilityReplicaCount = default(int?), string secondaryType = default(string), Sku currentSku = default(Sku), int? autoPauseDelay = default(int?), string currentBackupStorageRedundancy = default(string), string requestedBackupStorageRedundancy = default(string), double? minCapacity = default(double?), System.DateTime? pausedDate = default(System.DateTime?), System.DateTime? resumedDate = default(System.DateTime?), string maintenanceConfigurationId = default(string), bool? isLedgerOn = default(bool?), bool? isInfraEncryptionEnabled = default(bool?), System.Guid? federatedClientId = default(System.Guid?), IDictionary tags = default(IDictionary)) { Sku = sku; Identity = identity; @@ -228,7 +225,6 @@ public DatabaseUpdate() IsLedgerOn = isLedgerOn; IsInfraEncryptionEnabled = isInfraEncryptionEnabled; FederatedClientId = federatedClientId; - PrimaryDelegatedIdentityClientId = primaryDelegatedIdentityClientId; Tags = tags; CustomInit(); } @@ -563,13 +559,6 @@ public DatabaseUpdate() [JsonProperty(PropertyName = "properties.federatedClientId")] public System.Guid? FederatedClientId { get; set; } - /// - /// Gets or sets the Primary Delegated Identity Client id used for per - /// database CMK - for internal use only - /// - [JsonProperty(PropertyName = "properties.primaryDelegatedIdentityClientId")] - public System.Guid? PrimaryDelegatedIdentityClientId { get; set; } - /// /// Gets or sets resource tags. /// diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/Delegation.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/Delegation.cs deleted file mode 100644 index 0bc3e28727ee..000000000000 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/Delegation.cs +++ /dev/null @@ -1,63 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Sql.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Delegated Resource Properties - Internal Use Only - /// - public partial class Delegation - { - /// - /// Initializes a new instance of the Delegation class. - /// - public Delegation() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Delegation class. - /// - /// The resource id of the source resource - - /// Internal Use Only - /// AAD tenant guid of the source resource - /// identity - Internal Use Only. - public Delegation(string resourceId = default(string), System.Guid? tenantId = default(System.Guid?)) - { - ResourceId = resourceId; - TenantId = tenantId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the resource id of the source resource - Internal Use - /// Only - /// - [JsonProperty(PropertyName = "resourceId")] - public string ResourceId { get; set; } - - /// - /// Gets AAD tenant guid of the source resource identity - Internal Use - /// Only. - /// - [JsonProperty(PropertyName = "tenantId")] - public System.Guid? TenantId { get; private set; } - - } -} diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/EndpointCertificate.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/EndpointCertificate.cs new file mode 100644 index 000000000000..51815779d7ae --- /dev/null +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/EndpointCertificate.cs @@ -0,0 +1,58 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Sql.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Certificate used on an endpoint on the Managed Instance. + /// + [Rest.Serialization.JsonTransformation] + public partial class EndpointCertificate : ProxyResource + { + /// + /// Initializes a new instance of the EndpointCertificate class. + /// + public EndpointCertificate() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the EndpointCertificate class. + /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// The certificate public blob + public EndpointCertificate(string id = default(string), string name = default(string), string type = default(string), string publicBlob = default(string)) + : base(id, name, type) + { + PublicBlob = publicBlob; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the certificate public blob + /// + [JsonProperty(PropertyName = "properties.publicBlob")] + public string PublicBlob { get; set; } + + } +} diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/ManagedServerDnsAlias.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/ManagedServerDnsAlias.cs new file mode 100644 index 000000000000..826cf94c2b36 --- /dev/null +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/ManagedServerDnsAlias.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Sql.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// A managed server DNS alias. + /// + [Rest.Serialization.JsonTransformation] + public partial class ManagedServerDnsAlias : ProxyResource + { + /// + /// Initializes a new instance of the ManagedServerDnsAlias class. + /// + public ManagedServerDnsAlias() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ManagedServerDnsAlias class. + /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// The fully qualified DNS record for + /// managed server alias + public ManagedServerDnsAlias(string id = default(string), string name = default(string), string type = default(string), string azureDnsRecord = default(string)) + : base(id, name, type) + { + AzureDnsRecord = azureDnsRecord; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the fully qualified DNS record for managed server alias + /// + [JsonProperty(PropertyName = "properties.azureDnsRecord")] + public string AzureDnsRecord { get; private set; } + + } +} diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/ManagedServerDnsAliasAcquisition.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/ManagedServerDnsAliasAcquisition.cs new file mode 100644 index 000000000000..52e9ddd88255 --- /dev/null +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/ManagedServerDnsAliasAcquisition.cs @@ -0,0 +1,70 @@ +// +// 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 Newtonsoft.Json; + using System.Linq; + + /// + /// A managed server DNS alias acquisition request. + /// + public partial class ManagedServerDnsAliasAcquisition + { + /// + /// Initializes a new instance of the ManagedServerDnsAliasAcquisition + /// class. + /// + public ManagedServerDnsAliasAcquisition() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ManagedServerDnsAliasAcquisition + /// class. + /// + /// The resource ID of + /// the managed server DNS alias that will be acquired to point to this + /// managed server instead. + public ManagedServerDnsAliasAcquisition(string oldManagedServerDnsAliasResourceId) + { + OldManagedServerDnsAliasResourceId = oldManagedServerDnsAliasResourceId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the resource ID of the managed server DNS alias that + /// will be acquired to point to this managed server instead. + /// + [JsonProperty(PropertyName = "oldManagedServerDnsAliasResourceId")] + public string OldManagedServerDnsAliasResourceId { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (OldManagedServerDnsAliasResourceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "OldManagedServerDnsAliasResourceId"); + } + } + } +} diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/UnlinkParameters.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/ManagedServerDnsAliasCreation.cs similarity index 53% rename from sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/UnlinkParameters.cs rename to sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/ManagedServerDnsAliasCreation.cs index 773e905009a0..77f0176e74aa 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/UnlinkParameters.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/ManagedServerDnsAliasCreation.cs @@ -14,26 +14,28 @@ namespace Microsoft.Azure.Management.Sql.Models using System.Linq; /// - /// Represents the parameters for Unlink Replication Link request. + /// A managed server dns alias creation request. /// - public partial class UnlinkParameters + public partial class ManagedServerDnsAliasCreation { /// - /// Initializes a new instance of the UnlinkParameters class. + /// Initializes a new instance of the ManagedServerDnsAliasCreation + /// class. /// - public UnlinkParameters() + public ManagedServerDnsAliasCreation() { CustomInit(); } /// - /// Initializes a new instance of the UnlinkParameters class. + /// Initializes a new instance of the ManagedServerDnsAliasCreation + /// class. /// - /// Determines whether link will be - /// terminated in a forced or a friendly way. - public UnlinkParameters(bool? forcedTermination = default(bool?)) + /// Whether or not DNS record should be + /// created for this alias. + public ManagedServerDnsAliasCreation(bool? createDnsRecord = default(bool?)) { - ForcedTermination = forcedTermination; + CreateDnsRecord = createDnsRecord; CustomInit(); } @@ -43,11 +45,11 @@ public UnlinkParameters() partial void CustomInit(); /// - /// Gets or sets determines whether link will be terminated in a forced - /// or a friendly way. + /// Gets or sets whether or not DNS record should be created for this + /// alias. /// - [JsonProperty(PropertyName = "forcedTermination")] - public bool? ForcedTermination { get; set; } + [JsonProperty(PropertyName = "createDnsRecord")] + public bool? CreateDnsRecord { get; set; } } } diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/RecommendedSensitivityLabelsOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/RecommendedSensitivityLabelsOperations.cs index 71e46e0c31ca..bd26dd99867d 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/RecommendedSensitivityLabelsOperations.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/RecommendedSensitivityLabelsOperations.cs @@ -106,7 +106,7 @@ internal RecommendedSensitivityLabelsOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01-preview"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ReplicationLinksOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ReplicationLinksOperations.cs index 64ddd37e63c9..2cb48749e5f3 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ReplicationLinksOperations.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ReplicationLinksOperations.cs @@ -51,7 +51,7 @@ internal ReplicationLinksOperations(SqlManagementClient client) public SqlManagementClient Client { get; private set; } /// - /// Deletes a database replication link. Cannot be done during failover. + /// Gets a list of replication links on database. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -61,10 +61,7 @@ internal ReplicationLinksOperations(SqlManagementClient client) /// The name of the server. /// /// - /// The name of the database that has the replication link to be dropped. - /// - /// - /// The ID of the replication link to be deleted. + /// The name of the database. /// /// /// Headers that will be added to request. @@ -75,6 +72,9 @@ internal ReplicationLinksOperations(SqlManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -84,12 +84,8 @@ internal ReplicationLinksOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -102,11 +98,11 @@ internal ReplicationLinksOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); } - if (linkId == null) + if (Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "linkId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2014-04-01"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -114,22 +110,20 @@ internal ReplicationLinksOperations(SqlManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serverName", serverName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("linkId", linkId); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByDatabase", 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}/replicationLinks/{linkId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks").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("{linkId}", System.Uri.EscapeDataString(linkId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) { @@ -142,7 +136,7 @@ internal ReplicationLinksOperations(SqlManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -193,7 +187,7 @@ internal ReplicationLinksOperations(SqlManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -228,13 +222,31 @@ internal ReplicationLinksOperations(SqlManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _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); @@ -301,7 +313,7 @@ internal ReplicationLinksOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01-preview"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -456,8 +468,7 @@ internal ReplicationLinksOperations(SqlManagementClient client) } /// - /// Sets which replica database is primary by failing over from the current - /// primary replica database. + /// Deletes the replication link. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -467,98 +478,9 @@ internal ReplicationLinksOperations(SqlManagementClient client) /// The name of the server. /// /// - /// The name of the database that has the replication link to be failed over. - /// - /// - /// The ID of the replication link to be failed over. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task FailoverWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginFailoverWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Sets which replica database is primary by failing over from the current - /// primary replica database. This operation might result in data loss. - /// - /// - /// 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 that has the replication link to be failed over. - /// - /// - /// The ID of the replication link to be failed over. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task FailoverAllowDataLossWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginFailoverAllowDataLossWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes a database replication link in forced or friendly way. - /// - /// - /// 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 that has the replication link to be failed over. + /// The name of the database. /// /// - /// The ID of the replication link to be failed over. - /// - /// - /// The required parameters for unlinking replication link. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task UnlinkWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, UnlinkParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginUnlinkWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets a list of replication links on 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. /// /// /// Headers that will be added to request. @@ -569,9 +491,6 @@ internal ReplicationLinksOperations(SqlManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -581,7 +500,7 @@ internal ReplicationLinksOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -595,11 +514,15 @@ internal ReplicationLinksOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); } + if (linkId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "linkId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01-preview"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -610,16 +533,18 @@ internal ReplicationLinksOperations(SqlManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serverName", serverName); tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("linkId", linkId); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByDatabase", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}").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("{linkId}", System.Uri.EscapeDataString(linkId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -633,7 +558,7 @@ internal ReplicationLinksOperations(SqlManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -719,31 +644,13 @@ internal ReplicationLinksOperations(SqlManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _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); @@ -751,6 +658,65 @@ internal ReplicationLinksOperations(SqlManagementClient client) return _result; } + /// + /// Fails over from the current primary server to this 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 name of the database. + /// + /// + /// The name of the replication link. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> FailoverWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginFailoverWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Fails over from the current primary server to this server allowing data + /// loss. + /// + /// + /// 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 name of the replication link. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> FailoverAllowDataLossWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginFailoverAllowDataLossWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + /// /// Gets a list of replication links. /// @@ -796,7 +762,7 @@ internal ReplicationLinksOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01-preview"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -947,8 +913,7 @@ internal ReplicationLinksOperations(SqlManagementClient client) } /// - /// Sets which replica database is primary by failing over from the current - /// primary replica database. + /// Fails over from the current primary server to this server. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -958,10 +923,10 @@ internal ReplicationLinksOperations(SqlManagementClient client) /// The name of the server. /// /// - /// The name of the database that has the replication link to be failed over. + /// The name of the database. /// /// - /// The ID of the replication link to be failed over. + /// The name of the replication link. /// /// /// Headers that will be added to request. @@ -972,6 +937,9 @@ internal ReplicationLinksOperations(SqlManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -981,12 +949,8 @@ internal ReplicationLinksOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginFailoverWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginFailoverWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1003,7 +967,11 @@ internal ReplicationLinksOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "linkId"); } - string apiVersion = "2014-04-01"; + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1011,22 +979,22 @@ internal ReplicationLinksOperations(SqlManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serverName", serverName); tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("linkId", linkId); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginFailover", 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}/replicationLinks/{linkId}/failover").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _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("{linkId}", System.Uri.EscapeDataString(linkId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) { @@ -1090,7 +1058,7 @@ internal ReplicationLinksOperations(SqlManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1125,205 +1093,30 @@ internal ReplicationLinksOperations(SqlManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Sets which replica database is primary by failing over from the current - /// primary replica database. This operation might result in data loss. - /// - /// - /// 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 that has the replication link to be failed over. - /// - /// - /// The ID of the replication link to be failed over. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task BeginFailoverAllowDataLossWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (serverName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (linkId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "linkId"); - } - string apiVersion = "2014-04-01"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("serverName", serverName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("linkId", linkId); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginFailoverAllowDataLoss", 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}/replicationLinks/{linkId}/forceFailoverAllowDataLoss").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _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("{linkId}", System.Uri.EscapeDataString(linkId)); - 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("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) + // Deserialize Response + if ((int)_statusCode == 200) { - foreach(var _header in customHeaders) + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 202 && (int)_statusCode != 204) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try + catch (JsonException ex) { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) + _httpRequest.Dispose(); + if (_httpResponse != null) { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; + _httpResponse.Dispose(); } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { @@ -1333,7 +1126,8 @@ internal ReplicationLinksOperations(SqlManagementClient client) } /// - /// Deletes a database replication link in forced or friendly way. + /// Fails over from the current primary server to this server allowing data + /// loss. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -1343,13 +1137,10 @@ internal ReplicationLinksOperations(SqlManagementClient client) /// The name of the server. /// /// - /// The name of the database that has the replication link to be failed over. + /// The name of the database. /// /// - /// The ID of the replication link to be failed over. - /// - /// - /// The required parameters for unlinking replication link. + /// The name of the replication link. /// /// /// Headers that will be added to request. @@ -1360,6 +1151,9 @@ internal ReplicationLinksOperations(SqlManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -1369,12 +1163,8 @@ internal ReplicationLinksOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginUnlinkWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, UnlinkParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginFailoverAllowDataLossWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1391,11 +1181,11 @@ internal ReplicationLinksOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "linkId"); } - if (parameters == null) + if (Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2014-04-01"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1403,23 +1193,22 @@ internal ReplicationLinksOperations(SqlManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serverName", serverName); tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("linkId", linkId); - tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUnlink", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginFailoverAllowDataLoss", 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}/replicationLinks/{linkId}/unlink").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/forceFailoverAllowDataLoss").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("{linkId}", System.Uri.EscapeDataString(linkId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) { @@ -1463,12 +1252,6 @@ internal ReplicationLinksOperations(SqlManagementClient client) // Serialize Request string _requestContent = null; - if(parameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -1489,7 +1272,7 @@ internal ReplicationLinksOperations(SqlManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1524,13 +1307,31 @@ internal ReplicationLinksOperations(SqlManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _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); diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ReplicationLinksOperationsExtensions.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ReplicationLinksOperationsExtensions.cs index 5cfcc8702823..b5e56b6e2ffa 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ReplicationLinksOperationsExtensions.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ReplicationLinksOperationsExtensions.cs @@ -22,7 +22,7 @@ namespace Microsoft.Azure.Management.Sql public static partial class ReplicationLinksOperationsExtensions { /// - /// Deletes a database replication link. Cannot be done during failover. + /// Gets a list of replication links on database. /// /// /// The operations group for this extension method. @@ -35,18 +35,15 @@ public static partial class ReplicationLinksOperationsExtensions /// The name of the server. /// /// - /// The name of the database that has the replication link to be dropped. - /// - /// - /// The ID of the replication link to be deleted. + /// The name of the database. /// - public static void Delete(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId) + public static IPage ListByDatabase(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName) { - operations.DeleteAsync(resourceGroupName, serverName, databaseName, linkId).GetAwaiter().GetResult(); + return operations.ListByDatabaseAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult(); } /// - /// Deletes a database replication link. Cannot be done during failover. + /// Gets a list of replication links on database. /// /// /// The operations group for this extension method. @@ -59,17 +56,17 @@ public static void Delete(this IReplicationLinksOperations operations, string re /// The name of the server. /// /// - /// The name of the database that has the replication link to be dropped. - /// - /// - /// The ID of the replication link to be deleted. + /// The name of the database. /// /// /// The cancellation token. /// - public static async Task DeleteAsync(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByDatabaseAsync(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.ListByDatabaseWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// @@ -127,8 +124,7 @@ public static ReplicationLink Get(this IReplicationLinksOperations operations, s } /// - /// Sets which replica database is primary by failing over from the current - /// primary replica database. + /// Deletes the replication link. /// /// /// The operations group for this extension method. @@ -141,19 +137,17 @@ public static ReplicationLink Get(this IReplicationLinksOperations operations, s /// The name of the server. /// /// - /// The name of the database that has the replication link to be failed over. + /// The name of the database. /// /// - /// The ID of the replication link to be failed over. /// - public static void Failover(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId) + public static void Delete(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId) { - operations.FailoverAsync(resourceGroupName, serverName, databaseName, linkId).GetAwaiter().GetResult(); + operations.DeleteAsync(resourceGroupName, serverName, databaseName, linkId).GetAwaiter().GetResult(); } /// - /// Sets which replica database is primary by failing over from the current - /// primary replica database. + /// Deletes the replication link. /// /// /// The operations group for this extension method. @@ -166,22 +160,20 @@ public static void Failover(this IReplicationLinksOperations operations, string /// The name of the server. /// /// - /// The name of the database that has the replication link to be failed over. + /// The name of the database. /// /// - /// The ID of the replication link to be failed over. /// /// /// The cancellation token. /// - public static async Task FailoverAsync(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteAsync(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.FailoverWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Sets which replica database is primary by failing over from the current - /// primary replica database. This operation might result in data loss. + /// Fails over from the current primary server to this server. /// /// /// The operations group for this extension method. @@ -194,19 +186,18 @@ public static void Failover(this IReplicationLinksOperations operations, string /// The name of the server. /// /// - /// The name of the database that has the replication link to be failed over. + /// The name of the database. /// /// - /// The ID of the replication link to be failed over. + /// The name of the replication link. /// - public static void FailoverAllowDataLoss(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId) + public static ReplicationLink Failover(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId) { - operations.FailoverAllowDataLossAsync(resourceGroupName, serverName, databaseName, linkId).GetAwaiter().GetResult(); + return operations.FailoverAsync(resourceGroupName, serverName, databaseName, linkId).GetAwaiter().GetResult(); } /// - /// Sets which replica database is primary by failing over from the current - /// primary replica database. This operation might result in data loss. + /// Fails over from the current primary server to this server. /// /// /// The operations group for this extension method. @@ -219,48 +210,25 @@ public static void FailoverAllowDataLoss(this IReplicationLinksOperations operat /// The name of the server. /// /// - /// The name of the database that has the replication link to be failed over. + /// The name of the database. /// /// - /// The ID of the replication link to be failed over. + /// The name of the replication link. /// /// /// The cancellation token. /// - public static async Task FailoverAllowDataLossAsync(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.FailoverAllowDataLossWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Deletes a database replication link in forced or friendly way. - /// - /// - /// 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 that has the replication link to be failed over. - /// - /// - /// The ID of the replication link to be failed over. - /// - /// - /// The required parameters for unlinking replication link. - /// - public static void Unlink(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId, UnlinkParameters parameters) + public static async Task FailoverAsync(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId, CancellationToken cancellationToken = default(CancellationToken)) { - operations.UnlinkAsync(resourceGroupName, serverName, databaseName, linkId, parameters).GetAwaiter().GetResult(); + using (var _result = await operations.FailoverWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Deletes a database replication link in forced or friendly way. + /// Fails over from the current primary server to this server allowing data + /// loss. /// /// /// The operations group for this extension method. @@ -273,24 +241,19 @@ public static void Unlink(this IReplicationLinksOperations operations, string re /// The name of the server. /// /// - /// The name of the database that has the replication link to be failed over. + /// The name of the database. /// /// - /// The ID of the replication link to be failed over. - /// - /// - /// The required parameters for unlinking replication link. - /// - /// - /// The cancellation token. + /// The name of the replication link. /// - public static async Task UnlinkAsync(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId, UnlinkParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static ReplicationLink FailoverAllowDataLoss(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId) { - (await operations.UnlinkWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return operations.FailoverAllowDataLossAsync(resourceGroupName, serverName, databaseName, linkId).GetAwaiter().GetResult(); } /// - /// Gets a list of replication links on database. + /// Fails over from the current primary server to this server allowing data + /// loss. /// /// /// The operations group for this extension method. @@ -305,33 +268,15 @@ public static void Unlink(this IReplicationLinksOperations operations, string re /// /// The name of the database. /// - public static IPage ListByDatabase(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName) - { - return operations.ListByDatabaseAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult(); - } - - /// - /// Gets a list of replication links on 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 name of the replication link. /// /// /// The cancellation token. /// - public static async Task> ListByDatabaseAsync(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task FailoverAllowDataLossAsync(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByDatabaseWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.FailoverAllowDataLossWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -380,61 +325,7 @@ public static IPage ListByServer(this IReplicationLinksOperatio } /// - /// Sets which replica database is primary by failing over from the current - /// primary replica 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 that has the replication link to be failed over. - /// - /// - /// The ID of the replication link to be failed over. - /// - public static void BeginFailover(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId) - { - operations.BeginFailoverAsync(resourceGroupName, serverName, databaseName, linkId).GetAwaiter().GetResult(); - } - - /// - /// Sets which replica database is primary by failing over from the current - /// primary replica 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 that has the replication link to be failed over. - /// - /// - /// The ID of the replication link to be failed over. - /// - /// - /// The cancellation token. - /// - public static async Task BeginFailoverAsync(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginFailoverWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Sets which replica database is primary by failing over from the current - /// primary replica database. This operation might result in data loss. + /// Fails over from the current primary server to this server. /// /// /// The operations group for this extension method. @@ -447,19 +338,18 @@ public static void BeginFailover(this IReplicationLinksOperations operations, st /// The name of the server. /// /// - /// The name of the database that has the replication link to be failed over. + /// The name of the database. /// /// - /// The ID of the replication link to be failed over. + /// The name of the replication link. /// - public static void BeginFailoverAllowDataLoss(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId) + public static ReplicationLink BeginFailover(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId) { - operations.BeginFailoverAllowDataLossAsync(resourceGroupName, serverName, databaseName, linkId).GetAwaiter().GetResult(); + return operations.BeginFailoverAsync(resourceGroupName, serverName, databaseName, linkId).GetAwaiter().GetResult(); } /// - /// Sets which replica database is primary by failing over from the current - /// primary replica database. This operation might result in data loss. + /// Fails over from the current primary server to this server. /// /// /// The operations group for this extension method. @@ -472,21 +362,25 @@ public static void BeginFailoverAllowDataLoss(this IReplicationLinksOperations o /// The name of the server. /// /// - /// The name of the database that has the replication link to be failed over. + /// The name of the database. /// /// - /// The ID of the replication link to be failed over. + /// The name of the replication link. /// /// /// The cancellation token. /// - public static async Task BeginFailoverAllowDataLossAsync(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginFailoverAsync(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.BeginFailoverAllowDataLossWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginFailoverWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Deletes a database replication link in forced or friendly way. + /// Fails over from the current primary server to this server allowing data + /// loss. /// /// /// The operations group for this extension method. @@ -499,21 +393,19 @@ public static void BeginFailoverAllowDataLoss(this IReplicationLinksOperations o /// The name of the server. /// /// - /// The name of the database that has the replication link to be failed over. + /// The name of the database. /// /// - /// The ID of the replication link to be failed over. - /// - /// - /// The required parameters for unlinking replication link. + /// The name of the replication link. /// - public static void BeginUnlink(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId, UnlinkParameters parameters) + public static ReplicationLink BeginFailoverAllowDataLoss(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId) { - operations.BeginUnlinkAsync(resourceGroupName, serverName, databaseName, linkId, parameters).GetAwaiter().GetResult(); + return operations.BeginFailoverAllowDataLossAsync(resourceGroupName, serverName, databaseName, linkId).GetAwaiter().GetResult(); } /// - /// Deletes a database replication link in forced or friendly way. + /// Fails over from the current primary server to this server allowing data + /// loss. /// /// /// The operations group for this extension method. @@ -526,20 +418,20 @@ public static void BeginUnlink(this IReplicationLinksOperations operations, stri /// The name of the server. /// /// - /// The name of the database that has the replication link to be failed over. + /// The name of the database. /// /// - /// The ID of the replication link to be failed over. - /// - /// - /// The required parameters for unlinking replication link. + /// The name of the replication link. /// /// /// The cancellation token. /// - public static async Task BeginUnlinkAsync(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId, UnlinkParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginFailoverAllowDataLossAsync(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.BeginUnlinkWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginFailoverAllowDataLossWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SdkInfo_SqlManagementClient.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SdkInfo_SqlManagementClient.cs index a8987005c1f2..70d20f0bbc7a 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SdkInfo_SqlManagementClient.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SdkInfo_SqlManagementClient.cs @@ -41,13 +41,14 @@ public static IEnumerable> ApiInfo_SqlManagementCl new Tuple("Sql", "Databases", "2014-04-01"), new Tuple("Sql", "Databases", "2021-05-01-preview"), new Tuple("Sql", "DeletedServers", "2020-11-01-preview"), - new Tuple("Sql", "DistributedAvailabilityGroups", "2021-05-01-preview"), + new Tuple("Sql", "DistributedAvailabilityGroups", "2021-11-01-preview"), new Tuple("Sql", "ElasticPoolActivities", "2014-04-01"), new Tuple("Sql", "ElasticPoolDatabaseActivities", "2014-04-01"), new Tuple("Sql", "ElasticPoolOperations", "2020-11-01-preview"), new Tuple("Sql", "ElasticPools", "2014-04-01"), new Tuple("Sql", "ElasticPools", "2021-08-01-preview"), new Tuple("Sql", "EncryptionProtectors", "2020-11-01-preview"), + new Tuple("Sql", "EndpointCertificates", "2021-11-01-preview"), new Tuple("Sql", "ExtendedDatabaseBlobAuditingPolicies", "2020-11-01-preview"), new Tuple("Sql", "ExtendedServerBlobAuditingPolicies", "2020-11-01-preview"), new Tuple("Sql", "FailoverGroups", "2020-11-01-preview"), @@ -74,12 +75,12 @@ public static IEnumerable> ApiInfo_SqlManagementCl new Tuple("Sql", "ManagedBackupShortTermRetentionPolicies", "2020-11-01-preview"), new Tuple("Sql", "ManagedDatabaseColumns", "2020-11-01-preview"), new Tuple("Sql", "ManagedDatabaseQueries", "2020-11-01-preview"), - new Tuple("Sql", "ManagedDatabaseRecommendedSensitivityLabels", "2020-11-01-preview"), + new Tuple("Sql", "ManagedDatabaseRecommendedSensitivityLabels", "2021-11-01-preview"), new Tuple("Sql", "ManagedDatabaseRestoreDetails", "2020-11-01-preview"), new Tuple("Sql", "ManagedDatabaseSchemas", "2020-11-01-preview"), new Tuple("Sql", "ManagedDatabaseSecurityAlertPolicies", "2020-11-01-preview"), new Tuple("Sql", "ManagedDatabaseSecurityEvents", "2020-11-01-preview"), - new Tuple("Sql", "ManagedDatabaseSensitivityLabels", "2020-11-01-preview"), + new Tuple("Sql", "ManagedDatabaseSensitivityLabels", "2021-11-01-preview"), new Tuple("Sql", "ManagedDatabaseTables", "2020-11-01-preview"), new Tuple("Sql", "ManagedDatabaseTransparentDataEncryption", "2020-11-01-preview"), new Tuple("Sql", "ManagedDatabaseVulnerabilityAssessmentRuleBaselines", "2020-11-01-preview"), @@ -98,20 +99,20 @@ public static IEnumerable> ApiInfo_SqlManagementCl new Tuple("Sql", "ManagedInstanceVulnerabilityAssessments", "2020-11-01-preview"), new Tuple("Sql", "ManagedInstances", "2021-05-01-preview"), new Tuple("Sql", "ManagedRestorableDroppedDatabaseBackupShortTermRetentionPolicies", "2020-11-01-preview"), + new Tuple("Sql", "ManagedServerDnsAliases", "2021-11-01-preview"), new Tuple("Sql", "ManagedServerSecurityAlertPolicies", "2020-11-01-preview"), new Tuple("Sql", "Operations", "2020-11-01-preview"), new Tuple("Sql", "OutboundFirewallRules", "2021-02-01-preview"), new Tuple("Sql", "PrivateEndpointConnections", "2020-11-01-preview"), new Tuple("Sql", "PrivateLinkResources", "2020-11-01-preview"), - new Tuple("Sql", "RecommendedSensitivityLabels", "2020-11-01-preview"), + new Tuple("Sql", "RecommendedSensitivityLabels", "2021-11-01-preview"), new Tuple("Sql", "RecoverableDatabases", "2014-04-01"), new Tuple("Sql", "RecoverableManagedDatabases", "2020-11-01-preview"), - new Tuple("Sql", "ReplicationLinks", "2014-04-01"), - new Tuple("Sql", "ReplicationLinks", "2021-02-01-preview"), + new Tuple("Sql", "ReplicationLinks", "2021-11-01-preview"), new Tuple("Sql", "RestorableDroppedDatabases", "2021-05-01-preview"), new Tuple("Sql", "RestorableDroppedManagedDatabases", "2021-05-01-preview"), new Tuple("Sql", "RestorePoints", "2020-11-01-preview"), - new Tuple("Sql", "SensitivityLabels", "2020-11-01-preview"), + new Tuple("Sql", "SensitivityLabels", "2021-11-01-preview"), new Tuple("Sql", "ServerAdvisors", "2020-11-01-preview"), new Tuple("Sql", "ServerAutomaticTuning", "2020-11-01-preview"), new Tuple("Sql", "ServerAzureADAdministrators", "2020-11-01-preview"), @@ -124,7 +125,7 @@ public static IEnumerable> ApiInfo_SqlManagementCl new Tuple("Sql", "ServerKeys", "2020-11-01-preview"), new Tuple("Sql", "ServerOperations", "2020-11-01-preview"), new Tuple("Sql", "ServerSecurityAlertPolicies", "2020-11-01-preview"), - new Tuple("Sql", "ServerTrustCertificates", "2021-05-01-preview"), + new Tuple("Sql", "ServerTrustCertificates", "2021-11-01-preview"), new Tuple("Sql", "ServerTrustGroups", "2020-11-01-preview"), new Tuple("Sql", "ServerUsages", "2014-04-01"), new Tuple("Sql", "ServerVulnerabilityAssessments", "2020-11-01-preview"), @@ -146,15 +147,5 @@ public static IEnumerable> ApiInfo_SqlManagementCl }.AsEnumerable(); } } - public static readonly String AutoRestVersion = "2.0.4421"; - public static readonly String AutoRestBootStrapperVersion = "autorest@3.5.1"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/main/specification/sql/resource-manager/readme.md --csharp --version=2.0.4421 --reflect-api-versions --csharp-sdks-folder=D:\\OpenSourceProjects\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "main"; - public static readonly String GithubCommidId = "2b92c256213dfd230dabe819bb901c197188773a"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SensitivityLabelsOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SensitivityLabelsOperations.cs index c033488914ca..c3b5bb981564 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SensitivityLabelsOperations.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SensitivityLabelsOperations.cs @@ -110,7 +110,7 @@ internal SensitivityLabelsOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01-preview"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -336,7 +336,7 @@ internal SensitivityLabelsOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01-preview"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -537,7 +537,7 @@ internal SensitivityLabelsOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01-preview"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -709,8 +709,510 @@ internal SensitivityLabelsOperations(SqlManagementClient client) } /// - /// Enables sensitivity recommendations on a given column (recommendations are - /// enabled by default on all columns) + /// Gets the sensitivity label of a given column + /// + /// + /// 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 name of the schema. + /// + /// + /// The name of the table. + /// + /// + /// The name of the column. + /// + /// + /// The source of the sensitivity label. Possible values include: 'current', + /// 'recommended' + /// + /// + /// 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, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource, 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 (schemaName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "schemaName"); + } + if (tableName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); + } + if (columnName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "columnName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2021-11-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("schemaName", schemaName); + tracingParameters.Add("tableName", tableName); + tracingParameters.Add("columnName", columnName); + tracingParameters.Add("sensitivityLabelSource", sensitivityLabelSource); + 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}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}").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("{schemaName}", System.Uri.EscapeDataString(schemaName)); + _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); + _url = _url.Replace("{columnName}", System.Uri.EscapeDataString(columnName)); + _url = _url.Replace("{sensitivityLabelSource}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(sensitivityLabelSource, Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates the sensitivity label of a given column + /// + /// + /// 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 name of the schema. + /// + /// + /// The name of the table. + /// + /// + /// The name of the column. + /// + /// + /// The column sensitivity label resource. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabel 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 (schemaName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "schemaName"); + } + if (tableName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); + } + if (columnName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "columnName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string sensitivityLabelSource = "current"; + string apiVersion = "2021-11-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("schemaName", schemaName); + tracingParameters.Add("tableName", tableName); + tracingParameters.Add("columnName", columnName); + tracingParameters.Add("sensitivityLabelSource", sensitivityLabelSource); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}").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("{schemaName}", System.Uri.EscapeDataString(schemaName)); + _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); + _url = _url.Replace("{columnName}", System.Uri.EscapeDataString(columnName)); + _url = _url.Replace("{sensitivityLabelSource}", System.Uri.EscapeDataString(sensitivityLabelSource)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes the sensitivity label of a given column /// /// /// The name of the resource group that contains the resource. You can obtain @@ -749,7 +1251,7 @@ internal SensitivityLabelsOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task EnableRecommendationWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -779,8 +1281,8 @@ internal SensitivityLabelsOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string sensitivityLabelSource = "recommended"; - string apiVersion = "2020-11-01-preview"; + string sensitivityLabelSource = "current"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -797,11 +1299,11 @@ internal SensitivityLabelsOperations(SqlManagementClient client) tracingParameters.Add("sensitivityLabelSource", sensitivityLabelSource); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "EnableRecommendation", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/enable").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}").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)); @@ -822,7 +1324,7 @@ internal SensitivityLabelsOperations(SqlManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -993,7 +1495,7 @@ internal SensitivityLabelsOperations(SqlManagementClient client) throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } string sensitivityLabelSource = "recommended"; - string apiVersion = "2020-11-01-preview"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1136,7 +1638,8 @@ internal SensitivityLabelsOperations(SqlManagementClient client) } /// - /// Gets the sensitivity label of a given column + /// Enables sensitivity recommendations on a given column (recommendations are + /// enabled by default on all columns) /// /// /// The name of the resource group that contains the resource. You can obtain @@ -1157,10 +1660,6 @@ internal SensitivityLabelsOperations(SqlManagementClient client) /// /// The name of the column. /// - /// - /// The source of the sensitivity label. Possible values include: 'current', - /// 'recommended' - /// /// /// Headers that will be added to request. /// @@ -1170,9 +1669,6 @@ internal SensitivityLabelsOperations(SqlManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -1182,7 +1678,7 @@ internal SensitivityLabelsOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task EnableRecommendationWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1212,7 +1708,8 @@ internal SensitivityLabelsOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01-preview"; + string sensitivityLabelSource = "recommended"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1229,18 +1726,18 @@ internal SensitivityLabelsOperations(SqlManagementClient client) tracingParameters.Add("sensitivityLabelSource", sensitivityLabelSource); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "EnableRecommendation", 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}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/enable").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("{schemaName}", System.Uri.EscapeDataString(schemaName)); _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); _url = _url.Replace("{columnName}", System.Uri.EscapeDataString(columnName)); - _url = _url.Replace("{sensitivityLabelSource}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(sensitivityLabelSource, Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{sensitivityLabelSource}", System.Uri.EscapeDataString(sensitivityLabelSource)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -1254,7 +1751,7 @@ internal SensitivityLabelsOperations(SqlManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1340,31 +1837,13 @@ internal SensitivityLabelsOperations(SqlManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _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); @@ -1373,7 +1852,7 @@ internal SensitivityLabelsOperations(SqlManagementClient client) } /// - /// Creates or updates the sensitivity label of a given column + /// Gets the sensitivity labels of a given database /// /// /// The name of the resource group that contains the resource. You can obtain @@ -1385,17 +1864,8 @@ internal SensitivityLabelsOperations(SqlManagementClient client) /// /// The name of the database. /// - /// - /// The name of the schema. - /// - /// - /// The name of the table. - /// - /// - /// The name of the column. - /// - /// - /// The column sensitivity label resource. + /// + /// OData parameters to apply to the operation. /// /// /// Headers that will be added to request. @@ -1418,7 +1888,7 @@ internal SensitivityLabelsOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabel parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1432,28 +1902,11 @@ internal SensitivityLabelsOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); } - if (schemaName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "schemaName"); - } - if (tableName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); - } - if (columnName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "columnName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string sensitivityLabelSource = "current"; - string apiVersion = "2020-11-01-preview"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1461,30 +1914,30 @@ internal SensitivityLabelsOperations(SqlManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("odataQuery", odataQuery); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serverName", serverName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("schemaName", schemaName); - tracingParameters.Add("tableName", tableName); - tracingParameters.Add("columnName", columnName); - tracingParameters.Add("sensitivityLabelSource", sensitivityLabelSource); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByDatabase", 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}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sensitivityLabels").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("{schemaName}", System.Uri.EscapeDataString(schemaName)); - _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); - _url = _url.Replace("{columnName}", System.Uri.EscapeDataString(columnName)); - _url = _url.Replace("{sensitivityLabelSource}", System.Uri.EscapeDataString(sensitivityLabelSource)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (odataQuery != null) + { + var _odataFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_odataFilter)) + { + _queryParameters.Add(_odataFilter); + } + } if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1496,7 +1949,7 @@ internal SensitivityLabelsOperations(SqlManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1527,12 +1980,6 @@ internal SensitivityLabelsOperations(SqlManagementClient client) // Serialize Request string _requestContent = null; - if(parameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -1553,7 +2000,7 @@ internal SensitivityLabelsOperations(SqlManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1588,7 +2035,7 @@ internal SensitivityLabelsOperations(SqlManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1601,25 +2048,7 @@ internal SensitivityLabelsOperations(SqlManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1639,26 +2068,10 @@ internal SensitivityLabelsOperations(SqlManagementClient client) } /// - /// Deletes the sensitivity label of a given column + /// Gets the sensitivity labels of a given 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 name of the schema. - /// - /// - /// The name of the table. - /// - /// - /// The name of the column. + /// + /// The NextLink from the previous successful call to List operation. /// /// /// Headers that will be added to request. @@ -1669,6 +2082,9 @@ internal SensitivityLabelsOperations(SqlManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -1678,38 +2094,12 @@ internal SensitivityLabelsOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListCurrentByDatabaseNextWithHttpMessagesAsync(string nextPageLink, 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 (schemaName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "schemaName"); - } - if (tableName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); - } - if (columnName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "columnName"); - } - if (Client.SubscriptionId == null) + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } - string sensitivityLabelSource = "current"; - string apiVersion = "2020-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1717,33 +2107,14 @@ internal SensitivityLabelsOperations(SqlManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("serverName", serverName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("schemaName", schemaName); - tracingParameters.Add("tableName", tableName); - tracingParameters.Add("columnName", columnName); - tracingParameters.Add("sensitivityLabelSource", sensitivityLabelSource); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListCurrentByDatabaseNext", 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}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}").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("{schemaName}", System.Uri.EscapeDataString(schemaName)); - _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); - _url = _url.Replace("{columnName}", System.Uri.EscapeDataString(columnName)); - _url = _url.Replace("{sensitivityLabelSource}", System.Uri.EscapeDataString(sensitivityLabelSource)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -1751,7 +2122,7 @@ internal SensitivityLabelsOperations(SqlManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1837,13 +2208,31 @@ internal SensitivityLabelsOperations(SqlManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _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); @@ -1878,7 +2267,7 @@ internal SensitivityLabelsOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListCurrentByDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListRecommendedByDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -1893,7 +2282,7 @@ internal SensitivityLabelsOperations(SqlManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListCurrentByDatabaseNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListRecommendedByDatabaseNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -2051,7 +2440,7 @@ internal SensitivityLabelsOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListRecommendedByDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -2066,7 +2455,7 @@ internal SensitivityLabelsOperations(SqlManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListRecommendedByDatabaseNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByDatabaseNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SensitivityLabelsOperationsExtensions.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SensitivityLabelsOperationsExtensions.cs index 16d206000767..bad4e1db77f4 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SensitivityLabelsOperationsExtensions.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SensitivityLabelsOperationsExtensions.cs @@ -198,8 +198,7 @@ public static void Update(this ISensitivityLabelsOperations operations, string r } /// - /// Enables sensitivity recommendations on a given column (recommendations are - /// enabled by default on all columns) + /// Gets the sensitivity label of a given column /// /// /// The operations group for this extension method. @@ -223,14 +222,17 @@ public static void Update(this ISensitivityLabelsOperations operations, string r /// /// The name of the column. /// - public static void EnableRecommendation(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName) + /// + /// The source of the sensitivity label. Possible values include: 'current', + /// 'recommended' + /// + public static SensitivityLabel Get(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource) { - operations.EnableRecommendationAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, sensitivityLabelSource).GetAwaiter().GetResult(); } /// - /// Enables sensitivity recommendations on a given column (recommendations are - /// enabled by default on all columns) + /// Gets the sensitivity label of a given column /// /// /// The operations group for this extension method. @@ -254,16 +256,23 @@ public static void EnableRecommendation(this ISensitivityLabelsOperations operat /// /// The name of the column. /// + /// + /// The source of the sensitivity label. Possible values include: 'current', + /// 'recommended' + /// /// /// The cancellation token. /// - public static async Task EnableRecommendationAsync(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.EnableRecommendationWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, sensitivityLabelSource, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Disables sensitivity recommendations on a given column + /// Creates or updates the sensitivity label of a given column /// /// /// The operations group for this extension method. @@ -287,13 +296,16 @@ public static void EnableRecommendation(this ISensitivityLabelsOperations operat /// /// The name of the column. /// - public static void DisableRecommendation(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName) + /// + /// The column sensitivity label resource. + /// + public static SensitivityLabel CreateOrUpdate(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabel parameters) { - operations.DisableRecommendationAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName).GetAwaiter().GetResult(); + return operations.CreateOrUpdateAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, parameters).GetAwaiter().GetResult(); } /// - /// Disables sensitivity recommendations on a given column + /// Creates or updates the sensitivity label of a given column /// /// /// The operations group for this extension method. @@ -317,16 +329,22 @@ public static void DisableRecommendation(this ISensitivityLabelsOperations opera /// /// The name of the column. /// + /// + /// The column sensitivity label resource. + /// /// /// The cancellation token. /// - public static async Task DisableRecommendationAsync(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabel parameters, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DisableRecommendationWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Gets the sensitivity label of a given column + /// Deletes the sensitivity label of a given column /// /// /// The operations group for this extension method. @@ -350,17 +368,13 @@ public static void DisableRecommendation(this ISensitivityLabelsOperations opera /// /// The name of the column. /// - /// - /// The source of the sensitivity label. Possible values include: 'current', - /// 'recommended' - /// - public static SensitivityLabel Get(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource) + public static void Delete(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName) { - return operations.GetAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, sensitivityLabelSource).GetAwaiter().GetResult(); + operations.DeleteAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName).GetAwaiter().GetResult(); } /// - /// Gets the sensitivity label of a given column + /// Deletes the sensitivity label of a given column /// /// /// The operations group for this extension method. @@ -384,23 +398,16 @@ public static SensitivityLabel Get(this ISensitivityLabelsOperations operations, /// /// The name of the column. /// - /// - /// The source of the sensitivity label. Possible values include: 'current', - /// 'recommended' - /// /// /// The cancellation token. /// - public static async Task GetAsync(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteAsync(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, sensitivityLabelSource, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Creates or updates the sensitivity label of a given column + /// Disables sensitivity recommendations on a given column /// /// /// The operations group for this extension method. @@ -424,16 +431,13 @@ public static SensitivityLabel Get(this ISensitivityLabelsOperations operations, /// /// The name of the column. /// - /// - /// The column sensitivity label resource. - /// - public static SensitivityLabel CreateOrUpdate(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabel parameters) + public static void DisableRecommendation(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName) { - return operations.CreateOrUpdateAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, parameters).GetAwaiter().GetResult(); + operations.DisableRecommendationAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName).GetAwaiter().GetResult(); } /// - /// Creates or updates the sensitivity label of a given column + /// Disables sensitivity recommendations on a given column /// /// /// The operations group for this extension method. @@ -457,22 +461,17 @@ public static SensitivityLabel CreateOrUpdate(this ISensitivityLabelsOperations /// /// The name of the column. /// - /// - /// The column sensitivity label resource. - /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabel parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DisableRecommendationAsync(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + (await operations.DisableRecommendationWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Deletes the sensitivity label of a given column + /// Enables sensitivity recommendations on a given column (recommendations are + /// enabled by default on all columns) /// /// /// The operations group for this extension method. @@ -496,13 +495,14 @@ public static SensitivityLabel CreateOrUpdate(this ISensitivityLabelsOperations /// /// The name of the column. /// - public static void Delete(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName) + public static void EnableRecommendation(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName) { - operations.DeleteAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName).GetAwaiter().GetResult(); + operations.EnableRecommendationAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName).GetAwaiter().GetResult(); } /// - /// Deletes the sensitivity label of a given column + /// Enables sensitivity recommendations on a given column (recommendations are + /// enabled by default on all columns) /// /// /// The operations group for this extension method. @@ -529,9 +529,63 @@ public static void Delete(this ISensitivityLabelsOperations operations, string r /// /// The cancellation token. /// - public static async Task DeleteAsync(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task EnableRecommendationAsync(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.EnableRecommendationWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets the sensitivity labels of a given 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. + /// + /// + /// OData parameters to apply to the operation. + /// + public static IPage ListByDatabase(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, ODataQuery odataQuery = default(ODataQuery)) + { + return operations.ListByDatabaseAsync(resourceGroupName, serverName, databaseName, odataQuery).GetAwaiter().GetResult(); + } + + /// + /// Gets the sensitivity labels of a given 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. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByDatabaseAsync(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByDatabaseWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, odataQuery, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// @@ -602,5 +656,39 @@ public static IPage ListRecommendedByDatabaseNext(this ISensit } } + /// + /// Gets the sensitivity labels of a given database + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByDatabaseNext(this ISensitivityLabelsOperations operations, string nextPageLink) + { + return operations.ListByDatabaseNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the sensitivity labels of a given database + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByDatabaseNextAsync(this ISensitivityLabelsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByDatabaseNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } } diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ServerTrustCertificatesOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ServerTrustCertificatesOperations.cs index e495c28d80ea..5b11e2c1bdc4 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ServerTrustCertificatesOperations.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ServerTrustCertificatesOperations.cs @@ -51,8 +51,8 @@ internal ServerTrustCertificatesOperations(SqlManagementClient client) public SqlManagementClient Client { get; private set; } /// - /// Gets a server trust certificate that was uploaded from box to Sql Managed - /// Instance. + /// Gets a list of server trust certificates that were uploaded from box to the + /// given Sql Managed Instance. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -61,9 +61,6 @@ internal ServerTrustCertificatesOperations(SqlManagementClient client) /// /// The name of the managed instance. /// - /// - /// Name of of the certificate to get. - /// /// /// Headers that will be added to request. /// @@ -85,7 +82,7 @@ internal ServerTrustCertificatesOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string certificateName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByInstanceWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -95,15 +92,11 @@ internal ServerTrustCertificatesOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "managedInstanceName"); } - if (certificateName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "certificateName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-05-01-preview"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -113,17 +106,15 @@ internal ServerTrustCertificatesOperations(SqlManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("managedInstanceName", managedInstanceName); - tracingParameters.Add("certificateName", certificateName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByInstance", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{managedInstanceName}", System.Uri.EscapeDataString(managedInstanceName)); - _url = _url.Replace("{certificateName}", System.Uri.EscapeDataString(certificateName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -223,7 +214,7 @@ internal ServerTrustCertificatesOperations(SqlManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -236,7 +227,7 @@ internal ServerTrustCertificatesOperations(SqlManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -256,37 +247,8 @@ internal ServerTrustCertificatesOperations(SqlManagementClient client) } /// - /// Uploads a server trust certificate from box to Sql Managed Instance. - /// - /// - /// The name of the resource group that contains the resource. You can obtain - /// this value from the Azure Resource Manager API or the portal. - /// - /// - /// The name of the managed instance. - /// - /// - /// Name of of the certificate to upload. - /// - /// - /// The server trust certificate info. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string certificateName, ServerTrustCertificate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, managedInstanceName, certificateName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes a server trust certificate that was uploaded from box to Sql - /// Managed Instance. + /// Gets a server trust certificate that was uploaded from box to Sql Managed + /// Instance. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -296,32 +258,7 @@ internal ServerTrustCertificatesOperations(SqlManagementClient client) /// The name of the managed instance. /// /// - /// Name of of the certificate to delete. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string certificateName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, managedInstanceName, certificateName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets a list of the server trust certificates which are used for secure - /// communication between SQL On-Prem instance and the given Sql Managed - /// Instance - /// - /// - /// The name of the resource group that contains the resource. You can obtain - /// this value from the Azure Resource Manager API or the portal. - /// - /// - /// The name of the managed instance. + /// Name of of the certificate to get. /// /// /// Headers that will be added to request. @@ -344,7 +281,7 @@ internal ServerTrustCertificatesOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByInstanceWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string certificateName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -354,11 +291,15 @@ internal ServerTrustCertificatesOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "managedInstanceName"); } + if (certificateName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "certificateName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-05-01-preview"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -368,15 +309,17 @@ internal ServerTrustCertificatesOperations(SqlManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("managedInstanceName", managedInstanceName); + tracingParameters.Add("certificateName", certificateName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByInstance", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{managedInstanceName}", System.Uri.EscapeDataString(managedInstanceName)); + _url = _url.Replace("{certificateName}", System.Uri.EscapeDataString(certificateName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -476,7 +419,7 @@ internal ServerTrustCertificatesOperations(SqlManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -489,7 +432,7 @@ internal ServerTrustCertificatesOperations(SqlManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -508,6 +451,62 @@ internal ServerTrustCertificatesOperations(SqlManagementClient client) return _result; } + /// + /// Uploads a server trust certificate from box to Sql Managed Instance. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// Name of of the certificate to upload. + /// + /// + /// The server trust certificate info. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string certificateName, ServerTrustCertificate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, managedInstanceName, certificateName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes a server trust certificate that was uploaded from box to Sql + /// Managed Instance. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// Name of of the certificate to delete. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string certificateName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, managedInstanceName, certificateName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + /// /// Uploads a server trust certificate from box to Sql Managed Instance. /// @@ -567,7 +566,7 @@ internal ServerTrustCertificatesOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-05-01-preview"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -794,7 +793,7 @@ internal ServerTrustCertificatesOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-05-01-preview"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -929,9 +928,8 @@ internal ServerTrustCertificatesOperations(SqlManagementClient client) } /// - /// Gets a list of the server trust certificates which are used for secure - /// communication between SQL On-Prem instance and the given Sql Managed - /// Instance + /// Gets a list of server trust certificates that were uploaded from box to the + /// given Sql Managed Instance. /// /// /// The NextLink from the previous successful call to List operation. diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ServerTrustCertificatesOperationsExtensions.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ServerTrustCertificatesOperationsExtensions.cs index 5f584ce5976d..dec7ad431d81 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ServerTrustCertificatesOperationsExtensions.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ServerTrustCertificatesOperationsExtensions.cs @@ -21,6 +21,50 @@ namespace Microsoft.Azure.Management.Sql /// public static partial class ServerTrustCertificatesOperationsExtensions { + /// + /// Gets a list of server trust certificates that were uploaded from box to the + /// given Sql Managed Instance. + /// + /// + /// 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 managed instance. + /// + public static IPage ListByInstance(this IServerTrustCertificatesOperations operations, string resourceGroupName, string managedInstanceName) + { + return operations.ListByInstanceAsync(resourceGroupName, managedInstanceName).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of server trust certificates that were uploaded from box to the + /// given Sql Managed Instance. + /// + /// + /// 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 managed instance. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByInstanceAsync(this IServerTrustCertificatesOperations operations, string resourceGroupName, string managedInstanceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByInstanceWithHttpMessagesAsync(resourceGroupName, managedInstanceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Gets a server trust certificate that was uploaded from box to Sql Managed /// Instance. @@ -172,52 +216,6 @@ public static void Delete(this IServerTrustCertificatesOperations operations, st (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, managedInstanceName, certificateName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } - /// - /// Gets a list of the server trust certificates which are used for secure - /// communication between SQL On-Prem instance and the given Sql Managed - /// Instance - /// - /// - /// 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 managed instance. - /// - public static IPage ListByInstance(this IServerTrustCertificatesOperations operations, string resourceGroupName, string managedInstanceName) - { - return operations.ListByInstanceAsync(resourceGroupName, managedInstanceName).GetAwaiter().GetResult(); - } - - /// - /// Gets a list of the server trust certificates which are used for secure - /// communication between SQL On-Prem instance and the given Sql Managed - /// Instance - /// - /// - /// 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 managed instance. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByInstanceAsync(this IServerTrustCertificatesOperations operations, string resourceGroupName, string managedInstanceName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByInstanceWithHttpMessagesAsync(resourceGroupName, managedInstanceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Uploads a server trust certificate from box to Sql Managed Instance. /// @@ -320,9 +318,8 @@ public static void BeginDelete(this IServerTrustCertificatesOperations operation } /// - /// Gets a list of the server trust certificates which are used for secure - /// communication between SQL On-Prem instance and the given Sql Managed - /// Instance + /// Gets a list of server trust certificates that were uploaded from box to the + /// given Sql Managed Instance. /// /// /// The operations group for this extension method. @@ -336,9 +333,8 @@ public static IPage ListByInstanceNext(this IServerTrust } /// - /// Gets a list of the server trust certificates which are used for secure - /// communication between SQL On-Prem instance and the given Sql Managed - /// Instance + /// Gets a list of server trust certificates that were uploaded from box to the + /// given Sql Managed Instance. /// /// /// The operations group for this extension method. diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SqlManagementClient.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SqlManagementClient.cs index bcc439ccb95d..c1831da0674c 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SqlManagementClient.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SqlManagementClient.cs @@ -102,11 +102,6 @@ public partial class SqlManagementClient : ServiceClient, I /// public virtual IElasticPoolsOperations ElasticPools { get; private set; } - /// - /// Gets the IReplicationLinksOperations. - /// - public virtual IReplicationLinksOperations ReplicationLinks { get; private set; } - /// /// Gets the IServerCommunicationLinksOperations. /// @@ -347,16 +342,6 @@ public partial class SqlManagementClient : ServiceClient, I /// public virtual IManagedDatabaseSecurityEventsOperations ManagedDatabaseSecurityEvents { get; private set; } - /// - /// Gets the IManagedDatabaseSensitivityLabelsOperations. - /// - public virtual IManagedDatabaseSensitivityLabelsOperations ManagedDatabaseSensitivityLabels { get; private set; } - - /// - /// Gets the IManagedDatabaseRecommendedSensitivityLabelsOperations. - /// - public virtual IManagedDatabaseRecommendedSensitivityLabelsOperations ManagedDatabaseRecommendedSensitivityLabels { get; private set; } - /// /// Gets the IManagedDatabaseTablesOperations. /// @@ -467,16 +452,6 @@ public partial class SqlManagementClient : ServiceClient, I /// public virtual IRestorePointsOperations RestorePoints { get; private set; } - /// - /// Gets the ISensitivityLabelsOperations. - /// - public virtual ISensitivityLabelsOperations SensitivityLabels { get; private set; } - - /// - /// Gets the IRecommendedSensitivityLabelsOperations. - /// - public virtual IRecommendedSensitivityLabelsOperations RecommendedSensitivityLabels { get; private set; } - /// /// Gets the IServerAdvisorsOperations. /// @@ -677,6 +652,41 @@ public partial class SqlManagementClient : ServiceClient, I /// public virtual IIPv6FirewallRulesOperations IPv6FirewallRules { get; private set; } + /// + /// Gets the IReplicationLinksOperations. + /// + public virtual IReplicationLinksOperations ReplicationLinks { get; private set; } + + /// + /// Gets the IManagedDatabaseSensitivityLabelsOperations. + /// + public virtual IManagedDatabaseSensitivityLabelsOperations ManagedDatabaseSensitivityLabels { get; private set; } + + /// + /// Gets the IManagedDatabaseRecommendedSensitivityLabelsOperations. + /// + public virtual IManagedDatabaseRecommendedSensitivityLabelsOperations ManagedDatabaseRecommendedSensitivityLabels { get; private set; } + + /// + /// Gets the IManagedServerDnsAliasesOperations. + /// + public virtual IManagedServerDnsAliasesOperations ManagedServerDnsAliases { get; private set; } + + /// + /// Gets the ISensitivityLabelsOperations. + /// + public virtual ISensitivityLabelsOperations SensitivityLabels { get; private set; } + + /// + /// Gets the IRecommendedSensitivityLabelsOperations. + /// + public virtual IRecommendedSensitivityLabelsOperations RecommendedSensitivityLabels { get; private set; } + + /// + /// Gets the IEndpointCertificatesOperations. + /// + public virtual IEndpointCertificatesOperations EndpointCertificates { get; private set; } + /// /// Initializes a new instance of the SqlManagementClient class. /// @@ -924,7 +934,6 @@ private void Initialize() GeoBackupPolicies = new GeoBackupPoliciesOperations(this); Databases = new DatabasesOperations(this); ElasticPools = new ElasticPoolsOperations(this); - ReplicationLinks = new ReplicationLinksOperations(this); ServerCommunicationLinks = new ServerCommunicationLinksOperations(this); ServiceObjectives = new ServiceObjectivesOperations(this); ElasticPoolActivities = new ElasticPoolActivitiesOperations(this); @@ -973,8 +982,6 @@ private void Initialize() ManagedDatabaseSchemas = new ManagedDatabaseSchemasOperations(this); ManagedDatabaseSecurityAlertPolicies = new ManagedDatabaseSecurityAlertPoliciesOperations(this); ManagedDatabaseSecurityEvents = new ManagedDatabaseSecurityEventsOperations(this); - ManagedDatabaseSensitivityLabels = new ManagedDatabaseSensitivityLabelsOperations(this); - ManagedDatabaseRecommendedSensitivityLabels = new ManagedDatabaseRecommendedSensitivityLabelsOperations(this); ManagedDatabaseTables = new ManagedDatabaseTablesOperations(this); ManagedDatabaseTransparentDataEncryption = new ManagedDatabaseTransparentDataEncryptionOperations(this); ManagedDatabaseVulnerabilityAssessmentRuleBaselines = new ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations(this); @@ -997,8 +1004,6 @@ private void Initialize() PrivateLinkResources = new PrivateLinkResourcesOperations(this); RecoverableManagedDatabases = new RecoverableManagedDatabasesOperations(this); RestorePoints = new RestorePointsOperations(this); - SensitivityLabels = new SensitivityLabelsOperations(this); - RecommendedSensitivityLabels = new RecommendedSensitivityLabelsOperations(this); ServerAdvisors = new ServerAdvisorsOperations(this); ServerAutomaticTuning = new ServerAutomaticTuningOperations(this); ServerAzureADAdministrators = new ServerAzureADAdministratorsOperations(this); @@ -1039,6 +1044,13 @@ private void Initialize() DistributedAvailabilityGroups = new DistributedAvailabilityGroupsOperations(this); ServerTrustCertificates = new ServerTrustCertificatesOperations(this); IPv6FirewallRules = new IPv6FirewallRulesOperations(this); + ReplicationLinks = new ReplicationLinksOperations(this); + ManagedDatabaseSensitivityLabels = new ManagedDatabaseSensitivityLabelsOperations(this); + ManagedDatabaseRecommendedSensitivityLabels = new ManagedDatabaseRecommendedSensitivityLabelsOperations(this); + ManagedServerDnsAliases = new ManagedServerDnsAliasesOperations(this); + SensitivityLabels = new SensitivityLabelsOperations(this); + RecommendedSensitivityLabels = new RecommendedSensitivityLabelsOperations(this); + EndpointCertificates = new EndpointCertificatesOperations(this); BaseUri = new System.Uri("https://management.azure.com"); AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; From 7bdea852f09a4d2653f0e4b53a236f5e2f703e6a Mon Sep 17 00:00:00 2001 From: Bogdan Ostojic Date: Mon, 4 Apr 2022 12:36:59 +0200 Subject: [PATCH 02/10] Add tests --- .../tests/ManagedInstanceHybridLinkTests.cs | 64 +- .../TestDistributedAvailabilityGroup.json | 410 ++++----- .../TestEndpointCertificates.json | 639 ++++++++++++++ .../TestServerTrustCertificates.json | 825 +++++++++++------- 4 files changed, 1404 insertions(+), 534 deletions(-) create mode 100644 sdk/sqlmanagement/Microsoft.Azure.Management.Sql/tests/SessionRecords/ManagedInstanceHybridLinkTests/TestEndpointCertificates.json diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/tests/ManagedInstanceHybridLinkTests.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/tests/ManagedInstanceHybridLinkTests.cs index 4c18ebfe25d9..2009cdd4f4dc 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/tests/ManagedInstanceHybridLinkTests.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/tests/ManagedInstanceHybridLinkTests.cs @@ -9,6 +9,7 @@ using Microsoft.Rest.ClientRuntime.Azure.TestFramework; using System; using System.Linq; +using System.Text.RegularExpressions; using Xunit; namespace Sql.Tests @@ -65,6 +66,11 @@ public class ManagedInstanceHybridLinkTests return managedInstanceId + "/serverTrustCertificates/" + certificateName; }; + private const string endpointTypeDatabaseMirroring = "DATABASE_MIRRORING"; + private const string endpointTypeServiceBroker = "SERVICE_BROKER"; + private const string endpointCertType = "Microsoft.Sql/managedInstances/endpointCertificates"; + private static readonly Func makeEndpointCertID = (managedInstanceId, endpointType) => { return managedInstanceId + "/endpointCertificates/" + endpointType; }; + [Fact] public void TestServerTrustCertificates() { @@ -131,8 +137,8 @@ public void TestServerTrustCertificates() Assert.Contains("MissingPublicBlob", exception4.Body.Code); Assert.Contains("MethodNotAllowed", exception6.Body.Code); - sqlClient.ServerTrustCertificates.BeginDelete(resourceGroupName, managedInstanceName, certificateName1); - sqlClient.ServerTrustCertificates.BeginDelete(resourceGroupName, managedInstanceName, certificateName2); + sqlClient.ServerTrustCertificates.Delete(resourceGroupName, managedInstanceName, certificateName1); + sqlClient.ServerTrustCertificates.Delete(resourceGroupName, managedInstanceName, certificateName2); } } @@ -226,5 +232,59 @@ public void TestDistributedAvailabilityGroup() Assert.Equal("ResourceNotFound", exceptionGet.Body.Code); } } + + + [Fact] + public void TestEndpointCertificates() + { + string suiteName = this.GetType().Name; + using (SqlManagementTestContext context = new SqlManagementTestContext(this)) + { + // Test setup (rg, mi): + SqlManagementClient sqlClient = context.GetClient(); + //ResourceGroup rg = new ResourceGroup(location: "eastus2euap", id: "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/CustomerExperienceTeam_RG", name: "CustomerExperienceTeam_RG"); + //ManagedInstance managedInstance = sqlClient.ManagedInstances.Get(rg.Name, "chimera-ps-cli-v2"); + ResourceGroup rg = context.CreateResourceGroup(ManagedInstanceTestUtilities.Region); + ManagedInstance managedInstance = context.CreateManagedInstance(rg); + Assert.NotNull(managedInstance); + + var resourceGroupName = rg.Name; + var managedInstanceName = managedInstance.Name; + + var exceptionGet = Assert.Throws(() => sqlClient.EndpointCertificates.Get(resourceGroupName, managedInstanceName, "invalid_endpoint_type")); + Assert.Equal("ResourceNotFound", exceptionGet.Body.Code); + + var certServiceBroker = sqlClient.EndpointCertificates.Get(resourceGroupName, managedInstanceName, endpointTypeServiceBroker); + Assert.NotNull(certServiceBroker); + Assert.NotNull(certServiceBroker.PublicBlob); + Assert.True(Regex.Match(certServiceBroker.PublicBlob, @"^[0-9a-fA-F]+$").Success); + Assert.Equal(endpointTypeServiceBroker, certServiceBroker.Name); + Assert.Equal(makeEndpointCertID(managedInstance.Id, endpointTypeServiceBroker), certServiceBroker.Id); + Assert.Equal(endpointCertType, certServiceBroker.Type); + + var certDatabaseMirroring = sqlClient.EndpointCertificates.Get(resourceGroupName, managedInstanceName, endpointTypeDatabaseMirroring); + Assert.NotNull(certDatabaseMirroring); + Assert.NotNull(certDatabaseMirroring.PublicBlob); + Assert.True(Regex.Match(certDatabaseMirroring.PublicBlob, @"^[0-9a-fA-F]+$").Success); + Assert.Equal(endpointTypeDatabaseMirroring, certDatabaseMirroring.Name); + Assert.Equal(makeEndpointCertID(managedInstance.Id, endpointTypeDatabaseMirroring), certDatabaseMirroring.Id); + Assert.Equal(endpointCertType, certDatabaseMirroring.Type); + + var certList = sqlClient.EndpointCertificates.ListByInstance(resourceGroupName, managedInstanceName); + Assert.NotNull(certList); + var listCertDBM = certList.Where(cert => cert.Name.Equals(endpointTypeDatabaseMirroring)).FirstOrDefault(); + var listCertSB = certList.Where(cert => cert.Name.Equals(endpointTypeServiceBroker)).FirstOrDefault(); + Assert.NotNull(listCertDBM.PublicBlob); + Assert.True(Regex.Match(listCertDBM.PublicBlob, @"^[0-9a-fA-F]+$").Success); + Assert.Equal(endpointTypeDatabaseMirroring, listCertDBM.Name); + Assert.Equal(makeEndpointCertID(managedInstance.Id, endpointTypeDatabaseMirroring), listCertDBM.Id); + Assert.Equal(endpointCertType, listCertDBM.Type); + Assert.NotNull(listCertSB.PublicBlob); + Assert.True(Regex.Match(listCertSB.PublicBlob, @"^[0-9a-fA-F]+$").Success); + Assert.Equal(endpointTypeServiceBroker, listCertSB.Name); + Assert.Equal(makeEndpointCertID(managedInstance.Id, endpointTypeServiceBroker), listCertSB.Id); + Assert.Equal(endpointCertType, listCertSB.Type); + } + } } } diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/tests/SessionRecords/ManagedInstanceHybridLinkTests/TestDistributedAvailabilityGroup.json b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/tests/SessionRecords/ManagedInstanceHybridLinkTests/TestDistributedAvailabilityGroup.json index b0cf11addae5..2f3ffdb332bc 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/tests/SessionRecords/ManagedInstanceHybridLinkTests/TestDistributedAvailabilityGroup.json +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/tests/SessionRecords/ManagedInstanceHybridLinkTests/TestDistributedAvailabilityGroup.json @@ -1,19 +1,19 @@ { "Entries": [ { - "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourcegroups/sqlcrudtest-8136?api-version=2017-05-10", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlZ3JvdXBzL3NxbGNydWR0ZXN0LTgxMzY/YXBpLXZlcnNpb249MjAxNy0wNS0xMA==", + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourcegroups/sqlcrudtest-9564?api-version=2017-05-10", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlZ3JvdXBzL3NxbGNydWR0ZXN0LTk1NjQ/YXBpLXZlcnNpb249MjAxNy0wNS0xMA==", "RequestMethod": "PUT", - "RequestBody": "{\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"sqlcrudtest-8136\": \"2022-02-23 13:01:41Z\"\r\n }\r\n}", + "RequestBody": "{\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"sqlcrudtest-9564\": \"2022-04-03 12:04:16Z\"\r\n }\r\n}", "RequestHeaders": { "x-ms-client-request-id": [ - "05812a8c-f643-42ae-ac14-2b20e623ad54" + "6a638cc9-05f7-4d64-9bfc-dbdc6306dc54" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.21.56803", + "FxVersion/4.700.22.11601", "OSName/Windows", "OSVersion/Microsoft.Windows.10.0.17763", "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.6.0.0" @@ -36,13 +36,13 @@ "1199" ], "x-ms-request-id": [ - "61e6356a-e984-44e2-b5c3-95c0be5a73bb" + "90559999-8bc5-43f8-a3f8-67f22593979f" ], "x-ms-correlation-request-id": [ - "61e6356a-e984-44e2-b5c3-95c0be5a73bb" + "90559999-8bc5-43f8-a3f8-67f22593979f" ], "x-ms-routing-request-id": [ - "UKSOUTH:20220223T130144Z:61e6356a-e984-44e2-b5c3-95c0be5a73bb" + "UKSOUTH:20220403T120419Z:90559999-8bc5-43f8-a3f8-67f22593979f" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -51,7 +51,7 @@ "nosniff" ], "Date": [ - "Wed, 23 Feb 2022 13:01:43 GMT" + "Sun, 03 Apr 2022 12:04:19 GMT" ], "Content-Length": [ "243" @@ -63,26 +63,26 @@ "-1" ] }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-8136\",\r\n \"name\": \"sqlcrudtest-8136\",\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"sqlcrudtest-8136\": \"2022-02-23 13:01:41Z\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseBody": "{\r\n \"id\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-9564\",\r\n \"name\": \"sqlcrudtest-9564\",\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"sqlcrudtest-9564\": \"2022-04-03 12:04:16Z\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", "StatusCode": 201 }, { - "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-8136/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-7225?api-version=2021-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTgxMzYvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNzIyNT9hcGktdmVyc2lvbj0yMDIxLTA1LTAxLXByZXZpZXc=", + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-9564/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-5501?api-version=2021-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTk1NjQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNTUwMT9hcGktdmVyc2lvbj0yMDIxLTA1LTAxLXByZXZpZXc=", "RequestMethod": "PUT", - "RequestBody": "{\r\n \"properties\": {\r\n \"administratorLogin\": \"dummylogin\",\r\n \"administratorLoginPassword\": \"966c486b-b2fd-42f8-bfb1-5f190b4fb09d\",\r\n \"subnetId\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/CustomerExperienceTeam_RG/providers/Microsoft.Network/virtualNetworks/vnet-mi-tooling/subnets/ManagedInstance\",\r\n \"vCores\": 4,\r\n \"storageSizeInGB\": 32,\r\n \"requestedBackupStorageRedundancy\": \"Geo\"\r\n },\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"test\": \"azure-sdk-for-net\"\r\n }\r\n}", + "RequestBody": "{\r\n \"properties\": {\r\n \"administratorLogin\": \"dummylogin\",\r\n \"administratorLoginPassword\": \"cde98dac-c1b5-4087-8a2f-3fac4c43b6e8\",\r\n \"subnetId\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/CustomerExperienceTeam_RG/providers/Microsoft.Network/virtualNetworks/vnet-mi-tooling/subnets/ManagedInstance\",\r\n \"vCores\": 4,\r\n \"storageSizeInGB\": 32,\r\n \"requestedBackupStorageRedundancy\": \"Geo\"\r\n },\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"test\": \"azure-sdk-for-net\"\r\n }\r\n}", "RequestHeaders": { "x-ms-client-request-id": [ - "4b05a6dd-adf9-44c5-9750-a2932ce8a4f1" + "dd5b5dde-04ad-49c3-8ad0-4a5ad4acb768" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.21.56803", + "FxVersion/4.700.22.11601", "OSName/Windows", "OSVersion/Microsoft.Windows.10.0.17763", - "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.0.0" + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" ], "Content-Type": [ "application/json; charset=utf-8" @@ -102,7 +102,7 @@ "60" ], "x-ms-request-id": [ - "4b4f2d48-b725-4ca1-a5b0-4e02fc0ee9b3" + "e135db58-8f74-426d-914e-7714749976b1" ], "Server": [ "Microsoft-HTTPAPI/2.0" @@ -111,10 +111,10 @@ "1199" ], "x-ms-correlation-request-id": [ - "446ef44a-7285-4152-a6f6-0323878ce702" + "52d93d95-ad63-4c8d-852d-dbc09042c4be" ], "x-ms-routing-request-id": [ - "UKSOUTH:20220223T130152Z:446ef44a-7285-4152-a6f6-0323878ce702" + "UKSOUTH:20220403T120427Z:52d93d95-ad63-4c8d-852d-dbc09042c4be" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -123,7 +123,7 @@ "nosniff" ], "Date": [ - "Wed, 23 Feb 2022 13:01:52 GMT" + "Sun, 03 Apr 2022 12:04:26 GMT" ], "Content-Length": [ "761" @@ -135,20 +135,20 @@ "-1" ] }, - "ResponseBody": "{\r\n \"identity\": {\r\n \"type\": \"None\"\r\n },\r\n \"sku\": {\r\n \"name\": \"GP_Gen5\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen5\",\r\n \"capacity\": 4\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Creating\",\r\n \"administratorLogin\": \"dummylogin\",\r\n \"licenseType\": \"LicenseIncluded\",\r\n \"vCores\": 4,\r\n \"storageSizeInGB\": 32,\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"timezoneId\": \"UTC\",\r\n \"maintenanceConfigurationId\": \"SystemDefault\",\r\n \"privateEndpointConnections\": [],\r\n \"currentBackupStorageRedundancy\": \"Geo\",\r\n \"requestedBackupStorageRedundancy\": \"Geo\"\r\n },\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"test\": \"azure-sdk-for-net\"\r\n },\r\n \"id\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-8136/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-7225\",\r\n \"name\": \"net-sdk-crud-tests-7225\",\r\n \"type\": \"Microsoft.Sql/managedInstances\"\r\n}", + "ResponseBody": "{\r\n \"identity\": {\r\n \"type\": \"None\"\r\n },\r\n \"sku\": {\r\n \"name\": \"GP_Gen5\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen5\",\r\n \"capacity\": 4\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Creating\",\r\n \"administratorLogin\": \"dummylogin\",\r\n \"licenseType\": \"LicenseIncluded\",\r\n \"vCores\": 4,\r\n \"storageSizeInGB\": 32,\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"timezoneId\": \"UTC\",\r\n \"maintenanceConfigurationId\": \"SystemDefault\",\r\n \"privateEndpointConnections\": [],\r\n \"currentBackupStorageRedundancy\": \"Geo\",\r\n \"requestedBackupStorageRedundancy\": \"Geo\"\r\n },\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"test\": \"azure-sdk-for-net\"\r\n },\r\n \"id\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-9564/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-5501\",\r\n \"name\": \"net-sdk-crud-tests-5501\",\r\n \"type\": \"Microsoft.Sql/managedInstances\"\r\n}", "StatusCode": 201 }, { - "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-8136/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-7225?api-version=2021-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTgxMzYvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNzIyNT9hcGktdmVyc2lvbj0yMDIxLTA1LTAxLXByZXZpZXc=", + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-9564/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-5501?api-version=2021-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTk1NjQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNTUwMT9hcGktdmVyc2lvbj0yMDIxLTA1LTAxLXByZXZpZXc=", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "User-Agent": [ - "FxVersion/4.700.21.56803", + "FxVersion/4.700.22.11601", "OSName/Windows", "OSVersion/Microsoft.Windows.10.0.17763", - "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.0.0" + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" ] }, "ResponseHeaders": { @@ -159,7 +159,7 @@ "no-cache" ], "x-ms-request-id": [ - "ecfc0f6b-6b88-4af0-8b0a-f0afb45e5488" + "963c445b-b256-4ba8-935c-8f375d481494" ], "Server": [ "Microsoft-HTTPAPI/2.0" @@ -168,10 +168,10 @@ "11999" ], "x-ms-correlation-request-id": [ - "ad59a4f2-2c77-42d6-aad7-fbfb729938f6" + "f2be95da-63f1-44a3-8567-7fa06b5b7204" ], "x-ms-routing-request-id": [ - "UKSOUTH:20220223T130252Z:ad59a4f2-2c77-42d6-aad7-fbfb729938f6" + "UKSOUTH:20220403T120528Z:f2be95da-63f1-44a3-8567-7fa06b5b7204" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -180,7 +180,7 @@ "nosniff" ], "Date": [ - "Wed, 23 Feb 2022 13:02:52 GMT" + "Sun, 03 Apr 2022 12:05:27 GMT" ], "Content-Length": [ "1225" @@ -192,20 +192,20 @@ "-1" ] }, - "ResponseBody": "{\r\n \"sku\": {\r\n \"name\": \"GP_Gen5\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen5\",\r\n \"capacity\": 4\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Creating\",\r\n \"fullyQualifiedDomainName\": \"net-sdk-crud-tests-7225.1e6d90da5016.database.windows.net\",\r\n \"administratorLogin\": \"dummylogin\",\r\n \"subnetId\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/CustomerExperienceTeam_RG/providers/Microsoft.Network/virtualNetworks/vnet-mi-tooling/subnets/ManagedInstance\",\r\n \"state\": \"Creating\",\r\n \"licenseType\": \"LicenseIncluded\",\r\n \"vCores\": 4,\r\n \"storageSizeInGB\": 32,\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"dnsZone\": \"1e6d90da5016\",\r\n \"publicDataEndpointEnabled\": false,\r\n \"timezoneId\": \"UTC\",\r\n \"maintenanceConfigurationId\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default\",\r\n \"privateEndpointConnections\": [],\r\n \"currentBackupStorageRedundancy\": \"Geo\",\r\n \"requestedBackupStorageRedundancy\": \"Geo\",\r\n \"zoneRedundant\": false\r\n },\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"test\": \"azure-sdk-for-net\"\r\n },\r\n \"id\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-8136/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-7225\",\r\n \"name\": \"net-sdk-crud-tests-7225\",\r\n \"type\": \"Microsoft.Sql/managedInstances\"\r\n}", + "ResponseBody": "{\r\n \"sku\": {\r\n \"name\": \"GP_Gen5\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen5\",\r\n \"capacity\": 4\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Creating\",\r\n \"fullyQualifiedDomainName\": \"net-sdk-crud-tests-5501.1e6d90da5016.database.windows.net\",\r\n \"administratorLogin\": \"dummylogin\",\r\n \"subnetId\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/CustomerExperienceTeam_RG/providers/Microsoft.Network/virtualNetworks/vnet-mi-tooling/subnets/ManagedInstance\",\r\n \"state\": \"Creating\",\r\n \"licenseType\": \"LicenseIncluded\",\r\n \"vCores\": 4,\r\n \"storageSizeInGB\": 32,\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"dnsZone\": \"1e6d90da5016\",\r\n \"publicDataEndpointEnabled\": false,\r\n \"timezoneId\": \"UTC\",\r\n \"maintenanceConfigurationId\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default\",\r\n \"privateEndpointConnections\": [],\r\n \"currentBackupStorageRedundancy\": \"Geo\",\r\n \"requestedBackupStorageRedundancy\": \"Geo\",\r\n \"zoneRedundant\": false\r\n },\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"test\": \"azure-sdk-for-net\"\r\n },\r\n \"id\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-9564/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-5501\",\r\n \"name\": \"net-sdk-crud-tests-5501\",\r\n \"type\": \"Microsoft.Sql/managedInstances\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-8136/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-7225?api-version=2021-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTgxMzYvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNzIyNT9hcGktdmVyc2lvbj0yMDIxLTA1LTAxLXByZXZpZXc=", + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-9564/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-5501?api-version=2021-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTk1NjQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNTUwMT9hcGktdmVyc2lvbj0yMDIxLTA1LTAxLXByZXZpZXc=", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "User-Agent": [ - "FxVersion/4.700.21.56803", + "FxVersion/4.700.22.11601", "OSName/Windows", "OSVersion/Microsoft.Windows.10.0.17763", - "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.0.0" + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" ] }, "ResponseHeaders": { @@ -216,7 +216,7 @@ "no-cache" ], "x-ms-request-id": [ - "7b76b9d1-20f5-4e96-a6b9-5d2e9e63172e" + "e53eb0c7-0c37-4fc8-9880-c7b6c4b7f89f" ], "Server": [ "Microsoft-HTTPAPI/2.0" @@ -225,10 +225,10 @@ "11998" ], "x-ms-correlation-request-id": [ - "894bdaf6-1b11-4eea-9d89-e46670a02938" + "83b8569e-31f3-4824-8ba6-9dd8b5f43463" ], "x-ms-routing-request-id": [ - "UKSOUTH:20220223T130353Z:894bdaf6-1b11-4eea-9d89-e46670a02938" + "UKSOUTH:20220403T120628Z:83b8569e-31f3-4824-8ba6-9dd8b5f43463" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -237,7 +237,7 @@ "nosniff" ], "Date": [ - "Wed, 23 Feb 2022 13:03:52 GMT" + "Sun, 03 Apr 2022 12:06:28 GMT" ], "Content-Length": [ "1225" @@ -249,20 +249,20 @@ "-1" ] }, - "ResponseBody": "{\r\n \"sku\": {\r\n \"name\": \"GP_Gen5\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen5\",\r\n \"capacity\": 4\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Creating\",\r\n \"fullyQualifiedDomainName\": \"net-sdk-crud-tests-7225.1e6d90da5016.database.windows.net\",\r\n \"administratorLogin\": \"dummylogin\",\r\n \"subnetId\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/CustomerExperienceTeam_RG/providers/Microsoft.Network/virtualNetworks/vnet-mi-tooling/subnets/ManagedInstance\",\r\n \"state\": \"Creating\",\r\n \"licenseType\": \"LicenseIncluded\",\r\n \"vCores\": 4,\r\n \"storageSizeInGB\": 32,\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"dnsZone\": \"1e6d90da5016\",\r\n \"publicDataEndpointEnabled\": false,\r\n \"timezoneId\": \"UTC\",\r\n \"maintenanceConfigurationId\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default\",\r\n \"privateEndpointConnections\": [],\r\n \"currentBackupStorageRedundancy\": \"Geo\",\r\n \"requestedBackupStorageRedundancy\": \"Geo\",\r\n \"zoneRedundant\": false\r\n },\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"test\": \"azure-sdk-for-net\"\r\n },\r\n \"id\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-8136/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-7225\",\r\n \"name\": \"net-sdk-crud-tests-7225\",\r\n \"type\": \"Microsoft.Sql/managedInstances\"\r\n}", + "ResponseBody": "{\r\n \"sku\": {\r\n \"name\": \"GP_Gen5\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen5\",\r\n \"capacity\": 4\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Creating\",\r\n \"fullyQualifiedDomainName\": \"net-sdk-crud-tests-5501.1e6d90da5016.database.windows.net\",\r\n \"administratorLogin\": \"dummylogin\",\r\n \"subnetId\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/CustomerExperienceTeam_RG/providers/Microsoft.Network/virtualNetworks/vnet-mi-tooling/subnets/ManagedInstance\",\r\n \"state\": \"Creating\",\r\n \"licenseType\": \"LicenseIncluded\",\r\n \"vCores\": 4,\r\n \"storageSizeInGB\": 32,\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"dnsZone\": \"1e6d90da5016\",\r\n \"publicDataEndpointEnabled\": false,\r\n \"timezoneId\": \"UTC\",\r\n \"maintenanceConfigurationId\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default\",\r\n \"privateEndpointConnections\": [],\r\n \"currentBackupStorageRedundancy\": \"Geo\",\r\n \"requestedBackupStorageRedundancy\": \"Geo\",\r\n \"zoneRedundant\": false\r\n },\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"test\": \"azure-sdk-for-net\"\r\n },\r\n \"id\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-9564/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-5501\",\r\n \"name\": \"net-sdk-crud-tests-5501\",\r\n \"type\": \"Microsoft.Sql/managedInstances\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-8136/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-7225?api-version=2021-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTgxMzYvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNzIyNT9hcGktdmVyc2lvbj0yMDIxLTA1LTAxLXByZXZpZXc=", + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-9564/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-5501?api-version=2021-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTk1NjQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNTUwMT9hcGktdmVyc2lvbj0yMDIxLTA1LTAxLXByZXZpZXc=", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "User-Agent": [ - "FxVersion/4.700.21.56803", + "FxVersion/4.700.22.11601", "OSName/Windows", "OSVersion/Microsoft.Windows.10.0.17763", - "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.0.0" + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" ] }, "ResponseHeaders": { @@ -273,7 +273,7 @@ "no-cache" ], "x-ms-request-id": [ - "a3ef4d25-fad3-48a1-acf3-f24aff438d3e" + "affecf5a-8ac9-41a2-aa14-81e68edd27da" ], "Server": [ "Microsoft-HTTPAPI/2.0" @@ -282,10 +282,10 @@ "11997" ], "x-ms-correlation-request-id": [ - "92584bc0-c08b-430d-922b-584c05834e58" + "d0765309-b596-4a67-a335-785037d981fe" ], "x-ms-routing-request-id": [ - "UKSOUTH:20220223T130453Z:92584bc0-c08b-430d-922b-584c05834e58" + "UKSOUTH:20220403T120729Z:d0765309-b596-4a67-a335-785037d981fe" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -294,7 +294,7 @@ "nosniff" ], "Date": [ - "Wed, 23 Feb 2022 13:04:53 GMT" + "Sun, 03 Apr 2022 12:07:29 GMT" ], "Content-Length": [ "1225" @@ -306,20 +306,20 @@ "-1" ] }, - "ResponseBody": "{\r\n \"sku\": {\r\n \"name\": \"GP_Gen5\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen5\",\r\n \"capacity\": 4\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Creating\",\r\n \"fullyQualifiedDomainName\": \"net-sdk-crud-tests-7225.1e6d90da5016.database.windows.net\",\r\n \"administratorLogin\": \"dummylogin\",\r\n \"subnetId\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/CustomerExperienceTeam_RG/providers/Microsoft.Network/virtualNetworks/vnet-mi-tooling/subnets/ManagedInstance\",\r\n \"state\": \"Creating\",\r\n \"licenseType\": \"LicenseIncluded\",\r\n \"vCores\": 4,\r\n \"storageSizeInGB\": 32,\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"dnsZone\": \"1e6d90da5016\",\r\n \"publicDataEndpointEnabled\": false,\r\n \"timezoneId\": \"UTC\",\r\n \"maintenanceConfigurationId\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default\",\r\n \"privateEndpointConnections\": [],\r\n \"currentBackupStorageRedundancy\": \"Geo\",\r\n \"requestedBackupStorageRedundancy\": \"Geo\",\r\n \"zoneRedundant\": false\r\n },\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"test\": \"azure-sdk-for-net\"\r\n },\r\n \"id\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-8136/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-7225\",\r\n \"name\": \"net-sdk-crud-tests-7225\",\r\n \"type\": \"Microsoft.Sql/managedInstances\"\r\n}", + "ResponseBody": "{\r\n \"sku\": {\r\n \"name\": \"GP_Gen5\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen5\",\r\n \"capacity\": 4\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Creating\",\r\n \"fullyQualifiedDomainName\": \"net-sdk-crud-tests-5501.1e6d90da5016.database.windows.net\",\r\n \"administratorLogin\": \"dummylogin\",\r\n \"subnetId\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/CustomerExperienceTeam_RG/providers/Microsoft.Network/virtualNetworks/vnet-mi-tooling/subnets/ManagedInstance\",\r\n \"state\": \"Creating\",\r\n \"licenseType\": \"LicenseIncluded\",\r\n \"vCores\": 4,\r\n \"storageSizeInGB\": 32,\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"dnsZone\": \"1e6d90da5016\",\r\n \"publicDataEndpointEnabled\": false,\r\n \"timezoneId\": \"UTC\",\r\n \"maintenanceConfigurationId\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default\",\r\n \"privateEndpointConnections\": [],\r\n \"currentBackupStorageRedundancy\": \"Geo\",\r\n \"requestedBackupStorageRedundancy\": \"Geo\",\r\n \"zoneRedundant\": false\r\n },\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"test\": \"azure-sdk-for-net\"\r\n },\r\n \"id\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-9564/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-5501\",\r\n \"name\": \"net-sdk-crud-tests-5501\",\r\n \"type\": \"Microsoft.Sql/managedInstances\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-8136/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-7225?api-version=2021-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTgxMzYvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNzIyNT9hcGktdmVyc2lvbj0yMDIxLTA1LTAxLXByZXZpZXc=", + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-9564/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-5501?api-version=2021-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTk1NjQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNTUwMT9hcGktdmVyc2lvbj0yMDIxLTA1LTAxLXByZXZpZXc=", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "User-Agent": [ - "FxVersion/4.700.21.56803", + "FxVersion/4.700.22.11601", "OSName/Windows", "OSVersion/Microsoft.Windows.10.0.17763", - "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.0.0" + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" ] }, "ResponseHeaders": { @@ -330,7 +330,7 @@ "no-cache" ], "x-ms-request-id": [ - "4b901576-ca6c-4ff0-a945-be840de62afc" + "c7c2541b-79dd-477f-9632-130f902be868" ], "Server": [ "Microsoft-HTTPAPI/2.0" @@ -339,10 +339,10 @@ "11996" ], "x-ms-correlation-request-id": [ - "44eeba41-b0fd-4a56-8b3a-d7fdff80d583" + "11123856-c421-43b8-8ebd-a19a8f08505b" ], "x-ms-routing-request-id": [ - "UKSOUTH:20220223T130554Z:44eeba41-b0fd-4a56-8b3a-d7fdff80d583" + "UKSOUTH:20220403T120830Z:11123856-c421-43b8-8ebd-a19a8f08505b" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -351,7 +351,7 @@ "nosniff" ], "Date": [ - "Wed, 23 Feb 2022 13:05:53 GMT" + "Sun, 03 Apr 2022 12:08:29 GMT" ], "Content-Length": [ "1223" @@ -363,26 +363,26 @@ "-1" ] }, - "ResponseBody": "{\r\n \"sku\": {\r\n \"name\": \"GP_Gen5\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen5\",\r\n \"capacity\": 4\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"fullyQualifiedDomainName\": \"net-sdk-crud-tests-7225.1e6d90da5016.database.windows.net\",\r\n \"administratorLogin\": \"dummylogin\",\r\n \"subnetId\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/CustomerExperienceTeam_RG/providers/Microsoft.Network/virtualNetworks/vnet-mi-tooling/subnets/ManagedInstance\",\r\n \"state\": \"Ready\",\r\n \"licenseType\": \"LicenseIncluded\",\r\n \"vCores\": 4,\r\n \"storageSizeInGB\": 32,\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"dnsZone\": \"1e6d90da5016\",\r\n \"publicDataEndpointEnabled\": false,\r\n \"timezoneId\": \"UTC\",\r\n \"maintenanceConfigurationId\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default\",\r\n \"privateEndpointConnections\": [],\r\n \"currentBackupStorageRedundancy\": \"Geo\",\r\n \"requestedBackupStorageRedundancy\": \"Geo\",\r\n \"zoneRedundant\": false\r\n },\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"test\": \"azure-sdk-for-net\"\r\n },\r\n \"id\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-8136/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-7225\",\r\n \"name\": \"net-sdk-crud-tests-7225\",\r\n \"type\": \"Microsoft.Sql/managedInstances\"\r\n}", + "ResponseBody": "{\r\n \"sku\": {\r\n \"name\": \"GP_Gen5\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen5\",\r\n \"capacity\": 4\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"fullyQualifiedDomainName\": \"net-sdk-crud-tests-5501.1e6d90da5016.database.windows.net\",\r\n \"administratorLogin\": \"dummylogin\",\r\n \"subnetId\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/CustomerExperienceTeam_RG/providers/Microsoft.Network/virtualNetworks/vnet-mi-tooling/subnets/ManagedInstance\",\r\n \"state\": \"Ready\",\r\n \"licenseType\": \"LicenseIncluded\",\r\n \"vCores\": 4,\r\n \"storageSizeInGB\": 32,\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"dnsZone\": \"1e6d90da5016\",\r\n \"publicDataEndpointEnabled\": false,\r\n \"timezoneId\": \"UTC\",\r\n \"maintenanceConfigurationId\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default\",\r\n \"privateEndpointConnections\": [],\r\n \"currentBackupStorageRedundancy\": \"Geo\",\r\n \"requestedBackupStorageRedundancy\": \"Geo\",\r\n \"zoneRedundant\": false\r\n },\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"test\": \"azure-sdk-for-net\"\r\n },\r\n \"id\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-9564/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-5501\",\r\n \"name\": \"net-sdk-crud-tests-5501\",\r\n \"type\": \"Microsoft.Sql/managedInstances\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-8136/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-7225/distributedAvailabilityGroups/invalid_dag1?api-version=2021-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTgxMzYvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNzIyNS9kaXN0cmlidXRlZEF2YWlsYWJpbGl0eUdyb3Vwcy9pbnZhbGlkX2RhZzE/YXBpLXZlcnNpb249MjAyMS0wNS0wMS1wcmV2aWV3", + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-9564/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-5501/distributedAvailabilityGroups/invalid_dag1?api-version=2021-11-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTk1NjQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNTUwMS9kaXN0cmlidXRlZEF2YWlsYWJpbGl0eUdyb3Vwcy9pbnZhbGlkX2RhZzE/YXBpLXZlcnNpb249MjAyMS0xMS0wMS1wcmV2aWV3", "RequestMethod": "PUT", "RequestBody": "{\r\n \"properties\": {\r\n \"sourceEndpoint\": \"TCP://SERVER:7022\",\r\n \"primaryAvailabilityGroupName\": \"BoxLocalAg1\",\r\n \"secondaryAvailabilityGroupName\": \"testcl\"\r\n }\r\n}", "RequestHeaders": { "x-ms-client-request-id": [ - "e4270a50-fef4-44bc-bc1b-0c1f454517db" + "f2f435a7-521e-4848-b51e-119fea8af04e" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.21.56803", + "FxVersion/4.700.22.11601", "OSName/Windows", "OSVersion/Microsoft.Windows.10.0.17763", - "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.0.0" + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" ], "Content-Type": [ "application/json; charset=utf-8" @@ -399,7 +399,7 @@ "no-cache" ], "x-ms-request-id": [ - "4a4bf188-a79b-4e2e-a159-806cbe326dc3" + "3875dafc-c7bc-4d80-82e6-ec2c5ef9d868" ], "Server": [ "Microsoft-HTTPAPI/2.0" @@ -408,10 +408,10 @@ "1198" ], "x-ms-correlation-request-id": [ - "3cbeae67-7559-455b-b620-f845878dceeb" + "c54e24d3-b7ac-4336-ad42-423fe0d6f3f5" ], "x-ms-routing-request-id": [ - "UKSOUTH:20220223T130554Z:3cbeae67-7559-455b-b620-f845878dceeb" + "UKSOUTH:20220403T120830Z:c54e24d3-b7ac-4336-ad42-423fe0d6f3f5" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -420,7 +420,7 @@ "nosniff" ], "Date": [ - "Wed, 23 Feb 2022 13:05:54 GMT" + "Sun, 03 Apr 2022 12:08:29 GMT" ], "Content-Length": [ "137" @@ -436,22 +436,22 @@ "StatusCode": 400 }, { - "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-8136/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-7225/distributedAvailabilityGroups/invalid_dag2?api-version=2021-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTgxMzYvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNzIyNS9kaXN0cmlidXRlZEF2YWlsYWJpbGl0eUdyb3Vwcy9pbnZhbGlkX2RhZzI/YXBpLXZlcnNpb249MjAyMS0wNS0wMS1wcmV2aWV3", + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-9564/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-5501/distributedAvailabilityGroups/invalid_dag2?api-version=2021-11-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTk1NjQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNTUwMS9kaXN0cmlidXRlZEF2YWlsYWJpbGl0eUdyb3Vwcy9pbnZhbGlkX2RhZzI/YXBpLXZlcnNpb249MjAyMS0xMS0wMS1wcmV2aWV3", "RequestMethod": "PUT", "RequestBody": "{\r\n \"properties\": {\r\n \"targetDatabase\": \"testdb\",\r\n \"primaryAvailabilityGroupName\": \"BoxLocalAg1\",\r\n \"secondaryAvailabilityGroupName\": \"testcl\"\r\n }\r\n}", "RequestHeaders": { "x-ms-client-request-id": [ - "2aabcc5a-9e74-463b-8721-451caaa6c4a3" + "308b5746-f431-4649-be99-0d452f4c4a35" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.21.56803", + "FxVersion/4.700.22.11601", "OSName/Windows", "OSVersion/Microsoft.Windows.10.0.17763", - "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.0.0" + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" ], "Content-Type": [ "application/json; charset=utf-8" @@ -468,7 +468,7 @@ "no-cache" ], "x-ms-request-id": [ - "4f9720dd-8c62-497c-95e7-3c4e3d2d8609" + "970bc08d-69ca-4270-91b9-f77958dc5cfd" ], "Server": [ "Microsoft-HTTPAPI/2.0" @@ -477,10 +477,10 @@ "1197" ], "x-ms-correlation-request-id": [ - "8170f347-e70d-499d-9b3b-1b9adaeebd3b" + "8ad871d9-5800-461e-bc68-e96fd3498097" ], "x-ms-routing-request-id": [ - "UKSOUTH:20220223T130555Z:8170f347-e70d-499d-9b3b-1b9adaeebd3b" + "UKSOUTH:20220403T120830Z:8ad871d9-5800-461e-bc68-e96fd3498097" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -489,7 +489,7 @@ "nosniff" ], "Date": [ - "Wed, 23 Feb 2022 13:05:54 GMT" + "Sun, 03 Apr 2022 12:08:30 GMT" ], "Content-Length": [ "137" @@ -505,22 +505,22 @@ "StatusCode": 400 }, { - "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-8136/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-7225/distributedAvailabilityGroups/invalid_dag3?api-version=2021-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTgxMzYvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNzIyNS9kaXN0cmlidXRlZEF2YWlsYWJpbGl0eUdyb3Vwcy9pbnZhbGlkX2RhZzM/YXBpLXZlcnNpb249MjAyMS0wNS0wMS1wcmV2aWV3", + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-9564/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-5501/distributedAvailabilityGroups/invalid_dag3?api-version=2021-11-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTk1NjQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNTUwMS9kaXN0cmlidXRlZEF2YWlsYWJpbGl0eUdyb3Vwcy9pbnZhbGlkX2RhZzM/YXBpLXZlcnNpb249MjAyMS0xMS0wMS1wcmV2aWV3", "RequestMethod": "PUT", "RequestBody": "{\r\n \"properties\": {\r\n \"targetDatabase\": \"testdb\",\r\n \"sourceEndpoint\": \"TCP://SERVER:7022\",\r\n \"secondaryAvailabilityGroupName\": \"testcl\"\r\n }\r\n}", "RequestHeaders": { "x-ms-client-request-id": [ - "2568418f-645f-470c-aa72-15a71726d413" + "f2be1d43-242e-4b15-a095-2ecd65a87fd5" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.21.56803", + "FxVersion/4.700.22.11601", "OSName/Windows", "OSVersion/Microsoft.Windows.10.0.17763", - "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.0.0" + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" ], "Content-Type": [ "application/json; charset=utf-8" @@ -537,7 +537,7 @@ "no-cache" ], "x-ms-request-id": [ - "04a85417-22a2-44a9-8942-a4ef2925c1e4" + "3d839c1d-bc73-4cfd-b6a3-0fa0a4031cba" ], "Server": [ "Microsoft-HTTPAPI/2.0" @@ -546,10 +546,10 @@ "1196" ], "x-ms-correlation-request-id": [ - "21fb2314-1314-41b2-b56d-af075d7bbcae" + "34515a09-9772-4870-990a-0d250b90272d" ], "x-ms-routing-request-id": [ - "UKSOUTH:20220223T130555Z:21fb2314-1314-41b2-b56d-af075d7bbcae" + "UKSOUTH:20220403T120830Z:34515a09-9772-4870-990a-0d250b90272d" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -558,7 +558,7 @@ "nosniff" ], "Date": [ - "Wed, 23 Feb 2022 13:05:54 GMT" + "Sun, 03 Apr 2022 12:08:30 GMT" ], "Content-Length": [ "151" @@ -574,22 +574,22 @@ "StatusCode": 400 }, { - "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-8136/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-7225/distributedAvailabilityGroups/invalid_dag4?api-version=2021-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTgxMzYvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNzIyNS9kaXN0cmlidXRlZEF2YWlsYWJpbGl0eUdyb3Vwcy9pbnZhbGlkX2RhZzQ/YXBpLXZlcnNpb249MjAyMS0wNS0wMS1wcmV2aWV3", + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-9564/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-5501/distributedAvailabilityGroups/invalid_dag4?api-version=2021-11-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTk1NjQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNTUwMS9kaXN0cmlidXRlZEF2YWlsYWJpbGl0eUdyb3Vwcy9pbnZhbGlkX2RhZzQ/YXBpLXZlcnNpb249MjAyMS0xMS0wMS1wcmV2aWV3", "RequestMethod": "PUT", "RequestBody": "{\r\n \"properties\": {\r\n \"targetDatabase\": \"testdb\",\r\n \"sourceEndpoint\": \"TCP://SERVER:7022\",\r\n \"primaryAvailabilityGroupName\": \"BoxLocalAg1\"\r\n }\r\n}", "RequestHeaders": { "x-ms-client-request-id": [ - "7b656096-6b9a-4e44-90d8-06ffca67c27a" + "70de4f73-8edc-493c-8058-0038378f4ffd" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.21.56803", + "FxVersion/4.700.22.11601", "OSName/Windows", "OSVersion/Microsoft.Windows.10.0.17763", - "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.0.0" + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" ], "Content-Type": [ "application/json; charset=utf-8" @@ -606,7 +606,7 @@ "no-cache" ], "x-ms-request-id": [ - "dfb7f1ee-2fd8-46c7-b45f-5ba7edbd25a0" + "058bc3c7-9a6e-45f4-8ba8-ff582b8e2838" ], "Server": [ "Microsoft-HTTPAPI/2.0" @@ -615,10 +615,10 @@ "1195" ], "x-ms-correlation-request-id": [ - "05cd142f-0f08-410b-80bd-385e5ac4faaf" + "c884911f-c0de-4443-8462-ab1b7329603f" ], "x-ms-routing-request-id": [ - "UKSOUTH:20220223T130555Z:05cd142f-0f08-410b-80bd-385e5ac4faaf" + "UKSOUTH:20220403T120831Z:c884911f-c0de-4443-8462-ab1b7329603f" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -627,7 +627,7 @@ "nosniff" ], "Date": [ - "Wed, 23 Feb 2022 13:05:54 GMT" + "Sun, 03 Apr 2022 12:08:30 GMT" ], "Content-Length": [ "153" @@ -643,22 +643,22 @@ "StatusCode": 400 }, { - "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-8136/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-7225/distributedAvailabilityGroups/invalid_dag5?api-version=2021-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTgxMzYvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNzIyNS9kaXN0cmlidXRlZEF2YWlsYWJpbGl0eUdyb3Vwcy9pbnZhbGlkX2RhZzU/YXBpLXZlcnNpb249MjAyMS0wNS0wMS1wcmV2aWV3", + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-9564/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-5501/distributedAvailabilityGroups/invalid_dag5?api-version=2021-11-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTk1NjQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNTUwMS9kaXN0cmlidXRlZEF2YWlsYWJpbGl0eUdyb3Vwcy9pbnZhbGlkX2RhZzU/YXBpLXZlcnNpb249MjAyMS0xMS0wMS1wcmV2aWV3", "RequestMethod": "PUT", "RequestBody": "{}", "RequestHeaders": { "x-ms-client-request-id": [ - "d283e05c-9009-4935-a434-fc517dfeab25" + "5eb6721a-7232-4c14-b7e5-04c363c5cdde" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.21.56803", + "FxVersion/4.700.22.11601", "OSName/Windows", "OSVersion/Microsoft.Windows.10.0.17763", - "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.0.0" + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" ], "Content-Type": [ "application/json; charset=utf-8" @@ -675,7 +675,7 @@ "no-cache" ], "x-ms-request-id": [ - "ae6f71bf-a84f-446e-bae2-14be5f12527e" + "a7f2d68e-1156-4a7d-8db7-9a08f600305b" ], "Server": [ "Microsoft-HTTPAPI/2.0" @@ -684,13 +684,13 @@ "service" ], "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" + "1198" ], "x-ms-correlation-request-id": [ - "05962461-4452-42c1-9559-531755400a52" + "e132bccf-f100-4df8-b19d-79ef02914a51" ], "x-ms-routing-request-id": [ - "UKSOUTH:20220223T130620Z:05962461-4452-42c1-9559-531755400a52" + "UKSOUTH:20220403T120854Z:e132bccf-f100-4df8-b19d-79ef02914a51" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -699,7 +699,7 @@ "nosniff" ], "Date": [ - "Wed, 23 Feb 2022 13:06:19 GMT" + "Sun, 03 Apr 2022 12:08:53 GMT" ], "Connection": [ "close" @@ -714,26 +714,26 @@ "-1" ] }, - "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"An unexpected error occured while processing the request. Tracking ID: 'ae6f71bf-a84f-446e-bae2-14be5f12527e'\"\r\n }\r\n}", + "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"An unexpected error occured while processing the request. Tracking ID: 'a7f2d68e-1156-4a7d-8db7-9a08f600305b'\"\r\n }\r\n}", "StatusCode": 500 }, { - "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-8136/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-7225/distributedAvailabilityGroups/TestDAG?api-version=2021-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTgxMzYvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNzIyNS9kaXN0cmlidXRlZEF2YWlsYWJpbGl0eUdyb3Vwcy9UZXN0REFHP2FwaS12ZXJzaW9uPTIwMjEtMDUtMDEtcHJldmlldw==", + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-9564/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-5501/distributedAvailabilityGroups/TestDAG?api-version=2021-11-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTk1NjQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNTUwMS9kaXN0cmlidXRlZEF2YWlsYWJpbGl0eUdyb3Vwcy9UZXN0REFHP2FwaS12ZXJzaW9uPTIwMjEtMTEtMDEtcHJldmlldw==", "RequestMethod": "PUT", "RequestBody": "{\r\n \"properties\": {\r\n \"targetDatabase\": \"testdb\",\r\n \"sourceEndpoint\": \"TCP://SERVER:7022\",\r\n \"primaryAvailabilityGroupName\": \"BoxLocalAg1\",\r\n \"secondaryAvailabilityGroupName\": \"testcl\"\r\n }\r\n}", "RequestHeaders": { "x-ms-client-request-id": [ - "9f2f658d-51b4-4d7f-8235-9858e5c80689" + "c966f3b3-7792-4a10-9f67-69741ddae763" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.21.56803", + "FxVersion/4.700.22.11601", "OSName/Windows", "OSVersion/Microsoft.Windows.10.0.17763", - "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.0.0" + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" ], "Content-Type": [ "application/json; charset=utf-8" @@ -750,16 +750,16 @@ "no-cache" ], "Location": [ - "https://management.azure.com/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-8136/providers/Microsoft.Sql/locations/westcentralus/distributedAvailabilityGroupsOperationResults/f5e1e699-54d1-4bd5-8bf3-88b802792d13?api-version=2021-05-01-preview" + "https://management.azure.com/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-9564/providers/Microsoft.Sql/locations/westcentralus/distributedAvailabilityGroupsOperationResults/3ef69f9c-fc22-4eae-b6b2-99a053e5845c?api-version=2021-11-01-preview" ], "Retry-After": [ "15" ], "Azure-AsyncOperation": [ - "https://management.azure.com/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-8136/providers/Microsoft.Sql/locations/westcentralus/distributedAvailabilityGroupsAzureAsyncOperation/f5e1e699-54d1-4bd5-8bf3-88b802792d13?api-version=2021-05-01-preview" + "https://management.azure.com/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-9564/providers/Microsoft.Sql/locations/westcentralus/distributedAvailabilityGroupsAzureAsyncOperation/3ef69f9c-fc22-4eae-b6b2-99a053e5845c?api-version=2021-11-01-preview" ], "x-ms-request-id": [ - "ef4c92bd-124a-431f-8fd8-32d79b77003f" + "3ef69f9c-fc22-4eae-b6b2-99a053e5845c" ], "Server": [ "Microsoft-HTTPAPI/2.0" @@ -768,10 +768,10 @@ "1199" ], "x-ms-correlation-request-id": [ - "0f6b1a2e-5542-4a1d-af28-104a79f598fb" + "498ee6a9-2e2c-4939-934a-93004b8bdd7a" ], "x-ms-routing-request-id": [ - "UKSOUTH:20220223T130622Z:0f6b1a2e-5542-4a1d-af28-104a79f598fb" + "UKSOUTH:20220403T120855Z:498ee6a9-2e2c-4939-934a-93004b8bdd7a" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -780,7 +780,7 @@ "nosniff" ], "Date": [ - "Wed, 23 Feb 2022 13:06:21 GMT" + "Sun, 03 Apr 2022 12:08:55 GMT" ], "Content-Length": [ "94" @@ -792,26 +792,26 @@ "-1" ] }, - "ResponseBody": "{\r\n \"operation\": \"DistributedAvailabilityGroupsLinkCreate\",\r\n \"startTime\": \"2022-02-23T13:06:21.917Z\"\r\n}", + "ResponseBody": "{\r\n \"operation\": \"DistributedAvailabilityGroupsLinkCreate\",\r\n \"startTime\": \"2022-04-03T12:08:55.253Z\"\r\n}", "StatusCode": 202 }, { - "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-8136/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-7225/distributedAvailabilityGroups?api-version=2021-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTgxMzYvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNzIyNS9kaXN0cmlidXRlZEF2YWlsYWJpbGl0eUdyb3Vwcz9hcGktdmVyc2lvbj0yMDIxLTA1LTAxLXByZXZpZXc=", + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-9564/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-5501/distributedAvailabilityGroups?api-version=2021-11-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTk1NjQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNTUwMS9kaXN0cmlidXRlZEF2YWlsYWJpbGl0eUdyb3Vwcz9hcGktdmVyc2lvbj0yMDIxLTExLTAxLXByZXZpZXc=", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "586f038c-6d5d-4755-aba8-201c2aa0e1c0" + "b5b7f423-3296-415d-928f-87ee13e8d894" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.21.56803", + "FxVersion/4.700.22.11601", "OSName/Windows", "OSVersion/Microsoft.Windows.10.0.17763", - "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.0.0" + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" ] }, "ResponseHeaders": { @@ -822,7 +822,7 @@ "no-cache" ], "x-ms-request-id": [ - "dfe0d181-c133-4a89-920b-397dbfad3e56" + "49cd0fc3-28c3-4b9c-afee-b04b2b281cce" ], "Server": [ "Microsoft-HTTPAPI/2.0" @@ -831,10 +831,10 @@ "11999" ], "x-ms-correlation-request-id": [ - "909285b6-0ccb-49fa-ba4a-37c23414fc0f" + "7b4a9920-f3e9-4ad4-8eb2-a0ccab353c75" ], "x-ms-routing-request-id": [ - "UKSOUTH:20220223T130622Z:909285b6-0ccb-49fa-ba4a-37c23414fc0f" + "UKSOUTH:20220403T120855Z:7b4a9920-f3e9-4ad4-8eb2-a0ccab353c75" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -843,7 +843,7 @@ "nosniff" ], "Date": [ - "Wed, 23 Feb 2022 13:06:21 GMT" + "Sun, 03 Apr 2022 12:08:55 GMT" ], "Content-Length": [ "12" @@ -859,22 +859,22 @@ "StatusCode": 200 }, { - "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-8136/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-7225/distributedAvailabilityGroups?api-version=2021-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTgxMzYvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNzIyNS9kaXN0cmlidXRlZEF2YWlsYWJpbGl0eUdyb3Vwcz9hcGktdmVyc2lvbj0yMDIxLTA1LTAxLXByZXZpZXc=", + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-9564/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-5501/distributedAvailabilityGroups?api-version=2021-11-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTk1NjQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNTUwMS9kaXN0cmlidXRlZEF2YWlsYWJpbGl0eUdyb3Vwcz9hcGktdmVyc2lvbj0yMDIxLTExLTAxLXByZXZpZXc=", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "2931f12c-01f0-4666-9328-aefa2e0834ba" + "770ef5be-52a6-4f30-9133-0f052dc8dfae" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.21.56803", + "FxVersion/4.700.22.11601", "OSName/Windows", "OSVersion/Microsoft.Windows.10.0.17763", - "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.0.0" + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" ] }, "ResponseHeaders": { @@ -885,7 +885,7 @@ "no-cache" ], "x-ms-request-id": [ - "7a194657-a58e-40d7-88c6-fe6e5182c531" + "b225c6a9-3942-4c92-8186-80cb765270f2" ], "Server": [ "Microsoft-HTTPAPI/2.0" @@ -894,10 +894,10 @@ "11998" ], "x-ms-correlation-request-id": [ - "5802ca0e-9155-4d15-9156-0a82a5e0fa1c" + "5fd6ffb2-0d59-4c3b-9046-b74889753c87" ], "x-ms-routing-request-id": [ - "UKSOUTH:20220223T130652Z:5802ca0e-9155-4d15-9156-0a82a5e0fa1c" + "UKSOUTH:20220403T120925Z:5fd6ffb2-0d59-4c3b-9046-b74889753c87" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -906,7 +906,7 @@ "nosniff" ], "Date": [ - "Wed, 23 Feb 2022 13:06:51 GMT" + "Sun, 03 Apr 2022 12:09:24 GMT" ], "Content-Length": [ "606" @@ -918,26 +918,26 @@ "-1" ] }, - "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"properties\": {\r\n \"targetDatabase\": \"testdb\",\r\n \"sourceEndpoint\": \"TCP://SERVER:7022\",\r\n \"replicationMode\": \"Async\",\r\n \"distributedAvailabilityGroupId\": \"7a60eb24-937a-fb24-065c-eb4bcb0b60b8\",\r\n \"sourceReplicaId\": \"0cb00a6b-2461-8a4e-7bae-ba79fed799e0\",\r\n \"targetReplicaId\": \"f0e92fe9-ca08-6cd1-32ef-1febc1a34d46\",\r\n \"linkState\": \"Copying\"\r\n },\r\n \"id\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-8136/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-7225/distributedAvailabilityGroups/TestDAG\",\r\n \"name\": \"TestDAG\",\r\n \"type\": \"Microsoft.Sql/managedInstances/distributedAvailabilityGroups\"\r\n }\r\n ]\r\n}", + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"properties\": {\r\n \"targetDatabase\": \"testdb\",\r\n \"sourceEndpoint\": \"TCP://SERVER:7022\",\r\n \"replicationMode\": \"Async\",\r\n \"distributedAvailabilityGroupId\": \"7a60eb24-937a-fb24-065c-eb4bcb0b60b8\",\r\n \"sourceReplicaId\": \"0cb00a6b-2461-8a4e-7bae-ba79fed799e0\",\r\n \"targetReplicaId\": \"f0e92fe9-ca08-6cd1-32ef-1febc1a34d46\",\r\n \"linkState\": \"Copying\"\r\n },\r\n \"id\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-9564/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-5501/distributedAvailabilityGroups/TestDAG\",\r\n \"name\": \"TestDAG\",\r\n \"type\": \"Microsoft.Sql/managedInstances/distributedAvailabilityGroups\"\r\n }\r\n ]\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-8136/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-7225/distributedAvailabilityGroups?api-version=2021-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTgxMzYvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNzIyNS9kaXN0cmlidXRlZEF2YWlsYWJpbGl0eUdyb3Vwcz9hcGktdmVyc2lvbj0yMDIxLTA1LTAxLXByZXZpZXc=", + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-9564/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-5501/distributedAvailabilityGroups?api-version=2021-11-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTk1NjQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNTUwMS9kaXN0cmlidXRlZEF2YWlsYWJpbGl0eUdyb3Vwcz9hcGktdmVyc2lvbj0yMDIxLTExLTAxLXByZXZpZXc=", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "2f1754ad-651f-416a-9463-e54142aa0e8f" + "39c76ea3-4204-48c3-b888-ed248d139ea9" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.21.56803", + "FxVersion/4.700.22.11601", "OSName/Windows", "OSVersion/Microsoft.Windows.10.0.17763", - "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.0.0" + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" ] }, "ResponseHeaders": { @@ -948,7 +948,7 @@ "no-cache" ], "x-ms-request-id": [ - "d7cc464e-809d-4742-b7be-0c0ca313f1fa" + "ddcf96bc-b770-4981-8c0e-2afbf08f982e" ], "Server": [ "Microsoft-HTTPAPI/2.0" @@ -957,10 +957,10 @@ "11994" ], "x-ms-correlation-request-id": [ - "ae9e37cf-ff0d-49d9-a410-2d12e245e1f3" + "b9411c52-7c8e-4b08-b186-7f49c8b62b81" ], "x-ms-routing-request-id": [ - "UKSOUTH:20220223T130708Z:ae9e37cf-ff0d-49d9-a410-2d12e245e1f3" + "UKSOUTH:20220403T120941Z:b9411c52-7c8e-4b08-b186-7f49c8b62b81" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -969,7 +969,7 @@ "nosniff" ], "Date": [ - "Wed, 23 Feb 2022 13:07:08 GMT" + "Sun, 03 Apr 2022 12:09:40 GMT" ], "Content-Length": [ "12" @@ -985,22 +985,22 @@ "StatusCode": 200 }, { - "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-8136/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-7225/distributedAvailabilityGroups/TestDAG?api-version=2021-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTgxMzYvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNzIyNS9kaXN0cmlidXRlZEF2YWlsYWJpbGl0eUdyb3Vwcy9UZXN0REFHP2FwaS12ZXJzaW9uPTIwMjEtMDUtMDEtcHJldmlldw==", + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-9564/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-5501/distributedAvailabilityGroups/TestDAG?api-version=2021-11-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTk1NjQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNTUwMS9kaXN0cmlidXRlZEF2YWlsYWJpbGl0eUdyb3Vwcy9UZXN0REFHP2FwaS12ZXJzaW9uPTIwMjEtMTEtMDEtcHJldmlldw==", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "2f2c773e-6885-4d76-844a-2d20ff6e6ce5" + "df0496f8-ecda-4a4a-ad83-79c2a328c5ca" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.21.56803", + "FxVersion/4.700.22.11601", "OSName/Windows", "OSVersion/Microsoft.Windows.10.0.17763", - "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.0.0" + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" ] }, "ResponseHeaders": { @@ -1011,7 +1011,7 @@ "no-cache" ], "x-ms-request-id": [ - "51c985af-66a5-416e-a80e-c046b9e41c9a" + "defec118-46a8-4afa-8f7a-e40be3397415" ], "Server": [ "Microsoft-HTTPAPI/2.0" @@ -1020,10 +1020,10 @@ "11997" ], "x-ms-correlation-request-id": [ - "0b759cc9-921f-4357-b61f-be433bf3a9f7" + "eddb64b0-7f5e-426c-b2aa-677f8aa94921" ], "x-ms-routing-request-id": [ - "UKSOUTH:20220223T130652Z:0b759cc9-921f-4357-b61f-be433bf3a9f7" + "UKSOUTH:20220403T120925Z:eddb64b0-7f5e-426c-b2aa-677f8aa94921" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -1032,7 +1032,7 @@ "nosniff" ], "Date": [ - "Wed, 23 Feb 2022 13:06:51 GMT" + "Sun, 03 Apr 2022 12:09:25 GMT" ], "Content-Length": [ "594" @@ -1044,26 +1044,26 @@ "-1" ] }, - "ResponseBody": "{\r\n \"properties\": {\r\n \"targetDatabase\": \"testdb\",\r\n \"sourceEndpoint\": \"TCP://SERVER:7022\",\r\n \"replicationMode\": \"Async\",\r\n \"distributedAvailabilityGroupId\": \"7a60eb24-937a-fb24-065c-eb4bcb0b60b8\",\r\n \"sourceReplicaId\": \"0cb00a6b-2461-8a4e-7bae-ba79fed799e0\",\r\n \"targetReplicaId\": \"f0e92fe9-ca08-6cd1-32ef-1febc1a34d46\",\r\n \"linkState\": \"Copying\"\r\n },\r\n \"id\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-8136/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-7225/distributedAvailabilityGroups/TestDAG\",\r\n \"name\": \"TestDAG\",\r\n \"type\": \"Microsoft.Sql/managedInstances/distributedAvailabilityGroups\"\r\n}", + "ResponseBody": "{\r\n \"properties\": {\r\n \"targetDatabase\": \"testdb\",\r\n \"sourceEndpoint\": \"TCP://SERVER:7022\",\r\n \"replicationMode\": \"Async\",\r\n \"distributedAvailabilityGroupId\": \"7a60eb24-937a-fb24-065c-eb4bcb0b60b8\",\r\n \"sourceReplicaId\": \"0cb00a6b-2461-8a4e-7bae-ba79fed799e0\",\r\n \"targetReplicaId\": \"f0e92fe9-ca08-6cd1-32ef-1febc1a34d46\",\r\n \"linkState\": \"Copying\"\r\n },\r\n \"id\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-9564/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-5501/distributedAvailabilityGroups/TestDAG\",\r\n \"name\": \"TestDAG\",\r\n \"type\": \"Microsoft.Sql/managedInstances/distributedAvailabilityGroups\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-8136/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-7225/distributedAvailabilityGroups/TestDAG?api-version=2021-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTgxMzYvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNzIyNS9kaXN0cmlidXRlZEF2YWlsYWJpbGl0eUdyb3Vwcy9UZXN0REFHP2FwaS12ZXJzaW9uPTIwMjEtMDUtMDEtcHJldmlldw==", + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-9564/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-5501/distributedAvailabilityGroups/TestDAG?api-version=2021-11-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTk1NjQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNTUwMS9kaXN0cmlidXRlZEF2YWlsYWJpbGl0eUdyb3Vwcy9UZXN0REFHP2FwaS12ZXJzaW9uPTIwMjEtMTEtMDEtcHJldmlldw==", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "88cb406e-e865-4088-852e-23ad7351d045" + "2a2bba09-3ee5-487a-a375-c8a155de620b" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.21.56803", + "FxVersion/4.700.22.11601", "OSName/Windows", "OSVersion/Microsoft.Windows.10.0.17763", - "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.0.0" + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" ] }, "ResponseHeaders": { @@ -1074,7 +1074,7 @@ "no-cache" ], "x-ms-request-id": [ - "8daf0a73-d49e-4976-97b3-428d6777c530" + "5edf283c-ca3b-4c05-afc1-01cfff9da6cd" ], "Server": [ "Microsoft-HTTPAPI/2.0" @@ -1083,10 +1083,10 @@ "11993" ], "x-ms-correlation-request-id": [ - "e0ec15e2-8660-4882-9d93-6ee905283f88" + "0a185d7e-ac8b-4806-ad21-be0146cfda05" ], "x-ms-routing-request-id": [ - "UKSOUTH:20220223T130709Z:e0ec15e2-8660-4882-9d93-6ee905283f88" + "UKSOUTH:20220403T120941Z:0a185d7e-ac8b-4806-ad21-be0146cfda05" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -1095,7 +1095,7 @@ "nosniff" ], "Date": [ - "Wed, 23 Feb 2022 13:07:09 GMT" + "Sun, 03 Apr 2022 12:09:41 GMT" ], "Content-Length": [ "178" @@ -1111,22 +1111,22 @@ "StatusCode": 404 }, { - "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-8136/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-7225/distributedAvailabilityGroups/TestDAG?api-version=2021-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTgxMzYvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNzIyNS9kaXN0cmlidXRlZEF2YWlsYWJpbGl0eUdyb3Vwcy9UZXN0REFHP2FwaS12ZXJzaW9uPTIwMjEtMDUtMDEtcHJldmlldw==", + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-9564/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-5501/distributedAvailabilityGroups/TestDAG?api-version=2021-11-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTk1NjQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNTUwMS9kaXN0cmlidXRlZEF2YWlsYWJpbGl0eUdyb3Vwcy9UZXN0REFHP2FwaS12ZXJzaW9uPTIwMjEtMTEtMDEtcHJldmlldw==", "RequestMethod": "DELETE", "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "ebf3e282-793c-4d08-bb08-6eed402ea69e" + "80af8e6e-41ae-48ea-b454-b33041af29f0" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.21.56803", + "FxVersion/4.700.22.11601", "OSName/Windows", "OSVersion/Microsoft.Windows.10.0.17763", - "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.0.0" + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" ] }, "ResponseHeaders": { @@ -1137,16 +1137,16 @@ "no-cache" ], "Location": [ - "https://management.azure.com/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-8136/providers/Microsoft.Sql/locations/westcentralus/distributedAvailabilityGroupsOperationResults/a16a2ae9-b613-4dcf-a676-653630e74e07?api-version=2021-05-01-preview" + "https://management.azure.com/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-9564/providers/Microsoft.Sql/locations/westcentralus/distributedAvailabilityGroupsOperationResults/b90a62a8-45c1-4809-b626-9857d7e2bfb3?api-version=2021-11-01-preview" ], "Retry-After": [ "15" ], "Azure-AsyncOperation": [ - "https://management.azure.com/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-8136/providers/Microsoft.Sql/locations/westcentralus/distributedAvailabilityGroupsAzureAsyncOperation/a16a2ae9-b613-4dcf-a676-653630e74e07?api-version=2021-05-01-preview" + "https://management.azure.com/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-9564/providers/Microsoft.Sql/locations/westcentralus/distributedAvailabilityGroupsAzureAsyncOperation/b90a62a8-45c1-4809-b626-9857d7e2bfb3?api-version=2021-11-01-preview" ], "x-ms-request-id": [ - "39ce3a0c-1827-4555-b0d6-c2950fe74135" + "b90a62a8-45c1-4809-b626-9857d7e2bfb3" ], "Server": [ "Microsoft-HTTPAPI/2.0" @@ -1155,10 +1155,10 @@ "14999" ], "x-ms-correlation-request-id": [ - "655f00b3-a9d0-45c5-9465-8dc5c9ea8eec" + "90274a93-3df4-482e-aef1-0bffee2a0ed8" ], "x-ms-routing-request-id": [ - "UKSOUTH:20220223T130652Z:655f00b3-a9d0-45c5-9465-8dc5c9ea8eec" + "UKSOUTH:20220403T120926Z:90274a93-3df4-482e-aef1-0bffee2a0ed8" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -1167,10 +1167,10 @@ "nosniff" ], "Date": [ - "Wed, 23 Feb 2022 13:06:52 GMT" + "Sun, 03 Apr 2022 12:09:25 GMT" ], "Content-Length": [ - "92" + "91" ], "Content-Type": [ "application/json; charset=utf-8" @@ -1179,20 +1179,20 @@ "-1" ] }, - "ResponseBody": "{\r\n \"operation\": \"DistributedAvailabilityGroupsDropLink\",\r\n \"startTime\": \"2022-02-23T13:06:52.837Z\"\r\n}", + "ResponseBody": "{\r\n \"operation\": \"DistributedAvailabilityGroupsDropLink\",\r\n \"startTime\": \"2022-04-03T12:09:26.16Z\"\r\n}", "StatusCode": 202 }, { - "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-8136/providers/Microsoft.Sql/locations/westcentralus/distributedAvailabilityGroupsAzureAsyncOperation/a16a2ae9-b613-4dcf-a676-653630e74e07?api-version=2021-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTgxMzYvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbG9jYXRpb25zL3dlc3RjZW50cmFsdXMvZGlzdHJpYnV0ZWRBdmFpbGFiaWxpdHlHcm91cHNBenVyZUFzeW5jT3BlcmF0aW9uL2ExNmEyYWU5LWI2MTMtNGRjZi1hNjc2LTY1MzYzMGU3NGUwNz9hcGktdmVyc2lvbj0yMDIxLTA1LTAxLXByZXZpZXc=", + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-9564/providers/Microsoft.Sql/locations/westcentralus/distributedAvailabilityGroupsAzureAsyncOperation/b90a62a8-45c1-4809-b626-9857d7e2bfb3?api-version=2021-11-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTk1NjQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbG9jYXRpb25zL3dlc3RjZW50cmFsdXMvZGlzdHJpYnV0ZWRBdmFpbGFiaWxpdHlHcm91cHNBenVyZUFzeW5jT3BlcmF0aW9uL2I5MGE2MmE4LTQ1YzEtNDgwOS1iNjI2LTk4NTdkN2UyYmZiMz9hcGktdmVyc2lvbj0yMDIxLTExLTAxLXByZXZpZXc=", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "User-Agent": [ - "FxVersion/4.700.21.56803", + "FxVersion/4.700.22.11601", "OSName/Windows", "OSVersion/Microsoft.Windows.10.0.17763", - "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.0.0" + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" ] }, "ResponseHeaders": { @@ -1206,7 +1206,7 @@ "15" ], "x-ms-request-id": [ - "89848709-eed7-4389-9864-5c1dfff14565" + "ab760700-446f-4cfb-aa97-e1b8fa414fa1" ], "Server": [ "Microsoft-HTTPAPI/2.0" @@ -1215,10 +1215,10 @@ "11996" ], "x-ms-correlation-request-id": [ - "1cf6b47c-61b8-4d4b-b720-c285ca340976" + "20472d8d-bff2-454e-8353-b87e602b12e6" ], "x-ms-routing-request-id": [ - "UKSOUTH:20220223T130708Z:1cf6b47c-61b8-4d4b-b720-c285ca340976" + "UKSOUTH:20220403T120941Z:20472d8d-bff2-454e-8353-b87e602b12e6" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -1227,10 +1227,10 @@ "nosniff" ], "Date": [ - "Wed, 23 Feb 2022 13:07:08 GMT" + "Sun, 03 Apr 2022 12:09:40 GMT" ], "Content-Length": [ - "107" + "106" ], "Content-Type": [ "application/json; charset=utf-8" @@ -1239,20 +1239,20 @@ "-1" ] }, - "ResponseBody": "{\r\n \"name\": \"a16a2ae9-b613-4dcf-a676-653630e74e07\",\r\n \"status\": \"Succeeded\",\r\n \"startTime\": \"2022-02-23T13:06:52.837Z\"\r\n}", + "ResponseBody": "{\r\n \"name\": \"b90a62a8-45c1-4809-b626-9857d7e2bfb3\",\r\n \"status\": \"Succeeded\",\r\n \"startTime\": \"2022-04-03T12:09:26.16Z\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-8136/providers/Microsoft.Sql/locations/westcentralus/distributedAvailabilityGroupsOperationResults/a16a2ae9-b613-4dcf-a676-653630e74e07?api-version=2021-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTgxMzYvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbG9jYXRpb25zL3dlc3RjZW50cmFsdXMvZGlzdHJpYnV0ZWRBdmFpbGFiaWxpdHlHcm91cHNPcGVyYXRpb25SZXN1bHRzL2ExNmEyYWU5LWI2MTMtNGRjZi1hNjc2LTY1MzYzMGU3NGUwNz9hcGktdmVyc2lvbj0yMDIxLTA1LTAxLXByZXZpZXc=", + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-9564/providers/Microsoft.Sql/locations/westcentralus/distributedAvailabilityGroupsOperationResults/b90a62a8-45c1-4809-b626-9857d7e2bfb3?api-version=2021-11-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTk1NjQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbG9jYXRpb25zL3dlc3RjZW50cmFsdXMvZGlzdHJpYnV0ZWRBdmFpbGFiaWxpdHlHcm91cHNPcGVyYXRpb25SZXN1bHRzL2I5MGE2MmE4LTQ1YzEtNDgwOS1iNjI2LTk4NTdkN2UyYmZiMz9hcGktdmVyc2lvbj0yMDIxLTExLTAxLXByZXZpZXc=", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "User-Agent": [ - "FxVersion/4.700.21.56803", + "FxVersion/4.700.22.11601", "OSName/Windows", "OSVersion/Microsoft.Windows.10.0.17763", - "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.0.0" + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" ] }, "ResponseHeaders": { @@ -1263,7 +1263,7 @@ "no-cache" ], "x-ms-request-id": [ - "0ae6e4b9-a91b-44b0-87f3-5563ae0ff5a0" + "68df5b58-b2c8-4b96-a5ce-f27a8ec1f210" ], "Server": [ "Microsoft-HTTPAPI/2.0" @@ -1272,10 +1272,10 @@ "11995" ], "x-ms-correlation-request-id": [ - "af4021f0-1ed9-498c-8319-54dc6b2dcc78" + "59625657-39b5-49c5-b2ea-5a2895af4a6f" ], "x-ms-routing-request-id": [ - "UKSOUTH:20220223T130708Z:af4021f0-1ed9-498c-8319-54dc6b2dcc78" + "UKSOUTH:20220403T120941Z:59625657-39b5-49c5-b2ea-5a2895af4a6f" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -1284,7 +1284,7 @@ "nosniff" ], "Date": [ - "Wed, 23 Feb 2022 13:07:08 GMT" + "Sun, 03 Apr 2022 12:09:40 GMT" ], "Expires": [ "-1" @@ -1297,19 +1297,19 @@ "StatusCode": 200 }, { - "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourcegroups/sqlcrudtest-8136?api-version=2017-05-10", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlZ3JvdXBzL3NxbGNydWR0ZXN0LTgxMzY/YXBpLXZlcnNpb249MjAxNy0wNS0xMA==", + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourcegroups/sqlcrudtest-9564?api-version=2017-05-10", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlZ3JvdXBzL3NxbGNydWR0ZXN0LTk1NjQ/YXBpLXZlcnNpb249MjAxNy0wNS0xMA==", "RequestMethod": "DELETE", "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "306ad789-4929-4dbf-9c2c-0e0f45bd833c" + "5b490d3e-6105-41fe-9a89-32c5b17a2d53" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.21.56803", + "FxVersion/4.700.22.11601", "OSName/Windows", "OSVersion/Microsoft.Windows.10.0.17763", "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.6.0.0" @@ -1323,7 +1323,7 @@ "no-cache" ], "Location": [ - "https://management.azure.com/subscriptions/8313371e-0879-428e-b1da-6353575a9192/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1TUUxDUlVEVEVTVDoyRDgxMzYtV0VTVENFTlRSQUxVUyIsImpvYkxvY2F0aW9uIjoid2VzdGNlbnRyYWx1cyJ9?api-version=2017-05-10" + "https://management.azure.com/subscriptions/8313371e-0879-428e-b1da-6353575a9192/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1TUUxDUlVEVEVTVDoyRDk1NjQtV0VTVENFTlRSQUxVUyIsImpvYkxvY2F0aW9uIjoid2VzdGNlbnRyYWx1cyJ9?api-version=2017-05-10" ], "Retry-After": [ "15" @@ -1332,13 +1332,13 @@ "14999" ], "x-ms-request-id": [ - "bd7fcc2a-bd50-4aeb-8366-16a74b470b06" + "9996735b-d6d6-4491-9efa-effca7b223f6" ], "x-ms-correlation-request-id": [ - "bd7fcc2a-bd50-4aeb-8366-16a74b470b06" + "9996735b-d6d6-4491-9efa-effca7b223f6" ], "x-ms-routing-request-id": [ - "UKSOUTH:20220223T130713Z:bd7fcc2a-bd50-4aeb-8366-16a74b470b06" + "UKSOUTH:20220403T120946Z:9996735b-d6d6-4491-9efa-effca7b223f6" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -1347,7 +1347,7 @@ "nosniff" ], "Date": [ - "Wed, 23 Feb 2022 13:07:12 GMT" + "Sun, 03 Apr 2022 12:09:45 GMT" ], "Expires": [ "-1" @@ -1362,10 +1362,10 @@ ], "Names": { "CreateResourceGroup": [ - "sqlcrudtest-8136" + "sqlcrudtest-9564" ], "CreateManagedInstance": [ - "net-sdk-crud-tests-7225" + "net-sdk-crud-tests-5501" ] }, "Variables": { diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/tests/SessionRecords/ManagedInstanceHybridLinkTests/TestEndpointCertificates.json b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/tests/SessionRecords/ManagedInstanceHybridLinkTests/TestEndpointCertificates.json new file mode 100644 index 000000000000..7894da0114c4 --- /dev/null +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/tests/SessionRecords/ManagedInstanceHybridLinkTests/TestEndpointCertificates.json @@ -0,0 +1,639 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourcegroups/sqlcrudtest-6818?api-version=2017-05-10", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlZ3JvdXBzL3NxbGNydWR0ZXN0LTY4MTg/YXBpLXZlcnNpb249MjAxNy0wNS0xMA==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"sqlcrudtest-6818\": \"2022-04-03 12:09:49Z\"\r\n }\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "41d320e0-1b87-444b-80b0-71c4d764a4c7" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.700.22.11601", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.17763", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.6.0.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "102" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-request-id": [ + "782ceb12-084f-4257-8e40-4bc6b5b16a24" + ], + "x-ms-correlation-request-id": [ + "782ceb12-084f-4257-8e40-4bc6b5b16a24" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20220403T120952Z:782ceb12-084f-4257-8e40-4bc6b5b16a24" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Sun, 03 Apr 2022 12:09:52 GMT" + ], + "Content-Length": [ + "243" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-6818\",\r\n \"name\": \"sqlcrudtest-6818\",\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"sqlcrudtest-6818\": \"2022-04-03 12:09:49Z\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-6818/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-9770?api-version=2021-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTY4MTgvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtOTc3MD9hcGktdmVyc2lvbj0yMDIxLTA1LTAxLXByZXZpZXc=", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"administratorLogin\": \"dummylogin\",\r\n \"administratorLoginPassword\": \"cde98dac-c1b5-4087-8a2f-3fac4c43b6e8\",\r\n \"subnetId\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/CustomerExperienceTeam_RG/providers/Microsoft.Network/virtualNetworks/vnet-mi-tooling/subnets/ManagedInstance\",\r\n \"vCores\": 4,\r\n \"storageSizeInGB\": 32,\r\n \"requestedBackupStorageRedundancy\": \"Geo\"\r\n },\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"test\": \"azure-sdk-for-net\"\r\n }\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "cd5645aa-a459-4418-a3e1-101aee7b2399" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.700.22.11601", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.17763", + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "518" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "60" + ], + "x-ms-request-id": [ + "0f9c226d-3533-4a0c-adb2-53afa8ebc78f" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1198" + ], + "x-ms-correlation-request-id": [ + "42aac98f-04c7-4567-8807-132d571de4f2" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20220403T120958Z:42aac98f-04c7-4567-8807-132d571de4f2" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Sun, 03 Apr 2022 12:09:58 GMT" + ], + "Content-Length": [ + "761" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"identity\": {\r\n \"type\": \"None\"\r\n },\r\n \"sku\": {\r\n \"name\": \"GP_Gen5\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen5\",\r\n \"capacity\": 4\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Creating\",\r\n \"administratorLogin\": \"dummylogin\",\r\n \"licenseType\": \"LicenseIncluded\",\r\n \"vCores\": 4,\r\n \"storageSizeInGB\": 32,\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"timezoneId\": \"UTC\",\r\n \"maintenanceConfigurationId\": \"SystemDefault\",\r\n \"privateEndpointConnections\": [],\r\n \"currentBackupStorageRedundancy\": \"Geo\",\r\n \"requestedBackupStorageRedundancy\": \"Geo\"\r\n },\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"test\": \"azure-sdk-for-net\"\r\n },\r\n \"id\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-6818/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-9770\",\r\n \"name\": \"net-sdk-crud-tests-9770\",\r\n \"type\": \"Microsoft.Sql/managedInstances\"\r\n}", + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-6818/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-9770?api-version=2021-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTY4MTgvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtOTc3MD9hcGktdmVyc2lvbj0yMDIxLTA1LTAxLXByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.700.22.11601", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.17763", + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "486fb47f-cf19-4c62-9864-b976451d360c" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11999" + ], + "x-ms-correlation-request-id": [ + "a4337d84-a951-43db-a566-f8f403693fc2" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20220403T121058Z:a4337d84-a951-43db-a566-f8f403693fc2" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Sun, 03 Apr 2022 12:10:58 GMT" + ], + "Content-Length": [ + "1225" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"sku\": {\r\n \"name\": \"GP_Gen5\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen5\",\r\n \"capacity\": 4\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Creating\",\r\n \"fullyQualifiedDomainName\": \"net-sdk-crud-tests-9770.1e6d90da5016.database.windows.net\",\r\n \"administratorLogin\": \"dummylogin\",\r\n \"subnetId\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/CustomerExperienceTeam_RG/providers/Microsoft.Network/virtualNetworks/vnet-mi-tooling/subnets/ManagedInstance\",\r\n \"state\": \"Creating\",\r\n \"licenseType\": \"LicenseIncluded\",\r\n \"vCores\": 4,\r\n \"storageSizeInGB\": 32,\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"dnsZone\": \"1e6d90da5016\",\r\n \"publicDataEndpointEnabled\": false,\r\n \"timezoneId\": \"UTC\",\r\n \"maintenanceConfigurationId\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default\",\r\n \"privateEndpointConnections\": [],\r\n \"currentBackupStorageRedundancy\": \"Geo\",\r\n \"requestedBackupStorageRedundancy\": \"Geo\",\r\n \"zoneRedundant\": false\r\n },\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"test\": \"azure-sdk-for-net\"\r\n },\r\n \"id\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-6818/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-9770\",\r\n \"name\": \"net-sdk-crud-tests-9770\",\r\n \"type\": \"Microsoft.Sql/managedInstances\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-6818/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-9770?api-version=2021-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTY4MTgvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtOTc3MD9hcGktdmVyc2lvbj0yMDIxLTA1LTAxLXByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.700.22.11601", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.17763", + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "f94fc138-9eae-4ab1-a91a-0add807c2866" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11998" + ], + "x-ms-correlation-request-id": [ + "500afeec-06d3-469b-85d3-1517e22a05da" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20220403T121159Z:500afeec-06d3-469b-85d3-1517e22a05da" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Sun, 03 Apr 2022 12:11:59 GMT" + ], + "Content-Length": [ + "1225" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"sku\": {\r\n \"name\": \"GP_Gen5\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen5\",\r\n \"capacity\": 4\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Creating\",\r\n \"fullyQualifiedDomainName\": \"net-sdk-crud-tests-9770.1e6d90da5016.database.windows.net\",\r\n \"administratorLogin\": \"dummylogin\",\r\n \"subnetId\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/CustomerExperienceTeam_RG/providers/Microsoft.Network/virtualNetworks/vnet-mi-tooling/subnets/ManagedInstance\",\r\n \"state\": \"Creating\",\r\n \"licenseType\": \"LicenseIncluded\",\r\n \"vCores\": 4,\r\n \"storageSizeInGB\": 32,\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"dnsZone\": \"1e6d90da5016\",\r\n \"publicDataEndpointEnabled\": false,\r\n \"timezoneId\": \"UTC\",\r\n \"maintenanceConfigurationId\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default\",\r\n \"privateEndpointConnections\": [],\r\n \"currentBackupStorageRedundancy\": \"Geo\",\r\n \"requestedBackupStorageRedundancy\": \"Geo\",\r\n \"zoneRedundant\": false\r\n },\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"test\": \"azure-sdk-for-net\"\r\n },\r\n \"id\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-6818/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-9770\",\r\n \"name\": \"net-sdk-crud-tests-9770\",\r\n \"type\": \"Microsoft.Sql/managedInstances\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-6818/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-9770?api-version=2021-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTY4MTgvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtOTc3MD9hcGktdmVyc2lvbj0yMDIxLTA1LTAxLXByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.700.22.11601", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.17763", + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "8c0f172c-25e5-4a15-86cc-a309e69dc4d6" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11997" + ], + "x-ms-correlation-request-id": [ + "3fc43943-19e9-4e2f-a8e1-a98b771b6932" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20220403T121259Z:3fc43943-19e9-4e2f-a8e1-a98b771b6932" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Sun, 03 Apr 2022 12:12:59 GMT" + ], + "Content-Length": [ + "1223" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"sku\": {\r\n \"name\": \"GP_Gen5\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen5\",\r\n \"capacity\": 4\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"fullyQualifiedDomainName\": \"net-sdk-crud-tests-9770.1e6d90da5016.database.windows.net\",\r\n \"administratorLogin\": \"dummylogin\",\r\n \"subnetId\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/CustomerExperienceTeam_RG/providers/Microsoft.Network/virtualNetworks/vnet-mi-tooling/subnets/ManagedInstance\",\r\n \"state\": \"Ready\",\r\n \"licenseType\": \"LicenseIncluded\",\r\n \"vCores\": 4,\r\n \"storageSizeInGB\": 32,\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"dnsZone\": \"1e6d90da5016\",\r\n \"publicDataEndpointEnabled\": false,\r\n \"timezoneId\": \"UTC\",\r\n \"maintenanceConfigurationId\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default\",\r\n \"privateEndpointConnections\": [],\r\n \"currentBackupStorageRedundancy\": \"Geo\",\r\n \"requestedBackupStorageRedundancy\": \"Geo\",\r\n \"zoneRedundant\": false\r\n },\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"test\": \"azure-sdk-for-net\"\r\n },\r\n \"id\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-6818/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-9770\",\r\n \"name\": \"net-sdk-crud-tests-9770\",\r\n \"type\": \"Microsoft.Sql/managedInstances\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-6818/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-9770/endpointCertificates/invalid_endpoint_type?api-version=2021-11-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTY4MTgvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtOTc3MC9lbmRwb2ludENlcnRpZmljYXRlcy9pbnZhbGlkX2VuZHBvaW50X3R5cGU/YXBpLXZlcnNpb249MjAyMS0xMS0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "f65ac962-ba16-4aec-9c8a-0e93065eed90" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.700.22.11601", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.17763", + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "5c8f3a71-2922-4fa2-986e-a02e157cbeb3" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11996" + ], + "x-ms-correlation-request-id": [ + "a70389ea-afd4-4e1b-884d-71c8a24aea3a" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20220403T121300Z:a70389ea-afd4-4e1b-884d-71c8a24aea3a" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Sun, 03 Apr 2022 12:12:59 GMT" + ], + "Content-Length": [ + "183" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"The requested resource of type 'Microsoft.Sql/managedInstances/endpointCertificates' with name 'invalid_endpoint_type' was not found.\"\r\n }\r\n}", + "StatusCode": 404 + }, + { + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-6818/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-9770/endpointCertificates/SERVICE_BROKER?api-version=2021-11-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTY4MTgvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtOTc3MC9lbmRwb2ludENlcnRpZmljYXRlcy9TRVJWSUNFX0JST0tFUj9hcGktdmVyc2lvbj0yMDIxLTExLTAxLXByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "ab21b442-cb86-47bb-b167-1dfa32db391f" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.700.22.11601", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.17763", + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "ab6b660f-220d-430c-9aff-1ad60c813f64" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11995" + ], + "x-ms-correlation-request-id": [ + "3dfe0c63-11a7-4062-b225-20967e6bfdf2" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20220403T121300Z:3dfe0c63-11a7-4062-b225-20967e6bfdf2" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Sun, 03 Apr 2022 12:13:00 GMT" + ], + "Content-Length": [ + "4765" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"publicBlob\": \"308208B030820698A00302010202133300324F41E13F5EF148F8A5B8000000324F41300D06092A864886F70D01010C05003059310B3009060355040613025553311E301C060355040A13154D6963726F736F667420436F72706F726174696F6E312A3028060355040313214D6963726F736F667420417A75726520544C532049737375696E67204341203036301E170D3232303430333132303032345A170D3233303332393132303032345A3078310B3009060355040613025553310B30090603550408130257413110300E060355040713075265646D6F6E64311E301C060355040A13154D6963726F736F667420436F72706F726174696F6E312A3028060355040313213165366439306461353031362E64617461626173652E77696E646F77732E6E657430820122300D06092A864886F70D01010105000382010F003082010A0282010100B0176F84A1A46640309CC4CEAB95ED910AF7B4B3B3E46A74385977883A82DB6D36C4919C3B1546ADABF37AB8A0594A676CE40C9BA77552A598E9960692191330530821E976F83A9CD5B91C0111E3DED727E9C0AA32996C83298C7F8B5C90FDAA241BACEBC493A4FA80C2694552A1D8FDE688421ABD5B534261783AE3FBAB1AD49EA2980D607EE9804B5141C66ADD41B225B6FEEF28BBC0F25E3AE78FC6B76A2FA6E595AE81465481B5974884F49756B67DB9810CA8470B433EE0E8D314AD3CA8AA9CADE81FDDCE16210339E8165DCCE768F617BCCD7E4B55B22F361C5F369746FFE5AA6534696D41E8BF86702BACAB44739EAA7103DCB1923FDE221E375E12C10203010001A38204503082044C3082017C060A2B06010401D6790204020482016C048201680166007400E83ED0DA3EF5063532E75728BC896BC903D3CBD1116BECEB69E1777D6D06BD6E0000017FEF5564E9000004030045304302201479C3E6198B4D91A81A27F67A676D15288FF1CF5872969805DED63F144ADCDF021F7843FDA2EF8DD3AA0900108E37D515C49B8C6E1C9BAC87975BD225E62571AF0076007A328C54D8B72DB620EA38E0521EE98416703213854D3BD22BC13A57A352EB520000017FEF5565010000040300473045022021DD9E7DB819F5AC37B5ECAC27D4C43289ABC74A0415FC1F43E8D1A095C0A59E022100FB45C6016B4701AC1950B670FD89FF089137D426AC514A66D209B568E5B4F86A007600ADF7BEFA7CFF10C88B9D3D9C1E3E186AB467295DCFB10C24CA858634EBDC828A0000017FEF5564B30000040300473045022077D119A25311E5B420AE248C0D6F921AF209BF9A4260BED7B1B26DBAC166729902210097292FA9B7183BFE637AC57C500643975242B648ACEA87704F2DD2D474E8A2CF302706092B060104018237150A041A3018300A06082B06010505070302300A06082B06010505070301303C06092B0601040182371507042F302D06252B060104018237150887BDD71B81E7EB4682819D2E8ED00C87F0DA1D5D8284E56982F3A73E0201640201253081AE06082B060105050701010481A130819E306D06082B060105050730028661687474703A2F2F7777772E6D6963726F736F66742E636F6D2F706B696F70732F63657274732F4D6963726F736F6674253230417A757265253230544C5325323049737375696E67253230434125323030362532302D253230787369676E2E637274302D06082B060105050730018621687474703A2F2F6F6E656F6373702E6D6963726F736F66742E636F6D2F6F637370301D0603551D0E04160414EF7741E1A4EBB9ACC96ACB5EB4D617903AC2FA2E300E0603551D0F0101FF0404030204B030670603551D110460305E82396E65742D73646B2D637275642D74657374732D393737302E3165366439306461353031362E64617461626173652E77696E646F77732E6E657482213165366439306461353031362E64617461626173652E77696E646F77732E6E6574300C0603551D130101FF0402300030640603551D1F045D305B3059A057A0558653687474703A2F2F7777772E6D6963726F736F66742E636F6D2F706B696F70732F63726C2F4D6963726F736F6674253230417A757265253230544C5325323049737375696E67253230434125323030362E63726C30660603551D20045F305D3051060C2B0601040182374C837D01013041303F06082B060105050702011633687474703A2F2F7777772E6D6963726F736F66742E636F6D2F706B696F70732F446F63732F5265706F7369746F72792E68746D3008060667810C010202301F0603551D23041830168014D5C1673AC2A39DF477525B59123829E65568BBA5301D0603551D250416301406082B0601050507030206082B06010505070301300D06092A864886F70D01010C050003820201000E31E154F84426D36D2C7E9B61E7D05B636F23A06A987AAAAD6F04E8B5C558A1425E95EDACE02AC9EDAB06D56ACF925A364A2FFAED56675335ABDE384C9252C5C806525DC3FFDE2E58AC150D1BEF75B7CFB263E71B909E0B22A72CCA93E66C06A8658F284062A71EA4BD33466EEA14C1388BD3CEAA5F968C593C88F67235F749154BFEFAD6151C9BCD1E678D2D619961F259A9F6B96AE7F53A12B97822ED66FFBD89073D0984550387BC9F7DAB0000A77AA7E1990287697DB778497582A8D6A1C9CA5DC421E316F33080C8B270DFFDC4EE5D07F306BD10FBAC94058390C7C43A09C9E65A008DAD8D7E4EA5B04134A5CD7AA837C6D13A93024510BB500073E546A06BDBBC01896E3E89D4E08CC3D1B19967C49F553D413701777DC849C38A272FE43EC177C4C97F73902D7FF60A19772882B6E14F7ABF44FA4D5F25B9E04FAD5AD44BF7B57D17293036DB029F1C26A9E671810328B642EC74B7F7DCFC47531F0A3AF137E4723667ADF0A422E6EF8D18A8B09AFBD92CCD382CE3455EA696BA23FAB6ECFBD5DE820BE7CD873021A1683B081DF941BCE40BC1B398966E873BB51F948139A359F5DF98186AD0850429B3092417834FD3E2C3D10F8F38088CD6D5298DBB9B8D78011B134AF2FA7D338067946484CEF7E3C0210AAC2D478FC4AB6545B813F9CA47B7EC0AD7CC5AD7327D4C2F1F100F8FE518559C0C3D06D236870A31DC\"\r\n },\r\n \"id\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-6818/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-9770/endpointCertificates/SERVICE_BROKER\",\r\n \"name\": \"SERVICE_BROKER\",\r\n \"type\": \"Microsoft.Sql/managedInstances/endpointCertificates\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-6818/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-9770/endpointCertificates/DATABASE_MIRRORING?api-version=2021-11-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTY4MTgvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtOTc3MC9lbmRwb2ludENlcnRpZmljYXRlcy9EQVRBQkFTRV9NSVJST1JJTkc/YXBpLXZlcnNpb249MjAyMS0xMS0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "52baf0e0-7b74-4024-af2b-fbb332de6bd8" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.700.22.11601", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.17763", + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "4f46120e-c22d-4f00-8ff1-8de8acfca4c6" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11994" + ], + "x-ms-correlation-request-id": [ + "822e8833-a379-424a-9da6-8236b8f581a6" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20220403T121300Z:822e8833-a379-424a-9da6-8236b8f581a6" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Sun, 03 Apr 2022 12:13:00 GMT" + ], + "Content-Length": [ + "4773" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"publicBlob\": \"308208B030820698A00302010202133300324F41E13F5EF148F8A5B8000000324F41300D06092A864886F70D01010C05003059310B3009060355040613025553311E301C060355040A13154D6963726F736F667420436F72706F726174696F6E312A3028060355040313214D6963726F736F667420417A75726520544C532049737375696E67204341203036301E170D3232303430333132303032345A170D3233303332393132303032345A3078310B3009060355040613025553310B30090603550408130257413110300E060355040713075265646D6F6E64311E301C060355040A13154D6963726F736F667420436F72706F726174696F6E312A3028060355040313213165366439306461353031362E64617461626173652E77696E646F77732E6E657430820122300D06092A864886F70D01010105000382010F003082010A0282010100B0176F84A1A46640309CC4CEAB95ED910AF7B4B3B3E46A74385977883A82DB6D36C4919C3B1546ADABF37AB8A0594A676CE40C9BA77552A598E9960692191330530821E976F83A9CD5B91C0111E3DED727E9C0AA32996C83298C7F8B5C90FDAA241BACEBC493A4FA80C2694552A1D8FDE688421ABD5B534261783AE3FBAB1AD49EA2980D607EE9804B5141C66ADD41B225B6FEEF28BBC0F25E3AE78FC6B76A2FA6E595AE81465481B5974884F49756B67DB9810CA8470B433EE0E8D314AD3CA8AA9CADE81FDDCE16210339E8165DCCE768F617BCCD7E4B55B22F361C5F369746FFE5AA6534696D41E8BF86702BACAB44739EAA7103DCB1923FDE221E375E12C10203010001A38204503082044C3082017C060A2B06010401D6790204020482016C048201680166007400E83ED0DA3EF5063532E75728BC896BC903D3CBD1116BECEB69E1777D6D06BD6E0000017FEF5564E9000004030045304302201479C3E6198B4D91A81A27F67A676D15288FF1CF5872969805DED63F144ADCDF021F7843FDA2EF8DD3AA0900108E37D515C49B8C6E1C9BAC87975BD225E62571AF0076007A328C54D8B72DB620EA38E0521EE98416703213854D3BD22BC13A57A352EB520000017FEF5565010000040300473045022021DD9E7DB819F5AC37B5ECAC27D4C43289ABC74A0415FC1F43E8D1A095C0A59E022100FB45C6016B4701AC1950B670FD89FF089137D426AC514A66D209B568E5B4F86A007600ADF7BEFA7CFF10C88B9D3D9C1E3E186AB467295DCFB10C24CA858634EBDC828A0000017FEF5564B30000040300473045022077D119A25311E5B420AE248C0D6F921AF209BF9A4260BED7B1B26DBAC166729902210097292FA9B7183BFE637AC57C500643975242B648ACEA87704F2DD2D474E8A2CF302706092B060104018237150A041A3018300A06082B06010505070302300A06082B06010505070301303C06092B0601040182371507042F302D06252B060104018237150887BDD71B81E7EB4682819D2E8ED00C87F0DA1D5D8284E56982F3A73E0201640201253081AE06082B060105050701010481A130819E306D06082B060105050730028661687474703A2F2F7777772E6D6963726F736F66742E636F6D2F706B696F70732F63657274732F4D6963726F736F6674253230417A757265253230544C5325323049737375696E67253230434125323030362532302D253230787369676E2E637274302D06082B060105050730018621687474703A2F2F6F6E656F6373702E6D6963726F736F66742E636F6D2F6F637370301D0603551D0E04160414EF7741E1A4EBB9ACC96ACB5EB4D617903AC2FA2E300E0603551D0F0101FF0404030204B030670603551D110460305E82396E65742D73646B2D637275642D74657374732D393737302E3165366439306461353031362E64617461626173652E77696E646F77732E6E657482213165366439306461353031362E64617461626173652E77696E646F77732E6E6574300C0603551D130101FF0402300030640603551D1F045D305B3059A057A0558653687474703A2F2F7777772E6D6963726F736F66742E636F6D2F706B696F70732F63726C2F4D6963726F736F6674253230417A757265253230544C5325323049737375696E67253230434125323030362E63726C30660603551D20045F305D3051060C2B0601040182374C837D01013041303F06082B060105050702011633687474703A2F2F7777772E6D6963726F736F66742E636F6D2F706B696F70732F446F63732F5265706F7369746F72792E68746D3008060667810C010202301F0603551D23041830168014D5C1673AC2A39DF477525B59123829E65568BBA5301D0603551D250416301406082B0601050507030206082B06010505070301300D06092A864886F70D01010C050003820201000E31E154F84426D36D2C7E9B61E7D05B636F23A06A987AAAAD6F04E8B5C558A1425E95EDACE02AC9EDAB06D56ACF925A364A2FFAED56675335ABDE384C9252C5C806525DC3FFDE2E58AC150D1BEF75B7CFB263E71B909E0B22A72CCA93E66C06A8658F284062A71EA4BD33466EEA14C1388BD3CEAA5F968C593C88F67235F749154BFEFAD6151C9BCD1E678D2D619961F259A9F6B96AE7F53A12B97822ED66FFBD89073D0984550387BC9F7DAB0000A77AA7E1990287697DB778497582A8D6A1C9CA5DC421E316F33080C8B270DFFDC4EE5D07F306BD10FBAC94058390C7C43A09C9E65A008DAD8D7E4EA5B04134A5CD7AA837C6D13A93024510BB500073E546A06BDBBC01896E3E89D4E08CC3D1B19967C49F553D413701777DC849C38A272FE43EC177C4C97F73902D7FF60A19772882B6E14F7ABF44FA4D5F25B9E04FAD5AD44BF7B57D17293036DB029F1C26A9E671810328B642EC74B7F7DCFC47531F0A3AF137E4723667ADF0A422E6EF8D18A8B09AFBD92CCD382CE3455EA696BA23FAB6ECFBD5DE820BE7CD873021A1683B081DF941BCE40BC1B398966E873BB51F948139A359F5DF98186AD0850429B3092417834FD3E2C3D10F8F38088CD6D5298DBB9B8D78011B134AF2FA7D338067946484CEF7E3C0210AAC2D478FC4AB6545B813F9CA47B7EC0AD7CC5AD7327D4C2F1F100F8FE518559C0C3D06D236870A31DC\"\r\n },\r\n \"id\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-6818/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-9770/endpointCertificates/DATABASE_MIRRORING\",\r\n \"name\": \"DATABASE_MIRRORING\",\r\n \"type\": \"Microsoft.Sql/managedInstances/endpointCertificates\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-6818/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-9770/endpointCertificates?api-version=2021-11-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTY4MTgvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtOTc3MC9lbmRwb2ludENlcnRpZmljYXRlcz9hcGktdmVyc2lvbj0yMDIxLTExLTAxLXByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "f3b87e79-c87d-45e0-9c22-e96eb0012e88" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.700.22.11601", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.17763", + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "11fc0ce1-af73-473f-87a8-8764deff3749" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11993" + ], + "x-ms-correlation-request-id": [ + "d7e7709f-e677-436d-8b00-eb4201316067" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20220403T121300Z:d7e7709f-e677-436d-8b00-eb4201316067" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Sun, 03 Apr 2022 12:13:00 GMT" + ], + "Content-Length": [ + "9551" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"properties\": {\r\n \"publicBlob\": \"308208B030820698A00302010202133300324F41E13F5EF148F8A5B8000000324F41300D06092A864886F70D01010C05003059310B3009060355040613025553311E301C060355040A13154D6963726F736F667420436F72706F726174696F6E312A3028060355040313214D6963726F736F667420417A75726520544C532049737375696E67204341203036301E170D3232303430333132303032345A170D3233303332393132303032345A3078310B3009060355040613025553310B30090603550408130257413110300E060355040713075265646D6F6E64311E301C060355040A13154D6963726F736F667420436F72706F726174696F6E312A3028060355040313213165366439306461353031362E64617461626173652E77696E646F77732E6E657430820122300D06092A864886F70D01010105000382010F003082010A0282010100B0176F84A1A46640309CC4CEAB95ED910AF7B4B3B3E46A74385977883A82DB6D36C4919C3B1546ADABF37AB8A0594A676CE40C9BA77552A598E9960692191330530821E976F83A9CD5B91C0111E3DED727E9C0AA32996C83298C7F8B5C90FDAA241BACEBC493A4FA80C2694552A1D8FDE688421ABD5B534261783AE3FBAB1AD49EA2980D607EE9804B5141C66ADD41B225B6FEEF28BBC0F25E3AE78FC6B76A2FA6E595AE81465481B5974884F49756B67DB9810CA8470B433EE0E8D314AD3CA8AA9CADE81FDDCE16210339E8165DCCE768F617BCCD7E4B55B22F361C5F369746FFE5AA6534696D41E8BF86702BACAB44739EAA7103DCB1923FDE221E375E12C10203010001A38204503082044C3082017C060A2B06010401D6790204020482016C048201680166007400E83ED0DA3EF5063532E75728BC896BC903D3CBD1116BECEB69E1777D6D06BD6E0000017FEF5564E9000004030045304302201479C3E6198B4D91A81A27F67A676D15288FF1CF5872969805DED63F144ADCDF021F7843FDA2EF8DD3AA0900108E37D515C49B8C6E1C9BAC87975BD225E62571AF0076007A328C54D8B72DB620EA38E0521EE98416703213854D3BD22BC13A57A352EB520000017FEF5565010000040300473045022021DD9E7DB819F5AC37B5ECAC27D4C43289ABC74A0415FC1F43E8D1A095C0A59E022100FB45C6016B4701AC1950B670FD89FF089137D426AC514A66D209B568E5B4F86A007600ADF7BEFA7CFF10C88B9D3D9C1E3E186AB467295DCFB10C24CA858634EBDC828A0000017FEF5564B30000040300473045022077D119A25311E5B420AE248C0D6F921AF209BF9A4260BED7B1B26DBAC166729902210097292FA9B7183BFE637AC57C500643975242B648ACEA87704F2DD2D474E8A2CF302706092B060104018237150A041A3018300A06082B06010505070302300A06082B06010505070301303C06092B0601040182371507042F302D06252B060104018237150887BDD71B81E7EB4682819D2E8ED00C87F0DA1D5D8284E56982F3A73E0201640201253081AE06082B060105050701010481A130819E306D06082B060105050730028661687474703A2F2F7777772E6D6963726F736F66742E636F6D2F706B696F70732F63657274732F4D6963726F736F6674253230417A757265253230544C5325323049737375696E67253230434125323030362532302D253230787369676E2E637274302D06082B060105050730018621687474703A2F2F6F6E656F6373702E6D6963726F736F66742E636F6D2F6F637370301D0603551D0E04160414EF7741E1A4EBB9ACC96ACB5EB4D617903AC2FA2E300E0603551D0F0101FF0404030204B030670603551D110460305E82396E65742D73646B2D637275642D74657374732D393737302E3165366439306461353031362E64617461626173652E77696E646F77732E6E657482213165366439306461353031362E64617461626173652E77696E646F77732E6E6574300C0603551D130101FF0402300030640603551D1F045D305B3059A057A0558653687474703A2F2F7777772E6D6963726F736F66742E636F6D2F706B696F70732F63726C2F4D6963726F736F6674253230417A757265253230544C5325323049737375696E67253230434125323030362E63726C30660603551D20045F305D3051060C2B0601040182374C837D01013041303F06082B060105050702011633687474703A2F2F7777772E6D6963726F736F66742E636F6D2F706B696F70732F446F63732F5265706F7369746F72792E68746D3008060667810C010202301F0603551D23041830168014D5C1673AC2A39DF477525B59123829E65568BBA5301D0603551D250416301406082B0601050507030206082B06010505070301300D06092A864886F70D01010C050003820201000E31E154F84426D36D2C7E9B61E7D05B636F23A06A987AAAAD6F04E8B5C558A1425E95EDACE02AC9EDAB06D56ACF925A364A2FFAED56675335ABDE384C9252C5C806525DC3FFDE2E58AC150D1BEF75B7CFB263E71B909E0B22A72CCA93E66C06A8658F284062A71EA4BD33466EEA14C1388BD3CEAA5F968C593C88F67235F749154BFEFAD6151C9BCD1E678D2D619961F259A9F6B96AE7F53A12B97822ED66FFBD89073D0984550387BC9F7DAB0000A77AA7E1990287697DB778497582A8D6A1C9CA5DC421E316F33080C8B270DFFDC4EE5D07F306BD10FBAC94058390C7C43A09C9E65A008DAD8D7E4EA5B04134A5CD7AA837C6D13A93024510BB500073E546A06BDBBC01896E3E89D4E08CC3D1B19967C49F553D413701777DC849C38A272FE43EC177C4C97F73902D7FF60A19772882B6E14F7ABF44FA4D5F25B9E04FAD5AD44BF7B57D17293036DB029F1C26A9E671810328B642EC74B7F7DCFC47531F0A3AF137E4723667ADF0A422E6EF8D18A8B09AFBD92CCD382CE3455EA696BA23FAB6ECFBD5DE820BE7CD873021A1683B081DF941BCE40BC1B398966E873BB51F948139A359F5DF98186AD0850429B3092417834FD3E2C3D10F8F38088CD6D5298DBB9B8D78011B134AF2FA7D338067946484CEF7E3C0210AAC2D478FC4AB6545B813F9CA47B7EC0AD7CC5AD7327D4C2F1F100F8FE518559C0C3D06D236870A31DC\"\r\n },\r\n \"id\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-6818/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-9770/endpointCertificates/SERVICE_BROKER\",\r\n \"name\": \"SERVICE_BROKER\",\r\n \"type\": \"Microsoft.Sql/managedInstances/endpointCertificates\"\r\n },\r\n {\r\n \"properties\": {\r\n \"publicBlob\": \"308208B030820698A00302010202133300324F41E13F5EF148F8A5B8000000324F41300D06092A864886F70D01010C05003059310B3009060355040613025553311E301C060355040A13154D6963726F736F667420436F72706F726174696F6E312A3028060355040313214D6963726F736F667420417A75726520544C532049737375696E67204341203036301E170D3232303430333132303032345A170D3233303332393132303032345A3078310B3009060355040613025553310B30090603550408130257413110300E060355040713075265646D6F6E64311E301C060355040A13154D6963726F736F667420436F72706F726174696F6E312A3028060355040313213165366439306461353031362E64617461626173652E77696E646F77732E6E657430820122300D06092A864886F70D01010105000382010F003082010A0282010100B0176F84A1A46640309CC4CEAB95ED910AF7B4B3B3E46A74385977883A82DB6D36C4919C3B1546ADABF37AB8A0594A676CE40C9BA77552A598E9960692191330530821E976F83A9CD5B91C0111E3DED727E9C0AA32996C83298C7F8B5C90FDAA241BACEBC493A4FA80C2694552A1D8FDE688421ABD5B534261783AE3FBAB1AD49EA2980D607EE9804B5141C66ADD41B225B6FEEF28BBC0F25E3AE78FC6B76A2FA6E595AE81465481B5974884F49756B67DB9810CA8470B433EE0E8D314AD3CA8AA9CADE81FDDCE16210339E8165DCCE768F617BCCD7E4B55B22F361C5F369746FFE5AA6534696D41E8BF86702BACAB44739EAA7103DCB1923FDE221E375E12C10203010001A38204503082044C3082017C060A2B06010401D6790204020482016C048201680166007400E83ED0DA3EF5063532E75728BC896BC903D3CBD1116BECEB69E1777D6D06BD6E0000017FEF5564E9000004030045304302201479C3E6198B4D91A81A27F67A676D15288FF1CF5872969805DED63F144ADCDF021F7843FDA2EF8DD3AA0900108E37D515C49B8C6E1C9BAC87975BD225E62571AF0076007A328C54D8B72DB620EA38E0521EE98416703213854D3BD22BC13A57A352EB520000017FEF5565010000040300473045022021DD9E7DB819F5AC37B5ECAC27D4C43289ABC74A0415FC1F43E8D1A095C0A59E022100FB45C6016B4701AC1950B670FD89FF089137D426AC514A66D209B568E5B4F86A007600ADF7BEFA7CFF10C88B9D3D9C1E3E186AB467295DCFB10C24CA858634EBDC828A0000017FEF5564B30000040300473045022077D119A25311E5B420AE248C0D6F921AF209BF9A4260BED7B1B26DBAC166729902210097292FA9B7183BFE637AC57C500643975242B648ACEA87704F2DD2D474E8A2CF302706092B060104018237150A041A3018300A06082B06010505070302300A06082B06010505070301303C06092B0601040182371507042F302D06252B060104018237150887BDD71B81E7EB4682819D2E8ED00C87F0DA1D5D8284E56982F3A73E0201640201253081AE06082B060105050701010481A130819E306D06082B060105050730028661687474703A2F2F7777772E6D6963726F736F66742E636F6D2F706B696F70732F63657274732F4D6963726F736F6674253230417A757265253230544C5325323049737375696E67253230434125323030362532302D253230787369676E2E637274302D06082B060105050730018621687474703A2F2F6F6E656F6373702E6D6963726F736F66742E636F6D2F6F637370301D0603551D0E04160414EF7741E1A4EBB9ACC96ACB5EB4D617903AC2FA2E300E0603551D0F0101FF0404030204B030670603551D110460305E82396E65742D73646B2D637275642D74657374732D393737302E3165366439306461353031362E64617461626173652E77696E646F77732E6E657482213165366439306461353031362E64617461626173652E77696E646F77732E6E6574300C0603551D130101FF0402300030640603551D1F045D305B3059A057A0558653687474703A2F2F7777772E6D6963726F736F66742E636F6D2F706B696F70732F63726C2F4D6963726F736F6674253230417A757265253230544C5325323049737375696E67253230434125323030362E63726C30660603551D20045F305D3051060C2B0601040182374C837D01013041303F06082B060105050702011633687474703A2F2F7777772E6D6963726F736F66742E636F6D2F706B696F70732F446F63732F5265706F7369746F72792E68746D3008060667810C010202301F0603551D23041830168014D5C1673AC2A39DF477525B59123829E65568BBA5301D0603551D250416301406082B0601050507030206082B06010505070301300D06092A864886F70D01010C050003820201000E31E154F84426D36D2C7E9B61E7D05B636F23A06A987AAAAD6F04E8B5C558A1425E95EDACE02AC9EDAB06D56ACF925A364A2FFAED56675335ABDE384C9252C5C806525DC3FFDE2E58AC150D1BEF75B7CFB263E71B909E0B22A72CCA93E66C06A8658F284062A71EA4BD33466EEA14C1388BD3CEAA5F968C593C88F67235F749154BFEFAD6151C9BCD1E678D2D619961F259A9F6B96AE7F53A12B97822ED66FFBD89073D0984550387BC9F7DAB0000A77AA7E1990287697DB778497582A8D6A1C9CA5DC421E316F33080C8B270DFFDC4EE5D07F306BD10FBAC94058390C7C43A09C9E65A008DAD8D7E4EA5B04134A5CD7AA837C6D13A93024510BB500073E546A06BDBBC01896E3E89D4E08CC3D1B19967C49F553D413701777DC849C38A272FE43EC177C4C97F73902D7FF60A19772882B6E14F7ABF44FA4D5F25B9E04FAD5AD44BF7B57D17293036DB029F1C26A9E671810328B642EC74B7F7DCFC47531F0A3AF137E4723667ADF0A422E6EF8D18A8B09AFBD92CCD382CE3455EA696BA23FAB6ECFBD5DE820BE7CD873021A1683B081DF941BCE40BC1B398966E873BB51F948139A359F5DF98186AD0850429B3092417834FD3E2C3D10F8F38088CD6D5298DBB9B8D78011B134AF2FA7D338067946484CEF7E3C0210AAC2D478FC4AB6545B813F9CA47B7EC0AD7CC5AD7327D4C2F1F100F8FE518559C0C3D06D236870A31DC\"\r\n },\r\n \"id\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-6818/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-9770/endpointCertificates/DATABASE_MIRRORING\",\r\n \"name\": \"DATABASE_MIRRORING\",\r\n \"type\": \"Microsoft.Sql/managedInstances/endpointCertificates\"\r\n }\r\n ]\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourcegroups/sqlcrudtest-6818?api-version=2017-05-10", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlZ3JvdXBzL3NxbGNydWR0ZXN0LTY4MTg/YXBpLXZlcnNpb249MjAxNy0wNS0xMA==", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "8db6e295-b2d7-4d10-9a79-1985bd89f7a1" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.700.22.11601", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.17763", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.6.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/8313371e-0879-428e-b1da-6353575a9192/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1TUUxDUlVEVEVTVDoyRDY4MTgtV0VTVENFTlRSQUxVUyIsImpvYkxvY2F0aW9uIjoid2VzdGNlbnRyYWx1cyJ9?api-version=2017-05-10" + ], + "Retry-After": [ + "15" + ], + "x-ms-ratelimit-remaining-subscription-deletes": [ + "14999" + ], + "x-ms-request-id": [ + "b0c31f6b-950f-40f7-86eb-d313a3f28f9f" + ], + "x-ms-correlation-request-id": [ + "b0c31f6b-950f-40f7-86eb-d313a3f28f9f" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20220403T121304Z:b0c31f6b-950f-40f7-86eb-d313a3f28f9f" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Sun, 03 Apr 2022 12:13:03 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + } + ], + "Names": { + "CreateResourceGroup": [ + "sqlcrudtest-6818" + ], + "CreateManagedInstance": [ + "net-sdk-crud-tests-9770" + ] + }, + "Variables": { + "SubscriptionId": "8313371e-0879-428e-b1da-6353575a9192" + } +} \ No newline at end of file diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/tests/SessionRecords/ManagedInstanceHybridLinkTests/TestServerTrustCertificates.json b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/tests/SessionRecords/ManagedInstanceHybridLinkTests/TestServerTrustCertificates.json index 431d449d88f4..4ad4b855f517 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/tests/SessionRecords/ManagedInstanceHybridLinkTests/TestServerTrustCertificates.json +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/tests/SessionRecords/ManagedInstanceHybridLinkTests/TestServerTrustCertificates.json @@ -1,19 +1,19 @@ { "Entries": [ { - "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourcegroups/sqlcrudtest-5787?api-version=2017-05-10", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlZ3JvdXBzL3NxbGNydWR0ZXN0LTU3ODc/YXBpLXZlcnNpb249MjAxNy0wNS0xMA==", + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourcegroups/sqlcrudtest-5451?api-version=2017-05-10", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlZ3JvdXBzL3NxbGNydWR0ZXN0LTU0NTE/YXBpLXZlcnNpb249MjAxNy0wNS0xMA==", "RequestMethod": "PUT", - "RequestBody": "{\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"sqlcrudtest-5787\": \"2022-02-23 12:55:50Z\"\r\n }\r\n}", + "RequestBody": "{\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"sqlcrudtest-5451\": \"2022-04-03 11:58:56Z\"\r\n }\r\n}", "RequestHeaders": { "x-ms-client-request-id": [ - "79357fea-76df-4fa5-91e0-242b7dbf3319" + "3098153a-c173-4579-9274-8bc9839ff15c" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.21.56803", + "FxVersion/4.700.22.11601", "OSName/Windows", "OSVersion/Microsoft.Windows.10.0.17763", "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.6.0.0" @@ -36,13 +36,13 @@ "1199" ], "x-ms-request-id": [ - "ca74ec3b-d441-4118-a8d0-6815f334c4bd" + "0ec8d698-28b4-4ee3-988c-49805054bdc2" ], "x-ms-correlation-request-id": [ - "ca74ec3b-d441-4118-a8d0-6815f334c4bd" + "0ec8d698-28b4-4ee3-988c-49805054bdc2" ], "x-ms-routing-request-id": [ - "UKSOUTH:20220223T125553Z:ca74ec3b-d441-4118-a8d0-6815f334c4bd" + "UKSOUTH:20220403T115859Z:0ec8d698-28b4-4ee3-988c-49805054bdc2" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -51,7 +51,7 @@ "nosniff" ], "Date": [ - "Wed, 23 Feb 2022 12:55:52 GMT" + "Sun, 03 Apr 2022 11:58:58 GMT" ], "Content-Length": [ "243" @@ -63,26 +63,26 @@ "-1" ] }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5787\",\r\n \"name\": \"sqlcrudtest-5787\",\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"sqlcrudtest-5787\": \"2022-02-23 12:55:50Z\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseBody": "{\r\n \"id\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451\",\r\n \"name\": \"sqlcrudtest-5451\",\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"sqlcrudtest-5451\": \"2022-04-03 11:58:56Z\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", "StatusCode": 201 }, { - "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5787/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-4807?api-version=2021-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU3ODcvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNDgwNz9hcGktdmVyc2lvbj0yMDIxLTA1LTAxLXByZXZpZXc=", + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-2310?api-version=2021-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU0NTEvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtMjMxMD9hcGktdmVyc2lvbj0yMDIxLTA1LTAxLXByZXZpZXc=", "RequestMethod": "PUT", - "RequestBody": "{\r\n \"properties\": {\r\n \"administratorLogin\": \"dummylogin\",\r\n \"administratorLoginPassword\": \"966c486b-b2fd-42f8-bfb1-5f190b4fb09d\",\r\n \"subnetId\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/CustomerExperienceTeam_RG/providers/Microsoft.Network/virtualNetworks/vnet-mi-tooling/subnets/ManagedInstance\",\r\n \"vCores\": 4,\r\n \"storageSizeInGB\": 32,\r\n \"requestedBackupStorageRedundancy\": \"Geo\"\r\n },\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"test\": \"azure-sdk-for-net\"\r\n }\r\n}", + "RequestBody": "{\r\n \"properties\": {\r\n \"administratorLogin\": \"dummylogin\",\r\n \"administratorLoginPassword\": \"cde98dac-c1b5-4087-8a2f-3fac4c43b6e8\",\r\n \"subnetId\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/CustomerExperienceTeam_RG/providers/Microsoft.Network/virtualNetworks/vnet-mi-tooling/subnets/ManagedInstance\",\r\n \"vCores\": 4,\r\n \"storageSizeInGB\": 32,\r\n \"requestedBackupStorageRedundancy\": \"Geo\"\r\n },\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"test\": \"azure-sdk-for-net\"\r\n }\r\n}", "RequestHeaders": { "x-ms-client-request-id": [ - "3b26e554-3d6a-437f-abed-4a4656a125d7" + "1c9eb785-2e27-486d-924d-2e1700d539ce" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.21.56803", + "FxVersion/4.700.22.11601", "OSName/Windows", "OSVersion/Microsoft.Windows.10.0.17763", - "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.0.0" + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" ], "Content-Type": [ "application/json; charset=utf-8" @@ -102,7 +102,7 @@ "60" ], "x-ms-request-id": [ - "e51887e2-f394-452b-8695-045d5fe77baa" + "43693b71-e31c-496c-9f98-c654747cc0f8" ], "Server": [ "Microsoft-HTTPAPI/2.0" @@ -111,10 +111,10 @@ "1199" ], "x-ms-correlation-request-id": [ - "5ace2620-f724-4d11-bbf2-bd7ebc1397e4" + "98dfa76d-9ce4-4842-a762-cb4502b1687d" ], "x-ms-routing-request-id": [ - "UKSOUTH:20220223T125602Z:5ace2620-f724-4d11-bbf2-bd7ebc1397e4" + "UKSOUTH:20220403T115906Z:98dfa76d-9ce4-4842-a762-cb4502b1687d" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -123,7 +123,7 @@ "nosniff" ], "Date": [ - "Wed, 23 Feb 2022 12:56:02 GMT" + "Sun, 03 Apr 2022 11:59:06 GMT" ], "Content-Length": [ "761" @@ -135,20 +135,20 @@ "-1" ] }, - "ResponseBody": "{\r\n \"identity\": {\r\n \"type\": \"None\"\r\n },\r\n \"sku\": {\r\n \"name\": \"GP_Gen5\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen5\",\r\n \"capacity\": 4\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Creating\",\r\n \"administratorLogin\": \"dummylogin\",\r\n \"licenseType\": \"LicenseIncluded\",\r\n \"vCores\": 4,\r\n \"storageSizeInGB\": 32,\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"timezoneId\": \"UTC\",\r\n \"maintenanceConfigurationId\": \"SystemDefault\",\r\n \"privateEndpointConnections\": [],\r\n \"currentBackupStorageRedundancy\": \"Geo\",\r\n \"requestedBackupStorageRedundancy\": \"Geo\"\r\n },\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"test\": \"azure-sdk-for-net\"\r\n },\r\n \"id\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5787/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-4807\",\r\n \"name\": \"net-sdk-crud-tests-4807\",\r\n \"type\": \"Microsoft.Sql/managedInstances\"\r\n}", + "ResponseBody": "{\r\n \"identity\": {\r\n \"type\": \"None\"\r\n },\r\n \"sku\": {\r\n \"name\": \"GP_Gen5\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen5\",\r\n \"capacity\": 4\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Creating\",\r\n \"administratorLogin\": \"dummylogin\",\r\n \"licenseType\": \"LicenseIncluded\",\r\n \"vCores\": 4,\r\n \"storageSizeInGB\": 32,\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"timezoneId\": \"UTC\",\r\n \"maintenanceConfigurationId\": \"SystemDefault\",\r\n \"privateEndpointConnections\": [],\r\n \"currentBackupStorageRedundancy\": \"Geo\",\r\n \"requestedBackupStorageRedundancy\": \"Geo\"\r\n },\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"test\": \"azure-sdk-for-net\"\r\n },\r\n \"id\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-2310\",\r\n \"name\": \"net-sdk-crud-tests-2310\",\r\n \"type\": \"Microsoft.Sql/managedInstances\"\r\n}", "StatusCode": 201 }, { - "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5787/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-4807?api-version=2021-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU3ODcvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNDgwNz9hcGktdmVyc2lvbj0yMDIxLTA1LTAxLXByZXZpZXc=", + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-2310?api-version=2021-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU0NTEvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtMjMxMD9hcGktdmVyc2lvbj0yMDIxLTA1LTAxLXByZXZpZXc=", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "User-Agent": [ - "FxVersion/4.700.21.56803", + "FxVersion/4.700.22.11601", "OSName/Windows", "OSVersion/Microsoft.Windows.10.0.17763", - "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.0.0" + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" ] }, "ResponseHeaders": { @@ -159,7 +159,7 @@ "no-cache" ], "x-ms-request-id": [ - "76637da9-6101-4ec4-91b7-905630cd365e" + "54861694-da6c-4892-94d8-75f70f9003fe" ], "Server": [ "Microsoft-HTTPAPI/2.0" @@ -168,10 +168,10 @@ "11999" ], "x-ms-correlation-request-id": [ - "bec17d70-5d99-4932-a5f6-e425f34d3e49" + "aac50145-2ac3-416d-af73-87cbe76d3520" ], "x-ms-routing-request-id": [ - "UKSOUTH:20220223T125703Z:bec17d70-5d99-4932-a5f6-e425f34d3e49" + "UKSOUTH:20220403T120007Z:aac50145-2ac3-416d-af73-87cbe76d3520" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -180,7 +180,7 @@ "nosniff" ], "Date": [ - "Wed, 23 Feb 2022 12:57:03 GMT" + "Sun, 03 Apr 2022 12:00:06 GMT" ], "Content-Length": [ "1225" @@ -192,20 +192,20 @@ "-1" ] }, - "ResponseBody": "{\r\n \"sku\": {\r\n \"name\": \"GP_Gen5\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen5\",\r\n \"capacity\": 4\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Creating\",\r\n \"fullyQualifiedDomainName\": \"net-sdk-crud-tests-4807.1e6d90da5016.database.windows.net\",\r\n \"administratorLogin\": \"dummylogin\",\r\n \"subnetId\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/CustomerExperienceTeam_RG/providers/Microsoft.Network/virtualNetworks/vnet-mi-tooling/subnets/ManagedInstance\",\r\n \"state\": \"Creating\",\r\n \"licenseType\": \"LicenseIncluded\",\r\n \"vCores\": 4,\r\n \"storageSizeInGB\": 32,\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"dnsZone\": \"1e6d90da5016\",\r\n \"publicDataEndpointEnabled\": false,\r\n \"timezoneId\": \"UTC\",\r\n \"maintenanceConfigurationId\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default\",\r\n \"privateEndpointConnections\": [],\r\n \"currentBackupStorageRedundancy\": \"Geo\",\r\n \"requestedBackupStorageRedundancy\": \"Geo\",\r\n \"zoneRedundant\": false\r\n },\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"test\": \"azure-sdk-for-net\"\r\n },\r\n \"id\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5787/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-4807\",\r\n \"name\": \"net-sdk-crud-tests-4807\",\r\n \"type\": \"Microsoft.Sql/managedInstances\"\r\n}", + "ResponseBody": "{\r\n \"sku\": {\r\n \"name\": \"GP_Gen5\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen5\",\r\n \"capacity\": 4\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Creating\",\r\n \"fullyQualifiedDomainName\": \"net-sdk-crud-tests-2310.1e6d90da5016.database.windows.net\",\r\n \"administratorLogin\": \"dummylogin\",\r\n \"subnetId\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/CustomerExperienceTeam_RG/providers/Microsoft.Network/virtualNetworks/vnet-mi-tooling/subnets/ManagedInstance\",\r\n \"state\": \"Creating\",\r\n \"licenseType\": \"LicenseIncluded\",\r\n \"vCores\": 4,\r\n \"storageSizeInGB\": 32,\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"dnsZone\": \"1e6d90da5016\",\r\n \"publicDataEndpointEnabled\": false,\r\n \"timezoneId\": \"UTC\",\r\n \"maintenanceConfigurationId\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default\",\r\n \"privateEndpointConnections\": [],\r\n \"currentBackupStorageRedundancy\": \"Geo\",\r\n \"requestedBackupStorageRedundancy\": \"Geo\",\r\n \"zoneRedundant\": false\r\n },\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"test\": \"azure-sdk-for-net\"\r\n },\r\n \"id\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-2310\",\r\n \"name\": \"net-sdk-crud-tests-2310\",\r\n \"type\": \"Microsoft.Sql/managedInstances\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5787/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-4807?api-version=2021-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU3ODcvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNDgwNz9hcGktdmVyc2lvbj0yMDIxLTA1LTAxLXByZXZpZXc=", + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-2310?api-version=2021-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU0NTEvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtMjMxMD9hcGktdmVyc2lvbj0yMDIxLTA1LTAxLXByZXZpZXc=", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "User-Agent": [ - "FxVersion/4.700.21.56803", + "FxVersion/4.700.22.11601", "OSName/Windows", "OSVersion/Microsoft.Windows.10.0.17763", - "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.0.0" + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" ] }, "ResponseHeaders": { @@ -216,7 +216,7 @@ "no-cache" ], "x-ms-request-id": [ - "027ded77-ecfc-4c45-b3a2-7056e588fb9b" + "ae49d6c8-1fd2-4ce2-aa1d-34f9ef3a4828" ], "Server": [ "Microsoft-HTTPAPI/2.0" @@ -225,10 +225,10 @@ "11998" ], "x-ms-correlation-request-id": [ - "6b0debd5-ff92-4826-a0a9-a1696c0d373c" + "09235a0d-c1ee-428b-92b6-c509be6f5c1c" ], "x-ms-routing-request-id": [ - "UKSOUTH:20220223T125804Z:6b0debd5-ff92-4826-a0a9-a1696c0d373c" + "UKSOUTH:20220403T120107Z:09235a0d-c1ee-428b-92b6-c509be6f5c1c" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -237,7 +237,7 @@ "nosniff" ], "Date": [ - "Wed, 23 Feb 2022 12:58:03 GMT" + "Sun, 03 Apr 2022 12:01:07 GMT" ], "Content-Length": [ "1225" @@ -249,20 +249,20 @@ "-1" ] }, - "ResponseBody": "{\r\n \"sku\": {\r\n \"name\": \"GP_Gen5\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen5\",\r\n \"capacity\": 4\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Creating\",\r\n \"fullyQualifiedDomainName\": \"net-sdk-crud-tests-4807.1e6d90da5016.database.windows.net\",\r\n \"administratorLogin\": \"dummylogin\",\r\n \"subnetId\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/CustomerExperienceTeam_RG/providers/Microsoft.Network/virtualNetworks/vnet-mi-tooling/subnets/ManagedInstance\",\r\n \"state\": \"Creating\",\r\n \"licenseType\": \"LicenseIncluded\",\r\n \"vCores\": 4,\r\n \"storageSizeInGB\": 32,\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"dnsZone\": \"1e6d90da5016\",\r\n \"publicDataEndpointEnabled\": false,\r\n \"timezoneId\": \"UTC\",\r\n \"maintenanceConfigurationId\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default\",\r\n \"privateEndpointConnections\": [],\r\n \"currentBackupStorageRedundancy\": \"Geo\",\r\n \"requestedBackupStorageRedundancy\": \"Geo\",\r\n \"zoneRedundant\": false\r\n },\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"test\": \"azure-sdk-for-net\"\r\n },\r\n \"id\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5787/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-4807\",\r\n \"name\": \"net-sdk-crud-tests-4807\",\r\n \"type\": \"Microsoft.Sql/managedInstances\"\r\n}", + "ResponseBody": "{\r\n \"sku\": {\r\n \"name\": \"GP_Gen5\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen5\",\r\n \"capacity\": 4\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Creating\",\r\n \"fullyQualifiedDomainName\": \"net-sdk-crud-tests-2310.1e6d90da5016.database.windows.net\",\r\n \"administratorLogin\": \"dummylogin\",\r\n \"subnetId\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/CustomerExperienceTeam_RG/providers/Microsoft.Network/virtualNetworks/vnet-mi-tooling/subnets/ManagedInstance\",\r\n \"state\": \"Creating\",\r\n \"licenseType\": \"LicenseIncluded\",\r\n \"vCores\": 4,\r\n \"storageSizeInGB\": 32,\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"dnsZone\": \"1e6d90da5016\",\r\n \"publicDataEndpointEnabled\": false,\r\n \"timezoneId\": \"UTC\",\r\n \"maintenanceConfigurationId\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default\",\r\n \"privateEndpointConnections\": [],\r\n \"currentBackupStorageRedundancy\": \"Geo\",\r\n \"requestedBackupStorageRedundancy\": \"Geo\",\r\n \"zoneRedundant\": false\r\n },\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"test\": \"azure-sdk-for-net\"\r\n },\r\n \"id\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-2310\",\r\n \"name\": \"net-sdk-crud-tests-2310\",\r\n \"type\": \"Microsoft.Sql/managedInstances\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5787/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-4807?api-version=2021-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU3ODcvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNDgwNz9hcGktdmVyc2lvbj0yMDIxLTA1LTAxLXByZXZpZXc=", + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-2310?api-version=2021-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU0NTEvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtMjMxMD9hcGktdmVyc2lvbj0yMDIxLTA1LTAxLXByZXZpZXc=", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "User-Agent": [ - "FxVersion/4.700.21.56803", + "FxVersion/4.700.22.11601", "OSName/Windows", "OSVersion/Microsoft.Windows.10.0.17763", - "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.0.0" + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" ] }, "ResponseHeaders": { @@ -273,7 +273,7 @@ "no-cache" ], "x-ms-request-id": [ - "e05b9ed5-1388-4e94-95d2-67d417f8ab26" + "3e06a23d-9a40-4eb8-a8c4-133f2620facf" ], "Server": [ "Microsoft-HTTPAPI/2.0" @@ -282,10 +282,10 @@ "11997" ], "x-ms-correlation-request-id": [ - "4876216c-d29e-4ac6-9d2a-c09f87b92978" + "23667bd8-548e-448f-a049-f21a323314c0" ], "x-ms-routing-request-id": [ - "UKSOUTH:20220223T125904Z:4876216c-d29e-4ac6-9d2a-c09f87b92978" + "UKSOUTH:20220403T120208Z:23667bd8-548e-448f-a049-f21a323314c0" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -294,64 +294,7 @@ "nosniff" ], "Date": [ - "Wed, 23 Feb 2022 12:59:04 GMT" - ], - "Content-Length": [ - "1225" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"sku\": {\r\n \"name\": \"GP_Gen5\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen5\",\r\n \"capacity\": 4\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Creating\",\r\n \"fullyQualifiedDomainName\": \"net-sdk-crud-tests-4807.1e6d90da5016.database.windows.net\",\r\n \"administratorLogin\": \"dummylogin\",\r\n \"subnetId\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/CustomerExperienceTeam_RG/providers/Microsoft.Network/virtualNetworks/vnet-mi-tooling/subnets/ManagedInstance\",\r\n \"state\": \"Creating\",\r\n \"licenseType\": \"LicenseIncluded\",\r\n \"vCores\": 4,\r\n \"storageSizeInGB\": 32,\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"dnsZone\": \"1e6d90da5016\",\r\n \"publicDataEndpointEnabled\": false,\r\n \"timezoneId\": \"UTC\",\r\n \"maintenanceConfigurationId\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default\",\r\n \"privateEndpointConnections\": [],\r\n \"currentBackupStorageRedundancy\": \"Geo\",\r\n \"requestedBackupStorageRedundancy\": \"Geo\",\r\n \"zoneRedundant\": false\r\n },\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"test\": \"azure-sdk-for-net\"\r\n },\r\n \"id\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5787/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-4807\",\r\n \"name\": \"net-sdk-crud-tests-4807\",\r\n \"type\": \"Microsoft.Sql/managedInstances\"\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5787/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-4807?api-version=2021-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU3ODcvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNDgwNz9hcGktdmVyc2lvbj0yMDIxLTA1LTAxLXByZXZpZXc=", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.700.21.56803", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.17763", - "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "46ee7549-52b5-4268-b129-a79e531240f9" - ], - "Server": [ - "Microsoft-HTTPAPI/2.0" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11996" - ], - "x-ms-correlation-request-id": [ - "c84ac471-8151-4241-ae8f-7075891940ec" - ], - "x-ms-routing-request-id": [ - "UKSOUTH:20220223T130005Z:c84ac471-8151-4241-ae8f-7075891940ec" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Wed, 23 Feb 2022 13:00:04 GMT" + "Sun, 03 Apr 2022 12:02:08 GMT" ], "Content-Length": [ "1223" @@ -363,26 +306,26 @@ "-1" ] }, - "ResponseBody": "{\r\n \"sku\": {\r\n \"name\": \"GP_Gen5\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen5\",\r\n \"capacity\": 4\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"fullyQualifiedDomainName\": \"net-sdk-crud-tests-4807.1e6d90da5016.database.windows.net\",\r\n \"administratorLogin\": \"dummylogin\",\r\n \"subnetId\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/CustomerExperienceTeam_RG/providers/Microsoft.Network/virtualNetworks/vnet-mi-tooling/subnets/ManagedInstance\",\r\n \"state\": \"Ready\",\r\n \"licenseType\": \"LicenseIncluded\",\r\n \"vCores\": 4,\r\n \"storageSizeInGB\": 32,\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"dnsZone\": \"1e6d90da5016\",\r\n \"publicDataEndpointEnabled\": false,\r\n \"timezoneId\": \"UTC\",\r\n \"maintenanceConfigurationId\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default\",\r\n \"privateEndpointConnections\": [],\r\n \"currentBackupStorageRedundancy\": \"Geo\",\r\n \"requestedBackupStorageRedundancy\": \"Geo\",\r\n \"zoneRedundant\": false\r\n },\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"test\": \"azure-sdk-for-net\"\r\n },\r\n \"id\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5787/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-4807\",\r\n \"name\": \"net-sdk-crud-tests-4807\",\r\n \"type\": \"Microsoft.Sql/managedInstances\"\r\n}", + "ResponseBody": "{\r\n \"sku\": {\r\n \"name\": \"GP_Gen5\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen5\",\r\n \"capacity\": 4\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"fullyQualifiedDomainName\": \"net-sdk-crud-tests-2310.1e6d90da5016.database.windows.net\",\r\n \"administratorLogin\": \"dummylogin\",\r\n \"subnetId\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/CustomerExperienceTeam_RG/providers/Microsoft.Network/virtualNetworks/vnet-mi-tooling/subnets/ManagedInstance\",\r\n \"state\": \"Ready\",\r\n \"licenseType\": \"LicenseIncluded\",\r\n \"vCores\": 4,\r\n \"storageSizeInGB\": 32,\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"dnsZone\": \"1e6d90da5016\",\r\n \"publicDataEndpointEnabled\": false,\r\n \"timezoneId\": \"UTC\",\r\n \"maintenanceConfigurationId\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default\",\r\n \"privateEndpointConnections\": [],\r\n \"currentBackupStorageRedundancy\": \"Geo\",\r\n \"requestedBackupStorageRedundancy\": \"Geo\",\r\n \"zoneRedundant\": false\r\n },\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"test\": \"azure-sdk-for-net\"\r\n },\r\n \"id\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-2310\",\r\n \"name\": \"net-sdk-crud-tests-2310\",\r\n \"type\": \"Microsoft.Sql/managedInstances\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5787/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-4807/serverTrustCertificates/test_cert1?api-version=2021-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU3ODcvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNDgwNy9zZXJ2ZXJUcnVzdENlcnRpZmljYXRlcy90ZXN0X2NlcnQxP2FwaS12ZXJzaW9uPTIwMjEtMDUtMDEtcHJldmlldw==", + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-2310/serverTrustCertificates/test_cert1?api-version=2021-11-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU0NTEvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtMjMxMC9zZXJ2ZXJUcnVzdENlcnRpZmljYXRlcy90ZXN0X2NlcnQxP2FwaS12ZXJzaW9uPTIwMjEtMTEtMDEtcHJldmlldw==", "RequestMethod": "PUT", "RequestBody": "{\r\n \"properties\": {\r\n \"publicBlob\": \"0x3082031E30820206A00302010202107339C358890D88B04D584E95AD40EFA0300D06092A864886F70D01010B0500304B3149304706035504031E40004D0053005F0053006D006F0045007800740065006E006400650064005300690067006E0069006E006700430065007200740069006600690063006100740065301E170D3231303332333031343733385A170D3232303332333031343733385A304B3149304706035504031E40004D0053005F0053006D006F0045007800740065006E006400650064005300690067006E0069006E00670043006500720074006900660069006300610074006530820122300D06092A864886F70D01010105000382010F003082010A0282010100B796616200301A3E8E06A594CD45EB665676E23368222D7F7F70E6474B602978A7A3D45381B293D6FE5C4EB47298496CDA2599DBC2645B2A1CEB311FC4D5AD5AE162E337776D90B8D1E30BF2BB1D19783B22AA261EBA70FBF6896FFE356ED7A7E09EA71F67B6E2213ACE95E8DA12038B6D2D2C986D56CA0859D6A1BDA7DA08DCFFE11FF1E59EDA4225BC0A252405025E49F5C34B65E9614DF8BBD78AFE33CD14E32F2043D833EE7EF6CE3E663BF437A72DE2933D6FC62FB5E87F6B443A0257135C09B8308B231358594EE2FD3A384B3AD5B7D22B1B35E1682F28CC5F7F27A233D704E7DE46126B811E5CF4D2835C316DBD9A4288DA02B2481FF8FCEF754F957D0203010001300D06092A864886F70D01010B0500038201010029577117B09612B085B6AE47417C556013DEF38F61E726E1DEE908332BDD50F830CE43B7D61F20E300E50E23305C94D19DB5FF0F66D0E7B6DAB6510680A10B346653359C1B20F219BF1EB4217B6AEC4CD01BB96F0E84CC9C5DC6DA325EB8979DCA9E9F61AF1C2BB3E3DAB4DE7D118588184FF98FE8E803F3374392464A64563D097AB878DB01115CD443EAF58B0705E13A1E27021F6C0E0104CF5307DCCA79D4CA70F26A3FD2CE89AAE0AD1C08E884AB1BD8FAF3983A0667820BB122688E30C873932FB25BF85EA0B23E651D4DBA5436EC6F17D770832E7041ED44952883470E1B599FDB0E518E663CBD6FED7983849101A89497CF4D0C9FE2DF7F9C2BE3C21A\"\r\n }\r\n}", "RequestHeaders": { "x-ms-client-request-id": [ - "c4dcd94e-6476-4b10-821b-948cf14c5d22" + "c7d20f5b-34b2-49a4-8d82-127e49f0ab0e" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.21.56803", + "FxVersion/4.700.22.11601", "OSName/Windows", "OSVersion/Microsoft.Windows.10.0.17763", - "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.0.0" + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" ], "Content-Type": [ "application/json; charset=utf-8" @@ -399,16 +342,16 @@ "no-cache" ], "Location": [ - "https://management.azure.com/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5787/providers/Microsoft.Sql/locations/westcentralus/serverTrustCertificatesOperationResults/b0f500eb-e7a5-4854-9fe7-2b9937d08962?api-version=2021-05-01-preview" + "https://management.azure.com/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/locations/westcentralus/serverTrustCertificatesOperationResults/0ae47b8d-e027-4de1-a654-b6b35f944220?api-version=2021-11-01-preview" ], "Retry-After": [ "15" ], "Azure-AsyncOperation": [ - "https://management.azure.com/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5787/providers/Microsoft.Sql/locations/westcentralus/serverTrustCertificatesAzureAsyncOperation/b0f500eb-e7a5-4854-9fe7-2b9937d08962?api-version=2021-05-01-preview" + "https://management.azure.com/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/locations/westcentralus/serverTrustCertificatesAzureAsyncOperation/0ae47b8d-e027-4de1-a654-b6b35f944220?api-version=2021-11-01-preview" ], "x-ms-request-id": [ - "3c96fe77-9843-4642-ac1f-66c18b8f073d" + "0ae47b8d-e027-4de1-a654-b6b35f944220" ], "Server": [ "Microsoft-HTTPAPI/2.0" @@ -417,10 +360,10 @@ "1198" ], "x-ms-correlation-request-id": [ - "df7e43ec-33a5-4864-9669-bd240d90711b" + "73a952cc-c559-4035-bb7f-61a06d422404" ], "x-ms-routing-request-id": [ - "UKSOUTH:20220223T130005Z:df7e43ec-33a5-4864-9669-bd240d90711b" + "UKSOUTH:20220403T120208Z:73a952cc-c559-4035-bb7f-61a06d422404" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -429,7 +372,7 @@ "nosniff" ], "Date": [ - "Wed, 23 Feb 2022 13:00:04 GMT" + "Sun, 03 Apr 2022 12:02:08 GMT" ], "Content-Length": [ "98" @@ -441,26 +384,26 @@ "-1" ] }, - "ResponseBody": "{\r\n \"operation\": \"UploadManagedInstanceServerTrustCertificate\",\r\n \"startTime\": \"2022-02-23T13:00:05.517Z\"\r\n}", + "ResponseBody": "{\r\n \"operation\": \"UploadManagedInstanceServerTrustCertificate\",\r\n \"startTime\": \"2022-04-03T12:02:08.643Z\"\r\n}", "StatusCode": 202 }, { - "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5787/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-4807/serverTrustCertificates/test_cert1?api-version=2021-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU3ODcvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNDgwNy9zZXJ2ZXJUcnVzdENlcnRpZmljYXRlcy90ZXN0X2NlcnQxP2FwaS12ZXJzaW9uPTIwMjEtMDUtMDEtcHJldmlldw==", + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-2310/serverTrustCertificates/test_cert1?api-version=2021-11-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU0NTEvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtMjMxMC9zZXJ2ZXJUcnVzdENlcnRpZmljYXRlcy90ZXN0X2NlcnQxP2FwaS12ZXJzaW9uPTIwMjEtMTEtMDEtcHJldmlldw==", "RequestMethod": "PUT", "RequestBody": "{\r\n \"properties\": {\r\n \"publicBlob\": \"0x30820316308201FEA003020102021072F30C6F228A33B64405E7EA8BB1C949300D06092A864886F70D01010B050030473145304306035504031E3C004D0053005F00530051004C00410075007400680065006E00740069006300610074006F007200430065007200740069006600690063006100740065301E170D3231303332333031343733385A170D3232303332333031343733385A30473145304306035504031E3C004D0053005F00530051004C00410075007400680065006E00740069006300610074006F00720043006500720074006900660069006300610074006530820122300D06092A864886F70D01010105000382010F003082010A0282010100C6DB530E4E055B502D75A1E25EE65403B754A4079898027018E3032DDD42A67C243797DAA737C32E933E4582DC2BBADE16F35C41E55ED77B6AC640F7DE788FCD617A594FD6A4A0BC4F2FCAC84D031F1D1F4DD82225E953918550DF657633C1FB1D5D227DCBF7A924122165E3C67F5E88AA68EA509BAB82966C377C1F3CF83A0AEAFFD18B3C24D631FE12DF7D10659A6601ACD55CAA95CC57CD3E4B29B01271F0FA64725E288BEAEB7792B15FE2FD36EF8A86CEBF3AAEFCCAD3A84295EB01E0AD776617FB42A470A9F5956011C11BFFB881C97650647C734393A68AC379EB9187DEBAD9C61F26BB8AEFE5A1AD549010DA7DBF0478EEEBB4D55C5863DB336A7F7D0203010001300D06092A864886F70D01010B05000382010100C052781B299ECFB0B833B5DC3CC96E0C9DAB6900708F16059E13A8A5D07493A7BB551E7E2513284F11AA8D6F8AB85374B43A97388387FC8E0DB45650D68E61F634E1CD86D064F8831CD5E353FD6D304087A604CEB4388866BCB64CD95F3F45D76D4A97C4ECAA1512202F24001784C00243D63AFC402247A961FB48578B28BBC8496A4441A0A72BF12755F1C16810A53723510F498908C824340F0B18081615A2EF75B4B94F5A22D9D1B4A0AA483006B0A8B035F4D5D0E5FD247C7199874C3E0BD4E80DF013BA7636BE906146C888B1C4848A729797A971C74D67FFC6A926978F6F9A3A222AD534F27A1F7FEFB48E54C335050447BF41D8CCB71889D836BB6AC6\"\r\n }\r\n}", "RequestHeaders": { "x-ms-client-request-id": [ - "d6f78a90-04e4-470e-ade3-72cb7d24c631" + "ea5d5fd0-485d-4ee4-aa95-2f40cbd876be" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.21.56803", + "FxVersion/4.700.22.11601", "OSName/Windows", "OSVersion/Microsoft.Windows.10.0.17763", - "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.0.0" + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" ], "Content-Type": [ "application/json; charset=utf-8" @@ -477,16 +420,16 @@ "no-cache" ], "Location": [ - "https://management.azure.com/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5787/providers/Microsoft.Sql/locations/westcentralus/serverTrustCertificatesOperationResults/bb6a9fe8-84f0-4099-9d83-890e99b6687a?api-version=2021-05-01-preview" + "https://management.azure.com/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/locations/westcentralus/serverTrustCertificatesOperationResults/257dde61-a4c5-42ee-b2c6-9f14636a04eb?api-version=2021-11-01-preview" ], "Retry-After": [ "15" ], "Azure-AsyncOperation": [ - "https://management.azure.com/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5787/providers/Microsoft.Sql/locations/westcentralus/serverTrustCertificatesAzureAsyncOperation/bb6a9fe8-84f0-4099-9d83-890e99b6687a?api-version=2021-05-01-preview" + "https://management.azure.com/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/locations/westcentralus/serverTrustCertificatesAzureAsyncOperation/257dde61-a4c5-42ee-b2c6-9f14636a04eb?api-version=2021-11-01-preview" ], "x-ms-request-id": [ - "6a6dc602-abef-4318-80f0-f36d33732aa0" + "257dde61-a4c5-42ee-b2c6-9f14636a04eb" ], "Server": [ "Microsoft-HTTPAPI/2.0" @@ -495,10 +438,10 @@ "1197" ], "x-ms-correlation-request-id": [ - "a214b9fd-52b7-4221-a0ee-cdaba6237082" + "8f684a41-9f4b-4559-ac9c-f7d0eb2b28c9" ], "x-ms-routing-request-id": [ - "UKSOUTH:20220223T130118Z:a214b9fd-52b7-4221-a0ee-cdaba6237082" + "UKSOUTH:20220403T120321Z:8f684a41-9f4b-4559-ac9c-f7d0eb2b28c9" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -507,10 +450,10 @@ "nosniff" ], "Date": [ - "Wed, 23 Feb 2022 13:01:17 GMT" + "Sun, 03 Apr 2022 12:03:21 GMT" ], "Content-Length": [ - "97" + "98" ], "Content-Type": [ "application/json; charset=utf-8" @@ -519,20 +462,20 @@ "-1" ] }, - "ResponseBody": "{\r\n \"operation\": \"UploadManagedInstanceServerTrustCertificate\",\r\n \"startTime\": \"2022-02-23T13:01:17.94Z\"\r\n}", + "ResponseBody": "{\r\n \"operation\": \"UploadManagedInstanceServerTrustCertificate\",\r\n \"startTime\": \"2022-04-03T12:03:21.573Z\"\r\n}", "StatusCode": 202 }, { - "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5787/providers/Microsoft.Sql/locations/westcentralus/serverTrustCertificatesAzureAsyncOperation/b0f500eb-e7a5-4854-9fe7-2b9937d08962?api-version=2021-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU3ODcvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbG9jYXRpb25zL3dlc3RjZW50cmFsdXMvc2VydmVyVHJ1c3RDZXJ0aWZpY2F0ZXNBenVyZUFzeW5jT3BlcmF0aW9uL2IwZjUwMGViLWU3YTUtNDg1NC05ZmU3LTJiOTkzN2QwODk2Mj9hcGktdmVyc2lvbj0yMDIxLTA1LTAxLXByZXZpZXc=", + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/locations/westcentralus/serverTrustCertificatesAzureAsyncOperation/0ae47b8d-e027-4de1-a654-b6b35f944220?api-version=2021-11-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU0NTEvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbG9jYXRpb25zL3dlc3RjZW50cmFsdXMvc2VydmVyVHJ1c3RDZXJ0aWZpY2F0ZXNBenVyZUFzeW5jT3BlcmF0aW9uLzBhZTQ3YjhkLWUwMjctNGRlMS1hNjU0LWI2YjM1Zjk0NDIyMD9hcGktdmVyc2lvbj0yMDIxLTExLTAxLXByZXZpZXc=", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "User-Agent": [ - "FxVersion/4.700.21.56803", + "FxVersion/4.700.22.11601", "OSName/Windows", "OSVersion/Microsoft.Windows.10.0.17763", - "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.0.0" + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" ] }, "ResponseHeaders": { @@ -546,19 +489,19 @@ "15" ], "x-ms-request-id": [ - "2f0248d2-3f19-4a60-8b5d-bf8b1c5b9a2f" + "b3170b23-39be-48b3-85af-9e55a39fd1ef" ], "Server": [ "Microsoft-HTTPAPI/2.0" ], "x-ms-ratelimit-remaining-subscription-reads": [ - "11995" + "11996" ], "x-ms-correlation-request-id": [ - "4c46d999-69f3-48d9-ae14-702055d3bcc3" + "c03f28c7-19df-44b6-84d5-179234bc4c8b" ], "x-ms-routing-request-id": [ - "UKSOUTH:20220223T130021Z:4c46d999-69f3-48d9-ae14-702055d3bcc3" + "UKSOUTH:20220403T120224Z:c03f28c7-19df-44b6-84d5-179234bc4c8b" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -567,7 +510,7 @@ "nosniff" ], "Date": [ - "Wed, 23 Feb 2022 13:00:20 GMT" + "Sun, 03 Apr 2022 12:02:23 GMT" ], "Content-Length": [ "107" @@ -579,20 +522,20 @@ "-1" ] }, - "ResponseBody": "{\r\n \"name\": \"b0f500eb-e7a5-4854-9fe7-2b9937d08962\",\r\n \"status\": \"Succeeded\",\r\n \"startTime\": \"2022-02-23T13:00:05.517Z\"\r\n}", + "ResponseBody": "{\r\n \"name\": \"0ae47b8d-e027-4de1-a654-b6b35f944220\",\r\n \"status\": \"Succeeded\",\r\n \"startTime\": \"2022-04-03T12:02:08.643Z\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5787/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-4807/serverTrustCertificates/test_cert1?api-version=2021-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU3ODcvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNDgwNy9zZXJ2ZXJUcnVzdENlcnRpZmljYXRlcy90ZXN0X2NlcnQxP2FwaS12ZXJzaW9uPTIwMjEtMDUtMDEtcHJldmlldw==", + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-2310/serverTrustCertificates/test_cert1?api-version=2021-11-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU0NTEvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtMjMxMC9zZXJ2ZXJUcnVzdENlcnRpZmljYXRlcy90ZXN0X2NlcnQxP2FwaS12ZXJzaW9uPTIwMjEtMTEtMDEtcHJldmlldw==", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "User-Agent": [ - "FxVersion/4.700.21.56803", + "FxVersion/4.700.22.11601", "OSName/Windows", "OSVersion/Microsoft.Windows.10.0.17763", - "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.0.0" + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" ] }, "ResponseHeaders": { @@ -603,19 +546,19 @@ "no-cache" ], "x-ms-request-id": [ - "de1c973e-0821-4277-a7b9-caeb719cc23e" + "fd0fe4f1-2aeb-4a96-b468-4a1272c5c5e4" ], "Server": [ "Microsoft-HTTPAPI/2.0" ], "x-ms-ratelimit-remaining-subscription-reads": [ - "11994" + "11995" ], "x-ms-correlation-request-id": [ - "735a185e-1a97-4d22-8fd8-32f8172099ea" + "688bf3f0-5464-40a4-9ce4-493863d29057" ], "x-ms-routing-request-id": [ - "UKSOUTH:20220223T130021Z:735a185e-1a97-4d22-8fd8-32f8172099ea" + "UKSOUTH:20220403T120224Z:688bf3f0-5464-40a4-9ce4-493863d29057" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -624,7 +567,7 @@ "nosniff" ], "Date": [ - "Wed, 23 Feb 2022 13:00:20 GMT" + "Sun, 03 Apr 2022 12:02:23 GMT" ], "Content-Length": [ "1998" @@ -636,26 +579,26 @@ "-1" ] }, - "ResponseBody": "{\r\n \"properties\": {\r\n \"publicBlob\": \"3082031E30820206A00302010202107339C358890D88B04D584E95AD40EFA0300D06092A864886F70D01010B0500304B3149304706035504031E40004D0053005F0053006D006F0045007800740065006E006400650064005300690067006E0069006E006700430065007200740069006600690063006100740065301E170D3231303332333031343733385A170D3232303332333031343733385A304B3149304706035504031E40004D0053005F0053006D006F0045007800740065006E006400650064005300690067006E0069006E00670043006500720074006900660069006300610074006530820122300D06092A864886F70D01010105000382010F003082010A0282010100B796616200301A3E8E06A594CD45EB665676E23368222D7F7F70E6474B602978A7A3D45381B293D6FE5C4EB47298496CDA2599DBC2645B2A1CEB311FC4D5AD5AE162E337776D90B8D1E30BF2BB1D19783B22AA261EBA70FBF6896FFE356ED7A7E09EA71F67B6E2213ACE95E8DA12038B6D2D2C986D56CA0859D6A1BDA7DA08DCFFE11FF1E59EDA4225BC0A252405025E49F5C34B65E9614DF8BBD78AFE33CD14E32F2043D833EE7EF6CE3E663BF437A72DE2933D6FC62FB5E87F6B443A0257135C09B8308B231358594EE2FD3A384B3AD5B7D22B1B35E1682F28CC5F7F27A233D704E7DE46126B811E5CF4D2835C316DBD9A4288DA02B2481FF8FCEF754F957D0203010001300D06092A864886F70D01010B0500038201010029577117B09612B085B6AE47417C556013DEF38F61E726E1DEE908332BDD50F830CE43B7D61F20E300E50E23305C94D19DB5FF0F66D0E7B6DAB6510680A10B346653359C1B20F219BF1EB4217B6AEC4CD01BB96F0E84CC9C5DC6DA325EB8979DCA9E9F61AF1C2BB3E3DAB4DE7D118588184FF98FE8E803F3374392464A64563D097AB878DB01115CD443EAF58B0705E13A1E27021F6C0E0104CF5307DCCA79D4CA70F26A3FD2CE89AAE0AD1C08E884AB1BD8FAF3983A0667820BB122688E30C873932FB25BF85EA0B23E651D4DBA5436EC6F17D770832E7041ED44952883470E1B599FDB0E518E663CBD6FED7983849101A89497CF4D0C9FE2DF7F9C2BE3C21A\",\r\n \"thumbprint\": \"5E1C40529126487B5B20C0E7E299FFF7190E94D7\",\r\n \"certificateName\": \"test_cert1\"\r\n },\r\n \"id\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5787/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-4807/serverTrustCertificates/test_cert1\",\r\n \"name\": \"test_cert1\",\r\n \"type\": \"Microsoft.Sql/managedInstances/serverTrustCertificates\"\r\n}", + "ResponseBody": "{\r\n \"properties\": {\r\n \"publicBlob\": \"3082031E30820206A00302010202107339C358890D88B04D584E95AD40EFA0300D06092A864886F70D01010B0500304B3149304706035504031E40004D0053005F0053006D006F0045007800740065006E006400650064005300690067006E0069006E006700430065007200740069006600690063006100740065301E170D3231303332333031343733385A170D3232303332333031343733385A304B3149304706035504031E40004D0053005F0053006D006F0045007800740065006E006400650064005300690067006E0069006E00670043006500720074006900660069006300610074006530820122300D06092A864886F70D01010105000382010F003082010A0282010100B796616200301A3E8E06A594CD45EB665676E23368222D7F7F70E6474B602978A7A3D45381B293D6FE5C4EB47298496CDA2599DBC2645B2A1CEB311FC4D5AD5AE162E337776D90B8D1E30BF2BB1D19783B22AA261EBA70FBF6896FFE356ED7A7E09EA71F67B6E2213ACE95E8DA12038B6D2D2C986D56CA0859D6A1BDA7DA08DCFFE11FF1E59EDA4225BC0A252405025E49F5C34B65E9614DF8BBD78AFE33CD14E32F2043D833EE7EF6CE3E663BF437A72DE2933D6FC62FB5E87F6B443A0257135C09B8308B231358594EE2FD3A384B3AD5B7D22B1B35E1682F28CC5F7F27A233D704E7DE46126B811E5CF4D2835C316DBD9A4288DA02B2481FF8FCEF754F957D0203010001300D06092A864886F70D01010B0500038201010029577117B09612B085B6AE47417C556013DEF38F61E726E1DEE908332BDD50F830CE43B7D61F20E300E50E23305C94D19DB5FF0F66D0E7B6DAB6510680A10B346653359C1B20F219BF1EB4217B6AEC4CD01BB96F0E84CC9C5DC6DA325EB8979DCA9E9F61AF1C2BB3E3DAB4DE7D118588184FF98FE8E803F3374392464A64563D097AB878DB01115CD443EAF58B0705E13A1E27021F6C0E0104CF5307DCCA79D4CA70F26A3FD2CE89AAE0AD1C08E884AB1BD8FAF3983A0667820BB122688E30C873932FB25BF85EA0B23E651D4DBA5436EC6F17D770832E7041ED44952883470E1B599FDB0E518E663CBD6FED7983849101A89497CF4D0C9FE2DF7F9C2BE3C21A\",\r\n \"thumbprint\": \"5E1C40529126487B5B20C0E7E299FFF7190E94D7\",\r\n \"certificateName\": \"test_cert1\"\r\n },\r\n \"id\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-2310/serverTrustCertificates/test_cert1\",\r\n \"name\": \"test_cert1\",\r\n \"type\": \"Microsoft.Sql/managedInstances/serverTrustCertificates\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5787/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-4807/serverTrustCertificates/test_cert1?api-version=2021-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU3ODcvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNDgwNy9zZXJ2ZXJUcnVzdENlcnRpZmljYXRlcy90ZXN0X2NlcnQxP2FwaS12ZXJzaW9uPTIwMjEtMDUtMDEtcHJldmlldw==", + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-2310/serverTrustCertificates/test_cert1?api-version=2021-11-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU0NTEvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtMjMxMC9zZXJ2ZXJUcnVzdENlcnRpZmljYXRlcy90ZXN0X2NlcnQxP2FwaS12ZXJzaW9uPTIwMjEtMTEtMDEtcHJldmlldw==", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "110d8cb7-5707-401f-86bd-d2719794f331" + "2dca6633-5403-4d07-9a0f-5fc6fbe4eaaf" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.21.56803", + "FxVersion/4.700.22.11601", "OSName/Windows", "OSVersion/Microsoft.Windows.10.0.17763", - "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.0.0" + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" ] }, "ResponseHeaders": { @@ -666,19 +609,19 @@ "no-cache" ], "x-ms-request-id": [ - "2b998270-be38-4499-8517-0750088348eb" + "b6c7c542-9c20-4d02-98f9-b6bf1700fd0f" ], "Server": [ "Microsoft-HTTPAPI/2.0" ], "x-ms-ratelimit-remaining-subscription-reads": [ - "11991" + "11992" ], "x-ms-correlation-request-id": [ - "5693e0f2-ad5c-4d60-baed-bd6f81a7c3bf" + "72bd4092-6294-4ff0-aa0c-9c36d5973c3d" ], "x-ms-routing-request-id": [ - "UKSOUTH:20220223T130037Z:5693e0f2-ad5c-4d60-baed-bd6f81a7c3bf" + "UKSOUTH:20220403T120240Z:72bd4092-6294-4ff0-aa0c-9c36d5973c3d" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -687,7 +630,7 @@ "nosniff" ], "Date": [ - "Wed, 23 Feb 2022 13:00:36 GMT" + "Sun, 03 Apr 2022 12:02:39 GMT" ], "Content-Length": [ "1998" @@ -699,26 +642,26 @@ "-1" ] }, - "ResponseBody": "{\r\n \"properties\": {\r\n \"publicBlob\": \"3082031E30820206A00302010202107339C358890D88B04D584E95AD40EFA0300D06092A864886F70D01010B0500304B3149304706035504031E40004D0053005F0053006D006F0045007800740065006E006400650064005300690067006E0069006E006700430065007200740069006600690063006100740065301E170D3231303332333031343733385A170D3232303332333031343733385A304B3149304706035504031E40004D0053005F0053006D006F0045007800740065006E006400650064005300690067006E0069006E00670043006500720074006900660069006300610074006530820122300D06092A864886F70D01010105000382010F003082010A0282010100B796616200301A3E8E06A594CD45EB665676E23368222D7F7F70E6474B602978A7A3D45381B293D6FE5C4EB47298496CDA2599DBC2645B2A1CEB311FC4D5AD5AE162E337776D90B8D1E30BF2BB1D19783B22AA261EBA70FBF6896FFE356ED7A7E09EA71F67B6E2213ACE95E8DA12038B6D2D2C986D56CA0859D6A1BDA7DA08DCFFE11FF1E59EDA4225BC0A252405025E49F5C34B65E9614DF8BBD78AFE33CD14E32F2043D833EE7EF6CE3E663BF437A72DE2933D6FC62FB5E87F6B443A0257135C09B8308B231358594EE2FD3A384B3AD5B7D22B1B35E1682F28CC5F7F27A233D704E7DE46126B811E5CF4D2835C316DBD9A4288DA02B2481FF8FCEF754F957D0203010001300D06092A864886F70D01010B0500038201010029577117B09612B085B6AE47417C556013DEF38F61E726E1DEE908332BDD50F830CE43B7D61F20E300E50E23305C94D19DB5FF0F66D0E7B6DAB6510680A10B346653359C1B20F219BF1EB4217B6AEC4CD01BB96F0E84CC9C5DC6DA325EB8979DCA9E9F61AF1C2BB3E3DAB4DE7D118588184FF98FE8E803F3374392464A64563D097AB878DB01115CD443EAF58B0705E13A1E27021F6C0E0104CF5307DCCA79D4CA70F26A3FD2CE89AAE0AD1C08E884AB1BD8FAF3983A0667820BB122688E30C873932FB25BF85EA0B23E651D4DBA5436EC6F17D770832E7041ED44952883470E1B599FDB0E518E663CBD6FED7983849101A89497CF4D0C9FE2DF7F9C2BE3C21A\",\r\n \"thumbprint\": \"5E1C40529126487B5B20C0E7E299FFF7190E94D7\",\r\n \"certificateName\": \"test_cert1\"\r\n },\r\n \"id\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5787/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-4807/serverTrustCertificates/test_cert1\",\r\n \"name\": \"test_cert1\",\r\n \"type\": \"Microsoft.Sql/managedInstances/serverTrustCertificates\"\r\n}", + "ResponseBody": "{\r\n \"properties\": {\r\n \"publicBlob\": \"3082031E30820206A00302010202107339C358890D88B04D584E95AD40EFA0300D06092A864886F70D01010B0500304B3149304706035504031E40004D0053005F0053006D006F0045007800740065006E006400650064005300690067006E0069006E006700430065007200740069006600690063006100740065301E170D3231303332333031343733385A170D3232303332333031343733385A304B3149304706035504031E40004D0053005F0053006D006F0045007800740065006E006400650064005300690067006E0069006E00670043006500720074006900660069006300610074006530820122300D06092A864886F70D01010105000382010F003082010A0282010100B796616200301A3E8E06A594CD45EB665676E23368222D7F7F70E6474B602978A7A3D45381B293D6FE5C4EB47298496CDA2599DBC2645B2A1CEB311FC4D5AD5AE162E337776D90B8D1E30BF2BB1D19783B22AA261EBA70FBF6896FFE356ED7A7E09EA71F67B6E2213ACE95E8DA12038B6D2D2C986D56CA0859D6A1BDA7DA08DCFFE11FF1E59EDA4225BC0A252405025E49F5C34B65E9614DF8BBD78AFE33CD14E32F2043D833EE7EF6CE3E663BF437A72DE2933D6FC62FB5E87F6B443A0257135C09B8308B231358594EE2FD3A384B3AD5B7D22B1B35E1682F28CC5F7F27A233D704E7DE46126B811E5CF4D2835C316DBD9A4288DA02B2481FF8FCEF754F957D0203010001300D06092A864886F70D01010B0500038201010029577117B09612B085B6AE47417C556013DEF38F61E726E1DEE908332BDD50F830CE43B7D61F20E300E50E23305C94D19DB5FF0F66D0E7B6DAB6510680A10B346653359C1B20F219BF1EB4217B6AEC4CD01BB96F0E84CC9C5DC6DA325EB8979DCA9E9F61AF1C2BB3E3DAB4DE7D118588184FF98FE8E803F3374392464A64563D097AB878DB01115CD443EAF58B0705E13A1E27021F6C0E0104CF5307DCCA79D4CA70F26A3FD2CE89AAE0AD1C08E884AB1BD8FAF3983A0667820BB122688E30C873932FB25BF85EA0B23E651D4DBA5436EC6F17D770832E7041ED44952883470E1B599FDB0E518E663CBD6FED7983849101A89497CF4D0C9FE2DF7F9C2BE3C21A\",\r\n \"thumbprint\": \"5E1C40529126487B5B20C0E7E299FFF7190E94D7\",\r\n \"certificateName\": \"test_cert1\"\r\n },\r\n \"id\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-2310/serverTrustCertificates/test_cert1\",\r\n \"name\": \"test_cert1\",\r\n \"type\": \"Microsoft.Sql/managedInstances/serverTrustCertificates\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5787/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-4807/serverTrustCertificates/test_cert2?api-version=2021-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU3ODcvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNDgwNy9zZXJ2ZXJUcnVzdENlcnRpZmljYXRlcy90ZXN0X2NlcnQyP2FwaS12ZXJzaW9uPTIwMjEtMDUtMDEtcHJldmlldw==", + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-2310/serverTrustCertificates/test_cert2?api-version=2021-11-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU0NTEvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtMjMxMC9zZXJ2ZXJUcnVzdENlcnRpZmljYXRlcy90ZXN0X2NlcnQyP2FwaS12ZXJzaW9uPTIwMjEtMTEtMDEtcHJldmlldw==", "RequestMethod": "PUT", "RequestBody": "{\r\n \"properties\": {\r\n \"publicBlob\": \"0x3082031E30820206A003020102021015ECCB530A52D0874A9B4DFB69FFCAA0300D06092A864886F70D01010B0500304B3149304706035504031E40004D0053005F00530051004C005200650073006F0075007200630065005300690067006E0069006E006700430065007200740069006600690063006100740065301E170D3231303332333031343733385A170D3232303332333031343733385A304B3149304706035504031E40004D0053005F00530051004C005200650073006F0075007200630065005300690067006E0069006E00670043006500720074006900660069006300610074006530820122300D06092A864886F70D01010105000382010F003082010A0282010100C3BC903BD030D2EE904E941B603040F7DF38262BBA86AD3B9AD4BFE361D910378C5459DE540398E43124272BAE97AE502490F5140393A66EC49667D1B64449EAECC0DCB7FCA5BBF2E214F0AF8A697CBAF790B0FCD086C69C06A363849D7481468894E40F0B6466591775FFA6B3E387F5C56126078EBB69CB7EA9FD842233A29C9D92EE0ED2D9D09C96EBE2B4089EBE9A2D2276F75F506FD09CB3DF312C2B737E8E20AB4C7F48EF5D730D8AB4BB7234315ABD4CB2568896801CECB2B6452EADAEE2DFC7E8B03B01B0F8742BF9DA941E5449F14ABA8BAA58189D4F7558068E782580181038EB3DBAC7FD53D200357298258F3AC9ACCA4845F83C8539E35FC36B750203010001300D06092A864886F70D01010B0500038201010072200767AE16B164DCC9A7439F96CA3EBFDEEF8440B2BD9356E0257520FB8A2763E90BB6D727F7CE63CC40B40872A7C77B451EFD5CB022D349303C75956CA372D3FF513516EEA0F545240D451FC98EA743008EFDE63ABC003AEE3FA80CA05425CA3FD9C0EC8123BD6F1E9DAFE5AC33AF3A1DE89E6F28349DE7A5EE5AE39F0E6AD87B3D03037FDB9F1B1A7BB1B55A51A70C9E0604BC9EDDFA4BF1582C039826E89F960720FC6B6AB398DFFC4B38A2F7C526C9AC31D96BA40D9B02FC58FFAA37BE5B3DC0DCCF9F1ED1358A23E4E7D0E3A397B841BCFB7AE8405DE8A42511C2C3B14DFB13F467F16ED63EEB0E22127E281EEDCBD9A3D3C957AC51D5D75FBB713018\"\r\n }\r\n}", "RequestHeaders": { "x-ms-client-request-id": [ - "76ba05f8-e880-4887-a188-969bd6edab94" + "6db0fbe3-891a-447d-926d-9dc18643bb61" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.21.56803", + "FxVersion/4.700.22.11601", "OSName/Windows", "OSVersion/Microsoft.Windows.10.0.17763", - "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.0.0" + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" ], "Content-Type": [ "application/json; charset=utf-8" @@ -735,16 +678,16 @@ "no-cache" ], "Location": [ - "https://management.azure.com/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5787/providers/Microsoft.Sql/locations/westcentralus/serverTrustCertificatesOperationResults/c479ed4a-94ca-41d8-8f16-8245f58db795?api-version=2021-05-01-preview" + "https://management.azure.com/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/locations/westcentralus/serverTrustCertificatesOperationResults/97608687-6a33-4f33-acd0-615d6af06ad6?api-version=2021-11-01-preview" ], "Retry-After": [ "15" ], "Azure-AsyncOperation": [ - "https://management.azure.com/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5787/providers/Microsoft.Sql/locations/westcentralus/serverTrustCertificatesAzureAsyncOperation/c479ed4a-94ca-41d8-8f16-8245f58db795?api-version=2021-05-01-preview" + "https://management.azure.com/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/locations/westcentralus/serverTrustCertificatesAzureAsyncOperation/97608687-6a33-4f33-acd0-615d6af06ad6?api-version=2021-11-01-preview" ], "x-ms-request-id": [ - "d39c55ef-1f8b-4e9e-ae0e-d8afe21f06f5" + "97608687-6a33-4f33-acd0-615d6af06ad6" ], "Server": [ "Microsoft-HTTPAPI/2.0" @@ -753,10 +696,10 @@ "1197" ], "x-ms-correlation-request-id": [ - "1abcddc7-b9b2-4094-8903-b6d0fd255eb1" + "4e04e985-2eb7-4d06-b7fc-e087911d599f" ], "x-ms-routing-request-id": [ - "UKSOUTH:20220223T130021Z:1abcddc7-b9b2-4094-8903-b6d0fd255eb1" + "UKSOUTH:20220403T120224Z:4e04e985-2eb7-4d06-b7fc-e087911d599f" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -765,10 +708,10 @@ "nosniff" ], "Date": [ - "Wed, 23 Feb 2022 13:00:21 GMT" + "Sun, 03 Apr 2022 12:02:24 GMT" ], "Content-Length": [ - "98" + "97" ], "Content-Type": [ "application/json; charset=utf-8" @@ -777,20 +720,20 @@ "-1" ] }, - "ResponseBody": "{\r\n \"operation\": \"UploadManagedInstanceServerTrustCertificate\",\r\n \"startTime\": \"2022-02-23T13:00:21.673Z\"\r\n}", + "ResponseBody": "{\r\n \"operation\": \"UploadManagedInstanceServerTrustCertificate\",\r\n \"startTime\": \"2022-04-03T12:02:24.66Z\"\r\n}", "StatusCode": 202 }, { - "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5787/providers/Microsoft.Sql/locations/westcentralus/serverTrustCertificatesAzureAsyncOperation/c479ed4a-94ca-41d8-8f16-8245f58db795?api-version=2021-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU3ODcvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbG9jYXRpb25zL3dlc3RjZW50cmFsdXMvc2VydmVyVHJ1c3RDZXJ0aWZpY2F0ZXNBenVyZUFzeW5jT3BlcmF0aW9uL2M0NzllZDRhLTk0Y2EtNDFkOC04ZjE2LTgyNDVmNThkYjc5NT9hcGktdmVyc2lvbj0yMDIxLTA1LTAxLXByZXZpZXc=", + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/locations/westcentralus/serverTrustCertificatesAzureAsyncOperation/97608687-6a33-4f33-acd0-615d6af06ad6?api-version=2021-11-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU0NTEvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbG9jYXRpb25zL3dlc3RjZW50cmFsdXMvc2VydmVyVHJ1c3RDZXJ0aWZpY2F0ZXNBenVyZUFzeW5jT3BlcmF0aW9uLzk3NjA4Njg3LTZhMzMtNGYzMy1hY2QwLTYxNWQ2YWYwNmFkNj9hcGktdmVyc2lvbj0yMDIxLTExLTAxLXByZXZpZXc=", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "User-Agent": [ - "FxVersion/4.700.21.56803", + "FxVersion/4.700.22.11601", "OSName/Windows", "OSVersion/Microsoft.Windows.10.0.17763", - "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.0.0" + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" ] }, "ResponseHeaders": { @@ -804,19 +747,19 @@ "15" ], "x-ms-request-id": [ - "15cf5a31-5ef0-4f76-9769-68cc87fbe6c2" + "907d2016-311c-41fa-81ec-4f4ab96c32b0" ], "Server": [ "Microsoft-HTTPAPI/2.0" ], "x-ms-ratelimit-remaining-subscription-reads": [ - "11993" + "11994" ], "x-ms-correlation-request-id": [ - "1a9abc04-11b2-45cc-b1d8-c72168be4ea7" + "7d8ec0c8-7579-4652-889f-31c823ef3124" ], "x-ms-routing-request-id": [ - "UKSOUTH:20220223T130036Z:1a9abc04-11b2-45cc-b1d8-c72168be4ea7" + "UKSOUTH:20220403T120239Z:7d8ec0c8-7579-4652-889f-31c823ef3124" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -825,10 +768,10 @@ "nosniff" ], "Date": [ - "Wed, 23 Feb 2022 13:00:36 GMT" + "Sun, 03 Apr 2022 12:02:39 GMT" ], "Content-Length": [ - "107" + "106" ], "Content-Type": [ "application/json; charset=utf-8" @@ -837,20 +780,20 @@ "-1" ] }, - "ResponseBody": "{\r\n \"name\": \"c479ed4a-94ca-41d8-8f16-8245f58db795\",\r\n \"status\": \"Succeeded\",\r\n \"startTime\": \"2022-02-23T13:00:21.673Z\"\r\n}", + "ResponseBody": "{\r\n \"name\": \"97608687-6a33-4f33-acd0-615d6af06ad6\",\r\n \"status\": \"Succeeded\",\r\n \"startTime\": \"2022-04-03T12:02:24.66Z\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5787/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-4807/serverTrustCertificates/test_cert2?api-version=2021-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU3ODcvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNDgwNy9zZXJ2ZXJUcnVzdENlcnRpZmljYXRlcy90ZXN0X2NlcnQyP2FwaS12ZXJzaW9uPTIwMjEtMDUtMDEtcHJldmlldw==", + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-2310/serverTrustCertificates/test_cert2?api-version=2021-11-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU0NTEvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtMjMxMC9zZXJ2ZXJUcnVzdENlcnRpZmljYXRlcy90ZXN0X2NlcnQyP2FwaS12ZXJzaW9uPTIwMjEtMTEtMDEtcHJldmlldw==", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "User-Agent": [ - "FxVersion/4.700.21.56803", + "FxVersion/4.700.22.11601", "OSName/Windows", "OSVersion/Microsoft.Windows.10.0.17763", - "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.0.0" + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" ] }, "ResponseHeaders": { @@ -861,19 +804,19 @@ "no-cache" ], "x-ms-request-id": [ - "ea317389-5909-436a-bdec-00c46995c63c" + "75b1235b-4546-4be0-b0ac-c8fa01fcc572" ], "Server": [ "Microsoft-HTTPAPI/2.0" ], "x-ms-ratelimit-remaining-subscription-reads": [ - "11992" + "11993" ], "x-ms-correlation-request-id": [ - "472b8037-f98a-47ff-a8f0-7803731767ee" + "7e636acc-b92e-4035-9fc8-fea6a4045189" ], "x-ms-routing-request-id": [ - "UKSOUTH:20220223T130037Z:472b8037-f98a-47ff-a8f0-7803731767ee" + "UKSOUTH:20220403T120240Z:7e636acc-b92e-4035-9fc8-fea6a4045189" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -882,7 +825,7 @@ "nosniff" ], "Date": [ - "Wed, 23 Feb 2022 13:00:36 GMT" + "Sun, 03 Apr 2022 12:02:39 GMT" ], "Content-Length": [ "1998" @@ -894,26 +837,26 @@ "-1" ] }, - "ResponseBody": "{\r\n \"properties\": {\r\n \"publicBlob\": \"3082031E30820206A003020102021015ECCB530A52D0874A9B4DFB69FFCAA0300D06092A864886F70D01010B0500304B3149304706035504031E40004D0053005F00530051004C005200650073006F0075007200630065005300690067006E0069006E006700430065007200740069006600690063006100740065301E170D3231303332333031343733385A170D3232303332333031343733385A304B3149304706035504031E40004D0053005F00530051004C005200650073006F0075007200630065005300690067006E0069006E00670043006500720074006900660069006300610074006530820122300D06092A864886F70D01010105000382010F003082010A0282010100C3BC903BD030D2EE904E941B603040F7DF38262BBA86AD3B9AD4BFE361D910378C5459DE540398E43124272BAE97AE502490F5140393A66EC49667D1B64449EAECC0DCB7FCA5BBF2E214F0AF8A697CBAF790B0FCD086C69C06A363849D7481468894E40F0B6466591775FFA6B3E387F5C56126078EBB69CB7EA9FD842233A29C9D92EE0ED2D9D09C96EBE2B4089EBE9A2D2276F75F506FD09CB3DF312C2B737E8E20AB4C7F48EF5D730D8AB4BB7234315ABD4CB2568896801CECB2B6452EADAEE2DFC7E8B03B01B0F8742BF9DA941E5449F14ABA8BAA58189D4F7558068E782580181038EB3DBAC7FD53D200357298258F3AC9ACCA4845F83C8539E35FC36B750203010001300D06092A864886F70D01010B0500038201010072200767AE16B164DCC9A7439F96CA3EBFDEEF8440B2BD9356E0257520FB8A2763E90BB6D727F7CE63CC40B40872A7C77B451EFD5CB022D349303C75956CA372D3FF513516EEA0F545240D451FC98EA743008EFDE63ABC003AEE3FA80CA05425CA3FD9C0EC8123BD6F1E9DAFE5AC33AF3A1DE89E6F28349DE7A5EE5AE39F0E6AD87B3D03037FDB9F1B1A7BB1B55A51A70C9E0604BC9EDDFA4BF1582C039826E89F960720FC6B6AB398DFFC4B38A2F7C526C9AC31D96BA40D9B02FC58FFAA37BE5B3DC0DCCF9F1ED1358A23E4E7D0E3A397B841BCFB7AE8405DE8A42511C2C3B14DFB13F467F16ED63EEB0E22127E281EEDCBD9A3D3C957AC51D5D75FBB713018\",\r\n \"thumbprint\": \"3B3209B3F06A633946AB89FA5E18D7A7E81A066E\",\r\n \"certificateName\": \"test_cert2\"\r\n },\r\n \"id\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5787/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-4807/serverTrustCertificates/test_cert2\",\r\n \"name\": \"test_cert2\",\r\n \"type\": \"Microsoft.Sql/managedInstances/serverTrustCertificates\"\r\n}", + "ResponseBody": "{\r\n \"properties\": {\r\n \"publicBlob\": \"3082031E30820206A003020102021015ECCB530A52D0874A9B4DFB69FFCAA0300D06092A864886F70D01010B0500304B3149304706035504031E40004D0053005F00530051004C005200650073006F0075007200630065005300690067006E0069006E006700430065007200740069006600690063006100740065301E170D3231303332333031343733385A170D3232303332333031343733385A304B3149304706035504031E40004D0053005F00530051004C005200650073006F0075007200630065005300690067006E0069006E00670043006500720074006900660069006300610074006530820122300D06092A864886F70D01010105000382010F003082010A0282010100C3BC903BD030D2EE904E941B603040F7DF38262BBA86AD3B9AD4BFE361D910378C5459DE540398E43124272BAE97AE502490F5140393A66EC49667D1B64449EAECC0DCB7FCA5BBF2E214F0AF8A697CBAF790B0FCD086C69C06A363849D7481468894E40F0B6466591775FFA6B3E387F5C56126078EBB69CB7EA9FD842233A29C9D92EE0ED2D9D09C96EBE2B4089EBE9A2D2276F75F506FD09CB3DF312C2B737E8E20AB4C7F48EF5D730D8AB4BB7234315ABD4CB2568896801CECB2B6452EADAEE2DFC7E8B03B01B0F8742BF9DA941E5449F14ABA8BAA58189D4F7558068E782580181038EB3DBAC7FD53D200357298258F3AC9ACCA4845F83C8539E35FC36B750203010001300D06092A864886F70D01010B0500038201010072200767AE16B164DCC9A7439F96CA3EBFDEEF8440B2BD9356E0257520FB8A2763E90BB6D727F7CE63CC40B40872A7C77B451EFD5CB022D349303C75956CA372D3FF513516EEA0F545240D451FC98EA743008EFDE63ABC003AEE3FA80CA05425CA3FD9C0EC8123BD6F1E9DAFE5AC33AF3A1DE89E6F28349DE7A5EE5AE39F0E6AD87B3D03037FDB9F1B1A7BB1B55A51A70C9E0604BC9EDDFA4BF1582C039826E89F960720FC6B6AB398DFFC4B38A2F7C526C9AC31D96BA40D9B02FC58FFAA37BE5B3DC0DCCF9F1ED1358A23E4E7D0E3A397B841BCFB7AE8405DE8A42511C2C3B14DFB13F467F16ED63EEB0E22127E281EEDCBD9A3D3C957AC51D5D75FBB713018\",\r\n \"thumbprint\": \"3B3209B3F06A633946AB89FA5E18D7A7E81A066E\",\r\n \"certificateName\": \"test_cert2\"\r\n },\r\n \"id\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-2310/serverTrustCertificates/test_cert2\",\r\n \"name\": \"test_cert2\",\r\n \"type\": \"Microsoft.Sql/managedInstances/serverTrustCertificates\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5787/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-4807/serverTrustCertificates/test_cert2?api-version=2021-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU3ODcvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNDgwNy9zZXJ2ZXJUcnVzdENlcnRpZmljYXRlcy90ZXN0X2NlcnQyP2FwaS12ZXJzaW9uPTIwMjEtMDUtMDEtcHJldmlldw==", + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-2310/serverTrustCertificates/test_cert2?api-version=2021-11-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU0NTEvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtMjMxMC9zZXJ2ZXJUcnVzdENlcnRpZmljYXRlcy90ZXN0X2NlcnQyP2FwaS12ZXJzaW9uPTIwMjEtMTEtMDEtcHJldmlldw==", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "c9e1e053-f482-49a7-900d-df844fbe47a2" + "6fbe99b8-9357-4f88-a2a4-9f0c22928feb" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.21.56803", + "FxVersion/4.700.22.11601", "OSName/Windows", "OSVersion/Microsoft.Windows.10.0.17763", - "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.0.0" + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" ] }, "ResponseHeaders": { @@ -924,19 +867,19 @@ "no-cache" ], "x-ms-request-id": [ - "17a139f2-7e55-49db-8611-294d2a4f8c10" + "8405f5c6-76de-4cf6-8780-792adf09d4ff" ], "Server": [ "Microsoft-HTTPAPI/2.0" ], "x-ms-ratelimit-remaining-subscription-reads": [ - "11990" + "11991" ], "x-ms-correlation-request-id": [ - "6835f386-0dbc-474d-a434-279ac11113d9" + "40472e4c-9e63-4704-852d-80d25737b613" ], "x-ms-routing-request-id": [ - "UKSOUTH:20220223T130037Z:6835f386-0dbc-474d-a434-279ac11113d9" + "UKSOUTH:20220403T120240Z:40472e4c-9e63-4704-852d-80d25737b613" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -945,7 +888,7 @@ "nosniff" ], "Date": [ - "Wed, 23 Feb 2022 13:00:36 GMT" + "Sun, 03 Apr 2022 12:02:39 GMT" ], "Content-Length": [ "1998" @@ -957,26 +900,26 @@ "-1" ] }, - "ResponseBody": "{\r\n \"properties\": {\r\n \"publicBlob\": \"3082031E30820206A003020102021015ECCB530A52D0874A9B4DFB69FFCAA0300D06092A864886F70D01010B0500304B3149304706035504031E40004D0053005F00530051004C005200650073006F0075007200630065005300690067006E0069006E006700430065007200740069006600690063006100740065301E170D3231303332333031343733385A170D3232303332333031343733385A304B3149304706035504031E40004D0053005F00530051004C005200650073006F0075007200630065005300690067006E0069006E00670043006500720074006900660069006300610074006530820122300D06092A864886F70D01010105000382010F003082010A0282010100C3BC903BD030D2EE904E941B603040F7DF38262BBA86AD3B9AD4BFE361D910378C5459DE540398E43124272BAE97AE502490F5140393A66EC49667D1B64449EAECC0DCB7FCA5BBF2E214F0AF8A697CBAF790B0FCD086C69C06A363849D7481468894E40F0B6466591775FFA6B3E387F5C56126078EBB69CB7EA9FD842233A29C9D92EE0ED2D9D09C96EBE2B4089EBE9A2D2276F75F506FD09CB3DF312C2B737E8E20AB4C7F48EF5D730D8AB4BB7234315ABD4CB2568896801CECB2B6452EADAEE2DFC7E8B03B01B0F8742BF9DA941E5449F14ABA8BAA58189D4F7558068E782580181038EB3DBAC7FD53D200357298258F3AC9ACCA4845F83C8539E35FC36B750203010001300D06092A864886F70D01010B0500038201010072200767AE16B164DCC9A7439F96CA3EBFDEEF8440B2BD9356E0257520FB8A2763E90BB6D727F7CE63CC40B40872A7C77B451EFD5CB022D349303C75956CA372D3FF513516EEA0F545240D451FC98EA743008EFDE63ABC003AEE3FA80CA05425CA3FD9C0EC8123BD6F1E9DAFE5AC33AF3A1DE89E6F28349DE7A5EE5AE39F0E6AD87B3D03037FDB9F1B1A7BB1B55A51A70C9E0604BC9EDDFA4BF1582C039826E89F960720FC6B6AB398DFFC4B38A2F7C526C9AC31D96BA40D9B02FC58FFAA37BE5B3DC0DCCF9F1ED1358A23E4E7D0E3A397B841BCFB7AE8405DE8A42511C2C3B14DFB13F467F16ED63EEB0E22127E281EEDCBD9A3D3C957AC51D5D75FBB713018\",\r\n \"thumbprint\": \"3B3209B3F06A633946AB89FA5E18D7A7E81A066E\",\r\n \"certificateName\": \"test_cert2\"\r\n },\r\n \"id\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5787/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-4807/serverTrustCertificates/test_cert2\",\r\n \"name\": \"test_cert2\",\r\n \"type\": \"Microsoft.Sql/managedInstances/serverTrustCertificates\"\r\n}", + "ResponseBody": "{\r\n \"properties\": {\r\n \"publicBlob\": \"3082031E30820206A003020102021015ECCB530A52D0874A9B4DFB69FFCAA0300D06092A864886F70D01010B0500304B3149304706035504031E40004D0053005F00530051004C005200650073006F0075007200630065005300690067006E0069006E006700430065007200740069006600690063006100740065301E170D3231303332333031343733385A170D3232303332333031343733385A304B3149304706035504031E40004D0053005F00530051004C005200650073006F0075007200630065005300690067006E0069006E00670043006500720074006900660069006300610074006530820122300D06092A864886F70D01010105000382010F003082010A0282010100C3BC903BD030D2EE904E941B603040F7DF38262BBA86AD3B9AD4BFE361D910378C5459DE540398E43124272BAE97AE502490F5140393A66EC49667D1B64449EAECC0DCB7FCA5BBF2E214F0AF8A697CBAF790B0FCD086C69C06A363849D7481468894E40F0B6466591775FFA6B3E387F5C56126078EBB69CB7EA9FD842233A29C9D92EE0ED2D9D09C96EBE2B4089EBE9A2D2276F75F506FD09CB3DF312C2B737E8E20AB4C7F48EF5D730D8AB4BB7234315ABD4CB2568896801CECB2B6452EADAEE2DFC7E8B03B01B0F8742BF9DA941E5449F14ABA8BAA58189D4F7558068E782580181038EB3DBAC7FD53D200357298258F3AC9ACCA4845F83C8539E35FC36B750203010001300D06092A864886F70D01010B0500038201010072200767AE16B164DCC9A7439F96CA3EBFDEEF8440B2BD9356E0257520FB8A2763E90BB6D727F7CE63CC40B40872A7C77B451EFD5CB022D349303C75956CA372D3FF513516EEA0F545240D451FC98EA743008EFDE63ABC003AEE3FA80CA05425CA3FD9C0EC8123BD6F1E9DAFE5AC33AF3A1DE89E6F28349DE7A5EE5AE39F0E6AD87B3D03037FDB9F1B1A7BB1B55A51A70C9E0604BC9EDDFA4BF1582C039826E89F960720FC6B6AB398DFFC4B38A2F7C526C9AC31D96BA40D9B02FC58FFAA37BE5B3DC0DCCF9F1ED1358A23E4E7D0E3A397B841BCFB7AE8405DE8A42511C2C3B14DFB13F467F16ED63EEB0E22127E281EEDCBD9A3D3C957AC51D5D75FBB713018\",\r\n \"thumbprint\": \"3B3209B3F06A633946AB89FA5E18D7A7E81A066E\",\r\n \"certificateName\": \"test_cert2\"\r\n },\r\n \"id\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-2310/serverTrustCertificates/test_cert2\",\r\n \"name\": \"test_cert2\",\r\n \"type\": \"Microsoft.Sql/managedInstances/serverTrustCertificates\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5787/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-4807/serverTrustCertificates?api-version=2021-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU3ODcvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNDgwNy9zZXJ2ZXJUcnVzdENlcnRpZmljYXRlcz9hcGktdmVyc2lvbj0yMDIxLTA1LTAxLXByZXZpZXc=", + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-2310/serverTrustCertificates?api-version=2021-11-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU0NTEvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtMjMxMC9zZXJ2ZXJUcnVzdENlcnRpZmljYXRlcz9hcGktdmVyc2lvbj0yMDIxLTExLTAxLXByZXZpZXc=", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "ef00b1f8-e788-4565-89b2-787dbf3b8040" + "8055cde9-28aa-4f31-b669-61289d359ef1" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.21.56803", + "FxVersion/4.700.22.11601", "OSName/Windows", "OSVersion/Microsoft.Windows.10.0.17763", - "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.0.0" + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" ] }, "ResponseHeaders": { @@ -987,19 +930,19 @@ "no-cache" ], "x-ms-request-id": [ - "497a538e-fc8a-4946-926c-ebe5590c9050" + "c85c7418-712e-4527-bc76-0178e30419da" ], "Server": [ "Microsoft-HTTPAPI/2.0" ], "x-ms-ratelimit-remaining-subscription-reads": [ - "11989" + "11990" ], "x-ms-correlation-request-id": [ - "47cd704c-f81a-453a-bd4a-f16bb2253b89" + "7ba78a80-f065-467c-9c1d-245ccb43af7b" ], "x-ms-routing-request-id": [ - "UKSOUTH:20220223T130037Z:47cd704c-f81a-453a-bd4a-f16bb2253b89" + "UKSOUTH:20220403T120240Z:7ba78a80-f065-467c-9c1d-245ccb43af7b" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -1008,7 +951,7 @@ "nosniff" ], "Date": [ - "Wed, 23 Feb 2022 13:00:36 GMT" + "Sun, 03 Apr 2022 12:02:40 GMT" ], "Content-Length": [ "4009" @@ -1020,26 +963,26 @@ "-1" ] }, - "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"properties\": {\r\n \"publicBlob\": \"3082031E30820206A00302010202107339C358890D88B04D584E95AD40EFA0300D06092A864886F70D01010B0500304B3149304706035504031E40004D0053005F0053006D006F0045007800740065006E006400650064005300690067006E0069006E006700430065007200740069006600690063006100740065301E170D3231303332333031343733385A170D3232303332333031343733385A304B3149304706035504031E40004D0053005F0053006D006F0045007800740065006E006400650064005300690067006E0069006E00670043006500720074006900660069006300610074006530820122300D06092A864886F70D01010105000382010F003082010A0282010100B796616200301A3E8E06A594CD45EB665676E23368222D7F7F70E6474B602978A7A3D45381B293D6FE5C4EB47298496CDA2599DBC2645B2A1CEB311FC4D5AD5AE162E337776D90B8D1E30BF2BB1D19783B22AA261EBA70FBF6896FFE356ED7A7E09EA71F67B6E2213ACE95E8DA12038B6D2D2C986D56CA0859D6A1BDA7DA08DCFFE11FF1E59EDA4225BC0A252405025E49F5C34B65E9614DF8BBD78AFE33CD14E32F2043D833EE7EF6CE3E663BF437A72DE2933D6FC62FB5E87F6B443A0257135C09B8308B231358594EE2FD3A384B3AD5B7D22B1B35E1682F28CC5F7F27A233D704E7DE46126B811E5CF4D2835C316DBD9A4288DA02B2481FF8FCEF754F957D0203010001300D06092A864886F70D01010B0500038201010029577117B09612B085B6AE47417C556013DEF38F61E726E1DEE908332BDD50F830CE43B7D61F20E300E50E23305C94D19DB5FF0F66D0E7B6DAB6510680A10B346653359C1B20F219BF1EB4217B6AEC4CD01BB96F0E84CC9C5DC6DA325EB8979DCA9E9F61AF1C2BB3E3DAB4DE7D118588184FF98FE8E803F3374392464A64563D097AB878DB01115CD443EAF58B0705E13A1E27021F6C0E0104CF5307DCCA79D4CA70F26A3FD2CE89AAE0AD1C08E884AB1BD8FAF3983A0667820BB122688E30C873932FB25BF85EA0B23E651D4DBA5436EC6F17D770832E7041ED44952883470E1B599FDB0E518E663CBD6FED7983849101A89497CF4D0C9FE2DF7F9C2BE3C21A\",\r\n \"thumbprint\": \"5E1C40529126487B5B20C0E7E299FFF7190E94D7\",\r\n \"certificateName\": \"test_cert1\"\r\n },\r\n \"id\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5787/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-4807/serverTrustCertificates/test_cert1\",\r\n \"name\": \"test_cert1\",\r\n \"type\": \"Microsoft.Sql/managedInstances/serverTrustCertificates\"\r\n },\r\n {\r\n \"properties\": {\r\n \"publicBlob\": \"3082031E30820206A003020102021015ECCB530A52D0874A9B4DFB69FFCAA0300D06092A864886F70D01010B0500304B3149304706035504031E40004D0053005F00530051004C005200650073006F0075007200630065005300690067006E0069006E006700430065007200740069006600690063006100740065301E170D3231303332333031343733385A170D3232303332333031343733385A304B3149304706035504031E40004D0053005F00530051004C005200650073006F0075007200630065005300690067006E0069006E00670043006500720074006900660069006300610074006530820122300D06092A864886F70D01010105000382010F003082010A0282010100C3BC903BD030D2EE904E941B603040F7DF38262BBA86AD3B9AD4BFE361D910378C5459DE540398E43124272BAE97AE502490F5140393A66EC49667D1B64449EAECC0DCB7FCA5BBF2E214F0AF8A697CBAF790B0FCD086C69C06A363849D7481468894E40F0B6466591775FFA6B3E387F5C56126078EBB69CB7EA9FD842233A29C9D92EE0ED2D9D09C96EBE2B4089EBE9A2D2276F75F506FD09CB3DF312C2B737E8E20AB4C7F48EF5D730D8AB4BB7234315ABD4CB2568896801CECB2B6452EADAEE2DFC7E8B03B01B0F8742BF9DA941E5449F14ABA8BAA58189D4F7558068E782580181038EB3DBAC7FD53D200357298258F3AC9ACCA4845F83C8539E35FC36B750203010001300D06092A864886F70D01010B0500038201010072200767AE16B164DCC9A7439F96CA3EBFDEEF8440B2BD9356E0257520FB8A2763E90BB6D727F7CE63CC40B40872A7C77B451EFD5CB022D349303C75956CA372D3FF513516EEA0F545240D451FC98EA743008EFDE63ABC003AEE3FA80CA05425CA3FD9C0EC8123BD6F1E9DAFE5AC33AF3A1DE89E6F28349DE7A5EE5AE39F0E6AD87B3D03037FDB9F1B1A7BB1B55A51A70C9E0604BC9EDDFA4BF1582C039826E89F960720FC6B6AB398DFFC4B38A2F7C526C9AC31D96BA40D9B02FC58FFAA37BE5B3DC0DCCF9F1ED1358A23E4E7D0E3A397B841BCFB7AE8405DE8A42511C2C3B14DFB13F467F16ED63EEB0E22127E281EEDCBD9A3D3C957AC51D5D75FBB713018\",\r\n \"thumbprint\": \"3B3209B3F06A633946AB89FA5E18D7A7E81A066E\",\r\n \"certificateName\": \"test_cert2\"\r\n },\r\n \"id\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5787/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-4807/serverTrustCertificates/test_cert2\",\r\n \"name\": \"test_cert2\",\r\n \"type\": \"Microsoft.Sql/managedInstances/serverTrustCertificates\"\r\n }\r\n ]\r\n}", + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"properties\": {\r\n \"publicBlob\": \"3082031E30820206A00302010202107339C358890D88B04D584E95AD40EFA0300D06092A864886F70D01010B0500304B3149304706035504031E40004D0053005F0053006D006F0045007800740065006E006400650064005300690067006E0069006E006700430065007200740069006600690063006100740065301E170D3231303332333031343733385A170D3232303332333031343733385A304B3149304706035504031E40004D0053005F0053006D006F0045007800740065006E006400650064005300690067006E0069006E00670043006500720074006900660069006300610074006530820122300D06092A864886F70D01010105000382010F003082010A0282010100B796616200301A3E8E06A594CD45EB665676E23368222D7F7F70E6474B602978A7A3D45381B293D6FE5C4EB47298496CDA2599DBC2645B2A1CEB311FC4D5AD5AE162E337776D90B8D1E30BF2BB1D19783B22AA261EBA70FBF6896FFE356ED7A7E09EA71F67B6E2213ACE95E8DA12038B6D2D2C986D56CA0859D6A1BDA7DA08DCFFE11FF1E59EDA4225BC0A252405025E49F5C34B65E9614DF8BBD78AFE33CD14E32F2043D833EE7EF6CE3E663BF437A72DE2933D6FC62FB5E87F6B443A0257135C09B8308B231358594EE2FD3A384B3AD5B7D22B1B35E1682F28CC5F7F27A233D704E7DE46126B811E5CF4D2835C316DBD9A4288DA02B2481FF8FCEF754F957D0203010001300D06092A864886F70D01010B0500038201010029577117B09612B085B6AE47417C556013DEF38F61E726E1DEE908332BDD50F830CE43B7D61F20E300E50E23305C94D19DB5FF0F66D0E7B6DAB6510680A10B346653359C1B20F219BF1EB4217B6AEC4CD01BB96F0E84CC9C5DC6DA325EB8979DCA9E9F61AF1C2BB3E3DAB4DE7D118588184FF98FE8E803F3374392464A64563D097AB878DB01115CD443EAF58B0705E13A1E27021F6C0E0104CF5307DCCA79D4CA70F26A3FD2CE89AAE0AD1C08E884AB1BD8FAF3983A0667820BB122688E30C873932FB25BF85EA0B23E651D4DBA5436EC6F17D770832E7041ED44952883470E1B599FDB0E518E663CBD6FED7983849101A89497CF4D0C9FE2DF7F9C2BE3C21A\",\r\n \"thumbprint\": \"5E1C40529126487B5B20C0E7E299FFF7190E94D7\",\r\n \"certificateName\": \"test_cert1\"\r\n },\r\n \"id\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-2310/serverTrustCertificates/test_cert1\",\r\n \"name\": \"test_cert1\",\r\n \"type\": \"Microsoft.Sql/managedInstances/serverTrustCertificates\"\r\n },\r\n {\r\n \"properties\": {\r\n \"publicBlob\": \"3082031E30820206A003020102021015ECCB530A52D0874A9B4DFB69FFCAA0300D06092A864886F70D01010B0500304B3149304706035504031E40004D0053005F00530051004C005200650073006F0075007200630065005300690067006E0069006E006700430065007200740069006600690063006100740065301E170D3231303332333031343733385A170D3232303332333031343733385A304B3149304706035504031E40004D0053005F00530051004C005200650073006F0075007200630065005300690067006E0069006E00670043006500720074006900660069006300610074006530820122300D06092A864886F70D01010105000382010F003082010A0282010100C3BC903BD030D2EE904E941B603040F7DF38262BBA86AD3B9AD4BFE361D910378C5459DE540398E43124272BAE97AE502490F5140393A66EC49667D1B64449EAECC0DCB7FCA5BBF2E214F0AF8A697CBAF790B0FCD086C69C06A363849D7481468894E40F0B6466591775FFA6B3E387F5C56126078EBB69CB7EA9FD842233A29C9D92EE0ED2D9D09C96EBE2B4089EBE9A2D2276F75F506FD09CB3DF312C2B737E8E20AB4C7F48EF5D730D8AB4BB7234315ABD4CB2568896801CECB2B6452EADAEE2DFC7E8B03B01B0F8742BF9DA941E5449F14ABA8BAA58189D4F7558068E782580181038EB3DBAC7FD53D200357298258F3AC9ACCA4845F83C8539E35FC36B750203010001300D06092A864886F70D01010B0500038201010072200767AE16B164DCC9A7439F96CA3EBFDEEF8440B2BD9356E0257520FB8A2763E90BB6D727F7CE63CC40B40872A7C77B451EFD5CB022D349303C75956CA372D3FF513516EEA0F545240D451FC98EA743008EFDE63ABC003AEE3FA80CA05425CA3FD9C0EC8123BD6F1E9DAFE5AC33AF3A1DE89E6F28349DE7A5EE5AE39F0E6AD87B3D03037FDB9F1B1A7BB1B55A51A70C9E0604BC9EDDFA4BF1582C039826E89F960720FC6B6AB398DFFC4B38A2F7C526C9AC31D96BA40D9B02FC58FFAA37BE5B3DC0DCCF9F1ED1358A23E4E7D0E3A397B841BCFB7AE8405DE8A42511C2C3B14DFB13F467F16ED63EEB0E22127E281EEDCBD9A3D3C957AC51D5D75FBB713018\",\r\n \"thumbprint\": \"3B3209B3F06A633946AB89FA5E18D7A7E81A066E\",\r\n \"certificateName\": \"test_cert2\"\r\n },\r\n \"id\": \"/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-2310/serverTrustCertificates/test_cert2\",\r\n \"name\": \"test_cert2\",\r\n \"type\": \"Microsoft.Sql/managedInstances/serverTrustCertificates\"\r\n }\r\n ]\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5787/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-4807/serverTrustCertificates/invalid_cert1?api-version=2021-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU3ODcvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNDgwNy9zZXJ2ZXJUcnVzdENlcnRpZmljYXRlcy9pbnZhbGlkX2NlcnQxP2FwaS12ZXJzaW9uPTIwMjEtMDUtMDEtcHJldmlldw==", + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-2310/serverTrustCertificates/invalid_cert1?api-version=2021-11-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU0NTEvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtMjMxMC9zZXJ2ZXJUcnVzdENlcnRpZmljYXRlcy9pbnZhbGlkX2NlcnQxP2FwaS12ZXJzaW9uPTIwMjEtMTEtMDEtcHJldmlldw==", "RequestMethod": "PUT", "RequestBody": "{\r\n \"properties\": {\r\n \"publicBlob\": \"0x3082031E30820206A00302010202107339C358890D88B04D584E95AD40EFA0300D06092A864886F70D01010B0500304B3149304706035504031E40004D0053005F0053006D006F0045007800740065\"\r\n }\r\n}", "RequestHeaders": { "x-ms-client-request-id": [ - "31e365b9-24ba-41a6-bd23-32a38acdff96" + "6a838b83-52ed-4acb-9c4f-43fcaa7c716a" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.21.56803", + "FxVersion/4.700.22.11601", "OSName/Windows", "OSVersion/Microsoft.Windows.10.0.17763", - "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.0.0" + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" ], "Content-Type": [ "application/json; charset=utf-8" @@ -1056,7 +999,7 @@ "no-cache" ], "x-ms-request-id": [ - "a8423514-3114-44c5-af1a-c7e036575c2c" + "755cf189-d1f9-4f77-af51-69feba400043" ], "Server": [ "Microsoft-HTTPAPI/2.0" @@ -1065,10 +1008,10 @@ "1196" ], "x-ms-correlation-request-id": [ - "d17f8acb-add4-4bc5-9db1-5347638f75cb" + "f6dc402d-af7c-47d6-870b-5ffd4e486da7" ], "x-ms-routing-request-id": [ - "UKSOUTH:20220223T130037Z:d17f8acb-add4-4bc5-9db1-5347638f75cb" + "UKSOUTH:20220403T120240Z:f6dc402d-af7c-47d6-870b-5ffd4e486da7" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -1077,7 +1020,7 @@ "nosniff" ], "Date": [ - "Wed, 23 Feb 2022 13:00:37 GMT" + "Sun, 03 Apr 2022 12:02:40 GMT" ], "Content-Length": [ "130" @@ -1093,22 +1036,22 @@ "StatusCode": 400 }, { - "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5787/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-4807/serverTrustCertificates/invalid_cert2?api-version=2021-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU3ODcvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNDgwNy9zZXJ2ZXJUcnVzdENlcnRpZmljYXRlcy9pbnZhbGlkX2NlcnQyP2FwaS12ZXJzaW9uPTIwMjEtMDUtMDEtcHJldmlldw==", + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-2310/serverTrustCertificates/invalid_cert2?api-version=2021-11-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU0NTEvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtMjMxMC9zZXJ2ZXJUcnVzdENlcnRpZmljYXRlcy9pbnZhbGlkX2NlcnQyP2FwaS12ZXJzaW9uPTIwMjEtMTEtMDEtcHJldmlldw==", "RequestMethod": "PUT", "RequestBody": "{}", "RequestHeaders": { "x-ms-client-request-id": [ - "4280bc58-1dda-41a8-a064-2b2222cd99b5" + "ad1637e3-1d50-4a3e-a775-43b6b8c4dfcc" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.21.56803", + "FxVersion/4.700.22.11601", "OSName/Windows", "OSVersion/Microsoft.Windows.10.0.17763", - "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.0.0" + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" ], "Content-Type": [ "application/json; charset=utf-8" @@ -1125,7 +1068,7 @@ "no-cache" ], "x-ms-request-id": [ - "718ea47a-dc1b-43bc-881e-58739bf944f8" + "1e3932be-1d0b-4cd2-8107-a4fa61a7ff61" ], "Server": [ "Microsoft-HTTPAPI/2.0" @@ -1134,13 +1077,13 @@ "service" ], "x-ms-ratelimit-remaining-subscription-writes": [ - "1194" + "1199" ], "x-ms-correlation-request-id": [ - "f3eb828d-b447-4184-9dd1-97647d8501f3" + "b6b55706-3af5-46e9-ba57-96bd00f90883" ], "x-ms-routing-request-id": [ - "UKSOUTH:20220223T130100Z:f3eb828d-b447-4184-9dd1-97647d8501f3" + "UKSOUTH:20220403T120304Z:b6b55706-3af5-46e9-ba57-96bd00f90883" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -1149,7 +1092,7 @@ "nosniff" ], "Date": [ - "Wed, 23 Feb 2022 13:01:00 GMT" + "Sun, 03 Apr 2022 12:03:03 GMT" ], "Connection": [ "close" @@ -1164,26 +1107,26 @@ "-1" ] }, - "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"An unexpected error occured while processing the request. Tracking ID: '718ea47a-dc1b-43bc-881e-58739bf944f8'\"\r\n }\r\n}", + "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"An unexpected error occured while processing the request. Tracking ID: '1e3932be-1d0b-4cd2-8107-a4fa61a7ff61'\"\r\n }\r\n}", "StatusCode": 500 }, { - "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5787/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-4807/serverTrustCertificates/invalid_cert3?api-version=2021-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU3ODcvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNDgwNy9zZXJ2ZXJUcnVzdENlcnRpZmljYXRlcy9pbnZhbGlkX2NlcnQzP2FwaS12ZXJzaW9uPTIwMjEtMDUtMDEtcHJldmlldw==", + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-2310/serverTrustCertificates/invalid_cert3?api-version=2021-11-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU0NTEvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtMjMxMC9zZXJ2ZXJUcnVzdENlcnRpZmljYXRlcy9pbnZhbGlkX2NlcnQzP2FwaS12ZXJzaW9uPTIwMjEtMTEtMDEtcHJldmlldw==", "RequestMethod": "PUT", "RequestBody": "{\r\n \"properties\": {\r\n \"publicBlob\": \"0x3082031E30820206A00302010202107339C358890D88B04D584E95AD40EFA0300D06092A864886F70D01010B0500304B3149304706035504031E40004D0053005F0053006D006F0045007800740065006E006400650064005300690067006E0069006E006700430065007200740069006600690063006100740065301E170D3231303332333031343733385A170D3232303332333031343733385A304B3149304706035504031E40004D0053005F0053006D006F0045007800740065006E006400650064005300690067006E0069006E00670043006500720074006900660069006300610074006530820122300D06092A864886F70D01010105000382010F003082010A0282010100B796616200301A3E8E06A594CD45EB665676E23368222D7F7F70E6474B602978A7A3D45381B293D6FE5C4EB47298496CDA2599DBC2645B2A1CEB311FC4D5AD5AE162E337776D90B8D1E30BF2BB1D19783B22AA261EBA70FBF6896FFE356ED7A7E09EA71F67B6E2213ACE95E8DA12038B6D2D2C986D56CA0859D6A1BDA7DA08DCFFE11FF1E59EDA4225BC0A252405025E49F5C34B65E9614DF8BBD78AFE33CD14E32F2043D833EE7EF6CE3E663BF437A72DE2933D6FC62FB5E87F6B443A0257135C09B8308B231358594EE2FD3A384B3AD5B7D22B1B35E1682F28CC5F7F27A233D704E7DE46126B811E5CF4D2835C316DBD9A4288DA02B2481FF8FCEF754F957D0203010001300D06092A864886F70D01010B0500038201010029577117B09612B085B6AE47417C556013DEF38F61E726E1DEE908332BDD50F830CE43B7D61F20E300E50E23305C94D19DB5FF0F66D0E7B6DAB6510680A10B346653359C1B20F219BF1EB4217B6AEC4CD01BB96F0E84CC9C5DC6DA325EB8979DCA9E9F61AF1C2BB3E3DAB4DE7D118588184FF98FE8E803F3374392464A64563D097AB878DB01115CD443EAF58B0705E13A1E27021F6C0E0104CF5307DCCA79D4CA70F26A3FD2CE89AAE0AD1C08E884AB1BD8FAF3983A0667820BB122688E30C873932FB25BF85EA0B23E651D4DBA5436EC6F17D770832E7041ED44952883470E1B599FDB0E518E663CBD6FED7983849101A89497CF4D0C9FE2DF7F9C2BE3C21A\"\r\n }\r\n}", "RequestHeaders": { "x-ms-client-request-id": [ - "d2860c2e-3b3f-42a5-8383-dd57f031437d" + "f3eb26ec-d792-41ad-a52c-c56d81f730b0" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.21.56803", + "FxVersion/4.700.22.11601", "OSName/Windows", "OSVersion/Microsoft.Windows.10.0.17763", - "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.0.0" + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" ], "Content-Type": [ "application/json; charset=utf-8" @@ -1200,16 +1143,16 @@ "no-cache" ], "Location": [ - "https://management.azure.com/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5787/providers/Microsoft.Sql/locations/westcentralus/serverTrustCertificatesOperationResults/383f02aa-0833-4bdf-b057-d0a86cb41884?api-version=2021-05-01-preview" + "https://management.azure.com/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/locations/westcentralus/serverTrustCertificatesOperationResults/80fa2eb1-d447-44d5-adce-a62e719f1c58?api-version=2021-11-01-preview" ], "Retry-After": [ "15" ], "Azure-AsyncOperation": [ - "https://management.azure.com/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5787/providers/Microsoft.Sql/locations/westcentralus/serverTrustCertificatesAzureAsyncOperation/383f02aa-0833-4bdf-b057-d0a86cb41884?api-version=2021-05-01-preview" + "https://management.azure.com/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/locations/westcentralus/serverTrustCertificatesAzureAsyncOperation/80fa2eb1-d447-44d5-adce-a62e719f1c58?api-version=2021-11-01-preview" ], "x-ms-request-id": [ - "34c41e91-09b5-4cdc-8bb8-98b36d879988" + "80fa2eb1-d447-44d5-adce-a62e719f1c58" ], "Server": [ "Microsoft-HTTPAPI/2.0" @@ -1218,10 +1161,10 @@ "1199" ], "x-ms-correlation-request-id": [ - "c8290620-c2aa-45a9-b339-35358fa8aef7" + "f8cced35-7db0-45c9-876f-59c0ab51830c" ], "x-ms-routing-request-id": [ - "UKSOUTH:20220223T130101Z:c8290620-c2aa-45a9-b339-35358fa8aef7" + "UKSOUTH:20220403T120305Z:f8cced35-7db0-45c9-876f-59c0ab51830c" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -1230,10 +1173,10 @@ "nosniff" ], "Date": [ - "Wed, 23 Feb 2022 13:01:01 GMT" + "Sun, 03 Apr 2022 12:03:05 GMT" ], "Content-Length": [ - "97" + "98" ], "Content-Type": [ "application/json; charset=utf-8" @@ -1242,26 +1185,26 @@ "-1" ] }, - "ResponseBody": "{\r\n \"operation\": \"UploadManagedInstanceServerTrustCertificate\",\r\n \"startTime\": \"2022-02-23T13:01:01.77Z\"\r\n}", + "ResponseBody": "{\r\n \"operation\": \"UploadManagedInstanceServerTrustCertificate\",\r\n \"startTime\": \"2022-04-03T12:03:05.527Z\"\r\n}", "StatusCode": 202 }, { - "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5787/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-4807/serverTrustCertificates/invalid_cert3?api-version=2021-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU3ODcvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNDgwNy9zZXJ2ZXJUcnVzdENlcnRpZmljYXRlcy9pbnZhbGlkX2NlcnQzP2FwaS12ZXJzaW9uPTIwMjEtMDUtMDEtcHJldmlldw==", + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-2310/serverTrustCertificates/invalid_cert3?api-version=2021-11-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU0NTEvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtMjMxMC9zZXJ2ZXJUcnVzdENlcnRpZmljYXRlcy9pbnZhbGlkX2NlcnQzP2FwaS12ZXJzaW9uPTIwMjEtMTEtMDEtcHJldmlldw==", "RequestMethod": "PUT", "RequestBody": "{\r\n \"properties\": {\r\n \"publicBlob\": \"\"\r\n }\r\n}", "RequestHeaders": { "x-ms-client-request-id": [ - "f623dc47-6b26-4bc3-8538-0421561da156" + "c0eb0a76-53ac-40fc-8bc6-95613cbd2d84" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.21.56803", + "FxVersion/4.700.22.11601", "OSName/Windows", "OSVersion/Microsoft.Windows.10.0.17763", - "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.0.0" + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" ], "Content-Type": [ "application/json; charset=utf-8" @@ -1278,7 +1221,7 @@ "no-cache" ], "x-ms-request-id": [ - "0d4d1f7d-381d-4fb4-a38e-78553c1cc97f" + "a561a617-b4d4-4f6d-a58c-1caf3d636545" ], "Server": [ "Microsoft-HTTPAPI/2.0" @@ -1287,10 +1230,10 @@ "1198" ], "x-ms-correlation-request-id": [ - "f99820fd-3a33-49e4-a59b-c63ea9153438" + "4cfa1617-4504-4be1-806a-3be2f751488c" ], "x-ms-routing-request-id": [ - "UKSOUTH:20220223T130117Z:f99820fd-3a33-49e4-a59b-c63ea9153438" + "UKSOUTH:20220403T120321Z:4cfa1617-4504-4be1-806a-3be2f751488c" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -1299,7 +1242,7 @@ "nosniff" ], "Date": [ - "Wed, 23 Feb 2022 13:01:17 GMT" + "Sun, 03 Apr 2022 12:03:20 GMT" ], "Content-Length": [ "78" @@ -1315,16 +1258,16 @@ "StatusCode": 400 }, { - "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5787/providers/Microsoft.Sql/locations/westcentralus/serverTrustCertificatesAzureAsyncOperation/383f02aa-0833-4bdf-b057-d0a86cb41884?api-version=2021-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU3ODcvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbG9jYXRpb25zL3dlc3RjZW50cmFsdXMvc2VydmVyVHJ1c3RDZXJ0aWZpY2F0ZXNBenVyZUFzeW5jT3BlcmF0aW9uLzM4M2YwMmFhLTA4MzMtNGJkZi1iMDU3LWQwYTg2Y2I0MTg4ND9hcGktdmVyc2lvbj0yMDIxLTA1LTAxLXByZXZpZXc=", + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/locations/westcentralus/serverTrustCertificatesAzureAsyncOperation/80fa2eb1-d447-44d5-adce-a62e719f1c58?api-version=2021-11-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU0NTEvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbG9jYXRpb25zL3dlc3RjZW50cmFsdXMvc2VydmVyVHJ1c3RDZXJ0aWZpY2F0ZXNBenVyZUFzeW5jT3BlcmF0aW9uLzgwZmEyZWIxLWQ0NDctNDRkNS1hZGNlLWE2MmU3MTlmMWM1OD9hcGktdmVyc2lvbj0yMDIxLTExLTAxLXByZXZpZXc=", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "User-Agent": [ - "FxVersion/4.700.21.56803", + "FxVersion/4.700.22.11601", "OSName/Windows", "OSVersion/Microsoft.Windows.10.0.17763", - "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.0.0" + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" ] }, "ResponseHeaders": { @@ -1338,19 +1281,19 @@ "15" ], "x-ms-request-id": [ - "667633c3-ba64-4090-bb3a-6c1338b407ff" + "af08d1f9-6cb3-42a7-aa85-025c7cdf349f" ], "Server": [ "Microsoft-HTTPAPI/2.0" ], "x-ms-ratelimit-remaining-subscription-reads": [ - "11968" + "11999" ], "x-ms-correlation-request-id": [ - "d3c48d52-cf94-40ae-9b1b-f60112884560" + "9626cc37-54da-4702-9f56-a22495cdf9f6" ], "x-ms-routing-request-id": [ - "UKSOUTH:20220223T130117Z:d3c48d52-cf94-40ae-9b1b-f60112884560" + "UKSOUTH:20220403T120321Z:9626cc37-54da-4702-9f56-a22495cdf9f6" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -1359,10 +1302,10 @@ "nosniff" ], "Date": [ - "Wed, 23 Feb 2022 13:01:17 GMT" + "Sun, 03 Apr 2022 12:03:20 GMT" ], "Content-Length": [ - "264" + "267" ], "Content-Type": [ "application/json; charset=utf-8" @@ -1371,20 +1314,20 @@ "-1" ] }, - "ResponseBody": "{\r\n \"name\": \"383f02aa-0833-4bdf-b057-d0a86cb41884\",\r\n \"status\": \"Failed\",\r\n \"startTime\": \"2022-02-23T13:01:01.77Z\",\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"An unexpected error occured while processing the request. Tracking ID: '667633c3-ba64-4090-bb3a-6c1338b407ff'\"\r\n }\r\n}", + "ResponseBody": "{\r\n \"name\": \"80fa2eb1-d447-44d5-adce-a62e719f1c58\",\r\n \"status\": \"Failed\",\r\n \"startTime\": \"2022-04-03T12:03:05.527Z\",\r\n \"error\": {\r\n \"code\": \"CertificateAlreadyExists\",\r\n \"message\": \"A certificate with a given name already exists or this certificate already has been added to the database.\"\r\n }\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5787/providers/Microsoft.Sql/locations/westcentralus/serverTrustCertificatesAzureAsyncOperation/bb6a9fe8-84f0-4099-9d83-890e99b6687a?api-version=2021-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU3ODcvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbG9jYXRpb25zL3dlc3RjZW50cmFsdXMvc2VydmVyVHJ1c3RDZXJ0aWZpY2F0ZXNBenVyZUFzeW5jT3BlcmF0aW9uL2JiNmE5ZmU4LTg0ZjAtNDA5OS05ZDgzLTg5MGU5OWI2Njg3YT9hcGktdmVyc2lvbj0yMDIxLTA1LTAxLXByZXZpZXc=", + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/locations/westcentralus/serverTrustCertificatesAzureAsyncOperation/257dde61-a4c5-42ee-b2c6-9f14636a04eb?api-version=2021-11-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU0NTEvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbG9jYXRpb25zL3dlc3RjZW50cmFsdXMvc2VydmVyVHJ1c3RDZXJ0aWZpY2F0ZXNBenVyZUFzeW5jT3BlcmF0aW9uLzI1N2RkZTYxLWE0YzUtNDJlZS1iMmM2LTlmMTQ2MzZhMDRlYj9hcGktdmVyc2lvbj0yMDIxLTExLTAxLXByZXZpZXc=", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "User-Agent": [ - "FxVersion/4.700.21.56803", + "FxVersion/4.700.22.11601", "OSName/Windows", "OSVersion/Microsoft.Windows.10.0.17763", - "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.0.0" + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" ] }, "ResponseHeaders": { @@ -1398,19 +1341,19 @@ "15" ], "x-ms-request-id": [ - "c6598c82-0492-4a53-a669-d59207fd592a" + "04794f34-c9b6-4bca-a629-5822d2733041" ], "Server": [ "Microsoft-HTTPAPI/2.0" ], "x-ms-ratelimit-remaining-subscription-reads": [ - "11967" + "11998" ], "x-ms-correlation-request-id": [ - "42a7721d-8c33-483f-901d-56bee8eaf3fe" + "2d83b4b7-fb52-457d-afdd-52f62e66faa4" ], "x-ms-routing-request-id": [ - "UKSOUTH:20220223T130133Z:42a7721d-8c33-483f-901d-56bee8eaf3fe" + "UKSOUTH:20220403T120336Z:2d83b4b7-fb52-457d-afdd-52f62e66faa4" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -1419,10 +1362,10 @@ "nosniff" ], "Date": [ - "Wed, 23 Feb 2022 13:01:32 GMT" + "Sun, 03 Apr 2022 12:03:36 GMT" ], "Content-Length": [ - "264" + "267" ], "Content-Type": [ "application/json; charset=utf-8" @@ -1431,26 +1374,26 @@ "-1" ] }, - "ResponseBody": "{\r\n \"name\": \"bb6a9fe8-84f0-4099-9d83-890e99b6687a\",\r\n \"status\": \"Failed\",\r\n \"startTime\": \"2022-02-23T13:01:17.94Z\",\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"An unexpected error occured while processing the request. Tracking ID: 'c6598c82-0492-4a53-a669-d59207fd592a'\"\r\n }\r\n}", + "ResponseBody": "{\r\n \"name\": \"257dde61-a4c5-42ee-b2c6-9f14636a04eb\",\r\n \"status\": \"Failed\",\r\n \"startTime\": \"2022-04-03T12:03:21.573Z\",\r\n \"error\": {\r\n \"code\": \"CertificateAlreadyExists\",\r\n \"message\": \"A certificate with a given name already exists or this certificate already has been added to the database.\"\r\n }\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5787/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-4807/serverTrustCertificates/?api-version=2021-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU3ODcvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNDgwNy9zZXJ2ZXJUcnVzdENlcnRpZmljYXRlcy8/YXBpLXZlcnNpb249MjAyMS0wNS0wMS1wcmV2aWV3", + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-2310/serverTrustCertificates/?api-version=2021-11-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU0NTEvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtMjMxMC9zZXJ2ZXJUcnVzdENlcnRpZmljYXRlcy8/YXBpLXZlcnNpb249MjAyMS0xMS0wMS1wcmV2aWV3", "RequestMethod": "PUT", "RequestBody": "{\r\n \"properties\": {\r\n \"publicBlob\": \"0x3082031E30820206A00302010202107339C358890D88B04D584E95AD40EFA0300D06092A864886F70D01010B0500304B3149304706035504031E40004D0053005F0053006D006F0045007800740065006E006400650064005300690067006E0069006E006700430065007200740069006600690063006100740065301E170D3231303332333031343733385A170D3232303332333031343733385A304B3149304706035504031E40004D0053005F0053006D006F0045007800740065006E006400650064005300690067006E0069006E00670043006500720074006900660069006300610074006530820122300D06092A864886F70D01010105000382010F003082010A0282010100B796616200301A3E8E06A594CD45EB665676E23368222D7F7F70E6474B602978A7A3D45381B293D6FE5C4EB47298496CDA2599DBC2645B2A1CEB311FC4D5AD5AE162E337776D90B8D1E30BF2BB1D19783B22AA261EBA70FBF6896FFE356ED7A7E09EA71F67B6E2213ACE95E8DA12038B6D2D2C986D56CA0859D6A1BDA7DA08DCFFE11FF1E59EDA4225BC0A252405025E49F5C34B65E9614DF8BBD78AFE33CD14E32F2043D833EE7EF6CE3E663BF437A72DE2933D6FC62FB5E87F6B443A0257135C09B8308B231358594EE2FD3A384B3AD5B7D22B1B35E1682F28CC5F7F27A233D704E7DE46126B811E5CF4D2835C316DBD9A4288DA02B2481FF8FCEF754F957D0203010001300D06092A864886F70D01010B0500038201010029577117B09612B085B6AE47417C556013DEF38F61E726E1DEE908332BDD50F830CE43B7D61F20E300E50E23305C94D19DB5FF0F66D0E7B6DAB6510680A10B346653359C1B20F219BF1EB4217B6AEC4CD01BB96F0E84CC9C5DC6DA325EB8979DCA9E9F61AF1C2BB3E3DAB4DE7D118588184FF98FE8E803F3374392464A64563D097AB878DB01115CD443EAF58B0705E13A1E27021F6C0E0104CF5307DCCA79D4CA70F26A3FD2CE89AAE0AD1C08E884AB1BD8FAF3983A0667820BB122688E30C873932FB25BF85EA0B23E651D4DBA5436EC6F17D770832E7041ED44952883470E1B599FDB0E518E663CBD6FED7983849101A89497CF4D0C9FE2DF7F9C2BE3C21A\"\r\n }\r\n}", "RequestHeaders": { "x-ms-client-request-id": [ - "3f24c9ca-f5cf-4fa2-8ee3-7c8d9cc4192b" + "098ff206-4f9c-4d65-8f17-ed0e7e1df8c7" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.21.56803", + "FxVersion/4.700.22.11601", "OSName/Windows", "OSVersion/Microsoft.Windows.10.0.17763", - "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.0.0" + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" ], "Content-Type": [ "application/json; charset=utf-8" @@ -1467,7 +1410,7 @@ "no-cache" ], "x-ms-request-id": [ - "063a7f1a-e23b-42e8-829c-819c5aa0c397" + "98346d25-5057-4207-8a9c-6c4453c9818c" ], "Server": [ "Microsoft-HTTPAPI/2.0" @@ -1476,10 +1419,10 @@ "1196" ], "x-ms-correlation-request-id": [ - "509b4c03-62e7-475e-88f1-5c0f2e6eeba7" + "5d33859d-085d-45a6-ab43-277a93b67cf1" ], "x-ms-routing-request-id": [ - "UKSOUTH:20220223T130133Z:509b4c03-62e7-475e-88f1-5c0f2e6eeba7" + "UKSOUTH:20220403T120337Z:5d33859d-085d-45a6-ab43-277a93b67cf1" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -1488,7 +1431,7 @@ "nosniff" ], "Date": [ - "Wed, 23 Feb 2022 13:01:33 GMT" + "Sun, 03 Apr 2022 12:03:36 GMT" ], "Content-Length": [ "279" @@ -1500,26 +1443,26 @@ "-1" ] }, - "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"MethodNotAllowed\",\r\n \"message\": \"The HTTP method 'PUT' is not supported on the resource 'subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5787/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-4807/serverTrustCertificates'.\"\r\n }\r\n}", + "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"MethodNotAllowed\",\r\n \"message\": \"The HTTP method 'PUT' is not supported on the resource 'subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-2310/serverTrustCertificates'.\"\r\n }\r\n}", "StatusCode": 405 }, { - "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5787/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-4807/serverTrustCertificates/test_cert1?api-version=2021-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU3ODcvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNDgwNy9zZXJ2ZXJUcnVzdENlcnRpZmljYXRlcy90ZXN0X2NlcnQxP2FwaS12ZXJzaW9uPTIwMjEtMDUtMDEtcHJldmlldw==", + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-2310/serverTrustCertificates/test_cert1?api-version=2021-11-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU0NTEvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtMjMxMC9zZXJ2ZXJUcnVzdENlcnRpZmljYXRlcy90ZXN0X2NlcnQxP2FwaS12ZXJzaW9uPTIwMjEtMTEtMDEtcHJldmlldw==", "RequestMethod": "DELETE", "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "086c1379-d940-4629-b98a-1e6a56d00142" + "368c3d9d-5482-458a-a473-febd29a5a454" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.21.56803", + "FxVersion/4.700.22.11601", "OSName/Windows", "OSVersion/Microsoft.Windows.10.0.17763", - "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.0.0" + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" ] }, "ResponseHeaders": { @@ -1530,16 +1473,16 @@ "no-cache" ], "Location": [ - "https://management.azure.com/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5787/providers/Microsoft.Sql/locations/westcentralus/serverTrustCertificatesOperationResults/c058b302-6019-44ba-973a-4bf67ab697cb?api-version=2021-05-01-preview" + "https://management.azure.com/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/locations/westcentralus/serverTrustCertificatesOperationResults/782fdd0f-104e-466e-a594-d55e45ea35e9?api-version=2021-11-01-preview" ], "Retry-After": [ "15" ], "Azure-AsyncOperation": [ - "https://management.azure.com/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5787/providers/Microsoft.Sql/locations/westcentralus/serverTrustCertificatesOperationResults/c058b302-6019-44ba-973a-4bf67ab697cb?api-version=2021-05-01-preview" + "https://management.azure.com/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/locations/westcentralus/serverTrustCertificatesAzureAsyncOperation/782fdd0f-104e-466e-a594-d55e45ea35e9?api-version=2021-11-01-preview" ], "x-ms-request-id": [ - "f101fc91-ecbe-471a-97c9-9f6493c4e59d" + "782fdd0f-104e-466e-a594-d55e45ea35e9" ], "Server": [ "Microsoft-HTTPAPI/2.0" @@ -1548,10 +1491,10 @@ "14999" ], "x-ms-correlation-request-id": [ - "e0f9e38e-2fca-4604-a155-391d7eb9fc59" + "2616f55b-5dbe-4b1f-9293-0d094ca77753" ], "x-ms-routing-request-id": [ - "UKSOUTH:20220223T130133Z:e0f9e38e-2fca-4604-a155-391d7eb9fc59" + "UKSOUTH:20220403T120337Z:2616f55b-5dbe-4b1f-9293-0d094ca77753" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -1560,7 +1503,7 @@ "nosniff" ], "Date": [ - "Wed, 23 Feb 2022 13:01:33 GMT" + "Sun, 03 Apr 2022 12:03:37 GMT" ], "Content-Length": [ "98" @@ -1572,26 +1515,140 @@ "-1" ] }, - "ResponseBody": "{\r\n \"operation\": \"DeleteManagedInstanceServerTrustCertificate\",\r\n \"startTime\": \"2022-02-23T13:01:33.613Z\"\r\n}", + "ResponseBody": "{\r\n \"operation\": \"DeleteManagedInstanceServerTrustCertificate\",\r\n \"startTime\": \"2022-04-03T12:03:37.223Z\"\r\n}", "StatusCode": 202 }, { - "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5787/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-4807/serverTrustCertificates/test_cert2?api-version=2021-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU3ODcvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtNDgwNy9zZXJ2ZXJUcnVzdENlcnRpZmljYXRlcy90ZXN0X2NlcnQyP2FwaS12ZXJzaW9uPTIwMjEtMDUtMDEtcHJldmlldw==", + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/locations/westcentralus/serverTrustCertificatesAzureAsyncOperation/782fdd0f-104e-466e-a594-d55e45ea35e9?api-version=2021-11-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU0NTEvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbG9jYXRpb25zL3dlc3RjZW50cmFsdXMvc2VydmVyVHJ1c3RDZXJ0aWZpY2F0ZXNBenVyZUFzeW5jT3BlcmF0aW9uLzc4MmZkZDBmLTEwNGUtNDY2ZS1hNTk0LWQ1NWU0NWVhMzVlOT9hcGktdmVyc2lvbj0yMDIxLTExLTAxLXByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.700.22.11601", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.17763", + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "15" + ], + "x-ms-request-id": [ + "93810925-9418-4f3b-a427-a9ed18fbc3df" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11997" + ], + "x-ms-correlation-request-id": [ + "6d61bc6f-3011-4da7-94d2-e170edcc384a" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20220403T120352Z:6d61bc6f-3011-4da7-94d2-e170edcc384a" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Sun, 03 Apr 2022 12:03:52 GMT" + ], + "Content-Length": [ + "107" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"name\": \"782fdd0f-104e-466e-a594-d55e45ea35e9\",\r\n \"status\": \"Succeeded\",\r\n \"startTime\": \"2022-04-03T12:03:37.223Z\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/locations/westcentralus/serverTrustCertificatesOperationResults/782fdd0f-104e-466e-a594-d55e45ea35e9?api-version=2021-11-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU0NTEvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbG9jYXRpb25zL3dlc3RjZW50cmFsdXMvc2VydmVyVHJ1c3RDZXJ0aWZpY2F0ZXNPcGVyYXRpb25SZXN1bHRzLzc4MmZkZDBmLTEwNGUtNDY2ZS1hNTk0LWQ1NWU0NWVhMzVlOT9hcGktdmVyc2lvbj0yMDIxLTExLTAxLXByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.700.22.11601", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.17763", + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "383a1bb5-c22a-4a55-a7ec-091f529fff52" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11996" + ], + "x-ms-correlation-request-id": [ + "866dadb3-3ba4-4b9b-8a32-9ff9c584bbd3" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20220403T120352Z:866dadb3-3ba4-4b9b-8a32-9ff9c584bbd3" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Sun, 03 Apr 2022 12:03:52 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/managedInstances/net-sdk-crud-tests-2310/serverTrustCertificates/test_cert2?api-version=2021-11-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU0NTEvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9uZXQtc2RrLWNydWQtdGVzdHMtMjMxMC9zZXJ2ZXJUcnVzdENlcnRpZmljYXRlcy90ZXN0X2NlcnQyP2FwaS12ZXJzaW9uPTIwMjEtMTEtMDEtcHJldmlldw==", "RequestMethod": "DELETE", "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "b62fa368-1256-4a37-88aa-9c9de88947eb" + "f8cb7950-2ea1-46fb-b8c3-b92177fa9969" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.21.56803", + "FxVersion/4.700.22.11601", "OSName/Windows", "OSVersion/Microsoft.Windows.10.0.17763", - "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.0.0" + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" ] }, "ResponseHeaders": { @@ -1602,16 +1659,16 @@ "no-cache" ], "Location": [ - "https://management.azure.com/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5787/providers/Microsoft.Sql/locations/westcentralus/serverTrustCertificatesOperationResults/f80f0119-979b-4eab-85ff-cb081114ade8?api-version=2021-05-01-preview" + "https://management.azure.com/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/locations/westcentralus/serverTrustCertificatesOperationResults/5441bb4e-c5e2-4031-bb34-c5accf1ed0c6?api-version=2021-11-01-preview" ], "Retry-After": [ "15" ], "Azure-AsyncOperation": [ - "https://management.azure.com/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5787/providers/Microsoft.Sql/locations/westcentralus/serverTrustCertificatesOperationResults/f80f0119-979b-4eab-85ff-cb081114ade8?api-version=2021-05-01-preview" + "https://management.azure.com/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/locations/westcentralus/serverTrustCertificatesAzureAsyncOperation/5441bb4e-c5e2-4031-bb34-c5accf1ed0c6?api-version=2021-11-01-preview" ], "x-ms-request-id": [ - "773f82c2-a4d3-4b56-9b4d-67a06fd9956d" + "5441bb4e-c5e2-4031-bb34-c5accf1ed0c6" ], "Server": [ "Microsoft-HTTPAPI/2.0" @@ -1620,10 +1677,10 @@ "14998" ], "x-ms-correlation-request-id": [ - "adcf864d-3c94-4b22-a642-eb2edc21b86c" + "51ea0470-f01a-4c90-b1aa-c4601e0fcc3a" ], "x-ms-routing-request-id": [ - "UKSOUTH:20220223T130134Z:adcf864d-3c94-4b22-a642-eb2edc21b86c" + "UKSOUTH:20220403T120352Z:51ea0470-f01a-4c90-b1aa-c4601e0fcc3a" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -1632,10 +1689,10 @@ "nosniff" ], "Date": [ - "Wed, 23 Feb 2022 13:01:33 GMT" + "Sun, 03 Apr 2022 12:03:52 GMT" ], "Content-Length": [ - "97" + "98" ], "Content-Type": [ "application/json; charset=utf-8" @@ -1644,23 +1701,137 @@ "-1" ] }, - "ResponseBody": "{\r\n \"operation\": \"DeleteManagedInstanceServerTrustCertificate\",\r\n \"startTime\": \"2022-02-23T13:01:33.91Z\"\r\n}", + "ResponseBody": "{\r\n \"operation\": \"DeleteManagedInstanceServerTrustCertificate\",\r\n \"startTime\": \"2022-04-03T12:03:52.863Z\"\r\n}", "StatusCode": 202 }, { - "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourcegroups/sqlcrudtest-5787?api-version=2017-05-10", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlZ3JvdXBzL3NxbGNydWR0ZXN0LTU3ODc/YXBpLXZlcnNpb249MjAxNy0wNS0xMA==", + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/locations/westcentralus/serverTrustCertificatesAzureAsyncOperation/5441bb4e-c5e2-4031-bb34-c5accf1ed0c6?api-version=2021-11-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU0NTEvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbG9jYXRpb25zL3dlc3RjZW50cmFsdXMvc2VydmVyVHJ1c3RDZXJ0aWZpY2F0ZXNBenVyZUFzeW5jT3BlcmF0aW9uLzU0NDFiYjRlLWM1ZTItNDAzMS1iYjM0LWM1YWNjZjFlZDBjNj9hcGktdmVyc2lvbj0yMDIxLTExLTAxLXByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.700.22.11601", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.17763", + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "15" + ], + "x-ms-request-id": [ + "606226e3-36b3-45bc-b3b8-c61a18624fbd" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11995" + ], + "x-ms-correlation-request-id": [ + "a97ae83c-cde0-4b56-a54d-3638091b3e12" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20220403T120408Z:a97ae83c-cde0-4b56-a54d-3638091b3e12" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Sun, 03 Apr 2022 12:04:07 GMT" + ], + "Content-Length": [ + "107" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"name\": \"5441bb4e-c5e2-4031-bb34-c5accf1ed0c6\",\r\n \"status\": \"Succeeded\",\r\n \"startTime\": \"2022-04-03T12:03:52.863Z\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourceGroups/sqlcrudtest-5451/providers/Microsoft.Sql/locations/westcentralus/serverTrustCertificatesOperationResults/5441bb4e-c5e2-4031-bb34-c5accf1ed0c6?api-version=2021-11-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTU0NTEvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbG9jYXRpb25zL3dlc3RjZW50cmFsdXMvc2VydmVyVHJ1c3RDZXJ0aWZpY2F0ZXNPcGVyYXRpb25SZXN1bHRzLzU0NDFiYjRlLWM1ZTItNDAzMS1iYjM0LWM1YWNjZjFlZDBjNj9hcGktdmVyc2lvbj0yMDIxLTExLTAxLXByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.700.22.11601", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.17763", + "Microsoft.Azure.Management.Sql.SqlManagementClient/2.1.1.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "3208854f-af94-40a8-8396-69f9b0424c47" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11994" + ], + "x-ms-correlation-request-id": [ + "bb78db1b-1ac3-4c81-9e79-8ec983869e84" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20220403T120408Z:bb78db1b-1ac3-4c81-9e79-8ec983869e84" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Sun, 03 Apr 2022 12:04:07 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/8313371e-0879-428e-b1da-6353575a9192/resourcegroups/sqlcrudtest-5451?api-version=2017-05-10", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvODMxMzM3MWUtMDg3OS00MjhlLWIxZGEtNjM1MzU3NWE5MTkyL3Jlc291cmNlZ3JvdXBzL3NxbGNydWR0ZXN0LTU0NTE/YXBpLXZlcnNpb249MjAxNy0wNS0xMA==", "RequestMethod": "DELETE", "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "38d12056-7696-4653-acae-9b7f2525d666" + "af2c6448-8a19-4a76-bebf-c8e479d2f9fe" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.21.56803", + "FxVersion/4.700.22.11601", "OSName/Windows", "OSVersion/Microsoft.Windows.10.0.17763", "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.6.0.0" @@ -1674,7 +1845,7 @@ "no-cache" ], "Location": [ - "https://management.azure.com/subscriptions/8313371e-0879-428e-b1da-6353575a9192/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1TUUxDUlVEVEVTVDoyRDU3ODctV0VTVENFTlRSQUxVUyIsImpvYkxvY2F0aW9uIjoid2VzdGNlbnRyYWx1cyJ9?api-version=2017-05-10" + "https://management.azure.com/subscriptions/8313371e-0879-428e-b1da-6353575a9192/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1TUUxDUlVEVEVTVDoyRDU0NTEtV0VTVENFTlRSQUxVUyIsImpvYkxvY2F0aW9uIjoid2VzdGNlbnRyYWx1cyJ9?api-version=2017-05-10" ], "Retry-After": [ "15" @@ -1683,13 +1854,13 @@ "14999" ], "x-ms-request-id": [ - "caa5d5f0-45a5-4cd0-a4a0-fc73afff577c" + "793ac7ad-8ec0-4487-b10f-2e3fc6164ba4" ], "x-ms-correlation-request-id": [ - "caa5d5f0-45a5-4cd0-a4a0-fc73afff577c" + "793ac7ad-8ec0-4487-b10f-2e3fc6164ba4" ], "x-ms-routing-request-id": [ - "UKSOUTH:20220223T130138Z:caa5d5f0-45a5-4cd0-a4a0-fc73afff577c" + "UKSOUTH:20220403T120412Z:793ac7ad-8ec0-4487-b10f-2e3fc6164ba4" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -1698,7 +1869,7 @@ "nosniff" ], "Date": [ - "Wed, 23 Feb 2022 13:01:38 GMT" + "Sun, 03 Apr 2022 12:04:12 GMT" ], "Expires": [ "-1" @@ -1713,10 +1884,10 @@ ], "Names": { "CreateResourceGroup": [ - "sqlcrudtest-5787" + "sqlcrudtest-5451" ], "CreateManagedInstance": [ - "net-sdk-crud-tests-4807" + "net-sdk-crud-tests-2310" ] }, "Variables": { From af25e9b6c738dac51e78864c19d6663b2fcef359 Mon Sep 17 00:00:00 2001 From: Bogdan Ostojic Date: Fri, 8 Apr 2022 15:46:05 +0200 Subject: [PATCH 03/10] run generate.ps1 script --- .../mgmtmetadata/sql_resource-manager.txt | 10 +- .../Generated/IIPv6FirewallRulesOperations.cs | 36 ++-- .../Generated/IPv6FirewallRulesOperations.cs | 180 +++++++++--------- .../IPv6FirewallRulesOperationsExtensions.cs | 78 ++++---- .../Generated/Models/IPv6FirewallRuleList.cs | 51 ----- .../Generated/SdkInfo_SqlManagementClient.cs | 13 +- 6 files changed, 164 insertions(+), 204 deletions(-) delete mode 100644 sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/IPv6FirewallRuleList.cs diff --git a/eng/mgmt/mgmtmetadata/sql_resource-manager.txt b/eng/mgmt/mgmtmetadata/sql_resource-manager.txt index 8b5245a9515e..f4ff1d699c67 100644 --- a/eng/mgmt/mgmtmetadata/sql_resource-manager.txt +++ b/eng/mgmt/mgmtmetadata/sql_resource-manager.txt @@ -1,15 +1,15 @@ -Installing AutoRest version: v2 +Installing AutoRest version: v2 AutoRest installed successfully. Commencing code generation Generating CSharp code Executing AutoRest command -cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/main/specification/sql/resource-manager/readme.md --csharp --version=2.0.4421 --reflect-api-versions --csharp-sdks-folder=D:\OpenSourceProjects\azure-sdk-for-net\sdk +cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/main/specification/sql/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=D:\vs\gh_repos\azure-sdk-for-net\sdk Autorest CSharp Version: 2.3.82 -2022-03-10 19:08:59 UTC +2022-04-08 11:03:52 UTC Azure-rest-api-specs repository information GitHub fork: Azure Branch: main -Commit: 2b92c256213dfd230dabe819bb901c197188773a +Commit: e6960fdb7e58aa8bcca0b208a881452e2e6c55c8 AutoRest information -Requested version: 2.0.4421 +Requested version: v2 Bootstrapper version: autorest@3.5.1 diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IIPv6FirewallRulesOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IIPv6FirewallRulesOperations.cs index b083f7fbd36b..67df5526acaf 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IIPv6FirewallRulesOperations.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IIPv6FirewallRulesOperations.cs @@ -24,7 +24,7 @@ namespace Microsoft.Azure.Management.Sql public partial interface IIPv6FirewallRulesOperations { /// - /// Gets an IPv6 firewall rule. + /// Gets a list of IPv6 firewall rules. /// /// /// The name of the resource group that contains the resource. You can @@ -34,9 +34,6 @@ public partial interface IIPv6FirewallRulesOperations /// /// The name of the server. /// - /// - /// The name of the firewall rule. - /// /// /// The headers that will be added to request. /// @@ -52,9 +49,9 @@ public partial interface IIPv6FirewallRulesOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string firewallRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates an IPv6 firewall rule. + /// Gets an IPv6 firewall rule. /// /// /// The name of the resource group that contains the resource. You can @@ -67,10 +64,6 @@ public partial interface IIPv6FirewallRulesOperations /// /// The name of the firewall rule. /// - /// - /// The required parameters for creating or updating an IPv6 firewall - /// rule. - /// /// /// The headers that will be added to request. /// @@ -86,9 +79,9 @@ public partial interface IIPv6FirewallRulesOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string firewallRuleName, IPv6FirewallRule parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string firewallRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes an IPv6 firewall rule. + /// Creates or updates an IPv6 firewall rule. /// /// /// The name of the resource group that contains the resource. You can @@ -101,6 +94,10 @@ public partial interface IIPv6FirewallRulesOperations /// /// The name of the firewall rule. /// + /// + /// The required parameters for creating or updating an IPv6 firewall + /// rule. + /// /// /// The headers that will be added to request. /// @@ -110,12 +107,15 @@ public partial interface IIPv6FirewallRulesOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string firewallRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string firewallRuleName, IPv6FirewallRule parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets a list of IPv6 firewall rules. + /// Deletes an IPv6 firewall rule. /// /// /// The name of the resource group that contains the resource. You can @@ -125,6 +125,9 @@ public partial interface IIPv6FirewallRulesOperations /// /// The name of the server. /// + /// + /// The name of the firewall rule. + /// /// /// The headers that will be added to request. /// @@ -134,13 +137,10 @@ public partial interface IIPv6FirewallRulesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - Task>> ListByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string firewallRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets a list of IPv6 firewall rules. /// diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IPv6FirewallRulesOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IPv6FirewallRulesOperations.cs index a11276bd290d..796a2a063278 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IPv6FirewallRulesOperations.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IPv6FirewallRulesOperations.cs @@ -51,7 +51,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) public SqlManagementClient Client { get; private set; } /// - /// Gets an IPv6 firewall rule. + /// Gets a list of IPv6 firewall rules. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -60,9 +60,6 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) /// /// The name of the server. /// - /// - /// The name of the firewall rule. - /// /// /// Headers that will be added to request. /// @@ -84,7 +81,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string firewallRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -94,15 +91,11 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); } - if (firewallRuleName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "firewallRuleName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01-preview"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -112,17 +105,15 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serverName", serverName); - tracingParameters.Add("firewallRuleName", firewallRuleName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByServer", 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}/ipv6FirewallRules/{firewallRuleName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); - _url = _url.Replace("{firewallRuleName}", System.Uri.EscapeDataString(firewallRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -222,7 +213,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -235,7 +226,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -255,7 +246,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) } /// - /// Creates or updates an IPv6 firewall rule. + /// Gets an IPv6 firewall rule. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -267,9 +258,6 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) /// /// The name of the firewall rule. /// - /// - /// The required parameters for creating or updating an IPv6 firewall rule. - /// /// /// Headers that will be added to request. /// @@ -291,7 +279,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string firewallRuleName, IPv6FirewallRule parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string firewallRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -305,15 +293,11 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "firewallRuleName"); } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01-preview"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -324,10 +308,9 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serverName", serverName); tracingParameters.Add("firewallRuleName", firewallRuleName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -348,7 +331,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -379,12 +362,6 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) // Serialize Request string _requestContent = null; - if(parameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -405,7 +382,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -465,24 +442,6 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -491,7 +450,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) } /// - /// Deletes an IPv6 firewall rule. + /// Creates or updates an IPv6 firewall rule. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -503,6 +462,9 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) /// /// The name of the firewall rule. /// + /// + /// The required parameters for creating or updating an IPv6 firewall rule. + /// /// /// Headers that will be added to request. /// @@ -512,6 +474,9 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -521,7 +486,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string firewallRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string firewallRuleName, IPv6FirewallRule parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -535,11 +500,15 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "firewallRuleName"); } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01-preview"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -550,9 +519,10 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serverName", serverName); tracingParameters.Add("firewallRuleName", firewallRuleName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -573,7 +543,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -604,6 +574,12 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) // Serialize Request string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -624,7 +600,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -659,13 +635,49 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -674,7 +686,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) } /// - /// Gets a list of IPv6 firewall rules. + /// Deletes an IPv6 firewall rule. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -683,6 +695,9 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) /// /// The name of the server. /// + /// + /// The name of the firewall rule. + /// /// /// Headers that will be added to request. /// @@ -692,9 +707,6 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -704,7 +716,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string firewallRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -714,11 +726,15 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); } + if (firewallRuleName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "firewallRuleName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01-preview"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -728,15 +744,17 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serverName", serverName); + tracingParameters.Add("firewallRuleName", firewallRuleName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByServer", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); + _url = _url.Replace("{firewallRuleName}", System.Uri.EscapeDataString(firewallRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -750,7 +768,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -801,7 +819,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -836,31 +854,13 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _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); diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IPv6FirewallRulesOperationsExtensions.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IPv6FirewallRulesOperationsExtensions.cs index e632d77599d7..487adb33c94e 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IPv6FirewallRulesOperationsExtensions.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IPv6FirewallRulesOperationsExtensions.cs @@ -22,7 +22,7 @@ namespace Microsoft.Azure.Management.Sql public static partial class IPv6FirewallRulesOperationsExtensions { /// - /// Gets an IPv6 firewall rule. + /// Gets a list of IPv6 firewall rules. /// /// /// The operations group for this extension method. @@ -34,16 +34,13 @@ public static partial class IPv6FirewallRulesOperationsExtensions /// /// The name of the server. /// - /// - /// The name of the firewall rule. - /// - public static IPv6FirewallRule Get(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, string firewallRuleName) + public static IPage ListByServer(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName) { - return operations.GetAsync(resourceGroupName, serverName, firewallRuleName).GetAwaiter().GetResult(); + return operations.ListByServerAsync(resourceGroupName, serverName).GetAwaiter().GetResult(); } /// - /// Gets an IPv6 firewall rule. + /// Gets a list of IPv6 firewall rules. /// /// /// The operations group for this extension method. @@ -55,22 +52,19 @@ public static IPv6FirewallRule Get(this IIPv6FirewallRulesOperations operations, /// /// The name of the server. /// - /// - /// The name of the firewall rule. - /// /// /// The cancellation token. /// - public static async Task GetAsync(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, string firewallRuleName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByServerAsync(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serverName, firewallRuleName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByServerWithHttpMessagesAsync(resourceGroupName, serverName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Creates or updates an IPv6 firewall rule. + /// Gets an IPv6 firewall rule. /// /// /// The operations group for this extension method. @@ -85,16 +79,13 @@ public static IPv6FirewallRule Get(this IIPv6FirewallRulesOperations operations, /// /// The name of the firewall rule. /// - /// - /// The required parameters for creating or updating an IPv6 firewall rule. - /// - public static IPv6FirewallRule CreateOrUpdate(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, string firewallRuleName, IPv6FirewallRule parameters) + public static IPv6FirewallRule Get(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, string firewallRuleName) { - return operations.CreateOrUpdateAsync(resourceGroupName, serverName, firewallRuleName, parameters).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, serverName, firewallRuleName).GetAwaiter().GetResult(); } /// - /// Creates or updates an IPv6 firewall rule. + /// Gets an IPv6 firewall rule. /// /// /// The operations group for this extension method. @@ -109,22 +100,19 @@ public static IPv6FirewallRule CreateOrUpdate(this IIPv6FirewallRulesOperations /// /// The name of the firewall rule. /// - /// - /// The required parameters for creating or updating an IPv6 firewall rule. - /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, string firewallRuleName, IPv6FirewallRule parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, string firewallRuleName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, firewallRuleName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serverName, firewallRuleName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Deletes an IPv6 firewall rule. + /// Creates or updates an IPv6 firewall rule. /// /// /// The operations group for this extension method. @@ -139,13 +127,16 @@ public static IPv6FirewallRule CreateOrUpdate(this IIPv6FirewallRulesOperations /// /// The name of the firewall rule. /// - public static void Delete(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, string firewallRuleName) + /// + /// The required parameters for creating or updating an IPv6 firewall rule. + /// + public static IPv6FirewallRule CreateOrUpdate(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, string firewallRuleName, IPv6FirewallRule parameters) { - operations.DeleteAsync(resourceGroupName, serverName, firewallRuleName).GetAwaiter().GetResult(); + return operations.CreateOrUpdateAsync(resourceGroupName, serverName, firewallRuleName, parameters).GetAwaiter().GetResult(); } /// - /// Deletes an IPv6 firewall rule. + /// Creates or updates an IPv6 firewall rule. /// /// /// The operations group for this extension method. @@ -160,16 +151,22 @@ public static void Delete(this IIPv6FirewallRulesOperations operations, string r /// /// The name of the firewall rule. /// + /// + /// The required parameters for creating or updating an IPv6 firewall rule. + /// /// /// The cancellation token. /// - public static async Task DeleteAsync(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, string firewallRuleName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, string firewallRuleName, IPv6FirewallRule parameters, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serverName, firewallRuleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, firewallRuleName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Gets a list of IPv6 firewall rules. + /// Deletes an IPv6 firewall rule. /// /// /// The operations group for this extension method. @@ -181,13 +178,16 @@ public static void Delete(this IIPv6FirewallRulesOperations operations, string r /// /// The name of the server. /// - public static IPage ListByServer(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName) + /// + /// The name of the firewall rule. + /// + public static void Delete(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, string firewallRuleName) { - return operations.ListByServerAsync(resourceGroupName, serverName).GetAwaiter().GetResult(); + operations.DeleteAsync(resourceGroupName, serverName, firewallRuleName).GetAwaiter().GetResult(); } /// - /// Gets a list of IPv6 firewall rules. + /// Deletes an IPv6 firewall rule. /// /// /// The operations group for this extension method. @@ -199,15 +199,15 @@ public static IPage ListByServer(this IIPv6FirewallRulesOperat /// /// The name of the server. /// + /// + /// The name of the firewall rule. + /// /// /// The cancellation token. /// - public static async Task> ListByServerAsync(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteAsync(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, string firewallRuleName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByServerWithHttpMessagesAsync(resourceGroupName, serverName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serverName, firewallRuleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/IPv6FirewallRuleList.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/IPv6FirewallRuleList.cs deleted file mode 100644 index 9797c1a9fdc4..000000000000 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/IPv6FirewallRuleList.cs +++ /dev/null @@ -1,51 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Sql.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// A list of IPv6 server firewall rules. - /// - public partial class IPv6FirewallRuleList - { - /// - /// Initializes a new instance of the IPv6FirewallRuleList class. - /// - public IPv6FirewallRuleList() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the IPv6FirewallRuleList class. - /// - public IPv6FirewallRuleList(IList values = default(IList)) - { - Values = values; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "values")] - public IList Values { get; set; } - - } -} diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SdkInfo_SqlManagementClient.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SdkInfo_SqlManagementClient.cs index 70d20f0bbc7a..be79141b6288 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SdkInfo_SqlManagementClient.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SdkInfo_SqlManagementClient.cs @@ -54,7 +54,7 @@ public static IEnumerable> ApiInfo_SqlManagementCl new Tuple("Sql", "FailoverGroups", "2020-11-01-preview"), new Tuple("Sql", "FirewallRules", "2020-11-01-preview"), new Tuple("Sql", "GeoBackupPolicies", "2014-04-01"), - new Tuple("Sql", "IPv6FirewallRules", "2021-08-01-preview"), + new Tuple("Sql", "IPv6FirewallRules", "2021-11-01-preview"), new Tuple("Sql", "InstanceFailoverGroups", "2020-11-01-preview"), new Tuple("Sql", "InstancePools", "2020-11-01-preview"), new Tuple("Sql", "JobAgents", "2020-11-01-preview"), @@ -147,5 +147,16 @@ public static IEnumerable> ApiInfo_SqlManagementCl }.AsEnumerable(); } } + // BEGIN: Code Generation Metadata Section + public static readonly String AutoRestVersion = "v2"; + public static readonly String AutoRestBootStrapperVersion = "autorest@3.5.1"; + public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/main/specification/sql/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=D:\\vs\\gh_repos\\azure-sdk-for-net\\sdk"; + public static readonly String GithubForkName = "Azure"; + public static readonly String GithubBranchName = "main"; + public static readonly String GithubCommidId = "e6960fdb7e58aa8bcca0b208a881452e2e6c55c8"; + public static readonly String CodeGenerationErrors = ""; + public static readonly String GithubRepoName = "azure-rest-api-specs"; + // END: Code Generation Metadata Section } } + From 0984a47b6298324c9fe4860cfcec422af2180f6e Mon Sep 17 00:00:00 2001 From: Bogdan Ostojic Date: Fri, 8 Apr 2022 17:05:17 +0200 Subject: [PATCH 04/10] Bump versions --- .../src/Microsoft.Azure.Management.Sql.csproj | 6 ++++-- .../src/Properties/AssemblyInfo.cs | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Microsoft.Azure.Management.Sql.csproj b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Microsoft.Azure.Management.Sql.csproj index 896918a298b9..f9f1c8c79aaf 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Microsoft.Azure.Management.Sql.csproj +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Microsoft.Azure.Management.Sql.csproj @@ -7,12 +7,14 @@ Microsoft.Azure.Management.Sql Azure SQL Management SDK library Microsoft.Azure.Management.Sql - 2.1.1-preview + 2.2.1-preview Microsoft Azure SQL Management;SQL;SQL Management; diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Properties/AssemblyInfo.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Properties/AssemblyInfo.cs index 709d703d7527..4707015aae64 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Properties/AssemblyInfo.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Properties/AssemblyInfo.cs @@ -21,4 +21,4 @@ [assembly: AssemblyTitle("Microsoft Azure SQL Management Library")] [assembly: AssemblyDescription("Provides management functionality for Microsoft Azure SQL.")] [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("2.1.1.0")] +[assembly: AssemblyFileVersion("2.2.1.0")] From 9869ce3789459696b9bddef502d79a2f8050fc60 Mon Sep 17 00:00:00 2001 From: Bogdan Ostojic Date: Tue, 12 Apr 2022 18:59:05 +0200 Subject: [PATCH 05/10] revert collateral damage --- .../Generated/IIPv6FirewallRulesOperations.cs | 36 +- ...agedDatabaseSensitivityLabelsOperations.cs | 151 +- .../IManagedServerDnsAliasesOperations.cs | 281 ---- .../Generated/IPv6FirewallRulesOperations.cs | 180 +-- .../IPv6FirewallRulesOperationsExtensions.cs | 78 +- .../Generated/IReplicationLinksOperations.cs | 135 +- .../Generated/ISensitivityLabelsOperations.cs | 103 +- .../src/Generated/ISqlManagementClient.cs | 55 +- ...eRecommendedSensitivityLabelsOperations.cs | 2 +- ...agedDatabaseSensitivityLabelsOperations.cs | 883 +++-------- ...seSensitivityLabelsOperationsExtensions.cs | 300 ++-- .../ManagedServerDnsAliasesOperations.cs | 1340 ----------------- ...gedServerDnsAliasesOperationsExtensions.cs | 433 ------ .../src/Generated/Models/Database.cs | 13 +- .../src/Generated/Models/DatabaseIdentity.cs | 12 +- .../src/Generated/Models/DatabaseUpdate.cs | 13 +- .../src/Generated/Models/Delegation.cs | 63 + ...iasCreation.cs => IPv6FirewallRuleList.cs} | 26 +- .../Generated/Models/ManagedServerDnsAlias.cs | 59 - .../ManagedServerDnsAliasAcquisition.cs | 70 - .../src/Generated/Models/UnlinkParameters.cs | 53 + .../RecommendedSensitivityLabelsOperations.cs | 2 +- .../Generated/ReplicationLinksOperations.cs | 539 ++++--- .../ReplicationLinksOperationsExtensions.cs | 252 +++- .../Generated/SdkInfo_SqlManagementClient.cs | 14 +- .../Generated/SensitivityLabelsOperations.cs | 773 +++------- .../SensitivityLabelsOperationsExtensions.cs | 192 +-- .../src/Generated/SqlManagementClient.cs | 66 +- 28 files changed, 1692 insertions(+), 4432 deletions(-) delete mode 100644 sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IManagedServerDnsAliasesOperations.cs delete mode 100644 sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ManagedServerDnsAliasesOperations.cs delete mode 100644 sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ManagedServerDnsAliasesOperationsExtensions.cs create mode 100644 sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/Delegation.cs rename sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/{ManagedServerDnsAliasCreation.cs => IPv6FirewallRuleList.cs} (53%) delete mode 100644 sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/ManagedServerDnsAlias.cs delete mode 100644 sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/ManagedServerDnsAliasAcquisition.cs create mode 100644 sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/UnlinkParameters.cs diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IIPv6FirewallRulesOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IIPv6FirewallRulesOperations.cs index 67df5526acaf..b083f7fbd36b 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IIPv6FirewallRulesOperations.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IIPv6FirewallRulesOperations.cs @@ -24,7 +24,7 @@ namespace Microsoft.Azure.Management.Sql public partial interface IIPv6FirewallRulesOperations { /// - /// Gets a list of IPv6 firewall rules. + /// Gets an IPv6 firewall rule. /// /// /// The name of the resource group that contains the resource. You can @@ -34,6 +34,9 @@ public partial interface IIPv6FirewallRulesOperations /// /// The name of the server. /// + /// + /// The name of the firewall rule. + /// /// /// The headers that will be added to request. /// @@ -49,9 +52,9 @@ public partial interface IIPv6FirewallRulesOperations /// /// Thrown when a required parameter is null /// - Task>> ListByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string firewallRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets an IPv6 firewall rule. + /// Creates or updates an IPv6 firewall rule. /// /// /// The name of the resource group that contains the resource. You can @@ -64,6 +67,10 @@ public partial interface IIPv6FirewallRulesOperations /// /// The name of the firewall rule. /// + /// + /// The required parameters for creating or updating an IPv6 firewall + /// rule. + /// /// /// The headers that will be added to request. /// @@ -79,9 +86,9 @@ public partial interface IIPv6FirewallRulesOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string firewallRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string firewallRuleName, IPv6FirewallRule parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates an IPv6 firewall rule. + /// Deletes an IPv6 firewall rule. /// /// /// The name of the resource group that contains the resource. You can @@ -94,10 +101,6 @@ public partial interface IIPv6FirewallRulesOperations /// /// The name of the firewall rule. /// - /// - /// The required parameters for creating or updating an IPv6 firewall - /// rule. - /// /// /// The headers that will be added to request. /// @@ -107,15 +110,12 @@ public partial interface IIPv6FirewallRulesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string firewallRuleName, IPv6FirewallRule parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string firewallRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes an IPv6 firewall rule. + /// Gets a list of IPv6 firewall rules. /// /// /// The name of the resource group that contains the resource. You can @@ -125,9 +125,6 @@ public partial interface IIPv6FirewallRulesOperations /// /// The name of the server. /// - /// - /// The name of the firewall rule. - /// /// /// The headers that will be added to request. /// @@ -137,10 +134,13 @@ public partial interface IIPv6FirewallRulesOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string firewallRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets a list of IPv6 firewall rules. /// diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IManagedDatabaseSensitivityLabelsOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IManagedDatabaseSensitivityLabelsOperations.cs index e26cac97ec6b..be59cc99b7bc 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IManagedDatabaseSensitivityLabelsOperations.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IManagedDatabaseSensitivityLabelsOperations.cs @@ -25,7 +25,7 @@ namespace Microsoft.Azure.Management.Sql public partial interface IManagedDatabaseSensitivityLabelsOperations { /// - /// Gets the sensitivity labels of a given database + /// Gets the sensitivity label of a given column /// /// /// The name of the resource group that contains the resource. You can @@ -38,12 +38,18 @@ public partial interface IManagedDatabaseSensitivityLabelsOperations /// /// The name of the database. /// - /// - /// OData parameters to apply to the operation. + /// + /// The name of the schema. /// - /// + /// + /// The name of the table. /// - /// + /// + /// The name of the column. + /// + /// + /// The source of the sensitivity label. Possible values include: + /// 'current', 'recommended' /// /// /// The headers that will be added to request. @@ -60,10 +66,9 @@ public partial interface IManagedDatabaseSensitivityLabelsOperations /// /// Thrown when a required parameter is null /// - Task>> ListCurrentByDatabaseWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Update sensitivity labels of a given database using an operations - /// batch. + /// Creates or updates the sensitivity label of a given column /// /// /// The name of the resource group that contains the resource. You can @@ -76,42 +81,17 @@ public partial interface IManagedDatabaseSensitivityLabelsOperations /// /// 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 a required parameter is null - /// - Task UpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, SensitivityLabelUpdateList parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets the sensitivity labels of a given 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 managed instance. - /// - /// - /// The name of the database. + /// + /// The name of the schema. /// - /// - /// OData parameters to apply to the operation. + /// + /// The name of the table. /// - /// + /// + /// The name of the column. /// - /// - /// Specifies whether to include disabled recommendations or not. + /// + /// The column sensitivity label resource. /// /// /// The headers that will be added to request. @@ -128,9 +108,9 @@ public partial interface IManagedDatabaseSensitivityLabelsOperations /// /// Thrown when a required parameter is null /// - Task>> ListRecommendedByDatabaseWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), bool? includeDisabledRecommendations = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabel parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the sensitivity label of a given column + /// Deletes the sensitivity label of a given column /// /// /// The name of the resource group that contains the resource. You can @@ -152,10 +132,6 @@ public partial interface IManagedDatabaseSensitivityLabelsOperations /// /// The name of the column. /// - /// - /// The source of the sensitivity label. Possible values include: - /// 'current', 'recommended' - /// /// /// The headers that will be added to request. /// @@ -165,15 +141,12 @@ public partial interface IManagedDatabaseSensitivityLabelsOperations /// /// 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 managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates the sensitivity label of a given column + /// Disables sensitivity recommendations on a given column /// /// /// The name of the resource group that contains the resource. You can @@ -195,9 +168,6 @@ public partial interface IManagedDatabaseSensitivityLabelsOperations /// /// The name of the column. /// - /// - /// The column sensitivity label resource. - /// /// /// The headers that will be added to request. /// @@ -207,15 +177,13 @@ public partial interface IManagedDatabaseSensitivityLabelsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabel parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DisableRecommendationWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes the sensitivity label of a given column + /// Enables sensitivity recommendations on a given column + /// (recommendations are enabled by default on all columns) /// /// /// The name of the resource group that contains the resource. You can @@ -249,9 +217,9 @@ public partial interface IManagedDatabaseSensitivityLabelsOperations /// /// Thrown when a required parameter is null /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task EnableRecommendationWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Disables sensitivity recommendations on a given column + /// Gets the sensitivity labels of a given database /// /// /// The name of the resource group that contains the resource. You can @@ -264,14 +232,12 @@ public partial interface IManagedDatabaseSensitivityLabelsOperations /// /// The name of the database. /// - /// - /// The name of the schema. + /// + /// OData parameters to apply to the operation. /// - /// - /// The name of the table. + /// /// - /// - /// The name of the column. + /// /// /// /// The headers that will be added to request. @@ -282,13 +248,16 @@ public partial interface IManagedDatabaseSensitivityLabelsOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - Task DisableRecommendationWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListCurrentByDatabaseWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Enables sensitivity recommendations on a given column - /// (recommendations are enabled by default on all columns) + /// Update sensitivity labels of a given database using an operations + /// batch. /// /// /// The name of the resource group that contains the resource. You can @@ -301,14 +270,7 @@ public partial interface IManagedDatabaseSensitivityLabelsOperations /// /// The name of the database. /// - /// - /// The name of the schema. - /// - /// - /// The name of the table. - /// - /// - /// The name of the column. + /// /// /// /// The headers that will be added to request. @@ -322,7 +284,7 @@ public partial interface IManagedDatabaseSensitivityLabelsOperations /// /// Thrown when a required parameter is null /// - Task EnableRecommendationWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task UpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, SensitivityLabelUpdateList parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets the sensitivity labels of a given database /// @@ -340,27 +302,10 @@ public partial interface IManagedDatabaseSensitivityLabelsOperations /// /// OData parameters to apply to the operation. /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. + /// /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets the sensitivity labels of a given database - /// - /// - /// The NextLink from the previous successful call to List operation. + /// + /// Specifies whether to include disabled recommendations or not. /// /// /// The headers that will be added to request. @@ -377,7 +322,7 @@ public partial interface IManagedDatabaseSensitivityLabelsOperations /// /// Thrown when a required parameter is null /// - Task>> ListCurrentByDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListRecommendedByDatabaseWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), bool? includeDisabledRecommendations = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets the sensitivity labels of a given database /// @@ -399,7 +344,7 @@ public partial interface IManagedDatabaseSensitivityLabelsOperations /// /// Thrown when a required parameter is null /// - Task>> ListRecommendedByDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListCurrentByDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets the sensitivity labels of a given database /// @@ -421,6 +366,6 @@ public partial interface IManagedDatabaseSensitivityLabelsOperations /// /// Thrown when a required parameter is null /// - Task>> ListByDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListRecommendedByDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IManagedServerDnsAliasesOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IManagedServerDnsAliasesOperations.cs deleted file mode 100644 index fc03aa062c0d..000000000000 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IManagedServerDnsAliasesOperations.cs +++ /dev/null @@ -1,281 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Sql -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// ManagedServerDnsAliasesOperations operations. - /// - public partial interface IManagedServerDnsAliasesOperations - { - /// - /// Gets a list of managed server DNS aliases for a managed 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 managed instance. - /// - /// - /// 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>> ListByManagedInstanceWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets a server DNS alias. - /// - /// - /// The name of the resource group that contains the resource. You can - /// obtain this value from the Azure Resource Manager API or the - /// portal. - /// - /// - /// The name of the managed instance. - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// 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 managedInstanceName, string dnsAliasName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates a managed server DNS alias. - /// - /// - /// The name of the resource group that contains the resource. You can - /// obtain this value from the Azure Resource Manager API or the - /// portal. - /// - /// - /// The name of the managed instance. - /// - /// - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string dnsAliasName, ManagedServerDnsAliasCreation parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes the managed server DNS alias with the given name. - /// - /// - /// The name of the resource group that contains the resource. You can - /// obtain this value from the Azure Resource Manager API or the - /// portal. - /// - /// - /// The name of the managed instance. - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string dnsAliasName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Acquires managed server DNS alias from another managed 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 managed instance. - /// - /// - /// - /// - /// - /// - /// 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> AcquireWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string dnsAliasName, ManagedServerDnsAliasAcquisition parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates a managed server DNS alias. - /// - /// - /// The name of the resource group that contains the resource. You can - /// obtain this value from the Azure Resource Manager API or the - /// portal. - /// - /// - /// The name of the managed instance. - /// - /// - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string dnsAliasName, ManagedServerDnsAliasCreation parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes the managed server DNS alias with the given name. - /// - /// - /// The name of the resource group that contains the resource. You can - /// obtain this value from the Azure Resource Manager API or the - /// portal. - /// - /// - /// The name of the managed instance. - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string dnsAliasName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Acquires managed server DNS alias from another managed 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 managed instance. - /// - /// - /// - /// - /// - /// - /// 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> BeginAcquireWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string dnsAliasName, ManagedServerDnsAliasAcquisition parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets a list of managed server DNS aliases for a managed server. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByManagedInstanceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IPv6FirewallRulesOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IPv6FirewallRulesOperations.cs index 796a2a063278..a11276bd290d 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IPv6FirewallRulesOperations.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IPv6FirewallRulesOperations.cs @@ -51,7 +51,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) public SqlManagementClient Client { get; private set; } /// - /// Gets a list of IPv6 firewall rules. + /// Gets an IPv6 firewall rule. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -60,6 +60,9 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) /// /// The name of the server. /// + /// + /// The name of the firewall rule. + /// /// /// Headers that will be added to request. /// @@ -81,7 +84,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string firewallRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -91,11 +94,15 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); } + if (firewallRuleName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "firewallRuleName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-11-01-preview"; + string apiVersion = "2021-08-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -105,15 +112,17 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serverName", serverName); + tracingParameters.Add("firewallRuleName", firewallRuleName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByServer", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); + _url = _url.Replace("{firewallRuleName}", System.Uri.EscapeDataString(firewallRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -213,7 +222,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -226,7 +235,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -246,7 +255,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) } /// - /// Gets an IPv6 firewall rule. + /// Creates or updates an IPv6 firewall rule. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -258,6 +267,9 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) /// /// The name of the firewall rule. /// + /// + /// The required parameters for creating or updating an IPv6 firewall rule. + /// /// /// Headers that will be added to request. /// @@ -279,7 +291,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string firewallRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string firewallRuleName, IPv6FirewallRule parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -293,11 +305,15 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "firewallRuleName"); } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-11-01-preview"; + string apiVersion = "2021-08-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -308,9 +324,10 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serverName", serverName); tracingParameters.Add("firewallRuleName", firewallRuleName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -331,7 +348,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -362,6 +379,12 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) // Serialize Request string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -382,7 +405,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -442,6 +465,24 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -450,7 +491,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) } /// - /// Creates or updates an IPv6 firewall rule. + /// Deletes an IPv6 firewall rule. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -462,9 +503,6 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) /// /// The name of the firewall rule. /// - /// - /// The required parameters for creating or updating an IPv6 firewall rule. - /// /// /// Headers that will be added to request. /// @@ -474,9 +512,6 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -486,7 +521,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string firewallRuleName, IPv6FirewallRule parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string firewallRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -500,15 +535,11 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "firewallRuleName"); } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-11-01-preview"; + string apiVersion = "2021-08-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -519,10 +550,9 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serverName", serverName); tracingParameters.Add("firewallRuleName", firewallRuleName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -543,7 +573,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -574,12 +604,6 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) // Serialize Request string _requestContent = null; - if(parameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -600,7 +624,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -635,49 +659,13 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -686,7 +674,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) } /// - /// Deletes an IPv6 firewall rule. + /// Gets a list of IPv6 firewall rules. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -695,9 +683,6 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) /// /// The name of the server. /// - /// - /// The name of the firewall rule. - /// /// /// Headers that will be added to request. /// @@ -707,6 +692,9 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -716,7 +704,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string firewallRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -726,15 +714,11 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); } - if (firewallRuleName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "firewallRuleName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-11-01-preview"; + string apiVersion = "2021-08-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -744,17 +728,15 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serverName", serverName); - tracingParameters.Add("firewallRuleName", firewallRuleName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByServer", 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}/ipv6FirewallRules/{firewallRuleName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); - _url = _url.Replace("{firewallRuleName}", System.Uri.EscapeDataString(firewallRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -768,7 +750,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -819,7 +801,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -854,13 +836,31 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _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); diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IPv6FirewallRulesOperationsExtensions.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IPv6FirewallRulesOperationsExtensions.cs index 487adb33c94e..e632d77599d7 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IPv6FirewallRulesOperationsExtensions.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IPv6FirewallRulesOperationsExtensions.cs @@ -22,7 +22,7 @@ namespace Microsoft.Azure.Management.Sql public static partial class IPv6FirewallRulesOperationsExtensions { /// - /// Gets a list of IPv6 firewall rules. + /// Gets an IPv6 firewall rule. /// /// /// The operations group for this extension method. @@ -34,13 +34,16 @@ public static partial class IPv6FirewallRulesOperationsExtensions /// /// The name of the server. /// - public static IPage ListByServer(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName) + /// + /// The name of the firewall rule. + /// + public static IPv6FirewallRule Get(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, string firewallRuleName) { - return operations.ListByServerAsync(resourceGroupName, serverName).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, serverName, firewallRuleName).GetAwaiter().GetResult(); } /// - /// Gets a list of IPv6 firewall rules. + /// Gets an IPv6 firewall rule. /// /// /// The operations group for this extension method. @@ -52,19 +55,22 @@ public static IPage ListByServer(this IIPv6FirewallRulesOperat /// /// The name of the server. /// + /// + /// The name of the firewall rule. + /// /// /// The cancellation token. /// - public static async Task> ListByServerAsync(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, string firewallRuleName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByServerWithHttpMessagesAsync(resourceGroupName, serverName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serverName, firewallRuleName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets an IPv6 firewall rule. + /// Creates or updates an IPv6 firewall rule. /// /// /// The operations group for this extension method. @@ -79,13 +85,16 @@ public static IPage ListByServer(this IIPv6FirewallRulesOperat /// /// The name of the firewall rule. /// - public static IPv6FirewallRule Get(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, string firewallRuleName) + /// + /// The required parameters for creating or updating an IPv6 firewall rule. + /// + public static IPv6FirewallRule CreateOrUpdate(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, string firewallRuleName, IPv6FirewallRule parameters) { - return operations.GetAsync(resourceGroupName, serverName, firewallRuleName).GetAwaiter().GetResult(); + return operations.CreateOrUpdateAsync(resourceGroupName, serverName, firewallRuleName, parameters).GetAwaiter().GetResult(); } /// - /// Gets an IPv6 firewall rule. + /// Creates or updates an IPv6 firewall rule. /// /// /// The operations group for this extension method. @@ -100,19 +109,22 @@ public static IPv6FirewallRule Get(this IIPv6FirewallRulesOperations operations, /// /// The name of the firewall rule. /// + /// + /// The required parameters for creating or updating an IPv6 firewall rule. + /// /// /// The cancellation token. /// - public static async Task GetAsync(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, string firewallRuleName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, string firewallRuleName, IPv6FirewallRule parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serverName, firewallRuleName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, firewallRuleName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Creates or updates an IPv6 firewall rule. + /// Deletes an IPv6 firewall rule. /// /// /// The operations group for this extension method. @@ -127,16 +139,13 @@ public static IPv6FirewallRule Get(this IIPv6FirewallRulesOperations operations, /// /// The name of the firewall rule. /// - /// - /// The required parameters for creating or updating an IPv6 firewall rule. - /// - public static IPv6FirewallRule CreateOrUpdate(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, string firewallRuleName, IPv6FirewallRule parameters) + public static void Delete(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, string firewallRuleName) { - return operations.CreateOrUpdateAsync(resourceGroupName, serverName, firewallRuleName, parameters).GetAwaiter().GetResult(); + operations.DeleteAsync(resourceGroupName, serverName, firewallRuleName).GetAwaiter().GetResult(); } /// - /// Creates or updates an IPv6 firewall rule. + /// Deletes an IPv6 firewall rule. /// /// /// The operations group for this extension method. @@ -151,22 +160,16 @@ public static IPv6FirewallRule CreateOrUpdate(this IIPv6FirewallRulesOperations /// /// The name of the firewall rule. /// - /// - /// The required parameters for creating or updating an IPv6 firewall rule. - /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, string firewallRuleName, IPv6FirewallRule parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteAsync(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, string firewallRuleName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, firewallRuleName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serverName, firewallRuleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Deletes an IPv6 firewall rule. + /// Gets a list of IPv6 firewall rules. /// /// /// The operations group for this extension method. @@ -178,16 +181,13 @@ public static IPv6FirewallRule CreateOrUpdate(this IIPv6FirewallRulesOperations /// /// The name of the server. /// - /// - /// The name of the firewall rule. - /// - public static void Delete(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, string firewallRuleName) + public static IPage ListByServer(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName) { - operations.DeleteAsync(resourceGroupName, serverName, firewallRuleName).GetAwaiter().GetResult(); + return operations.ListByServerAsync(resourceGroupName, serverName).GetAwaiter().GetResult(); } /// - /// Deletes an IPv6 firewall rule. + /// Gets a list of IPv6 firewall rules. /// /// /// The operations group for this extension method. @@ -199,15 +199,15 @@ public static void Delete(this IIPv6FirewallRulesOperations operations, string r /// /// The name of the server. /// - /// - /// The name of the firewall rule. - /// /// /// The cancellation token. /// - public static async Task DeleteAsync(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, string firewallRuleName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByServerAsync(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serverName, firewallRuleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.ListByServerWithHttpMessagesAsync(resourceGroupName, serverName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IReplicationLinksOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IReplicationLinksOperations.cs index f7b71ae0811b..8e46eb06c69a 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IReplicationLinksOperations.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IReplicationLinksOperations.cs @@ -24,7 +24,8 @@ namespace Microsoft.Azure.Management.Sql public partial interface IReplicationLinksOperations { /// - /// Gets a list of replication links on database. + /// Deletes a database replication link. Cannot be done during + /// failover. /// /// /// The name of the resource group that contains the resource. You can @@ -35,7 +36,11 @@ public partial interface IReplicationLinksOperations /// The name of the server. /// /// - /// The name of the database. + /// The name of the database that has the replication link to be + /// dropped. + /// + /// + /// The ID of the replication link to be deleted. /// /// /// The headers that will be added to request. @@ -46,13 +51,10 @@ public partial interface IReplicationLinksOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets a replication link. /// @@ -87,7 +89,8 @@ public partial interface IReplicationLinksOperations /// Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes the replication link. + /// Sets which replica database is primary by failing over from the + /// current primary replica database. /// /// /// The name of the resource group that contains the resource. You can @@ -98,9 +101,11 @@ public partial interface IReplicationLinksOperations /// The name of the server. /// /// - /// The name of the database. + /// The name of the database that has the replication link to be failed + /// over. /// /// + /// The ID of the replication link to be failed over. /// /// /// The headers that will be added to request. @@ -114,9 +119,11 @@ public partial interface IReplicationLinksOperations /// /// Thrown when a required parameter is null /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task FailoverWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Fails over from the current primary server to this server. + /// Sets which replica database is primary by failing over from the + /// current primary replica database. This operation might result in + /// data loss. /// /// /// The name of the resource group that contains the resource. You can @@ -127,10 +134,11 @@ public partial interface IReplicationLinksOperations /// The name of the server. /// /// - /// The name of the database. + /// The name of the database that has the replication link to be failed + /// over. /// /// - /// The name of the replication link. + /// The ID of the replication link to be failed over. /// /// /// The headers that will be added to request. @@ -141,16 +149,12 @@ public partial interface IReplicationLinksOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - Task> FailoverWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task FailoverAllowDataLossWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Fails over from the current primary server to this server allowing - /// data loss. + /// Deletes a database replication link in forced or friendly way. /// /// /// The name of the resource group that contains the resource. You can @@ -161,10 +165,41 @@ public partial interface IReplicationLinksOperations /// The name of the server. /// /// - /// The name of the database. + /// The name of the database that has the replication link to be failed + /// over. /// /// - /// The name of the replication link. + /// The ID of the replication link to be failed over. + /// + /// + /// The required parameters for unlinking replication link. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task UnlinkWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, UnlinkParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a list of replication links on 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 headers that will be added to request. @@ -181,7 +216,7 @@ public partial interface IReplicationLinksOperations /// /// Thrown when a required parameter is null /// - Task> FailoverAllowDataLossWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets a list of replication links. /// @@ -210,7 +245,8 @@ public partial interface IReplicationLinksOperations /// Task>> ListByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Fails over from the current primary server to this server. + /// Sets which replica database is primary by failing over from the + /// current primary replica database. /// /// /// The name of the resource group that contains the resource. You can @@ -221,10 +257,11 @@ public partial interface IReplicationLinksOperations /// The name of the server. /// /// - /// The name of the database. + /// The name of the database that has the replication link to be failed + /// over. /// /// - /// The name of the replication link. + /// The ID of the replication link to be failed over. /// /// /// The headers that will be added to request. @@ -235,15 +272,13 @@ public partial interface IReplicationLinksOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - Task> BeginFailoverWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task BeginFailoverWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Fails over from the current primary server to this server allowing + /// Sets which replica database is primary by failing over from the + /// current primary replica database. This operation might result in /// data loss. /// /// @@ -255,10 +290,11 @@ public partial interface IReplicationLinksOperations /// The name of the server. /// /// - /// The name of the database. + /// The name of the database that has the replication link to be failed + /// over. /// /// - /// The name of the replication link. + /// The ID of the replication link to be failed over. /// /// /// The headers that will be added to request. @@ -269,13 +305,44 @@ public partial interface IReplicationLinksOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response + /// + /// Thrown when a required parameter is null + /// + Task BeginFailoverAllowDataLossWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a database replication link in forced or friendly way. + /// + /// + /// 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 that has the replication link to be failed + /// over. + /// + /// + /// The ID of the replication link to be failed over. + /// + /// + /// The required parameters for unlinking replication link. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code /// /// /// Thrown when a required parameter is null /// - Task> BeginFailoverAllowDataLossWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task BeginUnlinkWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, UnlinkParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets a list of replication links on database. /// diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ISensitivityLabelsOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ISensitivityLabelsOperations.cs index 9eabc21a7070..ad73f817a983 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ISensitivityLabelsOperations.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ISensitivityLabelsOperations.cs @@ -130,7 +130,8 @@ public partial interface ISensitivityLabelsOperations /// Task>> ListRecommendedByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), bool? includeDisabledRecommendations = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the sensitivity label of a given column + /// Enables sensitivity recommendations on a given column + /// (recommendations are enabled by default on all columns) /// /// /// The name of the resource group that contains the resource. You can @@ -152,10 +153,6 @@ public partial interface ISensitivityLabelsOperations /// /// The name of the column. /// - /// - /// The source of the sensitivity label. Possible values include: - /// 'current', 'recommended' - /// /// /// The headers that will be added to request. /// @@ -165,15 +162,12 @@ public partial interface ISensitivityLabelsOperations /// /// 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, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task EnableRecommendationWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates the sensitivity label of a given column + /// Disables sensitivity recommendations on a given column /// /// /// The name of the resource group that contains the resource. You can @@ -195,9 +189,6 @@ public partial interface ISensitivityLabelsOperations /// /// The name of the column. /// - /// - /// The column sensitivity label resource. - /// /// /// The headers that will be added to request. /// @@ -207,15 +198,12 @@ public partial interface ISensitivityLabelsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabel parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DisableRecommendationWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes the sensitivity label of a given column + /// Gets the sensitivity label of a given column /// /// /// The name of the resource group that contains the resource. You can @@ -237,6 +225,10 @@ public partial interface ISensitivityLabelsOperations /// /// The name of the column. /// + /// + /// The source of the sensitivity label. Possible values include: + /// 'current', 'recommended' + /// /// /// The headers that will be added to request. /// @@ -246,12 +238,15 @@ public partial interface ISensitivityLabelsOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Disables sensitivity recommendations on a given column + /// Creates or updates the sensitivity label of a given column /// /// /// The name of the resource group that contains the resource. You can @@ -273,6 +268,9 @@ public partial interface ISensitivityLabelsOperations /// /// The name of the column. /// + /// + /// The column sensitivity label resource. + /// /// /// The headers that will be added to request. /// @@ -282,13 +280,15 @@ public partial interface ISensitivityLabelsOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - Task DisableRecommendationWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabel parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Enables sensitivity recommendations on a given column - /// (recommendations are enabled by default on all columns) + /// Deletes the sensitivity label of a given column /// /// /// The name of the resource group that contains the resource. You can @@ -322,40 +322,7 @@ public partial interface ISensitivityLabelsOperations /// /// Thrown when a required parameter is null /// - Task EnableRecommendationWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets the sensitivity labels of a given 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. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets the sensitivity labels of a given database /// @@ -400,27 +367,5 @@ public partial interface ISensitivityLabelsOperations /// Thrown when a required parameter is null /// Task>> ListRecommendedByDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets the sensitivity labels of a given database - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ISqlManagementClient.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ISqlManagementClient.cs index 62839edc27de..357f5bd4c057 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ISqlManagementClient.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ISqlManagementClient.cs @@ -97,6 +97,11 @@ public partial interface ISqlManagementClient : System.IDisposable /// IElasticPoolsOperations ElasticPools { get; } + /// + /// Gets the IReplicationLinksOperations. + /// + IReplicationLinksOperations ReplicationLinks { get; } + /// /// Gets the IServerCommunicationLinksOperations. /// @@ -337,6 +342,16 @@ public partial interface ISqlManagementClient : System.IDisposable /// IManagedDatabaseSecurityEventsOperations ManagedDatabaseSecurityEvents { get; } + /// + /// Gets the IManagedDatabaseSensitivityLabelsOperations. + /// + IManagedDatabaseSensitivityLabelsOperations ManagedDatabaseSensitivityLabels { get; } + + /// + /// Gets the IManagedDatabaseRecommendedSensitivityLabelsOperations. + /// + IManagedDatabaseRecommendedSensitivityLabelsOperations ManagedDatabaseRecommendedSensitivityLabels { get; } + /// /// Gets the IManagedDatabaseTablesOperations. /// @@ -447,6 +462,16 @@ public partial interface ISqlManagementClient : System.IDisposable /// IRestorePointsOperations RestorePoints { get; } + /// + /// Gets the ISensitivityLabelsOperations. + /// + ISensitivityLabelsOperations SensitivityLabels { get; } + + /// + /// Gets the IRecommendedSensitivityLabelsOperations. + /// + IRecommendedSensitivityLabelsOperations RecommendedSensitivityLabels { get; } + /// /// Gets the IServerAdvisorsOperations. /// @@ -647,36 +672,6 @@ public partial interface ISqlManagementClient : System.IDisposable /// IIPv6FirewallRulesOperations IPv6FirewallRules { get; } - /// - /// Gets the IReplicationLinksOperations. - /// - IReplicationLinksOperations ReplicationLinks { get; } - - /// - /// Gets the IManagedDatabaseSensitivityLabelsOperations. - /// - IManagedDatabaseSensitivityLabelsOperations ManagedDatabaseSensitivityLabels { get; } - - /// - /// Gets the IManagedDatabaseRecommendedSensitivityLabelsOperations. - /// - IManagedDatabaseRecommendedSensitivityLabelsOperations ManagedDatabaseRecommendedSensitivityLabels { get; } - - /// - /// Gets the IManagedServerDnsAliasesOperations. - /// - IManagedServerDnsAliasesOperations ManagedServerDnsAliases { get; } - - /// - /// Gets the ISensitivityLabelsOperations. - /// - ISensitivityLabelsOperations SensitivityLabels { get; } - - /// - /// Gets the IRecommendedSensitivityLabelsOperations. - /// - IRecommendedSensitivityLabelsOperations RecommendedSensitivityLabels { get; } - /// /// Gets the IEndpointCertificatesOperations. /// diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ManagedDatabaseRecommendedSensitivityLabelsOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ManagedDatabaseRecommendedSensitivityLabelsOperations.cs index 6f91a482fea0..83420a3c4ec1 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ManagedDatabaseRecommendedSensitivityLabelsOperations.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ManagedDatabaseRecommendedSensitivityLabelsOperations.cs @@ -106,7 +106,7 @@ internal ManagedDatabaseRecommendedSensitivityLabelsOperations(SqlManagementClie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-11-01-preview"; + string apiVersion = "2020-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ManagedDatabaseSensitivityLabelsOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ManagedDatabaseSensitivityLabelsOperations.cs index d33105436921..2ad06b5467fb 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ManagedDatabaseSensitivityLabelsOperations.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ManagedDatabaseSensitivityLabelsOperations.cs @@ -52,433 +52,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) public SqlManagementClient Client { get; private set; } /// - /// Gets the sensitivity labels of a given 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 managed instance. - /// - /// - /// The name of the database. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// - /// - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task>> ListCurrentByDatabaseWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (managedInstanceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "managedInstanceName"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2021-11-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("managedInstanceName", managedInstanceName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("skipToken", skipToken); - tracingParameters.Add("count", count); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListCurrentByDatabase", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/currentSensitivityLabels").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{managedInstanceName}", System.Uri.EscapeDataString(managedInstanceName)); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (odataQuery != null) - { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) - { - _queryParameters.Add(_odataFilter); - } - } - if (skipToken != null) - { - _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); - } - if (count != null) - { - _queryParameters.Add(string.Format("$count={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(count, Client.SerializationSettings).Trim('"')))); - } - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Update sensitivity labels of a given database using an operations batch. - /// - /// - /// The name of the resource group that contains the resource. You can obtain - /// this value from the Azure Resource Manager API or the portal. - /// - /// - /// The name of the managed instance. - /// - /// - /// The 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 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 managedInstanceName, string databaseName, SensitivityLabelUpdateList parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (managedInstanceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "managedInstanceName"); - } - if (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 = "2021-11-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("managedInstanceName", managedInstanceName); - 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/managedInstances/{managedInstanceName}/databases/{databaseName}/currentSensitivityLabels").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{managedInstanceName}", System.Uri.EscapeDataString(managedInstanceName)); - _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(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Gets the sensitivity labels of a given database + /// Gets the sensitivity label of a given column /// /// /// The name of the resource group that contains the resource. You can obtain @@ -490,13 +64,18 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) /// /// The name of the database. /// - /// - /// OData parameters to apply to the operation. + /// + /// The name of the schema. /// - /// + /// + /// The name of the table. /// - /// - /// Specifies whether to include disabled recommendations or not. + /// + /// The name of the column. + /// + /// + /// The source of the sensitivity label. Possible values include: 'current', + /// 'recommended' /// /// /// Headers that will be added to request. @@ -519,7 +98,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListRecommendedByDatabaseWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), bool? includeDisabledRecommendations = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -533,11 +112,23 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); } + if (schemaName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "schemaName"); + } + if (tableName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); + } + if (columnName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "columnName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-11-01-preview"; + string apiVersion = "2020-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -545,40 +136,29 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("managedInstanceName", managedInstanceName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("skipToken", skipToken); - tracingParameters.Add("includeDisabledRecommendations", includeDisabledRecommendations); + tracingParameters.Add("schemaName", schemaName); + tracingParameters.Add("tableName", tableName); + tracingParameters.Add("columnName", columnName); + tracingParameters.Add("sensitivityLabelSource", sensitivityLabelSource); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListRecommendedByDatabase", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/recommendedSensitivityLabels").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{managedInstanceName}", System.Uri.EscapeDataString(managedInstanceName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _url = _url.Replace("{schemaName}", System.Uri.EscapeDataString(schemaName)); + _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); + _url = _url.Replace("{columnName}", System.Uri.EscapeDataString(columnName)); + _url = _url.Replace("{sensitivityLabelSource}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(sensitivityLabelSource, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (odataQuery != null) - { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) - { - _queryParameters.Add(_odataFilter); - } - } - if (skipToken != null) - { - _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); - } - if (includeDisabledRecommendations != null) - { - _queryParameters.Add(string.Format("includeDisabledRecommendations={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(includeDisabledRecommendations, Client.SerializationSettings).Trim('"')))); - } if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -676,7 +256,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -689,7 +269,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -709,7 +289,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) } /// - /// Gets the sensitivity label of a given column + /// Creates or updates the sensitivity label of a given column /// /// /// The name of the resource group that contains the resource. You can obtain @@ -730,9 +310,8 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) /// /// The name of the column. /// - /// - /// The source of the sensitivity label. Possible values include: 'current', - /// 'recommended' + /// + /// The column sensitivity label resource. /// /// /// Headers that will be added to request. @@ -755,7 +334,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabel parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -781,11 +360,16 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "columnName"); } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-11-01-preview"; + string sensitivityLabelSource = "current"; + string apiVersion = "2020-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -800,9 +384,10 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) tracingParameters.Add("tableName", tableName); tracingParameters.Add("columnName", columnName); tracingParameters.Add("sensitivityLabelSource", sensitivityLabelSource); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -813,7 +398,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) _url = _url.Replace("{schemaName}", System.Uri.EscapeDataString(schemaName)); _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); _url = _url.Replace("{columnName}", System.Uri.EscapeDataString(columnName)); - _url = _url.Replace("{sensitivityLabelSource}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(sensitivityLabelSource, Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{sensitivityLabelSource}", System.Uri.EscapeDataString(sensitivityLabelSource)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -827,7 +412,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -858,6 +443,12 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) // Serialize Request string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -878,7 +469,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -938,6 +529,24 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -946,7 +555,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) } /// - /// Creates or updates the sensitivity label of a given column + /// Deletes the sensitivity label of a given column /// /// /// The name of the resource group that contains the resource. You can obtain @@ -967,9 +576,6 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) /// /// The name of the column. /// - /// - /// The column sensitivity label resource. - /// /// /// Headers that will be added to request. /// @@ -979,9 +585,6 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -991,7 +594,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabel parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1017,16 +620,12 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "columnName"); } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } string sensitivityLabelSource = "current"; - string apiVersion = "2021-11-01-preview"; + string apiVersion = "2020-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1041,10 +640,9 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) tracingParameters.Add("tableName", tableName); tracingParameters.Add("columnName", columnName); tracingParameters.Add("sensitivityLabelSource", sensitivityLabelSource); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -1069,7 +667,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1100,12 +698,6 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) // Serialize Request string _requestContent = null; - if(parameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -1126,7 +718,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1154,55 +746,19 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) + if (_httpResponse != null) { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + _httpResponse.Dispose(); } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { @@ -1212,7 +768,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) } /// - /// Deletes the sensitivity label of a given column + /// Disables sensitivity recommendations on a given column /// /// /// The name of the resource group that contains the resource. You can obtain @@ -1251,7 +807,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DisableRecommendationWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1281,8 +837,8 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string sensitivityLabelSource = "current"; - string apiVersion = "2021-11-01-preview"; + string sensitivityLabelSource = "recommended"; + string apiVersion = "2020-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1299,11 +855,11 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) tracingParameters.Add("sensitivityLabelSource", sensitivityLabelSource); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DisableRecommendation", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/disable").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{managedInstanceName}", System.Uri.EscapeDataString(managedInstanceName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); @@ -1324,7 +880,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1425,7 +981,8 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) } /// - /// Disables sensitivity recommendations on a given column + /// Enables sensitivity recommendations on a given column (recommendations are + /// enabled by default on all columns) /// /// /// The name of the resource group that contains the resource. You can obtain @@ -1464,7 +1021,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DisableRecommendationWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task EnableRecommendationWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1495,7 +1052,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } string sensitivityLabelSource = "recommended"; - string apiVersion = "2021-11-01-preview"; + string apiVersion = "2020-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1512,11 +1069,11 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) tracingParameters.Add("sensitivityLabelSource", sensitivityLabelSource); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DisableRecommendation", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "EnableRecommendation", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/disable").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/enable").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{managedInstanceName}", System.Uri.EscapeDataString(managedInstanceName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); @@ -1638,8 +1195,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) } /// - /// Enables sensitivity recommendations on a given column (recommendations are - /// enabled by default on all columns) + /// Gets the sensitivity labels of a given database /// /// /// The name of the resource group that contains the resource. You can obtain @@ -1651,14 +1207,12 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) /// /// The name of the database. /// - /// - /// The name of the schema. + /// + /// OData parameters to apply to the operation. /// - /// - /// The name of the table. + /// /// - /// - /// The name of the column. + /// /// /// /// Headers that will be added to request. @@ -1669,6 +1223,9 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -1678,7 +1235,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task EnableRecommendationWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListCurrentByDatabaseWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1692,24 +1249,11 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); } - if (schemaName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "schemaName"); - } - if (tableName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); - } - if (columnName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "columnName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string sensitivityLabelSource = "recommended"; - string apiVersion = "2021-11-01-preview"; + string apiVersion = "2020-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1717,29 +1261,40 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("odataQuery", odataQuery); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("managedInstanceName", managedInstanceName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("schemaName", schemaName); - tracingParameters.Add("tableName", tableName); - tracingParameters.Add("columnName", columnName); - tracingParameters.Add("sensitivityLabelSource", sensitivityLabelSource); + tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("count", count); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "EnableRecommendation", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListCurrentByDatabase", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/enable").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/currentSensitivityLabels").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{managedInstanceName}", System.Uri.EscapeDataString(managedInstanceName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{schemaName}", System.Uri.EscapeDataString(schemaName)); - _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); - _url = _url.Replace("{columnName}", System.Uri.EscapeDataString(columnName)); - _url = _url.Replace("{sensitivityLabelSource}", System.Uri.EscapeDataString(sensitivityLabelSource)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (odataQuery != null) + { + var _odataFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_odataFilter)) + { + _queryParameters.Add(_odataFilter); + } + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + if (count != null) + { + _queryParameters.Add(string.Format("$count={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(count, Client.SerializationSettings).Trim('"')))); + } if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1751,7 +1306,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1837,13 +1392,31 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _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); @@ -1852,7 +1425,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) } /// - /// Gets the sensitivity labels of a given database + /// Update sensitivity labels of a given database using an operations batch. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -1864,8 +1437,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) /// /// The name of the database. /// - /// - /// OData parameters to apply to the operation. + /// /// /// /// Headers that will be added to request. @@ -1876,9 +1448,6 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -1888,7 +1457,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task UpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, SensitivityLabelUpdateList parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1902,11 +1471,15 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) { 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 = "2021-11-01-preview"; + string apiVersion = "2020-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1914,30 +1487,22 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("managedInstanceName", managedInstanceName); tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByDatabase", tracingParameters); + 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/managedInstances/{managedInstanceName}/databases/{databaseName}/sensitivityLabels").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/currentSensitivityLabels").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{managedInstanceName}", System.Uri.EscapeDataString(managedInstanceName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (odataQuery != null) - { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) - { - _queryParameters.Add(_odataFilter); - } - } if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1949,7 +1514,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1980,6 +1545,12 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) // Serialize Request string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -2035,31 +1606,13 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _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); @@ -2070,8 +1623,23 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) /// /// Gets the sensitivity labels of a given database /// - /// - /// The NextLink from the previous successful call to List operation. + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// The name of the database. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// + /// + /// Specifies whether to include disabled recommendations or not. /// /// /// Headers that will be added to request. @@ -2094,12 +1662,25 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListCurrentByDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListRecommendedByDatabaseWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), bool? includeDisabledRecommendations = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (nextPageLink == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (managedInstanceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "managedInstanceName"); + } + if (databaseName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2020-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2107,14 +1688,44 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("odataQuery", odataQuery); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("managedInstanceName", managedInstanceName); + tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("includeDisabledRecommendations", includeDisabledRecommendations); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListCurrentByDatabaseNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListRecommendedByDatabase", tracingParameters); } // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/recommendedSensitivityLabels").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{managedInstanceName}", System.Uri.EscapeDataString(managedInstanceName)); + _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (odataQuery != null) + { + var _odataFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_odataFilter)) + { + _queryParameters.Add(_odataFilter); + } + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + if (includeDisabledRecommendations != null) + { + _queryParameters.Add(string.Format("includeDisabledRecommendations={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(includeDisabledRecommendations, Client.SerializationSettings).Trim('"')))); + } + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -2267,7 +1878,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListRecommendedByDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListCurrentByDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -2282,7 +1893,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListRecommendedByDatabaseNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListCurrentByDatabaseNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -2440,7 +2051,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListRecommendedByDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -2455,7 +2066,7 @@ internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByDatabaseNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListRecommendedByDatabaseNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ManagedDatabaseSensitivityLabelsOperationsExtensions.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ManagedDatabaseSensitivityLabelsOperationsExtensions.cs index 2eb5b2e95234..c69fc7581d30 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ManagedDatabaseSensitivityLabelsOperationsExtensions.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ManagedDatabaseSensitivityLabelsOperationsExtensions.cs @@ -23,7 +23,7 @@ namespace Microsoft.Azure.Management.Sql public static partial class ManagedDatabaseSensitivityLabelsOperationsExtensions { /// - /// Gets the sensitivity labels of a given database + /// Gets the sensitivity label of a given column /// /// /// The operations group for this extension method. @@ -38,20 +38,26 @@ public static partial class ManagedDatabaseSensitivityLabelsOperationsExtensions /// /// The name of the database. /// - /// - /// OData parameters to apply to the operation. + /// + /// The name of the schema. /// - /// + /// + /// The name of the table. /// - /// + /// + /// The name of the column. /// - public static IPage ListCurrentByDatabase(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), bool? count = default(bool?)) + /// + /// The source of the sensitivity label. Possible values include: 'current', + /// 'recommended' + /// + public static SensitivityLabel Get(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource) { - return operations.ListCurrentByDatabaseAsync(resourceGroupName, managedInstanceName, databaseName, odataQuery, skipToken, count).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, sensitivityLabelSource).GetAwaiter().GetResult(); } /// - /// Gets the sensitivity labels of a given database + /// Gets the sensitivity label of a given column /// /// /// The operations group for this extension method. @@ -66,26 +72,32 @@ public static partial class ManagedDatabaseSensitivityLabelsOperationsExtensions /// /// The name of the database. /// - /// - /// OData parameters to apply to the operation. + /// + /// The name of the schema. /// - /// + /// + /// The name of the table. /// - /// + /// + /// The name of the column. + /// + /// + /// The source of the sensitivity label. Possible values include: 'current', + /// 'recommended' /// /// /// The cancellation token. /// - public static async Task> ListCurrentByDatabaseAsync(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), bool? count = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListCurrentByDatabaseWithHttpMessagesAsync(resourceGroupName, managedInstanceName, databaseName, odataQuery, skipToken, count, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, sensitivityLabelSource, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Update sensitivity labels of a given database using an operations batch. + /// Creates or updates the sensitivity label of a given column /// /// /// The operations group for this extension method. @@ -100,41 +112,25 @@ public static partial class ManagedDatabaseSensitivityLabelsOperationsExtensions /// /// The name of the database. /// - /// - /// - public static void Update(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, SensitivityLabelUpdateList parameters) - { - operations.UpdateAsync(resourceGroupName, managedInstanceName, databaseName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Update sensitivity labels of a given database using an operations batch. - /// - /// - /// 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 schema. /// - /// - /// The name of the managed instance. + /// + /// The name of the table. /// - /// - /// The name of the database. + /// + /// The name of the column. /// /// + /// The column sensitivity label resource. /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, SensitivityLabelUpdateList parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static SensitivityLabel CreateOrUpdate(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabel parameters) { - (await operations.UpdateWithHttpMessagesAsync(resourceGroupName, managedInstanceName, databaseName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return operations.CreateOrUpdateAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, parameters).GetAwaiter().GetResult(); } /// - /// Gets the sensitivity labels of a given database + /// Creates or updates the sensitivity label of a given column /// /// /// The operations group for this extension method. @@ -149,56 +145,31 @@ public static void Update(this IManagedDatabaseSensitivityLabelsOperations opera /// /// The name of the database. /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// - /// - /// Specifies whether to include disabled recommendations or not. - /// - public static IPage ListRecommendedByDatabase(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), bool? includeDisabledRecommendations = default(bool?)) - { - return operations.ListRecommendedByDatabaseAsync(resourceGroupName, managedInstanceName, databaseName, odataQuery, skipToken, includeDisabledRecommendations).GetAwaiter().GetResult(); - } - - /// - /// Gets the sensitivity labels of a given 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 managed instance. - /// - /// - /// The name of the database. + /// + /// The name of the schema. /// - /// - /// OData parameters to apply to the operation. + /// + /// The name of the table. /// - /// + /// + /// The name of the column. /// - /// - /// Specifies whether to include disabled recommendations or not. + /// + /// The column sensitivity label resource. /// /// /// The cancellation token. /// - public static async Task> ListRecommendedByDatabaseAsync(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), bool? includeDisabledRecommendations = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabel parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListRecommendedByDatabaseWithHttpMessagesAsync(resourceGroupName, managedInstanceName, databaseName, odataQuery, skipToken, includeDisabledRecommendations, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets the sensitivity label of a given column + /// Deletes the sensitivity label of a given column /// /// /// The operations group for this extension method. @@ -222,17 +193,13 @@ public static void Update(this IManagedDatabaseSensitivityLabelsOperations opera /// /// The name of the column. /// - /// - /// The source of the sensitivity label. Possible values include: 'current', - /// 'recommended' - /// - public static SensitivityLabel Get(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource) + public static void Delete(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName) { - return operations.GetAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, sensitivityLabelSource).GetAwaiter().GetResult(); + operations.DeleteAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName).GetAwaiter().GetResult(); } /// - /// Gets the sensitivity label of a given column + /// Deletes the sensitivity label of a given column /// /// /// The operations group for this extension method. @@ -256,23 +223,16 @@ public static SensitivityLabel Get(this IManagedDatabaseSensitivityLabelsOperati /// /// The name of the column. /// - /// - /// The source of the sensitivity label. Possible values include: 'current', - /// 'recommended' - /// /// /// The cancellation token. /// - public static async Task GetAsync(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteAsync(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, sensitivityLabelSource, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Creates or updates the sensitivity label of a given column + /// Disables sensitivity recommendations on a given column /// /// /// The operations group for this extension method. @@ -296,16 +256,13 @@ public static SensitivityLabel Get(this IManagedDatabaseSensitivityLabelsOperati /// /// The name of the column. /// - /// - /// The column sensitivity label resource. - /// - public static SensitivityLabel CreateOrUpdate(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabel parameters) + public static void DisableRecommendation(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName) { - return operations.CreateOrUpdateAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, parameters).GetAwaiter().GetResult(); + operations.DisableRecommendationAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName).GetAwaiter().GetResult(); } /// - /// Creates or updates the sensitivity label of a given column + /// Disables sensitivity recommendations on a given column /// /// /// The operations group for this extension method. @@ -329,22 +286,17 @@ public static SensitivityLabel CreateOrUpdate(this IManagedDatabaseSensitivityLa /// /// The name of the column. /// - /// - /// The column sensitivity label resource. - /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabel parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DisableRecommendationAsync(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + (await operations.DisableRecommendationWithHttpMessagesAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Deletes the sensitivity label of a given column + /// Enables sensitivity recommendations on a given column (recommendations are + /// enabled by default on all columns) /// /// /// The operations group for this extension method. @@ -368,13 +320,14 @@ public static SensitivityLabel CreateOrUpdate(this IManagedDatabaseSensitivityLa /// /// The name of the column. /// - public static void Delete(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName) + public static void EnableRecommendation(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName) { - operations.DeleteAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName).GetAwaiter().GetResult(); + operations.EnableRecommendationAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName).GetAwaiter().GetResult(); } /// - /// Deletes the sensitivity label of a given column + /// Enables sensitivity recommendations on a given column (recommendations are + /// enabled by default on all columns) /// /// /// The operations group for this extension method. @@ -401,13 +354,13 @@ public static void Delete(this IManagedDatabaseSensitivityLabelsOperations opera /// /// The cancellation token. /// - public static async Task DeleteAsync(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task EnableRecommendationAsync(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.EnableRecommendationWithHttpMessagesAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Disables sensitivity recommendations on a given column + /// Gets the sensitivity labels of a given database /// /// /// The operations group for this extension method. @@ -422,22 +375,20 @@ public static void Delete(this IManagedDatabaseSensitivityLabelsOperations opera /// /// The name of the database. /// - /// - /// The name of the schema. + /// + /// OData parameters to apply to the operation. /// - /// - /// The name of the table. + /// /// - /// - /// The name of the column. + /// /// - public static void DisableRecommendation(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName) + public static IPage ListCurrentByDatabase(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), bool? count = default(bool?)) { - operations.DisableRecommendationAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName).GetAwaiter().GetResult(); + return operations.ListCurrentByDatabaseAsync(resourceGroupName, managedInstanceName, databaseName, odataQuery, skipToken, count).GetAwaiter().GetResult(); } /// - /// Disables sensitivity recommendations on a given column + /// Gets the sensitivity labels of a given database /// /// /// The operations group for this extension method. @@ -452,26 +403,26 @@ public static void DisableRecommendation(this IManagedDatabaseSensitivityLabelsO /// /// The name of the database. /// - /// - /// The name of the schema. + /// + /// OData parameters to apply to the operation. /// - /// - /// The name of the table. + /// /// - /// - /// The name of the column. + /// /// /// /// The cancellation token. /// - public static async Task DisableRecommendationAsync(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListCurrentByDatabaseAsync(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), bool? count = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DisableRecommendationWithHttpMessagesAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.ListCurrentByDatabaseWithHttpMessagesAsync(resourceGroupName, managedInstanceName, databaseName, odataQuery, skipToken, count, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Enables sensitivity recommendations on a given column (recommendations are - /// enabled by default on all columns) + /// Update sensitivity labels of a given database using an operations batch. /// /// /// The operations group for this extension method. @@ -486,23 +437,15 @@ public static void DisableRecommendation(this IManagedDatabaseSensitivityLabelsO /// /// The name of the database. /// - /// - /// The name of the schema. - /// - /// - /// The name of the table. - /// - /// - /// The name of the column. + /// /// - public static void EnableRecommendation(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName) + public static void Update(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, SensitivityLabelUpdateList parameters) { - operations.EnableRecommendationAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName).GetAwaiter().GetResult(); + operations.UpdateAsync(resourceGroupName, managedInstanceName, databaseName, parameters).GetAwaiter().GetResult(); } /// - /// Enables sensitivity recommendations on a given column (recommendations are - /// enabled by default on all columns) + /// Update sensitivity labels of a given database using an operations batch. /// /// /// The operations group for this extension method. @@ -517,21 +460,14 @@ public static void EnableRecommendation(this IManagedDatabaseSensitivityLabelsOp /// /// The name of the database. /// - /// - /// The name of the schema. - /// - /// - /// The name of the table. - /// - /// - /// The name of the column. + /// /// /// /// The cancellation token. /// - public static async Task EnableRecommendationAsync(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdateAsync(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, SensitivityLabelUpdateList parameters, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.EnableRecommendationWithHttpMessagesAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.UpdateWithHttpMessagesAsync(resourceGroupName, managedInstanceName, databaseName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -553,9 +489,14 @@ public static void EnableRecommendation(this IManagedDatabaseSensitivityLabelsOp /// /// OData parameters to apply to the operation. /// - public static IPage ListByDatabase(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery)) + /// + /// + /// + /// Specifies whether to include disabled recommendations or not. + /// + public static IPage ListRecommendedByDatabase(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), bool? includeDisabledRecommendations = default(bool?)) { - return operations.ListByDatabaseAsync(resourceGroupName, managedInstanceName, databaseName, odataQuery).GetAwaiter().GetResult(); + return operations.ListRecommendedByDatabaseAsync(resourceGroupName, managedInstanceName, databaseName, odataQuery, skipToken, includeDisabledRecommendations).GetAwaiter().GetResult(); } /// @@ -577,12 +518,17 @@ public static void EnableRecommendation(this IManagedDatabaseSensitivityLabelsOp /// /// OData parameters to apply to the operation. /// + /// + /// + /// + /// Specifies whether to include disabled recommendations or not. + /// /// /// The cancellation token. /// - public static async Task> ListByDatabaseAsync(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListRecommendedByDatabaseAsync(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), bool? includeDisabledRecommendations = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByDatabaseWithHttpMessagesAsync(resourceGroupName, managedInstanceName, databaseName, odataQuery, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListRecommendedByDatabaseWithHttpMessagesAsync(resourceGroupName, managedInstanceName, databaseName, odataQuery, skipToken, includeDisabledRecommendations, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -656,39 +602,5 @@ public static IPage ListRecommendedByDatabaseNext(this IManage } } - /// - /// Gets the sensitivity labels of a given database - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByDatabaseNext(this IManagedDatabaseSensitivityLabelsOperations operations, string nextPageLink) - { - return operations.ListByDatabaseNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets the sensitivity labels of a given database - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByDatabaseNextAsync(this IManagedDatabaseSensitivityLabelsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByDatabaseNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - } } diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ManagedServerDnsAliasesOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ManagedServerDnsAliasesOperations.cs deleted file mode 100644 index 48534021d2f5..000000000000 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ManagedServerDnsAliasesOperations.cs +++ /dev/null @@ -1,1340 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.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; - - /// - /// ManagedServerDnsAliasesOperations operations. - /// - internal partial class ManagedServerDnsAliasesOperations : IServiceOperations, IManagedServerDnsAliasesOperations - { - /// - /// Initializes a new instance of the ManagedServerDnsAliasesOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal ManagedServerDnsAliasesOperations(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 list of managed server DNS aliases for a managed 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 managed instance. - /// - /// - /// 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>> ListByManagedInstanceWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (managedInstanceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "managedInstanceName"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2021-11-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("managedInstanceName", managedInstanceName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByManagedInstance", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{managedInstanceName}", System.Uri.EscapeDataString(managedInstanceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Gets a server DNS alias. - /// - /// - /// The name of the resource group that contains the resource. You can obtain - /// this value from the Azure Resource Manager API or the portal. - /// - /// - /// The name of the managed instance. - /// - /// - /// - /// - /// Headers that will be added to request. - /// - /// - /// 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 managedInstanceName, string dnsAliasName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (managedInstanceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "managedInstanceName"); - } - if (dnsAliasName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "dnsAliasName"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2021-11-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("managedInstanceName", managedInstanceName); - tracingParameters.Add("dnsAliasName", dnsAliasName); - 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/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{managedInstanceName}", System.Uri.EscapeDataString(managedInstanceName)); - _url = _url.Replace("{dnsAliasName}", System.Uri.EscapeDataString(dnsAliasName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Creates a managed server DNS alias. - /// - /// - /// The name of the resource group that contains the resource. You can obtain - /// this value from the Azure Resource Manager API or the portal. - /// - /// - /// The name of the managed instance. - /// - /// - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string dnsAliasName, ManagedServerDnsAliasCreation parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, managedInstanceName, dnsAliasName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes the managed server DNS alias with the given name. - /// - /// - /// The name of the resource group that contains the resource. You can obtain - /// this value from the Azure Resource Manager API or the portal. - /// - /// - /// The name of the managed instance. - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string dnsAliasName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, managedInstanceName, dnsAliasName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Acquires managed server DNS alias from another managed 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 managed instance. - /// - /// - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> AcquireWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string dnsAliasName, ManagedServerDnsAliasAcquisition parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginAcquireWithHttpMessagesAsync(resourceGroupName, managedInstanceName, dnsAliasName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Creates a managed server DNS alias. - /// - /// - /// The name of the resource group that contains the resource. You can obtain - /// this value from the Azure Resource Manager API or the portal. - /// - /// - /// The name of the managed instance. - /// - /// - /// - /// - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string dnsAliasName, ManagedServerDnsAliasCreation parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (managedInstanceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "managedInstanceName"); - } - if (dnsAliasName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "dnsAliasName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2021-11-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("managedInstanceName", managedInstanceName); - tracingParameters.Add("dnsAliasName", dnsAliasName); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{managedInstanceName}", System.Uri.EscapeDataString(managedInstanceName)); - _url = _url.Replace("{dnsAliasName}", System.Uri.EscapeDataString(dnsAliasName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(parameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Deletes the managed server DNS alias with the given name. - /// - /// - /// The name of the resource group that contains the resource. You can obtain - /// this value from the Azure Resource Manager API or the portal. - /// - /// - /// The name of the managed instance. - /// - /// - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string dnsAliasName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (managedInstanceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "managedInstanceName"); - } - if (dnsAliasName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "dnsAliasName"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2021-11-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("managedInstanceName", managedInstanceName); - tracingParameters.Add("dnsAliasName", dnsAliasName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{managedInstanceName}", System.Uri.EscapeDataString(managedInstanceName)); - _url = _url.Replace("{dnsAliasName}", System.Uri.EscapeDataString(dnsAliasName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Acquires managed server DNS alias from another managed 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 managed instance. - /// - /// - /// - /// - /// - /// - /// 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> BeginAcquireWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string dnsAliasName, ManagedServerDnsAliasAcquisition parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (managedInstanceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "managedInstanceName"); - } - if (dnsAliasName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "dnsAliasName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2021-11-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("managedInstanceName", managedInstanceName); - tracingParameters.Add("dnsAliasName", dnsAliasName); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginAcquire", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}/acquire").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{managedInstanceName}", System.Uri.EscapeDataString(managedInstanceName)); - _url = _url.Replace("{dnsAliasName}", System.Uri.EscapeDataString(dnsAliasName)); - _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("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(parameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Gets a list of managed server DNS aliases for a managed server. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task>> ListByManagedInstanceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (nextPageLink == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByManagedInstanceNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - } -} diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ManagedServerDnsAliasesOperationsExtensions.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ManagedServerDnsAliasesOperationsExtensions.cs deleted file mode 100644 index 196f59d94251..000000000000 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ManagedServerDnsAliasesOperationsExtensions.cs +++ /dev/null @@ -1,433 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Sql -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for ManagedServerDnsAliasesOperations. - /// - public static partial class ManagedServerDnsAliasesOperationsExtensions - { - /// - /// Gets a list of managed server DNS aliases for a managed 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 managed instance. - /// - public static IPage ListByManagedInstance(this IManagedServerDnsAliasesOperations operations, string resourceGroupName, string managedInstanceName) - { - return operations.ListByManagedInstanceAsync(resourceGroupName, managedInstanceName).GetAwaiter().GetResult(); - } - - /// - /// Gets a list of managed server DNS aliases for a managed 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 managed instance. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByManagedInstanceAsync(this IManagedServerDnsAliasesOperations operations, string resourceGroupName, string managedInstanceName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByManagedInstanceWithHttpMessagesAsync(resourceGroupName, managedInstanceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a server DNS alias. - /// - /// - /// 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 managed instance. - /// - /// - /// - public static ManagedServerDnsAlias Get(this IManagedServerDnsAliasesOperations operations, string resourceGroupName, string managedInstanceName, string dnsAliasName) - { - return operations.GetAsync(resourceGroupName, managedInstanceName, dnsAliasName).GetAwaiter().GetResult(); - } - - /// - /// Gets a server DNS alias. - /// - /// - /// 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 managed instance. - /// - /// - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IManagedServerDnsAliasesOperations operations, string resourceGroupName, string managedInstanceName, string dnsAliasName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, managedInstanceName, dnsAliasName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates a managed server DNS alias. - /// - /// - /// 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 managed instance. - /// - /// - /// - /// - /// - public static ManagedServerDnsAlias CreateOrUpdate(this IManagedServerDnsAliasesOperations operations, string resourceGroupName, string managedInstanceName, string dnsAliasName, ManagedServerDnsAliasCreation parameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, managedInstanceName, dnsAliasName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates a managed server DNS alias. - /// - /// - /// 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 managed instance. - /// - /// - /// - /// - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IManagedServerDnsAliasesOperations operations, string resourceGroupName, string managedInstanceName, string dnsAliasName, ManagedServerDnsAliasCreation parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, managedInstanceName, dnsAliasName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes the managed server DNS alias with the given name. - /// - /// - /// 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 managed instance. - /// - /// - /// - public static void Delete(this IManagedServerDnsAliasesOperations operations, string resourceGroupName, string managedInstanceName, string dnsAliasName) - { - operations.DeleteAsync(resourceGroupName, managedInstanceName, dnsAliasName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the managed server DNS alias with the given name. - /// - /// - /// 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 managed instance. - /// - /// - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IManagedServerDnsAliasesOperations operations, string resourceGroupName, string managedInstanceName, string dnsAliasName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, managedInstanceName, dnsAliasName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Acquires managed server DNS alias from another managed 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 managed instance. - /// - /// - /// - /// - /// - public static ManagedServerDnsAlias Acquire(this IManagedServerDnsAliasesOperations operations, string resourceGroupName, string managedInstanceName, string dnsAliasName, ManagedServerDnsAliasAcquisition parameters) - { - return operations.AcquireAsync(resourceGroupName, managedInstanceName, dnsAliasName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Acquires managed server DNS alias from another managed 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 managed instance. - /// - /// - /// - /// - /// - /// - /// The cancellation token. - /// - public static async Task AcquireAsync(this IManagedServerDnsAliasesOperations operations, string resourceGroupName, string managedInstanceName, string dnsAliasName, ManagedServerDnsAliasAcquisition parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.AcquireWithHttpMessagesAsync(resourceGroupName, managedInstanceName, dnsAliasName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates a managed server DNS alias. - /// - /// - /// 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 managed instance. - /// - /// - /// - /// - /// - public static ManagedServerDnsAlias BeginCreateOrUpdate(this IManagedServerDnsAliasesOperations operations, string resourceGroupName, string managedInstanceName, string dnsAliasName, ManagedServerDnsAliasCreation parameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, managedInstanceName, dnsAliasName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates a managed server DNS alias. - /// - /// - /// 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 managed instance. - /// - /// - /// - /// - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IManagedServerDnsAliasesOperations operations, string resourceGroupName, string managedInstanceName, string dnsAliasName, ManagedServerDnsAliasCreation parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, managedInstanceName, dnsAliasName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes the managed server DNS alias with the given name. - /// - /// - /// 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 managed instance. - /// - /// - /// - public static void BeginDelete(this IManagedServerDnsAliasesOperations operations, string resourceGroupName, string managedInstanceName, string dnsAliasName) - { - operations.BeginDeleteAsync(resourceGroupName, managedInstanceName, dnsAliasName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the managed server DNS alias with the given name. - /// - /// - /// 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 managed instance. - /// - /// - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IManagedServerDnsAliasesOperations operations, string resourceGroupName, string managedInstanceName, string dnsAliasName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, managedInstanceName, dnsAliasName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Acquires managed server DNS alias from another managed 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 managed instance. - /// - /// - /// - /// - /// - public static ManagedServerDnsAlias BeginAcquire(this IManagedServerDnsAliasesOperations operations, string resourceGroupName, string managedInstanceName, string dnsAliasName, ManagedServerDnsAliasAcquisition parameters) - { - return operations.BeginAcquireAsync(resourceGroupName, managedInstanceName, dnsAliasName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Acquires managed server DNS alias from another managed 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 managed instance. - /// - /// - /// - /// - /// - /// - /// The cancellation token. - /// - public static async Task BeginAcquireAsync(this IManagedServerDnsAliasesOperations operations, string resourceGroupName, string managedInstanceName, string dnsAliasName, ManagedServerDnsAliasAcquisition parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginAcquireWithHttpMessagesAsync(resourceGroupName, managedInstanceName, dnsAliasName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a list of managed server DNS aliases for a managed server. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByManagedInstanceNext(this IManagedServerDnsAliasesOperations operations, string nextPageLink) - { - return operations.ListByManagedInstanceNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets a list of managed server DNS aliases for a managed server. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByManagedInstanceNextAsync(this IManagedServerDnsAliasesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByManagedInstanceNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/Database.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/Database.cs index f282d44290f1..c5c3c64c7a2f 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/Database.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/Database.cs @@ -206,6 +206,9 @@ public Database() /// for this database. /// The Client id used for cross tenant /// per database CMK scenario + /// The Primary + /// Delegated Identity Client id used for per database CMK - for + /// internal use only /// The resource identifier of the /// source associated with the create operation of this database. /// @@ -233,7 +236,7 @@ public Database() /// “x-ms-authorization-auxiliary” header see /// https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/authenticate-multi-tenant /// - public Database(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), Sku sku = default(Sku), string kind = default(string), string managedBy = default(string), DatabaseIdentity identity = default(DatabaseIdentity), string createMode = default(string), string collation = default(string), long? maxSizeBytes = default(long?), string sampleName = default(string), string elasticPoolId = default(string), string sourceDatabaseId = default(string), string status = default(string), System.Guid? databaseId = default(System.Guid?), System.DateTime? creationDate = default(System.DateTime?), string currentServiceObjectiveName = default(string), string requestedServiceObjectiveName = default(string), string defaultSecondaryLocation = default(string), string failoverGroupId = default(string), System.DateTime? restorePointInTime = default(System.DateTime?), System.DateTime? sourceDatabaseDeletionDate = default(System.DateTime?), string recoveryServicesRecoveryPointId = default(string), string longTermRetentionBackupResourceId = default(string), string recoverableDatabaseId = default(string), string restorableDroppedDatabaseId = default(string), string catalogCollation = default(string), bool? zoneRedundant = default(bool?), string licenseType = default(string), long? maxLogSizeBytes = default(long?), System.DateTime? earliestRestoreDate = default(System.DateTime?), string readScale = default(string), int? highAvailabilityReplicaCount = default(int?), string secondaryType = default(string), Sku currentSku = default(Sku), int? autoPauseDelay = default(int?), string currentBackupStorageRedundancy = default(string), string requestedBackupStorageRedundancy = default(string), double? minCapacity = default(double?), System.DateTime? pausedDate = default(System.DateTime?), System.DateTime? resumedDate = default(System.DateTime?), string maintenanceConfigurationId = default(string), bool? isLedgerOn = default(bool?), bool? isInfraEncryptionEnabled = default(bool?), System.Guid? federatedClientId = default(System.Guid?), string sourceResourceId = default(string)) + public Database(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), Sku sku = default(Sku), string kind = default(string), string managedBy = default(string), DatabaseIdentity identity = default(DatabaseIdentity), string createMode = default(string), string collation = default(string), long? maxSizeBytes = default(long?), string sampleName = default(string), string elasticPoolId = default(string), string sourceDatabaseId = default(string), string status = default(string), System.Guid? databaseId = default(System.Guid?), System.DateTime? creationDate = default(System.DateTime?), string currentServiceObjectiveName = default(string), string requestedServiceObjectiveName = default(string), string defaultSecondaryLocation = default(string), string failoverGroupId = default(string), System.DateTime? restorePointInTime = default(System.DateTime?), System.DateTime? sourceDatabaseDeletionDate = default(System.DateTime?), string recoveryServicesRecoveryPointId = default(string), string longTermRetentionBackupResourceId = default(string), string recoverableDatabaseId = default(string), string restorableDroppedDatabaseId = default(string), string catalogCollation = default(string), bool? zoneRedundant = default(bool?), string licenseType = default(string), long? maxLogSizeBytes = default(long?), System.DateTime? earliestRestoreDate = default(System.DateTime?), string readScale = default(string), int? highAvailabilityReplicaCount = default(int?), string secondaryType = default(string), Sku currentSku = default(Sku), int? autoPauseDelay = default(int?), string currentBackupStorageRedundancy = default(string), string requestedBackupStorageRedundancy = default(string), double? minCapacity = default(double?), System.DateTime? pausedDate = default(System.DateTime?), System.DateTime? resumedDate = default(System.DateTime?), string maintenanceConfigurationId = default(string), bool? isLedgerOn = default(bool?), bool? isInfraEncryptionEnabled = default(bool?), System.Guid? federatedClientId = default(System.Guid?), System.Guid? primaryDelegatedIdentityClientId = default(System.Guid?), string sourceResourceId = default(string)) : base(location, id, name, type, tags) { Sku = sku; @@ -278,6 +281,7 @@ public Database() IsLedgerOn = isLedgerOn; IsInfraEncryptionEnabled = isInfraEncryptionEnabled; FederatedClientId = federatedClientId; + PrimaryDelegatedIdentityClientId = primaryDelegatedIdentityClientId; SourceResourceId = sourceResourceId; CustomInit(); } @@ -640,6 +644,13 @@ public Database() [JsonProperty(PropertyName = "properties.federatedClientId")] public System.Guid? FederatedClientId { get; set; } + /// + /// Gets or sets the Primary Delegated Identity Client id used for per + /// database CMK - for internal use only + /// + [JsonProperty(PropertyName = "properties.primaryDelegatedIdentityClientId")] + public System.Guid? PrimaryDelegatedIdentityClientId { get; set; } + /// /// Gets or sets the resource identifier of the source associated with /// the create operation of this database. diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/DatabaseIdentity.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/DatabaseIdentity.cs index 56dc6a20bea4..32e614559602 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/DatabaseIdentity.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/DatabaseIdentity.cs @@ -37,11 +37,14 @@ public DatabaseIdentity() /// id. /// The resource ids of the user /// assigned identities to use - public DatabaseIdentity(string type = default(string), System.Guid? tenantId = default(System.Guid?), IDictionary userAssignedIdentities = default(IDictionary)) + /// Resources delegated to the + /// database - Internal Use Only + public DatabaseIdentity(string type = default(string), System.Guid? tenantId = default(System.Guid?), IDictionary userAssignedIdentities = default(IDictionary), IDictionary delegatedResources = default(IDictionary)) { Type = type; TenantId = tenantId; UserAssignedIdentities = userAssignedIdentities; + DelegatedResources = delegatedResources; CustomInit(); } @@ -70,5 +73,12 @@ public DatabaseIdentity() [JsonProperty(PropertyName = "userAssignedIdentities")] public IDictionary UserAssignedIdentities { get; set; } + /// + /// Gets or sets resources delegated to the database - Internal Use + /// Only + /// + [JsonProperty(PropertyName = "delegatedResources")] + public IDictionary DelegatedResources { get; set; } + } } diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/DatabaseUpdate.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/DatabaseUpdate.cs index fad5a1679c9c..7f880478b16a 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/DatabaseUpdate.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/DatabaseUpdate.cs @@ -182,8 +182,11 @@ public DatabaseUpdate() /// for this database. /// The Client id used for cross tenant /// per database CMK scenario + /// The Primary + /// Delegated Identity Client id used for per database CMK - for + /// internal use only /// Resource tags. - public DatabaseUpdate(Sku sku = default(Sku), DatabaseIdentity identity = default(DatabaseIdentity), string createMode = default(string), string collation = default(string), long? maxSizeBytes = default(long?), string sampleName = default(string), string elasticPoolId = default(string), string sourceDatabaseId = default(string), string status = default(string), System.Guid? databaseId = default(System.Guid?), System.DateTime? creationDate = default(System.DateTime?), string currentServiceObjectiveName = default(string), string requestedServiceObjectiveName = default(string), string defaultSecondaryLocation = default(string), string failoverGroupId = default(string), System.DateTime? restorePointInTime = default(System.DateTime?), System.DateTime? sourceDatabaseDeletionDate = default(System.DateTime?), string recoveryServicesRecoveryPointId = default(string), string longTermRetentionBackupResourceId = default(string), string recoverableDatabaseId = default(string), string restorableDroppedDatabaseId = default(string), string catalogCollation = default(string), bool? zoneRedundant = default(bool?), string licenseType = default(string), long? maxLogSizeBytes = default(long?), System.DateTime? earliestRestoreDate = default(System.DateTime?), string readScale = default(string), int? highAvailabilityReplicaCount = default(int?), string secondaryType = default(string), Sku currentSku = default(Sku), int? autoPauseDelay = default(int?), string currentBackupStorageRedundancy = default(string), string requestedBackupStorageRedundancy = default(string), double? minCapacity = default(double?), System.DateTime? pausedDate = default(System.DateTime?), System.DateTime? resumedDate = default(System.DateTime?), string maintenanceConfigurationId = default(string), bool? isLedgerOn = default(bool?), bool? isInfraEncryptionEnabled = default(bool?), System.Guid? federatedClientId = default(System.Guid?), IDictionary tags = default(IDictionary)) + public DatabaseUpdate(Sku sku = default(Sku), DatabaseIdentity identity = default(DatabaseIdentity), string createMode = default(string), string collation = default(string), long? maxSizeBytes = default(long?), string sampleName = default(string), string elasticPoolId = default(string), string sourceDatabaseId = default(string), string status = default(string), System.Guid? databaseId = default(System.Guid?), System.DateTime? creationDate = default(System.DateTime?), string currentServiceObjectiveName = default(string), string requestedServiceObjectiveName = default(string), string defaultSecondaryLocation = default(string), string failoverGroupId = default(string), System.DateTime? restorePointInTime = default(System.DateTime?), System.DateTime? sourceDatabaseDeletionDate = default(System.DateTime?), string recoveryServicesRecoveryPointId = default(string), string longTermRetentionBackupResourceId = default(string), string recoverableDatabaseId = default(string), string restorableDroppedDatabaseId = default(string), string catalogCollation = default(string), bool? zoneRedundant = default(bool?), string licenseType = default(string), long? maxLogSizeBytes = default(long?), System.DateTime? earliestRestoreDate = default(System.DateTime?), string readScale = default(string), int? highAvailabilityReplicaCount = default(int?), string secondaryType = default(string), Sku currentSku = default(Sku), int? autoPauseDelay = default(int?), string currentBackupStorageRedundancy = default(string), string requestedBackupStorageRedundancy = default(string), double? minCapacity = default(double?), System.DateTime? pausedDate = default(System.DateTime?), System.DateTime? resumedDate = default(System.DateTime?), string maintenanceConfigurationId = default(string), bool? isLedgerOn = default(bool?), bool? isInfraEncryptionEnabled = default(bool?), System.Guid? federatedClientId = default(System.Guid?), System.Guid? primaryDelegatedIdentityClientId = default(System.Guid?), IDictionary tags = default(IDictionary)) { Sku = sku; Identity = identity; @@ -225,6 +228,7 @@ public DatabaseUpdate() IsLedgerOn = isLedgerOn; IsInfraEncryptionEnabled = isInfraEncryptionEnabled; FederatedClientId = federatedClientId; + PrimaryDelegatedIdentityClientId = primaryDelegatedIdentityClientId; Tags = tags; CustomInit(); } @@ -559,6 +563,13 @@ public DatabaseUpdate() [JsonProperty(PropertyName = "properties.federatedClientId")] public System.Guid? FederatedClientId { get; set; } + /// + /// Gets or sets the Primary Delegated Identity Client id used for per + /// database CMK - for internal use only + /// + [JsonProperty(PropertyName = "properties.primaryDelegatedIdentityClientId")] + public System.Guid? PrimaryDelegatedIdentityClientId { get; set; } + /// /// Gets or sets resource tags. /// diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/Delegation.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/Delegation.cs new file mode 100644 index 000000000000..0bc3e28727ee --- /dev/null +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/Delegation.cs @@ -0,0 +1,63 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Sql.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Delegated Resource Properties - Internal Use Only + /// + public partial class Delegation + { + /// + /// Initializes a new instance of the Delegation class. + /// + public Delegation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Delegation class. + /// + /// The resource id of the source resource - + /// Internal Use Only + /// AAD tenant guid of the source resource + /// identity - Internal Use Only. + public Delegation(string resourceId = default(string), System.Guid? tenantId = default(System.Guid?)) + { + ResourceId = resourceId; + TenantId = tenantId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the resource id of the source resource - Internal Use + /// Only + /// + [JsonProperty(PropertyName = "resourceId")] + public string ResourceId { get; set; } + + /// + /// Gets AAD tenant guid of the source resource identity - Internal Use + /// Only. + /// + [JsonProperty(PropertyName = "tenantId")] + public System.Guid? TenantId { get; private set; } + + } +} diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/ManagedServerDnsAliasCreation.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/IPv6FirewallRuleList.cs similarity index 53% rename from sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/ManagedServerDnsAliasCreation.cs rename to sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/IPv6FirewallRuleList.cs index 77f0176e74aa..9797c1a9fdc4 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/ManagedServerDnsAliasCreation.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/IPv6FirewallRuleList.cs @@ -11,31 +11,29 @@ namespace Microsoft.Azure.Management.Sql.Models { using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// - /// A managed server dns alias creation request. + /// A list of IPv6 server firewall rules. /// - public partial class ManagedServerDnsAliasCreation + public partial class IPv6FirewallRuleList { /// - /// Initializes a new instance of the ManagedServerDnsAliasCreation - /// class. + /// Initializes a new instance of the IPv6FirewallRuleList class. /// - public ManagedServerDnsAliasCreation() + public IPv6FirewallRuleList() { CustomInit(); } /// - /// Initializes a new instance of the ManagedServerDnsAliasCreation - /// class. + /// Initializes a new instance of the IPv6FirewallRuleList class. /// - /// Whether or not DNS record should be - /// created for this alias. - public ManagedServerDnsAliasCreation(bool? createDnsRecord = default(bool?)) + public IPv6FirewallRuleList(IList values = default(IList)) { - CreateDnsRecord = createDnsRecord; + Values = values; CustomInit(); } @@ -45,11 +43,9 @@ public ManagedServerDnsAliasCreation() partial void CustomInit(); /// - /// Gets or sets whether or not DNS record should be created for this - /// alias. /// - [JsonProperty(PropertyName = "createDnsRecord")] - public bool? CreateDnsRecord { get; set; } + [JsonProperty(PropertyName = "values")] + public IList Values { get; set; } } } diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/ManagedServerDnsAlias.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/ManagedServerDnsAlias.cs deleted file mode 100644 index 826cf94c2b36..000000000000 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/ManagedServerDnsAlias.cs +++ /dev/null @@ -1,59 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Sql.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// A managed server DNS alias. - /// - [Rest.Serialization.JsonTransformation] - public partial class ManagedServerDnsAlias : ProxyResource - { - /// - /// Initializes a new instance of the ManagedServerDnsAlias class. - /// - public ManagedServerDnsAlias() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ManagedServerDnsAlias class. - /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// The fully qualified DNS record for - /// managed server alias - public ManagedServerDnsAlias(string id = default(string), string name = default(string), string type = default(string), string azureDnsRecord = default(string)) - : base(id, name, type) - { - AzureDnsRecord = azureDnsRecord; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the fully qualified DNS record for managed server alias - /// - [JsonProperty(PropertyName = "properties.azureDnsRecord")] - public string AzureDnsRecord { get; private set; } - - } -} diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/ManagedServerDnsAliasAcquisition.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/ManagedServerDnsAliasAcquisition.cs deleted file mode 100644 index 52e9ddd88255..000000000000 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/ManagedServerDnsAliasAcquisition.cs +++ /dev/null @@ -1,70 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Sql.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// A managed server DNS alias acquisition request. - /// - public partial class ManagedServerDnsAliasAcquisition - { - /// - /// Initializes a new instance of the ManagedServerDnsAliasAcquisition - /// class. - /// - public ManagedServerDnsAliasAcquisition() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ManagedServerDnsAliasAcquisition - /// class. - /// - /// The resource ID of - /// the managed server DNS alias that will be acquired to point to this - /// managed server instead. - public ManagedServerDnsAliasAcquisition(string oldManagedServerDnsAliasResourceId) - { - OldManagedServerDnsAliasResourceId = oldManagedServerDnsAliasResourceId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the resource ID of the managed server DNS alias that - /// will be acquired to point to this managed server instead. - /// - [JsonProperty(PropertyName = "oldManagedServerDnsAliasResourceId")] - public string OldManagedServerDnsAliasResourceId { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (OldManagedServerDnsAliasResourceId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "OldManagedServerDnsAliasResourceId"); - } - } - } -} diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/UnlinkParameters.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/UnlinkParameters.cs new file mode 100644 index 000000000000..773e905009a0 --- /dev/null +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/UnlinkParameters.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Sql.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Represents the parameters for Unlink Replication Link request. + /// + public partial class UnlinkParameters + { + /// + /// Initializes a new instance of the UnlinkParameters class. + /// + public UnlinkParameters() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the UnlinkParameters class. + /// + /// Determines whether link will be + /// terminated in a forced or a friendly way. + public UnlinkParameters(bool? forcedTermination = default(bool?)) + { + ForcedTermination = forcedTermination; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets determines whether link will be terminated in a forced + /// or a friendly way. + /// + [JsonProperty(PropertyName = "forcedTermination")] + public bool? ForcedTermination { get; set; } + + } +} diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/RecommendedSensitivityLabelsOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/RecommendedSensitivityLabelsOperations.cs index bd26dd99867d..71e46e0c31ca 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/RecommendedSensitivityLabelsOperations.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/RecommendedSensitivityLabelsOperations.cs @@ -106,7 +106,7 @@ internal RecommendedSensitivityLabelsOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-11-01-preview"; + string apiVersion = "2020-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ReplicationLinksOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ReplicationLinksOperations.cs index 2cb48749e5f3..64ddd37e63c9 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ReplicationLinksOperations.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ReplicationLinksOperations.cs @@ -51,7 +51,7 @@ internal ReplicationLinksOperations(SqlManagementClient client) public SqlManagementClient Client { get; private set; } /// - /// Gets a list of replication links on database. + /// Deletes a database replication link. Cannot be done during failover. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -61,7 +61,10 @@ internal ReplicationLinksOperations(SqlManagementClient client) /// The name of the server. /// /// - /// The name of the database. + /// The name of the database that has the replication link to be dropped. + /// + /// + /// The ID of the replication link to be deleted. /// /// /// Headers that will be added to request. @@ -72,9 +75,6 @@ internal ReplicationLinksOperations(SqlManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -84,8 +84,12 @@ internal ReplicationLinksOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -98,11 +102,11 @@ internal ReplicationLinksOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); } - if (Client.SubscriptionId == null) + if (linkId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "linkId"); } - string apiVersion = "2021-11-01-preview"; + string apiVersion = "2014-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -110,20 +114,22 @@ internal ReplicationLinksOperations(SqlManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serverName", serverName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("linkId", linkId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByDatabase", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _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)); + _url = _url.Replace("{linkId}", System.Uri.EscapeDataString(linkId)); List _queryParameters = new List(); if (apiVersion != null) { @@ -136,7 +142,7 @@ internal ReplicationLinksOperations(SqlManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -187,7 +193,7 @@ internal ReplicationLinksOperations(SqlManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -222,31 +228,13 @@ internal ReplicationLinksOperations(SqlManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _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); @@ -313,7 +301,7 @@ internal ReplicationLinksOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-11-01-preview"; + string apiVersion = "2021-02-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -468,7 +456,8 @@ internal ReplicationLinksOperations(SqlManagementClient client) } /// - /// Deletes the replication link. + /// Sets which replica database is primary by failing over from the current + /// primary replica database. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -478,9 +467,98 @@ internal ReplicationLinksOperations(SqlManagementClient client) /// The name of the server. /// /// - /// The name of the database. + /// The name of the database that has the replication link to be failed over. /// /// + /// The ID of the replication link to be failed over. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task FailoverWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginFailoverWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Sets which replica database is primary by failing over from the current + /// primary replica database. This operation might result in data loss. + /// + /// + /// 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 that has the replication link to be failed over. + /// + /// + /// The ID of the replication link to be failed over. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task FailoverAllowDataLossWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginFailoverAllowDataLossWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes a database replication link in forced or friendly way. + /// + /// + /// 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 that has the replication link to be failed over. + /// + /// + /// The ID of the replication link to be failed over. + /// + /// + /// The required parameters for unlinking replication link. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task UnlinkWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, UnlinkParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginUnlinkWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a list of replication links on 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. /// /// /// Headers that will be added to request. @@ -491,6 +569,9 @@ internal ReplicationLinksOperations(SqlManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -500,7 +581,7 @@ internal ReplicationLinksOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -514,15 +595,11 @@ internal ReplicationLinksOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); } - if (linkId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "linkId"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-11-01-preview"; + string apiVersion = "2021-02-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -533,18 +610,16 @@ internal ReplicationLinksOperations(SqlManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serverName", serverName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("linkId", linkId); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByDatabase", 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}/replicationLinks/{linkId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks").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("{linkId}", System.Uri.EscapeDataString(linkId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -558,7 +633,7 @@ internal ReplicationLinksOperations(SqlManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -644,13 +719,31 @@ internal ReplicationLinksOperations(SqlManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _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); @@ -658,65 +751,6 @@ internal ReplicationLinksOperations(SqlManagementClient client) return _result; } - /// - /// Fails over from the current primary server to this 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 name of the database. - /// - /// - /// The name of the replication link. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> FailoverWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginFailoverWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Fails over from the current primary server to this server allowing data - /// loss. - /// - /// - /// 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 name of the replication link. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> FailoverAllowDataLossWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginFailoverAllowDataLossWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - /// /// Gets a list of replication links. /// @@ -762,7 +796,7 @@ internal ReplicationLinksOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-11-01-preview"; + string apiVersion = "2021-02-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -913,7 +947,8 @@ internal ReplicationLinksOperations(SqlManagementClient client) } /// - /// Fails over from the current primary server to this server. + /// Sets which replica database is primary by failing over from the current + /// primary replica database. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -923,10 +958,10 @@ internal ReplicationLinksOperations(SqlManagementClient client) /// The name of the server. /// /// - /// The name of the database. + /// The name of the database that has the replication link to be failed over. /// /// - /// The name of the replication link. + /// The ID of the replication link to be failed over. /// /// /// Headers that will be added to request. @@ -937,9 +972,6 @@ internal ReplicationLinksOperations(SqlManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -949,8 +981,12 @@ internal ReplicationLinksOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginFailoverWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginFailoverWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -967,11 +1003,7 @@ internal ReplicationLinksOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "linkId"); } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2021-11-01-preview"; + string apiVersion = "2014-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -979,22 +1011,22 @@ internal ReplicationLinksOperations(SqlManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serverName", serverName); tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("linkId", linkId); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginFailover", 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}/replicationLinks/{linkId}/failover").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _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("{linkId}", System.Uri.EscapeDataString(linkId)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) { @@ -1058,7 +1090,7 @@ internal ReplicationLinksOperations(SqlManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1093,31 +1125,13 @@ internal ReplicationLinksOperations(SqlManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _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); @@ -1126,8 +1140,8 @@ internal ReplicationLinksOperations(SqlManagementClient client) } /// - /// Fails over from the current primary server to this server allowing data - /// loss. + /// Sets which replica database is primary by failing over from the current + /// primary replica database. This operation might result in data loss. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -1137,10 +1151,10 @@ internal ReplicationLinksOperations(SqlManagementClient client) /// The name of the server. /// /// - /// The name of the database. + /// The name of the database that has the replication link to be failed over. /// /// - /// The name of the replication link. + /// The ID of the replication link to be failed over. /// /// /// Headers that will be added to request. @@ -1151,9 +1165,6 @@ internal ReplicationLinksOperations(SqlManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -1163,8 +1174,12 @@ internal ReplicationLinksOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginFailoverAllowDataLossWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginFailoverAllowDataLossWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1181,11 +1196,7 @@ internal ReplicationLinksOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "linkId"); } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2021-11-01-preview"; + string apiVersion = "2014-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1193,22 +1204,22 @@ internal ReplicationLinksOperations(SqlManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serverName", serverName); tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("linkId", linkId); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginFailoverAllowDataLoss", 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}/replicationLinks/{linkId}/forceFailoverAllowDataLoss").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _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("{linkId}", System.Uri.EscapeDataString(linkId)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) { @@ -1272,7 +1283,7 @@ internal ReplicationLinksOperations(SqlManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1307,31 +1318,219 @@ internal ReplicationLinksOperations(SqlManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) + if (_shouldTrace) { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes a database replication link in forced or friendly way. + /// + /// + /// 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 that has the replication link to be failed over. + /// + /// + /// The ID of the replication link to be failed over. + /// + /// + /// The required parameters for unlinking replication link. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginUnlinkWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, UnlinkParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serverName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); + } + if (databaseName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); + } + if (linkId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "linkId"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + string apiVersion = "2014-04-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serverName", serverName); + tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("linkId", linkId); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginUnlink", 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}/replicationLinks/{linkId}/unlink").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _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("{linkId}", System.Uri.EscapeDataString(linkId)); + 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("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _httpRequest.Headers.Remove("accept-language"); } - catch (JsonException ex) + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) { - _httpRequest.Dispose(); - if (_httpResponse != null) + if (_httpRequest.Headers.Contains(_header.Key)) { - _httpResponse.Dispose(); + _httpRequest.Headers.Remove(_header.Key); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } + + // Serialize Request + string _requestContent = null; + 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 != 202 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ReplicationLinksOperationsExtensions.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ReplicationLinksOperationsExtensions.cs index b5e56b6e2ffa..5cfcc8702823 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ReplicationLinksOperationsExtensions.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ReplicationLinksOperationsExtensions.cs @@ -22,7 +22,7 @@ namespace Microsoft.Azure.Management.Sql public static partial class ReplicationLinksOperationsExtensions { /// - /// Gets a list of replication links on database. + /// Deletes a database replication link. Cannot be done during failover. /// /// /// The operations group for this extension method. @@ -35,15 +35,18 @@ public static partial class ReplicationLinksOperationsExtensions /// The name of the server. /// /// - /// The name of the database. + /// The name of the database that has the replication link to be dropped. /// - public static IPage ListByDatabase(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName) + /// + /// The ID of the replication link to be deleted. + /// + public static void Delete(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId) { - return operations.ListByDatabaseAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult(); + operations.DeleteAsync(resourceGroupName, serverName, databaseName, linkId).GetAwaiter().GetResult(); } /// - /// Gets a list of replication links on database. + /// Deletes a database replication link. Cannot be done during failover. /// /// /// The operations group for this extension method. @@ -56,17 +59,17 @@ public static IPage ListByDatabase(this IReplicationLinksOperat /// The name of the server. /// /// - /// The name of the database. + /// The name of the database that has the replication link to be dropped. + /// + /// + /// The ID of the replication link to be deleted. /// /// /// The cancellation token. /// - public static async Task> ListByDatabaseAsync(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteAsync(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByDatabaseWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -124,7 +127,8 @@ public static ReplicationLink Get(this IReplicationLinksOperations operations, s } /// - /// Deletes the replication link. + /// Sets which replica database is primary by failing over from the current + /// primary replica database. /// /// /// The operations group for this extension method. @@ -137,17 +141,19 @@ public static ReplicationLink Get(this IReplicationLinksOperations operations, s /// The name of the server. /// /// - /// The name of the database. + /// The name of the database that has the replication link to be failed over. /// /// + /// The ID of the replication link to be failed over. /// - public static void Delete(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId) + public static void Failover(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId) { - operations.DeleteAsync(resourceGroupName, serverName, databaseName, linkId).GetAwaiter().GetResult(); + operations.FailoverAsync(resourceGroupName, serverName, databaseName, linkId).GetAwaiter().GetResult(); } /// - /// Deletes the replication link. + /// Sets which replica database is primary by failing over from the current + /// primary replica database. /// /// /// The operations group for this extension method. @@ -160,20 +166,22 @@ public static void Delete(this IReplicationLinksOperations operations, string re /// The name of the server. /// /// - /// The name of the database. + /// The name of the database that has the replication link to be failed over. /// /// + /// The ID of the replication link to be failed over. /// /// /// The cancellation token. /// - public static async Task DeleteAsync(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task FailoverAsync(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.FailoverWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Fails over from the current primary server to this server. + /// Sets which replica database is primary by failing over from the current + /// primary replica database. This operation might result in data loss. /// /// /// The operations group for this extension method. @@ -186,18 +194,19 @@ public static void Delete(this IReplicationLinksOperations operations, string re /// The name of the server. /// /// - /// The name of the database. + /// The name of the database that has the replication link to be failed over. /// /// - /// The name of the replication link. + /// The ID of the replication link to be failed over. /// - public static ReplicationLink Failover(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId) + public static void FailoverAllowDataLoss(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId) { - return operations.FailoverAsync(resourceGroupName, serverName, databaseName, linkId).GetAwaiter().GetResult(); + operations.FailoverAllowDataLossAsync(resourceGroupName, serverName, databaseName, linkId).GetAwaiter().GetResult(); } /// - /// Fails over from the current primary server to this server. + /// Sets which replica database is primary by failing over from the current + /// primary replica database. This operation might result in data loss. /// /// /// The operations group for this extension method. @@ -210,25 +219,21 @@ public static ReplicationLink Failover(this IReplicationLinksOperations operatio /// The name of the server. /// /// - /// The name of the database. + /// The name of the database that has the replication link to be failed over. /// /// - /// The name of the replication link. + /// The ID of the replication link to be failed over. /// /// /// The cancellation token. /// - public static async Task FailoverAsync(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task FailoverAllowDataLossAsync(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.FailoverWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + (await operations.FailoverAllowDataLossWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Fails over from the current primary server to this server allowing data - /// loss. + /// Deletes a database replication link in forced or friendly way. /// /// /// The operations group for this extension method. @@ -241,19 +246,21 @@ public static ReplicationLink Failover(this IReplicationLinksOperations operatio /// The name of the server. /// /// - /// The name of the database. + /// The name of the database that has the replication link to be failed over. /// /// - /// The name of the replication link. + /// The ID of the replication link to be failed over. + /// + /// + /// The required parameters for unlinking replication link. /// - public static ReplicationLink FailoverAllowDataLoss(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId) + public static void Unlink(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId, UnlinkParameters parameters) { - return operations.FailoverAllowDataLossAsync(resourceGroupName, serverName, databaseName, linkId).GetAwaiter().GetResult(); + operations.UnlinkAsync(resourceGroupName, serverName, databaseName, linkId, parameters).GetAwaiter().GetResult(); } /// - /// Fails over from the current primary server to this server allowing data - /// loss. + /// Deletes a database replication link in forced or friendly way. /// /// /// The operations group for this extension method. @@ -266,17 +273,65 @@ public static ReplicationLink FailoverAllowDataLoss(this IReplicationLinksOperat /// The name of the server. /// /// - /// The name of the database. + /// The name of the database that has the replication link to be failed over. /// /// - /// The name of the replication link. + /// The ID of the replication link to be failed over. + /// + /// + /// The required parameters for unlinking replication link. + /// + /// + /// The cancellation token. + /// + public static async Task UnlinkAsync(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId, UnlinkParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.UnlinkWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets a list of replication links on 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. + /// + public static IPage ListByDatabase(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName) + { + return operations.ListByDatabaseAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of replication links on 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 cancellation token. /// - public static async Task FailoverAllowDataLossAsync(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByDatabaseAsync(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.FailoverAllowDataLossWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByDatabaseWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -325,7 +380,8 @@ public static IPage ListByServer(this IReplicationLinksOperatio } /// - /// Fails over from the current primary server to this server. + /// Sets which replica database is primary by failing over from the current + /// primary replica database. /// /// /// The operations group for this extension method. @@ -338,18 +394,19 @@ public static IPage ListByServer(this IReplicationLinksOperatio /// The name of the server. /// /// - /// The name of the database. + /// The name of the database that has the replication link to be failed over. /// /// - /// The name of the replication link. + /// The ID of the replication link to be failed over. /// - public static ReplicationLink BeginFailover(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId) + public static void BeginFailover(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId) { - return operations.BeginFailoverAsync(resourceGroupName, serverName, databaseName, linkId).GetAwaiter().GetResult(); + operations.BeginFailoverAsync(resourceGroupName, serverName, databaseName, linkId).GetAwaiter().GetResult(); } /// - /// Fails over from the current primary server to this server. + /// Sets which replica database is primary by failing over from the current + /// primary replica database. /// /// /// The operations group for this extension method. @@ -362,25 +419,22 @@ public static ReplicationLink BeginFailover(this IReplicationLinksOperations ope /// The name of the server. /// /// - /// The name of the database. + /// The name of the database that has the replication link to be failed over. /// /// - /// The name of the replication link. + /// The ID of the replication link to be failed over. /// /// /// The cancellation token. /// - public static async Task BeginFailoverAsync(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginFailoverAsync(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginFailoverWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + (await operations.BeginFailoverWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Fails over from the current primary server to this server allowing data - /// loss. + /// Sets which replica database is primary by failing over from the current + /// primary replica database. This operation might result in data loss. /// /// /// The operations group for this extension method. @@ -393,19 +447,19 @@ public static ReplicationLink BeginFailover(this IReplicationLinksOperations ope /// The name of the server. /// /// - /// The name of the database. + /// The name of the database that has the replication link to be failed over. /// /// - /// The name of the replication link. + /// The ID of the replication link to be failed over. /// - public static ReplicationLink BeginFailoverAllowDataLoss(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId) + public static void BeginFailoverAllowDataLoss(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId) { - return operations.BeginFailoverAllowDataLossAsync(resourceGroupName, serverName, databaseName, linkId).GetAwaiter().GetResult(); + operations.BeginFailoverAllowDataLossAsync(resourceGroupName, serverName, databaseName, linkId).GetAwaiter().GetResult(); } /// - /// Fails over from the current primary server to this server allowing data - /// loss. + /// Sets which replica database is primary by failing over from the current + /// primary replica database. This operation might result in data loss. /// /// /// The operations group for this extension method. @@ -418,20 +472,74 @@ public static ReplicationLink BeginFailoverAllowDataLoss(this IReplicationLinksO /// The name of the server. /// /// - /// The name of the database. + /// The name of the database that has the replication link to be failed over. /// /// - /// The name of the replication link. + /// The ID of the replication link to be failed over. /// /// /// The cancellation token. /// - public static async Task BeginFailoverAllowDataLossAsync(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginFailoverAllowDataLossAsync(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginFailoverAllowDataLossWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + (await operations.BeginFailoverAllowDataLossWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Deletes a database replication link in forced or friendly way. + /// + /// + /// 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 that has the replication link to be failed over. + /// + /// + /// The ID of the replication link to be failed over. + /// + /// + /// The required parameters for unlinking replication link. + /// + public static void BeginUnlink(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId, UnlinkParameters parameters) + { + operations.BeginUnlinkAsync(resourceGroupName, serverName, databaseName, linkId, parameters).GetAwaiter().GetResult(); + } + + /// + /// Deletes a database replication link in forced or friendly way. + /// + /// + /// 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 that has the replication link to be failed over. + /// + /// + /// The ID of the replication link to be failed over. + /// + /// + /// The required parameters for unlinking replication link. + /// + /// + /// The cancellation token. + /// + public static async Task BeginUnlinkAsync(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId, UnlinkParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginUnlinkWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SdkInfo_SqlManagementClient.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SdkInfo_SqlManagementClient.cs index be79141b6288..ea8c5d51ae68 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SdkInfo_SqlManagementClient.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SdkInfo_SqlManagementClient.cs @@ -54,7 +54,7 @@ public static IEnumerable> ApiInfo_SqlManagementCl new Tuple("Sql", "FailoverGroups", "2020-11-01-preview"), new Tuple("Sql", "FirewallRules", "2020-11-01-preview"), new Tuple("Sql", "GeoBackupPolicies", "2014-04-01"), - new Tuple("Sql", "IPv6FirewallRules", "2021-11-01-preview"), + new Tuple("Sql", "IPv6FirewallRules", "2021-08-01-preview"), new Tuple("Sql", "InstanceFailoverGroups", "2020-11-01-preview"), new Tuple("Sql", "InstancePools", "2020-11-01-preview"), new Tuple("Sql", "JobAgents", "2020-11-01-preview"), @@ -75,12 +75,12 @@ public static IEnumerable> ApiInfo_SqlManagementCl new Tuple("Sql", "ManagedBackupShortTermRetentionPolicies", "2020-11-01-preview"), new Tuple("Sql", "ManagedDatabaseColumns", "2020-11-01-preview"), new Tuple("Sql", "ManagedDatabaseQueries", "2020-11-01-preview"), - new Tuple("Sql", "ManagedDatabaseRecommendedSensitivityLabels", "2021-11-01-preview"), + new Tuple("Sql", "ManagedDatabaseRecommendedSensitivityLabels", "2020-11-01-preview"), new Tuple("Sql", "ManagedDatabaseRestoreDetails", "2020-11-01-preview"), new Tuple("Sql", "ManagedDatabaseSchemas", "2020-11-01-preview"), new Tuple("Sql", "ManagedDatabaseSecurityAlertPolicies", "2020-11-01-preview"), new Tuple("Sql", "ManagedDatabaseSecurityEvents", "2020-11-01-preview"), - new Tuple("Sql", "ManagedDatabaseSensitivityLabels", "2021-11-01-preview"), + new Tuple("Sql", "ManagedDatabaseSensitivityLabels", "2020-11-01-preview"), new Tuple("Sql", "ManagedDatabaseTables", "2020-11-01-preview"), new Tuple("Sql", "ManagedDatabaseTransparentDataEncryption", "2020-11-01-preview"), new Tuple("Sql", "ManagedDatabaseVulnerabilityAssessmentRuleBaselines", "2020-11-01-preview"), @@ -99,20 +99,20 @@ public static IEnumerable> ApiInfo_SqlManagementCl new Tuple("Sql", "ManagedInstanceVulnerabilityAssessments", "2020-11-01-preview"), new Tuple("Sql", "ManagedInstances", "2021-05-01-preview"), new Tuple("Sql", "ManagedRestorableDroppedDatabaseBackupShortTermRetentionPolicies", "2020-11-01-preview"), - new Tuple("Sql", "ManagedServerDnsAliases", "2021-11-01-preview"), new Tuple("Sql", "ManagedServerSecurityAlertPolicies", "2020-11-01-preview"), new Tuple("Sql", "Operations", "2020-11-01-preview"), new Tuple("Sql", "OutboundFirewallRules", "2021-02-01-preview"), new Tuple("Sql", "PrivateEndpointConnections", "2020-11-01-preview"), new Tuple("Sql", "PrivateLinkResources", "2020-11-01-preview"), - new Tuple("Sql", "RecommendedSensitivityLabels", "2021-11-01-preview"), + new Tuple("Sql", "RecommendedSensitivityLabels", "2020-11-01-preview"), new Tuple("Sql", "RecoverableDatabases", "2014-04-01"), new Tuple("Sql", "RecoverableManagedDatabases", "2020-11-01-preview"), - new Tuple("Sql", "ReplicationLinks", "2021-11-01-preview"), + new Tuple("Sql", "ReplicationLinks", "2014-04-01"), + new Tuple("Sql", "ReplicationLinks", "2021-02-01-preview"), new Tuple("Sql", "RestorableDroppedDatabases", "2021-05-01-preview"), new Tuple("Sql", "RestorableDroppedManagedDatabases", "2021-05-01-preview"), new Tuple("Sql", "RestorePoints", "2020-11-01-preview"), - new Tuple("Sql", "SensitivityLabels", "2021-11-01-preview"), + new Tuple("Sql", "SensitivityLabels", "2020-11-01-preview"), new Tuple("Sql", "ServerAdvisors", "2020-11-01-preview"), new Tuple("Sql", "ServerAutomaticTuning", "2020-11-01-preview"), new Tuple("Sql", "ServerAzureADAdministrators", "2020-11-01-preview"), diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SensitivityLabelsOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SensitivityLabelsOperations.cs index c3b5bb981564..c033488914ca 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SensitivityLabelsOperations.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SensitivityLabelsOperations.cs @@ -110,7 +110,7 @@ internal SensitivityLabelsOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-11-01-preview"; + string apiVersion = "2020-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -336,7 +336,7 @@ internal SensitivityLabelsOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-11-01-preview"; + string apiVersion = "2020-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -537,7 +537,7 @@ internal SensitivityLabelsOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-11-01-preview"; + string apiVersion = "2020-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -709,510 +709,8 @@ internal SensitivityLabelsOperations(SqlManagementClient client) } /// - /// Gets the sensitivity label of a given column - /// - /// - /// 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 name of the schema. - /// - /// - /// The name of the table. - /// - /// - /// The name of the column. - /// - /// - /// The source of the sensitivity label. Possible values include: 'current', - /// 'recommended' - /// - /// - /// 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, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource, 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 (schemaName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "schemaName"); - } - if (tableName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); - } - if (columnName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "columnName"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2021-11-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("schemaName", schemaName); - tracingParameters.Add("tableName", tableName); - tracingParameters.Add("columnName", columnName); - tracingParameters.Add("sensitivityLabelSource", sensitivityLabelSource); - 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}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}").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("{schemaName}", System.Uri.EscapeDataString(schemaName)); - _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); - _url = _url.Replace("{columnName}", System.Uri.EscapeDataString(columnName)); - _url = _url.Replace("{sensitivityLabelSource}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(sensitivityLabelSource, Client.SerializationSettings).Trim('"'))); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Creates or updates the sensitivity label of a given column - /// - /// - /// 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 name of the schema. - /// - /// - /// The name of the table. - /// - /// - /// The name of the column. - /// - /// - /// The column sensitivity label resource. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabel 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 (schemaName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "schemaName"); - } - if (tableName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); - } - if (columnName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "columnName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string sensitivityLabelSource = "current"; - string apiVersion = "2021-11-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("schemaName", schemaName); - tracingParameters.Add("tableName", tableName); - tracingParameters.Add("columnName", columnName); - tracingParameters.Add("sensitivityLabelSource", sensitivityLabelSource); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}").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("{schemaName}", System.Uri.EscapeDataString(schemaName)); - _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); - _url = _url.Replace("{columnName}", System.Uri.EscapeDataString(columnName)); - _url = _url.Replace("{sensitivityLabelSource}", System.Uri.EscapeDataString(sensitivityLabelSource)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(parameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Deletes the sensitivity label of a given column + /// Enables sensitivity recommendations on a given column (recommendations are + /// enabled by default on all columns) /// /// /// The name of the resource group that contains the resource. You can obtain @@ -1251,7 +749,7 @@ internal SensitivityLabelsOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task EnableRecommendationWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1281,8 +779,8 @@ internal SensitivityLabelsOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string sensitivityLabelSource = "current"; - string apiVersion = "2021-11-01-preview"; + string sensitivityLabelSource = "recommended"; + string apiVersion = "2020-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1299,11 +797,11 @@ internal SensitivityLabelsOperations(SqlManagementClient client) tracingParameters.Add("sensitivityLabelSource", sensitivityLabelSource); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "EnableRecommendation", 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}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/enable").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)); @@ -1324,7 +822,7 @@ internal SensitivityLabelsOperations(SqlManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1495,7 +993,7 @@ internal SensitivityLabelsOperations(SqlManagementClient client) throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } string sensitivityLabelSource = "recommended"; - string apiVersion = "2021-11-01-preview"; + string apiVersion = "2020-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1638,8 +1136,7 @@ internal SensitivityLabelsOperations(SqlManagementClient client) } /// - /// Enables sensitivity recommendations on a given column (recommendations are - /// enabled by default on all columns) + /// Gets the sensitivity label of a given column /// /// /// The name of the resource group that contains the resource. You can obtain @@ -1660,6 +1157,10 @@ internal SensitivityLabelsOperations(SqlManagementClient client) /// /// The name of the column. /// + /// + /// The source of the sensitivity label. Possible values include: 'current', + /// 'recommended' + /// /// /// Headers that will be added to request. /// @@ -1669,6 +1170,9 @@ internal SensitivityLabelsOperations(SqlManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -1678,7 +1182,7 @@ internal SensitivityLabelsOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task EnableRecommendationWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1708,8 +1212,7 @@ internal SensitivityLabelsOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string sensitivityLabelSource = "recommended"; - string apiVersion = "2021-11-01-preview"; + string apiVersion = "2020-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1726,18 +1229,18 @@ internal SensitivityLabelsOperations(SqlManagementClient client) tracingParameters.Add("sensitivityLabelSource", sensitivityLabelSource); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "EnableRecommendation", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/enable").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}").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("{schemaName}", System.Uri.EscapeDataString(schemaName)); _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); _url = _url.Replace("{columnName}", System.Uri.EscapeDataString(columnName)); - _url = _url.Replace("{sensitivityLabelSource}", System.Uri.EscapeDataString(sensitivityLabelSource)); + _url = _url.Replace("{sensitivityLabelSource}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(sensitivityLabelSource, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -1751,7 +1254,7 @@ internal SensitivityLabelsOperations(SqlManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1837,13 +1340,31 @@ internal SensitivityLabelsOperations(SqlManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _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); @@ -1852,7 +1373,7 @@ internal SensitivityLabelsOperations(SqlManagementClient client) } /// - /// Gets the sensitivity labels of a given database + /// Creates or updates the sensitivity label of a given column /// /// /// The name of the resource group that contains the resource. You can obtain @@ -1864,8 +1385,17 @@ internal SensitivityLabelsOperations(SqlManagementClient client) /// /// The name of the database. /// - /// - /// OData parameters to apply to the operation. + /// + /// The name of the schema. + /// + /// + /// The name of the table. + /// + /// + /// The name of the column. + /// + /// + /// The column sensitivity label resource. /// /// /// Headers that will be added to request. @@ -1888,7 +1418,7 @@ internal SensitivityLabelsOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabel parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1902,11 +1432,28 @@ internal SensitivityLabelsOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); } + if (schemaName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "schemaName"); + } + if (tableName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); + } + if (columnName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "columnName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-11-01-preview"; + string sensitivityLabelSource = "current"; + string apiVersion = "2020-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1914,30 +1461,30 @@ internal SensitivityLabelsOperations(SqlManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serverName", serverName); tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("schemaName", schemaName); + tracingParameters.Add("tableName", tableName); + tracingParameters.Add("columnName", columnName); + tracingParameters.Add("sensitivityLabelSource", sensitivityLabelSource); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByDatabase", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sensitivityLabels").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}").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("{schemaName}", System.Uri.EscapeDataString(schemaName)); + _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); + _url = _url.Replace("{columnName}", System.Uri.EscapeDataString(columnName)); + _url = _url.Replace("{sensitivityLabelSource}", System.Uri.EscapeDataString(sensitivityLabelSource)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (odataQuery != null) - { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) - { - _queryParameters.Add(_odataFilter); - } - } if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1949,7 +1496,7 @@ internal SensitivityLabelsOperations(SqlManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1980,6 +1527,12 @@ internal SensitivityLabelsOperations(SqlManagementClient client) // Serialize Request string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -2000,7 +1553,7 @@ internal SensitivityLabelsOperations(SqlManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -2035,7 +1588,7 @@ internal SensitivityLabelsOperations(SqlManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2048,7 +1601,25 @@ internal SensitivityLabelsOperations(SqlManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -2068,10 +1639,26 @@ internal SensitivityLabelsOperations(SqlManagementClient client) } /// - /// Gets the sensitivity labels of a given database + /// Deletes the sensitivity label of a given column /// - /// - /// The NextLink from the previous successful call to List operation. + /// + /// 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 name of the schema. + /// + /// + /// The name of the table. + /// + /// + /// The name of the column. /// /// /// Headers that will be added to request. @@ -2082,9 +1669,6 @@ internal SensitivityLabelsOperations(SqlManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -2094,12 +1678,38 @@ internal SensitivityLabelsOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListCurrentByDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (nextPageLink == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + 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 (schemaName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "schemaName"); + } + if (tableName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); } + if (columnName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "columnName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string sensitivityLabelSource = "current"; + string apiVersion = "2020-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2107,14 +1717,33 @@ internal SensitivityLabelsOperations(SqlManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serverName", serverName); + tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("schemaName", schemaName); + tracingParameters.Add("tableName", tableName); + tracingParameters.Add("columnName", columnName); + tracingParameters.Add("sensitivityLabelSource", sensitivityLabelSource); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListCurrentByDatabaseNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); + 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}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}").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("{schemaName}", System.Uri.EscapeDataString(schemaName)); + _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); + _url = _url.Replace("{columnName}", System.Uri.EscapeDataString(columnName)); + _url = _url.Replace("{sensitivityLabelSource}", System.Uri.EscapeDataString(sensitivityLabelSource)); + _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); @@ -2122,7 +1751,7 @@ internal SensitivityLabelsOperations(SqlManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -2208,31 +1837,13 @@ internal SensitivityLabelsOperations(SqlManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _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); @@ -2267,7 +1878,7 @@ internal SensitivityLabelsOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListRecommendedByDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListCurrentByDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -2282,7 +1893,7 @@ internal SensitivityLabelsOperations(SqlManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListRecommendedByDatabaseNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListCurrentByDatabaseNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -2440,7 +2051,7 @@ internal SensitivityLabelsOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListRecommendedByDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -2455,7 +2066,7 @@ internal SensitivityLabelsOperations(SqlManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByDatabaseNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListRecommendedByDatabaseNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SensitivityLabelsOperationsExtensions.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SensitivityLabelsOperationsExtensions.cs index bad4e1db77f4..16d206000767 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SensitivityLabelsOperationsExtensions.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SensitivityLabelsOperationsExtensions.cs @@ -198,7 +198,8 @@ public static void Update(this ISensitivityLabelsOperations operations, string r } /// - /// Gets the sensitivity label of a given column + /// Enables sensitivity recommendations on a given column (recommendations are + /// enabled by default on all columns) /// /// /// The operations group for this extension method. @@ -222,17 +223,14 @@ public static void Update(this ISensitivityLabelsOperations operations, string r /// /// The name of the column. /// - /// - /// The source of the sensitivity label. Possible values include: 'current', - /// 'recommended' - /// - public static SensitivityLabel Get(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource) + public static void EnableRecommendation(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName) { - return operations.GetAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, sensitivityLabelSource).GetAwaiter().GetResult(); + operations.EnableRecommendationAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName).GetAwaiter().GetResult(); } /// - /// Gets the sensitivity label of a given column + /// Enables sensitivity recommendations on a given column (recommendations are + /// enabled by default on all columns) /// /// /// The operations group for this extension method. @@ -256,23 +254,16 @@ public static SensitivityLabel Get(this ISensitivityLabelsOperations operations, /// /// The name of the column. /// - /// - /// The source of the sensitivity label. Possible values include: 'current', - /// 'recommended' - /// /// /// The cancellation token. /// - public static async Task GetAsync(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task EnableRecommendationAsync(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, sensitivityLabelSource, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + (await operations.EnableRecommendationWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Creates or updates the sensitivity label of a given column + /// Disables sensitivity recommendations on a given column /// /// /// The operations group for this extension method. @@ -296,16 +287,13 @@ public static SensitivityLabel Get(this ISensitivityLabelsOperations operations, /// /// The name of the column. /// - /// - /// The column sensitivity label resource. - /// - public static SensitivityLabel CreateOrUpdate(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabel parameters) + public static void DisableRecommendation(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName) { - return operations.CreateOrUpdateAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, parameters).GetAwaiter().GetResult(); + operations.DisableRecommendationAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName).GetAwaiter().GetResult(); } /// - /// Creates or updates the sensitivity label of a given column + /// Disables sensitivity recommendations on a given column /// /// /// The operations group for this extension method. @@ -329,22 +317,16 @@ public static SensitivityLabel CreateOrUpdate(this ISensitivityLabelsOperations /// /// The name of the column. /// - /// - /// The column sensitivity label resource. - /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabel parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DisableRecommendationAsync(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + (await operations.DisableRecommendationWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Deletes the sensitivity label of a given column + /// Gets the sensitivity label of a given column /// /// /// The operations group for this extension method. @@ -368,13 +350,17 @@ public static SensitivityLabel CreateOrUpdate(this ISensitivityLabelsOperations /// /// The name of the column. /// - public static void Delete(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName) + /// + /// The source of the sensitivity label. Possible values include: 'current', + /// 'recommended' + /// + public static SensitivityLabel Get(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource) { - operations.DeleteAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, sensitivityLabelSource).GetAwaiter().GetResult(); } /// - /// Deletes the sensitivity label of a given column + /// Gets the sensitivity label of a given column /// /// /// The operations group for this extension method. @@ -398,16 +384,23 @@ public static void Delete(this ISensitivityLabelsOperations operations, string r /// /// The name of the column. /// + /// + /// The source of the sensitivity label. Possible values include: 'current', + /// 'recommended' + /// /// /// The cancellation token. /// - public static async Task DeleteAsync(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, sensitivityLabelSource, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Disables sensitivity recommendations on a given column + /// Creates or updates the sensitivity label of a given column /// /// /// The operations group for this extension method. @@ -431,13 +424,16 @@ public static void Delete(this ISensitivityLabelsOperations operations, string r /// /// The name of the column. /// - public static void DisableRecommendation(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName) + /// + /// The column sensitivity label resource. + /// + public static SensitivityLabel CreateOrUpdate(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabel parameters) { - operations.DisableRecommendationAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName).GetAwaiter().GetResult(); + return operations.CreateOrUpdateAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, parameters).GetAwaiter().GetResult(); } /// - /// Disables sensitivity recommendations on a given column + /// Creates or updates the sensitivity label of a given column /// /// /// The operations group for this extension method. @@ -461,17 +457,22 @@ public static void DisableRecommendation(this ISensitivityLabelsOperations opera /// /// The name of the column. /// + /// + /// The column sensitivity label resource. + /// /// /// The cancellation token. /// - public static async Task DisableRecommendationAsync(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabel parameters, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DisableRecommendationWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Enables sensitivity recommendations on a given column (recommendations are - /// enabled by default on all columns) + /// Deletes the sensitivity label of a given column /// /// /// The operations group for this extension method. @@ -495,14 +496,13 @@ public static void DisableRecommendation(this ISensitivityLabelsOperations opera /// /// The name of the column. /// - public static void EnableRecommendation(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName) + public static void Delete(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName) { - operations.EnableRecommendationAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName).GetAwaiter().GetResult(); + operations.DeleteAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName).GetAwaiter().GetResult(); } /// - /// Enables sensitivity recommendations on a given column (recommendations are - /// enabled by default on all columns) + /// Deletes the sensitivity label of a given column /// /// /// The operations group for this extension method. @@ -529,63 +529,9 @@ public static void EnableRecommendation(this ISensitivityLabelsOperations operat /// /// The cancellation token. /// - public static async Task EnableRecommendationAsync(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.EnableRecommendationWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets the sensitivity labels of a given 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. - /// - /// - /// OData parameters to apply to the operation. - /// - public static IPage ListByDatabase(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, ODataQuery odataQuery = default(ODataQuery)) - { - return operations.ListByDatabaseAsync(resourceGroupName, serverName, databaseName, odataQuery).GetAwaiter().GetResult(); - } - - /// - /// Gets the sensitivity labels of a given 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. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByDatabaseAsync(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteAsync(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByDatabaseWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, odataQuery, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -656,39 +602,5 @@ public static IPage ListRecommendedByDatabaseNext(this ISensit } } - /// - /// Gets the sensitivity labels of a given database - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByDatabaseNext(this ISensitivityLabelsOperations operations, string nextPageLink) - { - return operations.ListByDatabaseNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets the sensitivity labels of a given database - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByDatabaseNextAsync(this ISensitivityLabelsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByDatabaseNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - } } diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SqlManagementClient.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SqlManagementClient.cs index c1831da0674c..d890c93ab830 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SqlManagementClient.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SqlManagementClient.cs @@ -102,6 +102,11 @@ public partial class SqlManagementClient : ServiceClient, I /// public virtual IElasticPoolsOperations ElasticPools { get; private set; } + /// + /// Gets the IReplicationLinksOperations. + /// + public virtual IReplicationLinksOperations ReplicationLinks { get; private set; } + /// /// Gets the IServerCommunicationLinksOperations. /// @@ -342,6 +347,16 @@ public partial class SqlManagementClient : ServiceClient, I /// public virtual IManagedDatabaseSecurityEventsOperations ManagedDatabaseSecurityEvents { get; private set; } + /// + /// Gets the IManagedDatabaseSensitivityLabelsOperations. + /// + public virtual IManagedDatabaseSensitivityLabelsOperations ManagedDatabaseSensitivityLabels { get; private set; } + + /// + /// Gets the IManagedDatabaseRecommendedSensitivityLabelsOperations. + /// + public virtual IManagedDatabaseRecommendedSensitivityLabelsOperations ManagedDatabaseRecommendedSensitivityLabels { get; private set; } + /// /// Gets the IManagedDatabaseTablesOperations. /// @@ -452,6 +467,16 @@ public partial class SqlManagementClient : ServiceClient, I /// public virtual IRestorePointsOperations RestorePoints { get; private set; } + /// + /// Gets the ISensitivityLabelsOperations. + /// + public virtual ISensitivityLabelsOperations SensitivityLabels { get; private set; } + + /// + /// Gets the IRecommendedSensitivityLabelsOperations. + /// + public virtual IRecommendedSensitivityLabelsOperations RecommendedSensitivityLabels { get; private set; } + /// /// Gets the IServerAdvisorsOperations. /// @@ -652,36 +677,6 @@ public partial class SqlManagementClient : ServiceClient, I /// public virtual IIPv6FirewallRulesOperations IPv6FirewallRules { get; private set; } - /// - /// Gets the IReplicationLinksOperations. - /// - public virtual IReplicationLinksOperations ReplicationLinks { get; private set; } - - /// - /// Gets the IManagedDatabaseSensitivityLabelsOperations. - /// - public virtual IManagedDatabaseSensitivityLabelsOperations ManagedDatabaseSensitivityLabels { get; private set; } - - /// - /// Gets the IManagedDatabaseRecommendedSensitivityLabelsOperations. - /// - public virtual IManagedDatabaseRecommendedSensitivityLabelsOperations ManagedDatabaseRecommendedSensitivityLabels { get; private set; } - - /// - /// Gets the IManagedServerDnsAliasesOperations. - /// - public virtual IManagedServerDnsAliasesOperations ManagedServerDnsAliases { get; private set; } - - /// - /// Gets the ISensitivityLabelsOperations. - /// - public virtual ISensitivityLabelsOperations SensitivityLabels { get; private set; } - - /// - /// Gets the IRecommendedSensitivityLabelsOperations. - /// - public virtual IRecommendedSensitivityLabelsOperations RecommendedSensitivityLabels { get; private set; } - /// /// Gets the IEndpointCertificatesOperations. /// @@ -934,6 +929,7 @@ private void Initialize() GeoBackupPolicies = new GeoBackupPoliciesOperations(this); Databases = new DatabasesOperations(this); ElasticPools = new ElasticPoolsOperations(this); + ReplicationLinks = new ReplicationLinksOperations(this); ServerCommunicationLinks = new ServerCommunicationLinksOperations(this); ServiceObjectives = new ServiceObjectivesOperations(this); ElasticPoolActivities = new ElasticPoolActivitiesOperations(this); @@ -982,6 +978,8 @@ private void Initialize() ManagedDatabaseSchemas = new ManagedDatabaseSchemasOperations(this); ManagedDatabaseSecurityAlertPolicies = new ManagedDatabaseSecurityAlertPoliciesOperations(this); ManagedDatabaseSecurityEvents = new ManagedDatabaseSecurityEventsOperations(this); + ManagedDatabaseSensitivityLabels = new ManagedDatabaseSensitivityLabelsOperations(this); + ManagedDatabaseRecommendedSensitivityLabels = new ManagedDatabaseRecommendedSensitivityLabelsOperations(this); ManagedDatabaseTables = new ManagedDatabaseTablesOperations(this); ManagedDatabaseTransparentDataEncryption = new ManagedDatabaseTransparentDataEncryptionOperations(this); ManagedDatabaseVulnerabilityAssessmentRuleBaselines = new ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations(this); @@ -1004,6 +1002,8 @@ private void Initialize() PrivateLinkResources = new PrivateLinkResourcesOperations(this); RecoverableManagedDatabases = new RecoverableManagedDatabasesOperations(this); RestorePoints = new RestorePointsOperations(this); + SensitivityLabels = new SensitivityLabelsOperations(this); + RecommendedSensitivityLabels = new RecommendedSensitivityLabelsOperations(this); ServerAdvisors = new ServerAdvisorsOperations(this); ServerAutomaticTuning = new ServerAutomaticTuningOperations(this); ServerAzureADAdministrators = new ServerAzureADAdministratorsOperations(this); @@ -1044,12 +1044,6 @@ private void Initialize() DistributedAvailabilityGroups = new DistributedAvailabilityGroupsOperations(this); ServerTrustCertificates = new ServerTrustCertificatesOperations(this); IPv6FirewallRules = new IPv6FirewallRulesOperations(this); - ReplicationLinks = new ReplicationLinksOperations(this); - ManagedDatabaseSensitivityLabels = new ManagedDatabaseSensitivityLabelsOperations(this); - ManagedDatabaseRecommendedSensitivityLabels = new ManagedDatabaseRecommendedSensitivityLabelsOperations(this); - ManagedServerDnsAliases = new ManagedServerDnsAliasesOperations(this); - SensitivityLabels = new SensitivityLabelsOperations(this); - RecommendedSensitivityLabels = new RecommendedSensitivityLabelsOperations(this); EndpointCertificates = new EndpointCertificatesOperations(this); BaseUri = new System.Uri("https://management.azure.com"); AcceptLanguage = "en-US"; From ebe420e780be965ce75dcc1ddd9b39bcc1564119 Mon Sep 17 00:00:00 2001 From: Bogdan Ostojic Date: Wed, 20 Apr 2022 14:52:20 +0200 Subject: [PATCH 06/10] run generate.ps1, take 2 --- .../Generated/IIPv6FirewallRulesOperations.cs | 36 +- .../Generated/IPv6FirewallRulesOperations.cs | 180 ++-- .../IPv6FirewallRulesOperationsExtensions.cs | 78 +- .../Generated/IReplicationLinksOperations.cs | 242 +---- .../src/Generated/ISqlManagementClient.cs | 50 +- .../src/Generated/Models/Database.cs | 13 +- .../src/Generated/Models/DatabaseIdentity.cs | 12 +- .../src/Generated/Models/DatabaseUpdate.cs | 13 +- .../src/Generated/Models/Delegation.cs | 63 -- .../Generated/Models/IPv6FirewallRuleList.cs | 51 - .../src/Generated/Models/UnlinkParameters.cs | 53 - .../Generated/ReplicationLinksOperations.cs | 952 +----------------- .../ReplicationLinksOperationsExtensions.cs | 399 +------- .../Generated/SdkInfo_SqlManagementClient.cs | 5 +- .../src/Generated/SqlManagementClient.cs | 60 +- 15 files changed, 262 insertions(+), 1945 deletions(-) delete mode 100644 sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/Delegation.cs delete mode 100644 sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/IPv6FirewallRuleList.cs delete mode 100644 sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/UnlinkParameters.cs diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IIPv6FirewallRulesOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IIPv6FirewallRulesOperations.cs index b083f7fbd36b..67df5526acaf 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IIPv6FirewallRulesOperations.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IIPv6FirewallRulesOperations.cs @@ -24,7 +24,7 @@ namespace Microsoft.Azure.Management.Sql public partial interface IIPv6FirewallRulesOperations { /// - /// Gets an IPv6 firewall rule. + /// Gets a list of IPv6 firewall rules. /// /// /// The name of the resource group that contains the resource. You can @@ -34,9 +34,6 @@ public partial interface IIPv6FirewallRulesOperations /// /// The name of the server. /// - /// - /// The name of the firewall rule. - /// /// /// The headers that will be added to request. /// @@ -52,9 +49,9 @@ public partial interface IIPv6FirewallRulesOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string firewallRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates an IPv6 firewall rule. + /// Gets an IPv6 firewall rule. /// /// /// The name of the resource group that contains the resource. You can @@ -67,10 +64,6 @@ public partial interface IIPv6FirewallRulesOperations /// /// The name of the firewall rule. /// - /// - /// The required parameters for creating or updating an IPv6 firewall - /// rule. - /// /// /// The headers that will be added to request. /// @@ -86,9 +79,9 @@ public partial interface IIPv6FirewallRulesOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string firewallRuleName, IPv6FirewallRule parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string firewallRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes an IPv6 firewall rule. + /// Creates or updates an IPv6 firewall rule. /// /// /// The name of the resource group that contains the resource. You can @@ -101,6 +94,10 @@ public partial interface IIPv6FirewallRulesOperations /// /// The name of the firewall rule. /// + /// + /// The required parameters for creating or updating an IPv6 firewall + /// rule. + /// /// /// The headers that will be added to request. /// @@ -110,12 +107,15 @@ public partial interface IIPv6FirewallRulesOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string firewallRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string firewallRuleName, IPv6FirewallRule parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets a list of IPv6 firewall rules. + /// Deletes an IPv6 firewall rule. /// /// /// The name of the resource group that contains the resource. You can @@ -125,6 +125,9 @@ public partial interface IIPv6FirewallRulesOperations /// /// The name of the server. /// + /// + /// The name of the firewall rule. + /// /// /// The headers that will be added to request. /// @@ -134,13 +137,10 @@ public partial interface IIPv6FirewallRulesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - Task>> ListByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string firewallRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets a list of IPv6 firewall rules. /// diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IPv6FirewallRulesOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IPv6FirewallRulesOperations.cs index a11276bd290d..796a2a063278 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IPv6FirewallRulesOperations.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IPv6FirewallRulesOperations.cs @@ -51,7 +51,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) public SqlManagementClient Client { get; private set; } /// - /// Gets an IPv6 firewall rule. + /// Gets a list of IPv6 firewall rules. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -60,9 +60,6 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) /// /// The name of the server. /// - /// - /// The name of the firewall rule. - /// /// /// Headers that will be added to request. /// @@ -84,7 +81,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string firewallRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -94,15 +91,11 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); } - if (firewallRuleName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "firewallRuleName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01-preview"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -112,17 +105,15 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serverName", serverName); - tracingParameters.Add("firewallRuleName", firewallRuleName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByServer", 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}/ipv6FirewallRules/{firewallRuleName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); - _url = _url.Replace("{firewallRuleName}", System.Uri.EscapeDataString(firewallRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -222,7 +213,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -235,7 +226,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -255,7 +246,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) } /// - /// Creates or updates an IPv6 firewall rule. + /// Gets an IPv6 firewall rule. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -267,9 +258,6 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) /// /// The name of the firewall rule. /// - /// - /// The required parameters for creating or updating an IPv6 firewall rule. - /// /// /// Headers that will be added to request. /// @@ -291,7 +279,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string firewallRuleName, IPv6FirewallRule parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string firewallRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -305,15 +293,11 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "firewallRuleName"); } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01-preview"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -324,10 +308,9 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serverName", serverName); tracingParameters.Add("firewallRuleName", firewallRuleName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -348,7 +331,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -379,12 +362,6 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) // Serialize Request string _requestContent = null; - if(parameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -405,7 +382,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -465,24 +442,6 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -491,7 +450,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) } /// - /// Deletes an IPv6 firewall rule. + /// Creates or updates an IPv6 firewall rule. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -503,6 +462,9 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) /// /// The name of the firewall rule. /// + /// + /// The required parameters for creating or updating an IPv6 firewall rule. + /// /// /// Headers that will be added to request. /// @@ -512,6 +474,9 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -521,7 +486,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string firewallRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string firewallRuleName, IPv6FirewallRule parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -535,11 +500,15 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "firewallRuleName"); } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01-preview"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -550,9 +519,10 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serverName", serverName); tracingParameters.Add("firewallRuleName", firewallRuleName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -573,7 +543,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -604,6 +574,12 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) // Serialize Request string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -624,7 +600,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -659,13 +635,49 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -674,7 +686,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) } /// - /// Gets a list of IPv6 firewall rules. + /// Deletes an IPv6 firewall rule. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -683,6 +695,9 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) /// /// The name of the server. /// + /// + /// The name of the firewall rule. + /// /// /// Headers that will be added to request. /// @@ -692,9 +707,6 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -704,7 +716,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string firewallRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -714,11 +726,15 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); } + if (firewallRuleName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "firewallRuleName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01-preview"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -728,15 +744,17 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serverName", serverName); + tracingParameters.Add("firewallRuleName", firewallRuleName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByServer", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); + _url = _url.Replace("{firewallRuleName}", System.Uri.EscapeDataString(firewallRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -750,7 +768,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -801,7 +819,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -836,31 +854,13 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _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); diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IPv6FirewallRulesOperationsExtensions.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IPv6FirewallRulesOperationsExtensions.cs index e632d77599d7..487adb33c94e 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IPv6FirewallRulesOperationsExtensions.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IPv6FirewallRulesOperationsExtensions.cs @@ -22,7 +22,7 @@ namespace Microsoft.Azure.Management.Sql public static partial class IPv6FirewallRulesOperationsExtensions { /// - /// Gets an IPv6 firewall rule. + /// Gets a list of IPv6 firewall rules. /// /// /// The operations group for this extension method. @@ -34,16 +34,13 @@ public static partial class IPv6FirewallRulesOperationsExtensions /// /// The name of the server. /// - /// - /// The name of the firewall rule. - /// - public static IPv6FirewallRule Get(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, string firewallRuleName) + public static IPage ListByServer(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName) { - return operations.GetAsync(resourceGroupName, serverName, firewallRuleName).GetAwaiter().GetResult(); + return operations.ListByServerAsync(resourceGroupName, serverName).GetAwaiter().GetResult(); } /// - /// Gets an IPv6 firewall rule. + /// Gets a list of IPv6 firewall rules. /// /// /// The operations group for this extension method. @@ -55,22 +52,19 @@ public static IPv6FirewallRule Get(this IIPv6FirewallRulesOperations operations, /// /// The name of the server. /// - /// - /// The name of the firewall rule. - /// /// /// The cancellation token. /// - public static async Task GetAsync(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, string firewallRuleName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByServerAsync(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serverName, firewallRuleName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByServerWithHttpMessagesAsync(resourceGroupName, serverName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Creates or updates an IPv6 firewall rule. + /// Gets an IPv6 firewall rule. /// /// /// The operations group for this extension method. @@ -85,16 +79,13 @@ public static IPv6FirewallRule Get(this IIPv6FirewallRulesOperations operations, /// /// The name of the firewall rule. /// - /// - /// The required parameters for creating or updating an IPv6 firewall rule. - /// - public static IPv6FirewallRule CreateOrUpdate(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, string firewallRuleName, IPv6FirewallRule parameters) + public static IPv6FirewallRule Get(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, string firewallRuleName) { - return operations.CreateOrUpdateAsync(resourceGroupName, serverName, firewallRuleName, parameters).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, serverName, firewallRuleName).GetAwaiter().GetResult(); } /// - /// Creates or updates an IPv6 firewall rule. + /// Gets an IPv6 firewall rule. /// /// /// The operations group for this extension method. @@ -109,22 +100,19 @@ public static IPv6FirewallRule CreateOrUpdate(this IIPv6FirewallRulesOperations /// /// The name of the firewall rule. /// - /// - /// The required parameters for creating or updating an IPv6 firewall rule. - /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, string firewallRuleName, IPv6FirewallRule parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, string firewallRuleName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, firewallRuleName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serverName, firewallRuleName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Deletes an IPv6 firewall rule. + /// Creates or updates an IPv6 firewall rule. /// /// /// The operations group for this extension method. @@ -139,13 +127,16 @@ public static IPv6FirewallRule CreateOrUpdate(this IIPv6FirewallRulesOperations /// /// The name of the firewall rule. /// - public static void Delete(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, string firewallRuleName) + /// + /// The required parameters for creating or updating an IPv6 firewall rule. + /// + public static IPv6FirewallRule CreateOrUpdate(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, string firewallRuleName, IPv6FirewallRule parameters) { - operations.DeleteAsync(resourceGroupName, serverName, firewallRuleName).GetAwaiter().GetResult(); + return operations.CreateOrUpdateAsync(resourceGroupName, serverName, firewallRuleName, parameters).GetAwaiter().GetResult(); } /// - /// Deletes an IPv6 firewall rule. + /// Creates or updates an IPv6 firewall rule. /// /// /// The operations group for this extension method. @@ -160,16 +151,22 @@ public static void Delete(this IIPv6FirewallRulesOperations operations, string r /// /// The name of the firewall rule. /// + /// + /// The required parameters for creating or updating an IPv6 firewall rule. + /// /// /// The cancellation token. /// - public static async Task DeleteAsync(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, string firewallRuleName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, string firewallRuleName, IPv6FirewallRule parameters, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serverName, firewallRuleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, firewallRuleName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Gets a list of IPv6 firewall rules. + /// Deletes an IPv6 firewall rule. /// /// /// The operations group for this extension method. @@ -181,13 +178,16 @@ public static void Delete(this IIPv6FirewallRulesOperations operations, string r /// /// The name of the server. /// - public static IPage ListByServer(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName) + /// + /// The name of the firewall rule. + /// + public static void Delete(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, string firewallRuleName) { - return operations.ListByServerAsync(resourceGroupName, serverName).GetAwaiter().GetResult(); + operations.DeleteAsync(resourceGroupName, serverName, firewallRuleName).GetAwaiter().GetResult(); } /// - /// Gets a list of IPv6 firewall rules. + /// Deletes an IPv6 firewall rule. /// /// /// The operations group for this extension method. @@ -199,15 +199,15 @@ public static IPage ListByServer(this IIPv6FirewallRulesOperat /// /// The name of the server. /// + /// + /// The name of the firewall rule. + /// /// /// The cancellation token. /// - public static async Task> ListByServerAsync(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteAsync(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, string firewallRuleName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByServerWithHttpMessagesAsync(resourceGroupName, serverName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serverName, firewallRuleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IReplicationLinksOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IReplicationLinksOperations.cs index 8e46eb06c69a..aa8b7dd64f9f 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IReplicationLinksOperations.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IReplicationLinksOperations.cs @@ -24,39 +24,7 @@ namespace Microsoft.Azure.Management.Sql public partial interface IReplicationLinksOperations { /// - /// Deletes a database replication link. Cannot be done during - /// failover. - /// - /// - /// 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 that has the replication link to be - /// dropped. - /// - /// - /// The ID of the replication link to be deleted. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets a replication link. + /// Gets a list of replication links on database. /// /// /// The name of the resource group that contains the resource. You can @@ -69,9 +37,6 @@ public partial interface IReplicationLinksOperations /// /// The name of the database. /// - /// - /// The name of the replication link. - /// /// /// The headers that will be added to request. /// @@ -87,74 +52,9 @@ public partial interface IReplicationLinksOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Sets which replica database is primary by failing over from the - /// current primary replica 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 that has the replication link to be failed - /// over. - /// - /// - /// The ID of the replication link to be failed over. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task FailoverWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Sets which replica database is primary by failing over from the - /// current primary replica database. This operation might result in - /// data loss. - /// - /// - /// 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 that has the replication link to be failed - /// over. - /// - /// - /// The ID of the replication link to be failed over. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task FailoverAllowDataLossWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes a database replication link in forced or friendly way. + /// Gets a replication link. /// /// /// The name of the resource group that contains the resource. You can @@ -165,41 +65,10 @@ public partial interface IReplicationLinksOperations /// The name of the server. /// /// - /// The name of the database that has the replication link to be failed - /// over. + /// The name of the database. /// /// - /// The ID of the replication link to be failed over. - /// - /// - /// The required parameters for unlinking replication link. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task UnlinkWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, UnlinkParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets a list of replication links on 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 name of the replication link. /// /// /// The headers that will be added to request. @@ -216,7 +85,7 @@ public partial interface IReplicationLinksOperations /// /// Thrown when a required parameter is null /// - Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets a list of replication links. /// @@ -245,105 +114,6 @@ public partial interface IReplicationLinksOperations /// Task>> ListByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Sets which replica database is primary by failing over from the - /// current primary replica 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 that has the replication link to be failed - /// over. - /// - /// - /// The ID of the replication link to be failed over. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task BeginFailoverWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Sets which replica database is primary by failing over from the - /// current primary replica database. This operation might result in - /// data loss. - /// - /// - /// 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 that has the replication link to be failed - /// over. - /// - /// - /// The ID of the replication link to be failed over. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task BeginFailoverAllowDataLossWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes a database replication link in forced or friendly way. - /// - /// - /// 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 that has the replication link to be failed - /// over. - /// - /// - /// The ID of the replication link to be failed over. - /// - /// - /// The required parameters for unlinking replication link. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task BeginUnlinkWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, UnlinkParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Gets a list of replication links on database. /// /// diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ISqlManagementClient.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ISqlManagementClient.cs index 357f5bd4c057..30e761ee9ff3 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ISqlManagementClient.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ISqlManagementClient.cs @@ -97,11 +97,6 @@ public partial interface ISqlManagementClient : System.IDisposable /// IElasticPoolsOperations ElasticPools { get; } - /// - /// Gets the IReplicationLinksOperations. - /// - IReplicationLinksOperations ReplicationLinks { get; } - /// /// Gets the IServerCommunicationLinksOperations. /// @@ -342,16 +337,6 @@ public partial interface ISqlManagementClient : System.IDisposable /// IManagedDatabaseSecurityEventsOperations ManagedDatabaseSecurityEvents { get; } - /// - /// Gets the IManagedDatabaseSensitivityLabelsOperations. - /// - IManagedDatabaseSensitivityLabelsOperations ManagedDatabaseSensitivityLabels { get; } - - /// - /// Gets the IManagedDatabaseRecommendedSensitivityLabelsOperations. - /// - IManagedDatabaseRecommendedSensitivityLabelsOperations ManagedDatabaseRecommendedSensitivityLabels { get; } - /// /// Gets the IManagedDatabaseTablesOperations. /// @@ -462,16 +447,6 @@ public partial interface ISqlManagementClient : System.IDisposable /// IRestorePointsOperations RestorePoints { get; } - /// - /// Gets the ISensitivityLabelsOperations. - /// - ISensitivityLabelsOperations SensitivityLabels { get; } - - /// - /// Gets the IRecommendedSensitivityLabelsOperations. - /// - IRecommendedSensitivityLabelsOperations RecommendedSensitivityLabels { get; } - /// /// Gets the IServerAdvisorsOperations. /// @@ -677,5 +652,30 @@ public partial interface ISqlManagementClient : System.IDisposable /// IEndpointCertificatesOperations EndpointCertificates { get; } + /// + /// Gets the IReplicationLinksOperations. + /// + IReplicationLinksOperations ReplicationLinks { get; } + + /// + /// Gets the IManagedDatabaseSensitivityLabelsOperations. + /// + IManagedDatabaseSensitivityLabelsOperations ManagedDatabaseSensitivityLabels { get; } + + /// + /// Gets the IManagedDatabaseRecommendedSensitivityLabelsOperations. + /// + IManagedDatabaseRecommendedSensitivityLabelsOperations ManagedDatabaseRecommendedSensitivityLabels { get; } + + /// + /// Gets the ISensitivityLabelsOperations. + /// + ISensitivityLabelsOperations SensitivityLabels { get; } + + /// + /// Gets the IRecommendedSensitivityLabelsOperations. + /// + IRecommendedSensitivityLabelsOperations RecommendedSensitivityLabels { get; } + } } diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/Database.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/Database.cs index c5c3c64c7a2f..f282d44290f1 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/Database.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/Database.cs @@ -206,9 +206,6 @@ public Database() /// for this database. /// The Client id used for cross tenant /// per database CMK scenario - /// The Primary - /// Delegated Identity Client id used for per database CMK - for - /// internal use only /// The resource identifier of the /// source associated with the create operation of this database. /// @@ -236,7 +233,7 @@ public Database() /// “x-ms-authorization-auxiliary” header see /// https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/authenticate-multi-tenant /// - public Database(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), Sku sku = default(Sku), string kind = default(string), string managedBy = default(string), DatabaseIdentity identity = default(DatabaseIdentity), string createMode = default(string), string collation = default(string), long? maxSizeBytes = default(long?), string sampleName = default(string), string elasticPoolId = default(string), string sourceDatabaseId = default(string), string status = default(string), System.Guid? databaseId = default(System.Guid?), System.DateTime? creationDate = default(System.DateTime?), string currentServiceObjectiveName = default(string), string requestedServiceObjectiveName = default(string), string defaultSecondaryLocation = default(string), string failoverGroupId = default(string), System.DateTime? restorePointInTime = default(System.DateTime?), System.DateTime? sourceDatabaseDeletionDate = default(System.DateTime?), string recoveryServicesRecoveryPointId = default(string), string longTermRetentionBackupResourceId = default(string), string recoverableDatabaseId = default(string), string restorableDroppedDatabaseId = default(string), string catalogCollation = default(string), bool? zoneRedundant = default(bool?), string licenseType = default(string), long? maxLogSizeBytes = default(long?), System.DateTime? earliestRestoreDate = default(System.DateTime?), string readScale = default(string), int? highAvailabilityReplicaCount = default(int?), string secondaryType = default(string), Sku currentSku = default(Sku), int? autoPauseDelay = default(int?), string currentBackupStorageRedundancy = default(string), string requestedBackupStorageRedundancy = default(string), double? minCapacity = default(double?), System.DateTime? pausedDate = default(System.DateTime?), System.DateTime? resumedDate = default(System.DateTime?), string maintenanceConfigurationId = default(string), bool? isLedgerOn = default(bool?), bool? isInfraEncryptionEnabled = default(bool?), System.Guid? federatedClientId = default(System.Guid?), System.Guid? primaryDelegatedIdentityClientId = default(System.Guid?), string sourceResourceId = default(string)) + public Database(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), Sku sku = default(Sku), string kind = default(string), string managedBy = default(string), DatabaseIdentity identity = default(DatabaseIdentity), string createMode = default(string), string collation = default(string), long? maxSizeBytes = default(long?), string sampleName = default(string), string elasticPoolId = default(string), string sourceDatabaseId = default(string), string status = default(string), System.Guid? databaseId = default(System.Guid?), System.DateTime? creationDate = default(System.DateTime?), string currentServiceObjectiveName = default(string), string requestedServiceObjectiveName = default(string), string defaultSecondaryLocation = default(string), string failoverGroupId = default(string), System.DateTime? restorePointInTime = default(System.DateTime?), System.DateTime? sourceDatabaseDeletionDate = default(System.DateTime?), string recoveryServicesRecoveryPointId = default(string), string longTermRetentionBackupResourceId = default(string), string recoverableDatabaseId = default(string), string restorableDroppedDatabaseId = default(string), string catalogCollation = default(string), bool? zoneRedundant = default(bool?), string licenseType = default(string), long? maxLogSizeBytes = default(long?), System.DateTime? earliestRestoreDate = default(System.DateTime?), string readScale = default(string), int? highAvailabilityReplicaCount = default(int?), string secondaryType = default(string), Sku currentSku = default(Sku), int? autoPauseDelay = default(int?), string currentBackupStorageRedundancy = default(string), string requestedBackupStorageRedundancy = default(string), double? minCapacity = default(double?), System.DateTime? pausedDate = default(System.DateTime?), System.DateTime? resumedDate = default(System.DateTime?), string maintenanceConfigurationId = default(string), bool? isLedgerOn = default(bool?), bool? isInfraEncryptionEnabled = default(bool?), System.Guid? federatedClientId = default(System.Guid?), string sourceResourceId = default(string)) : base(location, id, name, type, tags) { Sku = sku; @@ -281,7 +278,6 @@ public Database() IsLedgerOn = isLedgerOn; IsInfraEncryptionEnabled = isInfraEncryptionEnabled; FederatedClientId = federatedClientId; - PrimaryDelegatedIdentityClientId = primaryDelegatedIdentityClientId; SourceResourceId = sourceResourceId; CustomInit(); } @@ -644,13 +640,6 @@ public Database() [JsonProperty(PropertyName = "properties.federatedClientId")] public System.Guid? FederatedClientId { get; set; } - /// - /// Gets or sets the Primary Delegated Identity Client id used for per - /// database CMK - for internal use only - /// - [JsonProperty(PropertyName = "properties.primaryDelegatedIdentityClientId")] - public System.Guid? PrimaryDelegatedIdentityClientId { get; set; } - /// /// Gets or sets the resource identifier of the source associated with /// the create operation of this database. diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/DatabaseIdentity.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/DatabaseIdentity.cs index 32e614559602..56dc6a20bea4 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/DatabaseIdentity.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/DatabaseIdentity.cs @@ -37,14 +37,11 @@ public DatabaseIdentity() /// id. /// The resource ids of the user /// assigned identities to use - /// Resources delegated to the - /// database - Internal Use Only - public DatabaseIdentity(string type = default(string), System.Guid? tenantId = default(System.Guid?), IDictionary userAssignedIdentities = default(IDictionary), IDictionary delegatedResources = default(IDictionary)) + public DatabaseIdentity(string type = default(string), System.Guid? tenantId = default(System.Guid?), IDictionary userAssignedIdentities = default(IDictionary)) { Type = type; TenantId = tenantId; UserAssignedIdentities = userAssignedIdentities; - DelegatedResources = delegatedResources; CustomInit(); } @@ -73,12 +70,5 @@ public DatabaseIdentity() [JsonProperty(PropertyName = "userAssignedIdentities")] public IDictionary UserAssignedIdentities { get; set; } - /// - /// Gets or sets resources delegated to the database - Internal Use - /// Only - /// - [JsonProperty(PropertyName = "delegatedResources")] - public IDictionary DelegatedResources { get; set; } - } } diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/DatabaseUpdate.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/DatabaseUpdate.cs index 7f880478b16a..fad5a1679c9c 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/DatabaseUpdate.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/DatabaseUpdate.cs @@ -182,11 +182,8 @@ public DatabaseUpdate() /// for this database. /// The Client id used for cross tenant /// per database CMK scenario - /// The Primary - /// Delegated Identity Client id used for per database CMK - for - /// internal use only /// Resource tags. - public DatabaseUpdate(Sku sku = default(Sku), DatabaseIdentity identity = default(DatabaseIdentity), string createMode = default(string), string collation = default(string), long? maxSizeBytes = default(long?), string sampleName = default(string), string elasticPoolId = default(string), string sourceDatabaseId = default(string), string status = default(string), System.Guid? databaseId = default(System.Guid?), System.DateTime? creationDate = default(System.DateTime?), string currentServiceObjectiveName = default(string), string requestedServiceObjectiveName = default(string), string defaultSecondaryLocation = default(string), string failoverGroupId = default(string), System.DateTime? restorePointInTime = default(System.DateTime?), System.DateTime? sourceDatabaseDeletionDate = default(System.DateTime?), string recoveryServicesRecoveryPointId = default(string), string longTermRetentionBackupResourceId = default(string), string recoverableDatabaseId = default(string), string restorableDroppedDatabaseId = default(string), string catalogCollation = default(string), bool? zoneRedundant = default(bool?), string licenseType = default(string), long? maxLogSizeBytes = default(long?), System.DateTime? earliestRestoreDate = default(System.DateTime?), string readScale = default(string), int? highAvailabilityReplicaCount = default(int?), string secondaryType = default(string), Sku currentSku = default(Sku), int? autoPauseDelay = default(int?), string currentBackupStorageRedundancy = default(string), string requestedBackupStorageRedundancy = default(string), double? minCapacity = default(double?), System.DateTime? pausedDate = default(System.DateTime?), System.DateTime? resumedDate = default(System.DateTime?), string maintenanceConfigurationId = default(string), bool? isLedgerOn = default(bool?), bool? isInfraEncryptionEnabled = default(bool?), System.Guid? federatedClientId = default(System.Guid?), System.Guid? primaryDelegatedIdentityClientId = default(System.Guid?), IDictionary tags = default(IDictionary)) + public DatabaseUpdate(Sku sku = default(Sku), DatabaseIdentity identity = default(DatabaseIdentity), string createMode = default(string), string collation = default(string), long? maxSizeBytes = default(long?), string sampleName = default(string), string elasticPoolId = default(string), string sourceDatabaseId = default(string), string status = default(string), System.Guid? databaseId = default(System.Guid?), System.DateTime? creationDate = default(System.DateTime?), string currentServiceObjectiveName = default(string), string requestedServiceObjectiveName = default(string), string defaultSecondaryLocation = default(string), string failoverGroupId = default(string), System.DateTime? restorePointInTime = default(System.DateTime?), System.DateTime? sourceDatabaseDeletionDate = default(System.DateTime?), string recoveryServicesRecoveryPointId = default(string), string longTermRetentionBackupResourceId = default(string), string recoverableDatabaseId = default(string), string restorableDroppedDatabaseId = default(string), string catalogCollation = default(string), bool? zoneRedundant = default(bool?), string licenseType = default(string), long? maxLogSizeBytes = default(long?), System.DateTime? earliestRestoreDate = default(System.DateTime?), string readScale = default(string), int? highAvailabilityReplicaCount = default(int?), string secondaryType = default(string), Sku currentSku = default(Sku), int? autoPauseDelay = default(int?), string currentBackupStorageRedundancy = default(string), string requestedBackupStorageRedundancy = default(string), double? minCapacity = default(double?), System.DateTime? pausedDate = default(System.DateTime?), System.DateTime? resumedDate = default(System.DateTime?), string maintenanceConfigurationId = default(string), bool? isLedgerOn = default(bool?), bool? isInfraEncryptionEnabled = default(bool?), System.Guid? federatedClientId = default(System.Guid?), IDictionary tags = default(IDictionary)) { Sku = sku; Identity = identity; @@ -228,7 +225,6 @@ public DatabaseUpdate() IsLedgerOn = isLedgerOn; IsInfraEncryptionEnabled = isInfraEncryptionEnabled; FederatedClientId = federatedClientId; - PrimaryDelegatedIdentityClientId = primaryDelegatedIdentityClientId; Tags = tags; CustomInit(); } @@ -563,13 +559,6 @@ public DatabaseUpdate() [JsonProperty(PropertyName = "properties.federatedClientId")] public System.Guid? FederatedClientId { get; set; } - /// - /// Gets or sets the Primary Delegated Identity Client id used for per - /// database CMK - for internal use only - /// - [JsonProperty(PropertyName = "properties.primaryDelegatedIdentityClientId")] - public System.Guid? PrimaryDelegatedIdentityClientId { get; set; } - /// /// Gets or sets resource tags. /// diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/Delegation.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/Delegation.cs deleted file mode 100644 index 0bc3e28727ee..000000000000 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/Delegation.cs +++ /dev/null @@ -1,63 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Sql.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Delegated Resource Properties - Internal Use Only - /// - public partial class Delegation - { - /// - /// Initializes a new instance of the Delegation class. - /// - public Delegation() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Delegation class. - /// - /// The resource id of the source resource - - /// Internal Use Only - /// AAD tenant guid of the source resource - /// identity - Internal Use Only. - public Delegation(string resourceId = default(string), System.Guid? tenantId = default(System.Guid?)) - { - ResourceId = resourceId; - TenantId = tenantId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the resource id of the source resource - Internal Use - /// Only - /// - [JsonProperty(PropertyName = "resourceId")] - public string ResourceId { get; set; } - - /// - /// Gets AAD tenant guid of the source resource identity - Internal Use - /// Only. - /// - [JsonProperty(PropertyName = "tenantId")] - public System.Guid? TenantId { get; private set; } - - } -} diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/IPv6FirewallRuleList.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/IPv6FirewallRuleList.cs deleted file mode 100644 index 9797c1a9fdc4..000000000000 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/IPv6FirewallRuleList.cs +++ /dev/null @@ -1,51 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Sql.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// A list of IPv6 server firewall rules. - /// - public partial class IPv6FirewallRuleList - { - /// - /// Initializes a new instance of the IPv6FirewallRuleList class. - /// - public IPv6FirewallRuleList() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the IPv6FirewallRuleList class. - /// - public IPv6FirewallRuleList(IList values = default(IList)) - { - Values = values; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "values")] - public IList Values { get; set; } - - } -} diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/UnlinkParameters.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/UnlinkParameters.cs deleted file mode 100644 index 773e905009a0..000000000000 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/UnlinkParameters.cs +++ /dev/null @@ -1,53 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Sql.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Represents the parameters for Unlink Replication Link request. - /// - public partial class UnlinkParameters - { - /// - /// Initializes a new instance of the UnlinkParameters class. - /// - public UnlinkParameters() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the UnlinkParameters class. - /// - /// Determines whether link will be - /// terminated in a forced or a friendly way. - public UnlinkParameters(bool? forcedTermination = default(bool?)) - { - ForcedTermination = forcedTermination; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets determines whether link will be terminated in a forced - /// or a friendly way. - /// - [JsonProperty(PropertyName = "forcedTermination")] - public bool? ForcedTermination { get; set; } - - } -} diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ReplicationLinksOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ReplicationLinksOperations.cs index 64ddd37e63c9..0d2e8974e92a 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ReplicationLinksOperations.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ReplicationLinksOperations.cs @@ -51,7 +51,7 @@ internal ReplicationLinksOperations(SqlManagementClient client) public SqlManagementClient Client { get; private set; } /// - /// Deletes a database replication link. Cannot be done during failover. + /// Gets a list of replication links on database. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -61,10 +61,7 @@ internal ReplicationLinksOperations(SqlManagementClient client) /// The name of the server. /// /// - /// The name of the database that has the replication link to be dropped. - /// - /// - /// The ID of the replication link to be deleted. + /// The name of the database. /// /// /// Headers that will be added to request. @@ -75,6 +72,9 @@ internal ReplicationLinksOperations(SqlManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -84,12 +84,8 @@ internal ReplicationLinksOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -102,11 +98,11 @@ internal ReplicationLinksOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); } - if (linkId == null) + if (Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "linkId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2014-04-01"; + string apiVersion = "2021-02-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -114,22 +110,20 @@ internal ReplicationLinksOperations(SqlManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serverName", serverName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("linkId", linkId); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByDatabase", 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}/replicationLinks/{linkId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks").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("{linkId}", System.Uri.EscapeDataString(linkId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) { @@ -142,7 +136,7 @@ internal ReplicationLinksOperations(SqlManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -193,7 +187,7 @@ internal ReplicationLinksOperations(SqlManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -228,13 +222,31 @@ internal ReplicationLinksOperations(SqlManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _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); @@ -456,99 +468,7 @@ internal ReplicationLinksOperations(SqlManagementClient client) } /// - /// Sets which replica database is primary by failing over from the current - /// primary replica 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 that has the replication link to be failed over. - /// - /// - /// The ID of the replication link to be failed over. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task FailoverWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginFailoverWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Sets which replica database is primary by failing over from the current - /// primary replica database. This operation might result in data loss. - /// - /// - /// 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 that has the replication link to be failed over. - /// - /// - /// The ID of the replication link to be failed over. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task FailoverAllowDataLossWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginFailoverAllowDataLossWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes a database replication link in forced or friendly way. - /// - /// - /// 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 that has the replication link to be failed over. - /// - /// - /// The ID of the replication link to be failed over. - /// - /// - /// The required parameters for unlinking replication link. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task UnlinkWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, UnlinkParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginUnlinkWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets a list of replication links on database. + /// Gets a list of replication links. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -557,9 +477,6 @@ internal ReplicationLinksOperations(SqlManagementClient client) /// /// The name of the server. /// - /// - /// The name of the database. - /// /// /// Headers that will be added to request. /// @@ -581,7 +498,7 @@ internal ReplicationLinksOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -591,10 +508,6 @@ internal ReplicationLinksOperations(SqlManagementClient client) { 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"); @@ -609,17 +522,15 @@ internal ReplicationLinksOperations(SqlManagementClient client) 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, "ListByDatabase", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByServer", 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}/replicationLinks").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/replicationLinks").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) @@ -751,793 +662,6 @@ internal ReplicationLinksOperations(SqlManagementClient client) return _result; } - /// - /// Gets a list of replication links. - /// - /// - /// 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>> ListByServerWithHttpMessagesAsync(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 = "2021-02-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, "ListByServer", 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}/replicationLinks").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; - } - - /// - /// Sets which replica database is primary by failing over from the current - /// primary replica 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 that has the replication link to be failed over. - /// - /// - /// The ID of the replication link to be failed over. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task BeginFailoverWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (serverName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (linkId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "linkId"); - } - string apiVersion = "2014-04-01"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("serverName", serverName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("linkId", linkId); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginFailover", 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}/replicationLinks/{linkId}/failover").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _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("{linkId}", System.Uri.EscapeDataString(linkId)); - 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("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 202 && (int)_statusCode != 204) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Sets which replica database is primary by failing over from the current - /// primary replica database. This operation might result in data loss. - /// - /// - /// 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 that has the replication link to be failed over. - /// - /// - /// The ID of the replication link to be failed over. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task BeginFailoverAllowDataLossWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (serverName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (linkId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "linkId"); - } - string apiVersion = "2014-04-01"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("serverName", serverName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("linkId", linkId); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginFailoverAllowDataLoss", 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}/replicationLinks/{linkId}/forceFailoverAllowDataLoss").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _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("{linkId}", System.Uri.EscapeDataString(linkId)); - 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("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 202 && (int)_statusCode != 204) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Deletes a database replication link in forced or friendly way. - /// - /// - /// 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 that has the replication link to be failed over. - /// - /// - /// The ID of the replication link to be failed over. - /// - /// - /// The required parameters for unlinking replication link. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task BeginUnlinkWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, UnlinkParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (serverName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (linkId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "linkId"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - string apiVersion = "2014-04-01"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("serverName", serverName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("linkId", linkId); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUnlink", 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}/replicationLinks/{linkId}/unlink").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _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("{linkId}", System.Uri.EscapeDataString(linkId)); - 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("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(parameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 202 && (int)_statusCode != 204) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - /// /// Gets a list of replication links on database. /// diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ReplicationLinksOperationsExtensions.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ReplicationLinksOperationsExtensions.cs index 5cfcc8702823..0706f8ca066f 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ReplicationLinksOperationsExtensions.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ReplicationLinksOperationsExtensions.cs @@ -22,7 +22,7 @@ namespace Microsoft.Azure.Management.Sql public static partial class ReplicationLinksOperationsExtensions { /// - /// Deletes a database replication link. Cannot be done during failover. + /// Gets a list of replication links on database. /// /// /// The operations group for this extension method. @@ -35,18 +35,15 @@ public static partial class ReplicationLinksOperationsExtensions /// The name of the server. /// /// - /// The name of the database that has the replication link to be dropped. - /// - /// - /// The ID of the replication link to be deleted. + /// The name of the database. /// - public static void Delete(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId) + public static IPage ListByDatabase(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName) { - operations.DeleteAsync(resourceGroupName, serverName, databaseName, linkId).GetAwaiter().GetResult(); + return operations.ListByDatabaseAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult(); } /// - /// Deletes a database replication link. Cannot be done during failover. + /// Gets a list of replication links on database. /// /// /// The operations group for this extension method. @@ -59,17 +56,17 @@ public static void Delete(this IReplicationLinksOperations operations, string re /// The name of the server. /// /// - /// The name of the database that has the replication link to be dropped. - /// - /// - /// The ID of the replication link to be deleted. + /// The name of the database. /// /// /// The cancellation token. /// - public static async Task DeleteAsync(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByDatabaseAsync(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.ListByDatabaseWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// @@ -126,217 +123,6 @@ public static ReplicationLink Get(this IReplicationLinksOperations operations, s } } - /// - /// Sets which replica database is primary by failing over from the current - /// primary replica 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 that has the replication link to be failed over. - /// - /// - /// The ID of the replication link to be failed over. - /// - public static void Failover(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId) - { - operations.FailoverAsync(resourceGroupName, serverName, databaseName, linkId).GetAwaiter().GetResult(); - } - - /// - /// Sets which replica database is primary by failing over from the current - /// primary replica 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 that has the replication link to be failed over. - /// - /// - /// The ID of the replication link to be failed over. - /// - /// - /// The cancellation token. - /// - public static async Task FailoverAsync(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.FailoverWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Sets which replica database is primary by failing over from the current - /// primary replica database. This operation might result in data loss. - /// - /// - /// 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 that has the replication link to be failed over. - /// - /// - /// The ID of the replication link to be failed over. - /// - public static void FailoverAllowDataLoss(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId) - { - operations.FailoverAllowDataLossAsync(resourceGroupName, serverName, databaseName, linkId).GetAwaiter().GetResult(); - } - - /// - /// Sets which replica database is primary by failing over from the current - /// primary replica database. This operation might result in data loss. - /// - /// - /// 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 that has the replication link to be failed over. - /// - /// - /// The ID of the replication link to be failed over. - /// - /// - /// The cancellation token. - /// - public static async Task FailoverAllowDataLossAsync(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.FailoverAllowDataLossWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Deletes a database replication link in forced or friendly way. - /// - /// - /// 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 that has the replication link to be failed over. - /// - /// - /// The ID of the replication link to be failed over. - /// - /// - /// The required parameters for unlinking replication link. - /// - public static void Unlink(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId, UnlinkParameters parameters) - { - operations.UnlinkAsync(resourceGroupName, serverName, databaseName, linkId, parameters).GetAwaiter().GetResult(); - } - - /// - /// Deletes a database replication link in forced or friendly way. - /// - /// - /// 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 that has the replication link to be failed over. - /// - /// - /// The ID of the replication link to be failed over. - /// - /// - /// The required parameters for unlinking replication link. - /// - /// - /// The cancellation token. - /// - public static async Task UnlinkAsync(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId, UnlinkParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.UnlinkWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets a list of replication links on 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. - /// - public static IPage ListByDatabase(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName) - { - return operations.ListByDatabaseAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult(); - } - - /// - /// Gets a list of replication links on 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 cancellation token. - /// - public static async Task> ListByDatabaseAsync(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByDatabaseWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Gets a list of replication links. /// @@ -379,169 +165,6 @@ public static IPage ListByServer(this IReplicationLinksOperatio } } - /// - /// Sets which replica database is primary by failing over from the current - /// primary replica 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 that has the replication link to be failed over. - /// - /// - /// The ID of the replication link to be failed over. - /// - public static void BeginFailover(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId) - { - operations.BeginFailoverAsync(resourceGroupName, serverName, databaseName, linkId).GetAwaiter().GetResult(); - } - - /// - /// Sets which replica database is primary by failing over from the current - /// primary replica 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 that has the replication link to be failed over. - /// - /// - /// The ID of the replication link to be failed over. - /// - /// - /// The cancellation token. - /// - public static async Task BeginFailoverAsync(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginFailoverWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Sets which replica database is primary by failing over from the current - /// primary replica database. This operation might result in data loss. - /// - /// - /// 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 that has the replication link to be failed over. - /// - /// - /// The ID of the replication link to be failed over. - /// - public static void BeginFailoverAllowDataLoss(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId) - { - operations.BeginFailoverAllowDataLossAsync(resourceGroupName, serverName, databaseName, linkId).GetAwaiter().GetResult(); - } - - /// - /// Sets which replica database is primary by failing over from the current - /// primary replica database. This operation might result in data loss. - /// - /// - /// 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 that has the replication link to be failed over. - /// - /// - /// The ID of the replication link to be failed over. - /// - /// - /// The cancellation token. - /// - public static async Task BeginFailoverAllowDataLossAsync(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginFailoverAllowDataLossWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Deletes a database replication link in forced or friendly way. - /// - /// - /// 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 that has the replication link to be failed over. - /// - /// - /// The ID of the replication link to be failed over. - /// - /// - /// The required parameters for unlinking replication link. - /// - public static void BeginUnlink(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId, UnlinkParameters parameters) - { - operations.BeginUnlinkAsync(resourceGroupName, serverName, databaseName, linkId, parameters).GetAwaiter().GetResult(); - } - - /// - /// Deletes a database replication link in forced or friendly way. - /// - /// - /// 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 that has the replication link to be failed over. - /// - /// - /// The ID of the replication link to be failed over. - /// - /// - /// The required parameters for unlinking replication link. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUnlinkAsync(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId, UnlinkParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginUnlinkWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - /// /// Gets a list of replication links on database. /// diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SdkInfo_SqlManagementClient.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SdkInfo_SqlManagementClient.cs index ea8c5d51ae68..dfc8ccf6a342 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SdkInfo_SqlManagementClient.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SdkInfo_SqlManagementClient.cs @@ -54,7 +54,7 @@ public static IEnumerable> ApiInfo_SqlManagementCl new Tuple("Sql", "FailoverGroups", "2020-11-01-preview"), new Tuple("Sql", "FirewallRules", "2020-11-01-preview"), new Tuple("Sql", "GeoBackupPolicies", "2014-04-01"), - new Tuple("Sql", "IPv6FirewallRules", "2021-08-01-preview"), + new Tuple("Sql", "IPv6FirewallRules", "2021-11-01-preview"), new Tuple("Sql", "InstanceFailoverGroups", "2020-11-01-preview"), new Tuple("Sql", "InstancePools", "2020-11-01-preview"), new Tuple("Sql", "JobAgents", "2020-11-01-preview"), @@ -107,7 +107,6 @@ public static IEnumerable> ApiInfo_SqlManagementCl new Tuple("Sql", "RecommendedSensitivityLabels", "2020-11-01-preview"), new Tuple("Sql", "RecoverableDatabases", "2014-04-01"), new Tuple("Sql", "RecoverableManagedDatabases", "2020-11-01-preview"), - new Tuple("Sql", "ReplicationLinks", "2014-04-01"), new Tuple("Sql", "ReplicationLinks", "2021-02-01-preview"), new Tuple("Sql", "RestorableDroppedDatabases", "2021-05-01-preview"), new Tuple("Sql", "RestorableDroppedManagedDatabases", "2021-05-01-preview"), @@ -153,7 +152,7 @@ public static IEnumerable> ApiInfo_SqlManagementCl public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/main/specification/sql/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=D:\\vs\\gh_repos\\azure-sdk-for-net\\sdk"; public static readonly String GithubForkName = "Azure"; public static readonly String GithubBranchName = "main"; - public static readonly String GithubCommidId = "e6960fdb7e58aa8bcca0b208a881452e2e6c55c8"; + public static readonly String GithubCommidId = "b5d8eef5bf187dc99f1c18e8323b19e0c37a7124"; public static readonly String CodeGenerationErrors = ""; public static readonly String GithubRepoName = "azure-rest-api-specs"; // END: Code Generation Metadata Section diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SqlManagementClient.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SqlManagementClient.cs index d890c93ab830..c79a4788baf0 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SqlManagementClient.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SqlManagementClient.cs @@ -102,11 +102,6 @@ public partial class SqlManagementClient : ServiceClient, I /// public virtual IElasticPoolsOperations ElasticPools { get; private set; } - /// - /// Gets the IReplicationLinksOperations. - /// - public virtual IReplicationLinksOperations ReplicationLinks { get; private set; } - /// /// Gets the IServerCommunicationLinksOperations. /// @@ -347,16 +342,6 @@ public partial class SqlManagementClient : ServiceClient, I /// public virtual IManagedDatabaseSecurityEventsOperations ManagedDatabaseSecurityEvents { get; private set; } - /// - /// Gets the IManagedDatabaseSensitivityLabelsOperations. - /// - public virtual IManagedDatabaseSensitivityLabelsOperations ManagedDatabaseSensitivityLabels { get; private set; } - - /// - /// Gets the IManagedDatabaseRecommendedSensitivityLabelsOperations. - /// - public virtual IManagedDatabaseRecommendedSensitivityLabelsOperations ManagedDatabaseRecommendedSensitivityLabels { get; private set; } - /// /// Gets the IManagedDatabaseTablesOperations. /// @@ -467,16 +452,6 @@ public partial class SqlManagementClient : ServiceClient, I /// public virtual IRestorePointsOperations RestorePoints { get; private set; } - /// - /// Gets the ISensitivityLabelsOperations. - /// - public virtual ISensitivityLabelsOperations SensitivityLabels { get; private set; } - - /// - /// Gets the IRecommendedSensitivityLabelsOperations. - /// - public virtual IRecommendedSensitivityLabelsOperations RecommendedSensitivityLabels { get; private set; } - /// /// Gets the IServerAdvisorsOperations. /// @@ -682,6 +657,31 @@ public partial class SqlManagementClient : ServiceClient, I /// public virtual IEndpointCertificatesOperations EndpointCertificates { get; private set; } + /// + /// Gets the IReplicationLinksOperations. + /// + public virtual IReplicationLinksOperations ReplicationLinks { get; private set; } + + /// + /// Gets the IManagedDatabaseSensitivityLabelsOperations. + /// + public virtual IManagedDatabaseSensitivityLabelsOperations ManagedDatabaseSensitivityLabels { get; private set; } + + /// + /// Gets the IManagedDatabaseRecommendedSensitivityLabelsOperations. + /// + public virtual IManagedDatabaseRecommendedSensitivityLabelsOperations ManagedDatabaseRecommendedSensitivityLabels { get; private set; } + + /// + /// Gets the ISensitivityLabelsOperations. + /// + public virtual ISensitivityLabelsOperations SensitivityLabels { get; private set; } + + /// + /// Gets the IRecommendedSensitivityLabelsOperations. + /// + public virtual IRecommendedSensitivityLabelsOperations RecommendedSensitivityLabels { get; private set; } + /// /// Initializes a new instance of the SqlManagementClient class. /// @@ -929,7 +929,6 @@ private void Initialize() GeoBackupPolicies = new GeoBackupPoliciesOperations(this); Databases = new DatabasesOperations(this); ElasticPools = new ElasticPoolsOperations(this); - ReplicationLinks = new ReplicationLinksOperations(this); ServerCommunicationLinks = new ServerCommunicationLinksOperations(this); ServiceObjectives = new ServiceObjectivesOperations(this); ElasticPoolActivities = new ElasticPoolActivitiesOperations(this); @@ -978,8 +977,6 @@ private void Initialize() ManagedDatabaseSchemas = new ManagedDatabaseSchemasOperations(this); ManagedDatabaseSecurityAlertPolicies = new ManagedDatabaseSecurityAlertPoliciesOperations(this); ManagedDatabaseSecurityEvents = new ManagedDatabaseSecurityEventsOperations(this); - ManagedDatabaseSensitivityLabels = new ManagedDatabaseSensitivityLabelsOperations(this); - ManagedDatabaseRecommendedSensitivityLabels = new ManagedDatabaseRecommendedSensitivityLabelsOperations(this); ManagedDatabaseTables = new ManagedDatabaseTablesOperations(this); ManagedDatabaseTransparentDataEncryption = new ManagedDatabaseTransparentDataEncryptionOperations(this); ManagedDatabaseVulnerabilityAssessmentRuleBaselines = new ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations(this); @@ -1002,8 +999,6 @@ private void Initialize() PrivateLinkResources = new PrivateLinkResourcesOperations(this); RecoverableManagedDatabases = new RecoverableManagedDatabasesOperations(this); RestorePoints = new RestorePointsOperations(this); - SensitivityLabels = new SensitivityLabelsOperations(this); - RecommendedSensitivityLabels = new RecommendedSensitivityLabelsOperations(this); ServerAdvisors = new ServerAdvisorsOperations(this); ServerAutomaticTuning = new ServerAutomaticTuningOperations(this); ServerAzureADAdministrators = new ServerAzureADAdministratorsOperations(this); @@ -1045,6 +1040,11 @@ private void Initialize() ServerTrustCertificates = new ServerTrustCertificatesOperations(this); IPv6FirewallRules = new IPv6FirewallRulesOperations(this); EndpointCertificates = new EndpointCertificatesOperations(this); + ReplicationLinks = new ReplicationLinksOperations(this); + ManagedDatabaseSensitivityLabels = new ManagedDatabaseSensitivityLabelsOperations(this); + ManagedDatabaseRecommendedSensitivityLabels = new ManagedDatabaseRecommendedSensitivityLabelsOperations(this); + SensitivityLabels = new SensitivityLabelsOperations(this); + RecommendedSensitivityLabels = new RecommendedSensitivityLabelsOperations(this); BaseUri = new System.Uri("https://management.azure.com"); AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; From c168656d8851f4ac9b05bd63e643fa68dfc129ed Mon Sep 17 00:00:00 2001 From: Bogdan Ostojic Date: Fri, 22 Apr 2022 16:22:41 +0200 Subject: [PATCH 07/10] revive replication links --- .../Generated/IReplicationLinksOperations.cs | 242 ++++- .../src/Generated/ISqlManagementClient.cs | 10 +- .../src/Generated/Models/UnlinkParameters.cs | 53 + .../Generated/ReplicationLinksOperations.cs | 952 +++++++++++++++++- .../ReplicationLinksOperationsExtensions.cs | 399 +++++++- .../Generated/SdkInfo_SqlManagementClient.cs | 1 + .../src/Generated/SqlManagementClient.cs | 12 +- 7 files changed, 1603 insertions(+), 66 deletions(-) create mode 100644 sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/UnlinkParameters.cs diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IReplicationLinksOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IReplicationLinksOperations.cs index aa8b7dd64f9f..8e46eb06c69a 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IReplicationLinksOperations.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IReplicationLinksOperations.cs @@ -24,7 +24,8 @@ namespace Microsoft.Azure.Management.Sql public partial interface IReplicationLinksOperations { /// - /// Gets a list of replication links on database. + /// Deletes a database replication link. Cannot be done during + /// failover. /// /// /// The name of the resource group that contains the resource. You can @@ -35,7 +36,11 @@ public partial interface IReplicationLinksOperations /// The name of the server. /// /// - /// The name of the database. + /// The name of the database that has the replication link to be + /// dropped. + /// + /// + /// The ID of the replication link to be deleted. /// /// /// The headers that will be added to request. @@ -46,13 +51,10 @@ public partial interface IReplicationLinksOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets a replication link. /// @@ -87,6 +89,135 @@ public partial interface IReplicationLinksOperations /// Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Sets which replica database is primary by failing over from the + /// current primary replica 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 that has the replication link to be failed + /// over. + /// + /// + /// The ID of the replication link to be failed over. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task FailoverWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Sets which replica database is primary by failing over from the + /// current primary replica database. This operation might result in + /// data loss. + /// + /// + /// 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 that has the replication link to be failed + /// over. + /// + /// + /// The ID of the replication link to be failed over. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task FailoverAllowDataLossWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a database replication link in forced or friendly way. + /// + /// + /// 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 that has the replication link to be failed + /// over. + /// + /// + /// The ID of the replication link to be failed over. + /// + /// + /// The required parameters for unlinking replication link. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task UnlinkWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, UnlinkParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a list of replication links on 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 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>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Gets a list of replication links. /// /// @@ -114,6 +245,105 @@ public partial interface IReplicationLinksOperations /// Task>> ListByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Sets which replica database is primary by failing over from the + /// current primary replica 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 that has the replication link to be failed + /// over. + /// + /// + /// The ID of the replication link to be failed over. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginFailoverWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Sets which replica database is primary by failing over from the + /// current primary replica database. This operation might result in + /// data loss. + /// + /// + /// 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 that has the replication link to be failed + /// over. + /// + /// + /// The ID of the replication link to be failed over. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginFailoverAllowDataLossWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a database replication link in forced or friendly way. + /// + /// + /// 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 that has the replication link to be failed + /// over. + /// + /// + /// The ID of the replication link to be failed over. + /// + /// + /// The required parameters for unlinking replication link. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginUnlinkWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, UnlinkParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Gets a list of replication links on database. /// /// diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ISqlManagementClient.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ISqlManagementClient.cs index 30e761ee9ff3..a1ad46e1ac1b 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ISqlManagementClient.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ISqlManagementClient.cs @@ -97,6 +97,11 @@ public partial interface ISqlManagementClient : System.IDisposable /// IElasticPoolsOperations ElasticPools { get; } + /// + /// Gets the IReplicationLinksOperations. + /// + IReplicationLinksOperations ReplicationLinks { get; } + /// /// Gets the IServerCommunicationLinksOperations. /// @@ -652,11 +657,6 @@ public partial interface ISqlManagementClient : System.IDisposable /// IEndpointCertificatesOperations EndpointCertificates { get; } - /// - /// Gets the IReplicationLinksOperations. - /// - IReplicationLinksOperations ReplicationLinks { get; } - /// /// Gets the IManagedDatabaseSensitivityLabelsOperations. /// diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/UnlinkParameters.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/UnlinkParameters.cs new file mode 100644 index 000000000000..773e905009a0 --- /dev/null +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/UnlinkParameters.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Sql.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Represents the parameters for Unlink Replication Link request. + /// + public partial class UnlinkParameters + { + /// + /// Initializes a new instance of the UnlinkParameters class. + /// + public UnlinkParameters() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the UnlinkParameters class. + /// + /// Determines whether link will be + /// terminated in a forced or a friendly way. + public UnlinkParameters(bool? forcedTermination = default(bool?)) + { + ForcedTermination = forcedTermination; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets determines whether link will be terminated in a forced + /// or a friendly way. + /// + [JsonProperty(PropertyName = "forcedTermination")] + public bool? ForcedTermination { get; set; } + + } +} diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ReplicationLinksOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ReplicationLinksOperations.cs index 0d2e8974e92a..64ddd37e63c9 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ReplicationLinksOperations.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ReplicationLinksOperations.cs @@ -51,7 +51,7 @@ internal ReplicationLinksOperations(SqlManagementClient client) public SqlManagementClient Client { get; private set; } /// - /// Gets a list of replication links on database. + /// Deletes a database replication link. Cannot be done during failover. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -61,7 +61,10 @@ internal ReplicationLinksOperations(SqlManagementClient client) /// The name of the server. /// /// - /// The name of the database. + /// The name of the database that has the replication link to be dropped. + /// + /// + /// The ID of the replication link to be deleted. /// /// /// Headers that will be added to request. @@ -72,9 +75,6 @@ internal ReplicationLinksOperations(SqlManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -84,8 +84,12 @@ internal ReplicationLinksOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -98,11 +102,11 @@ internal ReplicationLinksOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); } - if (Client.SubscriptionId == null) + if (linkId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "linkId"); } - string apiVersion = "2021-02-01-preview"; + string apiVersion = "2014-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -110,20 +114,22 @@ internal ReplicationLinksOperations(SqlManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serverName", serverName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("linkId", linkId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByDatabase", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _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)); + _url = _url.Replace("{linkId}", System.Uri.EscapeDataString(linkId)); List _queryParameters = new List(); if (apiVersion != null) { @@ -136,7 +142,7 @@ internal ReplicationLinksOperations(SqlManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -187,7 +193,7 @@ internal ReplicationLinksOperations(SqlManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -222,31 +228,13 @@ internal ReplicationLinksOperations(SqlManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _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); @@ -468,7 +456,99 @@ internal ReplicationLinksOperations(SqlManagementClient client) } /// - /// Gets a list of replication links. + /// Sets which replica database is primary by failing over from the current + /// primary replica 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 that has the replication link to be failed over. + /// + /// + /// The ID of the replication link to be failed over. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task FailoverWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginFailoverWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Sets which replica database is primary by failing over from the current + /// primary replica database. This operation might result in data loss. + /// + /// + /// 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 that has the replication link to be failed over. + /// + /// + /// The ID of the replication link to be failed over. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task FailoverAllowDataLossWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginFailoverAllowDataLossWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes a database replication link in forced or friendly way. + /// + /// + /// 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 that has the replication link to be failed over. + /// + /// + /// The ID of the replication link to be failed over. + /// + /// + /// The required parameters for unlinking replication link. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task UnlinkWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, UnlinkParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginUnlinkWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a list of replication links on database. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -477,6 +557,9 @@ internal ReplicationLinksOperations(SqlManagementClient client) /// /// The name of the server. /// + /// + /// The name of the database. + /// /// /// Headers that will be added to request. /// @@ -498,7 +581,7 @@ internal ReplicationLinksOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -508,6 +591,10 @@ internal ReplicationLinksOperations(SqlManagementClient client) { 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"); @@ -522,15 +609,17 @@ internal ReplicationLinksOperations(SqlManagementClient client) 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, "ListByServer", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByDatabase", 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}/replicationLinks").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks").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) @@ -662,6 +751,793 @@ internal ReplicationLinksOperations(SqlManagementClient client) return _result; } + /// + /// Gets a list of replication links. + /// + /// + /// 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>> ListByServerWithHttpMessagesAsync(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 = "2021-02-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, "ListByServer", 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}/replicationLinks").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; + } + + /// + /// Sets which replica database is primary by failing over from the current + /// primary replica 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 that has the replication link to be failed over. + /// + /// + /// The ID of the replication link to be failed over. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginFailoverWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serverName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); + } + if (databaseName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); + } + if (linkId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "linkId"); + } + string apiVersion = "2014-04-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serverName", serverName); + tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("linkId", linkId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginFailover", 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}/replicationLinks/{linkId}/failover").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _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("{linkId}", System.Uri.EscapeDataString(linkId)); + 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("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Sets which replica database is primary by failing over from the current + /// primary replica database. This operation might result in data loss. + /// + /// + /// 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 that has the replication link to be failed over. + /// + /// + /// The ID of the replication link to be failed over. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginFailoverAllowDataLossWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serverName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); + } + if (databaseName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); + } + if (linkId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "linkId"); + } + string apiVersion = "2014-04-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serverName", serverName); + tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("linkId", linkId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginFailoverAllowDataLoss", 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}/replicationLinks/{linkId}/forceFailoverAllowDataLoss").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _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("{linkId}", System.Uri.EscapeDataString(linkId)); + 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("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes a database replication link in forced or friendly way. + /// + /// + /// 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 that has the replication link to be failed over. + /// + /// + /// The ID of the replication link to be failed over. + /// + /// + /// The required parameters for unlinking replication link. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginUnlinkWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string linkId, UnlinkParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serverName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); + } + if (databaseName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); + } + if (linkId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "linkId"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + string apiVersion = "2014-04-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serverName", serverName); + tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("linkId", linkId); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginUnlink", 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}/replicationLinks/{linkId}/unlink").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _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("{linkId}", System.Uri.EscapeDataString(linkId)); + 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("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + /// /// Gets a list of replication links on database. /// diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ReplicationLinksOperationsExtensions.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ReplicationLinksOperationsExtensions.cs index 0706f8ca066f..5cfcc8702823 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ReplicationLinksOperationsExtensions.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ReplicationLinksOperationsExtensions.cs @@ -22,7 +22,7 @@ namespace Microsoft.Azure.Management.Sql public static partial class ReplicationLinksOperationsExtensions { /// - /// Gets a list of replication links on database. + /// Deletes a database replication link. Cannot be done during failover. /// /// /// The operations group for this extension method. @@ -35,15 +35,18 @@ public static partial class ReplicationLinksOperationsExtensions /// The name of the server. /// /// - /// The name of the database. + /// The name of the database that has the replication link to be dropped. /// - public static IPage ListByDatabase(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName) + /// + /// The ID of the replication link to be deleted. + /// + public static void Delete(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId) { - return operations.ListByDatabaseAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult(); + operations.DeleteAsync(resourceGroupName, serverName, databaseName, linkId).GetAwaiter().GetResult(); } /// - /// Gets a list of replication links on database. + /// Deletes a database replication link. Cannot be done during failover. /// /// /// The operations group for this extension method. @@ -56,17 +59,17 @@ public static IPage ListByDatabase(this IReplicationLinksOperat /// The name of the server. /// /// - /// The name of the database. + /// The name of the database that has the replication link to be dropped. + /// + /// + /// The ID of the replication link to be deleted. /// /// /// The cancellation token. /// - public static async Task> ListByDatabaseAsync(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteAsync(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByDatabaseWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -123,6 +126,217 @@ public static ReplicationLink Get(this IReplicationLinksOperations operations, s } } + /// + /// Sets which replica database is primary by failing over from the current + /// primary replica 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 that has the replication link to be failed over. + /// + /// + /// The ID of the replication link to be failed over. + /// + public static void Failover(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId) + { + operations.FailoverAsync(resourceGroupName, serverName, databaseName, linkId).GetAwaiter().GetResult(); + } + + /// + /// Sets which replica database is primary by failing over from the current + /// primary replica 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 that has the replication link to be failed over. + /// + /// + /// The ID of the replication link to be failed over. + /// + /// + /// The cancellation token. + /// + public static async Task FailoverAsync(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.FailoverWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Sets which replica database is primary by failing over from the current + /// primary replica database. This operation might result in data loss. + /// + /// + /// 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 that has the replication link to be failed over. + /// + /// + /// The ID of the replication link to be failed over. + /// + public static void FailoverAllowDataLoss(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId) + { + operations.FailoverAllowDataLossAsync(resourceGroupName, serverName, databaseName, linkId).GetAwaiter().GetResult(); + } + + /// + /// Sets which replica database is primary by failing over from the current + /// primary replica database. This operation might result in data loss. + /// + /// + /// 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 that has the replication link to be failed over. + /// + /// + /// The ID of the replication link to be failed over. + /// + /// + /// The cancellation token. + /// + public static async Task FailoverAllowDataLossAsync(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.FailoverAllowDataLossWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Deletes a database replication link in forced or friendly way. + /// + /// + /// 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 that has the replication link to be failed over. + /// + /// + /// The ID of the replication link to be failed over. + /// + /// + /// The required parameters for unlinking replication link. + /// + public static void Unlink(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId, UnlinkParameters parameters) + { + operations.UnlinkAsync(resourceGroupName, serverName, databaseName, linkId, parameters).GetAwaiter().GetResult(); + } + + /// + /// Deletes a database replication link in forced or friendly way. + /// + /// + /// 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 that has the replication link to be failed over. + /// + /// + /// The ID of the replication link to be failed over. + /// + /// + /// The required parameters for unlinking replication link. + /// + /// + /// The cancellation token. + /// + public static async Task UnlinkAsync(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId, UnlinkParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.UnlinkWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets a list of replication links on 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. + /// + public static IPage ListByDatabase(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName) + { + return operations.ListByDatabaseAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of replication links on 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 cancellation token. + /// + public static async Task> ListByDatabaseAsync(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByDatabaseWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Gets a list of replication links. /// @@ -165,6 +379,169 @@ public static IPage ListByServer(this IReplicationLinksOperatio } } + /// + /// Sets which replica database is primary by failing over from the current + /// primary replica 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 that has the replication link to be failed over. + /// + /// + /// The ID of the replication link to be failed over. + /// + public static void BeginFailover(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId) + { + operations.BeginFailoverAsync(resourceGroupName, serverName, databaseName, linkId).GetAwaiter().GetResult(); + } + + /// + /// Sets which replica database is primary by failing over from the current + /// primary replica 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 that has the replication link to be failed over. + /// + /// + /// The ID of the replication link to be failed over. + /// + /// + /// The cancellation token. + /// + public static async Task BeginFailoverAsync(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginFailoverWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Sets which replica database is primary by failing over from the current + /// primary replica database. This operation might result in data loss. + /// + /// + /// 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 that has the replication link to be failed over. + /// + /// + /// The ID of the replication link to be failed over. + /// + public static void BeginFailoverAllowDataLoss(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId) + { + operations.BeginFailoverAllowDataLossAsync(resourceGroupName, serverName, databaseName, linkId).GetAwaiter().GetResult(); + } + + /// + /// Sets which replica database is primary by failing over from the current + /// primary replica database. This operation might result in data loss. + /// + /// + /// 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 that has the replication link to be failed over. + /// + /// + /// The ID of the replication link to be failed over. + /// + /// + /// The cancellation token. + /// + public static async Task BeginFailoverAllowDataLossAsync(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginFailoverAllowDataLossWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Deletes a database replication link in forced or friendly way. + /// + /// + /// 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 that has the replication link to be failed over. + /// + /// + /// The ID of the replication link to be failed over. + /// + /// + /// The required parameters for unlinking replication link. + /// + public static void BeginUnlink(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId, UnlinkParameters parameters) + { + operations.BeginUnlinkAsync(resourceGroupName, serverName, databaseName, linkId, parameters).GetAwaiter().GetResult(); + } + + /// + /// Deletes a database replication link in forced or friendly way. + /// + /// + /// 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 that has the replication link to be failed over. + /// + /// + /// The ID of the replication link to be failed over. + /// + /// + /// The required parameters for unlinking replication link. + /// + /// + /// The cancellation token. + /// + public static async Task BeginUnlinkAsync(this IReplicationLinksOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId, UnlinkParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginUnlinkWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, linkId, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// /// Gets a list of replication links on database. /// diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SdkInfo_SqlManagementClient.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SdkInfo_SqlManagementClient.cs index dfc8ccf6a342..51f75214a9b0 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SdkInfo_SqlManagementClient.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SdkInfo_SqlManagementClient.cs @@ -107,6 +107,7 @@ public static IEnumerable> ApiInfo_SqlManagementCl new Tuple("Sql", "RecommendedSensitivityLabels", "2020-11-01-preview"), new Tuple("Sql", "RecoverableDatabases", "2014-04-01"), new Tuple("Sql", "RecoverableManagedDatabases", "2020-11-01-preview"), + new Tuple("Sql", "ReplicationLinks", "2014-04-01"), new Tuple("Sql", "ReplicationLinks", "2021-02-01-preview"), new Tuple("Sql", "RestorableDroppedDatabases", "2021-05-01-preview"), new Tuple("Sql", "RestorableDroppedManagedDatabases", "2021-05-01-preview"), diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SqlManagementClient.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SqlManagementClient.cs index c79a4788baf0..62d3767aeb4f 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SqlManagementClient.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SqlManagementClient.cs @@ -102,6 +102,11 @@ public partial class SqlManagementClient : ServiceClient, I /// public virtual IElasticPoolsOperations ElasticPools { get; private set; } + /// + /// Gets the IReplicationLinksOperations. + /// + public virtual IReplicationLinksOperations ReplicationLinks { get; private set; } + /// /// Gets the IServerCommunicationLinksOperations. /// @@ -657,11 +662,6 @@ public partial class SqlManagementClient : ServiceClient, I /// public virtual IEndpointCertificatesOperations EndpointCertificates { get; private set; } - /// - /// Gets the IReplicationLinksOperations. - /// - public virtual IReplicationLinksOperations ReplicationLinks { get; private set; } - /// /// Gets the IManagedDatabaseSensitivityLabelsOperations. /// @@ -929,6 +929,7 @@ private void Initialize() GeoBackupPolicies = new GeoBackupPoliciesOperations(this); Databases = new DatabasesOperations(this); ElasticPools = new ElasticPoolsOperations(this); + ReplicationLinks = new ReplicationLinksOperations(this); ServerCommunicationLinks = new ServerCommunicationLinksOperations(this); ServiceObjectives = new ServiceObjectivesOperations(this); ElasticPoolActivities = new ElasticPoolActivitiesOperations(this); @@ -1040,7 +1041,6 @@ private void Initialize() ServerTrustCertificates = new ServerTrustCertificatesOperations(this); IPv6FirewallRules = new IPv6FirewallRulesOperations(this); EndpointCertificates = new EndpointCertificatesOperations(this); - ReplicationLinks = new ReplicationLinksOperations(this); ManagedDatabaseSensitivityLabels = new ManagedDatabaseSensitivityLabelsOperations(this); ManagedDatabaseRecommendedSensitivityLabels = new ManagedDatabaseRecommendedSensitivityLabelsOperations(this); SensitivityLabels = new SensitivityLabelsOperations(this); From 8e6860e26f5d2124c3333de27031b74663d6bda2 Mon Sep 17 00:00:00 2001 From: Bogdan Ostojic Date: Sat, 30 Apr 2022 20:49:51 +0200 Subject: [PATCH 08/10] run generate.ps1 --- .../mgmtmetadata/sql_resource-manager.txt | 4 +- .../DatabaseBlobAuditingPoliciesOperations.cs | 122 +++++++++--------- ...lobAuditingPoliciesOperationsExtensions.cs | 48 +++---- ...dDatabaseBlobAuditingPoliciesOperations.cs | 122 +++++++++--------- ...lobAuditingPoliciesOperationsExtensions.cs | 48 +++---- ...dedServerBlobAuditingPoliciesOperations.cs | 88 ++++++------- ...lobAuditingPoliciesOperationsExtensions.cs | 48 +++---- ...IDatabaseBlobAuditingPoliciesOperations.cs | 18 +-- ...dDatabaseBlobAuditingPoliciesOperations.cs | 18 +-- ...dedServerBlobAuditingPoliciesOperations.cs | 18 +-- .../IServerBlobAuditingPoliciesOperations.cs | 18 +-- .../src/Generated/ISqlManagementClient.cs | 40 +++--- .../Models/DatabaseBlobAuditingPolicy.cs | 20 ++- .../ExtendedDatabaseBlobAuditingPolicy.cs | 20 ++- .../ExtendedServerBlobAuditingPolicy.cs | 20 ++- .../Models/ServerBlobAuditingPolicy.cs | 20 ++- .../Generated/SdkInfo_SqlManagementClient.cs | 10 +- .../ServerBlobAuditingPoliciesOperations.cs | 88 ++++++------- ...lobAuditingPoliciesOperationsExtensions.cs | 48 +++---- .../src/Generated/SqlManagementClient.cs | 48 +++---- 20 files changed, 469 insertions(+), 397 deletions(-) diff --git a/eng/mgmt/mgmtmetadata/sql_resource-manager.txt b/eng/mgmt/mgmtmetadata/sql_resource-manager.txt index f4ff1d699c67..fae5e723c9ab 100644 --- a/eng/mgmt/mgmtmetadata/sql_resource-manager.txt +++ b/eng/mgmt/mgmtmetadata/sql_resource-manager.txt @@ -5,11 +5,11 @@ Generating CSharp code Executing AutoRest command cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/main/specification/sql/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=D:\vs\gh_repos\azure-sdk-for-net\sdk Autorest CSharp Version: 2.3.82 -2022-04-08 11:03:52 UTC +2022-04-30 15:52:36 UTC Azure-rest-api-specs repository information GitHub fork: Azure Branch: main -Commit: e6960fdb7e58aa8bcca0b208a881452e2e6c55c8 +Commit: ea9af04161c73743cdb40c1439a3046f16f35f71 AutoRest information Requested version: v2 Bootstrapper version: autorest@3.5.1 diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/DatabaseBlobAuditingPoliciesOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/DatabaseBlobAuditingPoliciesOperations.cs index 3b6ca4f05a6c..caf02b5e9a95 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/DatabaseBlobAuditingPoliciesOperations.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/DatabaseBlobAuditingPoliciesOperations.cs @@ -51,7 +51,7 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client) public SqlManagementClient Client { get; private set; } /// - /// Gets a database's blob auditing policy. + /// Lists auditing settings of a database. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -84,7 +84,7 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client) /// /// 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)) + public async Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -102,8 +102,7 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string blobAuditingPolicyName = "default"; - string apiVersion = "2020-11-01-preview"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -114,18 +113,16 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serverName", serverName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("blobAuditingPolicyName", blobAuditingPolicyName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByDatabase", 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}/auditingSettings/{blobAuditingPolicyName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings").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("{blobAuditingPolicyName}", System.Uri.EscapeDataString(blobAuditingPolicyName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -225,7 +222,7 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -238,7 +235,7 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -258,7 +255,7 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client) } /// - /// Creates or updates a database's blob auditing policy. + /// Gets a database's blob auditing policy. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -270,9 +267,6 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client) /// /// The name of the database. /// - /// - /// The database blob auditing policy. - /// /// /// Headers that will be added to request. /// @@ -294,7 +288,7 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, DatabaseBlobAuditingPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -308,20 +302,12 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } string blobAuditingPolicyName = "default"; - string apiVersion = "2020-11-01-preview"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -333,10 +319,9 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client) tracingParameters.Add("serverName", serverName); tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("blobAuditingPolicyName", blobAuditingPolicyName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -358,7 +343,7 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -389,12 +374,6 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client) // Serialize Request string _requestContent = null; - if(parameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -415,7 +394,7 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -475,24 +454,6 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client) throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -501,7 +462,7 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client) } /// - /// Lists auditing settings of a database. + /// Creates or updates a database's blob auditing policy. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -513,6 +474,9 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client) /// /// The name of the database. /// + /// + /// The database blob auditing policy. + /// /// /// Headers that will be added to request. /// @@ -534,7 +498,7 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, DatabaseBlobAuditingPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -548,11 +512,20 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01-preview"; + string blobAuditingPolicyName = "default"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -563,16 +536,19 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serverName", serverName); tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("blobAuditingPolicyName", blobAuditingPolicyName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByDatabase", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings/{blobAuditingPolicyName}").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("{blobAuditingPolicyName}", System.Uri.EscapeDataString(blobAuditingPolicyName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -586,7 +562,7 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -617,6 +593,12 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client) // Serialize Request string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -637,7 +619,7 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -672,7 +654,7 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -685,7 +667,25 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/DatabaseBlobAuditingPoliciesOperationsExtensions.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/DatabaseBlobAuditingPoliciesOperationsExtensions.cs index 1ee6a5241f17..3ae1fc2f3381 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/DatabaseBlobAuditingPoliciesOperationsExtensions.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/DatabaseBlobAuditingPoliciesOperationsExtensions.cs @@ -22,7 +22,7 @@ namespace Microsoft.Azure.Management.Sql public static partial class DatabaseBlobAuditingPoliciesOperationsExtensions { /// - /// Gets a database's blob auditing policy. + /// Lists auditing settings of a database. /// /// /// The operations group for this extension method. @@ -37,13 +37,13 @@ public static partial class DatabaseBlobAuditingPoliciesOperationsExtensions /// /// The name of the database. /// - public static DatabaseBlobAuditingPolicy Get(this IDatabaseBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, string databaseName) + public static IPage ListByDatabase(this IDatabaseBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, string databaseName) { - return operations.GetAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult(); + return operations.ListByDatabaseAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult(); } /// - /// Gets a database's blob auditing policy. + /// Lists auditing settings of a database. /// /// /// The operations group for this extension method. @@ -61,16 +61,16 @@ public static DatabaseBlobAuditingPolicy Get(this IDatabaseBlobAuditingPoliciesO /// /// The cancellation token. /// - public static async Task GetAsync(this IDatabaseBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByDatabaseAsync(this IDatabaseBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByDatabaseWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Creates or updates a database's blob auditing policy. + /// Gets a database's blob auditing policy. /// /// /// The operations group for this extension method. @@ -85,16 +85,13 @@ public static DatabaseBlobAuditingPolicy Get(this IDatabaseBlobAuditingPoliciesO /// /// The name of the database. /// - /// - /// The database blob auditing policy. - /// - public static DatabaseBlobAuditingPolicy CreateOrUpdate(this IDatabaseBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, string databaseName, DatabaseBlobAuditingPolicy parameters) + public static DatabaseBlobAuditingPolicy Get(this IDatabaseBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, string databaseName) { - return operations.CreateOrUpdateAsync(resourceGroupName, serverName, databaseName, parameters).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult(); } /// - /// Creates or updates a database's blob auditing policy. + /// Gets a database's blob auditing policy. /// /// /// The operations group for this extension method. @@ -109,22 +106,19 @@ public static DatabaseBlobAuditingPolicy CreateOrUpdate(this IDatabaseBlobAuditi /// /// The name of the database. /// - /// - /// The database blob auditing policy. - /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IDatabaseBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, string databaseName, DatabaseBlobAuditingPolicy parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IDatabaseBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Lists auditing settings of a database. + /// Creates or updates a database's blob auditing policy. /// /// /// The operations group for this extension method. @@ -139,13 +133,16 @@ public static DatabaseBlobAuditingPolicy CreateOrUpdate(this IDatabaseBlobAuditi /// /// The name of the database. /// - public static IPage ListByDatabase(this IDatabaseBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, string databaseName) + /// + /// The database blob auditing policy. + /// + public static DatabaseBlobAuditingPolicy CreateOrUpdate(this IDatabaseBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, string databaseName, DatabaseBlobAuditingPolicy parameters) { - return operations.ListByDatabaseAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult(); + return operations.CreateOrUpdateAsync(resourceGroupName, serverName, databaseName, parameters).GetAwaiter().GetResult(); } /// - /// Lists auditing settings of a database. + /// Creates or updates a database's blob auditing policy. /// /// /// The operations group for this extension method. @@ -160,12 +157,15 @@ public static IPage ListByDatabase(this IDatabaseBlo /// /// The name of the database. /// + /// + /// The database blob auditing policy. + /// /// /// The cancellation token. /// - public static async Task> ListByDatabaseAsync(this IDatabaseBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this IDatabaseBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, string databaseName, DatabaseBlobAuditingPolicy parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByDatabaseWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ExtendedDatabaseBlobAuditingPoliciesOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ExtendedDatabaseBlobAuditingPoliciesOperations.cs index fa780931433a..84a14ccedb33 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ExtendedDatabaseBlobAuditingPoliciesOperations.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ExtendedDatabaseBlobAuditingPoliciesOperations.cs @@ -51,7 +51,7 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie public SqlManagementClient Client { get; private set; } /// - /// Gets an extended database's blob auditing policy. + /// Lists extended auditing settings of a database. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -84,7 +84,7 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie /// /// 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)) + public async Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -102,8 +102,7 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string blobAuditingPolicyName = "default"; - string apiVersion = "2020-11-01-preview"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -114,18 +113,16 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serverName", serverName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("blobAuditingPolicyName", blobAuditingPolicyName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByDatabase", 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}/extendedAuditingSettings/{blobAuditingPolicyName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extendedAuditingSettings").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("{blobAuditingPolicyName}", System.Uri.EscapeDataString(blobAuditingPolicyName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -225,7 +222,7 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -238,7 +235,7 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -258,7 +255,7 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie } /// - /// Creates or updates an extended database's blob auditing policy. + /// Gets an extended database's blob auditing policy. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -270,9 +267,6 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie /// /// The name of the database. /// - /// - /// The extended database blob auditing policy. - /// /// /// Headers that will be added to request. /// @@ -294,7 +288,7 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, ExtendedDatabaseBlobAuditingPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -308,20 +302,12 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } string blobAuditingPolicyName = "default"; - string apiVersion = "2020-11-01-preview"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -333,10 +319,9 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie tracingParameters.Add("serverName", serverName); tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("blobAuditingPolicyName", blobAuditingPolicyName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -358,7 +343,7 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -389,12 +374,6 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie // 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) { @@ -415,7 +394,7 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -475,24 +454,6 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -501,7 +462,7 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie } /// - /// Lists extended auditing settings of a database. + /// Creates or updates an extended database's blob auditing policy. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -513,6 +474,9 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie /// /// The name of the database. /// + /// + /// The extended database blob auditing policy. + /// /// /// Headers that will be added to request. /// @@ -534,7 +498,7 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie /// /// A response object containing the response body and response headers. /// - public async Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, ExtendedDatabaseBlobAuditingPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -548,11 +512,20 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01-preview"; + string blobAuditingPolicyName = "default"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -563,16 +536,19 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serverName", serverName); tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("blobAuditingPolicyName", blobAuditingPolicyName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByDatabase", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extendedAuditingSettings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extendedAuditingSettings/{blobAuditingPolicyName}").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("{blobAuditingPolicyName}", System.Uri.EscapeDataString(blobAuditingPolicyName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -586,7 +562,7 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -617,6 +593,12 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie // 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) { @@ -637,7 +619,7 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -672,7 +654,7 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -685,7 +667,25 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ExtendedDatabaseBlobAuditingPoliciesOperationsExtensions.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ExtendedDatabaseBlobAuditingPoliciesOperationsExtensions.cs index 58645764ac82..791bb305bb0d 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ExtendedDatabaseBlobAuditingPoliciesOperationsExtensions.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ExtendedDatabaseBlobAuditingPoliciesOperationsExtensions.cs @@ -22,7 +22,7 @@ namespace Microsoft.Azure.Management.Sql public static partial class ExtendedDatabaseBlobAuditingPoliciesOperationsExtensions { /// - /// Gets an extended database's blob auditing policy. + /// Lists extended auditing settings of a database. /// /// /// The operations group for this extension method. @@ -37,13 +37,13 @@ public static partial class ExtendedDatabaseBlobAuditingPoliciesOperationsExtens /// /// The name of the database. /// - public static ExtendedDatabaseBlobAuditingPolicy Get(this IExtendedDatabaseBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, string databaseName) + public static IPage ListByDatabase(this IExtendedDatabaseBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, string databaseName) { - return operations.GetAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult(); + return operations.ListByDatabaseAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult(); } /// - /// Gets an extended database's blob auditing policy. + /// Lists extended auditing settings of a database. /// /// /// The operations group for this extension method. @@ -61,16 +61,16 @@ public static ExtendedDatabaseBlobAuditingPolicy Get(this IExtendedDatabaseBlobA /// /// The cancellation token. /// - public static async Task GetAsync(this IExtendedDatabaseBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByDatabaseAsync(this IExtendedDatabaseBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByDatabaseWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Creates or updates an extended database's blob auditing policy. + /// Gets an extended database's blob auditing policy. /// /// /// The operations group for this extension method. @@ -85,16 +85,13 @@ public static ExtendedDatabaseBlobAuditingPolicy Get(this IExtendedDatabaseBlobA /// /// The name of the database. /// - /// - /// The extended database blob auditing policy. - /// - public static ExtendedDatabaseBlobAuditingPolicy CreateOrUpdate(this IExtendedDatabaseBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, string databaseName, ExtendedDatabaseBlobAuditingPolicy parameters) + public static ExtendedDatabaseBlobAuditingPolicy Get(this IExtendedDatabaseBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, string databaseName) { - return operations.CreateOrUpdateAsync(resourceGroupName, serverName, databaseName, parameters).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult(); } /// - /// Creates or updates an extended database's blob auditing policy. + /// Gets an extended database's blob auditing policy. /// /// /// The operations group for this extension method. @@ -109,22 +106,19 @@ public static ExtendedDatabaseBlobAuditingPolicy CreateOrUpdate(this IExtendedDa /// /// The name of the database. /// - /// - /// The extended database blob auditing policy. - /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IExtendedDatabaseBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, string databaseName, ExtendedDatabaseBlobAuditingPolicy parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IExtendedDatabaseBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Lists extended auditing settings of a database. + /// Creates or updates an extended database's blob auditing policy. /// /// /// The operations group for this extension method. @@ -139,13 +133,16 @@ public static ExtendedDatabaseBlobAuditingPolicy CreateOrUpdate(this IExtendedDa /// /// The name of the database. /// - public static IPage ListByDatabase(this IExtendedDatabaseBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, string databaseName) + /// + /// The extended database blob auditing policy. + /// + public static ExtendedDatabaseBlobAuditingPolicy CreateOrUpdate(this IExtendedDatabaseBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, string databaseName, ExtendedDatabaseBlobAuditingPolicy parameters) { - return operations.ListByDatabaseAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult(); + return operations.CreateOrUpdateAsync(resourceGroupName, serverName, databaseName, parameters).GetAwaiter().GetResult(); } /// - /// Lists extended auditing settings of a database. + /// Creates or updates an extended database's blob auditing policy. /// /// /// The operations group for this extension method. @@ -160,12 +157,15 @@ public static IPage ListByDatabase(this IExt /// /// The name of the database. /// + /// + /// The extended database blob auditing policy. + /// /// /// The cancellation token. /// - public static async Task> ListByDatabaseAsync(this IExtendedDatabaseBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this IExtendedDatabaseBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, string databaseName, ExtendedDatabaseBlobAuditingPolicy parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByDatabaseWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ExtendedServerBlobAuditingPoliciesOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ExtendedServerBlobAuditingPoliciesOperations.cs index 3b32da5af6af..8f21dfee8e80 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ExtendedServerBlobAuditingPoliciesOperations.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ExtendedServerBlobAuditingPoliciesOperations.cs @@ -51,7 +51,7 @@ internal ExtendedServerBlobAuditingPoliciesOperations(SqlManagementClient client public SqlManagementClient Client { get; private set; } /// - /// Gets an extended server's blob auditing policy. + /// Lists extended auditing settings of a server. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -81,7 +81,7 @@ internal ExtendedServerBlobAuditingPoliciesOperations(SqlManagementClient client /// /// 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)) + public async Task>> ListByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -95,8 +95,7 @@ internal ExtendedServerBlobAuditingPoliciesOperations(SqlManagementClient client { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string blobAuditingPolicyName = "default"; - string apiVersion = "2020-11-01-preview"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -106,17 +105,15 @@ internal ExtendedServerBlobAuditingPoliciesOperations(SqlManagementClient client Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serverName", serverName); - tracingParameters.Add("blobAuditingPolicyName", blobAuditingPolicyName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByServer", 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}/extendedAuditingSettings/{blobAuditingPolicyName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/extendedAuditingSettings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); - _url = _url.Replace("{blobAuditingPolicyName}", System.Uri.EscapeDataString(blobAuditingPolicyName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -216,7 +213,7 @@ internal ExtendedServerBlobAuditingPoliciesOperations(SqlManagementClient client throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -229,7 +226,7 @@ internal ExtendedServerBlobAuditingPoliciesOperations(SqlManagementClient client _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -249,33 +246,7 @@ internal ExtendedServerBlobAuditingPoliciesOperations(SqlManagementClient client } /// - /// Creates or updates an extended server's blob auditing policy. - /// - /// - /// 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. - /// - /// - /// Properties of extended blob auditing policy - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, ExtendedServerBlobAuditingPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Lists extended auditing settings of a server. + /// Gets an extended server's blob auditing policy. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -305,7 +276,7 @@ internal ExtendedServerBlobAuditingPoliciesOperations(SqlManagementClient client /// /// A response object containing the response body and response headers. /// - public async Task>> ListByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -319,7 +290,8 @@ internal ExtendedServerBlobAuditingPoliciesOperations(SqlManagementClient client { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01-preview"; + string blobAuditingPolicyName = "default"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -329,15 +301,17 @@ internal ExtendedServerBlobAuditingPoliciesOperations(SqlManagementClient client Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serverName", serverName); + tracingParameters.Add("blobAuditingPolicyName", blobAuditingPolicyName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByServer", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/extendedAuditingSettings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/extendedAuditingSettings/{blobAuditingPolicyName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); + _url = _url.Replace("{blobAuditingPolicyName}", System.Uri.EscapeDataString(blobAuditingPolicyName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -437,7 +411,7 @@ internal ExtendedServerBlobAuditingPoliciesOperations(SqlManagementClient client throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -450,7 +424,7 @@ internal ExtendedServerBlobAuditingPoliciesOperations(SqlManagementClient client _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -469,6 +443,32 @@ internal ExtendedServerBlobAuditingPoliciesOperations(SqlManagementClient client return _result; } + /// + /// Creates or updates an extended server's blob auditing policy. + /// + /// + /// 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. + /// + /// + /// Properties of extended blob auditing policy + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, ExtendedServerBlobAuditingPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + /// /// Creates or updates an extended server's blob auditing policy. /// @@ -526,7 +526,7 @@ internal ExtendedServerBlobAuditingPoliciesOperations(SqlManagementClient client throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } string blobAuditingPolicyName = "default"; - string apiVersion = "2020-11-01-preview"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ExtendedServerBlobAuditingPoliciesOperationsExtensions.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ExtendedServerBlobAuditingPoliciesOperationsExtensions.cs index 3d6509c3d1a1..58300f319ff3 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ExtendedServerBlobAuditingPoliciesOperationsExtensions.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ExtendedServerBlobAuditingPoliciesOperationsExtensions.cs @@ -22,7 +22,7 @@ namespace Microsoft.Azure.Management.Sql public static partial class ExtendedServerBlobAuditingPoliciesOperationsExtensions { /// - /// Gets an extended server's blob auditing policy. + /// Lists extended auditing settings of a server. /// /// /// The operations group for this extension method. @@ -34,13 +34,13 @@ public static partial class ExtendedServerBlobAuditingPoliciesOperationsExtensio /// /// The name of the server. /// - public static ExtendedServerBlobAuditingPolicy Get(this IExtendedServerBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName) + public static IPage ListByServer(this IExtendedServerBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName) { - return operations.GetAsync(resourceGroupName, serverName).GetAwaiter().GetResult(); + return operations.ListByServerAsync(resourceGroupName, serverName).GetAwaiter().GetResult(); } /// - /// Gets an extended server's blob auditing policy. + /// Lists extended auditing settings of a server. /// /// /// The operations group for this extension method. @@ -55,16 +55,16 @@ public static ExtendedServerBlobAuditingPolicy Get(this IExtendedServerBlobAudit /// /// The cancellation token. /// - public static async Task GetAsync(this IExtendedServerBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByServerAsync(this IExtendedServerBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serverName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByServerWithHttpMessagesAsync(resourceGroupName, serverName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Creates or updates an extended server's blob auditing policy. + /// Gets an extended server's blob auditing policy. /// /// /// The operations group for this extension method. @@ -76,16 +76,13 @@ public static ExtendedServerBlobAuditingPolicy Get(this IExtendedServerBlobAudit /// /// The name of the server. /// - /// - /// Properties of extended blob auditing policy - /// - public static ExtendedServerBlobAuditingPolicy CreateOrUpdate(this IExtendedServerBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, ExtendedServerBlobAuditingPolicy parameters) + public static ExtendedServerBlobAuditingPolicy Get(this IExtendedServerBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName) { - return operations.CreateOrUpdateAsync(resourceGroupName, serverName, parameters).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, serverName).GetAwaiter().GetResult(); } /// - /// Creates or updates an extended server's blob auditing policy. + /// Gets an extended server's blob auditing policy. /// /// /// The operations group for this extension method. @@ -97,22 +94,19 @@ public static ExtendedServerBlobAuditingPolicy CreateOrUpdate(this IExtendedServ /// /// The name of the server. /// - /// - /// Properties of extended blob auditing policy - /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IExtendedServerBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, ExtendedServerBlobAuditingPolicy parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IExtendedServerBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serverName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Lists extended auditing settings of a server. + /// Creates or updates an extended server's blob auditing policy. /// /// /// The operations group for this extension method. @@ -124,13 +118,16 @@ public static ExtendedServerBlobAuditingPolicy CreateOrUpdate(this IExtendedServ /// /// The name of the server. /// - public static IPage ListByServer(this IExtendedServerBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName) + /// + /// Properties of extended blob auditing policy + /// + public static ExtendedServerBlobAuditingPolicy CreateOrUpdate(this IExtendedServerBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, ExtendedServerBlobAuditingPolicy parameters) { - return operations.ListByServerAsync(resourceGroupName, serverName).GetAwaiter().GetResult(); + return operations.CreateOrUpdateAsync(resourceGroupName, serverName, parameters).GetAwaiter().GetResult(); } /// - /// Lists extended auditing settings of a server. + /// Creates or updates an extended server's blob auditing policy. /// /// /// The operations group for this extension method. @@ -142,12 +139,15 @@ public static IPage ListByServer(this IExtende /// /// The name of the server. /// + /// + /// Properties of extended blob auditing policy + /// /// /// The cancellation token. /// - public static async Task> ListByServerAsync(this IExtendedServerBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this IExtendedServerBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, ExtendedServerBlobAuditingPolicy parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByServerWithHttpMessagesAsync(resourceGroupName, serverName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IDatabaseBlobAuditingPoliciesOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IDatabaseBlobAuditingPoliciesOperations.cs index 0c98786e3f93..c0c3775f112b 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IDatabaseBlobAuditingPoliciesOperations.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IDatabaseBlobAuditingPoliciesOperations.cs @@ -24,7 +24,7 @@ namespace Microsoft.Azure.Management.Sql public partial interface IDatabaseBlobAuditingPoliciesOperations { /// - /// Gets a database's blob auditing policy. + /// Lists auditing settings of a database. /// /// /// The name of the resource group that contains the resource. You can @@ -52,9 +52,9 @@ public partial interface IDatabaseBlobAuditingPoliciesOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates a database's blob auditing policy. + /// Gets a database's blob auditing policy. /// /// /// The name of the resource group that contains the resource. You can @@ -67,9 +67,6 @@ public partial interface IDatabaseBlobAuditingPoliciesOperations /// /// The name of the database. /// - /// - /// The database blob auditing policy. - /// /// /// The headers that will be added to request. /// @@ -85,9 +82,9 @@ public partial interface IDatabaseBlobAuditingPoliciesOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, DatabaseBlobAuditingPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists auditing settings of a database. + /// Creates or updates a database's blob auditing policy. /// /// /// The name of the resource group that contains the resource. You can @@ -100,6 +97,9 @@ public partial interface IDatabaseBlobAuditingPoliciesOperations /// /// The name of the database. /// + /// + /// The database blob auditing policy. + /// /// /// The headers that will be added to request. /// @@ -115,7 +115,7 @@ public partial interface IDatabaseBlobAuditingPoliciesOperations /// /// Thrown when a required parameter is null /// - Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, DatabaseBlobAuditingPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists auditing settings of a database. /// diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IExtendedDatabaseBlobAuditingPoliciesOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IExtendedDatabaseBlobAuditingPoliciesOperations.cs index a98f84875167..73782a6cc742 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IExtendedDatabaseBlobAuditingPoliciesOperations.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IExtendedDatabaseBlobAuditingPoliciesOperations.cs @@ -24,7 +24,7 @@ namespace Microsoft.Azure.Management.Sql public partial interface IExtendedDatabaseBlobAuditingPoliciesOperations { /// - /// Gets an extended database's blob auditing policy. + /// Lists extended auditing settings of a database. /// /// /// The name of the resource group that contains the resource. You can @@ -52,9 +52,9 @@ public partial interface IExtendedDatabaseBlobAuditingPoliciesOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates an extended database's blob auditing policy. + /// Gets an extended database's blob auditing policy. /// /// /// The name of the resource group that contains the resource. You can @@ -67,9 +67,6 @@ public partial interface IExtendedDatabaseBlobAuditingPoliciesOperations /// /// The name of the database. /// - /// - /// The extended database blob auditing policy. - /// /// /// The headers that will be added to request. /// @@ -85,9 +82,9 @@ public partial interface IExtendedDatabaseBlobAuditingPoliciesOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, ExtendedDatabaseBlobAuditingPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists extended auditing settings of a database. + /// Creates or updates an extended database's blob auditing policy. /// /// /// The name of the resource group that contains the resource. You can @@ -100,6 +97,9 @@ public partial interface IExtendedDatabaseBlobAuditingPoliciesOperations /// /// The name of the database. /// + /// + /// The extended database blob auditing policy. + /// /// /// The headers that will be added to request. /// @@ -115,7 +115,7 @@ public partial interface IExtendedDatabaseBlobAuditingPoliciesOperations /// /// Thrown when a required parameter is null /// - Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, ExtendedDatabaseBlobAuditingPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists extended auditing settings of a database. /// diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IExtendedServerBlobAuditingPoliciesOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IExtendedServerBlobAuditingPoliciesOperations.cs index 5be793c26674..020e9acf3819 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IExtendedServerBlobAuditingPoliciesOperations.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IExtendedServerBlobAuditingPoliciesOperations.cs @@ -24,7 +24,7 @@ namespace Microsoft.Azure.Management.Sql public partial interface IExtendedServerBlobAuditingPoliciesOperations { /// - /// Gets an extended server's blob auditing policy. + /// Lists extended auditing settings of a server. /// /// /// The name of the resource group that contains the resource. You can @@ -49,9 +49,9 @@ public partial interface IExtendedServerBlobAuditingPoliciesOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates an extended server's blob auditing policy. + /// Gets an extended server's blob auditing policy. /// /// /// The name of the resource group that contains the resource. You can @@ -61,9 +61,6 @@ public partial interface IExtendedServerBlobAuditingPoliciesOperations /// /// The name of the server. /// - /// - /// Properties of extended blob auditing policy - /// /// /// The headers that will be added to request. /// @@ -79,9 +76,9 @@ public partial interface IExtendedServerBlobAuditingPoliciesOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, ExtendedServerBlobAuditingPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists extended auditing settings of a server. + /// Creates or updates an extended server's blob auditing policy. /// /// /// The name of the resource group that contains the resource. You can @@ -91,6 +88,9 @@ public partial interface IExtendedServerBlobAuditingPoliciesOperations /// /// The name of the server. /// + /// + /// Properties of extended blob auditing policy + /// /// /// The headers that will be added to request. /// @@ -106,7 +106,7 @@ public partial interface IExtendedServerBlobAuditingPoliciesOperations /// /// Thrown when a required parameter is null /// - Task>> ListByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, ExtendedServerBlobAuditingPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Creates or updates an extended server's blob auditing policy. /// diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IServerBlobAuditingPoliciesOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IServerBlobAuditingPoliciesOperations.cs index 2713643b8354..1d8af9d95963 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IServerBlobAuditingPoliciesOperations.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IServerBlobAuditingPoliciesOperations.cs @@ -24,7 +24,7 @@ namespace Microsoft.Azure.Management.Sql public partial interface IServerBlobAuditingPoliciesOperations { /// - /// Gets a server's blob auditing policy. + /// Lists auditing settings of a server. /// /// /// The name of the resource group that contains the resource. You can @@ -49,9 +49,9 @@ public partial interface IServerBlobAuditingPoliciesOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates a server's blob auditing policy. + /// Gets a server's blob auditing policy. /// /// /// The name of the resource group that contains the resource. You can @@ -61,9 +61,6 @@ public partial interface IServerBlobAuditingPoliciesOperations /// /// The name of the server. /// - /// - /// Properties of blob auditing policy - /// /// /// The headers that will be added to request. /// @@ -79,9 +76,9 @@ public partial interface IServerBlobAuditingPoliciesOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, ServerBlobAuditingPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists auditing settings of a server. + /// Creates or updates a server's blob auditing policy. /// /// /// The name of the resource group that contains the resource. You can @@ -91,6 +88,9 @@ public partial interface IServerBlobAuditingPoliciesOperations /// /// The name of the server. /// + /// + /// Properties of blob auditing policy + /// /// /// The headers that will be added to request. /// @@ -106,7 +106,7 @@ public partial interface IServerBlobAuditingPoliciesOperations /// /// Thrown when a required parameter is null /// - Task>> ListByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, ServerBlobAuditingPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Creates or updates a server's blob auditing policy. /// diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ISqlManagementClient.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ISqlManagementClient.cs index a1ad46e1ac1b..eb60ce2a0ec7 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ISqlManagementClient.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ISqlManagementClient.cs @@ -127,26 +127,6 @@ public partial interface ISqlManagementClient : System.IDisposable /// IServerUsagesOperations ServerUsages { get; } - /// - /// Gets the IExtendedDatabaseBlobAuditingPoliciesOperations. - /// - IExtendedDatabaseBlobAuditingPoliciesOperations ExtendedDatabaseBlobAuditingPolicies { get; } - - /// - /// Gets the IExtendedServerBlobAuditingPoliciesOperations. - /// - IExtendedServerBlobAuditingPoliciesOperations ExtendedServerBlobAuditingPolicies { get; } - - /// - /// Gets the IServerBlobAuditingPoliciesOperations. - /// - IServerBlobAuditingPoliciesOperations ServerBlobAuditingPolicies { get; } - - /// - /// Gets the IDatabaseBlobAuditingPoliciesOperations. - /// - IDatabaseBlobAuditingPoliciesOperations DatabaseBlobAuditingPolicies { get; } - /// /// Gets the IDatabaseAdvisorsOperations. /// @@ -677,5 +657,25 @@ public partial interface ISqlManagementClient : System.IDisposable /// IRecommendedSensitivityLabelsOperations RecommendedSensitivityLabels { get; } + /// + /// Gets the IServerBlobAuditingPoliciesOperations. + /// + IServerBlobAuditingPoliciesOperations ServerBlobAuditingPolicies { get; } + + /// + /// Gets the IDatabaseBlobAuditingPoliciesOperations. + /// + IDatabaseBlobAuditingPoliciesOperations DatabaseBlobAuditingPolicies { get; } + + /// + /// Gets the IExtendedDatabaseBlobAuditingPoliciesOperations. + /// + IExtendedDatabaseBlobAuditingPoliciesOperations ExtendedDatabaseBlobAuditingPolicies { get; } + + /// + /// Gets the IExtendedServerBlobAuditingPoliciesOperations. + /// + IExtendedServerBlobAuditingPoliciesOperations ExtendedServerBlobAuditingPolicies { get; } + } } diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/DatabaseBlobAuditingPolicy.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/DatabaseBlobAuditingPolicy.cs index c49e7503cda1..20341ec3952d 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/DatabaseBlobAuditingPolicy.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/DatabaseBlobAuditingPolicy.cs @@ -82,6 +82,10 @@ public DatabaseBlobAuditingPolicy() /// USER_CHANGE_PASSWORD_GROUP /// BATCH_STARTED_GROUP /// BATCH_COMPLETED_GROUP + /// DBCC_GROUP + /// DATABASE_OWNERSHIP_CHANGE_GROUP + /// DATABASE_CHANGE_GROUP + /// LEDGER_OPERATION_GROUP /// /// These are groups that cover all sql statements and stored /// procedures executed against the database, and should not be used in @@ -145,6 +149,8 @@ public DatabaseBlobAuditingPolicy() /// processed. /// The default minimum value is 1000 (1 second). The maximum is /// 2,147,483,647. + /// Specifies whether Managed + /// Identity is used to access blob storage /// Specifies the blob storage endpoint /// (e.g. https://MyAccount.blob.core.windows.net). If state is /// Enabled, storageEndpoint or isAzureMonitorTargetEnabled is @@ -165,7 +171,7 @@ public DatabaseBlobAuditingPolicy() /// authentication](https://go.microsoft.com/fwlink/?linkid=2114355) /// Specifies the blob /// storage subscription Id. - public DatabaseBlobAuditingPolicy(BlobAuditingPolicyState state, string id = default(string), string name = default(string), string type = default(string), string kind = default(string), int? retentionDays = default(int?), IList auditActionsAndGroups = default(IList), bool? isStorageSecondaryKeyInUse = default(bool?), bool? isAzureMonitorTargetEnabled = default(bool?), int? queueDelayMs = default(int?), string storageEndpoint = default(string), string storageAccountAccessKey = default(string), System.Guid? storageAccountSubscriptionId = default(System.Guid?)) + public DatabaseBlobAuditingPolicy(BlobAuditingPolicyState state, string id = default(string), string name = default(string), string type = default(string), string kind = default(string), int? retentionDays = default(int?), IList auditActionsAndGroups = default(IList), bool? isStorageSecondaryKeyInUse = default(bool?), bool? isAzureMonitorTargetEnabled = default(bool?), int? queueDelayMs = default(int?), bool? isManagedIdentityInUse = default(bool?), string storageEndpoint = default(string), string storageAccountAccessKey = default(string), System.Guid? storageAccountSubscriptionId = default(System.Guid?)) : base(id, name, type) { Kind = kind; @@ -174,6 +180,7 @@ public DatabaseBlobAuditingPolicy() IsStorageSecondaryKeyInUse = isStorageSecondaryKeyInUse; IsAzureMonitorTargetEnabled = isAzureMonitorTargetEnabled; QueueDelayMs = queueDelayMs; + IsManagedIdentityInUse = isManagedIdentityInUse; State = state; StorageEndpoint = storageEndpoint; StorageAccountAccessKey = storageAccountAccessKey; @@ -238,6 +245,10 @@ public DatabaseBlobAuditingPolicy() /// USER_CHANGE_PASSWORD_GROUP /// BATCH_STARTED_GROUP /// BATCH_COMPLETED_GROUP + /// DBCC_GROUP + /// DATABASE_OWNERSHIP_CHANGE_GROUP + /// DATABASE_CHANGE_GROUP + /// LEDGER_OPERATION_GROUP /// /// These are groups that cover all sql statements and stored /// procedures executed against the database, and should not be used in @@ -319,6 +330,13 @@ public DatabaseBlobAuditingPolicy() [JsonProperty(PropertyName = "properties.queueDelayMs")] public int? QueueDelayMs { get; set; } + /// + /// Gets or sets specifies whether Managed Identity is used to access + /// blob storage + /// + [JsonProperty(PropertyName = "properties.isManagedIdentityInUse")] + public bool? IsManagedIdentityInUse { get; set; } + /// /// Gets or sets specifies the state of the audit. If state is Enabled, /// storageEndpoint or isAzureMonitorTargetEnabled are required. diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/ExtendedDatabaseBlobAuditingPolicy.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/ExtendedDatabaseBlobAuditingPolicy.cs index dd8150e3ac2d..b1682d9ef99c 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/ExtendedDatabaseBlobAuditingPolicy.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/ExtendedDatabaseBlobAuditingPolicy.cs @@ -85,6 +85,10 @@ public ExtendedDatabaseBlobAuditingPolicy() /// USER_CHANGE_PASSWORD_GROUP /// BATCH_STARTED_GROUP /// BATCH_COMPLETED_GROUP + /// DBCC_GROUP + /// DATABASE_OWNERSHIP_CHANGE_GROUP + /// DATABASE_CHANGE_GROUP + /// LEDGER_OPERATION_GROUP /// /// These are groups that cover all sql statements and stored /// procedures executed against the database, and should not be used in @@ -148,6 +152,8 @@ public ExtendedDatabaseBlobAuditingPolicy() /// processed. /// The default minimum value is 1000 (1 second). The maximum is /// 2,147,483,647. + /// Specifies whether Managed + /// Identity is used to access blob storage /// Specifies the blob storage endpoint /// (e.g. https://MyAccount.blob.core.windows.net). If state is /// Enabled, storageEndpoint or isAzureMonitorTargetEnabled is @@ -168,7 +174,7 @@ public ExtendedDatabaseBlobAuditingPolicy() /// authentication](https://go.microsoft.com/fwlink/?linkid=2114355) /// Specifies the blob /// storage subscription Id. - public ExtendedDatabaseBlobAuditingPolicy(BlobAuditingPolicyState state, string id = default(string), string name = default(string), string type = default(string), string predicateExpression = default(string), int? retentionDays = default(int?), IList auditActionsAndGroups = default(IList), bool? isStorageSecondaryKeyInUse = default(bool?), bool? isAzureMonitorTargetEnabled = default(bool?), int? queueDelayMs = default(int?), string storageEndpoint = default(string), string storageAccountAccessKey = default(string), System.Guid? storageAccountSubscriptionId = default(System.Guid?)) + public ExtendedDatabaseBlobAuditingPolicy(BlobAuditingPolicyState state, string id = default(string), string name = default(string), string type = default(string), string predicateExpression = default(string), int? retentionDays = default(int?), IList auditActionsAndGroups = default(IList), bool? isStorageSecondaryKeyInUse = default(bool?), bool? isAzureMonitorTargetEnabled = default(bool?), int? queueDelayMs = default(int?), bool? isManagedIdentityInUse = default(bool?), string storageEndpoint = default(string), string storageAccountAccessKey = default(string), System.Guid? storageAccountSubscriptionId = default(System.Guid?)) : base(id, name, type) { PredicateExpression = predicateExpression; @@ -177,6 +183,7 @@ public ExtendedDatabaseBlobAuditingPolicy() IsStorageSecondaryKeyInUse = isStorageSecondaryKeyInUse; IsAzureMonitorTargetEnabled = isAzureMonitorTargetEnabled; QueueDelayMs = queueDelayMs; + IsManagedIdentityInUse = isManagedIdentityInUse; State = state; StorageEndpoint = storageEndpoint; StorageAccountAccessKey = storageAccountAccessKey; @@ -242,6 +249,10 @@ public ExtendedDatabaseBlobAuditingPolicy() /// USER_CHANGE_PASSWORD_GROUP /// BATCH_STARTED_GROUP /// BATCH_COMPLETED_GROUP + /// DBCC_GROUP + /// DATABASE_OWNERSHIP_CHANGE_GROUP + /// DATABASE_CHANGE_GROUP + /// LEDGER_OPERATION_GROUP /// /// These are groups that cover all sql statements and stored /// procedures executed against the database, and should not be used in @@ -323,6 +334,13 @@ public ExtendedDatabaseBlobAuditingPolicy() [JsonProperty(PropertyName = "properties.queueDelayMs")] public int? QueueDelayMs { get; set; } + /// + /// Gets or sets specifies whether Managed Identity is used to access + /// blob storage + /// + [JsonProperty(PropertyName = "properties.isManagedIdentityInUse")] + public bool? IsManagedIdentityInUse { get; set; } + /// /// Gets or sets specifies the state of the audit. If state is Enabled, /// storageEndpoint or isAzureMonitorTargetEnabled are required. diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/ExtendedServerBlobAuditingPolicy.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/ExtendedServerBlobAuditingPolicy.cs index 99347d827197..8c1515292962 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/ExtendedServerBlobAuditingPolicy.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/ExtendedServerBlobAuditingPolicy.cs @@ -105,6 +105,10 @@ public ExtendedServerBlobAuditingPolicy() /// USER_CHANGE_PASSWORD_GROUP /// BATCH_STARTED_GROUP /// BATCH_COMPLETED_GROUP + /// DBCC_GROUP + /// DATABASE_OWNERSHIP_CHANGE_GROUP + /// DATABASE_CHANGE_GROUP + /// LEDGER_OPERATION_GROUP /// /// These are groups that cover all sql statements and stored /// procedures executed against the database, and should not be used in @@ -168,6 +172,8 @@ public ExtendedServerBlobAuditingPolicy() /// processed. /// The default minimum value is 1000 (1 second). The maximum is /// 2,147,483,647. + /// Specifies whether Managed + /// Identity is used to access blob storage /// Specifies the blob storage endpoint /// (e.g. https://MyAccount.blob.core.windows.net). If state is /// Enabled, storageEndpoint or isAzureMonitorTargetEnabled is @@ -188,7 +194,7 @@ public ExtendedServerBlobAuditingPolicy() /// authentication](https://go.microsoft.com/fwlink/?linkid=2114355) /// Specifies the blob /// storage subscription Id. - public ExtendedServerBlobAuditingPolicy(BlobAuditingPolicyState state, string id = default(string), string name = default(string), string type = default(string), bool? isDevopsAuditEnabled = default(bool?), string predicateExpression = default(string), int? retentionDays = default(int?), IList auditActionsAndGroups = default(IList), bool? isStorageSecondaryKeyInUse = default(bool?), bool? isAzureMonitorTargetEnabled = default(bool?), int? queueDelayMs = default(int?), string storageEndpoint = default(string), string storageAccountAccessKey = default(string), System.Guid? storageAccountSubscriptionId = default(System.Guid?)) + public ExtendedServerBlobAuditingPolicy(BlobAuditingPolicyState state, string id = default(string), string name = default(string), string type = default(string), bool? isDevopsAuditEnabled = default(bool?), string predicateExpression = default(string), int? retentionDays = default(int?), IList auditActionsAndGroups = default(IList), bool? isStorageSecondaryKeyInUse = default(bool?), bool? isAzureMonitorTargetEnabled = default(bool?), int? queueDelayMs = default(int?), bool? isManagedIdentityInUse = default(bool?), string storageEndpoint = default(string), string storageAccountAccessKey = default(string), System.Guid? storageAccountSubscriptionId = default(System.Guid?)) : base(id, name, type) { IsDevopsAuditEnabled = isDevopsAuditEnabled; @@ -198,6 +204,7 @@ public ExtendedServerBlobAuditingPolicy() IsStorageSecondaryKeyInUse = isStorageSecondaryKeyInUse; IsAzureMonitorTargetEnabled = isAzureMonitorTargetEnabled; QueueDelayMs = queueDelayMs; + IsManagedIdentityInUse = isManagedIdentityInUse; State = state; StorageEndpoint = storageEndpoint; StorageAccountAccessKey = storageAccountAccessKey; @@ -287,6 +294,10 @@ public ExtendedServerBlobAuditingPolicy() /// USER_CHANGE_PASSWORD_GROUP /// BATCH_STARTED_GROUP /// BATCH_COMPLETED_GROUP + /// DBCC_GROUP + /// DATABASE_OWNERSHIP_CHANGE_GROUP + /// DATABASE_CHANGE_GROUP + /// LEDGER_OPERATION_GROUP /// /// These are groups that cover all sql statements and stored /// procedures executed against the database, and should not be used in @@ -368,6 +379,13 @@ public ExtendedServerBlobAuditingPolicy() [JsonProperty(PropertyName = "properties.queueDelayMs")] public int? QueueDelayMs { get; set; } + /// + /// Gets or sets specifies whether Managed Identity is used to access + /// blob storage + /// + [JsonProperty(PropertyName = "properties.isManagedIdentityInUse")] + public bool? IsManagedIdentityInUse { get; set; } + /// /// Gets or sets specifies the state of the audit. If state is Enabled, /// storageEndpoint or isAzureMonitorTargetEnabled are required. diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/ServerBlobAuditingPolicy.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/ServerBlobAuditingPolicy.cs index 5b3f8efae406..082ad011c7e8 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/ServerBlobAuditingPolicy.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/ServerBlobAuditingPolicy.cs @@ -101,6 +101,10 @@ public ServerBlobAuditingPolicy() /// USER_CHANGE_PASSWORD_GROUP /// BATCH_STARTED_GROUP /// BATCH_COMPLETED_GROUP + /// DBCC_GROUP + /// DATABASE_OWNERSHIP_CHANGE_GROUP + /// DATABASE_CHANGE_GROUP + /// LEDGER_OPERATION_GROUP /// /// These are groups that cover all sql statements and stored /// procedures executed against the database, and should not be used in @@ -164,6 +168,8 @@ public ServerBlobAuditingPolicy() /// processed. /// The default minimum value is 1000 (1 second). The maximum is /// 2,147,483,647. + /// Specifies whether Managed + /// Identity is used to access blob storage /// Specifies the blob storage endpoint /// (e.g. https://MyAccount.blob.core.windows.net). If state is /// Enabled, storageEndpoint or isAzureMonitorTargetEnabled is @@ -184,7 +190,7 @@ public ServerBlobAuditingPolicy() /// authentication](https://go.microsoft.com/fwlink/?linkid=2114355) /// Specifies the blob /// storage subscription Id. - public ServerBlobAuditingPolicy(BlobAuditingPolicyState state, string id = default(string), string name = default(string), string type = default(string), bool? isDevopsAuditEnabled = default(bool?), int? retentionDays = default(int?), IList auditActionsAndGroups = default(IList), bool? isStorageSecondaryKeyInUse = default(bool?), bool? isAzureMonitorTargetEnabled = default(bool?), int? queueDelayMs = default(int?), string storageEndpoint = default(string), string storageAccountAccessKey = default(string), System.Guid? storageAccountSubscriptionId = default(System.Guid?)) + public ServerBlobAuditingPolicy(BlobAuditingPolicyState state, string id = default(string), string name = default(string), string type = default(string), bool? isDevopsAuditEnabled = default(bool?), int? retentionDays = default(int?), IList auditActionsAndGroups = default(IList), bool? isStorageSecondaryKeyInUse = default(bool?), bool? isAzureMonitorTargetEnabled = default(bool?), int? queueDelayMs = default(int?), bool? isManagedIdentityInUse = default(bool?), string storageEndpoint = default(string), string storageAccountAccessKey = default(string), System.Guid? storageAccountSubscriptionId = default(System.Guid?)) : base(id, name, type) { IsDevopsAuditEnabled = isDevopsAuditEnabled; @@ -193,6 +199,7 @@ public ServerBlobAuditingPolicy() IsStorageSecondaryKeyInUse = isStorageSecondaryKeyInUse; IsAzureMonitorTargetEnabled = isAzureMonitorTargetEnabled; QueueDelayMs = queueDelayMs; + IsManagedIdentityInUse = isManagedIdentityInUse; State = state; StorageEndpoint = storageEndpoint; StorageAccountAccessKey = storageAccountAccessKey; @@ -275,6 +282,10 @@ public ServerBlobAuditingPolicy() /// USER_CHANGE_PASSWORD_GROUP /// BATCH_STARTED_GROUP /// BATCH_COMPLETED_GROUP + /// DBCC_GROUP + /// DATABASE_OWNERSHIP_CHANGE_GROUP + /// DATABASE_CHANGE_GROUP + /// LEDGER_OPERATION_GROUP /// /// These are groups that cover all sql statements and stored /// procedures executed against the database, and should not be used in @@ -356,6 +367,13 @@ public ServerBlobAuditingPolicy() [JsonProperty(PropertyName = "properties.queueDelayMs")] public int? QueueDelayMs { get; set; } + /// + /// Gets or sets specifies whether Managed Identity is used to access + /// blob storage + /// + [JsonProperty(PropertyName = "properties.isManagedIdentityInUse")] + public bool? IsManagedIdentityInUse { get; set; } + /// /// Gets or sets specifies the state of the audit. If state is Enabled, /// storageEndpoint or isAzureMonitorTargetEnabled are required. diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SdkInfo_SqlManagementClient.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SdkInfo_SqlManagementClient.cs index 51f75214a9b0..fd898ca0ff5b 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SdkInfo_SqlManagementClient.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SdkInfo_SqlManagementClient.cs @@ -26,7 +26,7 @@ public static IEnumerable> ApiInfo_SqlManagementCl new Tuple("Sql", "DataWarehouseUserActivities", "2020-11-01-preview"), new Tuple("Sql", "DatabaseAdvisors", "2020-11-01-preview"), new Tuple("Sql", "DatabaseAutomaticTuning", "2020-11-01-preview"), - new Tuple("Sql", "DatabaseBlobAuditingPolicies", "2020-11-01-preview"), + new Tuple("Sql", "DatabaseBlobAuditingPolicies", "2021-11-01-preview"), new Tuple("Sql", "DatabaseColumns", "2020-11-01-preview"), new Tuple("Sql", "DatabaseExtensions", "2021-02-01-preview"), new Tuple("Sql", "DatabaseOperations", "2021-02-01-preview"), @@ -49,8 +49,8 @@ public static IEnumerable> ApiInfo_SqlManagementCl new Tuple("Sql", "ElasticPools", "2021-08-01-preview"), new Tuple("Sql", "EncryptionProtectors", "2020-11-01-preview"), new Tuple("Sql", "EndpointCertificates", "2021-11-01-preview"), - new Tuple("Sql", "ExtendedDatabaseBlobAuditingPolicies", "2020-11-01-preview"), - new Tuple("Sql", "ExtendedServerBlobAuditingPolicies", "2020-11-01-preview"), + new Tuple("Sql", "ExtendedDatabaseBlobAuditingPolicies", "2021-11-01-preview"), + new Tuple("Sql", "ExtendedServerBlobAuditingPolicies", "2021-11-01-preview"), new Tuple("Sql", "FailoverGroups", "2020-11-01-preview"), new Tuple("Sql", "FirewallRules", "2020-11-01-preview"), new Tuple("Sql", "GeoBackupPolicies", "2014-04-01"), @@ -117,7 +117,7 @@ public static IEnumerable> ApiInfo_SqlManagementCl new Tuple("Sql", "ServerAutomaticTuning", "2020-11-01-preview"), new Tuple("Sql", "ServerAzureADAdministrators", "2020-11-01-preview"), new Tuple("Sql", "ServerAzureADOnlyAuthentications", "2020-11-01-preview"), - new Tuple("Sql", "ServerBlobAuditingPolicies", "2020-11-01-preview"), + new Tuple("Sql", "ServerBlobAuditingPolicies", "2021-11-01-preview"), new Tuple("Sql", "ServerCommunicationLinks", "2014-04-01"), new Tuple("Sql", "ServerConnectionPolicies", "2021-05-01-preview"), new Tuple("Sql", "ServerDevOpsAuditSettings", "2020-11-01-preview"), @@ -153,7 +153,7 @@ public static IEnumerable> ApiInfo_SqlManagementCl public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/main/specification/sql/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=D:\\vs\\gh_repos\\azure-sdk-for-net\\sdk"; public static readonly String GithubForkName = "Azure"; public static readonly String GithubBranchName = "main"; - public static readonly String GithubCommidId = "b5d8eef5bf187dc99f1c18e8323b19e0c37a7124"; + public static readonly String GithubCommidId = "ea9af04161c73743cdb40c1439a3046f16f35f71"; public static readonly String CodeGenerationErrors = ""; public static readonly String GithubRepoName = "azure-rest-api-specs"; // END: Code Generation Metadata Section diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ServerBlobAuditingPoliciesOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ServerBlobAuditingPoliciesOperations.cs index 07ace45490fe..fa1e259179be 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ServerBlobAuditingPoliciesOperations.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ServerBlobAuditingPoliciesOperations.cs @@ -51,7 +51,7 @@ internal ServerBlobAuditingPoliciesOperations(SqlManagementClient client) public SqlManagementClient Client { get; private set; } /// - /// Gets a server's blob auditing policy. + /// Lists auditing settings of a server. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -81,7 +81,7 @@ internal ServerBlobAuditingPoliciesOperations(SqlManagementClient client) /// /// 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)) + public async Task>> ListByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -95,8 +95,7 @@ internal ServerBlobAuditingPoliciesOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string blobAuditingPolicyName = "default"; - string apiVersion = "2020-11-01-preview"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -106,17 +105,15 @@ internal ServerBlobAuditingPoliciesOperations(SqlManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serverName", serverName); - tracingParameters.Add("blobAuditingPolicyName", blobAuditingPolicyName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByServer", 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}/auditingSettings/{blobAuditingPolicyName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingSettings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); - _url = _url.Replace("{blobAuditingPolicyName}", System.Uri.EscapeDataString(blobAuditingPolicyName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -216,7 +213,7 @@ internal ServerBlobAuditingPoliciesOperations(SqlManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -229,7 +226,7 @@ internal ServerBlobAuditingPoliciesOperations(SqlManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -249,33 +246,7 @@ internal ServerBlobAuditingPoliciesOperations(SqlManagementClient client) } /// - /// Creates or updates a server's blob auditing policy. - /// - /// - /// 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. - /// - /// - /// Properties of blob auditing policy - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, ServerBlobAuditingPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Lists auditing settings of a server. + /// Gets a server's blob auditing policy. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -305,7 +276,7 @@ internal ServerBlobAuditingPoliciesOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -319,7 +290,8 @@ internal ServerBlobAuditingPoliciesOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01-preview"; + string blobAuditingPolicyName = "default"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -329,15 +301,17 @@ internal ServerBlobAuditingPoliciesOperations(SqlManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serverName", serverName); + tracingParameters.Add("blobAuditingPolicyName", blobAuditingPolicyName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByServer", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingSettings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingSettings/{blobAuditingPolicyName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); + _url = _url.Replace("{blobAuditingPolicyName}", System.Uri.EscapeDataString(blobAuditingPolicyName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -437,7 +411,7 @@ internal ServerBlobAuditingPoliciesOperations(SqlManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -450,7 +424,7 @@ internal ServerBlobAuditingPoliciesOperations(SqlManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -469,6 +443,32 @@ internal ServerBlobAuditingPoliciesOperations(SqlManagementClient client) return _result; } + /// + /// Creates or updates a server's blob auditing policy. + /// + /// + /// 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. + /// + /// + /// Properties of blob auditing policy + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, ServerBlobAuditingPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + /// /// Creates or updates a server's blob auditing policy. /// @@ -526,7 +526,7 @@ internal ServerBlobAuditingPoliciesOperations(SqlManagementClient client) throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } string blobAuditingPolicyName = "default"; - string apiVersion = "2020-11-01-preview"; + string apiVersion = "2021-11-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ServerBlobAuditingPoliciesOperationsExtensions.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ServerBlobAuditingPoliciesOperationsExtensions.cs index 7a9d9d1085f0..f8785949d5ec 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ServerBlobAuditingPoliciesOperationsExtensions.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ServerBlobAuditingPoliciesOperationsExtensions.cs @@ -22,7 +22,7 @@ namespace Microsoft.Azure.Management.Sql public static partial class ServerBlobAuditingPoliciesOperationsExtensions { /// - /// Gets a server's blob auditing policy. + /// Lists auditing settings of a server. /// /// /// The operations group for this extension method. @@ -34,13 +34,13 @@ public static partial class ServerBlobAuditingPoliciesOperationsExtensions /// /// The name of the server. /// - public static ServerBlobAuditingPolicy Get(this IServerBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName) + public static IPage ListByServer(this IServerBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName) { - return operations.GetAsync(resourceGroupName, serverName).GetAwaiter().GetResult(); + return operations.ListByServerAsync(resourceGroupName, serverName).GetAwaiter().GetResult(); } /// - /// Gets a server's blob auditing policy. + /// Lists auditing settings of a server. /// /// /// The operations group for this extension method. @@ -55,16 +55,16 @@ public static ServerBlobAuditingPolicy Get(this IServerBlobAuditingPoliciesOpera /// /// The cancellation token. /// - public static async Task GetAsync(this IServerBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByServerAsync(this IServerBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serverName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByServerWithHttpMessagesAsync(resourceGroupName, serverName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Creates or updates a server's blob auditing policy. + /// Gets a server's blob auditing policy. /// /// /// The operations group for this extension method. @@ -76,16 +76,13 @@ public static ServerBlobAuditingPolicy Get(this IServerBlobAuditingPoliciesOpera /// /// The name of the server. /// - /// - /// Properties of blob auditing policy - /// - public static ServerBlobAuditingPolicy CreateOrUpdate(this IServerBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, ServerBlobAuditingPolicy parameters) + public static ServerBlobAuditingPolicy Get(this IServerBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName) { - return operations.CreateOrUpdateAsync(resourceGroupName, serverName, parameters).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, serverName).GetAwaiter().GetResult(); } /// - /// Creates or updates a server's blob auditing policy. + /// Gets a server's blob auditing policy. /// /// /// The operations group for this extension method. @@ -97,22 +94,19 @@ public static ServerBlobAuditingPolicy CreateOrUpdate(this IServerBlobAuditingPo /// /// The name of the server. /// - /// - /// Properties of blob auditing policy - /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IServerBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, ServerBlobAuditingPolicy parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IServerBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serverName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Lists auditing settings of a server. + /// Creates or updates a server's blob auditing policy. /// /// /// The operations group for this extension method. @@ -124,13 +118,16 @@ public static ServerBlobAuditingPolicy CreateOrUpdate(this IServerBlobAuditingPo /// /// The name of the server. /// - public static IPage ListByServer(this IServerBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName) + /// + /// Properties of blob auditing policy + /// + public static ServerBlobAuditingPolicy CreateOrUpdate(this IServerBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, ServerBlobAuditingPolicy parameters) { - return operations.ListByServerAsync(resourceGroupName, serverName).GetAwaiter().GetResult(); + return operations.CreateOrUpdateAsync(resourceGroupName, serverName, parameters).GetAwaiter().GetResult(); } /// - /// Lists auditing settings of a server. + /// Creates or updates a server's blob auditing policy. /// /// /// The operations group for this extension method. @@ -142,12 +139,15 @@ public static IPage ListByServer(this IServerBlobAudit /// /// The name of the server. /// + /// + /// Properties of blob auditing policy + /// /// /// The cancellation token. /// - public static async Task> ListByServerAsync(this IServerBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this IServerBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, ServerBlobAuditingPolicy parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByServerWithHttpMessagesAsync(resourceGroupName, serverName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SqlManagementClient.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SqlManagementClient.cs index 62d3767aeb4f..112cf2e84262 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SqlManagementClient.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SqlManagementClient.cs @@ -132,26 +132,6 @@ public partial class SqlManagementClient : ServiceClient, I /// public virtual IServerUsagesOperations ServerUsages { get; private set; } - /// - /// Gets the IExtendedDatabaseBlobAuditingPoliciesOperations. - /// - public virtual IExtendedDatabaseBlobAuditingPoliciesOperations ExtendedDatabaseBlobAuditingPolicies { get; private set; } - - /// - /// Gets the IExtendedServerBlobAuditingPoliciesOperations. - /// - public virtual IExtendedServerBlobAuditingPoliciesOperations ExtendedServerBlobAuditingPolicies { get; private set; } - - /// - /// Gets the IServerBlobAuditingPoliciesOperations. - /// - public virtual IServerBlobAuditingPoliciesOperations ServerBlobAuditingPolicies { get; private set; } - - /// - /// Gets the IDatabaseBlobAuditingPoliciesOperations. - /// - public virtual IDatabaseBlobAuditingPoliciesOperations DatabaseBlobAuditingPolicies { get; private set; } - /// /// Gets the IDatabaseAdvisorsOperations. /// @@ -682,6 +662,26 @@ public partial class SqlManagementClient : ServiceClient, I /// public virtual IRecommendedSensitivityLabelsOperations RecommendedSensitivityLabels { get; private set; } + /// + /// Gets the IServerBlobAuditingPoliciesOperations. + /// + public virtual IServerBlobAuditingPoliciesOperations ServerBlobAuditingPolicies { get; private set; } + + /// + /// Gets the IDatabaseBlobAuditingPoliciesOperations. + /// + public virtual IDatabaseBlobAuditingPoliciesOperations DatabaseBlobAuditingPolicies { get; private set; } + + /// + /// Gets the IExtendedDatabaseBlobAuditingPoliciesOperations. + /// + public virtual IExtendedDatabaseBlobAuditingPoliciesOperations ExtendedDatabaseBlobAuditingPolicies { get; private set; } + + /// + /// Gets the IExtendedServerBlobAuditingPoliciesOperations. + /// + public virtual IExtendedServerBlobAuditingPoliciesOperations ExtendedServerBlobAuditingPolicies { get; private set; } + /// /// Initializes a new instance of the SqlManagementClient class. /// @@ -935,10 +935,6 @@ private void Initialize() ElasticPoolActivities = new ElasticPoolActivitiesOperations(this); ElasticPoolDatabaseActivities = new ElasticPoolDatabaseActivitiesOperations(this); ServerUsages = new ServerUsagesOperations(this); - ExtendedDatabaseBlobAuditingPolicies = new ExtendedDatabaseBlobAuditingPoliciesOperations(this); - ExtendedServerBlobAuditingPolicies = new ExtendedServerBlobAuditingPoliciesOperations(this); - ServerBlobAuditingPolicies = new ServerBlobAuditingPoliciesOperations(this); - DatabaseBlobAuditingPolicies = new DatabaseBlobAuditingPoliciesOperations(this); DatabaseAdvisors = new DatabaseAdvisorsOperations(this); DatabaseAutomaticTuning = new DatabaseAutomaticTuningOperations(this); DatabaseColumns = new DatabaseColumnsOperations(this); @@ -1045,6 +1041,10 @@ private void Initialize() ManagedDatabaseRecommendedSensitivityLabels = new ManagedDatabaseRecommendedSensitivityLabelsOperations(this); SensitivityLabels = new SensitivityLabelsOperations(this); RecommendedSensitivityLabels = new RecommendedSensitivityLabelsOperations(this); + ServerBlobAuditingPolicies = new ServerBlobAuditingPoliciesOperations(this); + DatabaseBlobAuditingPolicies = new DatabaseBlobAuditingPoliciesOperations(this); + ExtendedDatabaseBlobAuditingPolicies = new ExtendedDatabaseBlobAuditingPoliciesOperations(this); + ExtendedServerBlobAuditingPolicies = new ExtendedServerBlobAuditingPoliciesOperations(this); BaseUri = new System.Uri("https://management.azure.com"); AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; From abd5114b8db6f09376bedeaa83174d0542d7311c Mon Sep 17 00:00:00 2001 From: Bogdan Ostojic Date: Sun, 1 May 2022 23:28:57 +0200 Subject: [PATCH 09/10] bump to 3.0.0 --- .../src/Microsoft.Azure.Management.Sql.csproj | 2 +- .../src/Properties/AssemblyInfo.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Microsoft.Azure.Management.Sql.csproj b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Microsoft.Azure.Management.Sql.csproj index f9f1c8c79aaf..038bd98be2c3 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Microsoft.Azure.Management.Sql.csproj +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Microsoft.Azure.Management.Sql.csproj @@ -7,7 +7,7 @@ Microsoft.Azure.Management.Sql Azure SQL Management SDK library Microsoft.Azure.Management.Sql - 2.2.1-preview + 3.0.0-preview Microsoft Azure SQL Management;SQL;SQL Management; Date: Thu, 5 May 2022 01:56:58 +0200 Subject: [PATCH 10/10] Bump AssemblyVersion --- .../src/Properties/AssemblyInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Properties/AssemblyInfo.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Properties/AssemblyInfo.cs index ee4c1cb3c0c5..a5b2badc83d6 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Properties/AssemblyInfo.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Properties/AssemblyInfo.cs @@ -20,5 +20,5 @@ [assembly: AssemblyTitle("Microsoft Azure SQL Management Library")] [assembly: AssemblyDescription("Provides management functionality for Microsoft Azure SQL.")] -[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyVersion("3.0.0.0")] [assembly: AssemblyFileVersion("3.0.0.0")]