diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/DatabasesOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/DatabasesOperations.cs index a951489d1804..11fe2d404960 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/DatabasesOperations.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/DatabasesOperations.cs @@ -961,7 +961,7 @@ internal DatabasesOperations(SqlManagementClient client) } /// - /// Gets a list of databases in an elastic pool. + /// Exports a database. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -970,8 +970,99 @@ internal DatabasesOperations(SqlManagementClient client) /// /// The name of the server. /// - /// - /// The name of the elastic pool. + /// + /// The name of the database. + /// + /// + /// The database export request parameters. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> ExportWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, ExportDatabaseDefinition parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginExportWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Failovers a 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 to failover. + /// + /// + /// The type of replica to be failed over. Possible values include: 'Primary', + /// 'ReadableSecondary' + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task FailoverWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string replicaType = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginFailoverWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, replicaType, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Imports a bacpac into a new 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 database import request parameters. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> ImportWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, ImportExistingDatabaseDefinition parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginImportWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Renames a 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 to rename. + /// + /// + /// The resource move definition for renaming this database. /// /// /// Headers that will be added to request. @@ -982,9 +1073,6 @@ internal DatabasesOperations(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 /// @@ -994,7 +1082,7 @@ internal DatabasesOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByElasticPoolWithHttpMessagesAsync(string resourceGroupName, string serverName, string elasticPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task RenameWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, ResourceMoveDefinition parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1004,9 +1092,17 @@ internal DatabasesOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); } - if (elasticPoolName == null) + if (databaseName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "elasticPoolName"); + throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); } if (Client.SubscriptionId == null) { @@ -1022,17 +1118,18 @@ internal DatabasesOperations(SqlManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serverName", serverName); - tracingParameters.Add("elasticPoolName", elasticPoolName); + tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByElasticPool", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Rename", 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}/elasticPools/{elasticPoolName}/databases").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/move").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); - _url = _url.Replace("{elasticPoolName}", System.Uri.EscapeDataString(elasticPoolName)); + _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -1046,7 +1143,7 @@ internal DatabasesOperations(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) @@ -1077,6 +1174,12 @@ internal DatabasesOperations(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) { @@ -1132,31 +1235,13 @@ internal DatabasesOperations(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); @@ -1165,7 +1250,7 @@ internal DatabasesOperations(SqlManagementClient client) } /// - /// Failovers a database. + /// Pauses a database. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -1175,11 +1260,33 @@ internal DatabasesOperations(SqlManagementClient client) /// The name of the server. /// /// - /// The name of the database to failover. + /// The name of the database to be paused. /// - /// - /// The type of replica to be failed over. Possible values include: 'Primary', - /// 'ReadableSecondary' + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> PauseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginPauseWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Resumes a 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 to be resumed. /// /// /// The headers that will be added to request. @@ -1187,15 +1294,41 @@ internal DatabasesOperations(SqlManagementClient client) /// /// The cancellation token. /// - public async Task FailoverWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string replicaType = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ResumeWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginFailoverWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, replicaType, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginResumeWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Gets a list of inaccessible databases in a logical server + /// Upgrades a data warehouse. + /// + /// + /// 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 to be upgraded. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task UpgradeDataWarehouseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginUpgradeDataWarehouseWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a list of databases in an elastic pool. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -1204,6 +1337,9 @@ internal DatabasesOperations(SqlManagementClient client) /// /// The name of the server. /// + /// + /// The name of the elastic pool. + /// /// /// Headers that will be added to request. /// @@ -1225,7 +1361,7 @@ internal DatabasesOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInaccessibleByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByElasticPoolWithHttpMessagesAsync(string resourceGroupName, string serverName, string elasticPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1235,6 +1371,10 @@ internal DatabasesOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); } + if (elasticPoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "elasticPoolName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -1249,15 +1389,17 @@ internal DatabasesOperations(SqlManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serverName", serverName); + tracingParameters.Add("elasticPoolName", elasticPoolName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInaccessibleByServer", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByElasticPool", 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}/inaccessibleDatabases").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/databases").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); + _url = _url.Replace("{elasticPoolName}", System.Uri.EscapeDataString(elasticPoolName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -1390,85 +1532,7 @@ internal DatabasesOperations(SqlManagementClient client) } /// - /// Pauses a 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 to be paused. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> PauseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginPauseWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Resumes a 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 to be resumed. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> ResumeWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginResumeWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Upgrades a data warehouse. - /// - /// - /// 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 to be upgraded. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task UpgradeDataWarehouseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginUpgradeDataWarehouseWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Renames a database. + /// Gets a list of inaccessible databases in a logical server /// /// /// The name of the resource group that contains the resource. You can obtain @@ -1477,12 +1541,6 @@ internal DatabasesOperations(SqlManagementClient client) /// /// The name of the server. /// - /// - /// The name of the database to rename. - /// - /// - /// The resource move definition for renaming this database. - /// /// /// Headers that will be added to request. /// @@ -1492,6 +1550,9 @@ internal DatabasesOperations(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 /// @@ -1501,7 +1562,7 @@ internal DatabasesOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task RenameWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, ResourceMoveDefinition parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInaccessibleByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1511,18 +1572,6 @@ internal DatabasesOperations(SqlManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -1537,18 +1586,15 @@ internal DatabasesOperations(SqlManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serverName", serverName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Rename", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInaccessibleByServer", 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}/move").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/inaccessibleDatabases").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) @@ -1562,7 +1608,7 @@ internal DatabasesOperations(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) @@ -1593,12 +1639,6 @@ internal DatabasesOperations(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) { @@ -1654,76 +1694,36 @@ internal DatabasesOperations(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) + // Deserialize Response + if ((int)_statusCode == 200) { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Imports a bacpac into a new 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 database import request parameters. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> ImportWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, ImportExistingDatabaseDefinition parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginImportWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Exports a 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 database export request parameters. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> ExportWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, ExportDatabaseDefinition parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginExportWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + _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; } /// @@ -2368,7 +2368,7 @@ internal DatabasesOperations(SqlManagementClient client) } /// - /// Failovers a database. + /// Exports a database. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -2378,11 +2378,10 @@ internal DatabasesOperations(SqlManagementClient client) /// The name of the server. /// /// - /// The name of the database to failover. + /// The name of the database. /// - /// - /// The type of replica to be failed over. Possible values include: 'Primary', - /// 'ReadableSecondary' + /// + /// The database export request parameters. /// /// /// Headers that will be added to request. @@ -2393,6 +2392,9 @@ internal DatabasesOperations(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 /// @@ -2402,7 +2404,7 @@ internal DatabasesOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginFailoverWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string replicaType = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginExportWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, ExportDatabaseDefinition parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2416,6 +2418,14 @@ internal DatabasesOperations(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"); @@ -2431,23 +2441,19 @@ internal DatabasesOperations(SqlManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serverName", serverName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("replicaType", replicaType); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginFailover", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginExport", 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}/failover").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/export").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 (replicaType != null) - { - _queryParameters.Add(string.Format("replicaType={0}", System.Uri.EscapeDataString(replicaType))); - } if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2490,6 +2496,12 @@ internal DatabasesOperations(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) { @@ -2545,13 +2557,31 @@ internal DatabasesOperations(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); @@ -2560,7 +2590,7 @@ internal DatabasesOperations(SqlManagementClient client) } /// - /// Pauses a database. + /// Failovers a database. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -2570,7 +2600,11 @@ internal DatabasesOperations(SqlManagementClient client) /// The name of the server. /// /// - /// The name of the database to be paused. + /// The name of the database to failover. + /// + /// + /// The type of replica to be failed over. Possible values include: 'Primary', + /// 'ReadableSecondary' /// /// /// Headers that will be added to request. @@ -2581,9 +2615,6 @@ internal DatabasesOperations(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 /// @@ -2593,7 +2624,7 @@ internal DatabasesOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginPauseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginFailoverWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string replicaType = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2622,18 +2653,23 @@ internal DatabasesOperations(SqlManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serverName", serverName); tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("replicaType", replicaType); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginPause", tracingParameters); + 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}/pause").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/failover").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 (replicaType != null) + { + _queryParameters.Add(string.Format("replicaType={0}", System.Uri.EscapeDataString(replicaType))); + } if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2731,31 +2767,13 @@ internal DatabasesOperations(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); @@ -2764,7 +2782,7 @@ internal DatabasesOperations(SqlManagementClient client) } /// - /// Resumes a database. + /// Imports a bacpac into a new database. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -2774,7 +2792,10 @@ internal DatabasesOperations(SqlManagementClient client) /// The name of the server. /// /// - /// The name of the database to be resumed. + /// The name of the database. + /// + /// + /// The database import request parameters. /// /// /// Headers that will be added to request. @@ -2797,7 +2818,7 @@ internal DatabasesOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginResumeWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginImportWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, ImportExistingDatabaseDefinition parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2811,6 +2832,14 @@ internal DatabasesOperations(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"); @@ -2826,13 +2855,14 @@ internal DatabasesOperations(SqlManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serverName", serverName); tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginResume", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginImport", 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}/resume").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/import").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)); @@ -2880,6 +2910,12 @@ internal DatabasesOperations(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) { @@ -2935,7 +2971,7 @@ internal DatabasesOperations(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")) @@ -2948,7 +2984,7 @@ internal DatabasesOperations(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) { @@ -2968,7 +3004,7 @@ internal DatabasesOperations(SqlManagementClient client) } /// - /// Upgrades a data warehouse. + /// Pauses a database. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -2978,7 +3014,7 @@ internal DatabasesOperations(SqlManagementClient client) /// The name of the server. /// /// - /// The name of the database to be upgraded. + /// The name of the database to be paused. /// /// /// Headers that will be added to request. @@ -2989,6 +3025,9 @@ internal DatabasesOperations(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 /// @@ -2998,7 +3037,7 @@ internal DatabasesOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginUpgradeDataWarehouseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginPauseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -3029,11 +3068,11 @@ internal DatabasesOperations(SqlManagementClient client) tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpgradeDataWarehouse", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginPause", 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}/upgradeDataWarehouse").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/pause").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)); @@ -3136,13 +3175,31 @@ internal DatabasesOperations(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); @@ -3151,7 +3208,7 @@ internal DatabasesOperations(SqlManagementClient client) } /// - /// Imports a bacpac into a new database. + /// Resumes a database. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -3161,10 +3218,7 @@ internal DatabasesOperations(SqlManagementClient client) /// The name of the server. /// /// - /// The name of the database. - /// - /// - /// The database import request parameters. + /// The name of the database to be resumed. /// /// /// Headers that will be added to request. @@ -3187,7 +3241,7 @@ internal DatabasesOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginImportWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, ImportExistingDatabaseDefinition parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginResumeWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -3201,14 +3255,6 @@ internal DatabasesOperations(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"); @@ -3224,14 +3270,13 @@ internal DatabasesOperations(SqlManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serverName", serverName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginImport", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginResume", 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}/import").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/resume").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)); @@ -3279,12 +3324,6 @@ internal DatabasesOperations(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) { @@ -3340,7 +3379,7 @@ internal DatabasesOperations(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")) @@ -3353,7 +3392,7 @@ internal DatabasesOperations(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) { @@ -3373,7 +3412,7 @@ internal DatabasesOperations(SqlManagementClient client) } /// - /// Exports a database. + /// Upgrades a data warehouse. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -3383,10 +3422,7 @@ internal DatabasesOperations(SqlManagementClient client) /// The name of the server. /// /// - /// The name of the database. - /// - /// - /// The database export request parameters. + /// The name of the database to be upgraded. /// /// /// Headers that will be added to request. @@ -3397,9 +3433,6 @@ internal DatabasesOperations(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 /// @@ -3409,7 +3442,7 @@ internal DatabasesOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginExportWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, ExportDatabaseDefinition parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginUpgradeDataWarehouseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -3423,14 +3456,6 @@ internal DatabasesOperations(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"); @@ -3446,14 +3471,13 @@ internal DatabasesOperations(SqlManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serverName", serverName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginExport", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpgradeDataWarehouse", 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}/export").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/upgradeDataWarehouse").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)); @@ -3501,12 +3525,6 @@ internal DatabasesOperations(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) { @@ -3562,31 +3580,13 @@ internal DatabasesOperations(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/DatabasesOperationsExtensions.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/DatabasesOperationsExtensions.cs index 46e86c427642..fd113028987b 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/DatabasesOperationsExtensions.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/DatabasesOperationsExtensions.cs @@ -373,7 +373,7 @@ public static Database Update(this IDatabasesOperations operations, string resou } /// - /// Gets a list of databases in an elastic pool. + /// Exports a database. /// /// /// The operations group for this extension method. @@ -385,16 +385,19 @@ public static Database Update(this IDatabasesOperations operations, string resou /// /// The name of the server. /// - /// - /// The name of the elastic pool. + /// + /// The name of the database. /// - public static IPage ListByElasticPool(this IDatabasesOperations operations, string resourceGroupName, string serverName, string elasticPoolName) + /// + /// The database export request parameters. + /// + public static ImportExportOperationResult Export(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, ExportDatabaseDefinition parameters) { - return operations.ListByElasticPoolAsync(resourceGroupName, serverName, elasticPoolName).GetAwaiter().GetResult(); + return operations.ExportAsync(resourceGroupName, serverName, databaseName, parameters).GetAwaiter().GetResult(); } /// - /// Gets a list of databases in an elastic pool. + /// Exports a database. /// /// /// The operations group for this extension method. @@ -406,15 +409,18 @@ public static IPage ListByElasticPool(this IDatabasesOperations operat /// /// The name of the server. /// - /// - /// The name of the elastic pool. + /// + /// The name of the database. + /// + /// + /// The database export request parameters. /// /// /// The cancellation token. /// - public static async Task> ListByElasticPoolAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string elasticPoolName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ExportAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, ExportDatabaseDefinition parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByElasticPoolWithHttpMessagesAsync(resourceGroupName, serverName, elasticPoolName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ExportWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -474,7 +480,7 @@ public static IPage ListByElasticPool(this IDatabasesOperations operat } /// - /// Gets a list of inaccessible databases in a logical server + /// Imports a bacpac into a new database. /// /// /// The operations group for this extension method. @@ -486,13 +492,19 @@ public static IPage ListByElasticPool(this IDatabasesOperations operat /// /// The name of the server. /// - public static IPage ListInaccessibleByServer(this IDatabasesOperations operations, string resourceGroupName, string serverName) + /// + /// The name of the database. + /// + /// + /// The database import request parameters. + /// + public static ImportExportOperationResult Import(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, ImportExistingDatabaseDefinition parameters) { - return operations.ListInaccessibleByServerAsync(resourceGroupName, serverName).GetAwaiter().GetResult(); + return operations.ImportAsync(resourceGroupName, serverName, databaseName, parameters).GetAwaiter().GetResult(); } /// - /// Gets a list of inaccessible databases in a logical server + /// Imports a bacpac into a new database. /// /// /// The operations group for this extension method. @@ -504,19 +516,25 @@ public static IPage ListInaccessibleByServer(this IDatabasesOperations /// /// The name of the server. /// + /// + /// The name of the database. + /// + /// + /// The database import request parameters. + /// /// /// The cancellation token. /// - public static async Task> ListInaccessibleByServerAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ImportAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, ImportExistingDatabaseDefinition parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListInaccessibleByServerWithHttpMessagesAsync(resourceGroupName, serverName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ImportWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Pauses a database. + /// Renames a database. /// /// /// The operations group for this extension method. @@ -529,15 +547,18 @@ public static IPage ListInaccessibleByServer(this IDatabasesOperations /// The name of the server. /// /// - /// The name of the database to be paused. + /// The name of the database to rename. /// - public static Database Pause(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName) + /// + /// The resource move definition for renaming this database. + /// + public static void Rename(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, ResourceMoveDefinition parameters) { - return operations.PauseAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult(); + operations.RenameAsync(resourceGroupName, serverName, databaseName, parameters).GetAwaiter().GetResult(); } /// - /// Pauses a database. + /// Renames a database. /// /// /// The operations group for this extension method. @@ -550,21 +571,21 @@ public static Database Pause(this IDatabasesOperations operations, string resour /// The name of the server. /// /// - /// The name of the database to be paused. + /// The name of the database to rename. + /// + /// + /// The resource move definition for renaming this database. /// /// /// The cancellation token. /// - public static async Task PauseAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task RenameAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, ResourceMoveDefinition parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.PauseWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + (await operations.RenameWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Resumes a database. + /// Pauses a database. /// /// /// The operations group for this extension method. @@ -577,15 +598,15 @@ public static Database Pause(this IDatabasesOperations operations, string resour /// The name of the server. /// /// - /// The name of the database to be resumed. + /// The name of the database to be paused. /// - public static Database Resume(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName) + public static Database Pause(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName) { - return operations.ResumeAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult(); + return operations.PauseAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult(); } /// - /// Resumes a database. + /// Pauses a database. /// /// /// The operations group for this extension method. @@ -598,21 +619,21 @@ public static Database Resume(this IDatabasesOperations operations, string resou /// The name of the server. /// /// - /// The name of the database to be resumed. + /// The name of the database to be paused. /// /// /// The cancellation token. /// - public static async Task ResumeAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task PauseAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ResumeWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.PauseWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Upgrades a data warehouse. + /// Resumes a database. /// /// /// The operations group for this extension method. @@ -625,15 +646,15 @@ public static Database Resume(this IDatabasesOperations operations, string resou /// The name of the server. /// /// - /// The name of the database to be upgraded. + /// The name of the database to be resumed. /// - public static void UpgradeDataWarehouse(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName) + public static Database Resume(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName) { - operations.UpgradeDataWarehouseAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult(); + return operations.ResumeAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult(); } /// - /// Upgrades a data warehouse. + /// Resumes a database. /// /// /// The operations group for this extension method. @@ -646,18 +667,21 @@ public static void UpgradeDataWarehouse(this IDatabasesOperations operations, st /// The name of the server. /// /// - /// The name of the database to be upgraded. + /// The name of the database to be resumed. /// /// /// The cancellation token. /// - public static async Task UpgradeDataWarehouseAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ResumeAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.UpgradeDataWarehouseWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.ResumeWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Renames a database. + /// Upgrades a data warehouse. /// /// /// The operations group for this extension method. @@ -670,18 +694,15 @@ public static void UpgradeDataWarehouse(this IDatabasesOperations operations, st /// The name of the server. /// /// - /// The name of the database to rename. - /// - /// - /// The resource move definition for renaming this database. + /// The name of the database to be upgraded. /// - public static void Rename(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, ResourceMoveDefinition parameters) + public static void UpgradeDataWarehouse(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName) { - operations.RenameAsync(resourceGroupName, serverName, databaseName, parameters).GetAwaiter().GetResult(); + operations.UpgradeDataWarehouseAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult(); } /// - /// Renames a database. + /// Upgrades a data warehouse. /// /// /// The operations group for this extension method. @@ -694,21 +715,18 @@ public static void Rename(this IDatabasesOperations operations, string resourceG /// The name of the server. /// /// - /// The name of the database to rename. - /// - /// - /// The resource move definition for renaming this database. + /// The name of the database to be upgraded. /// /// /// The cancellation token. /// - public static async Task RenameAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, ResourceMoveDefinition parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpgradeDataWarehouseAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.RenameWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.UpgradeDataWarehouseWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Imports a bacpac into a new database. + /// Gets a list of databases in an elastic pool. /// /// /// The operations group for this extension method. @@ -720,19 +738,16 @@ public static void Rename(this IDatabasesOperations operations, string resourceG /// /// The name of the server. /// - /// - /// The name of the database. - /// - /// - /// The database import request parameters. + /// + /// The name of the elastic pool. /// - public static ImportExportOperationResult Import(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, ImportExistingDatabaseDefinition parameters) + public static IPage ListByElasticPool(this IDatabasesOperations operations, string resourceGroupName, string serverName, string elasticPoolName) { - return operations.ImportAsync(resourceGroupName, serverName, databaseName, parameters).GetAwaiter().GetResult(); + return operations.ListByElasticPoolAsync(resourceGroupName, serverName, elasticPoolName).GetAwaiter().GetResult(); } /// - /// Imports a bacpac into a new database. + /// Gets a list of databases in an elastic pool. /// /// /// The operations group for this extension method. @@ -744,25 +759,22 @@ public static ImportExportOperationResult Import(this IDatabasesOperations opera /// /// The name of the server. /// - /// - /// The name of the database. - /// - /// - /// The database import request parameters. + /// + /// The name of the elastic pool. /// /// /// The cancellation token. /// - public static async Task ImportAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, ImportExistingDatabaseDefinition parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByElasticPoolAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string elasticPoolName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ImportWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByElasticPoolWithHttpMessagesAsync(resourceGroupName, serverName, elasticPoolName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Exports a database. + /// Gets a list of inaccessible databases in a logical server /// /// /// The operations group for this extension method. @@ -774,19 +786,13 @@ public static ImportExportOperationResult Import(this IDatabasesOperations opera /// /// The name of the server. /// - /// - /// The name of the database. - /// - /// - /// The database export request parameters. - /// - public static ImportExportOperationResult Export(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, ExportDatabaseDefinition parameters) + public static IPage ListInaccessibleByServer(this IDatabasesOperations operations, string resourceGroupName, string serverName) { - return operations.ExportAsync(resourceGroupName, serverName, databaseName, parameters).GetAwaiter().GetResult(); + return operations.ListInaccessibleByServerAsync(resourceGroupName, serverName).GetAwaiter().GetResult(); } /// - /// Exports a database. + /// Gets a list of inaccessible databases in a logical server /// /// /// The operations group for this extension method. @@ -798,18 +804,12 @@ public static ImportExportOperationResult Export(this IDatabasesOperations opera /// /// The name of the server. /// - /// - /// The name of the database. - /// - /// - /// The database export request parameters. - /// /// /// The cancellation token. /// - public static async Task ExportAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, ExportDatabaseDefinition parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListInaccessibleByServerAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ExportWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListInaccessibleByServerWithHttpMessagesAsync(resourceGroupName, serverName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -969,7 +969,7 @@ public static Database BeginUpdate(this IDatabasesOperations operations, string } /// - /// Failovers a database. + /// Exports a database. /// /// /// The operations group for this extension method. @@ -982,19 +982,18 @@ public static Database BeginUpdate(this IDatabasesOperations operations, string /// The name of the server. /// /// - /// The name of the database to failover. + /// The name of the database. /// - /// - /// The type of replica to be failed over. Possible values include: 'Primary', - /// 'ReadableSecondary' + /// + /// The database export request parameters. /// - public static void BeginFailover(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, string replicaType = default(string)) + public static ImportExportOperationResult BeginExport(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, ExportDatabaseDefinition parameters) { - operations.BeginFailoverAsync(resourceGroupName, serverName, databaseName, replicaType).GetAwaiter().GetResult(); + return operations.BeginExportAsync(resourceGroupName, serverName, databaseName, parameters).GetAwaiter().GetResult(); } /// - /// Failovers a database. + /// Exports a database. /// /// /// The operations group for this extension method. @@ -1007,22 +1006,24 @@ public static Database BeginUpdate(this IDatabasesOperations operations, string /// The name of the server. /// /// - /// The name of the database to failover. + /// The name of the database. /// - /// - /// The type of replica to be failed over. Possible values include: 'Primary', - /// 'ReadableSecondary' + /// + /// The database export request parameters. /// /// /// The cancellation token. /// - public static async Task BeginFailoverAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, string replicaType = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginExportAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, ExportDatabaseDefinition parameters, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.BeginFailoverWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, replicaType, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginExportWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Pauses a database. + /// Failovers a database. /// /// /// The operations group for this extension method. @@ -1035,15 +1036,19 @@ public static Database BeginUpdate(this IDatabasesOperations operations, string /// The name of the server. /// /// - /// The name of the database to be paused. + /// The name of the database to failover. /// - public static Database BeginPause(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName) + /// + /// The type of replica to be failed over. Possible values include: 'Primary', + /// 'ReadableSecondary' + /// + public static void BeginFailover(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, string replicaType = default(string)) { - return operations.BeginPauseAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult(); + operations.BeginFailoverAsync(resourceGroupName, serverName, databaseName, replicaType).GetAwaiter().GetResult(); } /// - /// Pauses a database. + /// Failovers a database. /// /// /// The operations group for this extension method. @@ -1056,21 +1061,22 @@ public static Database BeginPause(this IDatabasesOperations operations, string r /// The name of the server. /// /// - /// The name of the database to be paused. + /// The name of the database to failover. + /// + /// + /// The type of replica to be failed over. Possible values include: 'Primary', + /// 'ReadableSecondary' /// /// /// The cancellation token. /// - public static async Task BeginPauseAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginFailoverAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, string replicaType = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginPauseWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + (await operations.BeginFailoverWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, replicaType, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Resumes a database. + /// Imports a bacpac into a new database. /// /// /// The operations group for this extension method. @@ -1083,15 +1089,18 @@ public static Database BeginPause(this IDatabasesOperations operations, string r /// The name of the server. /// /// - /// The name of the database to be resumed. + /// The name of the database. /// - public static Database BeginResume(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName) + /// + /// The database import request parameters. + /// + public static ImportExportOperationResult BeginImport(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, ImportExistingDatabaseDefinition parameters) { - return operations.BeginResumeAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult(); + return operations.BeginImportAsync(resourceGroupName, serverName, databaseName, parameters).GetAwaiter().GetResult(); } /// - /// Resumes a database. + /// Imports a bacpac into a new database. /// /// /// The operations group for this extension method. @@ -1104,21 +1113,24 @@ public static Database BeginResume(this IDatabasesOperations operations, string /// The name of the server. /// /// - /// The name of the database to be resumed. + /// The name of the database. + /// + /// + /// The database import request parameters. /// /// /// The cancellation token. /// - public static async Task BeginResumeAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginImportAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, ImportExistingDatabaseDefinition parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginResumeWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginImportWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Upgrades a data warehouse. + /// Pauses a database. /// /// /// The operations group for this extension method. @@ -1131,15 +1143,15 @@ public static Database BeginResume(this IDatabasesOperations operations, string /// The name of the server. /// /// - /// The name of the database to be upgraded. + /// The name of the database to be paused. /// - public static void BeginUpgradeDataWarehouse(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName) + public static Database BeginPause(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName) { - operations.BeginUpgradeDataWarehouseAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult(); + return operations.BeginPauseAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult(); } /// - /// Upgrades a data warehouse. + /// Pauses a database. /// /// /// The operations group for this extension method. @@ -1152,18 +1164,21 @@ public static void BeginUpgradeDataWarehouse(this IDatabasesOperations operation /// The name of the server. /// /// - /// The name of the database to be upgraded. + /// The name of the database to be paused. /// /// /// The cancellation token. /// - public static async Task BeginUpgradeDataWarehouseAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginPauseAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.BeginUpgradeDataWarehouseWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginPauseWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Imports a bacpac into a new database. + /// Resumes a database. /// /// /// The operations group for this extension method. @@ -1176,18 +1191,15 @@ public static void BeginUpgradeDataWarehouse(this IDatabasesOperations operation /// The name of the server. /// /// - /// The name of the database. - /// - /// - /// The database import request parameters. + /// The name of the database to be resumed. /// - public static ImportExportOperationResult BeginImport(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, ImportExistingDatabaseDefinition parameters) + public static Database BeginResume(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName) { - return operations.BeginImportAsync(resourceGroupName, serverName, databaseName, parameters).GetAwaiter().GetResult(); + return operations.BeginResumeAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult(); } /// - /// Imports a bacpac into a new database. + /// Resumes a database. /// /// /// The operations group for this extension method. @@ -1200,24 +1212,21 @@ public static ImportExportOperationResult BeginImport(this IDatabasesOperations /// The name of the server. /// /// - /// The name of the database. - /// - /// - /// The database import request parameters. + /// The name of the database to be resumed. /// /// /// The cancellation token. /// - public static async Task BeginImportAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, ImportExistingDatabaseDefinition parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginResumeAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginImportWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginResumeWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Exports a database. + /// Upgrades a data warehouse. /// /// /// The operations group for this extension method. @@ -1230,18 +1239,15 @@ public static ImportExportOperationResult BeginImport(this IDatabasesOperations /// The name of the server. /// /// - /// The name of the database. - /// - /// - /// The database export request parameters. + /// The name of the database to be upgraded. /// - public static ImportExportOperationResult BeginExport(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, ExportDatabaseDefinition parameters) + public static void BeginUpgradeDataWarehouse(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName) { - return operations.BeginExportAsync(resourceGroupName, serverName, databaseName, parameters).GetAwaiter().GetResult(); + operations.BeginUpgradeDataWarehouseAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult(); } /// - /// Exports a database. + /// Upgrades a data warehouse. /// /// /// The operations group for this extension method. @@ -1254,20 +1260,14 @@ public static ImportExportOperationResult BeginExport(this IDatabasesOperations /// The name of the server. /// /// - /// The name of the database. - /// - /// - /// The database export request parameters. + /// The name of the database to be upgraded. /// /// /// The cancellation token. /// - public static async Task BeginExportAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, ExportDatabaseDefinition parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginUpgradeDataWarehouseAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginExportWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + (await operations.BeginUpgradeDataWarehouseWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IDatabasesOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IDatabasesOperations.cs index 277dc9cb311c..ebf844493a22 100644 --- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IDatabasesOperations.cs +++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IDatabasesOperations.cs @@ -240,7 +240,7 @@ public partial interface IDatabasesOperations /// Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, DatabaseUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets a list of databases in an elastic pool. + /// Exports a database. /// /// /// The name of the resource group that contains the resource. You can @@ -250,8 +250,11 @@ public partial interface IDatabasesOperations /// /// The name of the server. /// - /// - /// The name of the elastic pool. + /// + /// The name of the database. + /// + /// + /// The database export request parameters. /// /// /// The headers that will be added to request. @@ -268,7 +271,7 @@ public partial interface IDatabasesOperations /// /// Thrown when a required parameter is null /// - Task>> ListByElasticPoolWithHttpMessagesAsync(string resourceGroupName, string serverName, string elasticPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ExportWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, ExportDatabaseDefinition parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Failovers a database. /// @@ -301,7 +304,7 @@ public partial interface IDatabasesOperations /// Task FailoverWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string replicaType = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets a list of inaccessible databases in a logical server + /// Imports a bacpac into a new database. /// /// /// The name of the resource group that contains the resource. You can @@ -311,6 +314,12 @@ public partial interface IDatabasesOperations /// /// The name of the server. /// + /// + /// The name of the database. + /// + /// + /// The database import request parameters. + /// /// /// The headers that will be added to request. /// @@ -326,9 +335,9 @@ public partial interface IDatabasesOperations /// /// Thrown when a required parameter is null /// - Task>> ListInaccessibleByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ImportWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, ImportExistingDatabaseDefinition parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Pauses a database. + /// Renames a database. /// /// /// The name of the resource group that contains the resource. You can @@ -339,7 +348,10 @@ public partial interface IDatabasesOperations /// The name of the server. /// /// - /// The name of the database to be paused. + /// The name of the database to rename. + /// + /// + /// The resource move definition for renaming this database. /// /// /// The headers that will be added to request. @@ -350,15 +362,12 @@ public partial interface IDatabasesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - Task> PauseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task RenameWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, ResourceMoveDefinition parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Resumes a database. + /// Pauses a database. /// /// /// The name of the resource group that contains the resource. You can @@ -369,7 +378,7 @@ public partial interface IDatabasesOperations /// The name of the server. /// /// - /// The name of the database to be resumed. + /// The name of the database to be paused. /// /// /// The headers that will be added to request. @@ -386,9 +395,9 @@ public partial interface IDatabasesOperations /// /// Thrown when a required parameter is null /// - Task> ResumeWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> PauseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Upgrades a data warehouse. + /// Resumes a database. /// /// /// The name of the resource group that contains the resource. You can @@ -399,7 +408,7 @@ public partial interface IDatabasesOperations /// The name of the server. /// /// - /// The name of the database to be upgraded. + /// The name of the database to be resumed. /// /// /// The headers that will be added to request. @@ -410,12 +419,15 @@ public partial interface IDatabasesOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - Task UpgradeDataWarehouseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ResumeWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Renames a database. + /// Upgrades a data warehouse. /// /// /// The name of the resource group that contains the resource. You can @@ -426,10 +438,7 @@ public partial interface IDatabasesOperations /// The name of the server. /// /// - /// The name of the database to rename. - /// - /// - /// The resource move definition for renaming this database. + /// The name of the database to be upgraded. /// /// /// The headers that will be added to request. @@ -443,9 +452,9 @@ public partial interface IDatabasesOperations /// /// Thrown when a required parameter is null /// - Task RenameWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, ResourceMoveDefinition parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task UpgradeDataWarehouseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Imports a bacpac into a new database. + /// Gets a list of databases in an elastic pool. /// /// /// The name of the resource group that contains the resource. You can @@ -455,11 +464,8 @@ public partial interface IDatabasesOperations /// /// The name of the server. /// - /// - /// The name of the database. - /// - /// - /// The database import request parameters. + /// + /// The name of the elastic pool. /// /// /// The headers that will be added to request. @@ -476,9 +482,9 @@ public partial interface IDatabasesOperations /// /// Thrown when a required parameter is null /// - Task> ImportWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, ImportExistingDatabaseDefinition parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByElasticPoolWithHttpMessagesAsync(string resourceGroupName, string serverName, string elasticPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Exports a database. + /// Gets a list of inaccessible databases in a logical server /// /// /// The name of the resource group that contains the resource. You can @@ -488,12 +494,6 @@ public partial interface IDatabasesOperations /// /// The name of the server. /// - /// - /// The name of the database. - /// - /// - /// The database export request parameters. - /// /// /// The headers that will be added to request. /// @@ -509,7 +509,7 @@ public partial interface IDatabasesOperations /// /// Thrown when a required parameter is null /// - Task> ExportWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, ExportDatabaseDefinition parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListInaccessibleByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Creates a new database or updates an existing database. /// @@ -604,7 +604,7 @@ public partial interface IDatabasesOperations /// Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, DatabaseUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Failovers a database. + /// Exports a database. /// /// /// The name of the resource group that contains the resource. You can @@ -615,11 +615,10 @@ public partial interface IDatabasesOperations /// The name of the server. /// /// - /// The name of the database to failover. + /// The name of the database. /// - /// - /// The type of replica to be failed over. Possible values include: - /// 'Primary', 'ReadableSecondary' + /// + /// The database export request parameters. /// /// /// The headers that will be added to request. @@ -630,12 +629,15 @@ public partial interface IDatabasesOperations /// /// 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 replicaType = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginExportWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, ExportDatabaseDefinition parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Pauses a database. + /// Failovers a database. /// /// /// The name of the resource group that contains the resource. You can @@ -646,7 +648,11 @@ public partial interface IDatabasesOperations /// The name of the server. /// /// - /// The name of the database to be paused. + /// The name of the database to failover. + /// + /// + /// The type of replica to be failed over. Possible values include: + /// 'Primary', 'ReadableSecondary' /// /// /// The headers that will be added to request. @@ -657,15 +663,12 @@ public partial interface IDatabasesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - Task> BeginPauseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task BeginFailoverWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string replicaType = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Resumes a database. + /// Imports a bacpac into a new database. /// /// /// The name of the resource group that contains the resource. You can @@ -676,7 +679,10 @@ public partial interface IDatabasesOperations /// The name of the server. /// /// - /// The name of the database to be resumed. + /// The name of the database. + /// + /// + /// The database import request parameters. /// /// /// The headers that will be added to request. @@ -693,9 +699,9 @@ public partial interface IDatabasesOperations /// /// Thrown when a required parameter is null /// - Task> BeginResumeWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginImportWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, ImportExistingDatabaseDefinition parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Upgrades a data warehouse. + /// Pauses a database. /// /// /// The name of the resource group that contains the resource. You can @@ -706,7 +712,7 @@ public partial interface IDatabasesOperations /// The name of the server. /// /// - /// The name of the database to be upgraded. + /// The name of the database to be paused. /// /// /// The headers that will be added to request. @@ -717,12 +723,15 @@ public partial interface IDatabasesOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - Task BeginUpgradeDataWarehouseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginPauseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Imports a bacpac into a new database. + /// Resumes a database. /// /// /// The name of the resource group that contains the resource. You can @@ -733,10 +742,7 @@ public partial interface IDatabasesOperations /// The name of the server. /// /// - /// The name of the database. - /// - /// - /// The database import request parameters. + /// The name of the database to be resumed. /// /// /// The headers that will be added to request. @@ -753,9 +759,9 @@ public partial interface IDatabasesOperations /// /// Thrown when a required parameter is null /// - Task> BeginImportWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, ImportExistingDatabaseDefinition parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginResumeWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Exports a database. + /// Upgrades a data warehouse. /// /// /// The name of the resource group that contains the resource. You can @@ -766,10 +772,7 @@ public partial interface IDatabasesOperations /// The name of the server. /// /// - /// The name of the database. - /// - /// - /// The database export request parameters. + /// The name of the database to be upgraded. /// /// /// The headers that will be added to request. @@ -780,13 +783,10 @@ public partial interface IDatabasesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - Task> BeginExportWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, ExportDatabaseDefinition parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task BeginUpgradeDataWarehouseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets a list of databases. /// 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 32be96985605..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 @@ -167,11 +167,13 @@ public Database() /// The state of read-only routing. If enabled, /// connections that have application intent set to readonly in their /// connection string may be routed to a readonly secondary replica in - /// the same region. Possible values include: 'Enabled', + /// the same region. Not applicable to a Hyperscale database within an + /// elastic pool. Possible values include: 'Enabled', /// 'Disabled' /// The number of secondary /// replicas associated with the database that are used to provide high - /// availability. + /// availability. Not applicable to a Hyperscale database within an + /// elastic pool. /// The secondary type of the database if /// it is a secondary. Valid values are Geo and Named. Possible values /// include: 'Geo', 'Named' @@ -204,10 +206,34 @@ 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 - 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?)) + /// The resource identifier of the + /// source associated with the create operation of this database. + /// + /// When sourceResourceId is specified, sourceDatabaseId, + /// recoverableDatabaseId, restorableDroppedDatabaseId and + /// sourceDatabaseDeletionDate must not be specified and CreateMode + /// must be PointInTimeRestore, Restore or Recover. + /// + /// When createMode is PointInTimeRestore, sourceResourceId must be the + /// resource ID of an existing database or existing sql pool, and + /// restorePointInTime must be specified. + /// + /// When createMode is Restore, sourceResourceId must be the resource + /// ID of restorable dropped database or restorable dropped sql pool. + /// + /// When createMode is Recover, sourceResourceId must be the resource + /// ID of recoverable database or recoverable sql pool. + /// + /// This property allows to restore across subscriptions which is only + /// supported for DataWarehouse edition. + /// + /// When source subscription belongs to a different tenant than target + /// subscription, “x-ms-authorization-auxiliary” header must contain + /// authentication token for the source tenant. For more details about + /// “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)) : base(location, id, name, type, tags) { Sku = sku; @@ -252,7 +278,7 @@ public Database() IsLedgerOn = isLedgerOn; IsInfraEncryptionEnabled = isInfraEncryptionEnabled; FederatedClientId = federatedClientId; - PrimaryDelegatedIdentityClientId = primaryDelegatedIdentityClientId; + SourceResourceId = sourceResourceId; CustomInit(); } @@ -512,14 +538,16 @@ public Database() /// Gets or sets the state of read-only routing. If enabled, /// connections that have application intent set to readonly in their /// connection string may be routed to a readonly secondary replica in - /// the same region. Possible values include: 'Enabled', 'Disabled' + /// the same region. Not applicable to a Hyperscale database within an + /// elastic pool. Possible values include: 'Enabled', 'Disabled' /// [JsonProperty(PropertyName = "properties.readScale")] public string ReadScale { get; set; } /// /// Gets or sets the number of secondary replicas associated with the - /// database that are used to provide high availability. + /// database that are used to provide high availability. Not applicable + /// to a Hyperscale database within an elastic pool. /// [JsonProperty(PropertyName = "properties.highAvailabilityReplicaCount")] public int? HighAvailabilityReplicaCount { get; set; } @@ -613,11 +641,35 @@ public Database() 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. + /// + /// When sourceResourceId is specified, sourceDatabaseId, + /// recoverableDatabaseId, restorableDroppedDatabaseId and + /// sourceDatabaseDeletionDate must not be specified and CreateMode + /// must be PointInTimeRestore, Restore or Recover. + /// + /// When createMode is PointInTimeRestore, sourceResourceId must be the + /// resource ID of an existing database or existing sql pool, and + /// restorePointInTime must be specified. + /// + /// When createMode is Restore, sourceResourceId must be the resource + /// ID of restorable dropped database or restorable dropped sql pool. + /// + /// When createMode is Recover, sourceResourceId must be the resource + /// ID of recoverable database or recoverable sql pool. + /// + /// This property allows to restore across subscriptions which is only + /// supported for DataWarehouse edition. + /// + /// When source subscription belongs to a different tenant than target + /// subscription, “x-ms-authorization-auxiliary” header must contain + /// authentication token for the source tenant. For more details about + /// “x-ms-authorization-auxiliary” header see + /// https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/authenticate-multi-tenant + /// + [JsonProperty(PropertyName = "properties.sourceResourceId")] + public string SourceResourceId { get; set; } /// /// Validate the object. 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 3b27477e36b9..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 @@ -18,7 +18,7 @@ namespace Microsoft.Azure.Management.Sql.Models using System.Linq; /// - /// A database resource. + /// A database update resource. /// [Rest.Serialization.JsonTransformation] public partial class DatabaseUpdate @@ -143,11 +143,13 @@ public DatabaseUpdate() /// The state of read-only routing. If enabled, /// connections that have application intent set to readonly in their /// connection string may be routed to a readonly secondary replica in - /// the same region. Possible values include: 'Enabled', + /// the same region. Not applicable to a Hyperscale database within an + /// elastic pool. Possible values include: 'Enabled', /// 'Disabled' /// The number of secondary /// replicas associated with the database that are used to provide high - /// availability. + /// availability. Not applicable to a Hyperscale database within an + /// elastic pool. /// The secondary type of the database if /// it is a secondary. Valid values are Geo and Named. Possible values /// include: 'Geo', 'Named' @@ -180,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; @@ -226,7 +225,6 @@ public DatabaseUpdate() IsLedgerOn = isLedgerOn; IsInfraEncryptionEnabled = isInfraEncryptionEnabled; FederatedClientId = federatedClientId; - PrimaryDelegatedIdentityClientId = primaryDelegatedIdentityClientId; Tags = tags; CustomInit(); } @@ -459,14 +457,16 @@ public DatabaseUpdate() /// Gets or sets the state of read-only routing. If enabled, /// connections that have application intent set to readonly in their /// connection string may be routed to a readonly secondary replica in - /// the same region. Possible values include: 'Enabled', 'Disabled' + /// the same region. Not applicable to a Hyperscale database within an + /// elastic pool. Possible values include: 'Enabled', 'Disabled' /// [JsonProperty(PropertyName = "properties.readScale")] public string ReadScale { get; set; } /// /// Gets or sets the number of secondary replicas associated with the - /// database that are used to provide high availability. + /// database that are used to provide high availability. Not applicable + /// to a Hyperscale database within an elastic pool. /// [JsonProperty(PropertyName = "properties.highAvailabilityReplicaCount")] public int? HighAvailabilityReplicaCount { get; set; } @@ -559,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/SdkInfo_SqlManagementClient.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/SdkInfo_SqlManagementClient.cs index 23463b088247..341f6874d2fe 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 @@ -146,16 +146,5 @@ 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 = "d13884b6f5076e151278e9941dc6630ba86b350c"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } -