From 80848ef06c46109b9e1bb0dbb70fb46150655e0e Mon Sep 17 00:00:00 2001
From: payiAzure <36676045+payiAzure@users.noreply.github.com>
Date: Mon, 5 Mar 2018 09:42:20 -0800
Subject: [PATCH 1/7] Generate sdk from swagger, add new test for cancel pool
operation and list database/pool operation
---
src/SDKs/SqlManagement/AzSdk.RP.props | 2 +-
.../Generated/DatabaseOperations.cs | 4 +-
.../Generated/DatabasesOperations.cs | 854 ++++++-------
.../DatabasesOperationsExtensions.cs | 570 ++++-----
.../Generated/ElasticPoolOperations.cs | 617 ++++++++++
.../ElasticPoolOperationsExtensions.cs | 154 +++
.../Generated/ElasticPoolsOperations.cs | 268 ++--
.../ElasticPoolsOperationsExtensions.cs | 154 +--
.../Generated/IDatabasesOperations.cs | 262 ++--
.../Generated/IElasticPoolOperations.cs | 107 ++
.../Generated/IElasticPoolsOperations.cs | 70 +-
.../Generated/IRestorePointsOperations.cs | 101 +-
.../Generated/ISqlManagementClient.cs | 55 +-
.../CreateDatabaseRestorePointDefinition.cs | 69 ++
.../Generated/Models/DatabaseOperation.cs | 28 +-
.../Generated/Models/ElasticPoolOperation.cs | 170 +++
.../Generated/Models/RestorePoint.cs | 52 +-
.../Generated/Models/RestorePointType.cs | 14 +-
.../Generated/RestorePointsOperations.cs | 498 +++++++-
.../RestorePointsOperationsExtensions.cs | 166 ++-
.../Generated/SdkInfo_SqlManagementClient.cs | 5 +-
.../Generated/SqlManagementClient.cs | 66 +-
.../Sql.Tests/DatabaseCrudScenarioTests.cs | 9 +-
.../Sql.Tests/ElasticPoolCrudScenarioTests.cs | 69 ++
.../TestCancelDatabaseOperation.json | 503 +++++---
.../TestCancelUpdateElasticPoolOperation.json | 1085 +++++++++++++++++
src/SDKs/_metadata/sql_resource-manager.txt | 12 +-
27 files changed, 4590 insertions(+), 1374 deletions(-)
create mode 100644 src/SDKs/SqlManagement/Management.Sql/Generated/ElasticPoolOperations.cs
create mode 100644 src/SDKs/SqlManagement/Management.Sql/Generated/ElasticPoolOperationsExtensions.cs
create mode 100644 src/SDKs/SqlManagement/Management.Sql/Generated/IElasticPoolOperations.cs
create mode 100644 src/SDKs/SqlManagement/Management.Sql/Generated/Models/CreateDatabaseRestorePointDefinition.cs
create mode 100644 src/SDKs/SqlManagement/Management.Sql/Generated/Models/ElasticPoolOperation.cs
create mode 100644 src/SDKs/SqlManagement/Sql.Tests/SessionRecords/Sql.Tests.ElasticPoolCrudScenarioTests/TestCancelUpdateElasticPoolOperation.json
diff --git a/src/SDKs/SqlManagement/AzSdk.RP.props b/src/SDKs/SqlManagement/AzSdk.RP.props
index de7d5ff4aab7..c686be55af5f 100644
--- a/src/SDKs/SqlManagement/AzSdk.RP.props
+++ b/src/SDKs/SqlManagement/AzSdk.RP.props
@@ -1,7 +1,7 @@
- Sql_2014-04-01;Sql_2015-05-01-preview;Sql_2017-03-01-preview;
+ Sql_2014-04-01;Sql_2015-05-01-preview;Sql_2017-10-01-preview;Sql_2017-03-01-preview;
$(PackageTags);$(CommonTags);$(AzureApiTag);
\ No newline at end of file
diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/DatabaseOperations.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/DatabaseOperations.cs
index 2ef5cbd53604..ebedc7aca5bd 100644
--- a/src/SDKs/SqlManagement/Management.Sql/Generated/DatabaseOperations.cs
+++ b/src/SDKs/SqlManagement/Management.Sql/Generated/DatabaseOperations.cs
@@ -102,7 +102,7 @@ internal DatabaseOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2017-03-01-preview";
+ string apiVersion = "2017-10-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -290,7 +290,7 @@ internal DatabaseOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2017-03-01-preview";
+ string apiVersion = "2017-10-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/DatabasesOperations.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/DatabasesOperations.cs
index b416a2fb9525..26c3a7dfd351 100644
--- a/src/SDKs/SqlManagement/Management.Sql/Generated/DatabasesOperations.cs
+++ b/src/SDKs/SqlManagement/Management.Sql/Generated/DatabasesOperations.cs
@@ -51,7 +51,7 @@ internal DatabasesOperations(SqlManagementClient client)
public SqlManagementClient Client { get; private set; }
///
- /// Imports a bacpac into a new database.
+ /// Pauses a data warehouse.
///
///
/// The name of the resource group that contains the resource. You can obtain
@@ -60,8 +60,8 @@ internal DatabasesOperations(SqlManagementClient client)
///
/// The name of the server.
///
- ///
- /// The required parameters for importing a Bacpac into a database.
+ ///
+ /// The name of the data warehouse to pause.
///
///
/// The headers that will be added to request.
@@ -69,16 +69,15 @@ internal DatabasesOperations(SqlManagementClient client)
///
/// The cancellation token.
///
- public async Task> ImportWithHttpMessagesAsync(string resourceGroupName, string serverName, ImportRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task PauseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
// Send request
- AzureOperationResponse _response = await BeginImportWithHttpMessagesAsync(resourceGroupName, serverName, parameters, customHeaders, cancellationToken).ConfigureAwait(false);
+ AzureOperationResponse _response = await BeginPauseWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, customHeaders, cancellationToken).ConfigureAwait(false);
return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
}
///
- /// Creates an import operation that imports a bacpac into an existing
- /// database. The existing database must be empty.
+ /// Resumes a data warehouse.
///
///
/// The name of the resource group that contains the resource. You can obtain
@@ -88,10 +87,36 @@ internal DatabasesOperations(SqlManagementClient client)
/// The name of the server.
///
///
- /// The name of the database to import into
+ /// The name of the data warehouse to resume.
+ ///
+ ///
+ /// 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);
+ }
+
+ ///
+ /// Creates a new database or updates an existing 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 operated on (updated or created).
///
///
- /// The required parameters for importing a Bacpac into a database.
+ /// The required parameters for creating or updating a database.
///
///
/// The headers that will be added to request.
@@ -99,15 +124,15 @@ internal DatabasesOperations(SqlManagementClient client)
///
/// The cancellation token.
///
- public async Task> CreateImportOperationWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, ImportExtensionRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Database parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
// Send Request
- AzureOperationResponse _response = await BeginCreateImportOperationWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, parameters, customHeaders, cancellationToken).ConfigureAwait(false);
+ AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, parameters, customHeaders, cancellationToken).ConfigureAwait(false);
return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
}
///
- /// Exports a database to a bacpac.
+ /// Updates an existing database.
///
///
/// The name of the resource group that contains the resource. You can obtain
@@ -117,10 +142,10 @@ internal DatabasesOperations(SqlManagementClient client)
/// The name of the server.
///
///
- /// The name of the database to be exported.
+ /// The name of the database to be updated.
///
///
- /// The required parameters for exporting a database.
+ /// The required parameters for updating a database.
///
///
/// The headers that will be added to request.
@@ -128,15 +153,15 @@ internal DatabasesOperations(SqlManagementClient client)
///
/// The cancellation token.
///
- public async Task> ExportWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, ExportRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, DatabaseUpdate 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);
+ // Send Request
+ AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, parameters, customHeaders, cancellationToken).ConfigureAwait(false);
+ return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
}
///
- /// Returns database metrics.
+ /// Deletes a database.
///
///
/// The name of the resource group that contains the resource. You can obtain
@@ -146,10 +171,7 @@ internal DatabasesOperations(SqlManagementClient client)
/// The name of the server.
///
///
- /// The name of the database.
- ///
- ///
- /// An OData filter expression that describes a subset of metrics to return.
+ /// The name of the database to be deleted.
///
///
/// Headers that will be added to request.
@@ -160,9 +182,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
///
@@ -172,7 +191,7 @@ internal DatabasesOperations(SqlManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string filter, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.SubscriptionId == null)
{
@@ -190,10 +209,6 @@ internal DatabasesOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "databaseName");
}
- if (filter == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "filter");
- }
string apiVersion = "2014-04-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
@@ -206,13 +221,12 @@ internal DatabasesOperations(SqlManagementClient client)
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serverName", serverName);
tracingParameters.Add("databaseName", databaseName);
- tracingParameters.Add("filter", filter);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListMetrics", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metrics").ToString();
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}").ToString();
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName));
@@ -222,10 +236,6 @@ internal DatabasesOperations(SqlManagementClient client)
{
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
}
- if (filter != null)
- {
- _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter)));
- }
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
@@ -233,7 +243,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("DELETE");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
@@ -284,7 +294,7 @@ internal DatabasesOperations(SqlManagementClient client)
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
- if ((int)_statusCode != 200)
+ if ((int)_statusCode != 200 && (int)_statusCode != 204)
{
var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
@@ -319,31 +329,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);
@@ -352,7 +344,7 @@ internal DatabasesOperations(SqlManagementClient client)
}
///
- /// Returns database metric definitions.
+ /// Gets a database.
///
///
/// The name of the resource group that contains the resource. You can obtain
@@ -362,7 +354,11 @@ internal DatabasesOperations(SqlManagementClient client)
/// The name of the server.
///
///
- /// The name of the database.
+ /// The name of the database to be retrieved.
+ ///
+ ///
+ /// A comma separated list of child objects to expand in the response. Possible
+ /// properties: serviceTierAdvisors, transparentDataEncryption.
///
///
/// Headers that will be added to request.
@@ -385,7 +381,7 @@ internal DatabasesOperations(SqlManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListMetricDefinitionsWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.SubscriptionId == null)
{
@@ -415,12 +411,13 @@ internal DatabasesOperations(SqlManagementClient client)
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serverName", serverName);
tracingParameters.Add("databaseName", databaseName);
+ tracingParameters.Add("expand", expand);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListMetricDefinitions", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metricDefinitions").ToString();
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}").ToString();
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName));
@@ -430,6 +427,10 @@ internal DatabasesOperations(SqlManagementClient client)
{
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
}
+ if (expand != null)
+ {
+ _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand)));
+ }
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
@@ -523,7 +524,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"))
@@ -536,7 +537,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)
{
@@ -556,88 +557,7 @@ internal DatabasesOperations(SqlManagementClient client)
}
///
- /// Pauses 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 data warehouse to pause.
- ///
- ///
- /// 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 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 data warehouse to resume.
- ///
- ///
- /// 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);
- }
-
- ///
- /// Creates a new database or updates an existing 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 operated on (updated or created).
- ///
- ///
- /// The required parameters for creating or updating a database.
- ///
- ///
- /// The headers that will be added to request.
- ///
- ///
- /// The cancellation token.
- ///
- public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Database parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
- {
- // Send Request
- AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, parameters, customHeaders, cancellationToken).ConfigureAwait(false);
- return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
- }
-
- ///
- /// Updates an existing database.
+ /// Returns a list of databases in a server.
///
///
/// The name of the resource group that contains the resource. You can obtain
@@ -646,37 +566,12 @@ internal DatabasesOperations(SqlManagementClient client)
///
/// The name of the server.
///
- ///
- /// The name of the database to be updated.
- ///
- ///
- /// The required parameters for updating a database.
- ///
- ///
- /// The headers that will be added to request.
- ///
- ///
- /// The cancellation token.
- ///
- public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, DatabaseUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
- {
- // Send Request
- AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, parameters, customHeaders, cancellationToken).ConfigureAwait(false);
- return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
- }
-
- ///
- /// Deletes 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.
+ ///
+ /// A comma separated list of child objects to expand in the response. Possible
+ /// properties: serviceTierAdvisors, transparentDataEncryption.
///
- ///
- /// The name of the database to be deleted.
+ ///
+ /// An OData filter expression that describes a subset of databases to return.
///
///
/// Headers that will be added to request.
@@ -687,6 +582,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
///
@@ -696,7 +594,7 @@ internal DatabasesOperations(SqlManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, string expand = default(string), string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.SubscriptionId == null)
{
@@ -710,10 +608,6 @@ internal DatabasesOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "serverName");
}
- if (databaseName == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "databaseName");
- }
string apiVersion = "2014-04-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
@@ -725,22 +619,30 @@ internal DatabasesOperations(SqlManagementClient client)
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serverName", serverName);
- tracingParameters.Add("databaseName", databaseName);
+ tracingParameters.Add("expand", expand);
+ tracingParameters.Add("filter", filter);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "ListByServer", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}").ToString();
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases").ToString();
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName));
- _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName));
List _queryParameters = new List();
if (apiVersion != null)
{
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
}
+ if (expand != null)
+ {
+ _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand)));
+ }
+ if (filter != null)
+ {
+ _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter)));
+ }
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
@@ -748,7 +650,7 @@ internal DatabasesOperations(SqlManagementClient client)
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("DELETE");
+ _httpRequest.Method = new HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
@@ -799,7 +701,7 @@ internal DatabasesOperations(SqlManagementClient client)
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
- if ((int)_statusCode != 200 && (int)_statusCode != 204)
+ if ((int)_statusCode != 200)
{
var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
@@ -834,13 +736,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);
@@ -849,7 +769,7 @@ internal DatabasesOperations(SqlManagementClient client)
}
///
- /// Gets a database.
+ /// Gets a database inside of an elastic pool.
///
///
/// The name of the resource group that contains the resource. You can obtain
@@ -858,13 +778,12 @@ internal DatabasesOperations(SqlManagementClient client)
///
/// The name of the server.
///
+ ///
+ /// The name of the elastic pool to be retrieved.
+ ///
///
/// The name of the database to be retrieved.
///
- ///
- /// A comma separated list of child objects to expand in the response. Possible
- /// properties: serviceTierAdvisors, transparentDataEncryption.
- ///
///
/// Headers that will be added to request.
///
@@ -886,7 +805,7 @@ internal DatabasesOperations(SqlManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> GetByElasticPoolWithHttpMessagesAsync(string resourceGroupName, string serverName, string elasticPoolName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.SubscriptionId == null)
{
@@ -900,6 +819,10 @@ internal DatabasesOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "serverName");
}
+ if (elasticPoolName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "elasticPoolName");
+ }
if (databaseName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "databaseName");
@@ -915,27 +838,24 @@ internal DatabasesOperations(SqlManagementClient client)
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serverName", serverName);
+ tracingParameters.Add("elasticPoolName", elasticPoolName);
tracingParameters.Add("databaseName", databaseName);
- tracingParameters.Add("expand", expand);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "GetByElasticPool", 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}").ToString();
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/databases/{databaseName}").ToString();
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName));
+ _url = _url.Replace("{elasticPoolName}", System.Uri.EscapeDataString(elasticPoolName));
_url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName));
List _queryParameters = new List();
if (apiVersion != null)
{
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
}
- if (expand != null)
- {
- _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand)));
- }
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
@@ -1062,7 +982,7 @@ internal DatabasesOperations(SqlManagementClient client)
}
///
- /// Returns a list of databases in a server.
+ /// Returns a list of databases in an elastic pool.
///
///
/// The name of the resource group that contains the resource. You can obtain
@@ -1071,12 +991,8 @@ internal DatabasesOperations(SqlManagementClient client)
///
/// The name of the server.
///
- ///
- /// A comma separated list of child objects to expand in the response. Possible
- /// properties: serviceTierAdvisors, transparentDataEncryption.
- ///
- ///
- /// An OData filter expression that describes a subset of databases to return.
+ ///
+ /// The name of the elastic pool to be retrieved.
///
///
/// Headers that will be added to request.
@@ -1099,7 +1015,7 @@ internal DatabasesOperations(SqlManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, string expand = default(string), string filter = default(string), 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 (Client.SubscriptionId == null)
{
@@ -1111,7 +1027,11 @@ internal DatabasesOperations(SqlManagementClient client)
}
if (serverName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "serverName");
+ throw new ValidationException(ValidationRules.CannotBeNull, "serverName");
+ }
+ if (elasticPoolName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "elasticPoolName");
}
string apiVersion = "2014-04-01";
// Tracing
@@ -1124,30 +1044,22 @@ internal DatabasesOperations(SqlManagementClient client)
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serverName", serverName);
- tracingParameters.Add("expand", expand);
- tracingParameters.Add("filter", filter);
+ tracingParameters.Add("elasticPoolName", elasticPoolName);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListByServer", 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}/databases").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("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName));
+ _url = _url.Replace("{elasticPoolName}", System.Uri.EscapeDataString(elasticPoolName));
List _queryParameters = new List();
if (apiVersion != null)
{
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
}
- if (expand != null)
- {
- _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand)));
- }
- if (filter != null)
- {
- _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter)));
- }
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
@@ -1274,7 +1186,7 @@ internal DatabasesOperations(SqlManagementClient client)
}
///
- /// Gets a database inside of an elastic pool.
+ /// Gets a database inside of a recommented elastic pool.
///
///
/// The name of the resource group that contains the resource. You can obtain
@@ -1283,7 +1195,7 @@ internal DatabasesOperations(SqlManagementClient client)
///
/// The name of the server.
///
- ///
+ ///
/// The name of the elastic pool to be retrieved.
///
///
@@ -1310,7 +1222,7 @@ internal DatabasesOperations(SqlManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> GetByElasticPoolWithHttpMessagesAsync(string resourceGroupName, string serverName, string elasticPoolName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> GetByRecommendedElasticPoolWithHttpMessagesAsync(string resourceGroupName, string serverName, string recommendedElasticPoolName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.SubscriptionId == null)
{
@@ -1324,9 +1236,9 @@ internal DatabasesOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "serverName");
}
- if (elasticPoolName == null)
+ if (recommendedElasticPoolName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "elasticPoolName");
+ throw new ValidationException(ValidationRules.CannotBeNull, "recommendedElasticPoolName");
}
if (databaseName == null)
{
@@ -1343,18 +1255,18 @@ internal DatabasesOperations(SqlManagementClient client)
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serverName", serverName);
- tracingParameters.Add("elasticPoolName", elasticPoolName);
+ tracingParameters.Add("recommendedElasticPoolName", recommendedElasticPoolName);
tracingParameters.Add("databaseName", databaseName);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "GetByElasticPool", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "GetByRecommendedElasticPool", 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/{databaseName}").ToString();
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recommendedElasticPools/{recommendedElasticPoolName}/databases/{databaseName}").ToString();
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName));
- _url = _url.Replace("{elasticPoolName}", System.Uri.EscapeDataString(elasticPoolName));
+ _url = _url.Replace("{recommendedElasticPoolName}", System.Uri.EscapeDataString(recommendedElasticPoolName));
_url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName));
List _queryParameters = new List();
if (apiVersion != null)
@@ -1487,7 +1399,7 @@ internal DatabasesOperations(SqlManagementClient client)
}
///
- /// Returns a list of databases in an elastic pool.
+ /// Returns a list of databases inside a recommented elastic pool.
///
///
/// The name of the resource group that contains the resource. You can obtain
@@ -1496,8 +1408,8 @@ internal DatabasesOperations(SqlManagementClient client)
///
/// The name of the server.
///
- ///
- /// The name of the elastic pool to be retrieved.
+ ///
+ /// The name of the recommended elastic pool to be retrieved.
///
///
/// Headers that will be added to request.
@@ -1520,7 +1432,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>> ListByRecommendedElasticPoolWithHttpMessagesAsync(string resourceGroupName, string serverName, string recommendedElasticPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.SubscriptionId == null)
{
@@ -1534,9 +1446,9 @@ internal DatabasesOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "serverName");
}
- if (elasticPoolName == null)
+ if (recommendedElasticPoolName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "elasticPoolName");
+ throw new ValidationException(ValidationRules.CannotBeNull, "recommendedElasticPoolName");
}
string apiVersion = "2014-04-01";
// Tracing
@@ -1549,17 +1461,17 @@ internal DatabasesOperations(SqlManagementClient client)
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serverName", serverName);
- tracingParameters.Add("elasticPoolName", elasticPoolName);
+ tracingParameters.Add("recommendedElasticPoolName", recommendedElasticPoolName);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListByElasticPool", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "ListByRecommendedElasticPool", 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}/recommendedElasticPools/{recommendedElasticPoolName}/databases").ToString();
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName));
- _url = _url.Replace("{elasticPoolName}", System.Uri.EscapeDataString(elasticPoolName));
+ _url = _url.Replace("{recommendedElasticPoolName}", System.Uri.EscapeDataString(recommendedElasticPoolName));
List _queryParameters = new List();
if (apiVersion != null)
{
@@ -1691,7 +1603,7 @@ internal DatabasesOperations(SqlManagementClient client)
}
///
- /// Gets a database inside of a recommented elastic pool.
+ /// Imports a bacpac into a new database.
///
///
/// The name of the resource group that contains the resource. You can obtain
@@ -1700,11 +1612,96 @@ internal DatabasesOperations(SqlManagementClient client)
///
/// The name of the server.
///
- ///
- /// The name of the elastic pool to be retrieved.
+ ///
+ /// The required parameters for importing a Bacpac into a database.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public async Task> ImportWithHttpMessagesAsync(string resourceGroupName, string serverName, ImportRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ // Send request
+ AzureOperationResponse _response = await BeginImportWithHttpMessagesAsync(resourceGroupName, serverName, parameters, customHeaders, cancellationToken).ConfigureAwait(false);
+ return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Creates an import operation that imports a bacpac into an existing
+ /// database. The existing database must be empty.
+ ///
+ ///
+ /// The 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 retrieved.
+ /// The name of the database to import into
+ ///
+ ///
+ /// The required parameters for importing a Bacpac into a database.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public async Task> CreateImportOperationWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, ImportExtensionRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ // Send Request
+ AzureOperationResponse _response = await BeginCreateImportOperationWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, parameters, customHeaders, cancellationToken).ConfigureAwait(false);
+ return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Exports a database to a bacpac.
+ ///
+ ///
+ /// The 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 exported.
+ ///
+ ///
+ /// The required parameters for exporting a database.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public async Task> ExportWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, ExportRequest 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);
+ }
+
+ ///
+ /// Returns database metrics.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can obtain
+ /// this value from the Azure Resource Manager API or the portal.
+ ///
+ ///
+ /// The name of the server.
+ ///
+ ///
+ /// The name of the database.
+ ///
+ ///
+ /// An OData filter expression that describes a subset of metrics to return.
///
///
/// Headers that will be added to request.
@@ -1727,7 +1724,7 @@ internal DatabasesOperations(SqlManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> GetByRecommendedElasticPoolWithHttpMessagesAsync(string resourceGroupName, string serverName, string recommendedElasticPoolName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string filter, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.SubscriptionId == null)
{
@@ -1741,14 +1738,14 @@ internal DatabasesOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "serverName");
}
- if (recommendedElasticPoolName == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "recommendedElasticPoolName");
- }
if (databaseName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "databaseName");
}
+ if (filter == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "filter");
+ }
string apiVersion = "2014-04-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
@@ -1760,24 +1757,27 @@ internal DatabasesOperations(SqlManagementClient client)
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serverName", serverName);
- tracingParameters.Add("recommendedElasticPoolName", recommendedElasticPoolName);
tracingParameters.Add("databaseName", databaseName);
+ tracingParameters.Add("filter", filter);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "GetByRecommendedElasticPool", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "ListMetrics", 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}/recommendedElasticPools/{recommendedElasticPoolName}/databases/{databaseName}").ToString();
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metrics").ToString();
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName));
- _url = _url.Replace("{recommendedElasticPoolName}", System.Uri.EscapeDataString(recommendedElasticPoolName));
_url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName));
List _queryParameters = new List();
if (apiVersion != null)
{
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
}
+ if (filter != null)
+ {
+ _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter)));
+ }
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
@@ -1871,7 +1871,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"))
@@ -1884,7 +1884,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)
{
@@ -1904,7 +1904,7 @@ internal DatabasesOperations(SqlManagementClient client)
}
///
- /// Returns a list of databases inside a recommented elastic pool.
+ /// Returns database metric definitions.
///
///
/// The name of the resource group that contains the resource. You can obtain
@@ -1913,8 +1913,8 @@ internal DatabasesOperations(SqlManagementClient client)
///
/// The name of the server.
///
- ///
- /// The name of the recommended elastic pool to be retrieved.
+ ///
+ /// The name of the database.
///
///
/// Headers that will be added to request.
@@ -1937,7 +1937,7 @@ internal DatabasesOperations(SqlManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListByRecommendedElasticPoolWithHttpMessagesAsync(string resourceGroupName, string serverName, string recommendedElasticPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListMetricDefinitionsWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.SubscriptionId == null)
{
@@ -1951,9 +1951,9 @@ internal DatabasesOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "serverName");
}
- if (recommendedElasticPoolName == null)
+ if (databaseName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "recommendedElasticPoolName");
+ throw new ValidationException(ValidationRules.CannotBeNull, "databaseName");
}
string apiVersion = "2014-04-01";
// Tracing
@@ -1966,17 +1966,17 @@ internal DatabasesOperations(SqlManagementClient client)
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serverName", serverName);
- tracingParameters.Add("recommendedElasticPoolName", recommendedElasticPoolName);
+ tracingParameters.Add("databaseName", databaseName);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListByRecommendedElasticPool", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "ListMetricDefinitions", 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}/recommendedElasticPools/{recommendedElasticPoolName}/databases").ToString();
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metricDefinitions").ToString();
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName));
- _url = _url.Replace("{recommendedElasticPoolName}", System.Uri.EscapeDataString(recommendedElasticPoolName));
+ _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName));
List _queryParameters = new List();
if (apiVersion != null)
{
@@ -2075,7 +2075,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"))
@@ -2088,7 +2088,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)
{
@@ -2309,7 +2309,7 @@ internal DatabasesOperations(SqlManagementClient client)
}
///
- /// Imports a bacpac into a new database.
+ /// Pauses a data warehouse.
///
///
/// The name of the resource group that contains the resource. You can obtain
@@ -2318,8 +2318,8 @@ internal DatabasesOperations(SqlManagementClient client)
///
/// The name of the server.
///
- ///
- /// The required parameters for importing a Bacpac into a database.
+ ///
+ /// The name of the data warehouse to pause.
///
///
/// Headers that will be added to request.
@@ -2330,9 +2330,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
///
@@ -2342,7 +2339,7 @@ internal DatabasesOperations(SqlManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> BeginImportWithHttpMessagesAsync(string resourceGroupName, string serverName, ImportRequest parameters, 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 (Client.SubscriptionId == null)
{
@@ -2356,13 +2353,9 @@ internal DatabasesOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "serverName");
}
- if (parameters == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "parameters");
- }
- if (parameters != null)
+ if (databaseName == null)
{
- parameters.Validate();
+ throw new ValidationException(ValidationRules.CannotBeNull, "databaseName");
}
string apiVersion = "2014-04-01";
// Tracing
@@ -2375,16 +2368,17 @@ internal DatabasesOperations(SqlManagementClient client)
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serverName", serverName);
- tracingParameters.Add("parameters", parameters);
+ tracingParameters.Add("databaseName", databaseName);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "BeginImport", 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}/import").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("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName));
+ _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName));
List _queryParameters = new List();
if (apiVersion != null)
{
@@ -2428,12 +2422,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)
{
@@ -2489,31 +2477,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);
@@ -2522,8 +2492,7 @@ internal DatabasesOperations(SqlManagementClient client)
}
///
- /// Creates an import operation that imports a bacpac into an existing
- /// database. The existing database must be empty.
+ /// Resumes a data warehouse.
///
///
/// The name of the resource group that contains the resource. You can obtain
@@ -2532,11 +2501,8 @@ internal DatabasesOperations(SqlManagementClient client)
///
/// The name of the server.
///
- ///
- /// The name of the database to import into
- ///
- ///
- /// The required parameters for importing a Bacpac into a database.
+ ///
+ /// The name of the data warehouse to resume.
///
///
/// Headers that will be added to request.
@@ -2547,9 +2513,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
///
@@ -2559,7 +2522,7 @@ internal DatabasesOperations(SqlManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> BeginCreateImportOperationWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, ImportExtensionRequest 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 (Client.SubscriptionId == null)
{
@@ -2577,16 +2540,7 @@ internal DatabasesOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "databaseName");
}
- if (parameters == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "parameters");
- }
- if (parameters != null)
- {
- parameters.Validate();
- }
string apiVersion = "2014-04-01";
- string extensionName = "import";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -2598,19 +2552,16 @@ internal DatabasesOperations(SqlManagementClient client)
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serverName", serverName);
tracingParameters.Add("databaseName", databaseName);
- tracingParameters.Add("extensionName", extensionName);
- tracingParameters.Add("parameters", parameters);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "BeginCreateImportOperation", 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}/extensions/{extensionName}").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("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName));
_url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName));
- _url = _url.Replace("{extensionName}", System.Uri.EscapeDataString(extensionName));
List _queryParameters = new List();
if (apiVersion != null)
{
@@ -2623,7 +2574,7 @@ internal DatabasesOperations(SqlManagementClient client)
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("PUT");
+ _httpRequest.Method = new HttpMethod("POST");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
@@ -2654,12 +2605,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)
{
@@ -2680,7 +2625,7 @@ internal DatabasesOperations(SqlManagementClient client)
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
- if ((int)_statusCode != 201 && (int)_statusCode != 202)
+ if ((int)_statusCode != 200 && (int)_statusCode != 202)
{
var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
@@ -2715,31 +2660,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 == 201)
- {
- _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- try
- {
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
- }
- catch (JsonException ex)
- {
- _httpRequest.Dispose();
- if (_httpResponse != null)
- {
- _httpResponse.Dispose();
- }
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
- }
- }
if (_shouldTrace)
{
ServiceClientTracing.Exit(_invocationId, _result);
@@ -2748,7 +2675,7 @@ internal DatabasesOperations(SqlManagementClient client)
}
///
- /// Exports a database to a bacpac.
+ /// Creates a new database or updates an existing database.
///
///
/// The name of the resource group that contains the resource. You can obtain
@@ -2758,10 +2685,10 @@ internal DatabasesOperations(SqlManagementClient client)
/// The name of the server.
///
///
- /// The name of the database to be exported.
+ /// The name of the database to be operated on (updated or created).
///
///
- /// The required parameters for exporting a database.
+ /// The required parameters for creating or updating a database.
///
///
/// Headers that will be added to request.
@@ -2784,7 +2711,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, ExportRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Database parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.SubscriptionId == null)
{
@@ -2824,11 +2751,11 @@ internal DatabasesOperations(SqlManagementClient client)
tracingParameters.Add("databaseName", databaseName);
tracingParameters.Add("parameters", parameters);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "BeginExport", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/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}").ToString();
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName));
@@ -2845,7 +2772,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("PUT");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
@@ -2902,7 +2829,7 @@ internal DatabasesOperations(SqlManagementClient client)
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
- if ((int)_statusCode != 200 && (int)_statusCode != 202)
+ if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202)
{
var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
@@ -2937,7 +2864,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"))
@@ -2950,7 +2877,25 @@ 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)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 201)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -2970,7 +2915,7 @@ internal DatabasesOperations(SqlManagementClient client)
}
///
- /// Pauses a data warehouse.
+ /// Updates an existing database.
///
///
/// The name of the resource group that contains the resource. You can obtain
@@ -2980,7 +2925,10 @@ internal DatabasesOperations(SqlManagementClient client)
/// The name of the server.
///
///
- /// The name of the data warehouse to pause.
+ /// The name of the database to be updated.
+ ///
+ ///
+ /// The required parameters for updating a database.
///
///
/// Headers that will be added to request.
@@ -2991,6 +2939,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
///
@@ -3000,7 +2951,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> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, DatabaseUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.SubscriptionId == null)
{
@@ -3018,6 +2969,10 @@ internal DatabasesOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "databaseName");
}
+ if (parameters == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "parameters");
+ }
string apiVersion = "2014-04-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
@@ -3030,12 +2985,13 @@ internal DatabasesOperations(SqlManagementClient client)
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serverName", serverName);
tracingParameters.Add("databaseName", databaseName);
+ tracingParameters.Add("parameters", parameters);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "BeginPause", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/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}").ToString();
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName));
@@ -3052,7 +3008,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("PATCH");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
@@ -3083,6 +3039,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)
{
@@ -3138,13 +3100,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);
@@ -3153,7 +3133,7 @@ internal DatabasesOperations(SqlManagementClient client)
}
///
- /// Resumes a data warehouse.
+ /// Imports a bacpac into a new database.
///
///
/// The name of the resource group that contains the resource. You can obtain
@@ -3162,8 +3142,8 @@ internal DatabasesOperations(SqlManagementClient client)
///
/// The name of the server.
///
- ///
- /// The name of the data warehouse to resume.
+ ///
+ /// The required parameters for importing a Bacpac into a database.
///
///
/// Headers that will be added to request.
@@ -3174,6 +3154,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
///
@@ -3183,7 +3166,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, ImportRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.SubscriptionId == null)
{
@@ -3197,9 +3180,13 @@ internal DatabasesOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "serverName");
}
- if (databaseName == null)
+ if (parameters == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "databaseName");
+ throw new ValidationException(ValidationRules.CannotBeNull, "parameters");
+ }
+ if (parameters != null)
+ {
+ parameters.Validate();
}
string apiVersion = "2014-04-01";
// Tracing
@@ -3212,17 +3199,16 @@ internal DatabasesOperations(SqlManagementClient client)
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serverName", serverName);
- tracingParameters.Add("databaseName", databaseName);
+ tracingParameters.Add("parameters", parameters);
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}/import").ToString();
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName));
- _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName));
List _queryParameters = new List();
if (apiVersion != null)
{
@@ -3266,6 +3252,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)
{
@@ -3321,13 +3313,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);
@@ -3336,7 +3346,8 @@ internal DatabasesOperations(SqlManagementClient client)
}
///
- /// Creates a new database or updates an existing database.
+ /// Creates an import operation that imports a bacpac into an existing
+ /// database. The existing database must be empty.
///
///
/// The name of the resource group that contains the resource. You can obtain
@@ -3346,10 +3357,10 @@ internal DatabasesOperations(SqlManagementClient client)
/// The name of the server.
///
///
- /// The name of the database to be operated on (updated or created).
+ /// The name of the database to import into
///
///
- /// The required parameters for creating or updating a database.
+ /// The required parameters for importing a Bacpac into a database.
///
///
/// Headers that will be added to request.
@@ -3372,7 +3383,7 @@ internal DatabasesOperations(SqlManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Database parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> BeginCreateImportOperationWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, ImportExtensionRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.SubscriptionId == null)
{
@@ -3399,6 +3410,7 @@ internal DatabasesOperations(SqlManagementClient client)
parameters.Validate();
}
string apiVersion = "2014-04-01";
+ string extensionName = "import";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -3410,17 +3422,19 @@ internal DatabasesOperations(SqlManagementClient client)
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serverName", serverName);
tracingParameters.Add("databaseName", databaseName);
+ tracingParameters.Add("extensionName", extensionName);
tracingParameters.Add("parameters", parameters);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "BeginCreateImportOperation", 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}").ToString();
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions/{extensionName}").ToString();
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName));
_url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName));
+ _url = _url.Replace("{extensionName}", System.Uri.EscapeDataString(extensionName));
List _queryParameters = new List();
if (apiVersion != null)
{
@@ -3490,7 +3504,7 @@ internal DatabasesOperations(SqlManagementClient client)
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
- if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202)
+ if ((int)_statusCode != 201 && (int)_statusCode != 202)
{
var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
@@ -3525,7 +3539,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"))
@@ -3533,30 +3547,12 @@ internal DatabasesOperations(SqlManagementClient client)
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
// Deserialize Response
- if ((int)_statusCode == 200)
- {
- _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- try
- {
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
- }
- catch (JsonException ex)
- {
- _httpRequest.Dispose();
- if (_httpResponse != null)
- {
- _httpResponse.Dispose();
- }
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
- }
- }
- // Deserialize Response
if ((int)_statusCode == 201)
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -3576,7 +3572,7 @@ internal DatabasesOperations(SqlManagementClient client)
}
///
- /// Updates an existing database.
+ /// Exports a database to a bacpac.
///
///
/// The name of the resource group that contains the resource. You can obtain
@@ -3586,10 +3582,10 @@ internal DatabasesOperations(SqlManagementClient client)
/// The name of the server.
///
///
- /// The name of the database to be updated.
+ /// The name of the database to be exported.
///
///
- /// The required parameters for updating a database.
+ /// The required parameters for exporting a database.
///
///
/// Headers that will be added to request.
@@ -3612,7 +3608,7 @@ internal DatabasesOperations(SqlManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, DatabaseUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> BeginExportWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, ExportRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.SubscriptionId == null)
{
@@ -3634,6 +3630,10 @@ internal DatabasesOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "parameters");
}
+ if (parameters != null)
+ {
+ parameters.Validate();
+ }
string apiVersion = "2014-04-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
@@ -3648,11 +3648,11 @@ internal DatabasesOperations(SqlManagementClient client)
tracingParameters.Add("databaseName", databaseName);
tracingParameters.Add("parameters", parameters);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", 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}").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("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName));
@@ -3669,7 +3669,7 @@ internal DatabasesOperations(SqlManagementClient client)
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("PATCH");
+ _httpRequest.Method = new HttpMethod("POST");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
@@ -3761,7 +3761,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"))
@@ -3774,7 +3774,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)
{
diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/DatabasesOperationsExtensions.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/DatabasesOperationsExtensions.cs
index 9969d198f908..fd9c9ea53d44 100644
--- a/src/SDKs/SqlManagement/Management.Sql/Generated/DatabasesOperationsExtensions.cs
+++ b/src/SDKs/SqlManagement/Management.Sql/Generated/DatabasesOperationsExtensions.cs
@@ -24,7 +24,7 @@ namespace Microsoft.Azure.Management.Sql
public static partial class DatabasesOperationsExtensions
{
///
- /// Imports a bacpac into a new database.
+ /// Pauses a data warehouse.
///
///
/// The operations group for this extension method.
@@ -36,16 +36,16 @@ public static partial class DatabasesOperationsExtensions
///
/// The name of the server.
///
- ///
- /// The required parameters for importing a Bacpac into a database.
+ ///
+ /// The name of the data warehouse to pause.
///
- public static ImportExportResponse Import(this IDatabasesOperations operations, string resourceGroupName, string serverName, ImportRequest parameters)
+ public static void Pause(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName)
{
- return operations.ImportAsync(resourceGroupName, serverName, parameters).GetAwaiter().GetResult();
+ operations.PauseAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult();
}
///
- /// Imports a bacpac into a new database.
+ /// Pauses a data warehouse.
///
///
/// The operations group for this extension method.
@@ -57,23 +57,19 @@ public static ImportExportResponse Import(this IDatabasesOperations operations,
///
/// The name of the server.
///
- ///
- /// The required parameters for importing a Bacpac into a database.
+ ///
+ /// The name of the data warehouse to pause.
///
///
/// The cancellation token.
///
- public static async Task ImportAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, ImportRequest parameters, 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.ImportWithHttpMessagesAsync(resourceGroupName, serverName, parameters, null, cancellationToken).ConfigureAwait(false))
- {
- return _result.Body;
- }
+ (await operations.PauseWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false)).Dispose();
}
///
- /// Creates an import operation that imports a bacpac into an existing
- /// database. The existing database must be empty.
+ /// Resumes a data warehouse.
///
///
/// The operations group for this extension method.
@@ -86,19 +82,15 @@ public static ImportExportResponse Import(this IDatabasesOperations operations,
/// The name of the server.
///
///
- /// The name of the database to import into
- ///
- ///
- /// The required parameters for importing a Bacpac into a database.
+ /// The name of the data warehouse to resume.
///
- public static ImportExportResponse CreateImportOperation(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, ImportExtensionRequest parameters)
+ public static void Resume(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName)
{
- return operations.CreateImportOperationAsync(resourceGroupName, serverName, databaseName, parameters).GetAwaiter().GetResult();
+ operations.ResumeAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult();
}
///
- /// Creates an import operation that imports a bacpac into an existing
- /// database. The existing database must be empty.
+ /// Resumes a data warehouse.
///
///
/// The operations group for this extension method.
@@ -111,24 +103,18 @@ public static ImportExportResponse CreateImportOperation(this IDatabasesOperatio
/// The name of the server.
///
///
- /// The name of the database to import into
- ///
- ///
- /// The required parameters for importing a Bacpac into a database.
+ /// The name of the data warehouse to resume.
///
///
/// The cancellation token.
///
- public static async Task CreateImportOperationAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, ImportExtensionRequest parameters, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task ResumeAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.CreateImportOperationWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, parameters, null, cancellationToken).ConfigureAwait(false))
- {
- return _result.Body;
- }
+ (await operations.ResumeWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false)).Dispose();
}
///
- /// Exports a database to a bacpac.
+ /// Creates a new database or updates an existing database.
///
///
/// The operations group for this extension method.
@@ -141,18 +127,18 @@ public static ImportExportResponse CreateImportOperation(this IDatabasesOperatio
/// The name of the server.
///
///
- /// The name of the database to be exported.
+ /// The name of the database to be operated on (updated or created).
///
///
- /// The required parameters for exporting a database.
+ /// The required parameters for creating or updating a database.
///
- public static ImportExportResponse Export(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, ExportRequest parameters)
+ public static Database CreateOrUpdate(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, Database parameters)
{
- return operations.ExportAsync(resourceGroupName, serverName, databaseName, parameters).GetAwaiter().GetResult();
+ return operations.CreateOrUpdateAsync(resourceGroupName, serverName, databaseName, parameters).GetAwaiter().GetResult();
}
///
- /// Exports a database to a bacpac.
+ /// Creates a new database or updates an existing database.
///
///
/// The operations group for this extension method.
@@ -165,24 +151,24 @@ public static ImportExportResponse Export(this IDatabasesOperations operations,
/// The name of the server.
///
///
- /// The name of the database to be exported.
+ /// The name of the database to be operated on (updated or created).
///
///
- /// The required parameters for exporting a database.
+ /// The required parameters for creating or updating a database.
///
///
/// The cancellation token.
///
- public static async Task ExportAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, ExportRequest parameters, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task CreateOrUpdateAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, Database parameters, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.ExportWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, parameters, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, parameters, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
///
- /// Returns database metrics.
+ /// Updates an existing database.
///
///
/// The operations group for this extension method.
@@ -195,18 +181,18 @@ public static ImportExportResponse Export(this IDatabasesOperations operations,
/// The name of the server.
///
///
- /// The name of the database.
+ /// The name of the database to be updated.
///
- ///
- /// An OData filter expression that describes a subset of metrics to return.
+ ///
+ /// The required parameters for updating a database.
///
- public static IEnumerable ListMetrics(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, string filter)
+ public static Database Update(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, DatabaseUpdate parameters)
{
- return operations.ListMetricsAsync(resourceGroupName, serverName, databaseName, filter).GetAwaiter().GetResult();
+ return operations.UpdateAsync(resourceGroupName, serverName, databaseName, parameters).GetAwaiter().GetResult();
}
///
- /// Returns database metrics.
+ /// Updates an existing database.
///
///
/// The operations group for this extension method.
@@ -219,24 +205,24 @@ public static IEnumerable ListMetrics(this IDatabasesOperations operatio
/// The name of the server.
///
///
- /// The name of the database.
+ /// The name of the database to be updated.
///
- ///
- /// An OData filter expression that describes a subset of metrics to return.
+ ///
+ /// The required parameters for updating a database.
///
///
/// The cancellation token.
///
- public static async Task> ListMetricsAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, string filter, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task UpdateAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, DatabaseUpdate parameters, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.ListMetricsWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, filter, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, parameters, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
///
- /// Returns database metric definitions.
+ /// Deletes a database.
///
///
/// The operations group for this extension method.
@@ -249,15 +235,15 @@ public static IEnumerable ListMetrics(this IDatabasesOperations operatio
/// The name of the server.
///
///
- /// The name of the database.
+ /// The name of the database to be deleted.
///
- public static IEnumerable ListMetricDefinitions(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName)
+ public static void Delete(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName)
{
- return operations.ListMetricDefinitionsAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult();
+ operations.DeleteAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult();
}
///
- /// Returns database metric definitions.
+ /// Deletes a database.
///
///
/// The operations group for this extension method.
@@ -270,21 +256,18 @@ public static IEnumerable ListMetricDefinitions(this IDatabase
/// The name of the server.
///
///
- /// The name of the database.
+ /// The name of the database to be deleted.
///
///
/// The cancellation token.
///
- public static async Task> ListMetricDefinitionsAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task DeleteAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.ListMetricDefinitionsWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false))
- {
- return _result.Body;
- }
+ (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false)).Dispose();
}
///
- /// Pauses a data warehouse.
+ /// Gets a database.
///
///
/// The operations group for this extension method.
@@ -297,15 +280,19 @@ public static IEnumerable ListMetricDefinitions(this IDatabase
/// The name of the server.
///
///
- /// The name of the data warehouse to pause.
+ /// The name of the database to be retrieved.
///
- public static void Pause(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName)
+ ///
+ /// A comma separated list of child objects to expand in the response. Possible
+ /// properties: serviceTierAdvisors, transparentDataEncryption.
+ ///
+ public static Database Get(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, string expand = default(string))
{
- operations.PauseAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult();
+ return operations.GetAsync(resourceGroupName, serverName, databaseName, expand).GetAwaiter().GetResult();
}
///
- /// Pauses a data warehouse.
+ /// Gets a database.
///
///
/// The operations group for this extension method.
@@ -318,18 +305,25 @@ public static void Pause(this IDatabasesOperations operations, string resourceGr
/// The name of the server.
///
///
- /// The name of the data warehouse to pause.
+ /// The name of the database to be retrieved.
+ ///
+ ///
+ /// A comma separated list of child objects to expand in the response. Possible
+ /// properties: serviceTierAdvisors, transparentDataEncryption.
///
///
/// 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 GetAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken))
{
- (await operations.PauseWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, expand, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
}
///
- /// Resumes a data warehouse.
+ /// Returns a list of databases in a server.
///
///
/// The operations group for this extension method.
@@ -341,16 +335,20 @@ public static void Pause(this IDatabasesOperations operations, string resourceGr
///
/// The name of the server.
///
- ///
- /// The name of the data warehouse to resume.
+ ///
+ /// A comma separated list of child objects to expand in the response. Possible
+ /// properties: serviceTierAdvisors, transparentDataEncryption.
///
- public static void Resume(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName)
+ ///
+ /// An OData filter expression that describes a subset of databases to return.
+ ///
+ public static IEnumerable ListByServer(this IDatabasesOperations operations, string resourceGroupName, string serverName, string expand = default(string), string filter = default(string))
{
- operations.ResumeAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult();
+ return operations.ListByServerAsync(resourceGroupName, serverName, expand, filter).GetAwaiter().GetResult();
}
///
- /// Resumes a data warehouse.
+ /// Returns a list of databases in a server.
///
///
/// The operations group for this extension method.
@@ -362,19 +360,26 @@ public static void Resume(this IDatabasesOperations operations, string resourceG
///
/// The name of the server.
///
- ///
- /// The name of the data warehouse to resume.
+ ///
+ /// A comma separated list of child objects to expand in the response. Possible
+ /// properties: serviceTierAdvisors, transparentDataEncryption.
+ ///
+ ///
+ /// An OData filter expression that describes a subset of databases to return.
///
///
/// 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> ListByServerAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string expand = default(string), string filter = default(string), CancellationToken cancellationToken = default(CancellationToken))
{
- (await operations.ResumeWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ using (var _result = await operations.ListByServerWithHttpMessagesAsync(resourceGroupName, serverName, expand, filter, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
}
///
- /// Creates a new database or updates an existing database.
+ /// Gets a database inside of an elastic pool.
///
///
/// The operations group for this extension method.
@@ -386,19 +391,19 @@ public static void Resume(this IDatabasesOperations operations, string resourceG
///
/// The name of the server.
///
- ///
- /// The name of the database to be operated on (updated or created).
+ ///
+ /// The name of the elastic pool to be retrieved.
///
- ///
- /// The required parameters for creating or updating a database.
+ ///
+ /// The name of the database to be retrieved.
///
- public static Database CreateOrUpdate(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, Database parameters)
+ public static Database GetByElasticPool(this IDatabasesOperations operations, string resourceGroupName, string serverName, string elasticPoolName, string databaseName)
{
- return operations.CreateOrUpdateAsync(resourceGroupName, serverName, databaseName, parameters).GetAwaiter().GetResult();
+ return operations.GetByElasticPoolAsync(resourceGroupName, serverName, elasticPoolName, databaseName).GetAwaiter().GetResult();
}
///
- /// Creates a new database or updates an existing database.
+ /// Gets a database inside of an elastic pool.
///
///
/// The operations group for this extension method.
@@ -410,25 +415,25 @@ public static Database CreateOrUpdate(this IDatabasesOperations operations, stri
///
/// The name of the server.
///
- ///
- /// The name of the database to be operated on (updated or created).
+ ///
+ /// The name of the elastic pool to be retrieved.
///
- ///
- /// The required parameters for creating or updating a database.
+ ///
+ /// The name of the database to be retrieved.
///
///
/// The cancellation token.
///
- public static async Task CreateOrUpdateAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, Database parameters, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task GetByElasticPoolAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string elasticPoolName, string databaseName, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, parameters, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.GetByElasticPoolWithHttpMessagesAsync(resourceGroupName, serverName, elasticPoolName, databaseName, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
///
- /// Updates an existing database.
+ /// Returns a list of databases in an elastic pool.
///
///
/// The operations group for this extension method.
@@ -440,19 +445,16 @@ public static Database CreateOrUpdate(this IDatabasesOperations operations, stri
///
/// The name of the server.
///
- ///
- /// The name of the database to be updated.
- ///
- ///
- /// The required parameters for updating a database.
+ ///
+ /// The name of the elastic pool to be retrieved.
///
- public static Database Update(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, DatabaseUpdate parameters)
+ public static IEnumerable ListByElasticPool(this IDatabasesOperations operations, string resourceGroupName, string serverName, string elasticPoolName)
{
- return operations.UpdateAsync(resourceGroupName, serverName, databaseName, parameters).GetAwaiter().GetResult();
+ return operations.ListByElasticPoolAsync(resourceGroupName, serverName, elasticPoolName).GetAwaiter().GetResult();
}
///
- /// Updates an existing database.
+ /// Returns a list of databases in an elastic pool.
///
///
/// The operations group for this extension method.
@@ -464,25 +466,22 @@ public static Database Update(this IDatabasesOperations operations, string resou
///
/// The name of the server.
///
- ///
- /// The name of the database to be updated.
- ///
- ///
- /// The required parameters for updating a database.
+ ///
+ /// The name of the elastic pool to be retrieved.
///
///
/// The cancellation token.
///
- public static async Task UpdateAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, DatabaseUpdate 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.UpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, parameters, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.ListByElasticPoolWithHttpMessagesAsync(resourceGroupName, serverName, elasticPoolName, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
///
- /// Deletes a database.
+ /// Gets a database inside of a recommented elastic pool.
///
///
/// The operations group for this extension method.
@@ -494,16 +493,19 @@ public static Database Update(this IDatabasesOperations operations, string resou
///
/// The name of the server.
///
+ ///
+ /// The name of the elastic pool to be retrieved.
+ ///
///
- /// The name of the database to be deleted.
+ /// The name of the database to be retrieved.
///
- public static void Delete(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName)
+ public static Database GetByRecommendedElasticPool(this IDatabasesOperations operations, string resourceGroupName, string serverName, string recommendedElasticPoolName, string databaseName)
{
- operations.DeleteAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult();
+ return operations.GetByRecommendedElasticPoolAsync(resourceGroupName, serverName, recommendedElasticPoolName, databaseName).GetAwaiter().GetResult();
}
///
- /// Deletes a database.
+ /// Gets a database inside of a recommented elastic pool.
///
///
/// The operations group for this extension method.
@@ -515,19 +517,25 @@ public static void Delete(this IDatabasesOperations operations, string resourceG
///
/// The name of the server.
///
+ ///
+ /// The name of the elastic pool to be retrieved.
+ ///
///
- /// The name of the database to be deleted.
+ /// The name of the database to be retrieved.
///
///
/// The cancellation token.
///
- public static async Task DeleteAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task GetByRecommendedElasticPoolAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string recommendedElasticPoolName, string databaseName, CancellationToken cancellationToken = default(CancellationToken))
{
- (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ using (var _result = await operations.GetByRecommendedElasticPoolWithHttpMessagesAsync(resourceGroupName, serverName, recommendedElasticPoolName, databaseName, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
}
///
- /// Gets a database.
+ /// Returns a list of databases inside a recommented elastic pool.
///
///
/// The operations group for this extension method.
@@ -539,20 +547,16 @@ public static void Delete(this IDatabasesOperations operations, string resourceG
///
/// The name of the server.
///
- ///
- /// The name of the database to be retrieved.
- ///
- ///
- /// A comma separated list of child objects to expand in the response. Possible
- /// properties: serviceTierAdvisors, transparentDataEncryption.
+ ///
+ /// The name of the recommended elastic pool to be retrieved.
///
- public static Database Get(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, string expand = default(string))
+ public static IEnumerable ListByRecommendedElasticPool(this IDatabasesOperations operations, string resourceGroupName, string serverName, string recommendedElasticPoolName)
{
- return operations.GetAsync(resourceGroupName, serverName, databaseName, expand).GetAwaiter().GetResult();
+ return operations.ListByRecommendedElasticPoolAsync(resourceGroupName, serverName, recommendedElasticPoolName).GetAwaiter().GetResult();
}
///
- /// Gets a database.
+ /// Returns a list of databases inside a recommented elastic pool.
///
///
/// The operations group for this extension method.
@@ -564,26 +568,22 @@ public static void Delete(this IDatabasesOperations operations, string resourceG
///
/// The name of the server.
///
- ///
- /// The name of the database to be retrieved.
- ///
- ///
- /// A comma separated list of child objects to expand in the response. Possible
- /// properties: serviceTierAdvisors, transparentDataEncryption.
+ ///
+ /// The name of the recommended elastic pool to be retrieved.
///
///
/// The cancellation token.
///
- public static async Task GetAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task> ListByRecommendedElasticPoolAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string recommendedElasticPoolName, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, expand, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.ListByRecommendedElasticPoolWithHttpMessagesAsync(resourceGroupName, serverName, recommendedElasticPoolName, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
///
- /// Returns a list of databases in a server.
+ /// Imports a bacpac into a new database.
///
///
/// The operations group for this extension method.
@@ -595,20 +595,16 @@ public static void Delete(this IDatabasesOperations operations, string resourceG
///
/// The name of the server.
///
- ///
- /// A comma separated list of child objects to expand in the response. Possible
- /// properties: serviceTierAdvisors, transparentDataEncryption.
- ///
- ///
- /// An OData filter expression that describes a subset of databases to return.
+ ///
+ /// The required parameters for importing a Bacpac into a database.
///
- public static IEnumerable ListByServer(this IDatabasesOperations operations, string resourceGroupName, string serverName, string expand = default(string), string filter = default(string))
+ public static ImportExportResponse Import(this IDatabasesOperations operations, string resourceGroupName, string serverName, ImportRequest parameters)
{
- return operations.ListByServerAsync(resourceGroupName, serverName, expand, filter).GetAwaiter().GetResult();
+ return operations.ImportAsync(resourceGroupName, serverName, parameters).GetAwaiter().GetResult();
}
///
- /// Returns a list of databases in a server.
+ /// Imports a bacpac into a new database.
///
///
/// The operations group for this extension method.
@@ -620,26 +616,23 @@ public static void Delete(this IDatabasesOperations operations, string resourceG
///
/// The name of the server.
///
- ///
- /// A comma separated list of child objects to expand in the response. Possible
- /// properties: serviceTierAdvisors, transparentDataEncryption.
- ///
- ///
- /// An OData filter expression that describes a subset of databases to return.
+ ///
+ /// The required parameters for importing a Bacpac into a database.
///
///
/// The cancellation token.
///
- public static async Task> ListByServerAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string expand = default(string), string filter = default(string), CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task ImportAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, ImportRequest parameters, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.ListByServerWithHttpMessagesAsync(resourceGroupName, serverName, expand, filter, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.ImportWithHttpMessagesAsync(resourceGroupName, serverName, parameters, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
///
- /// Gets a database inside of an elastic pool.
+ /// Creates an import operation that imports a bacpac into an existing
+ /// database. The existing database must be empty.
///
///
/// The operations group for this extension method.
@@ -651,19 +644,20 @@ public static void Delete(this IDatabasesOperations operations, string resourceG
///
/// The name of the server.
///
- ///
- /// The name of the elastic pool to be retrieved.
- ///
///
- /// The name of the database to be retrieved.
+ /// The name of the database to import into
///
- public static Database GetByElasticPool(this IDatabasesOperations operations, string resourceGroupName, string serverName, string elasticPoolName, string databaseName)
+ ///
+ /// The required parameters for importing a Bacpac into a database.
+ ///
+ public static ImportExportResponse CreateImportOperation(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, ImportExtensionRequest parameters)
{
- return operations.GetByElasticPoolAsync(resourceGroupName, serverName, elasticPoolName, databaseName).GetAwaiter().GetResult();
+ return operations.CreateImportOperationAsync(resourceGroupName, serverName, databaseName, parameters).GetAwaiter().GetResult();
}
///
- /// Gets a database inside of an elastic pool.
+ /// Creates an import operation that imports a bacpac into an existing
+ /// database. The existing database must be empty.
///
///
/// The operations group for this extension method.
@@ -675,25 +669,25 @@ public static Database GetByElasticPool(this IDatabasesOperations operations, st
///
/// The name of the server.
///
- ///
- /// The name of the elastic pool to be retrieved.
- ///
///
- /// The name of the database to be retrieved.
+ /// The name of the database to import into
+ ///
+ ///
+ /// The required parameters for importing a Bacpac into a database.
///
///
/// The cancellation token.
///
- public static async Task GetByElasticPoolAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string elasticPoolName, string databaseName, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task CreateImportOperationAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, ImportExtensionRequest parameters, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.GetByElasticPoolWithHttpMessagesAsync(resourceGroupName, serverName, elasticPoolName, databaseName, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.CreateImportOperationWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, parameters, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
///
- /// Returns a list of databases in an elastic pool.
+ /// Exports a database to a bacpac.
///
///
/// The operations group for this extension method.
@@ -705,16 +699,19 @@ public static Database GetByElasticPool(this IDatabasesOperations operations, st
///
/// The name of the server.
///
- ///
- /// The name of the elastic pool to be retrieved.
+ ///
+ /// The name of the database to be exported.
///
- public static IEnumerable ListByElasticPool(this IDatabasesOperations operations, string resourceGroupName, string serverName, string elasticPoolName)
+ ///
+ /// The required parameters for exporting a database.
+ ///
+ public static ImportExportResponse Export(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, ExportRequest parameters)
{
- return operations.ListByElasticPoolAsync(resourceGroupName, serverName, elasticPoolName).GetAwaiter().GetResult();
+ return operations.ExportAsync(resourceGroupName, serverName, databaseName, parameters).GetAwaiter().GetResult();
}
///
- /// Returns a list of databases in an elastic pool.
+ /// Exports a database to a bacpac.
///
///
/// The operations group for this extension method.
@@ -726,22 +723,25 @@ public static IEnumerable ListByElasticPool(this IDatabasesOperations
///
/// The name of the server.
///
- ///
- /// The name of the elastic pool to be retrieved.
+ ///
+ /// The name of the database to be exported.
+ ///
+ ///
+ /// The required parameters for exporting a database.
///
///
/// 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, ExportRequest 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;
}
}
///
- /// Gets a database inside of a recommented elastic pool.
+ /// Returns database metrics.
///
///
/// The operations group for this extension method.
@@ -753,19 +753,19 @@ public static IEnumerable ListByElasticPool(this IDatabasesOperations
///
/// The name of the server.
///
- ///
- /// The name of the elastic pool to be retrieved.
- ///
///
- /// The name of the database to be retrieved.
+ /// The name of the database.
///
- public static Database GetByRecommendedElasticPool(this IDatabasesOperations operations, string resourceGroupName, string serverName, string recommendedElasticPoolName, string databaseName)
+ ///
+ /// An OData filter expression that describes a subset of metrics to return.
+ ///
+ public static IEnumerable ListMetrics(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, string filter)
{
- return operations.GetByRecommendedElasticPoolAsync(resourceGroupName, serverName, recommendedElasticPoolName, databaseName).GetAwaiter().GetResult();
+ return operations.ListMetricsAsync(resourceGroupName, serverName, databaseName, filter).GetAwaiter().GetResult();
}
///
- /// Gets a database inside of a recommented elastic pool.
+ /// Returns database metrics.
///
///
/// The operations group for this extension method.
@@ -777,25 +777,25 @@ public static Database GetByRecommendedElasticPool(this IDatabasesOperations ope
///
/// The name of the server.
///
- ///
- /// The name of the elastic pool to be retrieved.
- ///
///
- /// The name of the database to be retrieved.
+ /// The name of the database.
+ ///
+ ///
+ /// An OData filter expression that describes a subset of metrics to return.
///
///
/// The cancellation token.
///
- public static async Task GetByRecommendedElasticPoolAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string recommendedElasticPoolName, string databaseName, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task> ListMetricsAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, string filter, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.GetByRecommendedElasticPoolWithHttpMessagesAsync(resourceGroupName, serverName, recommendedElasticPoolName, databaseName, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.ListMetricsWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, filter, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
///
- /// Returns a list of databases inside a recommented elastic pool.
+ /// Returns database metric definitions.
///
///
/// The operations group for this extension method.
@@ -807,16 +807,16 @@ public static Database GetByRecommendedElasticPool(this IDatabasesOperations ope
///
/// The name of the server.
///
- ///
- /// The name of the recommended elastic pool to be retrieved.
+ ///
+ /// The name of the database.
///
- public static IEnumerable ListByRecommendedElasticPool(this IDatabasesOperations operations, string resourceGroupName, string serverName, string recommendedElasticPoolName)
+ public static IEnumerable ListMetricDefinitions(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName)
{
- return operations.ListByRecommendedElasticPoolAsync(resourceGroupName, serverName, recommendedElasticPoolName).GetAwaiter().GetResult();
+ return operations.ListMetricDefinitionsAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult();
}
///
- /// Returns a list of databases inside a recommented elastic pool.
+ /// Returns database metric definitions.
///
///
/// The operations group for this extension method.
@@ -828,15 +828,15 @@ public static IEnumerable ListByRecommendedElasticPool(this IDatabases
///
/// The name of the server.
///
- ///
- /// The name of the recommended elastic pool to be retrieved.
+ ///
+ /// The name of the database.
///
///
/// The cancellation token.
///
- public static async Task> ListByRecommendedElasticPoolAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string recommendedElasticPoolName, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task> ListMetricDefinitionsAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.ListByRecommendedElasticPoolWithHttpMessagesAsync(resourceGroupName, serverName, recommendedElasticPoolName, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.ListMetricDefinitionsWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
@@ -894,7 +894,7 @@ public static void Rename(this IDatabasesOperations operations, string resourceG
}
///
- /// Imports a bacpac into a new database.
+ /// Pauses a data warehouse.
///
///
/// The operations group for this extension method.
@@ -906,16 +906,16 @@ public static void Rename(this IDatabasesOperations operations, string resourceG
///
/// The name of the server.
///
- ///
- /// The required parameters for importing a Bacpac into a database.
+ ///
+ /// The name of the data warehouse to pause.
///
- public static ImportExportResponse BeginImport(this IDatabasesOperations operations, string resourceGroupName, string serverName, ImportRequest parameters)
+ public static void BeginPause(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName)
{
- return operations.BeginImportAsync(resourceGroupName, serverName, parameters).GetAwaiter().GetResult();
+ operations.BeginPauseAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult();
}
///
- /// Imports a bacpac into a new database.
+ /// Pauses a data warehouse.
///
///
/// The operations group for this extension method.
@@ -927,23 +927,19 @@ public static ImportExportResponse BeginImport(this IDatabasesOperations operati
///
/// The name of the server.
///
- ///
- /// The required parameters for importing a Bacpac into a database.
+ ///
+ /// The name of the data warehouse to pause.
///
///
/// The cancellation token.
///
- public static async Task BeginImportAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, ImportRequest parameters, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task BeginPauseAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.BeginImportWithHttpMessagesAsync(resourceGroupName, serverName, parameters, null, cancellationToken).ConfigureAwait(false))
- {
- return _result.Body;
- }
+ (await operations.BeginPauseWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false)).Dispose();
}
///
- /// Creates an import operation that imports a bacpac into an existing
- /// database. The existing database must be empty.
+ /// Resumes a data warehouse.
///
///
/// The operations group for this extension method.
@@ -956,19 +952,15 @@ public static ImportExportResponse BeginImport(this IDatabasesOperations operati
/// The name of the server.
///
///
- /// The name of the database to import into
- ///
- ///
- /// The required parameters for importing a Bacpac into a database.
+ /// The name of the data warehouse to resume.
///
- public static ImportExportResponse BeginCreateImportOperation(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, ImportExtensionRequest parameters)
+ public static void BeginResume(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName)
{
- return operations.BeginCreateImportOperationAsync(resourceGroupName, serverName, databaseName, parameters).GetAwaiter().GetResult();
+ operations.BeginResumeAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult();
}
///
- /// Creates an import operation that imports a bacpac into an existing
- /// database. The existing database must be empty.
+ /// Resumes a data warehouse.
///
///
/// The operations group for this extension method.
@@ -981,24 +973,18 @@ public static ImportExportResponse BeginCreateImportOperation(this IDatabasesOpe
/// The name of the server.
///
///
- /// The name of the database to import into
- ///
- ///
- /// The required parameters for importing a Bacpac into a database.
+ /// The name of the data warehouse to resume.
///
///
/// The cancellation token.
///
- public static async Task BeginCreateImportOperationAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, ImportExtensionRequest 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.BeginCreateImportOperationWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, parameters, null, cancellationToken).ConfigureAwait(false))
- {
- return _result.Body;
- }
+ (await operations.BeginResumeWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false)).Dispose();
}
///
- /// Exports a database to a bacpac.
+ /// Creates a new database or updates an existing database.
///
///
/// The operations group for this extension method.
@@ -1011,18 +997,18 @@ public static ImportExportResponse BeginCreateImportOperation(this IDatabasesOpe
/// The name of the server.
///
///
- /// The name of the database to be exported.
+ /// The name of the database to be operated on (updated or created).
///
///
- /// The required parameters for exporting a database.
+ /// The required parameters for creating or updating a database.
///
- public static ImportExportResponse BeginExport(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, ExportRequest parameters)
+ public static Database BeginCreateOrUpdate(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, Database parameters)
{
- return operations.BeginExportAsync(resourceGroupName, serverName, databaseName, parameters).GetAwaiter().GetResult();
+ return operations.BeginCreateOrUpdateAsync(resourceGroupName, serverName, databaseName, parameters).GetAwaiter().GetResult();
}
///
- /// Exports a database to a bacpac.
+ /// Creates a new database or updates an existing database.
///
///
/// The operations group for this extension method.
@@ -1035,24 +1021,24 @@ public static ImportExportResponse BeginExport(this IDatabasesOperations operati
/// The name of the server.
///
///
- /// The name of the database to be exported.
+ /// The name of the database to be operated on (updated or created).
///
///
- /// The required parameters for exporting a database.
+ /// The required parameters for creating or updating a database.
///
///
/// The cancellation token.
///
- public static async Task BeginExportAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, ExportRequest parameters, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task BeginCreateOrUpdateAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, Database parameters, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.BeginExportWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, parameters, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, parameters, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
///
- /// Pauses a data warehouse.
+ /// Updates an existing database.
///
///
/// The operations group for this extension method.
@@ -1065,15 +1051,18 @@ public static ImportExportResponse BeginExport(this IDatabasesOperations operati
/// The name of the server.
///
///
- /// The name of the data warehouse to pause.
+ /// The name of the database to be updated.
///
- public static void BeginPause(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName)
+ ///
+ /// The required parameters for updating a database.
+ ///
+ public static Database BeginUpdate(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, DatabaseUpdate parameters)
{
- operations.BeginPauseAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult();
+ return operations.BeginUpdateAsync(resourceGroupName, serverName, databaseName, parameters).GetAwaiter().GetResult();
}
///
- /// Pauses a data warehouse.
+ /// Updates an existing database.
///
///
/// The operations group for this extension method.
@@ -1086,18 +1075,24 @@ public static void BeginPause(this IDatabasesOperations operations, string resou
/// The name of the server.
///
///
- /// The name of the data warehouse to pause.
+ /// The name of the database to be updated.
+ ///
+ ///
+ /// The required parameters for updating a database.
///
///
/// 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 BeginUpdateAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, DatabaseUpdate parameters, CancellationToken cancellationToken = default(CancellationToken))
{
- (await operations.BeginPauseWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, parameters, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
}
///
- /// Resumes a data warehouse.
+ /// Imports a bacpac into a new database.
///
///
/// The operations group for this extension method.
@@ -1109,16 +1104,16 @@ public static void BeginPause(this IDatabasesOperations operations, string resou
///
/// The name of the server.
///
- ///
- /// The name of the data warehouse to resume.
+ ///
+ /// The required parameters for importing a Bacpac into a database.
///
- public static void BeginResume(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName)
+ public static ImportExportResponse BeginImport(this IDatabasesOperations operations, string resourceGroupName, string serverName, ImportRequest parameters)
{
- operations.BeginResumeAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult();
+ return operations.BeginImportAsync(resourceGroupName, serverName, parameters).GetAwaiter().GetResult();
}
///
- /// Resumes a data warehouse.
+ /// Imports a bacpac into a new database.
///
///
/// The operations group for this extension method.
@@ -1130,19 +1125,23 @@ public static void BeginResume(this IDatabasesOperations operations, string reso
///
/// The name of the server.
///
- ///
- /// The name of the data warehouse to resume.
+ ///
+ /// The required parameters for importing a Bacpac into a database.
///
///
/// 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, ImportRequest parameters, CancellationToken cancellationToken = default(CancellationToken))
{
- (await operations.BeginResumeWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ using (var _result = await operations.BeginImportWithHttpMessagesAsync(resourceGroupName, serverName, parameters, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
}
///
- /// Creates a new database or updates an existing database.
+ /// Creates an import operation that imports a bacpac into an existing
+ /// database. The existing database must be empty.
///
///
/// The operations group for this extension method.
@@ -1155,18 +1154,19 @@ public static void BeginResume(this IDatabasesOperations operations, string reso
/// The name of the server.
///
///
- /// The name of the database to be operated on (updated or created).
+ /// The name of the database to import into
///
///
- /// The required parameters for creating or updating a database.
+ /// The required parameters for importing a Bacpac into a database.
///
- public static Database BeginCreateOrUpdate(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, Database parameters)
+ public static ImportExportResponse BeginCreateImportOperation(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, ImportExtensionRequest parameters)
{
- return operations.BeginCreateOrUpdateAsync(resourceGroupName, serverName, databaseName, parameters).GetAwaiter().GetResult();
+ return operations.BeginCreateImportOperationAsync(resourceGroupName, serverName, databaseName, parameters).GetAwaiter().GetResult();
}
///
- /// Creates a new database or updates an existing database.
+ /// Creates an import operation that imports a bacpac into an existing
+ /// database. The existing database must be empty.
///
///
/// The operations group for this extension method.
@@ -1179,24 +1179,24 @@ public static Database BeginCreateOrUpdate(this IDatabasesOperations operations,
/// The name of the server.
///
///
- /// The name of the database to be operated on (updated or created).
+ /// The name of the database to import into
///
///
- /// The required parameters for creating or updating a database.
+ /// The required parameters for importing a Bacpac into a database.
///
///
/// The cancellation token.
///
- public static async Task BeginCreateOrUpdateAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, Database parameters, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task BeginCreateImportOperationAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, ImportExtensionRequest parameters, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, parameters, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.BeginCreateImportOperationWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, parameters, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
///
- /// Updates an existing database.
+ /// Exports a database to a bacpac.
///
///
/// The operations group for this extension method.
@@ -1209,18 +1209,18 @@ public static Database BeginCreateOrUpdate(this IDatabasesOperations operations,
/// The name of the server.
///
///
- /// The name of the database to be updated.
+ /// The name of the database to be exported.
///
///
- /// The required parameters for updating a database.
+ /// The required parameters for exporting a database.
///
- public static Database BeginUpdate(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, DatabaseUpdate parameters)
+ public static ImportExportResponse BeginExport(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, ExportRequest parameters)
{
- return operations.BeginUpdateAsync(resourceGroupName, serverName, databaseName, parameters).GetAwaiter().GetResult();
+ return operations.BeginExportAsync(resourceGroupName, serverName, databaseName, parameters).GetAwaiter().GetResult();
}
///
- /// Updates an existing database.
+ /// Exports a database to a bacpac.
///
///
/// The operations group for this extension method.
@@ -1233,17 +1233,17 @@ public static Database BeginUpdate(this IDatabasesOperations operations, string
/// The name of the server.
///
///
- /// The name of the database to be updated.
+ /// The name of the database to be exported.
///
///
- /// The required parameters for updating a database.
+ /// The required parameters for exporting a database.
///
///
/// The cancellation token.
///
- public static async Task BeginUpdateAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, DatabaseUpdate parameters, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task BeginExportAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, ExportRequest parameters, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, parameters, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.BeginExportWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, parameters, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/ElasticPoolOperations.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/ElasticPoolOperations.cs
new file mode 100644
index 000000000000..313d1a22cc51
--- /dev/null
+++ b/src/SDKs/SqlManagement/Management.Sql/Generated/ElasticPoolOperations.cs
@@ -0,0 +1,617 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.Sql
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+ using System.Net;
+ using System.Net.Http;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// ElasticPoolOperations operations.
+ ///
+ internal partial class ElasticPoolOperations : IServiceOperations, IElasticPoolOperations
+ {
+ ///
+ /// Initializes a new instance of the ElasticPoolOperations class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ internal ElasticPoolOperations(SqlManagementClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the SqlManagementClient
+ ///
+ public SqlManagementClient Client { get; private set; }
+
+ ///
+ /// Cancels the asynchronous operation on the elastic pool.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can obtain
+ /// this value from the Azure Resource Manager API or the portal.
+ ///
+ ///
+ /// The name of the server.
+ ///
+ ///
+ ///
+ ///
+ /// The operation identifier.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task CancelWithHttpMessagesAsync(string resourceGroupName, string serverName, string elasticPoolName, System.Guid operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (serverName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "serverName");
+ }
+ if (elasticPoolName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "elasticPoolName");
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ string apiVersion = "2017-10-01-preview";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("serverName", serverName);
+ tracingParameters.Add("elasticPoolName", elasticPoolName);
+ tracingParameters.Add("operationId", operationId);
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Cancel", 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}/operations/{operationId}/cancel").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("{operationId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(operationId, Client.SerializationSettings).Trim('"')));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("POST");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Gets a list of operations performed on the elastic pool.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can obtain
+ /// this value from the Azure Resource Manager API or the portal.
+ ///
+ ///
+ /// The name of the server.
+ ///
+ ///
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListByElasticPoolWithHttpMessagesAsync(string resourceGroupName, string serverName, string elasticPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (serverName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "serverName");
+ }
+ if (elasticPoolName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "elasticPoolName");
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ string apiVersion = "2017-10-01-preview";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("serverName", serverName);
+ tracingParameters.Add("elasticPoolName", elasticPoolName);
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ 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}/elasticPools/{elasticPoolName}/operations").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)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Gets a list of operations performed on the elastic pool.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListByElasticPoolNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (nextPageLink == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("nextPageLink", nextPageLink);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "ListByElasticPoolNext", tracingParameters);
+ }
+ // Construct URL
+ string _url = "{nextLink}";
+ _url = _url.Replace("{nextLink}", nextPageLink);
+ List _queryParameters = new List();
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ }
+}
diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/ElasticPoolOperationsExtensions.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/ElasticPoolOperationsExtensions.cs
new file mode 100644
index 000000000000..c633583487bc
--- /dev/null
+++ b/src/SDKs/SqlManagement/Management.Sql/Generated/ElasticPoolOperationsExtensions.cs
@@ -0,0 +1,154 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.Sql
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// Extension methods for ElasticPoolOperations.
+ ///
+ public static partial class ElasticPoolOperationsExtensions
+ {
+ ///
+ /// Cancels the asynchronous operation on the elastic pool.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can obtain
+ /// this value from the Azure Resource Manager API or the portal.
+ ///
+ ///
+ /// The name of the server.
+ ///
+ ///
+ ///
+ ///
+ /// The operation identifier.
+ ///
+ public static void Cancel(this IElasticPoolOperations operations, string resourceGroupName, string serverName, string elasticPoolName, System.Guid operationId)
+ {
+ operations.CancelAsync(resourceGroupName, serverName, elasticPoolName, operationId).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Cancels the asynchronous operation on the elastic pool.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can obtain
+ /// this value from the Azure Resource Manager API or the portal.
+ ///
+ ///
+ /// The name of the server.
+ ///
+ ///
+ ///
+ ///
+ /// The operation identifier.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task CancelAsync(this IElasticPoolOperations operations, string resourceGroupName, string serverName, string elasticPoolName, System.Guid operationId, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ (await operations.CancelWithHttpMessagesAsync(resourceGroupName, serverName, elasticPoolName, operationId, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ }
+
+ ///
+ /// Gets a list of operations performed on the elastic pool.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can obtain
+ /// this value from the Azure Resource Manager API or the portal.
+ ///
+ ///
+ /// The name of the server.
+ ///
+ ///
+ ///
+ public static IPage ListByElasticPool(this IElasticPoolOperations operations, string resourceGroupName, string serverName, string elasticPoolName)
+ {
+ return operations.ListByElasticPoolAsync(resourceGroupName, serverName, elasticPoolName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Gets a list of operations performed on the elastic pool.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can obtain
+ /// this value from the Azure Resource Manager API or the portal.
+ ///
+ ///
+ /// The name of the server.
+ ///
+ ///
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListByElasticPoolAsync(this IElasticPoolOperations operations, string resourceGroupName, string serverName, string elasticPoolName, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListByElasticPoolWithHttpMessagesAsync(resourceGroupName, serverName, elasticPoolName, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Gets a list of operations performed on the elastic pool.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ public static IPage ListByElasticPoolNext(this IElasticPoolOperations operations, string nextPageLink)
+ {
+ return operations.ListByElasticPoolNextAsync(nextPageLink).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Gets a list of operations performed on the elastic pool.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListByElasticPoolNextAsync(this IElasticPoolOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListByElasticPoolNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ }
+}
diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/ElasticPoolsOperations.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/ElasticPoolsOperations.cs
index 3724c3c56237..c25d45bf0c75 100644
--- a/src/SDKs/SqlManagement/Management.Sql/Generated/ElasticPoolsOperations.cs
+++ b/src/SDKs/SqlManagement/Management.Sql/Generated/ElasticPoolsOperations.cs
@@ -51,7 +51,7 @@ internal ElasticPoolsOperations(SqlManagementClient client)
public SqlManagementClient Client { get; private set; }
///
- /// Returns elastic pool metrics.
+ /// Creates a new elastic pool or updates an existing elastic pool.
///
///
/// The name of the resource group that contains the resource. You can obtain
@@ -61,10 +61,65 @@ internal ElasticPoolsOperations(SqlManagementClient client)
/// The name of the server.
///
///
- /// The name of the elastic pool.
+ /// The name of the elastic pool to be operated on (updated or created).
///
- ///
- /// An OData filter expression that describes a subset of metrics to return.
+ ///
+ /// The required parameters for creating or updating an elastic pool.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string elasticPoolName, ElasticPool parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ // Send Request
+ AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, elasticPoolName, parameters, customHeaders, cancellationToken).ConfigureAwait(false);
+ return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Updates an existing elastic pool.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can obtain
+ /// this value from the Azure Resource Manager API or the portal.
+ ///
+ ///
+ /// The name of the server.
+ ///
+ ///
+ /// The name of the elastic pool to be updated.
+ ///
+ ///
+ /// The required parameters for updating an elastic pool.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string elasticPoolName, ElasticPoolUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ // Send Request
+ AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, serverName, elasticPoolName, parameters, customHeaders, cancellationToken).ConfigureAwait(false);
+ return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Deletes the elastic pool.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can obtain
+ /// this value from the Azure Resource Manager API or the portal.
+ ///
+ ///
+ /// The name of the server.
+ ///
+ ///
+ /// The name of the elastic pool to be deleted.
///
///
/// Headers that will be added to request.
@@ -75,9 +130,6 @@ internal ElasticPoolsOperations(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
///
@@ -87,7 +139,7 @@ internal ElasticPoolsOperations(SqlManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string serverName, string elasticPoolName, string filter, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string elasticPoolName, Dictionary