diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/DatabasesOperations.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/DatabasesOperations.cs
index 422b90ed5bae..0bcc04e9d018 100644
--- a/src/SDKs/SqlManagement/Management.Sql/Generated/DatabasesOperations.cs
+++ b/src/SDKs/SqlManagement/Management.Sql/Generated/DatabasesOperations.cs
@@ -339,6 +339,426 @@ internal DatabasesOperations(SqlManagementClient client)
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.
+ ///
+ ///
+ /// 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>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string filter, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (serverName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "serverName");
+ }
+ if (databaseName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "databaseName");
+ }
+ if (filter == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "filter");
+ }
+ string apiVersion = "2014-04-01";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("serverName", serverName);
+ tracingParameters.Add("databaseName", databaseName);
+ tracingParameters.Add("filter", filter);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ 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}/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("{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);
+ }
+ // 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;
+ }
+
+ ///
+ /// Returns database metric definitions.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can obtain
+ /// this value from the Azure Resource Manager API or the portal.
+ ///
+ ///
+ /// The name of the server.
+ ///
+ ///
+ /// The name of the database.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListMetricDefinitionsWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (serverName == null)
+ {
+ 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;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("serverName", serverName);
+ tracingParameters.Add("databaseName", databaseName);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ 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}/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("{databaseName}", System.Uri.EscapeDataString(databaseName));
+ 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;
+ }
+
///
/// Deletes a database replication link. Cannot be done during failover.
///
@@ -1360,219 +1780,7 @@ internal DatabasesOperations(SqlManagementClient client)
}
if (expand != null)
{
- _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand)));
- }
- 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;
- }
-
- ///
- /// Returns a list of databases in a server.
- ///
- ///
- /// The name of the resource group that contains the resource. You can obtain
- /// this value from the Azure Resource Manager API or the portal.
- ///
- ///
- /// The name of the server.
- ///
- ///
- /// 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.
- ///
- ///
- /// Headers that will be added to request.
- ///
- ///
- /// The cancellation token.
- ///
- ///
- /// Thrown when the operation returned an invalid status code
- ///
- ///
- /// Thrown when unable to deserialize the response
- ///
- ///
- /// Thrown when a required parameter is null
- ///
- ///
- /// Thrown when a required parameter is null
- ///
- ///
- /// A response object containing the response body and response headers.
- ///
- public async Task>> ListByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, string expand = default(string), string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
- {
- if (Client.SubscriptionId == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
- }
- if (resourceGroupName == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
- }
- if (serverName == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "serverName");
- }
- string apiVersion = "2014-04-01";
- // Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
- string _invocationId = null;
- if (_shouldTrace)
- {
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
- tracingParameters.Add("apiVersion", apiVersion);
- tracingParameters.Add("resourceGroupName", resourceGroupName);
- tracingParameters.Add("serverName", serverName);
- tracingParameters.Add("expand", expand);
- tracingParameters.Add("filter", filter);
- tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListByServer", tracingParameters);
- }
- // Construct URL
- var _baseUrl = Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/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));
- 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)));
+ _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand)));
}
if (_queryParameters.Count > 0)
{
@@ -1667,7 +1875,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"))
@@ -1680,7 +1888,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)
{
@@ -1700,7 +1908,7 @@ internal DatabasesOperations(SqlManagementClient client)
}
///
- /// Returns database usages.
+ /// Returns a list of databases in a server.
///
///
/// The name of the resource group that contains the resource. You can obtain
@@ -1709,8 +1917,12 @@ internal DatabasesOperations(SqlManagementClient client)
///
/// The name of the server.
///
- ///
- /// The name of the database.
+ ///
+ /// 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.
///
///
/// Headers that will be added to request.
@@ -1733,7 +1945,7 @@ internal DatabasesOperations(SqlManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListUsagesWithHttpMessagesAsync(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)
{
@@ -1747,10 +1959,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;
@@ -1762,22 +1970,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, "ListUsages", 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}/usages").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);
@@ -1871,7 +2087,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 +2100,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)
{
@@ -3413,7 +3629,7 @@ internal DatabasesOperations(SqlManagementClient client)
}
///
- /// Gets a database's blob auditing policy.
+ /// Returns database usages.
///
///
/// The name of the resource group that contains the resource. You can obtain
@@ -3423,7 +3639,7 @@ internal DatabasesOperations(SqlManagementClient client)
/// The name of the server.
///
///
- /// The name of the database for which database blob audit policy is defined.
+ /// The name of the database.
///
///
/// Headers that will be added to request.
@@ -3446,7 +3662,7 @@ internal DatabasesOperations(SqlManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> GetBlobAuditingPolicyWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListUsagesWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.SubscriptionId == null)
{
@@ -3464,6 +3680,211 @@ internal DatabasesOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "databaseName");
}
+ string apiVersion = "2014-04-01";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("serverName", serverName);
+ tracingParameters.Add("databaseName", databaseName);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "ListUsages", 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}/usages").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 (_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 database's blob auditing policy.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can obtain
+ /// this value from the Azure Resource Manager API or the portal.
+ ///
+ ///
+ /// The name of the server.
+ ///
+ ///
+ /// The name of the database for which the blob audit policy is defined.
+ ///
+ ///
+ /// 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> GetBlobAuditingPolicyWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (serverName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "serverName");
+ }
+ if (databaseName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "databaseName");
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ string blobAuditingPolicyName = "default";
string apiVersion = "2015-05-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
@@ -3475,17 +3896,19 @@ internal DatabasesOperations(SqlManagementClient client)
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serverName", serverName);
tracingParameters.Add("databaseName", databaseName);
+ tracingParameters.Add("blobAuditingPolicyName", blobAuditingPolicyName);
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "GetBlobAuditingPolicy", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings/default").ToString();
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings/{blobAuditingPolicyName}").ToString();
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName));
_url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName));
+ _url = _url.Replace("{blobAuditingPolicyName}", System.Uri.EscapeDataString(blobAuditingPolicyName));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
if (apiVersion != null)
{
@@ -3627,7 +4050,7 @@ internal DatabasesOperations(SqlManagementClient client)
/// The name of the server.
///
///
- /// The name of the database for which database blob audit policy will be
+ /// The name of the database for which the blob auditing policy will be
/// defined.
///
///
@@ -3656,10 +4079,6 @@ internal DatabasesOperations(SqlManagementClient client)
///
public async Task> CreateOrUpdateBlobAuditingPolicyWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, DatabaseBlobAuditingPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
- if (Client.SubscriptionId == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
- }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
@@ -3676,10 +4095,11 @@ internal DatabasesOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "parameters");
}
- if (parameters != null)
+ if (Client.SubscriptionId == null)
{
- parameters.Validate();
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ string blobAuditingPolicyName = "default";
string apiVersion = "2015-05-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
@@ -3691,6 +4111,7 @@ internal DatabasesOperations(SqlManagementClient client)
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serverName", serverName);
tracingParameters.Add("databaseName", databaseName);
+ tracingParameters.Add("blobAuditingPolicyName", blobAuditingPolicyName);
tracingParameters.Add("parameters", parameters);
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
@@ -3698,11 +4119,12 @@ internal DatabasesOperations(SqlManagementClient client)
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings/default").ToString();
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings/{blobAuditingPolicyName}").ToString();
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName));
_url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName));
+ _url = _url.Replace("{blobAuditingPolicyName}", System.Uri.EscapeDataString(blobAuditingPolicyName));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
if (apiVersion != null)
{
diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/DatabasesOperationsExtensions.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/DatabasesOperationsExtensions.cs
index 5409196c33b9..9dfa94892027 100644
--- a/src/SDKs/SqlManagement/Management.Sql/Generated/DatabasesOperationsExtensions.cs
+++ b/src/SDKs/SqlManagement/Management.Sql/Generated/DatabasesOperationsExtensions.cs
@@ -229,6 +229,108 @@ public static ImportExportResponse Export(this IDatabasesOperations operations,
}
}
+ ///
+ /// Returns database metrics.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can obtain
+ /// this value from the Azure Resource Manager API or the portal.
+ ///
+ ///
+ /// The name of the server.
+ ///
+ ///
+ /// The name of the database.
+ ///
+ ///
+ /// 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.ListMetricsAsync(resourceGroupName, serverName, databaseName, filter).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Returns database metrics.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can obtain
+ /// this value from the Azure Resource Manager API or the portal.
+ ///
+ ///
+ /// The name of the server.
+ ///
+ ///
+ /// The name of the database.
+ ///
+ ///
+ /// An OData filter expression that describes a subset of metrics to return.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ 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.ListMetricsWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, filter, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Returns database metric definitions.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can obtain
+ /// this value from the Azure Resource Manager API or the portal.
+ ///
+ ///
+ /// The name of the server.
+ ///
+ ///
+ /// The name of the database.
+ ///
+ public static IEnumerable ListMetricDefinitions(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName)
+ {
+ return operations.ListMetricDefinitionsAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Returns database metric definitions.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can obtain
+ /// this value from the Azure Resource Manager API or the portal.
+ ///
+ ///
+ /// The name of the server.
+ ///
+ ///
+ /// The name of the database.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListMetricDefinitionsAsync(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;
+ }
+ }
+
///
/// Deletes a database replication link. Cannot be done during failover.
///
@@ -793,54 +895,6 @@ public static void Delete(this IDatabasesOperations operations, string resourceG
}
}
- ///
- /// Returns database usages.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The name of the resource group that contains the resource. You can obtain
- /// this value from the Azure Resource Manager API or the portal.
- ///
- ///
- /// The name of the server.
- ///
- ///
- /// The name of the database.
- ///
- public static IEnumerable ListUsages(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName)
- {
- return operations.ListUsagesAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult();
- }
-
- ///
- /// Returns database usages.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The name of the resource group that contains the resource. You can obtain
- /// this value from the Azure Resource Manager API or the portal.
- ///
- ///
- /// The name of the server.
- ///
- ///
- /// The name of the database.
- ///
- ///
- /// The cancellation token.
- ///
- public static async Task> ListUsagesAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default(CancellationToken))
- {
- using (var _result = await operations.ListUsagesWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false))
- {
- return _result.Body;
- }
- }
-
///
/// Gets a service tier advisor.
///
@@ -1203,6 +1257,54 @@ public static DatabaseSecurityAlertPolicy CreateOrUpdateThreatDetectionPolicy(th
}
}
+ ///
+ /// Returns database usages.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can obtain
+ /// this value from the Azure Resource Manager API or the portal.
+ ///
+ ///
+ /// The name of the server.
+ ///
+ ///
+ /// The name of the database.
+ ///
+ public static IEnumerable ListUsages(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName)
+ {
+ return operations.ListUsagesAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Returns database usages.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can obtain
+ /// this value from the Azure Resource Manager API or the portal.
+ ///
+ ///
+ /// The name of the server.
+ ///
+ ///
+ /// The name of the database.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListUsagesAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListUsagesWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
///
/// Gets a database's blob auditing policy.
///
@@ -1217,7 +1319,7 @@ public static DatabaseSecurityAlertPolicy CreateOrUpdateThreatDetectionPolicy(th
/// The name of the server.
///
///
- /// The name of the database for which database blob audit policy is defined.
+ /// The name of the database for which the blob audit policy is defined.
///
public static DatabaseBlobAuditingPolicy GetBlobAuditingPolicy(this IDatabasesOperations operations, string resourceGroupName, string serverName, string databaseName)
{
@@ -1238,7 +1340,7 @@ public static DatabaseBlobAuditingPolicy GetBlobAuditingPolicy(this IDatabasesOp
/// The name of the server.
///
///
- /// The name of the database for which database blob audit policy is defined.
+ /// The name of the database for which the blob audit policy is defined.
///
///
/// The cancellation token.
@@ -1265,7 +1367,7 @@ public static DatabaseBlobAuditingPolicy GetBlobAuditingPolicy(this IDatabasesOp
/// The name of the server.
///
///
- /// The name of the database for which database blob audit policy will be
+ /// The name of the database for which the blob auditing policy will be
/// defined.
///
///
@@ -1290,7 +1392,7 @@ public static DatabaseBlobAuditingPolicy CreateOrUpdateBlobAuditingPolicy(this I
/// The name of the server.
///
///
- /// The name of the database for which database blob audit policy will be
+ /// The name of the database for which the blob auditing policy will be
/// defined.
///
///
diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/ElasticPoolsOperations.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/ElasticPoolsOperations.cs
index c32acd9fd7fe..24af8dd2aa1f 100644
--- a/src/SDKs/SqlManagement/Management.Sql/Generated/ElasticPoolsOperations.cs
+++ b/src/SDKs/SqlManagement/Management.Sql/Generated/ElasticPoolsOperations.cs
@@ -50,6 +50,426 @@ internal ElasticPoolsOperations(SqlManagementClient client)
///
public SqlManagementClient Client { get; private set; }
+ ///
+ /// Returns elastic pool 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 elastic pool.
+ ///
+ ///
+ /// An OData filter expression that describes a subset of metrics to return.
+ ///
+ ///
+ /// 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>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string serverName, string elasticPoolName, string filter, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (serverName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "serverName");
+ }
+ if (elasticPoolName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "elasticPoolName");
+ }
+ if (filter == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "filter");
+ }
+ string apiVersion = "2014-04-01";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("serverName", serverName);
+ tracingParameters.Add("elasticPoolName", elasticPoolName);
+ tracingParameters.Add("filter", filter);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ 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}/elasticPools/{elasticPoolName}/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("{elasticPoolName}", System.Uri.EscapeDataString(elasticPoolName));
+ 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);
+ }
+ // 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;
+ }
+
+ ///
+ /// Returns elastic pool metric definitions.
+ ///
+ ///
+ /// The name of the 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.
+ ///
+ ///
+ /// 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>> ListMetricDefinitionsWithHttpMessagesAsync(string resourceGroupName, string serverName, string elasticPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (serverName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "serverName");
+ }
+ if (elasticPoolName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "elasticPoolName");
+ }
+ string apiVersion = "2014-04-01";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("serverName", serverName);
+ tracingParameters.Add("elasticPoolName", elasticPoolName);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ 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}/elasticPools/{elasticPoolName}/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("{elasticPoolName}", System.Uri.EscapeDataString(elasticPoolName));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
///
/// Creates a new elastic pool or updates an existing elastic pool.
///
diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/ElasticPoolsOperationsExtensions.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/ElasticPoolsOperationsExtensions.cs
index 5b0f1409861c..9684cb352570 100644
--- a/src/SDKs/SqlManagement/Management.Sql/Generated/ElasticPoolsOperationsExtensions.cs
+++ b/src/SDKs/SqlManagement/Management.Sql/Generated/ElasticPoolsOperationsExtensions.cs
@@ -23,6 +23,108 @@ namespace Microsoft.Azure.Management.Sql
///
public static partial class ElasticPoolsOperationsExtensions
{
+ ///
+ /// Returns elastic pool metrics.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can obtain
+ /// this value from the Azure Resource Manager API or the portal.
+ ///
+ ///
+ /// The name of the server.
+ ///
+ ///
+ /// The name of the elastic pool.
+ ///
+ ///
+ /// An OData filter expression that describes a subset of metrics to return.
+ ///
+ public static IEnumerable ListMetrics(this IElasticPoolsOperations operations, string resourceGroupName, string serverName, string elasticPoolName, string filter)
+ {
+ return operations.ListMetricsAsync(resourceGroupName, serverName, elasticPoolName, filter).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Returns elastic pool metrics.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can obtain
+ /// this value from the Azure Resource Manager API or the portal.
+ ///
+ ///
+ /// The name of the server.
+ ///
+ ///
+ /// The name of the elastic pool.
+ ///
+ ///
+ /// An OData filter expression that describes a subset of metrics to return.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListMetricsAsync(this IElasticPoolsOperations operations, string resourceGroupName, string serverName, string elasticPoolName, string filter, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListMetricsWithHttpMessagesAsync(resourceGroupName, serverName, elasticPoolName, filter, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Returns elastic pool metric definitions.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can obtain
+ /// this value from the Azure Resource Manager API or the portal.
+ ///
+ ///
+ /// The name of the server.
+ ///
+ ///
+ /// The name of the elastic pool.
+ ///
+ public static IEnumerable ListMetricDefinitions(this IElasticPoolsOperations operations, string resourceGroupName, string serverName, string elasticPoolName)
+ {
+ return operations.ListMetricDefinitionsAsync(resourceGroupName, serverName, elasticPoolName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Returns elastic pool metric definitions.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can obtain
+ /// this value from the Azure Resource Manager API or the portal.
+ ///
+ ///
+ /// The name of the server.
+ ///
+ ///
+ /// The name of the elastic pool.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListMetricDefinitionsAsync(this IElasticPoolsOperations operations, string resourceGroupName, string serverName, string elasticPoolName, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListMetricDefinitionsWithHttpMessagesAsync(resourceGroupName, serverName, elasticPoolName, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
///
/// Creates a new elastic pool or updates an existing elastic pool.
///
diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/IDatabasesOperations.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/IDatabasesOperations.cs
index b2e6f54226e9..d20f2e8ebc64 100644
--- a/src/SDKs/SqlManagement/Management.Sql/Generated/IDatabasesOperations.cs
+++ b/src/SDKs/SqlManagement/Management.Sql/Generated/IDatabasesOperations.cs
@@ -152,6 +152,70 @@ public partial interface IDatabasesOperations
///
Task> ExportWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, ExportRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
+ /// 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.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string filter, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Returns database metric definitions.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can
+ /// obtain this value from the Azure Resource Manager API or the
+ /// portal.
+ ///
+ ///
+ /// The name of the server.
+ ///
+ ///
+ /// The name of the database.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListMetricDefinitionsWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
/// Deletes a database replication link. Cannot be done during
/// failover.
///
@@ -499,36 +563,6 @@ public partial interface IDatabasesOperations
///
Task>> ListByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, string expand = default(string), string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
- /// Returns database usages.
- ///
- ///
- /// The name of the resource group that contains the resource. You can
- /// obtain this value from the Azure Resource Manager API or the
- /// portal.
- ///
- ///
- /// The name of the server.
- ///
- ///
- /// The name of the database.
- ///
- ///
- /// The headers that will be added to request.
- ///
- ///
- /// The cancellation token.
- ///
- ///
- /// Thrown when the operation returned an invalid status code
- ///
- ///
- /// Thrown when unable to deserialize the response
- ///
- ///
- /// Thrown when a required parameter is null
- ///
- Task>> ListUsagesWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
/// Gets a service tier advisor.
///
///
@@ -755,6 +789,36 @@ public partial interface IDatabasesOperations
///
Task> CreateOrUpdateThreatDetectionPolicyWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, DatabaseSecurityAlertPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
+ /// Returns database usages.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can
+ /// obtain this value from the Azure Resource Manager API or the
+ /// portal.
+ ///
+ ///
+ /// The name of the server.
+ ///
+ ///
+ /// The name of the database.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListUsagesWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
/// Gets a database's blob auditing policy.
///
///
@@ -766,7 +830,7 @@ public partial interface IDatabasesOperations
/// The name of the server.
///
///
- /// The name of the database for which database blob audit policy is
+ /// The name of the database for which the blob audit policy is
/// defined.
///
///
@@ -797,8 +861,8 @@ public partial interface IDatabasesOperations
/// The name of the server.
///
///
- /// The name of the database for which database blob audit policy will
- /// be defined.
+ /// The name of the database for which the blob auditing policy will be
+ /// defined.
///
///
/// The database blob auditing policy.
diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/IElasticPoolsOperations.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/IElasticPoolsOperations.cs
index 15506976935d..c5c115637675 100644
--- a/src/SDKs/SqlManagement/Management.Sql/Generated/IElasticPoolsOperations.cs
+++ b/src/SDKs/SqlManagement/Management.Sql/Generated/IElasticPoolsOperations.cs
@@ -23,6 +23,70 @@ namespace Microsoft.Azure.Management.Sql
///
public partial interface IElasticPoolsOperations
{
+ ///
+ /// Returns elastic pool 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 elastic pool.
+ ///
+ ///
+ /// An OData filter expression that describes a subset of metrics to
+ /// return.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string serverName, string elasticPoolName, string filter, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Returns elastic pool metric definitions.
+ ///
+ ///
+ /// The name of the 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.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListMetricDefinitionsWithHttpMessagesAsync(string resourceGroupName, string serverName, string elasticPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Creates a new elastic pool or updates an existing elastic pool.
///
diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/IServerAzureADAdministratorsOperations.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/IServerAzureADAdministratorsOperations.cs
index dc3b9924265b..af951e286155 100644
--- a/src/SDKs/SqlManagement/Management.Sql/Generated/IServerAzureADAdministratorsOperations.cs
+++ b/src/SDKs/SqlManagement/Management.Sql/Generated/IServerAzureADAdministratorsOperations.cs
@@ -35,7 +35,7 @@ public partial interface IServerAzureADAdministratorsOperations
///
/// The name of the server.
///
- ///
+ ///
/// The required parameters for creating or updating an Active
/// Directory Administrator.
///
@@ -54,7 +54,7 @@ public partial interface IServerAzureADAdministratorsOperations
///
/// Thrown when a required parameter is null
///
- Task> CreateOrUpdateAzureADAdministratorWithHttpMessagesAsync(string resourceGroupName, string serverName, ServerAzureADAdministrator parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, ServerAzureADAdministrator properties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Deletes an existing server Active Directory Administrator.
///
@@ -75,10 +75,13 @@ public partial interface IServerAzureADAdministratorsOperations
///
/// Thrown when the operation returned an invalid status code
///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
///
/// Thrown when a required parameter is null
///
- Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Returns an server Administrator.
///
@@ -145,7 +148,7 @@ public partial interface IServerAzureADAdministratorsOperations
///
/// The name of the server.
///
- ///
+ ///
/// The required parameters for creating or updating an Active
/// Directory Administrator.
///
@@ -164,7 +167,7 @@ public partial interface IServerAzureADAdministratorsOperations
///
/// Thrown when a required parameter is null
///
- Task> BeginCreateOrUpdateAzureADAdministratorWithHttpMessagesAsync(string resourceGroupName, string serverName, ServerAzureADAdministrator parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, ServerAzureADAdministrator properties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Deletes an existing server Active Directory Administrator.
///
@@ -185,9 +188,12 @@ public partial interface IServerAzureADAdministratorsOperations
///
/// Thrown when the operation returned an invalid status code
///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
///
/// Thrown when a required parameter is null
///
- Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
}
}
diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/IServerKeysOperations.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/IServerKeysOperations.cs
new file mode 100644
index 000000000000..4aca0f7c791e
--- /dev/null
+++ b/src/SDKs/SqlManagement/Management.Sql/Generated/IServerKeysOperations.cs
@@ -0,0 +1,236 @@
+// 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 1.0.1.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+namespace Microsoft.Azure.Management.Sql
+{
+ using Microsoft.Azure;
+ using Microsoft.Azure.Management;
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// ServerKeysOperations operations.
+ ///
+ public partial interface IServerKeysOperations
+ {
+ ///
+ /// Returns a list of server keys.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can
+ /// obtain this value from the Azure Resource Manager API or the
+ /// portal.
+ ///
+ ///
+ /// The name of the server.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Returns a server key.
+ ///
+ ///
+ /// The name of the 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 server key to be retrieved.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string keyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Creates or updates a server key.
+ ///
+ ///
+ /// The name of the 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 server key to be operated on (updated or created).
+ /// The key name is required to be in the format of
+ /// 'vault_key_version'. For example, if the keyId is
+ /// https://YourVaultName.vault.azure.net/keys/YourKeyName/01234567890123456789012345678901,
+ /// then the server key name should be formatted as:
+ /// YourVaultName_YourKeyName_01234567890123456789012345678901
+ ///
+ ///
+ /// The requested server key resource state.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string keyName, ServerKey parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Deletes the server key with the given name.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can
+ /// obtain this value from the Azure Resource Manager API or the
+ /// portal.
+ ///
+ ///
+ /// The name of the server.
+ ///
+ ///
+ /// The name of the server key to be deleted.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string keyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Creates or updates a server key.
+ ///
+ ///
+ /// The name of the 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 server key to be operated on (updated or created).
+ /// The key name is required to be in the format of
+ /// 'vault_key_version'. For example, if the keyId is
+ /// https://YourVaultName.vault.azure.net/keys/YourKeyName/01234567890123456789012345678901,
+ /// then the server key name should be formatted as:
+ /// YourVaultName_YourKeyName_01234567890123456789012345678901
+ ///
+ ///
+ /// The requested server key resource state.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string keyName, ServerKey parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Deletes the server key with the given name.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can
+ /// obtain this value from the Azure Resource Manager API or the
+ /// portal.
+ ///
+ ///
+ /// The name of the server.
+ ///
+ ///
+ /// The name of the server key to be deleted.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string keyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Returns a list of server keys.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListByServerNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ }
+}
diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/IServersOperations.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/IServersOperations.cs
index 0fd9073a8ae5..ab962aa48c7b 100644
--- a/src/SDKs/SqlManagement/Management.Sql/Generated/IServersOperations.cs
+++ b/src/SDKs/SqlManagement/Management.Sql/Generated/IServersOperations.cs
@@ -23,6 +23,113 @@ namespace Microsoft.Azure.Management.Sql
///
public partial interface IServersOperations
{
+ ///
+ /// Determines whether a resource can be created with the specified
+ /// name.
+ ///
+ ///
+ /// The parameters to request for name availability.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> CheckNameAvailabilityWithHttpMessagesAsync(CheckNameAvailabilityRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Gets a database service objective.
+ ///
+ ///
+ /// The name of the 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 service objective to retrieve.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> GetServiceObjectiveWithHttpMessagesAsync(string resourceGroupName, string serverName, string serviceObjectiveName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Returns database service objectives.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can
+ /// obtain this value from the Azure Resource Manager API or the
+ /// portal.
+ ///
+ ///
+ /// The name of the server.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListServiceObjectivesWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Returns server usages.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can
+ /// obtain this value from the Azure Resource Manager API or the
+ /// portal.
+ ///
+ ///
+ /// The name of the server.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListUsagesWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Returns a list of servers.
///
@@ -41,9 +148,60 @@ public partial interface IServersOperations
///
/// Thrown when a required parameter is null
///
- Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
- /// Creates or updates a new server.
+ /// Gets a list of servers in a resource groups.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can
+ /// obtain this value from the Azure Resource Manager API or the
+ /// portal.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Gets a server.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can
+ /// obtain this value from the Azure Resource Manager API or the
+ /// portal.
+ ///
+ ///
+ /// The name of the server.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Creates or updates a server.
///
///
/// The name of the resource group that contains the resource. You can
@@ -54,7 +212,7 @@ public partial interface IServersOperations
/// The name of the server.
///
///
- /// The required parameters for creating or updating a server.
+ /// The requested server resource state.
///
///
/// The headers that will be added to request.
@@ -73,7 +231,7 @@ public partial interface IServersOperations
///
Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, Server parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
- /// Deletes a SQL server.
+ /// Deletes a server.
///
///
/// The name of the resource group that contains the resource. You can
@@ -97,7 +255,7 @@ public partial interface IServersOperations
///
Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
- /// Gets a server.
+ /// Updates a server.
///
///
/// The name of the resource group that contains the resource. You can
@@ -107,6 +265,9 @@ public partial interface IServersOperations
///
/// The name of the server.
///
+ ///
+ /// The requested server resource state.
+ ///
///
/// The headers that will be added to request.
///
@@ -122,15 +283,18 @@ public partial interface IServersOperations
///
/// Thrown when a required parameter is null
///
- Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, Server parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
- /// Returns a list of servers in a resource group.
+ /// Returns a list of the server encryption protectors
///
///
/// The name of the resource group that contains the resource. You can
/// obtain this value from the Azure Resource Manager API or the
/// portal.
///
+ ///
+ /// The name of the server.
+ ///
///
/// The headers that will be added to request.
///
@@ -146,9 +310,9 @@ public partial interface IServersOperations
///
/// Thrown when a required parameter is null
///
- Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> ListEncryptionProtectorsWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
- /// Returns server usages.
+ /// Returns the server encryption protector.
///
///
/// The name of the resource group that contains the resource. You can
@@ -173,9 +337,9 @@ public partial interface IServersOperations
///
/// Thrown when a required parameter is null
///
- Task>> ListUsagesWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> GetEncryptionProtectorWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
- /// Gets a database service objective.
+ /// Updates an existing encryption protector.
///
///
/// The name of the resource group that contains the resource. You can
@@ -185,8 +349,8 @@ public partial interface IServersOperations
///
/// The name of the server.
///
- ///
- /// The name of the service objective to retrieve.
+ ///
+ /// The requested encryption protector resource state.
///
///
/// The headers that will be added to request.
@@ -203,9 +367,9 @@ public partial interface IServersOperations
///
/// Thrown when a required parameter is null
///
- Task> GetServiceObjectiveWithHttpMessagesAsync(string resourceGroupName, string serverName, string serviceObjectiveName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> CreateOrUpdateEncryptionProtectorWithHttpMessagesAsync(string resourceGroupName, string serverName, EncryptionProtector parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
- /// Returns database service objectives.
+ /// Creates or updates a server.
///
///
/// The name of the resource group that contains the resource. You can
@@ -215,6 +379,9 @@ public partial interface IServersOperations
///
/// The name of the server.
///
+ ///
+ /// The requested server resource state.
+ ///
///
/// The headers that will be added to request.
///
@@ -230,6 +397,156 @@ public partial interface IServersOperations
///
/// Thrown when a required parameter is null
///
- Task>> ListServiceObjectivesWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, Server parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Deletes a server.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can
+ /// obtain this value from the Azure Resource Manager API or the
+ /// portal.
+ ///
+ ///
+ /// The name of the server.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Updates a server.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can
+ /// obtain this value from the Azure Resource Manager API or the
+ /// portal.
+ ///
+ ///
+ /// The name of the server.
+ ///
+ ///
+ /// The requested server resource state.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, Server parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Updates an existing encryption protector.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can
+ /// obtain this value from the Azure Resource Manager API or the
+ /// portal.
+ ///
+ ///
+ /// The name of the server.
+ ///
+ ///
+ /// The requested encryption protector resource state.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> BeginCreateOrUpdateEncryptionProtectorWithHttpMessagesAsync(string resourceGroupName, string serverName, EncryptionProtector parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Returns a list of servers.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Gets a list of servers in a resource groups.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Returns a list of the server encryption protectors
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListEncryptionProtectorsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
}
}
diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/ISqlManagementClient.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/ISqlManagementClient.cs
index a5e00fbca203..b06026f03ac7 100644
--- a/src/SDKs/SqlManagement/Management.Sql/Generated/ISqlManagementClient.cs
+++ b/src/SDKs/SqlManagement/Management.Sql/Generated/ISqlManagementClient.cs
@@ -81,6 +81,11 @@ public partial interface ISqlManagementClient : System.IDisposable
///
IFirewallRulesOperations FirewallRules { get; }
+ ///
+ /// Gets the IElasticPoolsOperations.
+ ///
+ IElasticPoolsOperations ElasticPools { get; }
+
///
/// Gets the IOperations.
///
@@ -91,11 +96,6 @@ public partial interface ISqlManagementClient : System.IDisposable
///
IServersOperations Servers { get; }
- ///
- /// Gets the IElasticPoolsOperations.
- ///
- IElasticPoolsOperations ElasticPools { get; }
-
///
/// Gets the IRecommendedElasticPoolsOperations.
///
@@ -111,5 +111,10 @@ public partial interface ISqlManagementClient : System.IDisposable
///
IFailoverGroupsOperations FailoverGroups { get; }
+ ///
+ /// Gets the IServerKeysOperations.
+ ///
+ IServerKeysOperations ServerKeys { get; }
+
}
}
diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/ServerState.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/CheckNameAvailabilityReason.cs
similarity index 75%
rename from src/SDKs/SqlManagement/Management.Sql/Generated/Models/ServerState.cs
rename to src/SDKs/SqlManagement/Management.Sql/Generated/Models/CheckNameAvailabilityReason.cs
index db7bcb0552b3..24a751bf3cfe 100644
--- a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/ServerState.cs
+++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/CheckNameAvailabilityReason.cs
@@ -17,14 +17,14 @@ namespace Microsoft.Azure.Management.Sql.Models
using System.Runtime.Serialization;
///
- /// Defines values for ServerState.
+ /// Defines values for CheckNameAvailabilityReason.
///
[JsonConverter(typeof(StringEnumConverter))]
- public enum ServerState
+ public enum CheckNameAvailabilityReason
{
- [EnumMember(Value = "Ready")]
- Ready,
- [EnumMember(Value = "Disabled")]
- Disabled
+ [EnumMember(Value = "Invalid")]
+ Invalid,
+ [EnumMember(Value = "AlreadyExists")]
+ AlreadyExists
}
}
diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/CheckNameAvailabilityRequest.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/CheckNameAvailabilityRequest.cs
new file mode 100644
index 000000000000..6168ca506fa1
--- /dev/null
+++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/CheckNameAvailabilityRequest.cs
@@ -0,0 +1,84 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+namespace Microsoft.Azure.Management.Sql.Models
+{
+ using Microsoft.Azure;
+ using Microsoft.Azure.Management;
+ using Microsoft.Azure.Management.Sql;
+ using Microsoft.Rest;
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// A request to check whether the specified name for a resource is
+ /// available.
+ ///
+ public partial class CheckNameAvailabilityRequest
+ {
+ ///
+ /// Initializes a new instance of the CheckNameAvailabilityRequest
+ /// class.
+ ///
+ public CheckNameAvailabilityRequest()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the CheckNameAvailabilityRequest
+ /// class.
+ ///
+ /// The name whose availability is to be
+ /// checked.
+ public CheckNameAvailabilityRequest(string name)
+ {
+ Name = name;
+ CustomInit();
+ }
+ ///
+ /// Static constructor for CheckNameAvailabilityRequest class.
+ ///
+ static CheckNameAvailabilityRequest()
+ {
+ Type = "Microsoft.Sql/servers";
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets the name whose availability is to be checked.
+ ///
+ [JsonProperty(PropertyName = "name")]
+ public string Name { get; set; }
+
+ ///
+ /// The type of resource that is used as the scope of the availability
+ /// check.
+ ///
+ [JsonProperty(PropertyName = "type")]
+ public static string Type { get; private set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (Name == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "Name");
+ }
+ }
+ }
+}
diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/CheckNameAvailabilityResponse.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/CheckNameAvailabilityResponse.cs
new file mode 100644
index 000000000000..746618dfbd23
--- /dev/null
+++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/CheckNameAvailabilityResponse.cs
@@ -0,0 +1,86 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+namespace Microsoft.Azure.Management.Sql.Models
+{
+ using Microsoft.Azure;
+ using Microsoft.Azure.Management;
+ using Microsoft.Azure.Management.Sql;
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// A response indicating whether the specified name for a resource is
+ /// available.
+ ///
+ public partial class CheckNameAvailabilityResponse
+ {
+ ///
+ /// Initializes a new instance of the CheckNameAvailabilityResponse
+ /// class.
+ ///
+ public CheckNameAvailabilityResponse()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the CheckNameAvailabilityResponse
+ /// class.
+ ///
+ /// True if the name is available, otherwise
+ /// false.
+ /// A message explaining why the name is
+ /// unavailable. Will be null if the name is available.
+ /// The name whose availability was checked.
+ /// The reason code explaining why the name is
+ /// unavailable. Will be null if the name is available. Possible values
+ /// include: 'Invalid', 'AlreadyExists'
+ public CheckNameAvailabilityResponse(bool? available = default(bool?), string message = default(string), string name = default(string), CheckNameAvailabilityReason? reason = default(CheckNameAvailabilityReason?))
+ {
+ Available = available;
+ Message = message;
+ Name = name;
+ Reason = reason;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets true if the name is available, otherwise false.
+ ///
+ [JsonProperty(PropertyName = "available")]
+ public bool? Available { get; private set; }
+
+ ///
+ /// Gets a message explaining why the name is unavailable. Will be null
+ /// if the name is available.
+ ///
+ [JsonProperty(PropertyName = "message")]
+ public string Message { get; private set; }
+
+ ///
+ /// Gets the name whose availability was checked.
+ ///
+ [JsonProperty(PropertyName = "name")]
+ public string Name { get; private set; }
+
+ ///
+ /// Gets the reason code explaining why the name is unavailable. Will
+ /// be null if the name is available. Possible values include:
+ /// 'Invalid', 'AlreadyExists'
+ ///
+ [JsonProperty(PropertyName = "reason")]
+ public CheckNameAvailabilityReason? Reason { get; private set; }
+
+ }
+}
diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/DatabaseBlobAuditingPolicy.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/DatabaseBlobAuditingPolicy.cs
index 11081c0dafe2..0a0c85b3a575 100644
--- a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/DatabaseBlobAuditingPolicy.cs
+++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/DatabaseBlobAuditingPolicy.cs
@@ -19,7 +19,7 @@ namespace Microsoft.Azure.Management.Sql.Models
using System.Linq;
///
- /// Contains information about a database Blob Auditing policy.
+ /// A database blob auditing policy.
///
[Rest.Serialization.JsonTransformation]
public partial class DatabaseBlobAuditingPolicy : ProxyResource
@@ -35,15 +35,13 @@ public DatabaseBlobAuditingPolicy()
///
/// Initializes a new instance of the DatabaseBlobAuditingPolicy class.
///
- /// Specifies the state of the policy. If state is
- /// Enabled, storageEndpoint and storageAccountAccessKey are required.
- /// Possible values include: 'Enabled', 'Disabled'
/// Resource ID.
/// Resource name.
/// Resource type.
- /// The geo-location where the resource
- /// lives
/// Resource kind.
+ /// Specifies the state of the policy. If state is
+ /// Enabled, storageEndpoint and storageAccountAccessKey are required.
+ /// Possible values include: 'Enabled', 'Disabled'
/// Specifies the blob storage endpoint
/// (e.g. https://MyAccount.blob.core.windows.net). If state is
/// Enabled, storageEndpoint is required.
@@ -59,10 +57,9 @@ public DatabaseBlobAuditingPolicy()
/// Specifies whether
/// storageAccountAccessKey value is the storage’s secondary
/// key.
- public DatabaseBlobAuditingPolicy(BlobAuditingPolicyState state, string id = default(string), string name = default(string), string type = default(string), string location = default(string), string kind = default(string), string storageEndpoint = default(string), string storageAccountAccessKey = default(string), int? retentionDays = default(int?), IList auditActionsAndGroups = default(IList), string storageAccountSubscriptionId = default(string), bool? isStorageSecondaryKeyInUse = default(bool?))
+ public DatabaseBlobAuditingPolicy(string id = default(string), string name = default(string), string type = default(string), string kind = default(string), BlobAuditingPolicyState? state = default(BlobAuditingPolicyState?), string storageEndpoint = default(string), string storageAccountAccessKey = default(string), int? retentionDays = default(int?), IList auditActionsAndGroups = default(IList), System.Guid? storageAccountSubscriptionId = default(System.Guid?), bool? isStorageSecondaryKeyInUse = default(bool?))
: base(id, name, type)
{
- Location = location;
Kind = kind;
State = state;
StorageEndpoint = storageEndpoint;
@@ -79,12 +76,6 @@ public DatabaseBlobAuditingPolicy()
///
partial void CustomInit();
- ///
- /// Gets or sets the geo-location where the resource lives
- ///
- [JsonProperty(PropertyName = "location")]
- public string Location { get; set; }
-
///
/// Gets resource kind.
///
@@ -97,7 +88,7 @@ public DatabaseBlobAuditingPolicy()
/// Possible values include: 'Enabled', 'Disabled'
///
[JsonProperty(PropertyName = "properties.state")]
- public BlobAuditingPolicyState State { get; set; }
+ public BlobAuditingPolicyState? State { get; set; }
///
/// Gets or sets specifies the blob storage endpoint (e.g.
@@ -131,7 +122,7 @@ public DatabaseBlobAuditingPolicy()
/// Gets or sets specifies the blob storage subscription Id.
///
[JsonProperty(PropertyName = "properties.storageAccountSubscriptionId")]
- public string StorageAccountSubscriptionId { get; set; }
+ public System.Guid? StorageAccountSubscriptionId { get; set; }
///
/// Gets or sets specifies whether storageAccountAccessKey value is the
@@ -140,14 +131,5 @@ public DatabaseBlobAuditingPolicy()
[JsonProperty(PropertyName = "properties.isStorageSecondaryKeyInUse")]
public bool? IsStorageSecondaryKeyInUse { get; set; }
- ///
- /// Validate the object.
- ///
- ///
- /// Thrown if validation fails
- ///
- public virtual void Validate()
- {
- }
}
}
diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/DatabaseMetric.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/DatabaseUsage.cs
similarity index 67%
rename from src/SDKs/SqlManagement/Management.Sql/Generated/Models/DatabaseMetric.cs
rename to src/SDKs/SqlManagement/Management.Sql/Generated/Models/DatabaseUsage.cs
index 261b7ca03351..f7193b92d12e 100644
--- a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/DatabaseMetric.cs
+++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/DatabaseUsage.cs
@@ -15,31 +15,32 @@ namespace Microsoft.Azure.Management.Sql.Models
using System.Linq;
///
- /// Represents database metrics.
+ /// The database usages.
///
- public partial class DatabaseMetric : SubResource
+ public partial class DatabaseUsage : SubResource
{
///
- /// Initializes a new instance of the DatabaseMetric class.
+ /// Initializes a new instance of the DatabaseUsage class.
///
- public DatabaseMetric()
+ public DatabaseUsage()
{
CustomInit();
}
///
- /// Initializes a new instance of the DatabaseMetric class.
+ /// Initializes a new instance of the DatabaseUsage class.
///
/// Resource name
/// The resource ID.
/// The name of the resource.
- /// The metric display name.
- /// The current value of the metric.
- /// The current limit of the metric.
- /// The units of the metric.
- /// The next reset time for the metric
- /// (ISO8601 format).
- public DatabaseMetric(string name = default(string), string id = default(string), string resourceName = default(string), string displayName = default(string), double? currentValue = default(double?), double? limit = default(double?), string unit = default(string), System.DateTime? nextResetTime = default(System.DateTime?))
+ /// The usage metric display name.
+ /// The current value of the usage
+ /// metric.
+ /// The current limit of the usage metric.
+ /// The units of the usage metric.
+ /// The next reset time for the usage
+ /// metric (ISO8601 format).
+ public DatabaseUsage(string name = default(string), string id = default(string), string resourceName = default(string), string displayName = default(string), double? currentValue = default(double?), double? limit = default(double?), string unit = default(string), System.DateTime? nextResetTime = default(System.DateTime?))
: base(name, id)
{
ResourceName = resourceName;
@@ -63,31 +64,31 @@ public DatabaseMetric()
public string ResourceName { get; private set; }
///
- /// Gets the metric display name.
+ /// Gets the usage metric display name.
///
[JsonProperty(PropertyName = "displayName")]
public string DisplayName { get; private set; }
///
- /// Gets the current value of the metric.
+ /// Gets the current value of the usage metric.
///
[JsonProperty(PropertyName = "currentValue")]
public double? CurrentValue { get; private set; }
///
- /// Gets the current limit of the metric.
+ /// Gets the current limit of the usage metric.
///
[JsonProperty(PropertyName = "limit")]
public double? Limit { get; private set; }
///
- /// Gets the units of the metric.
+ /// Gets the units of the usage metric.
///
[JsonProperty(PropertyName = "unit")]
public string Unit { get; private set; }
///
- /// Gets the next reset time for the metric (ISO8601 format).
+ /// Gets the next reset time for the usage metric (ISO8601 format).
///
[JsonProperty(PropertyName = "nextResetTime")]
public System.DateTime? NextResetTime { get; private set; }
diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/EncryptionProtector.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/EncryptionProtector.cs
new file mode 100644
index 000000000000..c93853438094
--- /dev/null
+++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/EncryptionProtector.cs
@@ -0,0 +1,116 @@
+// 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 1.0.1.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+namespace Microsoft.Azure.Management.Sql.Models
+{
+ using Microsoft.Azure;
+ using Microsoft.Azure.Management;
+ using Microsoft.Azure.Management.Sql;
+ using Microsoft.Rest;
+ using Microsoft.Rest.Serialization;
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// The server encryption protector.
+ ///
+ [Rest.Serialization.JsonTransformation]
+ public partial class EncryptionProtector : ProxyResource
+ {
+ ///
+ /// Initializes a new instance of the EncryptionProtector class.
+ ///
+ public EncryptionProtector()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the EncryptionProtector class.
+ ///
+ /// Resource ID.
+ /// Resource name.
+ /// Resource type.
+ /// Kind of encryption protector. This is metadata
+ /// used for the Azure portal experience. Possible values include: '',
+ /// 'azurekeyvault', 'servicemanaged'
+ /// Resource location.
+ /// Subregion of the encryption
+ /// protector.
+ /// The name of the server key.
+ /// The encryption protector type like
+ /// 'ServiceManaged', 'AzureKeyVault'. Possible values include:
+ /// 'ServiceManaged', 'AzureKeyVault'
+ /// The URI of the server key.
+ /// Thumbprint of the server key.
+ public EncryptionProtector(string id = default(string), string name = default(string), string type = default(string), string kind = default(string), string location = default(string), string subregion = default(string), string serverKeyName = default(string), string serverKeyType = default(string), string uri = default(string), string thumbprint = default(string))
+ : base(id, name, type)
+ {
+ Kind = kind;
+ Location = location;
+ Subregion = subregion;
+ ServerKeyName = serverKeyName;
+ ServerKeyType = serverKeyType;
+ Uri = uri;
+ Thumbprint = thumbprint;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets kind of encryption protector. This is metadata used
+ /// for the Azure portal experience. Possible values include: '',
+ /// 'azurekeyvault', 'servicemanaged'
+ ///
+ [JsonProperty(PropertyName = "kind")]
+ public string Kind { get; set; }
+
+ ///
+ /// Gets resource location.
+ ///
+ [JsonProperty(PropertyName = "location")]
+ public string Location { get; private set; }
+
+ ///
+ /// Gets subregion of the encryption protector.
+ ///
+ [JsonProperty(PropertyName = "properties.subregion")]
+ public string Subregion { get; private set; }
+
+ ///
+ /// Gets or sets the name of the server key.
+ ///
+ [JsonProperty(PropertyName = "properties.serverKeyName")]
+ public string ServerKeyName { get; set; }
+
+ ///
+ /// Gets or sets the encryption protector type like 'ServiceManaged',
+ /// 'AzureKeyVault'. Possible values include: 'ServiceManaged',
+ /// 'AzureKeyVault'
+ ///
+ [JsonProperty(PropertyName = "properties.serverKeyType")]
+ public string ServerKeyType { get; set; }
+
+ ///
+ /// Gets the URI of the server key.
+ ///
+ [JsonProperty(PropertyName = "properties.uri")]
+ public string Uri { get; private set; }
+
+ ///
+ /// Gets thumbprint of the server key.
+ ///
+ [JsonProperty(PropertyName = "properties.thumbprint")]
+ public string Thumbprint { get; private set; }
+
+ }
+}
diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/ServerVersion.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/IdentityType.cs
similarity index 73%
rename from src/SDKs/SqlManagement/Management.Sql/Generated/Models/ServerVersion.cs
rename to src/SDKs/SqlManagement/Management.Sql/Generated/Models/IdentityType.cs
index 4f9f632f75ba..2d2a6a04af1a 100644
--- a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/ServerVersion.cs
+++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/IdentityType.cs
@@ -13,11 +13,10 @@ namespace Microsoft.Azure.Management.Sql.Models
using Microsoft.Azure.Management.Sql;
///
- /// Defines values for ServerVersion.
+ /// Defines values for IdentityType.
///
- public static class ServerVersion
+ public static class IdentityType
{
- public const string TwoFullStopZero = "2.0";
- public const string OneTwoFullStopZero = "12.0";
+ public const string SystemAssigned = "SystemAssigned";
}
}
diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/Metric.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/Metric.cs
new file mode 100644
index 000000000000..58d535b78841
--- /dev/null
+++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/Metric.cs
@@ -0,0 +1,101 @@
+// 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 1.0.1.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+namespace Microsoft.Azure.Management.Sql.Models
+{
+ using Microsoft.Azure;
+ using Microsoft.Azure.Management;
+ using Microsoft.Azure.Management.Sql;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// Database metrics.
+ ///
+ public partial class Metric
+ {
+ ///
+ /// Initializes a new instance of the Metric class.
+ ///
+ public Metric()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the Metric class.
+ ///
+ /// The start time for the metric (ISO-8601
+ /// format).
+ /// The end time for the metric (ISO-8601
+ /// format).
+ /// The time step to be used to summarize the
+ /// metric values.
+ /// The unit of the metric. Possible values include:
+ /// 'count', 'bytes', 'seconds', 'percent', 'countPerSecond',
+ /// 'bytesPerSecond'
+ /// The name information for the metric.
+ /// The metric values for the specified time
+ /// window and timestep.
+ public Metric(System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), string timeGrain = default(string), string unit = default(string), MetricName name = default(MetricName), IList metricValues = default(IList))
+ {
+ StartTime = startTime;
+ EndTime = endTime;
+ TimeGrain = timeGrain;
+ Unit = unit;
+ Name = name;
+ MetricValues = metricValues;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets the start time for the metric (ISO-8601 format).
+ ///
+ [JsonProperty(PropertyName = "startTime")]
+ public System.DateTime? StartTime { get; private set; }
+
+ ///
+ /// Gets the end time for the metric (ISO-8601 format).
+ ///
+ [JsonProperty(PropertyName = "endTime")]
+ public System.DateTime? EndTime { get; private set; }
+
+ ///
+ /// Gets the time step to be used to summarize the metric values.
+ ///
+ [JsonProperty(PropertyName = "timeGrain")]
+ public string TimeGrain { get; private set; }
+
+ ///
+ /// Gets the unit of the metric. Possible values include: 'count',
+ /// 'bytes', 'seconds', 'percent', 'countPerSecond', 'bytesPerSecond'
+ ///
+ [JsonProperty(PropertyName = "unit")]
+ public string Unit { get; private set; }
+
+ ///
+ /// Gets the name information for the metric.
+ ///
+ [JsonProperty(PropertyName = "name")]
+ public MetricName Name { get; private set; }
+
+ ///
+ /// Gets the metric values for the specified time window and timestep.
+ ///
+ [JsonProperty(PropertyName = "metricValues")]
+ public IList MetricValues { get; private set; }
+
+ }
+}
diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/MetricAvailability.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/MetricAvailability.cs
new file mode 100644
index 000000000000..c0023f860d1e
--- /dev/null
+++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/MetricAvailability.cs
@@ -0,0 +1,62 @@
+// 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 1.0.1.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+namespace Microsoft.Azure.Management.Sql.Models
+{
+ using Microsoft.Azure;
+ using Microsoft.Azure.Management;
+ using Microsoft.Azure.Management.Sql;
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// A metric availability value.
+ ///
+ public partial class MetricAvailability
+ {
+ ///
+ /// Initializes a new instance of the MetricAvailability class.
+ ///
+ public MetricAvailability()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the MetricAvailability class.
+ ///
+ /// The length of retention for the database
+ /// metric.
+ /// The granularity of the database
+ /// metric.
+ public MetricAvailability(string retention = default(string), string timeGrain = default(string))
+ {
+ Retention = retention;
+ TimeGrain = timeGrain;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets the length of retention for the database metric.
+ ///
+ [JsonProperty(PropertyName = "retention")]
+ public string Retention { get; private set; }
+
+ ///
+ /// Gets the granularity of the database metric.
+ ///
+ [JsonProperty(PropertyName = "timeGrain")]
+ public string TimeGrain { get; private set; }
+
+ }
+}
diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/MetricDefinition.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/MetricDefinition.cs
new file mode 100644
index 000000000000..d96587a1b26a
--- /dev/null
+++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/MetricDefinition.cs
@@ -0,0 +1,94 @@
+// 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 1.0.1.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+namespace Microsoft.Azure.Management.Sql.Models
+{
+ using Microsoft.Azure;
+ using Microsoft.Azure.Management;
+ using Microsoft.Azure.Management.Sql;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// A database metric definition.
+ ///
+ public partial class MetricDefinition
+ {
+ ///
+ /// Initializes a new instance of the MetricDefinition class.
+ ///
+ public MetricDefinition()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the MetricDefinition class.
+ ///
+ /// The name information for the metric.
+ /// The primary aggregation type
+ /// defining how metric values are displayed. Possible values include:
+ /// 'None', 'Average', 'Count', 'Minimum', 'Maximum', 'Total'
+ /// The resource uri of the database.
+ /// The unit of the metric. Possible values include:
+ /// 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond',
+ /// 'BytesPerSecond'
+ /// The list of database metric
+ /// availabities for the metric.
+ public MetricDefinition(MetricName name = default(MetricName), string primaryAggregationType = default(string), string resourceUri = default(string), string unit = default(string), IList metricAvailabilities = default(IList))
+ {
+ Name = name;
+ PrimaryAggregationType = primaryAggregationType;
+ ResourceUri = resourceUri;
+ Unit = unit;
+ MetricAvailabilities = metricAvailabilities;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets the name information for the metric.
+ ///
+ [JsonProperty(PropertyName = "name")]
+ public MetricName Name { get; private set; }
+
+ ///
+ /// Gets the primary aggregation type defining how metric values are
+ /// displayed. Possible values include: 'None', 'Average', 'Count',
+ /// 'Minimum', 'Maximum', 'Total'
+ ///
+ [JsonProperty(PropertyName = "primaryAggregationType")]
+ public string PrimaryAggregationType { get; private set; }
+
+ ///
+ /// Gets the resource uri of the database.
+ ///
+ [JsonProperty(PropertyName = "resourceUri")]
+ public string ResourceUri { get; private set; }
+
+ ///
+ /// Gets the unit of the metric. Possible values include: 'Count',
+ /// 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond'
+ ///
+ [JsonProperty(PropertyName = "unit")]
+ public string Unit { get; private set; }
+
+ ///
+ /// Gets the list of database metric availabities for the metric.
+ ///
+ [JsonProperty(PropertyName = "metricAvailabilities")]
+ public IList MetricAvailabilities { get; private set; }
+
+ }
+}
diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/MetricName.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/MetricName.cs
new file mode 100644
index 000000000000..6eb9367a7061
--- /dev/null
+++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/MetricName.cs
@@ -0,0 +1,61 @@
+// 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 1.0.1.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+namespace Microsoft.Azure.Management.Sql.Models
+{
+ using Microsoft.Azure;
+ using Microsoft.Azure.Management;
+ using Microsoft.Azure.Management.Sql;
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// A database metric name.
+ ///
+ public partial class MetricName
+ {
+ ///
+ /// Initializes a new instance of the MetricName class.
+ ///
+ public MetricName()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the MetricName class.
+ ///
+ /// The name of the database metric.
+ /// The friendly name of the database
+ /// metric.
+ public MetricName(string value = default(string), string localizedValue = default(string))
+ {
+ Value = value;
+ LocalizedValue = localizedValue;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets the name of the database metric.
+ ///
+ [JsonProperty(PropertyName = "value")]
+ public string Value { get; private set; }
+
+ ///
+ /// Gets the friendly name of the database metric.
+ ///
+ [JsonProperty(PropertyName = "localizedValue")]
+ public string LocalizedValue { get; private set; }
+
+ }
+}
diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/MetricValue.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/MetricValue.cs
new file mode 100644
index 000000000000..1e005ca88268
--- /dev/null
+++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/MetricValue.cs
@@ -0,0 +1,96 @@
+// 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 1.0.1.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+namespace Microsoft.Azure.Management.Sql.Models
+{
+ using Microsoft.Azure;
+ using Microsoft.Azure.Management;
+ using Microsoft.Azure.Management.Sql;
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// Represents database metrics.
+ ///
+ public partial class MetricValue : SubResource
+ {
+ ///
+ /// Initializes a new instance of the MetricValue class.
+ ///
+ public MetricValue()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the MetricValue class.
+ ///
+ /// Resource name
+ /// The resource ID.
+ /// The number of values for the metric.
+ /// The average value of the metric.
+ /// The max value of the metric.
+ /// The min value of the metric.
+ /// The metric timestamp (ISO-8601
+ /// format).
+ /// The total value of the metric.
+ public MetricValue(string name = default(string), string id = default(string), double? count = default(double?), double? average = default(double?), double? maximum = default(double?), double? minimum = default(double?), System.DateTime? timestamp = default(System.DateTime?), double? total = default(double?))
+ : base(name, id)
+ {
+ Count = count;
+ Average = average;
+ Maximum = maximum;
+ Minimum = minimum;
+ Timestamp = timestamp;
+ Total = total;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets the number of values for the metric.
+ ///
+ [JsonProperty(PropertyName = "count")]
+ public double? Count { get; private set; }
+
+ ///
+ /// Gets the average value of the metric.
+ ///
+ [JsonProperty(PropertyName = "average")]
+ public double? Average { get; private set; }
+
+ ///
+ /// Gets the max value of the metric.
+ ///
+ [JsonProperty(PropertyName = "maximum")]
+ public double? Maximum { get; private set; }
+
+ ///
+ /// Gets the min value of the metric.
+ ///
+ [JsonProperty(PropertyName = "minimum")]
+ public double? Minimum { get; private set; }
+
+ ///
+ /// Gets the metric timestamp (ISO-8601 format).
+ ///
+ [JsonProperty(PropertyName = "timestamp")]
+ public System.DateTime? Timestamp { get; private set; }
+
+ ///
+ /// Gets the total value of the metric.
+ ///
+ [JsonProperty(PropertyName = "total")]
+ public double? Total { get; private set; }
+
+ }
+}
diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/OperationImpact.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/OperationImpact.cs
index b4357304e49f..d98533d358c9 100644
--- a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/OperationImpact.cs
+++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/OperationImpact.cs
@@ -15,7 +15,7 @@ namespace Microsoft.Azure.Management.Sql.Models
using System.Linq;
///
- /// Represents impact of an operation, both in absolute and relative terms.
+ /// The impact of an operation, both in absolute and relative terms.
///
public partial class OperationImpact
{
diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/PrimaryAggregationType.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/PrimaryAggregationType.cs
new file mode 100644
index 000000000000..a0f66cc64e64
--- /dev/null
+++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/PrimaryAggregationType.cs
@@ -0,0 +1,27 @@
+// 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 1.0.1.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+namespace Microsoft.Azure.Management.Sql.Models
+{
+ using Microsoft.Azure;
+ using Microsoft.Azure.Management;
+ using Microsoft.Azure.Management.Sql;
+
+ ///
+ /// Defines values for PrimaryAggregationType.
+ ///
+ public static class PrimaryAggregationType
+ {
+ public const string None = "None";
+ public const string Average = "Average";
+ public const string Count = "Count";
+ public const string Minimum = "Minimum";
+ public const string Maximum = "Maximum";
+ public const string Total = "Total";
+ }
+}
diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/ResourceIdentity.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/ResourceIdentity.cs
new file mode 100644
index 000000000000..43dbef04e07e
--- /dev/null
+++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/ResourceIdentity.cs
@@ -0,0 +1,76 @@
+// 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 1.0.1.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+namespace Microsoft.Azure.Management.Sql.Models
+{
+ using Microsoft.Azure;
+ using Microsoft.Azure.Management;
+ using Microsoft.Azure.Management.Sql;
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// Azure Active Directory identity configuration for a resource.
+ ///
+ public partial class ResourceIdentity
+ {
+ ///
+ /// Initializes a new instance of the ResourceIdentity class.
+ ///
+ public ResourceIdentity()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the ResourceIdentity class.
+ ///
+ /// The Azure Active Directory principal
+ /// id.
+ /// The identity type. Set this to 'SystemAssigned'
+ /// in order to automatically create and assign an Azure Active
+ /// Directory principal for the resource. Possible values include:
+ /// 'SystemAssigned'
+ /// The Azure Active Directory tenant
+ /// id.
+ public ResourceIdentity(System.Guid? principalId = default(System.Guid?), string type = default(string), System.Guid? tenantId = default(System.Guid?))
+ {
+ PrincipalId = principalId;
+ Type = type;
+ TenantId = tenantId;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets the Azure Active Directory principal id.
+ ///
+ [JsonProperty(PropertyName = "principalId")]
+ public System.Guid? PrincipalId { get; private set; }
+
+ ///
+ /// Gets or sets the identity type. Set this to 'SystemAssigned' in
+ /// order to automatically create and assign an Azure Active Directory
+ /// principal for the resource. Possible values include:
+ /// 'SystemAssigned'
+ ///
+ [JsonProperty(PropertyName = "type")]
+ public string Type { get; set; }
+
+ ///
+ /// Gets the Azure Active Directory tenant id.
+ ///
+ [JsonProperty(PropertyName = "tenantId")]
+ public System.Guid? TenantId { get; private set; }
+
+ }
+}
diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/Server.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/Server.cs
index 3223eeb4daf0..9644f3fc3e21 100644
--- a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/Server.cs
+++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/Server.cs
@@ -19,7 +19,7 @@ namespace Microsoft.Azure.Management.Sql.Models
using System.Linq;
///
- /// Represents a server.
+ /// An Azure SQL Database server.
///
[Rest.Serialization.JsonTransformation]
public partial class Server : TrackedResource
@@ -40,39 +40,29 @@ public Server()
/// Resource name.
/// Resource type.
/// Resource tags.
- /// Kind of sql server. This is metadata used for
- /// the Azure portal experience.
- /// The fully qualified domain
- /// name of the server.
- /// The version of the server. Possible values
- /// include: '2.0', '12.0'
+ /// The Azure Active Directory identity of the
+ /// server.
+ /// Kind of sql server. This is metadata used for
+ /// the Azure portal experience. Possible values include: '', 'v2.0',
+ /// 'v12.0', 'user', 'system', 'datawarehouse'
/// Administrator username for the
- /// server. Can only be specified when the server is being created (and
- /// is required for creation).
+ /// server. Once created it cannot be changed.
/// The administrator login
/// password (required for server creation).
- /// The ID of the Active Azure
- /// Directory object with admin permissions on this server. Legacy
- /// parameter, always null. To check for Active Directory admin, query
- /// .../servers/{serverName}/administrators.
- /// The display name of the
- /// Azure Active Directory object with admin permissions on this
- /// server. Legacy parameter, always null. To check for Active
- /// Directory admin, query
- /// .../servers/{serverName}/administrators
- /// The state of the server. Possible values
- /// include: 'Ready', 'Disabled'
- public Server(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string kind = default(string), string fullyQualifiedDomainName = default(string), string version = default(string), string administratorLogin = default(string), string administratorLoginPassword = default(string), System.Guid? externalAdministratorSid = default(System.Guid?), string externalAdministratorLogin = default(string), ServerState? state = default(ServerState?))
+ /// The version of the server.
+ /// The state of the server.
+ /// The fully qualified domain
+ /// name of the server.
+ public Server(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), ResourceIdentity identity = default(ResourceIdentity), string kind = default(string), string administratorLogin = default(string), string administratorLoginPassword = default(string), string version = default(string), string state = default(string), string fullyQualifiedDomainName = default(string))
: base(location, id, name, type, tags)
{
+ Identity = identity;
Kind = kind;
- FullyQualifiedDomainName = fullyQualifiedDomainName;
- Version = version;
AdministratorLogin = administratorLogin;
AdministratorLoginPassword = administratorLoginPassword;
- ExternalAdministratorSid = externalAdministratorSid;
- ExternalAdministratorLogin = externalAdministratorLogin;
+ Version = version;
State = state;
+ FullyQualifiedDomainName = fullyQualifiedDomainName;
CustomInit();
}
@@ -82,29 +72,22 @@ public Server()
partial void CustomInit();
///
- /// Gets kind of sql server. This is metadata used for the Azure
- /// portal experience.
- ///
- [JsonProperty(PropertyName = "kind")]
- public string Kind { get; private set; }
-
- ///
- /// Gets the fully qualified domain name of the server.
+ /// Gets or sets the Azure Active Directory identity of the server.
///
- [JsonProperty(PropertyName = "properties.fullyQualifiedDomainName")]
- public string FullyQualifiedDomainName { get; private set; }
+ [JsonProperty(PropertyName = "identity")]
+ public ResourceIdentity Identity { get; set; }
///
- /// Gets or sets the version of the server. Possible values include:
- /// '2.0', '12.0'
+ /// Gets kind of sql server. This is metadata used for the Azure portal
+ /// experience. Possible values include: '', 'v2.0', 'v12.0', 'user',
+ /// 'system', 'datawarehouse'
///
- [JsonProperty(PropertyName = "properties.version")]
- public string Version { get; set; }
+ [JsonProperty(PropertyName = "kind")]
+ public string Kind { get; private set; }
///
- /// Gets or sets administrator username for the server. Can only be
- /// specified when the server is being created (and is required for
- /// creation).
+ /// Gets or sets administrator username for the server. Once created it
+ /// cannot be changed.
///
[JsonProperty(PropertyName = "properties.administratorLogin")]
public string AdministratorLogin { get; set; }
@@ -117,29 +100,22 @@ public Server()
public string AdministratorLoginPassword { get; set; }
///
- /// Gets the ID of the Active Azure Directory object with admin
- /// permissions on this server. Legacy parameter, always null. To check
- /// for Active Directory admin, query
- /// .../servers/{serverName}/administrators.
+ /// Gets or sets the version of the server.
///
- [JsonProperty(PropertyName = "properties.externalAdministratorSid")]
- public System.Guid? ExternalAdministratorSid { get; private set; }
+ [JsonProperty(PropertyName = "properties.version")]
+ public string Version { get; set; }
///
- /// Gets the display name of the Azure Active Directory object with
- /// admin permissions on this server. Legacy parameter, always null. To
- /// check for Active Directory admin, query
- /// .../servers/{serverName}/administrators
+ /// Gets the state of the server.
///
- [JsonProperty(PropertyName = "properties.externalAdministratorLogin")]
- public string ExternalAdministratorLogin { get; private set; }
+ [JsonProperty(PropertyName = "properties.state")]
+ public string State { get; private set; }
///
- /// Gets the state of the server. Possible values include: 'Ready',
- /// 'Disabled'
+ /// Gets the fully qualified domain name of the server.
///
- [JsonProperty(PropertyName = "properties.state")]
- public ServerState? State { get; private set; }
+ [JsonProperty(PropertyName = "properties.fullyQualifiedDomainName")]
+ public string FullyQualifiedDomainName { get; private set; }
///
/// Validate the object.
diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/ServerKey.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/ServerKey.cs
new file mode 100644
index 000000000000..23cb4aab778d
--- /dev/null
+++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/ServerKey.cs
@@ -0,0 +1,115 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+namespace Microsoft.Azure.Management.Sql.Models
+{
+ using Microsoft.Azure;
+ using Microsoft.Azure.Management;
+ using Microsoft.Azure.Management.Sql;
+ using Microsoft.Rest;
+ using Microsoft.Rest.Serialization;
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// A server key.
+ ///
+ [Rest.Serialization.JsonTransformation]
+ public partial class ServerKey : ProxyResource
+ {
+ ///
+ /// Initializes a new instance of the ServerKey class.
+ ///
+ public ServerKey()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the ServerKey class.
+ ///
+ /// Resource ID.
+ /// Resource name.
+ /// Resource type.
+ /// Kind of encryption protector. This is metadata
+ /// used for the Azure portal experience. Possible values include: '',
+ /// 'azurekeyvault', 'servicemanaged'
+ /// Resource location.
+ /// Subregion of the server key.
+ /// The server key type like
+ /// 'ServiceManaged', 'AzureKeyVault'. Possible values include:
+ /// 'ServiceManaged', 'AzureKeyVault'
+ /// The URI of the server key.
+ /// Thumbprint of the server key.
+ /// The server key creation date.
+ public ServerKey(string id = default(string), string name = default(string), string type = default(string), string kind = default(string), string location = default(string), string subregion = default(string), string serverKeyType = default(string), string uri = default(string), string thumbprint = default(string), System.DateTime? creationDate = default(System.DateTime?))
+ : base(id, name, type)
+ {
+ Kind = kind;
+ Location = location;
+ Subregion = subregion;
+ ServerKeyType = serverKeyType;
+ Uri = uri;
+ Thumbprint = thumbprint;
+ CreationDate = creationDate;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets kind of encryption protector. This is metadata used
+ /// for the Azure portal experience. Possible values include: '',
+ /// 'azurekeyvault', 'servicemanaged'
+ ///
+ [JsonProperty(PropertyName = "kind")]
+ public string Kind { get; set; }
+
+ ///
+ /// Gets resource location.
+ ///
+ [JsonProperty(PropertyName = "location")]
+ public string Location { get; private set; }
+
+ ///
+ /// Gets subregion of the server key.
+ ///
+ [JsonProperty(PropertyName = "properties.subregion")]
+ public string Subregion { get; private set; }
+
+ ///
+ /// Gets or sets the server key type like 'ServiceManaged',
+ /// 'AzureKeyVault'. Possible values include: 'ServiceManaged',
+ /// 'AzureKeyVault'
+ ///
+ [JsonProperty(PropertyName = "properties.serverKeyType")]
+ public string ServerKeyType { get; set; }
+
+ ///
+ /// Gets or sets the URI of the server key.
+ ///
+ [JsonProperty(PropertyName = "properties.uri")]
+ public string Uri { get; set; }
+
+ ///
+ /// Gets or sets thumbprint of the server key.
+ ///
+ [JsonProperty(PropertyName = "properties.thumbprint")]
+ public string Thumbprint { get; set; }
+
+ ///
+ /// Gets or sets the server key creation date.
+ ///
+ [JsonProperty(PropertyName = "properties.creationDate")]
+ public System.DateTime? CreationDate { get; set; }
+
+ }
+}
diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/ServerKeyType.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/ServerKeyType.cs
new file mode 100644
index 000000000000..80faa0bef166
--- /dev/null
+++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/ServerKeyType.cs
@@ -0,0 +1,23 @@
+// 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 1.0.1.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+namespace Microsoft.Azure.Management.Sql.Models
+{
+ using Microsoft.Azure;
+ using Microsoft.Azure.Management;
+ using Microsoft.Azure.Management.Sql;
+
+ ///
+ /// Defines values for ServerKeyType.
+ ///
+ public static class ServerKeyType
+ {
+ public const string ServiceManaged = "ServiceManaged";
+ public const string AzureKeyVault = "AzureKeyVault";
+ }
+}
diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/ServerMetric.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/ServerUsage.cs
similarity index 86%
rename from src/SDKs/SqlManagement/Management.Sql/Generated/Models/ServerMetric.cs
rename to src/SDKs/SqlManagement/Management.Sql/Generated/Models/ServerUsage.cs
index 165386b6bc0a..7b7da5a6a121 100644
--- a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/ServerMetric.cs
+++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/ServerUsage.cs
@@ -17,18 +17,18 @@ namespace Microsoft.Azure.Management.Sql.Models
///
/// Represents server metrics.
///
- public partial class ServerMetric
+ public partial class ServerUsage
{
///
- /// Initializes a new instance of the ServerMetric class.
+ /// Initializes a new instance of the ServerUsage class.
///
- public ServerMetric()
+ public ServerUsage()
{
CustomInit();
}
///
- /// Initializes a new instance of the ServerMetric class.
+ /// Initializes a new instance of the ServerUsage class.
///
/// Name of the server usage metric.
/// The name of the resource.
@@ -38,7 +38,7 @@ public ServerMetric()
/// The units of the metric.
/// The next reset time for the metric
/// (ISO8601 format).
- public ServerMetric(string name = default(string), string resourceName = default(string), string displayName = default(string), double? currentValue = default(double?), double? limit = default(double?), string unit = default(string), System.DateTime? nextResetTime = default(System.DateTime?))
+ public ServerUsage(string name = default(string), string resourceName = default(string), string displayName = default(string), double? currentValue = default(double?), double? limit = default(double?), string unit = default(string), System.DateTime? nextResetTime = default(System.DateTime?))
{
Name = name;
ResourceName = resourceName;
diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SloUsageMetric.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SloUsageMetric.cs
index 17e9665487b1..060df6a75eb2 100644
--- a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SloUsageMetric.cs
+++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SloUsageMetric.cs
@@ -15,7 +15,7 @@ namespace Microsoft.Azure.Management.Sql.Models
using System.Linq;
///
- /// Represents a Slo Usage Metric.
+ /// A Slo Usage Metric.
///
public partial class SloUsageMetric
{
diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/UnitDefinitionType.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/UnitDefinitionType.cs
new file mode 100644
index 000000000000..318a5286446d
--- /dev/null
+++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/UnitDefinitionType.cs
@@ -0,0 +1,27 @@
+// 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 1.0.1.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+namespace Microsoft.Azure.Management.Sql.Models
+{
+ using Microsoft.Azure;
+ using Microsoft.Azure.Management;
+ using Microsoft.Azure.Management.Sql;
+
+ ///
+ /// Defines values for UnitDefinitionType.
+ ///
+ public static class UnitDefinitionType
+ {
+ public const string Count = "Count";
+ public const string Bytes = "Bytes";
+ public const string Seconds = "Seconds";
+ public const string Percent = "Percent";
+ public const string CountPerSecond = "CountPerSecond";
+ public const string BytesPerSecond = "BytesPerSecond";
+ }
+}
diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/UnitType.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/UnitType.cs
new file mode 100644
index 000000000000..7bbe2c387d90
--- /dev/null
+++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/UnitType.cs
@@ -0,0 +1,27 @@
+// 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 1.0.1.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+namespace Microsoft.Azure.Management.Sql.Models
+{
+ using Microsoft.Azure;
+ using Microsoft.Azure.Management;
+ using Microsoft.Azure.Management.Sql;
+
+ ///
+ /// Defines values for UnitType.
+ ///
+ public static class UnitType
+ {
+ public const string Count = "count";
+ public const string Bytes = "bytes";
+ public const string Seconds = "seconds";
+ public const string Percent = "percent";
+ public const string CountPerSecond = "countPerSecond";
+ public const string BytesPerSecond = "bytesPerSecond";
+ }
+}
diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/ServerAzureADAdministratorsOperations.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/ServerAzureADAdministratorsOperations.cs
index 445402c8d723..abe8d849809e 100644
--- a/src/SDKs/SqlManagement/Management.Sql/Generated/ServerAzureADAdministratorsOperations.cs
+++ b/src/SDKs/SqlManagement/Management.Sql/Generated/ServerAzureADAdministratorsOperations.cs
@@ -61,7 +61,7 @@ internal ServerAzureADAdministratorsOperations(SqlManagementClient client)
///
/// The name of the server.
///
- ///
+ ///
/// The required parameters for creating or updating an Active Directory
/// Administrator.
///
@@ -71,10 +71,10 @@ internal ServerAzureADAdministratorsOperations(SqlManagementClient client)
///
/// The cancellation token.
///
- public async Task> CreateOrUpdateAzureADAdministratorWithHttpMessagesAsync(string resourceGroupName, string serverName, ServerAzureADAdministrator parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, ServerAzureADAdministrator properties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
// Send Request
- AzureOperationResponse _response = await BeginCreateOrUpdateAzureADAdministratorWithHttpMessagesAsync(resourceGroupName, serverName, parameters, customHeaders, cancellationToken).ConfigureAwait(false);
+ AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, properties, customHeaders, cancellationToken).ConfigureAwait(false);
return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
}
@@ -94,10 +94,10 @@ internal ServerAzureADAdministratorsOperations(SqlManagementClient client)
///
/// The cancellation token.
///
- public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
// Send request
- AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, serverName, customHeaders, cancellationToken).ConfigureAwait(false);
+ AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, serverName, customHeaders, cancellationToken).ConfigureAwait(false);
return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
}
@@ -502,7 +502,7 @@ internal ServerAzureADAdministratorsOperations(SqlManagementClient client)
///
/// The name of the server.
///
- ///
+ ///
/// The required parameters for creating or updating an Active Directory
/// Administrator.
///
@@ -527,7 +527,7 @@ internal ServerAzureADAdministratorsOperations(SqlManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> BeginCreateOrUpdateAzureADAdministratorWithHttpMessagesAsync(string resourceGroupName, string serverName, ServerAzureADAdministrator parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, ServerAzureADAdministrator properties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.SubscriptionId == null)
{
@@ -541,18 +541,18 @@ internal ServerAzureADAdministratorsOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "serverName");
}
- if (parameters == null)
+ if (properties == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "parameters");
+ throw new ValidationException(ValidationRules.CannotBeNull, "properties");
}
- if (parameters != null)
+ if (properties != null)
{
- parameters.Validate();
+ properties.Validate();
}
string apiVersion = "2014-04-01";
- if (parameters == null)
+ if (properties == null)
{
- parameters = new ServerAzureADAdministrator();
+ properties = new ServerAzureADAdministrator();
}
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
@@ -564,9 +564,9 @@ internal ServerAzureADAdministratorsOperations(SqlManagementClient client)
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serverName", serverName);
- tracingParameters.Add("parameters", parameters);
+ tracingParameters.Add("properties", properties);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdateAzureADAdministrator", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
@@ -617,9 +617,9 @@ internal ServerAzureADAdministratorsOperations(SqlManagementClient client)
// Serialize Request
string _requestContent = null;
- if(parameters != null)
+ if(properties != null)
{
- _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings);
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(properties, 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");
}
@@ -721,6 +721,24 @@ internal ServerAzureADAdministratorsOperations(SqlManagementClient client)
throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
+ // Deserialize Response
+ if ((int)_statusCode == 202)
+ {
+ _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);
@@ -747,6 +765,9 @@ internal ServerAzureADAdministratorsOperations(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
///
@@ -756,7 +777,7 @@ internal ServerAzureADAdministratorsOperations(SqlManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.SubscriptionId == null)
{
@@ -888,13 +909,67 @@ internal ServerAzureADAdministratorsOperations(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 == 202)
+ {
+ _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 == 204)
+ {
+ _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 == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
if (_shouldTrace)
{
ServiceClientTracing.Exit(_invocationId, _result);
diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/ServerAzureADAdministratorsOperationsExtensions.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/ServerAzureADAdministratorsOperationsExtensions.cs
index ce06dfb982b2..a47bbf9ffb62 100644
--- a/src/SDKs/SqlManagement/Management.Sql/Generated/ServerAzureADAdministratorsOperationsExtensions.cs
+++ b/src/SDKs/SqlManagement/Management.Sql/Generated/ServerAzureADAdministratorsOperationsExtensions.cs
@@ -37,13 +37,13 @@ public static partial class ServerAzureADAdministratorsOperationsExtensions
///
/// The name of the server.
///
- ///
+ ///
/// The required parameters for creating or updating an Active Directory
/// Administrator.
///
- public static ServerAzureADAdministrator CreateOrUpdateAzureADAdministrator(this IServerAzureADAdministratorsOperations operations, string resourceGroupName, string serverName, ServerAzureADAdministrator parameters)
+ public static ServerAzureADAdministrator CreateOrUpdate(this IServerAzureADAdministratorsOperations operations, string resourceGroupName, string serverName, ServerAzureADAdministrator properties)
{
- return operations.CreateOrUpdateAzureADAdministratorAsync(resourceGroupName, serverName, parameters).GetAwaiter().GetResult();
+ return operations.CreateOrUpdateAsync(resourceGroupName, serverName, properties).GetAwaiter().GetResult();
}
///
@@ -60,16 +60,16 @@ public static ServerAzureADAdministrator CreateOrUpdateAzureADAdministrator(this
///
/// The name of the server.
///
- ///
+ ///
/// The required parameters for creating or updating an Active Directory
/// Administrator.
///
///
/// The cancellation token.
///
- public static async Task CreateOrUpdateAzureADAdministratorAsync(this IServerAzureADAdministratorsOperations operations, string resourceGroupName, string serverName, ServerAzureADAdministrator parameters, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task CreateOrUpdateAsync(this IServerAzureADAdministratorsOperations operations, string resourceGroupName, string serverName, ServerAzureADAdministrator properties, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.CreateOrUpdateAzureADAdministratorWithHttpMessagesAsync(resourceGroupName, serverName, parameters, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, properties, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
@@ -88,9 +88,9 @@ public static ServerAzureADAdministrator CreateOrUpdateAzureADAdministrator(this
///
/// The name of the server.
///
- public static void Delete(this IServerAzureADAdministratorsOperations operations, string resourceGroupName, string serverName)
+ public static ServerAzureADAdministrator Delete(this IServerAzureADAdministratorsOperations operations, string resourceGroupName, string serverName)
{
- operations.DeleteAsync(resourceGroupName, serverName).GetAwaiter().GetResult();
+ return operations.DeleteAsync(resourceGroupName, serverName).GetAwaiter().GetResult();
}
///
@@ -109,9 +109,12 @@ public static void Delete(this IServerAzureADAdministratorsOperations operations
///
/// The cancellation token.
///
- public static async Task DeleteAsync(this IServerAzureADAdministratorsOperations operations, string resourceGroupName, string serverName, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task DeleteAsync(this IServerAzureADAdministratorsOperations operations, string resourceGroupName, string serverName, CancellationToken cancellationToken = default(CancellationToken))
{
- (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serverName, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serverName, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
}
///
@@ -212,13 +215,13 @@ public static IEnumerable List(this IServerAzureADAd
///
/// The name of the server.
///
- ///
+ ///
/// The required parameters for creating or updating an Active Directory
/// Administrator.
///
- public static ServerAzureADAdministrator BeginCreateOrUpdateAzureADAdministrator(this IServerAzureADAdministratorsOperations operations, string resourceGroupName, string serverName, ServerAzureADAdministrator parameters)
+ public static ServerAzureADAdministrator BeginCreateOrUpdate(this IServerAzureADAdministratorsOperations operations, string resourceGroupName, string serverName, ServerAzureADAdministrator properties)
{
- return operations.BeginCreateOrUpdateAzureADAdministratorAsync(resourceGroupName, serverName, parameters).GetAwaiter().GetResult();
+ return operations.BeginCreateOrUpdateAsync(resourceGroupName, serverName, properties).GetAwaiter().GetResult();
}
///
@@ -235,16 +238,16 @@ public static ServerAzureADAdministrator BeginCreateOrUpdateAzureADAdministrator
///
/// The name of the server.
///
- ///
+ ///
/// The required parameters for creating or updating an Active Directory
/// Administrator.
///
///
/// The cancellation token.
///
- public static async Task BeginCreateOrUpdateAzureADAdministratorAsync(this IServerAzureADAdministratorsOperations operations, string resourceGroupName, string serverName, ServerAzureADAdministrator parameters, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task BeginCreateOrUpdateAsync(this IServerAzureADAdministratorsOperations operations, string resourceGroupName, string serverName, ServerAzureADAdministrator properties, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.BeginCreateOrUpdateAzureADAdministratorWithHttpMessagesAsync(resourceGroupName, serverName, parameters, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, properties, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
@@ -263,9 +266,9 @@ public static ServerAzureADAdministrator BeginCreateOrUpdateAzureADAdministrator
///
/// The name of the server.
///
- public static void BeginDelete(this IServerAzureADAdministratorsOperations operations, string resourceGroupName, string serverName)
+ public static ServerAzureADAdministrator BeginDelete(this IServerAzureADAdministratorsOperations operations, string resourceGroupName, string serverName)
{
- operations.BeginDeleteAsync(resourceGroupName, serverName).GetAwaiter().GetResult();
+ return operations.BeginDeleteAsync(resourceGroupName, serverName).GetAwaiter().GetResult();
}
///
@@ -284,9 +287,12 @@ public static void BeginDelete(this IServerAzureADAdministratorsOperations opera
///
/// The cancellation token.
///
- public static async Task BeginDeleteAsync(this IServerAzureADAdministratorsOperations operations, string resourceGroupName, string serverName, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task BeginDeleteAsync(this IServerAzureADAdministratorsOperations operations, string resourceGroupName, string serverName, CancellationToken cancellationToken = default(CancellationToken))
{
- (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, serverName, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, serverName, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
}
}
diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/ServerKeysOperations.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/ServerKeysOperations.cs
new file mode 100644
index 000000000000..764d17a1173c
--- /dev/null
+++ b/src/SDKs/SqlManagement/Management.Sql/Generated/ServerKeysOperations.cs
@@ -0,0 +1,1110 @@
+// 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 1.0.1.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+namespace Microsoft.Azure.Management.Sql
+{
+ using Microsoft.Azure;
+ using Microsoft.Azure.Management;
+ 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;
+
+ ///
+ /// ServerKeysOperations operations.
+ ///
+ internal partial class ServerKeysOperations : IServiceOperations, IServerKeysOperations
+ {
+ ///
+ /// Initializes a new instance of the ServerKeysOperations class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ internal ServerKeysOperations(SqlManagementClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the SqlManagementClient
+ ///
+ public SqlManagementClient Client { get; private set; }
+
+ ///
+ /// Returns a list of server keys.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can obtain
+ /// this value from the Azure Resource Manager API or the portal.
+ ///
+ ///
+ /// The name of the server.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (serverName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "serverName");
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ string apiVersion = "2015-05-01-preview";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("serverName", serverName);
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "ListByServer", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys").ToString();
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Returns a server key.
+ ///
+ ///
+ /// The name of the 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 server key to be retrieved.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string keyName, 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 (keyName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "keyName");
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ string apiVersion = "2015-05-01-preview";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary