diff --git a/src/Sql/Sql.Management.Sdk/Generated/IManagedInstancesOperations.cs b/src/Sql/Sql.Management.Sdk/Generated/IManagedInstancesOperations.cs
index 04f4a66c1e68..85cbbeabec4a 100644
--- a/src/Sql/Sql.Management.Sdk/Generated/IManagedInstancesOperations.cs
+++ b/src/Sql/Sql.Management.Sdk/Generated/IManagedInstancesOperations.cs
@@ -151,7 +151,7 @@ public partial interface IManagedInstancesOperations
///
/// Thrown when unable to deserialize the response
///
- System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, ManagedInstance parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+ System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, ManagedInstance parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
///
/// Deletes a managed instance.
@@ -175,7 +175,7 @@ public partial interface IManagedInstancesOperations
///
/// Thrown when the operation returned an invalid status code
///
- System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+ System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
///
/// Updates a managed instance.
@@ -205,7 +205,7 @@ public partial interface IManagedInstancesOperations
///
/// Thrown when unable to deserialize the response
///
- System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, ManagedInstanceUpdate parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+ System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, ManagedInstanceUpdate parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
///
/// Failovers a managed instance.
@@ -232,7 +232,7 @@ public partial interface IManagedInstancesOperations
///
/// Thrown when the operation returned an invalid status code
///
- System.Threading.Tasks.Task FailoverWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string replicaType = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+ System.Threading.Tasks.Task> FailoverWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string replicaType = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
///
/// Gets the collection of outbound network dependencies for the given managed
@@ -263,6 +263,30 @@ public partial interface IManagedInstancesOperations
///
System.Threading.Tasks.Task>> ListOutboundNetworkDependenciesByManagedInstanceWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+ ///
+ /// Reevaluates the inaccessibility state of all managed databases.
+ ///
+ ///
+ /// Reevaluates the inaccessibility state of all managed databases.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can obtain
+ /// this value from the Azure Resource Manager API or the portal.
+ ///
+ ///
+ /// The name of the managed instance.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ System.Threading.Tasks.Task> ReevaluateInaccessibleDatabaseStateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+
///
/// Refresh external governance enablement status.
///
@@ -288,7 +312,7 @@ public partial interface IManagedInstancesOperations
///
/// Thrown when unable to deserialize the response
///
- System.Threading.Tasks.Task> RefreshStatusWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+ System.Threading.Tasks.Task> RefreshStatusWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
///
/// Starts the managed instance.
@@ -315,7 +339,7 @@ public partial interface IManagedInstancesOperations
///
/// Thrown when unable to deserialize the response
///
- System.Threading.Tasks.Task> StartWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+ System.Threading.Tasks.Task> StartWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
///
/// Stops the managed instance.
@@ -342,7 +366,7 @@ public partial interface IManagedInstancesOperations
///
/// Thrown when unable to deserialize the response
///
- System.Threading.Tasks.Task> StopWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+ System.Threading.Tasks.Task> StopWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
///
/// Get top resource consuming queries of a managed instance.
@@ -394,6 +418,33 @@ public partial interface IManagedInstancesOperations
///
System.Threading.Tasks.Task>> ListByManagedInstanceWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, int? numberOfQueries = default(int?), string databases = default(string), string startTime = default(string), string endTime = default(string), string interval = default(string), string aggregationFunction = default(string), string observationMetric = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+ ///
+ /// Validates customer managed key.
+ ///
+ ///
+ /// Validates customer managed 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 managed instance.
+ ///
+ ///
+ /// The validate azure key vault encryption key parameters.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ System.Threading.Tasks.Task> ValidateAzureKeyVaultEncryptionKeyWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+
///
/// Creates or updates a managed instance.
///
@@ -422,7 +473,7 @@ public partial interface IManagedInstancesOperations
///
/// Thrown when unable to deserialize the response
///
- System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, ManagedInstance parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+ System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, ManagedInstance parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
///
/// Deletes a managed instance.
@@ -446,7 +497,7 @@ public partial interface IManagedInstancesOperations
///
/// Thrown when the operation returned an invalid status code
///
- System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+ System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
///
/// Updates a managed instance.
@@ -476,7 +527,7 @@ public partial interface IManagedInstancesOperations
///
/// Thrown when unable to deserialize the response
///
- System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, ManagedInstanceUpdate parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+ System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, ManagedInstanceUpdate parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
///
/// Failovers a managed instance.
@@ -503,7 +554,31 @@ public partial interface IManagedInstancesOperations
///
/// Thrown when the operation returned an invalid status code
///
- System.Threading.Tasks.Task BeginFailoverWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string replicaType = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+ System.Threading.Tasks.Task> BeginFailoverWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string replicaType = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+
+ ///
+ /// Reevaluates the inaccessibility state of all managed databases.
+ ///
+ ///
+ /// Reevaluates the inaccessibility state of all managed databases.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can obtain
+ /// this value from the Azure Resource Manager API or the portal.
+ ///
+ ///
+ /// The name of the managed instance.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ System.Threading.Tasks.Task> BeginReevaluateInaccessibleDatabaseStateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
///
/// Refresh external governance enablement status.
@@ -530,7 +605,7 @@ public partial interface IManagedInstancesOperations
///
/// Thrown when unable to deserialize the response
///
- System.Threading.Tasks.Task> BeginRefreshStatusWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+ System.Threading.Tasks.Task> BeginRefreshStatusWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
///
/// Starts the managed instance.
@@ -557,7 +632,7 @@ public partial interface IManagedInstancesOperations
///
/// Thrown when unable to deserialize the response
///
- System.Threading.Tasks.Task> BeginStartWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+ System.Threading.Tasks.Task> BeginStartWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
///
/// Stops the managed instance.
@@ -584,7 +659,34 @@ public partial interface IManagedInstancesOperations
///
/// Thrown when unable to deserialize the response
///
- System.Threading.Tasks.Task> BeginStopWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+ System.Threading.Tasks.Task> BeginStopWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+
+ ///
+ /// Validates customer managed key.
+ ///
+ ///
+ /// Validates customer managed 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 managed instance.
+ ///
+ ///
+ /// The validate azure key vault encryption key parameters.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ System.Threading.Tasks.Task> BeginValidateAzureKeyVaultEncryptionKeyWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
///
/// Gets a list of all managed instances in the subscription.
diff --git a/src/Sql/Sql.Management.Sdk/Generated/ManagedInstancesOperations.cs b/src/Sql/Sql.Management.Sdk/Generated/ManagedInstancesOperations.cs
index 0d785a7151fa..8d44ae7424c7 100644
--- a/src/Sql/Sql.Management.Sdk/Generated/ManagedInstancesOperations.cs
+++ b/src/Sql/Sql.Management.Sdk/Generated/ManagedInstancesOperations.cs
@@ -77,7 +77,7 @@ internal ManagedInstancesOperations (SqlManagementClient client)
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2023-05-01-preview";
+ string apiVersion = "2024-11-01-preview";
// Tracing
bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -167,14 +167,13 @@ internal ManagedInstancesOperations (SqlManagementClient client)
if ((int)_statusCode != 200)
{
- var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
+ ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -184,10 +183,6 @@ internal ManagedInstancesOperations (SqlManagementClient client)
}
ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
- if (_httpResponse.Headers.Contains("x-ms-request-id"))
- {
- ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
- }
if (_shouldTrace)
{
Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
@@ -293,7 +288,7 @@ internal ManagedInstancesOperations (SqlManagementClient client)
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2023-05-01-preview";
+ string apiVersion = "2024-11-01-preview";
// Tracing
bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -387,14 +382,13 @@ internal ManagedInstancesOperations (SqlManagementClient client)
if ((int)_statusCode != 200)
{
- var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
+ ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -404,10 +398,6 @@ internal ManagedInstancesOperations (SqlManagementClient client)
}
ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
- if (_httpResponse.Headers.Contains("x-ms-request-id"))
- {
- ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
- }
if (_shouldTrace)
{
Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
@@ -505,7 +495,7 @@ internal ManagedInstancesOperations (SqlManagementClient client)
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2023-05-01-preview";
+ string apiVersion = "2024-11-01-preview";
// Tracing
bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -597,14 +587,13 @@ internal ManagedInstancesOperations (SqlManagementClient client)
if ((int)_statusCode != 200)
{
- var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
+ ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -614,10 +603,6 @@ internal ManagedInstancesOperations (SqlManagementClient client)
}
ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
- if (_httpResponse.Headers.Contains("x-ms-request-id"))
- {
- ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
- }
if (_shouldTrace)
{
Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
@@ -723,7 +708,7 @@ internal ManagedInstancesOperations (SqlManagementClient client)
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2023-05-01-preview";
+ string apiVersion = "2024-11-01-preview";
// Tracing
bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -817,14 +802,13 @@ internal ManagedInstancesOperations (SqlManagementClient client)
if ((int)_statusCode != 200)
{
- var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
+ ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -834,10 +818,6 @@ internal ManagedInstancesOperations (SqlManagementClient client)
}
ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
- if (_httpResponse.Headers.Contains("x-ms-request-id"))
- {
- ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
- }
if (_shouldTrace)
{
Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
@@ -906,10 +886,10 @@ internal ManagedInstancesOperations (SqlManagementClient client)
///
/// The cancellation token.
///
- public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, ManagedInstance parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, ManagedInstance parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
// Send Request
- Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, managedInstanceName, parameters, customHeaders, cancellationToken).ConfigureAwait(false);
+ Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, managedInstanceName, parameters, customHeaders, cancellationToken).ConfigureAwait(false);
return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
}
@@ -929,10 +909,10 @@ internal ManagedInstancesOperations (SqlManagementClient client)
///
/// The cancellation token.
///
- public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ public async System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
// Send Request
- Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, managedInstanceName, customHeaders, cancellationToken).ConfigureAwait(false);
+ Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, managedInstanceName, customHeaders, cancellationToken).ConfigureAwait(false);
return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
}
@@ -955,10 +935,10 @@ internal ManagedInstancesOperations (SqlManagementClient client)
///
/// The cancellation token.
///
- public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, ManagedInstanceUpdate parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, ManagedInstanceUpdate parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
// Send Request
- Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, managedInstanceName, parameters, customHeaders, cancellationToken).ConfigureAwait(false);
+ Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, managedInstanceName, parameters, customHeaders, cancellationToken).ConfigureAwait(false);
return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
}
@@ -981,10 +961,10 @@ internal ManagedInstancesOperations (SqlManagementClient client)
///
/// The cancellation token.
///
- public async System.Threading.Tasks.Task FailoverWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string replicaType = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ public async System.Threading.Tasks.Task> FailoverWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string replicaType = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
// Send Request
- Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginFailoverWithHttpMessagesAsync(resourceGroupName, managedInstanceName, replicaType, customHeaders, cancellationToken).ConfigureAwait(false);
+ Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginFailoverWithHttpMessagesAsync(resourceGroupName, managedInstanceName, replicaType, customHeaders, cancellationToken).ConfigureAwait(false);
return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
}
@@ -1041,7 +1021,7 @@ internal ManagedInstancesOperations (SqlManagementClient client)
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2023-05-01-preview";
+ string apiVersion = "2024-11-01-preview";
// Tracing
bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1130,14 +1110,13 @@ internal ManagedInstancesOperations (SqlManagementClient client)
if ((int)_statusCode != 200)
{
- var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
+ ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -1147,10 +1126,6 @@ internal ManagedInstancesOperations (SqlManagementClient client)
}
ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
- if (_httpResponse.Headers.Contains("x-ms-request-id"))
- {
- ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
- }
if (_shouldTrace)
{
Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
@@ -1200,6 +1175,29 @@ internal ManagedInstancesOperations (SqlManagementClient client)
}
+ ///
+ /// Reevaluates the inaccessibility state of all managed databases.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can obtain
+ /// this value from the Azure Resource Manager API or the portal.
+ ///
+ ///
+ /// The name of the managed instance.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public async System.Threading.Tasks.Task> ReevaluateInaccessibleDatabaseStateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ {
+ // Send Request
+ Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginReevaluateInaccessibleDatabaseStateWithHttpMessagesAsync(resourceGroupName, managedInstanceName, customHeaders, cancellationToken).ConfigureAwait(false);
+ return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
+ }
+
///
/// Refresh external governance enablement status.
///
@@ -1216,10 +1214,10 @@ internal ManagedInstancesOperations (SqlManagementClient client)
///
/// The cancellation token.
///
- public async System.Threading.Tasks.Task> RefreshStatusWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ public async System.Threading.Tasks.Task> RefreshStatusWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
// Send Request
- Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginRefreshStatusWithHttpMessagesAsync(resourceGroupName, managedInstanceName, customHeaders, cancellationToken).ConfigureAwait(false);
+ Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginRefreshStatusWithHttpMessagesAsync(resourceGroupName, managedInstanceName, customHeaders, cancellationToken).ConfigureAwait(false);
return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
}
@@ -1239,10 +1237,10 @@ internal ManagedInstancesOperations (SqlManagementClient client)
///
/// The cancellation token.
///
- public async System.Threading.Tasks.Task> StartWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ public async System.Threading.Tasks.Task> StartWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
// Send Request
- Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginStartWithHttpMessagesAsync(resourceGroupName, managedInstanceName, customHeaders, cancellationToken).ConfigureAwait(false);
+ Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginStartWithHttpMessagesAsync(resourceGroupName, managedInstanceName, customHeaders, cancellationToken).ConfigureAwait(false);
return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
}
@@ -1262,10 +1260,10 @@ internal ManagedInstancesOperations (SqlManagementClient client)
///
/// The cancellation token.
///
- public async System.Threading.Tasks.Task> StopWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ public async System.Threading.Tasks.Task> StopWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
// Send Request
- Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginStopWithHttpMessagesAsync(resourceGroupName, managedInstanceName, customHeaders, cancellationToken).ConfigureAwait(false);
+ Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginStopWithHttpMessagesAsync(resourceGroupName, managedInstanceName, customHeaders, cancellationToken).ConfigureAwait(false);
return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
}
@@ -1351,7 +1349,7 @@ internal ManagedInstancesOperations (SqlManagementClient client)
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2023-05-01-preview";
+ string apiVersion = "2024-11-01-preview";
// Tracing
bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1475,14 +1473,13 @@ internal ManagedInstancesOperations (SqlManagementClient client)
if ((int)_statusCode != 200)
{
- var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
+ ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -1492,10 +1489,6 @@ internal ManagedInstancesOperations (SqlManagementClient client)
}
ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
- if (_httpResponse.Headers.Contains("x-ms-request-id"))
- {
- ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
- }
if (_shouldTrace)
{
Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
@@ -1545,6 +1538,32 @@ internal ManagedInstancesOperations (SqlManagementClient client)
}
+ ///
+ /// Validates customer managed 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 managed instance.
+ ///
+ ///
+ /// The validate azure key vault encryption key parameters.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public async System.Threading.Tasks.Task> ValidateAzureKeyVaultEncryptionKeyWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ {
+ // Send Request
+ Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginValidateAzureKeyVaultEncryptionKeyWithHttpMessagesAsync(resourceGroupName, managedInstanceName, parameters, customHeaders, cancellationToken).ConfigureAwait(false);
+ return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
+ }
+
///
/// Creates or updates a managed instance.
///
@@ -1579,7 +1598,7 @@ internal ManagedInstancesOperations (SqlManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, ManagedInstance parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, ManagedInstance parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
@@ -1608,7 +1627,7 @@ internal ManagedInstancesOperations (SqlManagementClient client)
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2023-05-01-preview";
+ string apiVersion = "2024-11-01-preview";
// Tracing
bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1704,14 +1723,13 @@ internal ManagedInstancesOperations (SqlManagementClient client)
if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202)
{
- var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
+ ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -1721,10 +1739,6 @@ internal ManagedInstancesOperations (SqlManagementClient client)
}
ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
- if (_httpResponse.Headers.Contains("x-ms-request-id"))
- {
- ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
- }
if (_shouldTrace)
{
Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
@@ -1737,7 +1751,7 @@ internal ManagedInstancesOperations (SqlManagementClient client)
throw ex;
}
// Create Result
- var _result = new Microsoft.Rest.Azure.AzureOperationResponse();
+ var _result = new Microsoft.Rest.Azure.AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
@@ -1781,6 +1795,19 @@ internal ManagedInstancesOperations (SqlManagementClient client)
throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
+ try
+ {
+ _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings));
+ }
+ catch (Newtonsoft.Json.JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex);
+ }
if (_shouldTrace)
{
Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
@@ -1820,7 +1847,7 @@ internal ManagedInstancesOperations (SqlManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ public async System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
@@ -1841,7 +1868,7 @@ internal ManagedInstancesOperations (SqlManagementClient client)
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2023-05-01-preview";
+ string apiVersion = "2024-11-01-preview";
// Tracing
bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1930,14 +1957,13 @@ internal ManagedInstancesOperations (SqlManagementClient client)
if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204)
{
- var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
+ ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -1947,10 +1973,6 @@ internal ManagedInstancesOperations (SqlManagementClient client)
}
ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
- if (_httpResponse.Headers.Contains("x-ms-request-id"))
- {
- ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
- }
if (_shouldTrace)
{
Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
@@ -1963,7 +1985,7 @@ internal ManagedInstancesOperations (SqlManagementClient client)
throw ex;
}
// Create Result
- var _result = new Microsoft.Rest.Azure.AzureOperationResponse();
+ var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
@@ -1971,6 +1993,19 @@ internal ManagedInstancesOperations (SqlManagementClient client)
{
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
+ try
+ {
+ _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings));
+ }
+ catch (Newtonsoft.Json.JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex);
+ }
if (_shouldTrace)
{
Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
@@ -2016,7 +2051,7 @@ internal ManagedInstancesOperations (SqlManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, ManagedInstanceUpdate parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, ManagedInstanceUpdate parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
@@ -2041,7 +2076,7 @@ internal ManagedInstancesOperations (SqlManagementClient client)
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2023-05-01-preview";
+ string apiVersion = "2024-11-01-preview";
// Tracing
bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -2137,14 +2172,13 @@ internal ManagedInstancesOperations (SqlManagementClient client)
if ((int)_statusCode != 200 && (int)_statusCode != 202)
{
- var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
+ ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -2154,10 +2188,6 @@ internal ManagedInstancesOperations (SqlManagementClient client)
}
ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
- if (_httpResponse.Headers.Contains("x-ms-request-id"))
- {
- ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
- }
if (_shouldTrace)
{
Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
@@ -2170,7 +2200,7 @@ internal ManagedInstancesOperations (SqlManagementClient client)
throw ex;
}
// Create Result
- var _result = new Microsoft.Rest.Azure.AzureOperationResponse();
+ var _result = new Microsoft.Rest.Azure.AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
@@ -2196,6 +2226,19 @@ internal ManagedInstancesOperations (SqlManagementClient client)
throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
+ try
+ {
+ _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings));
+ }
+ catch (Newtonsoft.Json.JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex);
+ }
if (_shouldTrace)
{
Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
@@ -2238,7 +2281,7 @@ internal ManagedInstancesOperations (SqlManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async System.Threading.Tasks.Task BeginFailoverWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string replicaType = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ public async System.Threading.Tasks.Task> BeginFailoverWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string replicaType = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
@@ -2260,7 +2303,7 @@ internal ManagedInstancesOperations (SqlManagementClient client)
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2023-05-01-preview";
+ string apiVersion = "2024-11-01-preview";
// Tracing
bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -2354,14 +2397,13 @@ internal ManagedInstancesOperations (SqlManagementClient client)
if ((int)_statusCode != 200 && (int)_statusCode != 202)
{
- var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
+ ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -2371,10 +2413,6 @@ internal ManagedInstancesOperations (SqlManagementClient client)
}
ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
- if (_httpResponse.Headers.Contains("x-ms-request-id"))
- {
- ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
- }
if (_shouldTrace)
{
Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
@@ -2387,7 +2425,7 @@ internal ManagedInstancesOperations (SqlManagementClient client)
throw ex;
}
// Create Result
- var _result = new Microsoft.Rest.Azure.AzureOperationResponse();
+ var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
@@ -2395,6 +2433,19 @@ internal ManagedInstancesOperations (SqlManagementClient client)
{
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
+ try
+ {
+ _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings));
+ }
+ catch (Newtonsoft.Json.JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex);
+ }
if (_shouldTrace)
{
Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
@@ -2407,7 +2458,7 @@ internal ManagedInstancesOperations (SqlManagementClient client)
}
///
- /// Refresh external governance enablement status.
+ /// Reevaluates the inaccessibility state of all managed databases.
///
///
/// The name of the resource group that contains the resource. You can obtain
@@ -2425,9 +2476,6 @@ internal ManagedInstancesOperations (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
///
@@ -2437,7 +2485,7 @@ internal ManagedInstancesOperations (SqlManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async System.Threading.Tasks.Task> BeginRefreshStatusWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ public async System.Threading.Tasks.Task> BeginReevaluateInaccessibleDatabaseStateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
@@ -2458,7 +2506,7 @@ internal ManagedInstancesOperations (SqlManagementClient client)
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2023-05-01-preview";
+ string apiVersion = "2024-11-01-preview";
// Tracing
bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -2472,12 +2520,12 @@ internal ManagedInstancesOperations (SqlManagementClient client)
tracingParameters.Add("cancellationToken", cancellationToken);
- Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginRefreshStatus", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginReevaluateInaccessibleDatabaseState", tracingParameters);
}
// Construct URL
var _baseUrl = this.Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/refreshExternalGovernanceStatus").ToString();
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/reevaluateInaccessibleDatabaseState").ToString();
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{managedInstanceName}", System.Uri.EscapeDataString(managedInstanceName));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId));
@@ -2575,7 +2623,7 @@ internal ManagedInstancesOperations (SqlManagementClient client)
throw ex;
}
// Create Result
- var _result = new Microsoft.Rest.Azure.AzureOperationResponse();
+ var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
@@ -2583,23 +2631,18 @@ internal ManagedInstancesOperations (SqlManagementClient client)
{
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
- // Deserialize Response
- if ((int)_statusCode == 200)
+ try
{
- _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- try
- {
- _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
- }
- catch (Newtonsoft.Json.JsonException ex)
+ _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings));
+ }
+ catch (Newtonsoft.Json.JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
{
- _httpRequest.Dispose();
- if (_httpResponse != null)
- {
- _httpResponse.Dispose();
- }
- throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ _httpResponse.Dispose();
}
+ throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex);
}
if (_shouldTrace)
{
@@ -2613,7 +2656,7 @@ internal ManagedInstancesOperations (SqlManagementClient client)
}
///
- /// Starts the managed instance.
+ /// Refresh external governance enablement status.
///
///
/// The name of the resource group that contains the resource. You can obtain
@@ -2643,7 +2686,7 @@ internal ManagedInstancesOperations (SqlManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async System.Threading.Tasks.Task> BeginStartWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ public async System.Threading.Tasks.Task> BeginRefreshStatusWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
@@ -2664,7 +2707,7 @@ internal ManagedInstancesOperations (SqlManagementClient client)
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2023-05-01-preview";
+ string apiVersion = "2024-11-01-preview";
// Tracing
bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -2678,12 +2721,12 @@ internal ManagedInstancesOperations (SqlManagementClient client)
tracingParameters.Add("cancellationToken", cancellationToken);
- Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginStart", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginRefreshStatus", tracingParameters);
}
// Construct URL
var _baseUrl = this.Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/start").ToString();
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/refreshExternalGovernanceStatus").ToString();
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{managedInstanceName}", System.Uri.EscapeDataString(managedInstanceName));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId));
@@ -2753,14 +2796,13 @@ internal ManagedInstancesOperations (SqlManagementClient client)
if ((int)_statusCode != 200 && (int)_statusCode != 202)
{
- var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
+ ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -2770,10 +2812,6 @@ internal ManagedInstancesOperations (SqlManagementClient client)
}
ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
- if (_httpResponse.Headers.Contains("x-ms-request-id"))
- {
- ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
- }
if (_shouldTrace)
{
Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
@@ -2786,7 +2824,7 @@ internal ManagedInstancesOperations (SqlManagementClient client)
throw ex;
}
// Create Result
- var _result = new Microsoft.Rest.Azure.AzureOperationResponse();
+ var _result = new Microsoft.Rest.Azure.AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
@@ -2800,7 +2838,7 @@ internal ManagedInstancesOperations (SqlManagementClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
+ _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
}
catch (Newtonsoft.Json.JsonException ex)
{
@@ -2812,6 +2850,19 @@ internal ManagedInstancesOperations (SqlManagementClient client)
throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
+ try
+ {
+ _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings));
+ }
+ catch (Newtonsoft.Json.JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex);
+ }
if (_shouldTrace)
{
Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
@@ -2824,7 +2875,7 @@ internal ManagedInstancesOperations (SqlManagementClient client)
}
///
- /// Stops the managed instance.
+ /// Starts the managed instance.
///
///
/// The name of the resource group that contains the resource. You can obtain
@@ -2854,7 +2905,7 @@ internal ManagedInstancesOperations (SqlManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async System.Threading.Tasks.Task> BeginStopWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ public async System.Threading.Tasks.Task> BeginStartWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
@@ -2875,7 +2926,7 @@ internal ManagedInstancesOperations (SqlManagementClient client)
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2023-05-01-preview";
+ string apiVersion = "2024-11-01-preview";
// Tracing
bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -2889,12 +2940,12 @@ internal ManagedInstancesOperations (SqlManagementClient client)
tracingParameters.Add("cancellationToken", cancellationToken);
- Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginStop", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginStart", tracingParameters);
}
// Construct URL
var _baseUrl = this.Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/stop").ToString();
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/start").ToString();
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{managedInstanceName}", System.Uri.EscapeDataString(managedInstanceName));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId));
@@ -2964,14 +3015,13 @@ internal ManagedInstancesOperations (SqlManagementClient client)
if ((int)_statusCode != 200 && (int)_statusCode != 202)
{
- var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
+ ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -2981,10 +3031,6 @@ internal ManagedInstancesOperations (SqlManagementClient client)
}
ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
- if (_httpResponse.Headers.Contains("x-ms-request-id"))
- {
- ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
- }
if (_shouldTrace)
{
Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
@@ -2997,7 +3043,7 @@ internal ManagedInstancesOperations (SqlManagementClient client)
throw ex;
}
// Create Result
- var _result = new Microsoft.Rest.Azure.AzureOperationResponse();
+ var _result = new Microsoft.Rest.Azure.AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
@@ -3023,6 +3069,19 @@ internal ManagedInstancesOperations (SqlManagementClient client)
throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
+ try
+ {
+ _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings));
+ }
+ catch (Newtonsoft.Json.JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex);
+ }
if (_shouldTrace)
{
Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
@@ -3035,10 +3094,14 @@ internal ManagedInstancesOperations (SqlManagementClient client)
}
///
- /// Gets a list of all managed instances in the subscription.
+ /// Stops the managed instance.
///
- ///
- /// The NextLink from the previous successful call to List operation.
+ ///
+ /// The name of the resource group that contains the resource. You can obtain
+ /// this value from the Azure Resource Manager API or the portal.
+ ///
+ ///
+ /// The name of the managed instance.
///
///
/// Headers that will be added to request.
@@ -3061,13 +3124,28 @@ internal ManagedInstancesOperations (SqlManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ public async System.Threading.Tasks.Task> BeginStopWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
- if (nextPageLink == null)
+
+
+
+ if (resourceGroupName == null)
{
- throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+
+ if (managedInstanceName == null)
+ {
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "managedInstanceName");
+ }
+
+ if (this.Client.SubscriptionId == null)
+ {
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+
+ string apiVersion = "2024-11-01-preview";
// Tracing
bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -3075,17 +3153,27 @@ internal ManagedInstancesOperations (SqlManagementClient client)
{
_invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
- tracingParameters.Add("nextPageLink", nextPageLink);
-
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("managedInstanceName", managedInstanceName);
+ tracingParameters.Add("apiVersion", apiVersion);
+
tracingParameters.Add("cancellationToken", cancellationToken);
- Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginStop", tracingParameters);
}
// Construct URL
- string _url = "{nextLink}";
- _url = _url.Replace("{nextLink}", nextPageLink);
+
+ var _baseUrl = this.Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/stop").ToString();
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{managedInstanceName}", System.Uri.EscapeDataString(managedInstanceName));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId));
System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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);
@@ -3093,7 +3181,7 @@ internal ManagedInstancesOperations (SqlManagementClient client)
// Create HTTP transport objects
var _httpRequest = new System.Net.Http.HttpRequestMessage();
System.Net.Http.HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new System.Net.Http.HttpMethod("GET");
+ _httpRequest.Method = new System.Net.Http.HttpMethod("POST");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
@@ -3144,16 +3232,15 @@ internal ManagedInstancesOperations (SqlManagementClient client)
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
- if ((int)_statusCode != 200)
+ if ((int)_statusCode != 200 && (int)_statusCode != 202)
{
- var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
+ ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -3163,10 +3250,6 @@ internal ManagedInstancesOperations (SqlManagementClient client)
}
ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
- if (_httpResponse.Headers.Contains("x-ms-request-id"))
- {
- ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
- }
if (_shouldTrace)
{
Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
@@ -3179,7 +3262,7 @@ internal ManagedInstancesOperations (SqlManagementClient client)
throw ex;
}
// Create Result
- var _result = new Microsoft.Rest.Azure.AzureOperationResponse>();
+ var _result = new Microsoft.Rest.Azure.AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
@@ -3193,7 +3276,413 @@ internal ManagedInstancesOperations (SqlManagementClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings);
+ _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
+ }
+ catch (Newtonsoft.Json.JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ try
+ {
+ _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings));
+ }
+ catch (Newtonsoft.Json.JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex);
+ }
+ if (_shouldTrace)
+ {
+ Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+
+
+
+
+
+ }
+ ///
+ /// Validates customer managed 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 managed instance.
+ ///
+ ///
+ /// The validate azure key vault encryption key parameters.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async System.Threading.Tasks.Task> BeginValidateAzureKeyVaultEncryptionKeyWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ {
+
+
+
+
+ if (parameters == null)
+ {
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters");
+ }
+ if (parameters != null)
+ {
+ parameters.Validate();
+ }
+ if (resourceGroupName == null)
+ {
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+
+ if (managedInstanceName == null)
+ {
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "managedInstanceName");
+ }
+
+ if (this.Client.SubscriptionId == null)
+ {
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+
+ string apiVersion = "2024-11-01-preview";
+ // Tracing
+ bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
+ System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("managedInstanceName", managedInstanceName);
+ tracingParameters.Add("apiVersion", apiVersion);
+
+ tracingParameters.Add("parameters", parameters);
+
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginValidateAzureKeyVaultEncryptionKey", tracingParameters);
+ }
+ // Construct URL
+
+ var _baseUrl = this.Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/validateAzureKeyVaultEncryptionKey").ToString();
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{managedInstanceName}", System.Uri.EscapeDataString(managedInstanceName));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId));
+
+ System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage();
+ System.Net.Http.HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new System.Net.Http.HttpMethod("POST");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (this.Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
+ }
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+ // Serialize Request
+ string _requestContent = null;
+ if(parameters != null)
+ {
+ _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings);
+ _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
+ // Set Credentials
+ if (this.Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+
+ System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+
+ if ((int)_statusCode != 200 && (int)_statusCode != 202)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (Newtonsoft.Json.JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ try
+ {
+ _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings));
+ }
+ catch (Newtonsoft.Json.JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex);
+ }
+ if (_shouldTrace)
+ {
+ Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+
+
+
+
+
+ }
+ ///
+ /// Gets a list of all managed instances in the subscription.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ {
+
+ if (nextPageLink == null)
+ {
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink");
+ }
+ // Tracing
+ bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
+ System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
+ tracingParameters.Add("nextPageLink", nextPageLink);
+
+
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters);
+ }
+ // Construct URL
+ string _url = "{nextLink}";
+ _url = _url.Replace("{nextLink}", nextPageLink);
+
+ System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new System.Net.Http.HttpRequestMessage();
+ System.Net.Http.HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new System.Net.Http.HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (this.Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+
+ System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+
+ if ((int)_statusCode != 200)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (Newtonsoft.Json.JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings);
}
catch (Newtonsoft.Json.JsonException ex)
{
@@ -3328,14 +3817,13 @@ internal ManagedInstancesOperations (SqlManagementClient client)
if ((int)_statusCode != 200)
{
- var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
+ ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -3345,10 +3833,6 @@ internal ManagedInstancesOperations (SqlManagementClient client)
}
ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
- if (_httpResponse.Headers.Contains("x-ms-request-id"))
- {
- ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
- }
if (_shouldTrace)
{
Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
@@ -3510,14 +3994,13 @@ internal ManagedInstancesOperations (SqlManagementClient client)
if ((int)_statusCode != 200)
{
- var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
+ ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -3527,10 +4010,6 @@ internal ManagedInstancesOperations (SqlManagementClient client)
}
ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
- if (_httpResponse.Headers.Contains("x-ms-request-id"))
- {
- ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
- }
if (_shouldTrace)
{
Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
@@ -3693,14 +4172,13 @@ internal ManagedInstancesOperations (SqlManagementClient client)
if ((int)_statusCode != 200)
{
- var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
+ ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -3710,10 +4188,6 @@ internal ManagedInstancesOperations (SqlManagementClient client)
}
ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
- if (_httpResponse.Headers.Contains("x-ms-request-id"))
- {
- ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
- }
if (_shouldTrace)
{
Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
@@ -3875,14 +4349,13 @@ internal ManagedInstancesOperations (SqlManagementClient client)
if ((int)_statusCode != 200)
{
- var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
+ ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -3892,10 +4365,6 @@ internal ManagedInstancesOperations (SqlManagementClient client)
}
ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
- if (_httpResponse.Headers.Contains("x-ms-request-id"))
- {
- ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
- }
if (_shouldTrace)
{
Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
diff --git a/src/Sql/Sql.Management.Sdk/Generated/ManagedInstancesOperationsExtensions.cs b/src/Sql/Sql.Management.Sdk/Generated/ManagedInstancesOperationsExtensions.cs
index 8af3c3c1a7dd..c7df140ac085 100644
--- a/src/Sql/Sql.Management.Sdk/Generated/ManagedInstancesOperationsExtensions.cs
+++ b/src/Sql/Sql.Management.Sdk/Generated/ManagedInstancesOperationsExtensions.cs
@@ -234,9 +234,9 @@ public static ManagedInstance CreateOrUpdate(this IManagedInstancesOperations op
///
/// The name of the managed instance.
///
- public static void Delete(this IManagedInstancesOperations operations, string resourceGroupName, string managedInstanceName)
+ public static ManagedInstancesDeleteHeaders Delete(this IManagedInstancesOperations operations, string resourceGroupName, string managedInstanceName)
{
- ((IManagedInstancesOperations)operations).DeleteAsync(resourceGroupName, managedInstanceName).GetAwaiter().GetResult();
+ return ((IManagedInstancesOperations)operations).DeleteAsync(resourceGroupName, managedInstanceName).GetAwaiter().GetResult();
}
///
@@ -255,9 +255,12 @@ public static void Delete(this IManagedInstancesOperations operations, string re
///
/// The cancellation token.
///
- public static async System.Threading.Tasks.Task DeleteAsync(this IManagedInstancesOperations operations, string resourceGroupName, string managedInstanceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ public static async System.Threading.Tasks.Task DeleteAsync(this IManagedInstancesOperations operations, string resourceGroupName, string managedInstanceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
- (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, managedInstanceName, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, managedInstanceName, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Headers;
+ }
}
///
/// Updates a managed instance.
@@ -316,9 +319,9 @@ public static ManagedInstance Update(this IManagedInstancesOperations operations
///
/// The type of replica to be failed over.
///
- public static void Failover(this IManagedInstancesOperations operations, string resourceGroupName, string managedInstanceName, string replicaType = default(string))
+ public static ManagedInstancesFailoverHeaders Failover(this IManagedInstancesOperations operations, string resourceGroupName, string managedInstanceName, string replicaType = default(string))
{
- ((IManagedInstancesOperations)operations).FailoverAsync(resourceGroupName, managedInstanceName, replicaType).GetAwaiter().GetResult();
+ return ((IManagedInstancesOperations)operations).FailoverAsync(resourceGroupName, managedInstanceName, replicaType).GetAwaiter().GetResult();
}
///
@@ -340,9 +343,12 @@ public static ManagedInstance Update(this IManagedInstancesOperations operations
///
/// The cancellation token.
///
- public static async System.Threading.Tasks.Task FailoverAsync(this IManagedInstancesOperations operations, string resourceGroupName, string managedInstanceName, string replicaType = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ public static async System.Threading.Tasks.Task FailoverAsync(this IManagedInstancesOperations operations, string resourceGroupName, string managedInstanceName, string replicaType = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
- (await operations.FailoverWithHttpMessagesAsync(resourceGroupName, managedInstanceName, replicaType, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ using (var _result = await operations.FailoverWithHttpMessagesAsync(resourceGroupName, managedInstanceName, replicaType, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Headers;
+ }
}
///
/// Gets the collection of outbound network dependencies for the given managed
@@ -388,6 +394,47 @@ public static Microsoft.Rest.Azure.IPage ListOutbou
}
}
///
+ /// Reevaluates the inaccessibility state of all managed databases.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can obtain
+ /// this value from the Azure Resource Manager API or the portal.
+ ///
+ ///
+ /// The name of the managed instance.
+ ///
+ public static ManagedInstancesReevaluateInaccessibleDatabaseStateHeaders ReevaluateInaccessibleDatabaseState(this IManagedInstancesOperations operations, string resourceGroupName, string managedInstanceName)
+ {
+ return ((IManagedInstancesOperations)operations).ReevaluateInaccessibleDatabaseStateAsync(resourceGroupName, managedInstanceName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Reevaluates the inaccessibility state of all managed databases.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can obtain
+ /// this value from the Azure Resource Manager API or the portal.
+ ///
+ ///
+ /// The name of the managed instance.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async System.Threading.Tasks.Task ReevaluateInaccessibleDatabaseStateAsync(this IManagedInstancesOperations operations, string resourceGroupName, string managedInstanceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ {
+ using (var _result = await operations.ReevaluateInaccessibleDatabaseStateWithHttpMessagesAsync(resourceGroupName, managedInstanceName, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Headers;
+ }
+ }
+ ///
/// Refresh external governance enablement status.
///
///
@@ -598,6 +645,47 @@ public static ManagedInstance Stop(this IManagedInstancesOperations operations,
}
}
///
+ /// Validates customer managed key.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can obtain
+ /// this value from the Azure Resource Manager API or the portal.
+ ///
+ ///
+ /// The name of the managed instance.
+ ///
+ public static ManagedInstancesValidateAzureKeyVaultEncryptionKeyHeaders ValidateAzureKeyVaultEncryptionKey(this IManagedInstancesOperations operations, string resourceGroupName, string managedInstanceName, ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest parameters)
+ {
+ return ((IManagedInstancesOperations)operations).ValidateAzureKeyVaultEncryptionKeyAsync(resourceGroupName, managedInstanceName, parameters).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Validates customer managed key.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can obtain
+ /// this value from the Azure Resource Manager API or the portal.
+ ///
+ ///
+ /// The name of the managed instance.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async System.Threading.Tasks.Task ValidateAzureKeyVaultEncryptionKeyAsync(this IManagedInstancesOperations operations, string resourceGroupName, string managedInstanceName, ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ {
+ using (var _result = await operations.ValidateAzureKeyVaultEncryptionKeyWithHttpMessagesAsync(resourceGroupName, managedInstanceName, parameters, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Headers;
+ }
+ }
+ ///
/// Creates or updates a managed instance.
///
///
@@ -651,9 +739,9 @@ public static ManagedInstance BeginCreateOrUpdate(this IManagedInstancesOperatio
///
/// The name of the managed instance.
///
- public static void BeginDelete(this IManagedInstancesOperations operations, string resourceGroupName, string managedInstanceName)
+ public static ManagedInstancesDeleteHeaders BeginDelete(this IManagedInstancesOperations operations, string resourceGroupName, string managedInstanceName)
{
- ((IManagedInstancesOperations)operations).BeginDeleteAsync(resourceGroupName, managedInstanceName).GetAwaiter().GetResult();
+ return ((IManagedInstancesOperations)operations).BeginDeleteAsync(resourceGroupName, managedInstanceName).GetAwaiter().GetResult();
}
///
@@ -672,9 +760,12 @@ public static void BeginDelete(this IManagedInstancesOperations operations, stri
///
/// The cancellation token.
///
- public static async System.Threading.Tasks.Task BeginDeleteAsync(this IManagedInstancesOperations operations, string resourceGroupName, string managedInstanceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ public static async System.Threading.Tasks.Task BeginDeleteAsync(this IManagedInstancesOperations operations, string resourceGroupName, string managedInstanceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
- (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, managedInstanceName, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, managedInstanceName, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Headers;
+ }
}
///