diff --git a/eng/mgmt/mgmtmetadata/dataprotection_resource-manager.txt b/eng/mgmt/mgmtmetadata/dataprotection_resource-manager.txt index abc686037e431..b16399a0f5679 100644 --- a/eng/mgmt/mgmtmetadata/dataprotection_resource-manager.txt +++ b/eng/mgmt/mgmtmetadata/dataprotection_resource-manager.txt @@ -3,13 +3,13 @@ AutoRest installed successfully. Commencing code generation Generating CSharp code Executing AutoRest command -cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/dataprotection/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=C:\One\github\mayank\azure-sdk-for-net\sdk -Autorest CSharp Version: 2.3.91 -2021-04-28 09:18:01 UTC +cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/main/specification/dataprotection/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=D:\SDK_DPP\azure-sdk-for-net\sdk +Autorest CSharp Version: 2.3.82 +2021-09-24 10:17:11 UTC Azure-rest-api-specs repository information GitHub fork: Azure -Branch: master -Commit: e1ab90da9a49c2f22ed2d836332a00a2b12cc4e1 +Branch: main +Commit: b49af808cba06f45b01193623ce1ff9e2e017777 AutoRest information Requested version: v2 -Bootstrapper version: autorest@2.0.4413 +Bootstrapper version: autorest@3.3.2 diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/AzSdk.RP.props b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/AzSdk.RP.props index 22ace5943bbf8..3073958fb942e 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/AzSdk.RP.props +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/AzSdk.RP.props @@ -1,7 +1,7 @@ - DataProtection_2021-01-01; + DataProtection_2021-01-01;DataProtection_2021-07-01; $(PackageTags);$(CommonTags);$(AzureApiTag); \ No newline at end of file diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupInstancesOperations.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupInstancesOperations.cs index 0b6a3d3a3c94d..71fde8e99f028 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupInstancesOperations.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupInstancesOperations.cs @@ -632,10 +632,10 @@ internal BackupInstancesOperations(DataProtectionClient client) /// /// The cancellation token. /// - public async Task> ValidateRestoreWithHttpMessagesAsync(string vaultName, string resourceGroupName, string backupInstanceName, AzureBackupRestoreRequest restoreRequestObject, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ValidateForRestoreWithHttpMessagesAsync(string vaultName, string resourceGroupName, string backupInstanceName, AzureBackupRestoreRequest restoreRequestObject, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginValidateRestoreWithHttpMessagesAsync(vaultName, resourceGroupName, backupInstanceName, restoreRequestObject, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginValidateForRestoreWithHttpMessagesAsync(vaultName, resourceGroupName, backupInstanceName, restoreRequestObject, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -2035,7 +2035,7 @@ internal BackupInstancesOperations(DataProtectionClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginValidateRestoreWithHttpMessagesAsync(string vaultName, string resourceGroupName, string backupInstanceName, AzureBackupRestoreRequest restoreRequestObject, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginValidateForRestoreWithHttpMessagesAsync(string vaultName, string resourceGroupName, string backupInstanceName, AzureBackupRestoreRequest restoreRequestObject, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -2082,7 +2082,7 @@ internal BackupInstancesOperations(DataProtectionClient client) tracingParameters.Add("backupInstanceName", backupInstanceName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginValidateRestore", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginValidateForRestore", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -2195,7 +2195,7 @@ internal BackupInstancesOperations(DataProtectionClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2222,7 +2222,7 @@ internal BackupInstancesOperations(DataProtectionClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); } catch (JsonException ex) { diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupInstancesOperationsExtensions.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupInstancesOperationsExtensions.cs index 811cdb7bb7279..a1b6ffdb9073a 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupInstancesOperationsExtensions.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupInstancesOperationsExtensions.cs @@ -421,9 +421,9 @@ public static OperationJobExtendedInfo TriggerRestore(this IBackupInstancesOpera /// /// Gets or sets the restore request object. /// - public static OperationJobExtendedInfo ValidateRestore(this IBackupInstancesOperations operations, string vaultName, string resourceGroupName, string backupInstanceName, AzureBackupRestoreRequest restoreRequestObject) + public static OperationJobExtendedInfo ValidateForRestore(this IBackupInstancesOperations operations, string vaultName, string resourceGroupName, string backupInstanceName, AzureBackupRestoreRequest restoreRequestObject) { - return operations.ValidateRestoreAsync(vaultName, resourceGroupName, backupInstanceName, restoreRequestObject).GetAwaiter().GetResult(); + return operations.ValidateForRestoreAsync(vaultName, resourceGroupName, backupInstanceName, restoreRequestObject).GetAwaiter().GetResult(); } /// @@ -447,9 +447,9 @@ public static OperationJobExtendedInfo ValidateRestore(this IBackupInstancesOper /// /// The cancellation token. /// - public static async Task ValidateRestoreAsync(this IBackupInstancesOperations operations, string vaultName, string resourceGroupName, string backupInstanceName, AzureBackupRestoreRequest restoreRequestObject, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ValidateForRestoreAsync(this IBackupInstancesOperations operations, string vaultName, string resourceGroupName, string backupInstanceName, AzureBackupRestoreRequest restoreRequestObject, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ValidateRestoreWithHttpMessagesAsync(vaultName, resourceGroupName, backupInstanceName, restoreRequestObject, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ValidateForRestoreWithHttpMessagesAsync(vaultName, resourceGroupName, backupInstanceName, restoreRequestObject, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -769,9 +769,9 @@ public static OperationJobExtendedInfo BeginTriggerRestore(this IBackupInstances /// /// Gets or sets the restore request object. /// - public static OperationJobExtendedInfo BeginValidateRestore(this IBackupInstancesOperations operations, string vaultName, string resourceGroupName, string backupInstanceName, AzureBackupRestoreRequest restoreRequestObject) + public static OperationJobExtendedInfo BeginValidateForRestore(this IBackupInstancesOperations operations, string vaultName, string resourceGroupName, string backupInstanceName, AzureBackupRestoreRequest restoreRequestObject) { - return operations.BeginValidateRestoreAsync(vaultName, resourceGroupName, backupInstanceName, restoreRequestObject).GetAwaiter().GetResult(); + return operations.BeginValidateForRestoreAsync(vaultName, resourceGroupName, backupInstanceName, restoreRequestObject).GetAwaiter().GetResult(); } /// @@ -795,9 +795,9 @@ public static OperationJobExtendedInfo BeginValidateRestore(this IBackupInstance /// /// The cancellation token. /// - public static async Task BeginValidateRestoreAsync(this IBackupInstancesOperations operations, string vaultName, string resourceGroupName, string backupInstanceName, AzureBackupRestoreRequest restoreRequestObject, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginValidateForRestoreAsync(this IBackupInstancesOperations operations, string vaultName, string resourceGroupName, string backupInstanceName, AzureBackupRestoreRequest restoreRequestObject, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginValidateRestoreWithHttpMessagesAsync(vaultName, resourceGroupName, backupInstanceName, restoreRequestObject, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginValidateForRestoreWithHttpMessagesAsync(vaultName, resourceGroupName, backupInstanceName, restoreRequestObject, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupPoliciesOperations.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupPoliciesOperations.cs index cab2079c5415b..f261279d84196 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupPoliciesOperations.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupPoliciesOperations.cs @@ -463,6 +463,7 @@ internal BackupPoliciesOperations(DataProtectionClient client) /// The name of the resource group where the backup vault is present. /// /// + /// Name of the policy /// /// /// Request body for operation diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupPoliciesOperationsExtensions.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupPoliciesOperationsExtensions.cs index d55ed26c73937..7046f6843383c 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupPoliciesOperationsExtensions.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupPoliciesOperationsExtensions.cs @@ -124,6 +124,7 @@ public static BaseBackupPolicyResource Get(this IBackupPoliciesOperations operat /// The name of the resource group where the backup vault is present. /// /// + /// Name of the policy /// /// /// Request body for operation @@ -146,6 +147,7 @@ public static BaseBackupPolicyResource CreateOrUpdate(this IBackupPoliciesOperat /// The name of the resource group where the backup vault is present. /// /// + /// Name of the policy /// /// /// Request body for operation diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/RecoveryPointOperations.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupVaultOperationResultsOperations.cs similarity index 84% rename from sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/RecoveryPointOperations.cs rename to sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupVaultOperationResultsOperations.cs index 5503263391d9e..a467984be25e2 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/RecoveryPointOperations.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupVaultOperationResultsOperations.cs @@ -23,12 +23,12 @@ namespace Microsoft.Azure.Management.DataProtection using System.Threading.Tasks; /// - /// RecoveryPointOperations operations. + /// BackupVaultOperationResultsOperations operations. /// - internal partial class RecoveryPointOperations : IServiceOperations, IRecoveryPointOperations + internal partial class BackupVaultOperationResultsOperations : IServiceOperations, IBackupVaultOperationResultsOperations { /// - /// Initializes a new instance of the RecoveryPointOperations class. + /// Initializes a new instance of the BackupVaultOperationResultsOperations class. /// /// /// Reference to the service client. @@ -36,7 +36,7 @@ internal partial class RecoveryPointOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal RecoveryPointOperations(DataProtectionClient client) + internal BackupVaultOperationResultsOperations(DataProtectionClient client) { if (client == null) { @@ -50,19 +50,13 @@ internal RecoveryPointOperations(DataProtectionClient client) /// public DataProtectionClient Client { get; private set; } - /// - /// Gets a Recovery Point using recoveryPointId for a Datasource. - /// /// /// The name of the backup vault. /// /// /// The name of the resource group where the backup vault is present. /// - /// - /// The name of the backup instance - /// - /// + /// /// /// /// Headers that will be added to request. @@ -85,7 +79,7 @@ internal RecoveryPointOperations(DataProtectionClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string backupInstanceName, string recoveryPointId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -103,13 +97,9 @@ internal RecoveryPointOperations(DataProtectionClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (backupInstanceName == null) + if (operationId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "backupInstanceName"); - } - if (recoveryPointId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "recoveryPointId"); + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -120,19 +110,17 @@ internal RecoveryPointOperations(DataProtectionClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("backupInstanceName", backupInstanceName); - tracingParameters.Add("recoveryPointId", recoveryPointId); + tracingParameters.Add("operationId", operationId); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/recoveryPoints/{recoveryPointId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/operationResults/{operationId}").ToString(); _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{backupInstanceName}", System.Uri.EscapeDataString(backupInstanceName)); - _url = _url.Replace("{recoveryPointId}", System.Uri.EscapeDataString(recoveryPointId)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -196,7 +184,7 @@ internal RecoveryPointOperations(DataProtectionClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -231,7 +219,7 @@ internal RecoveryPointOperations(DataProtectionClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -244,7 +232,7 @@ internal RecoveryPointOperations(DataProtectionClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -256,6 +244,19 @@ internal RecoveryPointOperations(DataProtectionClient client) throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/JobOperationsExtensions.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupVaultOperationResultsOperationsExtensions.cs similarity index 59% rename from sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/JobOperationsExtensions.cs rename to sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupVaultOperationResultsOperationsExtensions.cs index f2faadb5fc68c..4c8ef4e40199f 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/JobOperationsExtensions.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupVaultOperationResultsOperationsExtensions.cs @@ -17,53 +17,43 @@ namespace Microsoft.Azure.Management.DataProtection using System.Threading.Tasks; /// - /// Extension methods for JobOperations. + /// Extension methods for BackupVaultOperationResultsOperations. /// - public static partial class JobOperationsExtensions + public static partial class BackupVaultOperationResultsOperationsExtensions { - /// - /// Gets a job with id in a backup vault - /// /// /// The operations group for this extension method. /// - /// - /// The name of the resource group where the backup vault is present. - /// /// /// The name of the backup vault. /// - /// - /// The Job ID. This is a GUID-formatted string (e.g. - /// 00000000-0000-0000-0000-000000000000). + /// + /// The name of the resource group where the backup vault is present. + /// + /// /// - public static AzureBackupJobResource Get(this IJobOperations operations, string resourceGroupName, string vaultName, string jobId) + public static BackupVaultResource Get(this IBackupVaultOperationResultsOperations operations, string vaultName, string resourceGroupName, string operationId) { - return operations.GetAsync(resourceGroupName, vaultName, jobId).GetAwaiter().GetResult(); + return operations.GetAsync(vaultName, resourceGroupName, operationId).GetAwaiter().GetResult(); } - /// - /// Gets a job with id in a backup vault - /// /// /// The operations group for this extension method. /// - /// - /// The name of the resource group where the backup vault is present. - /// /// /// The name of the backup vault. /// - /// - /// The Job ID. This is a GUID-formatted string (e.g. - /// 00000000-0000-0000-0000-000000000000). + /// + /// The name of the resource group where the backup vault is present. + /// + /// /// /// /// The cancellation token. /// - public static async Task GetAsync(this IJobOperations operations, string resourceGroupName, string vaultName, string jobId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IBackupVaultOperationResultsOperations operations, string vaultName, string resourceGroupName, string operationId, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vaultName, jobId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, operationId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupVaultsOperations.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupVaultsOperations.cs index e9768b0e5e37c..b15138438612a 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupVaultsOperations.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupVaultsOperations.cs @@ -74,7 +74,7 @@ internal BackupVaultsOperations(DataProtectionClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetResourcesInSubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetInSubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -92,7 +92,7 @@ internal BackupVaultsOperations(DataProtectionClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetResourcesInSubscription", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInSubscription", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -255,7 +255,7 @@ internal BackupVaultsOperations(DataProtectionClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetResourcesInResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetInResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -278,7 +278,7 @@ internal BackupVaultsOperations(DataProtectionClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetResourcesInResourceGroup", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInResourceGroup", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -830,10 +830,10 @@ internal BackupVaultsOperations(DataProtectionClient client) /// /// The cancellation token. /// - public async Task> PatchWithHttpMessagesAsync(string vaultName, string resourceGroupName, PatchResourceRequestInput parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateWithHttpMessagesAsync(string vaultName, string resourceGroupName, PatchResourceRequestInput parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send Request - AzureOperationResponse _response = await BeginPatchWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -1313,7 +1313,7 @@ internal BackupVaultsOperations(DataProtectionClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginPatchWithHttpMessagesAsync(string vaultName, string resourceGroupName, PatchResourceRequestInput parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginUpdateWithHttpMessagesAsync(string vaultName, string resourceGroupName, PatchResourceRequestInput parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -1346,7 +1346,7 @@ internal BackupVaultsOperations(DataProtectionClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginPatch", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -1517,7 +1517,7 @@ internal BackupVaultsOperations(DataProtectionClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetResourcesInSubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetInSubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -1532,7 +1532,7 @@ internal BackupVaultsOperations(DataProtectionClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetResourcesInSubscriptionNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInSubscriptionNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -1690,7 +1690,7 @@ internal BackupVaultsOperations(DataProtectionClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetResourcesInResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetInResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -1705,7 +1705,7 @@ internal BackupVaultsOperations(DataProtectionClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetResourcesInResourceGroupNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInResourceGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupVaultsOperationsExtensions.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupVaultsOperationsExtensions.cs index 60b269f48c1f1..f4c6667a53505 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupVaultsOperationsExtensions.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupVaultsOperationsExtensions.cs @@ -27,9 +27,9 @@ public static partial class BackupVaultsOperationsExtensions /// /// The operations group for this extension method. /// - public static IPage GetResourcesInSubscription(this IBackupVaultsOperations operations) + public static IPage GetInSubscription(this IBackupVaultsOperations operations) { - return operations.GetResourcesInSubscriptionAsync().GetAwaiter().GetResult(); + return operations.GetInSubscriptionAsync().GetAwaiter().GetResult(); } /// @@ -41,9 +41,9 @@ public static IPage GetResourcesInSubscription(this IBackup /// /// The cancellation token. /// - public static async Task> GetResourcesInSubscriptionAsync(this IBackupVaultsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> GetInSubscriptionAsync(this IBackupVaultsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetResourcesInSubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetInSubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -58,9 +58,9 @@ public static IPage GetResourcesInSubscription(this IBackup /// /// The name of the resource group where the backup vault is present. /// - public static IPage GetResourcesInResourceGroup(this IBackupVaultsOperations operations, string resourceGroupName) + public static IPage GetInResourceGroup(this IBackupVaultsOperations operations, string resourceGroupName) { - return operations.GetResourcesInResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + return operations.GetInResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); } /// @@ -75,9 +75,9 @@ public static IPage GetResourcesInResourceGroup(this IBacku /// /// The cancellation token. /// - public static async Task> GetResourcesInResourceGroupAsync(this IBackupVaultsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> GetInResourceGroupAsync(this IBackupVaultsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetResourcesInResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetInResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -222,9 +222,9 @@ public static void Delete(this IBackupVaultsOperations operations, string vaultN /// /// Request body for operation /// - public static BackupVaultResource Patch(this IBackupVaultsOperations operations, string vaultName, string resourceGroupName, PatchResourceRequestInput parameters) + public static BackupVaultResource Update(this IBackupVaultsOperations operations, string vaultName, string resourceGroupName, PatchResourceRequestInput parameters) { - return operations.PatchAsync(vaultName, resourceGroupName, parameters).GetAwaiter().GetResult(); + return operations.UpdateAsync(vaultName, resourceGroupName, parameters).GetAwaiter().GetResult(); } /// @@ -246,9 +246,9 @@ public static BackupVaultResource Patch(this IBackupVaultsOperations operations, /// /// The cancellation token. /// - public static async Task PatchAsync(this IBackupVaultsOperations operations, string vaultName, string resourceGroupName, PatchResourceRequestInput parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdateAsync(this IBackupVaultsOperations operations, string vaultName, string resourceGroupName, PatchResourceRequestInput parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.PatchWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -362,9 +362,9 @@ public static BackupVaultResource BeginCreateOrUpdate(this IBackupVaultsOperatio /// /// Request body for operation /// - public static BackupVaultResource BeginPatch(this IBackupVaultsOperations operations, string vaultName, string resourceGroupName, PatchResourceRequestInput parameters) + public static BackupVaultResource BeginUpdate(this IBackupVaultsOperations operations, string vaultName, string resourceGroupName, PatchResourceRequestInput parameters) { - return operations.BeginPatchAsync(vaultName, resourceGroupName, parameters).GetAwaiter().GetResult(); + return operations.BeginUpdateAsync(vaultName, resourceGroupName, parameters).GetAwaiter().GetResult(); } /// @@ -386,9 +386,9 @@ public static BackupVaultResource BeginPatch(this IBackupVaultsOperations operat /// /// The cancellation token. /// - public static async Task BeginPatchAsync(this IBackupVaultsOperations operations, string vaultName, string resourceGroupName, PatchResourceRequestInput parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginUpdateAsync(this IBackupVaultsOperations operations, string vaultName, string resourceGroupName, PatchResourceRequestInput parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginPatchWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -403,9 +403,9 @@ public static BackupVaultResource BeginPatch(this IBackupVaultsOperations operat /// /// The NextLink from the previous successful call to List operation. /// - public static IPage GetResourcesInSubscriptionNext(this IBackupVaultsOperations operations, string nextPageLink) + public static IPage GetInSubscriptionNext(this IBackupVaultsOperations operations, string nextPageLink) { - return operations.GetResourcesInSubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); + return operations.GetInSubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// @@ -420,9 +420,9 @@ public static IPage GetResourcesInSubscriptionNext(this IBa /// /// The cancellation token. /// - public static async Task> GetResourcesInSubscriptionNextAsync(this IBackupVaultsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> GetInSubscriptionNextAsync(this IBackupVaultsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetResourcesInSubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetInSubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -437,9 +437,9 @@ public static IPage GetResourcesInSubscriptionNext(this IBa /// /// The NextLink from the previous successful call to List operation. /// - public static IPage GetResourcesInResourceGroupNext(this IBackupVaultsOperations operations, string nextPageLink) + public static IPage GetInResourceGroupNext(this IBackupVaultsOperations operations, string nextPageLink) { - return operations.GetResourcesInResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + return operations.GetInResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// @@ -454,9 +454,9 @@ public static IPage GetResourcesInResourceGroupNext(this IB /// /// The cancellation token. /// - public static async Task> GetResourcesInResourceGroupNextAsync(this IBackupVaultsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> GetInResourceGroupNextAsync(this IBackupVaultsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetResourcesInResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetInResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/DataProtectionClient.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/DataProtectionClient.cs index a82e959b23f54..0f28d046a47c1 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/DataProtectionClient.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/DataProtectionClient.cs @@ -20,8 +20,6 @@ namespace Microsoft.Azure.Management.DataProtection using System.Linq; using System.Net; using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// Open API 2.0 Specs for Azure Data Protection service @@ -87,9 +85,24 @@ public partial class DataProtectionClient : ServiceClient, public virtual IOperationResultOperations OperationResult { get; private set; } /// - /// Gets the IOperations. + /// Gets the IOperationStatusOperations. /// - public virtual IOperations Operations { get; private set; } + public virtual IOperationStatusOperations OperationStatus { get; private set; } + + /// + /// Gets the IBackupVaultOperationResultsOperations. + /// + public virtual IBackupVaultOperationResultsOperations BackupVaultOperationResults { get; private set; } + + /// + /// Gets the IDataProtectionOperations. + /// + public virtual IDataProtectionOperations DataProtection { get; private set; } + + /// + /// Gets the IDataProtectionOperationsOperations. + /// + public virtual IDataProtectionOperationsOperations DataProtectionOperations { get; private set; } /// /// Gets the IBackupPoliciesOperations. @@ -106,25 +119,15 @@ public partial class DataProtectionClient : ServiceClient, /// public virtual IRecoveryPointsOperations RecoveryPoints { get; private set; } - /// - /// Gets the IRecoveryPointOperations. - /// - public virtual IRecoveryPointOperations RecoveryPoint { get; private set; } - /// /// Gets the IJobsOperations. /// public virtual IJobsOperations Jobs { get; private set; } /// - /// Gets the IFindRestorableTimeRangesOperations. - /// - public virtual IFindRestorableTimeRangesOperations FindRestorableTimeRanges { get; private set; } - - /// - /// Gets the IJobOperations. + /// Gets the IRestorableTimeRangesOperations. /// - public virtual IJobOperations Job { get; private set; } + public virtual IRestorableTimeRangesOperations RestorableTimeRanges { get; private set; } /// /// Gets the IExportJobsOperations. @@ -136,6 +139,11 @@ public partial class DataProtectionClient : ServiceClient, /// public virtual IExportJobsOperationResultOperations ExportJobsOperationResult { get; private set; } + /// + /// Gets the IResourceGuardsOperations. + /// + public virtual IResourceGuardsOperations ResourceGuards { get; private set; } + /// /// Initializes a new instance of the DataProtectionClient class. /// @@ -379,18 +387,20 @@ private void Initialize() { BackupVaults = new BackupVaultsOperations(this); OperationResult = new OperationResultOperations(this); - Operations = new Operations(this); + OperationStatus = new OperationStatusOperations(this); + BackupVaultOperationResults = new BackupVaultOperationResultsOperations(this); + DataProtection = new DataProtectionOperations(this); + DataProtectionOperations = new DataProtectionOperationsOperations(this); BackupPolicies = new BackupPoliciesOperations(this); BackupInstances = new BackupInstancesOperations(this); RecoveryPoints = new RecoveryPointsOperations(this); - RecoveryPoint = new RecoveryPointOperations(this); Jobs = new JobsOperations(this); - FindRestorableTimeRanges = new FindRestorableTimeRangesOperations(this); - Job = new JobOperations(this); + RestorableTimeRanges = new RestorableTimeRangesOperations(this); ExportJobs = new ExportJobsOperations(this); ExportJobsOperationResult = new ExportJobsOperationResultOperations(this); + ResourceGuards = new ResourceGuardsOperations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2021-01-01"; + ApiVersion = "2021-07-01"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; @@ -419,6 +429,8 @@ private void Initialize() new Iso8601TimeSpanConverter() } }; + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("objectType")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("objectType")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("objectType")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("objectType")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("objectType")); @@ -447,603 +459,10 @@ private void Initialize() DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("objectType")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("objectType")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("objectType")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("objectType")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("objectType")); CustomInitialize(); DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); } - /// - /// Gets the operation status for a resource. - /// - /// - /// - /// - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> GetOperationStatusWithHttpMessagesAsync(string location, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); - } - if (SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); - } - if (location == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); - } - if (operationId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("location", location); - tracingParameters.Add("operationId", operationId); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetOperationStatus", tracingParameters); - } - // Construct URL - var _baseUrl = BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DataProtection/locations/{location}/operationStatus/{operationId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); - _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); - _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); - List _queryParameters = new List(); - if (ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (GenerateClientRequestId != null && GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", 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 (Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// The name of the backup vault. - /// - /// - /// The name of the resource group where the backup vault is present. - /// - /// - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> GetOperationResultPatchWithHttpMessagesAsync(string vaultName, string resourceGroupName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); - } - if (vaultName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); - } - if (operationId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("vaultName", vaultName); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("operationId", operationId); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetOperationResultPatch", tracingParameters); - } - // Construct URL - var _baseUrl = BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/operationResults/{operationId}").ToString(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); - _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); - List _queryParameters = new List(); - if (ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (GenerateClientRequestId != null && GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", 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 (Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Validates if a feature is supported - /// - /// - /// - /// - /// Feature support request object - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> CheckFeatureSupportWithHttpMessagesAsync(string location, FeatureValidationRequestBase parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); - } - if (SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); - } - if (location == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("location", location); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CheckFeatureSupport", tracingParameters); - } - // Construct URL - var _baseUrl = BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DataProtection/locations/{location}/checkFeatureSupport").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); - _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); - List _queryParameters = new List(); - if (ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (GenerateClientRequestId != null && GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", 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 = SafeJsonConvert.SerializeObject(parameters, SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - } } diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/DataProtectionClientExtensions.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/DataProtectionClientExtensions.cs deleted file mode 100644 index ac4e7abcc0d38..0000000000000 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/DataProtectionClientExtensions.cs +++ /dev/null @@ -1,137 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.DataProtection -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for DataProtectionClient. - /// - public static partial class DataProtectionClientExtensions - { - /// - /// Gets the operation status for a resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// - /// - /// - public static OperationResource GetOperationStatus(this IDataProtectionClient operations, string location, string operationId) - { - return operations.GetOperationStatusAsync(location, operationId).GetAwaiter().GetResult(); - } - - /// - /// Gets the operation status for a resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// - /// - /// - /// - /// The cancellation token. - /// - public static async Task GetOperationStatusAsync(this IDataProtectionClient operations, string location, string operationId, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetOperationStatusWithHttpMessagesAsync(location, operationId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// The operations group for this extension method. - /// - /// - /// The name of the backup vault. - /// - /// - /// The name of the resource group where the backup vault is present. - /// - /// - /// - public static BackupVaultResource GetOperationResultPatch(this IDataProtectionClient operations, string vaultName, string resourceGroupName, string operationId) - { - return operations.GetOperationResultPatchAsync(vaultName, resourceGroupName, operationId).GetAwaiter().GetResult(); - } - - /// - /// The operations group for this extension method. - /// - /// - /// The name of the backup vault. - /// - /// - /// The name of the resource group where the backup vault is present. - /// - /// - /// - /// - /// The cancellation token. - /// - public static async Task GetOperationResultPatchAsync(this IDataProtectionClient operations, string vaultName, string resourceGroupName, string operationId, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetOperationResultPatchWithHttpMessagesAsync(vaultName, resourceGroupName, operationId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Validates if a feature is supported - /// - /// - /// The operations group for this extension method. - /// - /// - /// - /// - /// Feature support request object - /// - public static FeatureValidationResponseBase CheckFeatureSupport(this IDataProtectionClient operations, string location, FeatureValidationRequestBase parameters) - { - return operations.CheckFeatureSupportAsync(location, parameters).GetAwaiter().GetResult(); - } - - /// - /// Validates if a feature is supported - /// - /// - /// The operations group for this extension method. - /// - /// - /// - /// - /// Feature support request object - /// - /// - /// The cancellation token. - /// - public static async Task CheckFeatureSupportAsync(this IDataProtectionClient operations, string location, FeatureValidationRequestBase parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CheckFeatureSupportWithHttpMessagesAsync(location, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/DataProtectionOperations.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/DataProtectionOperations.cs new file mode 100644 index 0000000000000..f1bf432b5f204 --- /dev/null +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/DataProtectionOperations.cs @@ -0,0 +1,254 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataProtection +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// DataProtectionOperations operations. + /// + internal partial class DataProtectionOperations : IServiceOperations, IDataProtectionOperations + { + /// + /// Initializes a new instance of the DataProtectionOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal DataProtectionOperations(DataProtectionClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the DataProtectionClient + /// + public DataProtectionClient Client { get; private set; } + + /// + /// Validates if a feature is supported + /// + /// + /// + /// + /// Feature support request object + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> CheckFeatureSupportWithHttpMessagesAsync(string location, FeatureValidationRequestBase parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "location"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("location", location); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CheckFeatureSupport", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DataProtection/locations/{location}/checkFeatureSupport").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/DataProtectionOperationsExtensions.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/DataProtectionOperationsExtensions.cs new file mode 100644 index 0000000000000..adc84f8e60795 --- /dev/null +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/DataProtectionOperationsExtensions.cs @@ -0,0 +1,63 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataProtection +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for DataProtectionOperations. + /// + public static partial class DataProtectionOperationsExtensions + { + /// + /// Validates if a feature is supported + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// Feature support request object + /// + public static FeatureValidationResponseBase CheckFeatureSupport(this IDataProtectionOperations operations, string location, FeatureValidationRequestBase parameters) + { + return operations.CheckFeatureSupportAsync(location, parameters).GetAwaiter().GetResult(); + } + + /// + /// Validates if a feature is supported + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// Feature support request object + /// + /// + /// The cancellation token. + /// + public static async Task CheckFeatureSupportAsync(this IDataProtectionOperations operations, string location, FeatureValidationRequestBase parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CheckFeatureSupportWithHttpMessagesAsync(location, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Operations.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/DataProtectionOperationsOperations.cs similarity index 97% rename from sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Operations.cs rename to sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/DataProtectionOperationsOperations.cs index d03fb04abcdcf..b2ac1ee668ee0 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Operations.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/DataProtectionOperationsOperations.cs @@ -23,12 +23,12 @@ namespace Microsoft.Azure.Management.DataProtection using System.Threading.Tasks; /// - /// Operations operations. + /// DataProtectionOperationsOperations operations. /// - internal partial class Operations : IServiceOperations, IOperations + internal partial class DataProtectionOperationsOperations : IServiceOperations, IDataProtectionOperationsOperations { /// - /// Initializes a new instance of the Operations class. + /// Initializes a new instance of the DataProtectionOperationsOperations class. /// /// /// Reference to the service client. @@ -36,7 +36,7 @@ internal partial class Operations : IServiceOperations, IO /// /// Thrown when a required parameter is null /// - internal Operations(DataProtectionClient client) + internal DataProtectionOperationsOperations(DataProtectionClient client) { if (client == null) { diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/OperationsExtensions.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/DataProtectionOperationsOperationsExtensions.cs similarity index 83% rename from sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/OperationsExtensions.cs rename to sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/DataProtectionOperationsOperationsExtensions.cs index d58f9b4ef7903..dac3df49f939f 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/OperationsExtensions.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/DataProtectionOperationsOperationsExtensions.cs @@ -17,9 +17,9 @@ namespace Microsoft.Azure.Management.DataProtection using System.Threading.Tasks; /// - /// Extension methods for Operations. + /// Extension methods for DataProtectionOperationsOperations. /// - public static partial class OperationsExtensions + public static partial class DataProtectionOperationsOperationsExtensions { /// /// Returns the list of available operations. @@ -27,7 +27,7 @@ public static partial class OperationsExtensions /// /// The operations group for this extension method. /// - public static IPage List(this IOperations operations) + public static IPage List(this IDataProtectionOperationsOperations operations) { return operations.ListAsync().GetAwaiter().GetResult(); } @@ -41,7 +41,7 @@ public static IPage List(this IOperations oper /// /// The cancellation token. /// - public static async Task> ListAsync(this IOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this IDataProtectionOperationsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { @@ -58,7 +58,7 @@ public static IPage List(this IOperations oper /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListNext(this IOperations operations, string nextPageLink) + public static IPage ListNext(this IDataProtectionOperationsOperations operations, string nextPageLink) { return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); } @@ -75,7 +75,7 @@ public static IPage ListNext(this IOperations /// /// The cancellation token. /// - public static async Task> ListNextAsync(this IOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListNextAsync(this IDataProtectionOperationsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IBackupInstancesOperations.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IBackupInstancesOperations.cs index 3fe682fc7c272..f434be5b79e1e 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IBackupInstancesOperations.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IBackupInstancesOperations.cs @@ -279,7 +279,7 @@ public partial interface IBackupInstancesOperations /// /// Thrown when a required parameter is null /// - Task> ValidateRestoreWithHttpMessagesAsync(string vaultName, string resourceGroupName, string backupInstanceName, AzureBackupRestoreRequest restoreRequestObject, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ValidateForRestoreWithHttpMessagesAsync(string vaultName, string resourceGroupName, string backupInstanceName, AzureBackupRestoreRequest restoreRequestObject, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Create or update a backup instance in a backup vault /// @@ -483,7 +483,7 @@ public partial interface IBackupInstancesOperations /// /// Thrown when a required parameter is null /// - Task> BeginValidateRestoreWithHttpMessagesAsync(string vaultName, string resourceGroupName, string backupInstanceName, AzureBackupRestoreRequest restoreRequestObject, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginValidateForRestoreWithHttpMessagesAsync(string vaultName, string resourceGroupName, string backupInstanceName, AzureBackupRestoreRequest restoreRequestObject, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets a backup instances belonging to a backup vault /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IBackupPoliciesOperations.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IBackupPoliciesOperations.cs index 5be8de5bd0f54..df8957ca3e52b 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IBackupPoliciesOperations.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IBackupPoliciesOperations.cs @@ -88,6 +88,7 @@ public partial interface IBackupPoliciesOperations /// The name of the resource group where the backup vault is present. /// /// + /// Name of the policy /// /// /// Request body for operation diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IJobOperations.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IBackupVaultOperationResultsOperations.cs similarity index 73% rename from sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IJobOperations.cs rename to sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IBackupVaultOperationResultsOperations.cs index 7eda13ba0d92f..b6af7d56d19f3 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IJobOperations.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IBackupVaultOperationResultsOperations.cs @@ -19,22 +19,17 @@ namespace Microsoft.Azure.Management.DataProtection using System.Threading.Tasks; /// - /// JobOperations operations. + /// BackupVaultOperationResultsOperations operations. /// - public partial interface IJobOperations + public partial interface IBackupVaultOperationResultsOperations { - /// - /// Gets a job with id in a backup vault - /// - /// - /// The name of the resource group where the backup vault is present. - /// /// /// The name of the backup vault. /// - /// - /// The Job ID. This is a GUID-formatted string (e.g. - /// 00000000-0000-0000-0000-000000000000). + /// + /// The name of the resource group where the backup vault is present. + /// + /// /// /// /// The headers that will be added to request. @@ -51,6 +46,6 @@ public partial interface IJobOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, string jobId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IBackupVaultsOperations.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IBackupVaultsOperations.cs index 527a9027c8d39..91cf4a56e14b1 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IBackupVaultsOperations.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IBackupVaultsOperations.cs @@ -41,7 +41,7 @@ public partial interface IBackupVaultsOperations /// /// Thrown when a required parameter is null /// - Task>> GetResourcesInSubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> GetInSubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Returns resource collection belonging to a resource group. /// @@ -63,7 +63,7 @@ public partial interface IBackupVaultsOperations /// /// Thrown when a required parameter is null /// - Task>> GetResourcesInResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> GetInResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Returns a resource belonging to a resource group. /// @@ -168,7 +168,7 @@ public partial interface IBackupVaultsOperations /// /// Thrown when a required parameter is null /// - Task> PatchWithHttpMessagesAsync(string vaultName, string resourceGroupName, PatchResourceRequestInput parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateWithHttpMessagesAsync(string vaultName, string resourceGroupName, PatchResourceRequestInput parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// API to check for resource name availability /// @@ -254,7 +254,7 @@ public partial interface IBackupVaultsOperations /// /// Thrown when a required parameter is null /// - Task> BeginPatchWithHttpMessagesAsync(string vaultName, string resourceGroupName, PatchResourceRequestInput parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginUpdateWithHttpMessagesAsync(string vaultName, string resourceGroupName, PatchResourceRequestInput parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Returns resource collection belonging to a subscription. /// @@ -276,7 +276,7 @@ public partial interface IBackupVaultsOperations /// /// Thrown when a required parameter is null /// - Task>> GetResourcesInSubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> GetInSubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Returns resource collection belonging to a resource group. /// @@ -298,6 +298,6 @@ public partial interface IBackupVaultsOperations /// /// Thrown when a required parameter is null /// - Task>> GetResourcesInResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> GetInResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IDataProtectionClient.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IDataProtectionClient.cs index f14fca4980d92..2e77377ff7c79 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IDataProtectionClient.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IDataProtectionClient.cs @@ -14,10 +14,6 @@ namespace Microsoft.Azure.Management.DataProtection using Microsoft.Rest.Azure; using Models; using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// Open API 2.0 Specs for Azure Data Protection service @@ -84,9 +80,24 @@ public partial interface IDataProtectionClient : System.IDisposable IOperationResultOperations OperationResult { get; } /// - /// Gets the IOperations. + /// Gets the IOperationStatusOperations. /// - IOperations Operations { get; } + IOperationStatusOperations OperationStatus { get; } + + /// + /// Gets the IBackupVaultOperationResultsOperations. + /// + IBackupVaultOperationResultsOperations BackupVaultOperationResults { get; } + + /// + /// Gets the IDataProtectionOperations. + /// + IDataProtectionOperations DataProtection { get; } + + /// + /// Gets the IDataProtectionOperationsOperations. + /// + IDataProtectionOperationsOperations DataProtectionOperations { get; } /// /// Gets the IBackupPoliciesOperations. @@ -103,25 +114,15 @@ public partial interface IDataProtectionClient : System.IDisposable /// IRecoveryPointsOperations RecoveryPoints { get; } - /// - /// Gets the IRecoveryPointOperations. - /// - IRecoveryPointOperations RecoveryPoint { get; } - /// /// Gets the IJobsOperations. /// IJobsOperations Jobs { get; } /// - /// Gets the IFindRestorableTimeRangesOperations. + /// Gets the IRestorableTimeRangesOperations. /// - IFindRestorableTimeRangesOperations FindRestorableTimeRanges { get; } - - /// - /// Gets the IJobOperations. - /// - IJobOperations Job { get; } + IRestorableTimeRangesOperations RestorableTimeRanges { get; } /// /// Gets the IExportJobsOperations. @@ -134,51 +135,9 @@ public partial interface IDataProtectionClient : System.IDisposable IExportJobsOperationResultOperations ExportJobsOperationResult { get; } /// - /// Gets the operation status for a resource. - /// - /// - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - Task> GetOperationStatusWithHttpMessagesAsync(string location, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// The name of the backup vault. - /// - /// - /// The name of the resource group where the backup vault is present. - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - Task> GetOperationResultPatchWithHttpMessagesAsync(string vaultName, string resourceGroupName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Validates if a feature is supported - /// - /// - /// - /// - /// Feature support request object - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - Task> CheckFeatureSupportWithHttpMessagesAsync(string location, FeatureValidationRequestBase parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// Gets the IResourceGuardsOperations. + /// + IResourceGuardsOperations ResourceGuards { get; } } } diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IRecoveryPointOperations.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IDataProtectionOperations.cs similarity index 62% rename from sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IRecoveryPointOperations.cs rename to sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IDataProtectionOperations.cs index 8709cd2687abc..ee73d59aba452 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IRecoveryPointOperations.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IDataProtectionOperations.cs @@ -19,23 +19,17 @@ namespace Microsoft.Azure.Management.DataProtection using System.Threading.Tasks; /// - /// RecoveryPointOperations operations. + /// DataProtectionOperations operations. /// - public partial interface IRecoveryPointOperations + public partial interface IDataProtectionOperations { /// - /// Gets a Recovery Point using recoveryPointId for a Datasource. + /// Validates if a feature is supported /// - /// - /// The name of the backup vault. + /// /// - /// - /// The name of the resource group where the backup vault is present. - /// - /// - /// The name of the backup instance - /// - /// + /// + /// Feature support request object /// /// /// The headers that will be added to request. @@ -52,6 +46,6 @@ public partial interface IRecoveryPointOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string backupInstanceName, string recoveryPointId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CheckFeatureSupportWithHttpMessagesAsync(string location, FeatureValidationRequestBase parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IOperations.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IDataProtectionOperationsOperations.cs similarity index 95% rename from sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IOperations.cs rename to sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IDataProtectionOperationsOperations.cs index dfc6a2ed33c80..fff09d93866e0 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IOperations.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IDataProtectionOperationsOperations.cs @@ -19,9 +19,9 @@ namespace Microsoft.Azure.Management.DataProtection using System.Threading.Tasks; /// - /// Operations operations. + /// DataProtectionOperationsOperations operations. /// - public partial interface IOperations + public partial interface IDataProtectionOperationsOperations { /// /// Returns the list of available operations. diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IJobsOperations.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IJobsOperations.cs index 934b1eee274a6..3352c7bcbc4f4 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IJobsOperations.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IJobsOperations.cs @@ -49,6 +49,35 @@ public partial interface IJobsOperations /// Task>> ListWithHttpMessagesAsync(string resourceGroupName, string vaultName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Gets a job with id in a backup vault + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// The name of the backup vault. + /// + /// + /// The Job ID. This is a GUID-formatted string (e.g. + /// 00000000-0000-0000-0000-000000000000). + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, string jobId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Returns list of jobs belonging to a backup vault /// /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IOperationStatusOperations.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IOperationStatusOperations.cs new file mode 100644 index 0000000000000..db7168d01c795 --- /dev/null +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IOperationStatusOperations.cs @@ -0,0 +1,50 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataProtection +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// OperationStatusOperations operations. + /// + public partial interface IOperationStatusOperations + { + /// + /// Gets the operation status for a resource. + /// + /// + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string location, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IRecoveryPointsOperations.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IRecoveryPointsOperations.cs index 6809bf1b3c0f0..795eb564e7921 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IRecoveryPointsOperations.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IRecoveryPointsOperations.cs @@ -57,7 +57,37 @@ public partial interface IRecoveryPointsOperations /// /// Thrown when a required parameter is null /// - Task>> GetListWithHttpMessagesAsync(string vaultName, string resourceGroupName, string backupInstanceName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, string backupInstanceName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a Recovery Point using recoveryPointId for a Datasource. + /// + /// + /// The name of the backup vault. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// The name of the backup instance + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string backupInstanceName, string recoveryPointId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Returns a list of Recovery Points for a DataSource in a vault. /// @@ -79,6 +109,6 @@ public partial interface IRecoveryPointsOperations /// /// Thrown when a required parameter is null /// - Task>> GetListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IResourceGuardsOperations.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IResourceGuardsOperations.cs new file mode 100644 index 0000000000000..5c2332d53b493 --- /dev/null +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IResourceGuardsOperations.cs @@ -0,0 +1,667 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataProtection +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ResourceGuardsOperations operations. + /// + public partial interface IResourceGuardsOperations + { + /// + /// Returns ResourceGuards collection belonging to a subscription. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetResourcesInSubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Returns ResourceGuards collection belonging to a ResourceGroup. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetResourcesInResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a ResourceGuard resource belonging to a resource + /// group. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// The name of ResourceGuard + /// + /// + /// Request body for operation + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> PutWithHttpMessagesAsync(string resourceGroupName, string resourceGuardsName, ResourceGuardResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Returns a ResourceGuard belonging to a resource group. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// The name of ResourceGuard + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string resourceGuardsName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a ResourceGuard resource from the resource group. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// The name of ResourceGuard + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string resourceGuardsName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates a ResourceGuard resource belonging to a resource group. For + /// example, updating tags for a resource. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// The name of ResourceGuard + /// + /// + /// Request body for operation + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> PatchWithHttpMessagesAsync(string resourceGroupName, string resourceGuardsName, PatchResourceRequestInput parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Returns collection of operation request objects for a critical + /// operation protected by the given ResourceGuard resource. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetDisableSoftDeleteRequestsObjectsWithHttpMessagesAsync(string resourceGroupName, string resourceGuardsName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Returns collection of operation request objects for a critical + /// operation protected by the given ResourceGuard resource. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetDeleteResourceGuardProxyRequestsObjectsWithHttpMessagesAsync(string resourceGroupName, string resourceGuardsName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Returns collection of operation request objects for a critical + /// operation protected by the given ResourceGuard resource. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetBackupSecurityPINRequestsObjectsWithHttpMessagesAsync(string resourceGroupName, string resourceGuardsName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Returns collection of operation request objects for a critical + /// operation protected by the given ResourceGuard resource. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetDeleteProtectedItemRequestsObjectsWithHttpMessagesAsync(string resourceGroupName, string resourceGuardsName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Returns collection of operation request objects for a critical + /// operation protected by the given ResourceGuard resource. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetUpdateProtectionPolicyRequestsObjectsWithHttpMessagesAsync(string resourceGroupName, string resourceGuardsName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Returns collection of operation request objects for a critical + /// operation protected by the given ResourceGuard resource. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetUpdateProtectedItemRequestsObjectsWithHttpMessagesAsync(string resourceGroupName, string resourceGuardsName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Returns collection of operation request objects for a critical + /// operation protected by the given ResourceGuard resource. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetDefaultDisableSoftDeleteRequestsObjectWithHttpMessagesAsync(string resourceGroupName, string resourceGuardsName, string requestName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Returns collection of operation request objects for a critical + /// operation protected by the given ResourceGuard resource. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetDefaultDeleteResourceGuardProxyRequestsObjectWithHttpMessagesAsync(string resourceGroupName, string resourceGuardsName, string requestName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Returns collection of operation request objects for a critical + /// operation protected by the given ResourceGuard resource. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetDefaultBackupSecurityPINRequestsObjectWithHttpMessagesAsync(string resourceGroupName, string resourceGuardsName, string requestName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Returns collection of operation request objects for a critical + /// operation protected by the given ResourceGuard resource. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetDefaultDeleteProtectedItemRequestsObjectWithHttpMessagesAsync(string resourceGroupName, string resourceGuardsName, string requestName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Returns collection of operation request objects for a critical + /// operation protected by the given ResourceGuard resource. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetDefaultUpdateProtectionPolicyRequestsObjectWithHttpMessagesAsync(string resourceGroupName, string resourceGuardsName, string requestName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Returns collection of operation request objects for a critical + /// operation protected by the given ResourceGuard resource. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetDefaultUpdateProtectedItemRequestsObjectWithHttpMessagesAsync(string resourceGroupName, string resourceGuardsName, string requestName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Returns ResourceGuards collection belonging to a subscription. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetResourcesInSubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Returns ResourceGuards collection belonging to a ResourceGroup. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetResourcesInResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Returns collection of operation request objects for a critical + /// operation protected by the given ResourceGuard resource. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetDisableSoftDeleteRequestsObjectsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Returns collection of operation request objects for a critical + /// operation protected by the given ResourceGuard resource. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetDeleteResourceGuardProxyRequestsObjectsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Returns collection of operation request objects for a critical + /// operation protected by the given ResourceGuard resource. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetBackupSecurityPINRequestsObjectsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Returns collection of operation request objects for a critical + /// operation protected by the given ResourceGuard resource. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetDeleteProtectedItemRequestsObjectsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Returns collection of operation request objects for a critical + /// operation protected by the given ResourceGuard resource. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetUpdateProtectionPolicyRequestsObjectsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Returns collection of operation request objects for a critical + /// operation protected by the given ResourceGuard resource. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetUpdateProtectedItemRequestsObjectsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IFindRestorableTimeRangesOperations.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IRestorableTimeRangesOperations.cs similarity index 77% rename from sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IFindRestorableTimeRangesOperations.cs rename to sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IRestorableTimeRangesOperations.cs index 8e6b13a111b7a..86522466f5bf9 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IFindRestorableTimeRangesOperations.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IRestorableTimeRangesOperations.cs @@ -19,9 +19,9 @@ namespace Microsoft.Azure.Management.DataProtection using System.Threading.Tasks; /// - /// FindRestorableTimeRangesOperations operations. + /// RestorableTimeRangesOperations operations. /// - public partial interface IFindRestorableTimeRangesOperations + public partial interface IRestorableTimeRangesOperations { /// /// The name of the backup vault. @@ -29,7 +29,8 @@ public partial interface IFindRestorableTimeRangesOperations /// /// The name of the resource group where the backup vault is present. /// - /// + /// + /// The name of the backup instance /// /// /// Request body for operation @@ -49,6 +50,6 @@ public partial interface IFindRestorableTimeRangesOperations /// /// Thrown when a required parameter is null /// - Task> PostWithHttpMessagesAsync(string vaultName, string resourceGroupName, string backupInstances, AzureBackupFindRestorableTimeRangesRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> FindWithHttpMessagesAsync(string vaultName, string resourceGroupName, string backupInstanceName, AzureBackupFindRestorableTimeRangesRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/JobsOperations.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/JobsOperations.cs index 289fbd1f6bdb9..2b26450c2f50c 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/JobsOperations.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/JobsOperations.cs @@ -246,6 +246,212 @@ internal JobsOperations(DataProtectionClient client) return _result; } + /// + /// Gets a job with id in a backup vault + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// The name of the backup vault. + /// + /// + /// The Job ID. This is a GUID-formatted string (e.g. + /// 00000000-0000-0000-0000-000000000000). + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, string jobId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (jobId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "jobId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("jobId", jobId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupJobs/{jobId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{jobId}", System.Uri.EscapeDataString(jobId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + /// /// Returns list of jobs belonging to a backup vault /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/JobsOperationsExtensions.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/JobsOperationsExtensions.cs index bbee7362fa3d9..c4e6755375436 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/JobsOperationsExtensions.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/JobsOperationsExtensions.cs @@ -61,6 +61,54 @@ public static IPage List(this IJobsOperations operations } } + /// + /// Gets a job with id in a backup vault + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// The name of the backup vault. + /// + /// + /// The Job ID. This is a GUID-formatted string (e.g. + /// 00000000-0000-0000-0000-000000000000). + /// + public static AzureBackupJobResource Get(this IJobsOperations operations, string resourceGroupName, string vaultName, string jobId) + { + return operations.GetAsync(resourceGroupName, vaultName, jobId).GetAwaiter().GetResult(); + } + + /// + /// Gets a job with id in a backup vault + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// The name of the backup vault. + /// + /// + /// The Job ID. This is a GUID-formatted string (e.g. + /// 00000000-0000-0000-0000-000000000000). + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IJobsOperations operations, string resourceGroupName, string vaultName, string jobId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vaultName, jobId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Returns list of jobs belonging to a backup vault /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AbsoluteDeleteOption.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AbsoluteDeleteOption.cs index b9449c574b3ce..bdeef3022b874 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AbsoluteDeleteOption.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AbsoluteDeleteOption.cs @@ -10,7 +10,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +18,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Delete option with duration /// - [Newtonsoft.Json.JsonObject("AbsoluteDeleteOption")] public partial class AbsoluteDeleteOption : DeleteOption { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AdhocBasedTriggerContext.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AdhocBasedTriggerContext.cs index 2610f931230e2..34b57086ea748 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AdhocBasedTriggerContext.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AdhocBasedTriggerContext.cs @@ -20,7 +20,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Adhoc trigger context /// - [Newtonsoft.Json.JsonObject("AdhocBasedTriggerContext")] public partial class AdhocBasedTriggerContext : TriggerContext { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AuthCredentials.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AuthCredentials.cs new file mode 100644 index 0000000000000..138f1e233466c --- /dev/null +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AuthCredentials.cs @@ -0,0 +1,35 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataProtection.Models +{ + using System.Linq; + + /// + /// Base class for different types of authentication credentials. + /// + public partial class AuthCredentials + { + /// + /// Initializes a new instance of the AuthCredentials class. + /// + public AuthCredentials() + { + CustomInit(); + } + + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupDiscreteRecoveryPoint.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupDiscreteRecoveryPoint.cs index e10e676eb6a77..d66d2250627ab 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupDiscreteRecoveryPoint.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupDiscreteRecoveryPoint.cs @@ -21,7 +21,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Azure backup discrete RecoveryPoint /// - [Newtonsoft.Json.JsonObject("AzureBackupDiscreteRecoveryPoint")] public partial class AzureBackupDiscreteRecoveryPoint : AzureBackupRecoveryPoint { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupFindRestorableTimeRangesRequest.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupFindRestorableTimeRangesRequest.cs index 8cb683fc578a5..986233b5ec263 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupFindRestorableTimeRangesRequest.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupFindRestorableTimeRangesRequest.cs @@ -36,10 +36,10 @@ public AzureBackupFindRestorableTimeRangesRequest() /// source data store. Possible values include: 'OperationalStore', /// 'VaultStore', 'ArchiveStore' /// Start time for the List Restore Ranges - /// request - /// End time for the List Restore Ranges - /// request - public AzureBackupFindRestorableTimeRangesRequest(string sourceDataStoreType, string startTime, string endTime) + /// request. ISO 8601 format. + /// End time for the List Restore Ranges request. + /// ISO 8601 format. + public AzureBackupFindRestorableTimeRangesRequest(string sourceDataStoreType, string startTime = default(string), string endTime = default(string)) { SourceDataStoreType = sourceDataStoreType; StartTime = startTime; @@ -60,13 +60,15 @@ public AzureBackupFindRestorableTimeRangesRequest(string sourceDataStoreType, st public string SourceDataStoreType { get; set; } /// - /// Gets or sets start time for the List Restore Ranges request + /// Gets or sets start time for the List Restore Ranges request. ISO + /// 8601 format. /// [JsonProperty(PropertyName = "startTime")] public string StartTime { get; set; } /// - /// Gets or sets end time for the List Restore Ranges request + /// Gets or sets end time for the List Restore Ranges request. ISO 8601 + /// format. /// [JsonProperty(PropertyName = "endTime")] public string EndTime { get; set; } @@ -83,14 +85,6 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.CannotBeNull, "SourceDataStoreType"); } - if (StartTime == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "StartTime"); - } - if (EndTime == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "EndTime"); - } } } } diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupJob.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupJob.cs index c56036fb32082..20c28eceb67d8 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupJob.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupJob.cs @@ -39,8 +39,6 @@ public AzureBackupJob() /// Location of the DataSource /// User Friendly Name of the /// DataSource - /// Data Source Set Name of the - /// DataSource /// Type of DataSource /// Indicated that whether the job is /// adhoc(true) or scheduled(false) @@ -64,6 +62,8 @@ public AzureBackupJob() /// Name of the vault /// ARM ID of the Backup /// Instance + /// Data Source Set Name of the + /// DataSource /// Total run time of the job. ISO 8601 /// format. /// EndTime of the job(in UTC) @@ -76,7 +76,7 @@ public AzureBackupJob() /// Url which contains job's progress /// It indicates the sub type of operation /// i.e. in case of Restore it can be ALR/OLR - public AzureBackupJob(string activityID, string backupInstanceFriendlyName, string dataSourceId, string dataSourceLocation, string dataSourceName, string dataSourceSetName, string dataSourceType, bool isUserTriggered, string operation, string operationCategory, bool progressEnabled, string sourceResourceGroup, string sourceSubscriptionID, System.DateTime startTime, string status, string subscriptionId, IList supportedActions, string vaultName, string backupInstanceId = default(string), string duration = default(string), System.DateTime? endTime = default(System.DateTime?), IList errorDetails = default(IList), JobExtendedInfo extendedInfo = default(JobExtendedInfo), string policyId = default(string), string policyName = default(string), string progressUrl = default(string), string restoreType = default(string), string etag = default(string), string sourceDataStoreName = default(string), string destinationDataStoreName = default(string)) + public AzureBackupJob(string activityID, string backupInstanceFriendlyName, string dataSourceId, string dataSourceLocation, string dataSourceName, string dataSourceType, bool isUserTriggered, string operation, string operationCategory, bool progressEnabled, string sourceResourceGroup, string sourceSubscriptionID, System.DateTime startTime, string status, string subscriptionId, IList supportedActions, string vaultName, string backupInstanceId = default(string), string dataSourceSetName = default(string), string duration = default(string), System.DateTime? endTime = default(System.DateTime?), IList errorDetails = default(IList), JobExtendedInfo extendedInfo = default(JobExtendedInfo), string policyId = default(string), string policyName = default(string), string progressUrl = default(string), string restoreType = default(string), string etag = default(string), string sourceDataStoreName = default(string), string destinationDataStoreName = default(string)) { ActivityID = activityID; BackupInstanceFriendlyName = backupInstanceFriendlyName; @@ -327,10 +327,6 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.CannotBeNull, "DataSourceName"); } - if (DataSourceSetName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "DataSourceSetName"); - } if (DataSourceType == null) { throw new ValidationException(ValidationRules.CannotBeNull, "DataSourceType"); diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupParams.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupParams.cs index 05f9e5052d31f..df49dcb4d65a0 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupParams.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupParams.cs @@ -20,7 +20,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Azure backup parameters /// - [Newtonsoft.Json.JsonObject("AzureBackupParams")] public partial class AzureBackupParams : BackupParameters { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupRecoveryPoint.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupRecoveryPoint.cs index b645088534477..afecf4f87e8d8 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupRecoveryPoint.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupRecoveryPoint.cs @@ -10,7 +10,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +18,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Azure backup recoveryPoint /// - [Newtonsoft.Json.JsonObject("AzureBackupRecoveryPoint")] public partial class AzureBackupRecoveryPoint { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupRecoveryPointBasedRestoreRequest.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupRecoveryPointBasedRestoreRequest.cs index 7b34466b12a80..35b08d7f53bef 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupRecoveryPointBasedRestoreRequest.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupRecoveryPointBasedRestoreRequest.cs @@ -20,7 +20,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Azure backup recoveryPoint based restore request /// - [Newtonsoft.Json.JsonObject("AzureBackupRecoveryPointBasedRestoreRequest")] public partial class AzureBackupRecoveryPointBasedRestoreRequest : AzureBackupRestoreRequest { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupRecoveryTimeBasedRestoreRequest.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupRecoveryTimeBasedRestoreRequest.cs index aba88b23dbba5..facb67aca110b 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupRecoveryTimeBasedRestoreRequest.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupRecoveryTimeBasedRestoreRequest.cs @@ -20,7 +20,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// AzureBackup RecoveryPointTime Based Restore Request /// - [Newtonsoft.Json.JsonObject("AzureBackupRecoveryTimeBasedRestoreRequest")] public partial class AzureBackupRecoveryTimeBasedRestoreRequest : AzureBackupRestoreRequest { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupRestoreRequest.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupRestoreRequest.cs index 5a075556edd6b..51f4ca15a49d1 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupRestoreRequest.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupRestoreRequest.cs @@ -20,7 +20,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Azure backup restore request /// - [Newtonsoft.Json.JsonObject("AzureBackupRestoreRequest")] public partial class AzureBackupRestoreRequest { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupRestoreWithRehydrationRequest.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupRestoreWithRehydrationRequest.cs index f2e642f05511d..2389fa6656173 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupRestoreWithRehydrationRequest.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupRestoreWithRehydrationRequest.cs @@ -20,7 +20,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// AzureBackup Restore with Rehydration Request /// - [Newtonsoft.Json.JsonObject("AzureBackupRestoreWithRehydrationRequest")] public partial class AzureBackupRestoreWithRehydrationRequest : AzureBackupRecoveryPointBasedRestoreRequest { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupRule.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupRule.cs index d656aa74bc130..11f890c168c2c 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupRule.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupRule.cs @@ -20,7 +20,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Azure backup rule /// - [Newtonsoft.Json.JsonObject("AzureBackupRule")] public partial class AzureBackupRule : BasePolicyRule { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureOperationalStoreParameters.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureOperationalStoreParameters.cs index bd538a47978c6..7cdafb6d372e5 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureOperationalStoreParameters.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureOperationalStoreParameters.cs @@ -16,7 +16,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Parameters for Operational-Tier DataStore /// - [Newtonsoft.Json.JsonObject("AzureOperationalStoreParameters")] public partial class AzureOperationalStoreParameters : DataStoreParameters { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureRetentionRule.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureRetentionRule.cs index 62553c323ac19..38f0b6ac82693 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureRetentionRule.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureRetentionRule.cs @@ -22,7 +22,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Azure retention rule /// - [Newtonsoft.Json.JsonObject("AzureRetentionRule")] public partial class AzureRetentionRule : BasePolicyRule { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupCriteria.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupCriteria.cs index 0e6ce7b56625c..8d6841cf0e3e1 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupCriteria.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupCriteria.cs @@ -10,7 +10,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +18,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// BackupCriteria base class /// - [Newtonsoft.Json.JsonObject("BackupCriteria")] public partial class BackupCriteria { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupInstance.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupInstance.cs index 1b9a174d5df3b..701fd43356cc6 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupInstance.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupInstance.cs @@ -51,7 +51,9 @@ public BackupInstance() /// of the resource /// Specifies the provisioning state of /// the resource i.e. provisioning/updating/Succeeded/Failed - public BackupInstance(Datasource dataSourceInfo, PolicyInfo policyInfo, string objectType, string friendlyName = default(string), DatasourceSet dataSourceSetInfo = default(DatasourceSet), ProtectionStatusDetails protectionStatus = default(ProtectionStatusDetails), string currentProtectionState = default(string), UserFacingError protectionErrorDetails = default(UserFacingError), string provisioningState = default(string)) + /// Credentials to use to + /// authenticate with data source provider. + public BackupInstance(Datasource dataSourceInfo, PolicyInfo policyInfo, string objectType, string friendlyName = default(string), DatasourceSet dataSourceSetInfo = default(DatasourceSet), ProtectionStatusDetails protectionStatus = default(ProtectionStatusDetails), string currentProtectionState = default(string), UserFacingError protectionErrorDetails = default(UserFacingError), string provisioningState = default(string), AuthCredentials datasourceAuthCredentials = default(AuthCredentials)) { FriendlyName = friendlyName; DataSourceInfo = dataSourceInfo; @@ -61,6 +63,7 @@ public BackupInstance() CurrentProtectionState = currentProtectionState; ProtectionErrorDetails = protectionErrorDetails; ProvisioningState = provisioningState; + DatasourceAuthCredentials = datasourceAuthCredentials; ObjectType = objectType; CustomInit(); } @@ -125,6 +128,13 @@ public BackupInstance() [JsonProperty(PropertyName = "provisioningState")] public string ProvisioningState { get; private set; } + /// + /// Gets or sets credentials to use to authenticate with data source + /// provider. + /// + [JsonProperty(PropertyName = "datasourceAuthCredentials")] + public AuthCredentials DatasourceAuthCredentials { get; set; } + /// /// [JsonProperty(PropertyName = "objectType")] diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupInstancesValidateForRestoreHeaders.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupInstancesValidateForRestoreHeaders.cs new file mode 100644 index 0000000000000..8e9eeefaa4baa --- /dev/null +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupInstancesValidateForRestoreHeaders.cs @@ -0,0 +1,77 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataProtection.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for ValidateForRestore operation. + /// + public partial class BackupInstancesValidateForRestoreHeaders + { + /// + /// Initializes a new instance of the + /// BackupInstancesValidateForRestoreHeaders class. + /// + public BackupInstancesValidateForRestoreHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// BackupInstancesValidateForRestoreHeaders class. + /// + /// The URL of the resource used to check the + /// status of the asynchronous operation. + /// The URL of the resource used to + /// check the status of the asynchronous operation. + /// Suggested delay to check the status of the + /// asynchronous operation. The value is an integer that represents the + /// seconds. + public BackupInstancesValidateForRestoreHeaders(string location = default(string), string azureAsyncOperation = default(string), int? retryAfter = default(int?)) + { + Location = location; + AzureAsyncOperation = azureAsyncOperation; + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the URL of the resource used to check the status of + /// the asynchronous operation. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + /// + /// Gets or sets the URL of the resource used to check the status of + /// the asynchronous operation. + /// + [JsonProperty(PropertyName = "Azure-AsyncOperation")] + public string AzureAsyncOperation { get; set; } + + /// + /// Gets or sets suggested delay to check the status of the + /// asynchronous operation. The value is an integer that represents the + /// seconds. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupParameters.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupParameters.cs index 56bb78b6e9bc6..c8b4629b7f85b 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupParameters.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupParameters.cs @@ -10,7 +10,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +18,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// BackupParameters base /// - [Newtonsoft.Json.JsonObject("BackupParameters")] public partial class BackupParameters { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupPolicy.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupPolicy.cs index b0558098f595d..f8876d262a397 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupPolicy.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupPolicy.cs @@ -22,7 +22,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Rule based backup policy /// - [Newtonsoft.Json.JsonObject("BackupPolicy")] public partial class BackupPolicy : BaseBackupPolicy { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupSchedule.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupSchedule.cs index 7f0ff2573869e..35f1149dc65dc 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupSchedule.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupSchedule.cs @@ -37,9 +37,12 @@ public BackupSchedule() /// /// ISO 8601 repeating time /// interval format - public BackupSchedule(IList repeatingTimeIntervals) + /// Time zone for a schedule. Example: Pacific + /// Standard Time + public BackupSchedule(IList repeatingTimeIntervals, string timeZone = default(string)) { RepeatingTimeIntervals = repeatingTimeIntervals; + TimeZone = timeZone; CustomInit(); } @@ -54,6 +57,13 @@ public BackupSchedule(IList repeatingTimeIntervals) [JsonProperty(PropertyName = "repeatingTimeIntervals")] public IList RepeatingTimeIntervals { get; set; } + /// + /// Gets or sets time zone for a schedule. Example: Pacific Standard + /// Time + /// + [JsonProperty(PropertyName = "timeZone")] + public string TimeZone { get; set; } + /// /// Validate the object. /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupVault.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupVault.cs index a1b9a022fa1e3..f38674a9340dc 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupVault.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupVault.cs @@ -39,9 +39,18 @@ public BackupVault() /// Provisioning state of the /// BackupVault resource. Possible values include: 'Failed', /// 'Provisioning', 'Succeeded', 'Unknown', 'Updating' - public BackupVault(IList storageSettings, string provisioningState = default(string)) + /// Resource move state for backup + /// vault. Possible values include: 'Unknown', 'InProgress', + /// 'PrepareFailed', 'CommitFailed', 'Failed', 'PrepareTimedout', + /// 'CommitTimedout', 'CriticalFailure', 'PartialSuccess', + /// 'MoveSucceeded' + /// Resource move details for backup + /// vault + public BackupVault(IList storageSettings, string provisioningState = default(string), string resourceMoveState = default(string), ResourceMoveDetails resourceMoveDetails = default(ResourceMoveDetails)) { ProvisioningState = provisioningState; + ResourceMoveState = resourceMoveState; + ResourceMoveDetails = resourceMoveDetails; StorageSettings = storageSettings; CustomInit(); } @@ -59,6 +68,21 @@ public BackupVault() [JsonProperty(PropertyName = "provisioningState")] public string ProvisioningState { get; private set; } + /// + /// Gets resource move state for backup vault. Possible values include: + /// 'Unknown', 'InProgress', 'PrepareFailed', 'CommitFailed', 'Failed', + /// 'PrepareTimedout', 'CommitTimedout', 'CriticalFailure', + /// 'PartialSuccess', 'MoveSucceeded' + /// + [JsonProperty(PropertyName = "resourceMoveState")] + public string ResourceMoveState { get; private set; } + + /// + /// Gets resource move details for backup vault + /// + [JsonProperty(PropertyName = "resourceMoveDetails")] + public ResourceMoveDetails ResourceMoveDetails { get; private set; } + /// /// Gets or sets storage Settings /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupInstancesValidateRestoreHeaders.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupVaultOperationResultsGetHeaders.cs similarity index 87% rename from sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupInstancesValidateRestoreHeaders.cs rename to sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupVaultOperationResultsGetHeaders.cs index 9aa9032970e72..3234c86555104 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupInstancesValidateRestoreHeaders.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupVaultOperationResultsGetHeaders.cs @@ -14,22 +14,22 @@ namespace Microsoft.Azure.Management.DataProtection.Models using System.Linq; /// - /// Defines headers for ValidateRestore operation. + /// Defines headers for Get operation. /// - public partial class BackupInstancesValidateRestoreHeaders + public partial class BackupVaultOperationResultsGetHeaders { /// /// Initializes a new instance of the - /// BackupInstancesValidateRestoreHeaders class. + /// BackupVaultOperationResultsGetHeaders class. /// - public BackupInstancesValidateRestoreHeaders() + public BackupVaultOperationResultsGetHeaders() { CustomInit(); } /// /// Initializes a new instance of the - /// BackupInstancesValidateRestoreHeaders class. + /// BackupVaultOperationResultsGetHeaders class. /// /// The URL of the resource used to check the /// status of the asynchronous operation. @@ -38,7 +38,7 @@ public BackupInstancesValidateRestoreHeaders() /// Suggested delay to check the status of the /// asynchronous operation. The value is an integer that represents the /// seconds. - public BackupInstancesValidateRestoreHeaders(string location = default(string), string azureAsyncOperation = default(string), int? retryAfter = default(int?)) + public BackupVaultOperationResultsGetHeaders(string location = default(string), string azureAsyncOperation = default(string), int? retryAfter = default(int?)) { Location = location; AzureAsyncOperation = azureAsyncOperation; diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BaseBackupPolicy.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BaseBackupPolicy.cs index 2f22621b62026..751621ac4accf 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BaseBackupPolicy.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BaseBackupPolicy.cs @@ -22,7 +22,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// BackupPolicy base /// - [Newtonsoft.Json.JsonObject("BaseBackupPolicy")] public partial class BaseBackupPolicy { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BasePolicyRule.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BasePolicyRule.cs index db86b7704f987..316146a57c071 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BasePolicyRule.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BasePolicyRule.cs @@ -20,7 +20,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// BasePolicy Rule /// - [Newtonsoft.Json.JsonObject("BasePolicyRule")] public partial class BasePolicyRule { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/CopyOnExpiryOption.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/CopyOnExpiryOption.cs index e3d53b68ed0fa..8d98c16fcb6c6 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/CopyOnExpiryOption.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/CopyOnExpiryOption.cs @@ -10,7 +10,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +18,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Copy on Expiry Option /// - [Newtonsoft.Json.JsonObject("CopyOnExpiryOption")] public partial class CopyOnExpiryOption : CopyOption { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/CopyOption.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/CopyOption.cs index 1a32dab5f1ae8..189916ad5c0df 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/CopyOption.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/CopyOption.cs @@ -10,7 +10,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +18,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Options to copy /// - [Newtonsoft.Json.JsonObject("CopyOption")] public partial class CopyOption { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/CustomCopyOption.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/CustomCopyOption.cs index f0b78ba3e2b36..0420f11540d36 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/CustomCopyOption.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/CustomCopyOption.cs @@ -19,7 +19,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Duration based custom options to copy /// - [Newtonsoft.Json.JsonObject("CustomCopyOption")] public partial class CustomCopyOption : CopyOption { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/DataStoreParameters.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/DataStoreParameters.cs index 76553c1dcb419..650583e52a290 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/DataStoreParameters.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/DataStoreParameters.cs @@ -17,7 +17,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Parameters for DataStore /// - [Newtonsoft.Json.JsonObject("DataStoreParameters")] public partial class DataStoreParameters { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/DeleteOption.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/DeleteOption.cs index bf8458939e0cc..d97d270007988 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/DeleteOption.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/DeleteOption.cs @@ -20,7 +20,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Delete Option /// - [Newtonsoft.Json.JsonObject("DeleteOption")] public partial class DeleteOption { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/DppBaseResource.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/DppBaseResource.cs new file mode 100644 index 0000000000000..42c9e4db5eefc --- /dev/null +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/DppBaseResource.cs @@ -0,0 +1,71 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataProtection.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Base resource under Microsoft.DataProtection provider namespace + /// + public partial class DppBaseResource + { + /// + /// Initializes a new instance of the DppBaseResource class. + /// + public DppBaseResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DppBaseResource class. + /// + /// Resource Id represents the complete path to the + /// resource. + /// Resource name associated with the + /// resource. + /// Resource type represents the complete path of + /// the form Namespace/ResourceType/ResourceType/... + public DppBaseResource(string id = default(string), string name = default(string), string type = default(string)) + { + Id = id; + Name = name; + Type = type; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets resource Id represents the complete path to the resource. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets resource name associated with the resource. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets resource type represents the complete path of the form + /// Namespace/ResourceType/ResourceType/... + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + } +} diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/FeatureValidationRequest.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/FeatureValidationRequest.cs index 0e2a8ddc9ff32..d015b787a33d6 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/FeatureValidationRequest.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/FeatureValidationRequest.cs @@ -16,7 +16,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Base class for feature object /// - [Newtonsoft.Json.JsonObject("FeatureValidationRequest")] public partial class FeatureValidationRequest : FeatureValidationRequestBase { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/FeatureValidationRequestBase.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/FeatureValidationRequestBase.cs index ac054517cf734..da4a29209e116 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/FeatureValidationRequestBase.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/FeatureValidationRequestBase.cs @@ -10,13 +10,11 @@ namespace Microsoft.Azure.Management.DataProtection.Models { - using Newtonsoft.Json; using System.Linq; /// /// Base class for Backup Feature support /// - [Newtonsoft.Json.JsonObject("FeatureValidationRequestBase")] public partial class FeatureValidationRequestBase { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/FeatureValidationResponse.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/FeatureValidationResponse.cs index eae5bb3bfd6bc..443b2ab5a6f2a 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/FeatureValidationResponse.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/FeatureValidationResponse.cs @@ -18,7 +18,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Feature Validation Response /// - [Newtonsoft.Json.JsonObject("FeatureValidationResponse")] public partial class FeatureValidationResponse : FeatureValidationResponseBase { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/FeatureValidationResponseBase.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/FeatureValidationResponseBase.cs index 7711ca5f31b19..9897681d1496b 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/FeatureValidationResponseBase.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/FeatureValidationResponseBase.cs @@ -10,13 +10,11 @@ namespace Microsoft.Azure.Management.DataProtection.Models { - using Newtonsoft.Json; using System.Linq; /// /// Base class for Backup Feature support /// - [Newtonsoft.Json.JsonObject("FeatureValidationResponseBase")] public partial class FeatureValidationResponseBase { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ImmediateCopyOption.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ImmediateCopyOption.cs index f228953b84432..6c05eb881a2ad 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ImmediateCopyOption.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ImmediateCopyOption.cs @@ -10,7 +10,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +18,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Immediate copy Option /// - [Newtonsoft.Json.JsonObject("ImmediateCopyOption")] public partial class ImmediateCopyOption : CopyOption { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ItemLevelRestoreCriteria.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ItemLevelRestoreCriteria.cs index d8a76a866db19..2dd889476dfb0 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ItemLevelRestoreCriteria.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ItemLevelRestoreCriteria.cs @@ -10,13 +10,11 @@ namespace Microsoft.Azure.Management.DataProtection.Models { - using Newtonsoft.Json; using System.Linq; /// /// Class to contain criteria for item level restore /// - [Newtonsoft.Json.JsonObject("ItemLevelRestoreCriteria")] public partial class ItemLevelRestoreCriteria { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ItemLevelRestoreTargetInfo.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ItemLevelRestoreTargetInfo.cs index db42316cb86e0..1ce8670189de1 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ItemLevelRestoreTargetInfo.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ItemLevelRestoreTargetInfo.cs @@ -19,7 +19,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Restore target info for Item level restore operation /// - [Newtonsoft.Json.JsonObject("ItemLevelRestoreTargetInfo")] public partial class ItemLevelRestoreTargetInfo : RestoreTargetInfoBase { /// @@ -38,12 +37,15 @@ public ItemLevelRestoreTargetInfo() /// Target Restore region /// Information of target DS /// Set - public ItemLevelRestoreTargetInfo(IList restoreCriteria, Datasource datasourceInfo, string restoreLocation = default(string), DatasourceSet datasourceSetInfo = default(DatasourceSet)) + /// Credentials to use to + /// authenticate with data source provider. + public ItemLevelRestoreTargetInfo(IList restoreCriteria, Datasource datasourceInfo, string restoreLocation = default(string), DatasourceSet datasourceSetInfo = default(DatasourceSet), AuthCredentials datasourceAuthCredentials = default(AuthCredentials)) : base(restoreLocation) { RestoreCriteria = restoreCriteria; DatasourceInfo = datasourceInfo; DatasourceSetInfo = datasourceSetInfo; + DatasourceAuthCredentials = datasourceAuthCredentials; CustomInit(); } @@ -70,6 +72,13 @@ public ItemLevelRestoreTargetInfo() [JsonProperty(PropertyName = "datasourceSetInfo")] public DatasourceSet DatasourceSetInfo { get; set; } + /// + /// Gets or sets credentials to use to authenticate with data source + /// provider. + /// + [JsonProperty(PropertyName = "datasourceAuthCredentials")] + public AuthCredentials DatasourceAuthCredentials { get; set; } + /// /// Validate the object. /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/OperationExtendedInfo.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/OperationExtendedInfo.cs index 118a716e040ff..e39bc0df1b99b 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/OperationExtendedInfo.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/OperationExtendedInfo.cs @@ -10,7 +10,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,29 +28,11 @@ public OperationExtendedInfo() CustomInit(); } - /// - /// Initializes a new instance of the OperationExtendedInfo class. - /// - /// This property will be used as the - /// discriminator for deciding the specific types in the polymorphic - /// chain of types. - public OperationExtendedInfo(string objectType = default(string)) - { - ObjectType = objectType; - CustomInit(); - } /// /// An initialization method that performs custom operations like setting defaults /// partial void CustomInit(); - /// - /// Gets or sets this property will be used as the discriminator for - /// deciding the specific types in the polymorphic chain of types. - /// - [JsonProperty(PropertyName = "objectType")] - public string ObjectType { get; set; } - } } diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/OperationJobExtendedInfo.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/OperationJobExtendedInfo.cs index e1cb5f8e3fb66..c8f96b992a40b 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/OperationJobExtendedInfo.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/OperationJobExtendedInfo.cs @@ -32,13 +32,9 @@ public OperationJobExtendedInfo() /// /// Initializes a new instance of the OperationJobExtendedInfo class. /// - /// This property will be used as the - /// discriminator for deciding the specific types in the polymorphic - /// chain of types. /// Arm Id of the job created for this /// operation. - public OperationJobExtendedInfo(string objectType = default(string), string jobId = default(string)) - : base(objectType) + public OperationJobExtendedInfo(string jobId = default(string)) { JobId = jobId; CustomInit(); diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/RangeBasedItemLevelRestoreCriteria.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/RangeBasedItemLevelRestoreCriteria.cs index 82a66f47c8399..f6504787ae3fe 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/RangeBasedItemLevelRestoreCriteria.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/RangeBasedItemLevelRestoreCriteria.cs @@ -16,7 +16,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Item Level target info for restore operation /// - [Newtonsoft.Json.JsonObject("RangeBasedItemLevelRestoreCriteria")] public partial class RangeBasedItemLevelRestoreCriteria : ItemLevelRestoreCriteria { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ResourceGuard.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ResourceGuard.cs new file mode 100644 index 0000000000000..a7920471acc99 --- /dev/null +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ResourceGuard.cs @@ -0,0 +1,93 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataProtection.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class ResourceGuard + { + /// + /// Initializes a new instance of the ResourceGuard class. + /// + public ResourceGuard() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ResourceGuard class. + /// + /// Provisioning state of the + /// BackupVault resource. Possible values include: 'Failed', + /// 'Provisioning', 'Succeeded', 'Unknown', 'Updating' + /// This flag indicates whether auto + /// approval is allowed or not. + /// {readonly} List of operation + /// details those are protected by the ResourceGuard resource + /// List of critical + /// operations which are not protected by this resourceGuard + /// Description about the pre-req steps to + /// perform all the critical operations. + public ResourceGuard(string provisioningState = default(string), bool? allowAutoApprovals = default(bool?), IList resourceGuardOperations = default(IList), IList vaultCriticalOperationExclusionList = default(IList), string description = default(string)) + { + ProvisioningState = provisioningState; + AllowAutoApprovals = allowAutoApprovals; + ResourceGuardOperations = resourceGuardOperations; + VaultCriticalOperationExclusionList = vaultCriticalOperationExclusionList; + Description = description; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets provisioning state of the BackupVault resource. Possible + /// values include: 'Failed', 'Provisioning', 'Succeeded', 'Unknown', + /// 'Updating' + /// + [JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets this flag indicates whether auto approval is allowed or not. + /// + [JsonProperty(PropertyName = "allowAutoApprovals")] + public bool? AllowAutoApprovals { get; private set; } + + /// + /// Gets {readonly} List of operation details those are protected by + /// the ResourceGuard resource + /// + [JsonProperty(PropertyName = "resourceGuardOperations")] + public IList ResourceGuardOperations { get; private set; } + + /// + /// Gets list of critical operations which are not protected by this + /// resourceGuard + /// + [JsonProperty(PropertyName = "vaultCriticalOperationExclusionList")] + public IList VaultCriticalOperationExclusionList { get; private set; } + + /// + /// Gets description about the pre-req steps to perform all the + /// critical operations. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; private set; } + + } +} diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ResourceGuardOperation.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ResourceGuardOperation.cs new file mode 100644 index 0000000000000..cffa591a994d0 --- /dev/null +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ResourceGuardOperation.cs @@ -0,0 +1,60 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataProtection.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// This class contains all the details about a critical operation. + /// + public partial class ResourceGuardOperation + { + /// + /// Initializes a new instance of the ResourceGuardOperation class. + /// + public ResourceGuardOperation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ResourceGuardOperation class. + /// + /// Name of the critical + /// operation. + /// Type of resource request. + public ResourceGuardOperation(string vaultCriticalOperation = default(string), string requestResourceType = default(string)) + { + VaultCriticalOperation = vaultCriticalOperation; + RequestResourceType = requestResourceType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets name of the critical operation. + /// + [JsonProperty(PropertyName = "vaultCriticalOperation")] + public string VaultCriticalOperation { get; private set; } + + /// + /// Gets type of resource request. + /// + [JsonProperty(PropertyName = "requestResourceType")] + public string RequestResourceType { get; private set; } + + } +} diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ResourceGuardResource.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ResourceGuardResource.cs new file mode 100644 index 0000000000000..ee20535a689a7 --- /dev/null +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ResourceGuardResource.cs @@ -0,0 +1,61 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataProtection.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class ResourceGuardResource : DppTrackedResource + { + /// + /// Initializes a new instance of the ResourceGuardResource class. + /// + public ResourceGuardResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ResourceGuardResource class. + /// + /// Optional ETag. + /// Resource Id represents the complete path to the + /// resource. + /// Input Managed Identity Details + /// Resource location. + /// Resource name associated with the + /// resource. + /// Resource tags. + /// Resource type represents the complete path of + /// the form Namespace/ResourceType/ResourceType/... + /// ResourceGuardResource properties + public ResourceGuardResource(string eTag = default(string), string id = default(string), DppIdentityDetails identity = default(DppIdentityDetails), string location = default(string), string name = default(string), IDictionary tags = default(IDictionary), string type = default(string), SystemData systemData = default(SystemData), ResourceGuard properties = default(ResourceGuard)) + : base(eTag, id, identity, location, name, tags, type, systemData) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets resourceGuardResource properties + /// + [JsonProperty(PropertyName = "properties")] + public ResourceGuard Properties { get; set; } + + } +} diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ResourceMoveDetails.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ResourceMoveDetails.cs new file mode 100644 index 0000000000000..b34d4c6a5d0df --- /dev/null +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ResourceMoveDetails.cs @@ -0,0 +1,93 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataProtection.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// ResourceMoveDetails will be returned in response to GetResource call + /// from ARM + /// + public partial class ResourceMoveDetails + { + /// + /// Initializes a new instance of the ResourceMoveDetails class. + /// + public ResourceMoveDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ResourceMoveDetails class. + /// + /// CorrelationId of latest ResourceMove + /// operation attempted + /// Start time in UTC of latest ResourceMove + /// operation attempted. ISO 8601 format. + /// Completion time in UTC of latest + /// ResourceMove operation attempted. ISO 8601 format. + /// ARM resource path of source + /// resource + /// ARM resource path of target + /// resource used in latest ResourceMove operation + public ResourceMoveDetails(string operationId = default(string), string startTimeUtc = default(string), string completionTimeUtc = default(string), string sourceResourcePath = default(string), string targetResourcePath = default(string)) + { + OperationId = operationId; + StartTimeUtc = startTimeUtc; + CompletionTimeUtc = completionTimeUtc; + SourceResourcePath = sourceResourcePath; + TargetResourcePath = targetResourcePath; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets correlationId of latest ResourceMove operation + /// attempted + /// + [JsonProperty(PropertyName = "operationId")] + public string OperationId { get; set; } + + /// + /// Gets or sets start time in UTC of latest ResourceMove operation + /// attempted. ISO 8601 format. + /// + [JsonProperty(PropertyName = "startTimeUtc")] + public string StartTimeUtc { get; set; } + + /// + /// Gets or sets completion time in UTC of latest ResourceMove + /// operation attempted. ISO 8601 format. + /// + [JsonProperty(PropertyName = "completionTimeUtc")] + public string CompletionTimeUtc { get; set; } + + /// + /// Gets or sets ARM resource path of source resource + /// + [JsonProperty(PropertyName = "sourceResourcePath")] + public string SourceResourcePath { get; set; } + + /// + /// Gets or sets ARM resource path of target resource used in latest + /// ResourceMove operation + /// + [JsonProperty(PropertyName = "targetResourcePath")] + public string TargetResourcePath { get; set; } + + } +} diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ResourceMoveState.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ResourceMoveState.cs new file mode 100644 index 0000000000000..1571b3c704ce8 --- /dev/null +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ResourceMoveState.cs @@ -0,0 +1,30 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataProtection.Models +{ + + /// + /// Defines values for ResourceMoveState. + /// + public static class ResourceMoveState + { + public const string Unknown = "Unknown"; + public const string InProgress = "InProgress"; + public const string PrepareFailed = "PrepareFailed"; + public const string CommitFailed = "CommitFailed"; + public const string Failed = "Failed"; + public const string PrepareTimedout = "PrepareTimedout"; + public const string CommitTimedout = "CommitTimedout"; + public const string CriticalFailure = "CriticalFailure"; + public const string PartialSuccess = "PartialSuccess"; + public const string MoveSucceeded = "MoveSucceeded"; + } +} diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/RestoreFilesTargetInfo.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/RestoreFilesTargetInfo.cs index 664c0974314b4..d7b3e302bce64 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/RestoreFilesTargetInfo.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/RestoreFilesTargetInfo.cs @@ -17,7 +17,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Class encapsulating restore as files target parameters /// - [Newtonsoft.Json.JsonObject("RestoreFilesTargetInfo")] public partial class RestoreFilesTargetInfo : RestoreTargetInfoBase { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/RestoreTargetInfo.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/RestoreTargetInfo.cs index c4840db162755..34f155ba302ea 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/RestoreTargetInfo.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/RestoreTargetInfo.cs @@ -17,7 +17,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Class encapsulating restore target parameters /// - [Newtonsoft.Json.JsonObject("RestoreTargetInfo")] public partial class RestoreTargetInfo : RestoreTargetInfoBase { /// @@ -35,11 +34,14 @@ public RestoreTargetInfo() /// Target Restore region /// Information of target DS /// Set - public RestoreTargetInfo(Datasource datasourceInfo, string restoreLocation = default(string), DatasourceSet datasourceSetInfo = default(DatasourceSet)) + /// Credentials to use to + /// authenticate with data source provider. + public RestoreTargetInfo(Datasource datasourceInfo, string restoreLocation = default(string), DatasourceSet datasourceSetInfo = default(DatasourceSet), AuthCredentials datasourceAuthCredentials = default(AuthCredentials)) : base(restoreLocation) { DatasourceInfo = datasourceInfo; DatasourceSetInfo = datasourceSetInfo; + DatasourceAuthCredentials = datasourceAuthCredentials; CustomInit(); } @@ -60,6 +62,13 @@ public RestoreTargetInfo() [JsonProperty(PropertyName = "datasourceSetInfo")] public DatasourceSet DatasourceSetInfo { get; set; } + /// + /// Gets or sets credentials to use to authenticate with data source + /// provider. + /// + [JsonProperty(PropertyName = "datasourceAuthCredentials")] + public AuthCredentials DatasourceAuthCredentials { get; set; } + /// /// Validate the object. /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/RestoreTargetInfoBase.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/RestoreTargetInfoBase.cs index 246cf582516fe..24c8eb40f70e4 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/RestoreTargetInfoBase.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/RestoreTargetInfoBase.cs @@ -16,7 +16,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Base class common to RestoreTargetInfo and RestoreFilesTargetInfo /// - [Newtonsoft.Json.JsonObject("RestoreTargetInfoBase")] public partial class RestoreTargetInfoBase { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ScheduleBasedBackupCriteria.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ScheduleBasedBackupCriteria.cs index cd03b95da4359..e600d2e12ca4a 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ScheduleBasedBackupCriteria.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ScheduleBasedBackupCriteria.cs @@ -21,7 +21,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Schedule based backup criteria /// - [Newtonsoft.Json.JsonObject("ScheduleBasedBackupCriteria")] public partial class ScheduleBasedBackupCriteria : BackupCriteria { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ScheduleBasedTriggerContext.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ScheduleBasedTriggerContext.cs index 3df0a4dc7dcb5..329cc882831d8 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ScheduleBasedTriggerContext.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ScheduleBasedTriggerContext.cs @@ -22,7 +22,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Schedule based trigger context /// - [Newtonsoft.Json.JsonObject("ScheduleBasedTriggerContext")] public partial class ScheduleBasedTriggerContext : TriggerContext { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/SecretStoreBasedAuthCredentials.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/SecretStoreBasedAuthCredentials.cs new file mode 100644 index 0000000000000..2531af2486ba1 --- /dev/null +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/SecretStoreBasedAuthCredentials.cs @@ -0,0 +1,66 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataProtection.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Secret store based authentication credentials. + /// + public partial class SecretStoreBasedAuthCredentials : AuthCredentials + { + /// + /// Initializes a new instance of the SecretStoreBasedAuthCredentials + /// class. + /// + public SecretStoreBasedAuthCredentials() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SecretStoreBasedAuthCredentials + /// class. + /// + /// Secret store resource + public SecretStoreBasedAuthCredentials(SecretStoreResource secretStoreResource = default(SecretStoreResource)) + { + SecretStoreResource = secretStoreResource; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets secret store resource + /// + [JsonProperty(PropertyName = "secretStoreResource")] + public SecretStoreResource SecretStoreResource { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (SecretStoreResource != null) + { + SecretStoreResource.Validate(); + } + } + } +} diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/SecretStoreResource.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/SecretStoreResource.cs new file mode 100644 index 0000000000000..3bfbd797ee84c --- /dev/null +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/SecretStoreResource.cs @@ -0,0 +1,75 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataProtection.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Class representing a secret store resource. + /// + public partial class SecretStoreResource + { + /// + /// Initializes a new instance of the SecretStoreResource class. + /// + public SecretStoreResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SecretStoreResource class. + /// + /// Gets or sets the type of secret + /// store. Possible values include: 'Invalid', 'AzureKeyVault' + /// Uri to get to the resource + public SecretStoreResource(string secretStoreType, string uri = default(string)) + { + Uri = uri; + SecretStoreType = secretStoreType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets uri to get to the resource + /// + [JsonProperty(PropertyName = "uri")] + public string Uri { get; set; } + + /// + /// Gets or sets the type of secret store. Possible values include: + /// 'Invalid', 'AzureKeyVault' + /// + [JsonProperty(PropertyName = "secretStoreType")] + public string SecretStoreType { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (SecretStoreType == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "SecretStoreType"); + } + } + } +} diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/SecretStoreType.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/SecretStoreType.cs new file mode 100644 index 0000000000000..657b77fc8951e --- /dev/null +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/SecretStoreType.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataProtection.Models +{ + + /// + /// Defines values for SecretStoreType. + /// + public static class SecretStoreType + { + public const string Invalid = "Invalid"; + public const string AzureKeyVault = "AzureKeyVault"; + } +} diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/TriggerContext.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/TriggerContext.cs index 9f60526fbaeee..1819703da9dba 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/TriggerContext.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/TriggerContext.cs @@ -10,7 +10,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +18,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Trigger context /// - [Newtonsoft.Json.JsonObject("TriggerContext")] public partial class TriggerContext { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/JobOperations.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/OperationStatusOperations.cs similarity index 82% rename from sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/JobOperations.cs rename to sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/OperationStatusOperations.cs index 578839820c51d..7941da4424422 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/JobOperations.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/OperationStatusOperations.cs @@ -23,12 +23,12 @@ namespace Microsoft.Azure.Management.DataProtection using System.Threading.Tasks; /// - /// JobOperations operations. + /// OperationStatusOperations operations. /// - internal partial class JobOperations : IServiceOperations, IJobOperations + internal partial class OperationStatusOperations : IServiceOperations, IOperationStatusOperations { /// - /// Initializes a new instance of the JobOperations class. + /// Initializes a new instance of the OperationStatusOperations class. /// /// /// Reference to the service client. @@ -36,7 +36,7 @@ internal partial class JobOperations : IServiceOperations, /// /// Thrown when a required parameter is null /// - internal JobOperations(DataProtectionClient client) + internal OperationStatusOperations(DataProtectionClient client) { if (client == null) { @@ -51,17 +51,11 @@ internal JobOperations(DataProtectionClient client) public DataProtectionClient Client { get; private set; } /// - /// Gets a job with id in a backup vault + /// Gets the operation status for a resource. /// - /// - /// The name of the resource group where the backup vault is present. + /// /// - /// - /// The name of the backup vault. - /// - /// - /// The Job ID. This is a GUID-formatted string (e.g. - /// 00000000-0000-0000-0000-000000000000). + /// /// /// /// Headers that will be added to request. @@ -84,7 +78,7 @@ internal JobOperations(DataProtectionClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, string jobId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string location, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -94,17 +88,13 @@ internal JobOperations(DataProtectionClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (vaultName == null) + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + throw new ValidationException(ValidationRules.CannotBeNull, "location"); } - if (jobId == null) + if (operationId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "jobId"); + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -113,19 +103,17 @@ internal JobOperations(DataProtectionClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("vaultName", vaultName); - tracingParameters.Add("jobId", jobId); + tracingParameters.Add("location", location); + tracingParameters.Add("operationId", operationId); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupJobs/{jobId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DataProtection/locations/{location}/operationStatus/{operationId}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{jobId}", System.Uri.EscapeDataString(jobId)); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -224,7 +212,7 @@ internal JobOperations(DataProtectionClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -237,7 +225,7 @@ internal JobOperations(DataProtectionClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/OperationStatusOperationsExtensions.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/OperationStatusOperationsExtensions.cs new file mode 100644 index 0000000000000..a03e197bda736 --- /dev/null +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/OperationStatusOperationsExtensions.cs @@ -0,0 +1,61 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataProtection +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for OperationStatusOperations. + /// + public static partial class OperationStatusOperationsExtensions + { + /// + /// Gets the operation status for a resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + public static OperationResource Get(this IOperationStatusOperations operations, string location, string operationId) + { + return operations.GetAsync(location, operationId).GetAwaiter().GetResult(); + } + + /// + /// Gets the operation status for a resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IOperationStatusOperations operations, string location, string operationId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(location, operationId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/RecoveryPointOperationsExtensions.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/RecoveryPointOperationsExtensions.cs deleted file mode 100644 index deaab0e43d0f2..0000000000000 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/RecoveryPointOperationsExtensions.cs +++ /dev/null @@ -1,75 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.DataProtection -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for RecoveryPointOperations. - /// - public static partial class RecoveryPointOperationsExtensions - { - /// - /// Gets a Recovery Point using recoveryPointId for a Datasource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the backup vault. - /// - /// - /// The name of the resource group where the backup vault is present. - /// - /// - /// The name of the backup instance - /// - /// - /// - public static AzureBackupRecoveryPointResource Get(this IRecoveryPointOperations operations, string vaultName, string resourceGroupName, string backupInstanceName, string recoveryPointId) - { - return operations.GetAsync(vaultName, resourceGroupName, backupInstanceName, recoveryPointId).GetAwaiter().GetResult(); - } - - /// - /// Gets a Recovery Point using recoveryPointId for a Datasource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the backup vault. - /// - /// - /// The name of the resource group where the backup vault is present. - /// - /// - /// The name of the backup instance - /// - /// - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IRecoveryPointOperations operations, string vaultName, string resourceGroupName, string backupInstanceName, string recoveryPointId, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, backupInstanceName, recoveryPointId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/RecoveryPointsOperations.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/RecoveryPointsOperations.cs index fca08f8457fbc..495bb0d4ccbf0 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/RecoveryPointsOperations.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/RecoveryPointsOperations.cs @@ -90,7 +90,7 @@ internal RecoveryPointsOperations(DataProtectionClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetListWithHttpMessagesAsync(string vaultName, string resourceGroupName, string backupInstanceName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, string backupInstanceName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -125,7 +125,7 @@ internal RecoveryPointsOperations(DataProtectionClient client) tracingParameters.Add("backupInstanceName", backupInstanceName); tracingParameters.Add("skipToken", skipToken); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetList", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -276,6 +276,219 @@ internal RecoveryPointsOperations(DataProtectionClient client) return _result; } + /// + /// Gets a Recovery Point using recoveryPointId for a Datasource. + /// + /// + /// The name of the backup vault. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// The name of the backup instance + /// + /// + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string backupInstanceName, string recoveryPointId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (backupInstanceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "backupInstanceName"); + } + if (recoveryPointId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "recoveryPointId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("backupInstanceName", backupInstanceName); + tracingParameters.Add("recoveryPointId", recoveryPointId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/recoveryPoints/{recoveryPointId}").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{backupInstanceName}", System.Uri.EscapeDataString(backupInstanceName)); + _url = _url.Replace("{recoveryPointId}", System.Uri.EscapeDataString(recoveryPointId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + /// /// Returns a list of Recovery Points for a DataSource in a vault. /// @@ -303,7 +516,7 @@ internal RecoveryPointsOperations(DataProtectionClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -318,7 +531,7 @@ internal RecoveryPointsOperations(DataProtectionClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetListNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/RecoveryPointsOperationsExtensions.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/RecoveryPointsOperationsExtensions.cs index f21887bdeadf6..f7bef6b42c2c9 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/RecoveryPointsOperationsExtensions.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/RecoveryPointsOperationsExtensions.cs @@ -43,9 +43,9 @@ public static partial class RecoveryPointsOperationsExtensions /// /// skipToken Filter. /// - public static IPage GetList(this IRecoveryPointsOperations operations, string vaultName, string resourceGroupName, string backupInstanceName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string)) + public static IPage List(this IRecoveryPointsOperations operations, string vaultName, string resourceGroupName, string backupInstanceName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string)) { - return operations.GetListAsync(vaultName, resourceGroupName, backupInstanceName, odataQuery, skipToken).GetAwaiter().GetResult(); + return operations.ListAsync(vaultName, resourceGroupName, backupInstanceName, odataQuery, skipToken).GetAwaiter().GetResult(); } /// @@ -72,9 +72,59 @@ public static partial class RecoveryPointsOperationsExtensions /// /// The cancellation token. /// - public static async Task> GetListAsync(this IRecoveryPointsOperations operations, string vaultName, string resourceGroupName, string backupInstanceName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this IRecoveryPointsOperations operations, string vaultName, string resourceGroupName, string backupInstanceName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetListWithHttpMessagesAsync(vaultName, resourceGroupName, backupInstanceName, odataQuery, skipToken, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(vaultName, resourceGroupName, backupInstanceName, odataQuery, skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a Recovery Point using recoveryPointId for a Datasource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the backup vault. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// The name of the backup instance + /// + /// + /// + public static AzureBackupRecoveryPointResource Get(this IRecoveryPointsOperations operations, string vaultName, string resourceGroupName, string backupInstanceName, string recoveryPointId) + { + return operations.GetAsync(vaultName, resourceGroupName, backupInstanceName, recoveryPointId).GetAwaiter().GetResult(); + } + + /// + /// Gets a Recovery Point using recoveryPointId for a Datasource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the backup vault. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// The name of the backup instance + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IRecoveryPointsOperations operations, string vaultName, string resourceGroupName, string backupInstanceName, string recoveryPointId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, backupInstanceName, recoveryPointId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -89,9 +139,9 @@ public static partial class RecoveryPointsOperationsExtensions /// /// The NextLink from the previous successful call to List operation. /// - public static IPage GetListNext(this IRecoveryPointsOperations operations, string nextPageLink) + public static IPage ListNext(this IRecoveryPointsOperations operations, string nextPageLink) { - return operations.GetListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// @@ -106,9 +156,9 @@ public static IPage GetListNext(this IRecovery /// /// The cancellation token. /// - public static async Task> GetListNextAsync(this IRecoveryPointsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListNextAsync(this IRecoveryPointsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/ResourceGuardsOperations.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/ResourceGuardsOperations.cs new file mode 100644 index 0000000000000..c187875799494 --- /dev/null +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/ResourceGuardsOperations.cs @@ -0,0 +1,5001 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataProtection +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ResourceGuardsOperations operations. + /// + internal partial class ResourceGuardsOperations : IServiceOperations, IResourceGuardsOperations + { + /// + /// Initializes a new instance of the ResourceGuardsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ResourceGuardsOperations(DataProtectionClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the DataProtectionClient + /// + public DataProtectionClient Client { get; private set; } + + /// + /// Returns ResourceGuards collection belonging to a subscription. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> GetResourcesInSubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetResourcesInSubscription", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DataProtection/resourceGuards").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Returns ResourceGuards collection belonging to a ResourceGroup. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> GetResourcesInResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetResourcesInResourceGroup", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates a ResourceGuard resource belonging to a resource group. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// The name of ResourceGuard + /// + /// + /// Request body for operation + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> PutWithHttpMessagesAsync(string resourceGroupName, string resourceGuardsName, ResourceGuardResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGuardsName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGuardsName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceGuardsName", resourceGuardsName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Put", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGuardsName}", System.Uri.EscapeDataString(resourceGuardsName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Returns a ResourceGuard belonging to a resource group. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// The name of ResourceGuard + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string resourceGuardsName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGuardsName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGuardsName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceGuardsName", resourceGuardsName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGuardsName}", System.Uri.EscapeDataString(resourceGuardsName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes a ResourceGuard resource from the resource group. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// The name of ResourceGuard + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string resourceGuardsName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGuardsName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGuardsName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceGuardsName", resourceGuardsName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGuardsName}", System.Uri.EscapeDataString(resourceGuardsName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Updates a ResourceGuard resource belonging to a resource group. For + /// example, updating tags for a resource. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// The name of ResourceGuard + /// + /// + /// Request body for operation + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> PatchWithHttpMessagesAsync(string resourceGroupName, string resourceGuardsName, PatchResourceRequestInput parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGuardsName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGuardsName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceGuardsName", resourceGuardsName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Patch", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGuardsName}", System.Uri.EscapeDataString(resourceGuardsName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> GetDisableSoftDeleteRequestsObjectsWithHttpMessagesAsync(string resourceGroupName, string resourceGuardsName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGuardsName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGuardsName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceGuardsName", resourceGuardsName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetDisableSoftDeleteRequestsObjects", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/disableSoftDeleteRequests").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGuardsName}", System.Uri.EscapeDataString(resourceGuardsName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> GetDeleteResourceGuardProxyRequestsObjectsWithHttpMessagesAsync(string resourceGroupName, string resourceGuardsName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGuardsName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGuardsName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceGuardsName", resourceGuardsName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetDeleteResourceGuardProxyRequestsObjects", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/deleteResourceGuardProxyRequests").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGuardsName}", System.Uri.EscapeDataString(resourceGuardsName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> GetBackupSecurityPINRequestsObjectsWithHttpMessagesAsync(string resourceGroupName, string resourceGuardsName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGuardsName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGuardsName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceGuardsName", resourceGuardsName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetBackupSecurityPINRequestsObjects", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/getBackupSecurityPINRequests").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGuardsName}", System.Uri.EscapeDataString(resourceGuardsName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> GetDeleteProtectedItemRequestsObjectsWithHttpMessagesAsync(string resourceGroupName, string resourceGuardsName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGuardsName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGuardsName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceGuardsName", resourceGuardsName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetDeleteProtectedItemRequestsObjects", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/deleteProtectedItemRequests").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGuardsName}", System.Uri.EscapeDataString(resourceGuardsName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> GetUpdateProtectionPolicyRequestsObjectsWithHttpMessagesAsync(string resourceGroupName, string resourceGuardsName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGuardsName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGuardsName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceGuardsName", resourceGuardsName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetUpdateProtectionPolicyRequestsObjects", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/updateProtectionPolicyRequests").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGuardsName}", System.Uri.EscapeDataString(resourceGuardsName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> GetUpdateProtectedItemRequestsObjectsWithHttpMessagesAsync(string resourceGroupName, string resourceGuardsName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGuardsName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGuardsName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceGuardsName", resourceGuardsName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetUpdateProtectedItemRequestsObjects", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/updateProtectedItemRequests").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGuardsName}", System.Uri.EscapeDataString(resourceGuardsName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// + /// + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetDefaultDisableSoftDeleteRequestsObjectWithHttpMessagesAsync(string resourceGroupName, string resourceGuardsName, string requestName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGuardsName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGuardsName"); + } + if (requestName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "requestName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceGuardsName", resourceGuardsName); + tracingParameters.Add("requestName", requestName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetDefaultDisableSoftDeleteRequestsObject", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/disableSoftDeleteRequests/{requestName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGuardsName}", System.Uri.EscapeDataString(resourceGuardsName)); + _url = _url.Replace("{requestName}", System.Uri.EscapeDataString(requestName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// + /// + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetDefaultDeleteResourceGuardProxyRequestsObjectWithHttpMessagesAsync(string resourceGroupName, string resourceGuardsName, string requestName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGuardsName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGuardsName"); + } + if (requestName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "requestName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceGuardsName", resourceGuardsName); + tracingParameters.Add("requestName", requestName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetDefaultDeleteResourceGuardProxyRequestsObject", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/deleteResourceGuardProxyRequests/{requestName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGuardsName}", System.Uri.EscapeDataString(resourceGuardsName)); + _url = _url.Replace("{requestName}", System.Uri.EscapeDataString(requestName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// + /// + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetDefaultBackupSecurityPINRequestsObjectWithHttpMessagesAsync(string resourceGroupName, string resourceGuardsName, string requestName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGuardsName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGuardsName"); + } + if (requestName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "requestName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceGuardsName", resourceGuardsName); + tracingParameters.Add("requestName", requestName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetDefaultBackupSecurityPINRequestsObject", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/getBackupSecurityPINRequests/{requestName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGuardsName}", System.Uri.EscapeDataString(resourceGuardsName)); + _url = _url.Replace("{requestName}", System.Uri.EscapeDataString(requestName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// + /// + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetDefaultDeleteProtectedItemRequestsObjectWithHttpMessagesAsync(string resourceGroupName, string resourceGuardsName, string requestName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGuardsName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGuardsName"); + } + if (requestName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "requestName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceGuardsName", resourceGuardsName); + tracingParameters.Add("requestName", requestName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetDefaultDeleteProtectedItemRequestsObject", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/deleteProtectedItemRequests/{requestName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGuardsName}", System.Uri.EscapeDataString(resourceGuardsName)); + _url = _url.Replace("{requestName}", System.Uri.EscapeDataString(requestName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// + /// + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetDefaultUpdateProtectionPolicyRequestsObjectWithHttpMessagesAsync(string resourceGroupName, string resourceGuardsName, string requestName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGuardsName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGuardsName"); + } + if (requestName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "requestName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceGuardsName", resourceGuardsName); + tracingParameters.Add("requestName", requestName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetDefaultUpdateProtectionPolicyRequestsObject", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/updateProtectionPolicyRequests/{requestName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGuardsName}", System.Uri.EscapeDataString(resourceGuardsName)); + _url = _url.Replace("{requestName}", System.Uri.EscapeDataString(requestName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// + /// + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetDefaultUpdateProtectedItemRequestsObjectWithHttpMessagesAsync(string resourceGroupName, string resourceGuardsName, string requestName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGuardsName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGuardsName"); + } + if (requestName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "requestName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceGuardsName", resourceGuardsName); + tracingParameters.Add("requestName", requestName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetDefaultUpdateProtectedItemRequestsObject", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/updateProtectedItemRequests/{requestName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGuardsName}", System.Uri.EscapeDataString(resourceGuardsName)); + _url = _url.Replace("{requestName}", System.Uri.EscapeDataString(requestName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Returns ResourceGuards collection belonging to a 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 Task>> GetResourcesInSubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetResourcesInSubscriptionNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Returns ResourceGuards collection belonging to a ResourceGroup. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> GetResourcesInResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetResourcesInResourceGroupNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> GetDisableSoftDeleteRequestsObjectsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetDisableSoftDeleteRequestsObjectsNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> GetDeleteResourceGuardProxyRequestsObjectsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetDeleteResourceGuardProxyRequestsObjectsNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> GetBackupSecurityPINRequestsObjectsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetBackupSecurityPINRequestsObjectsNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> GetDeleteProtectedItemRequestsObjectsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetDeleteProtectedItemRequestsObjectsNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> GetUpdateProtectionPolicyRequestsObjectsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetUpdateProtectionPolicyRequestsObjectsNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> GetUpdateProtectedItemRequestsObjectsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetUpdateProtectedItemRequestsObjectsNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/ResourceGuardsOperationsExtensions.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/ResourceGuardsOperationsExtensions.cs new file mode 100644 index 0000000000000..c139a3aa66a56 --- /dev/null +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/ResourceGuardsOperationsExtensions.cs @@ -0,0 +1,1046 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataProtection +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ResourceGuardsOperations. + /// + public static partial class ResourceGuardsOperationsExtensions + { + /// + /// Returns ResourceGuards collection belonging to a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static IPage GetResourcesInSubscription(this IResourceGuardsOperations operations) + { + return operations.GetResourcesInSubscriptionAsync().GetAwaiter().GetResult(); + } + + /// + /// Returns ResourceGuards collection belonging to a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> GetResourcesInSubscriptionAsync(this IResourceGuardsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetResourcesInSubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Returns ResourceGuards collection belonging to a ResourceGroup. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + public static IPage GetResourcesInResourceGroup(this IResourceGuardsOperations operations, string resourceGroupName) + { + return operations.GetResourcesInResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Returns ResourceGuards collection belonging to a ResourceGroup. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// The cancellation token. + /// + public static async Task> GetResourcesInResourceGroupAsync(this IResourceGuardsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetResourcesInResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates a ResourceGuard resource belonging to a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// The name of ResourceGuard + /// + /// + /// Request body for operation + /// + public static ResourceGuardResource Put(this IResourceGuardsOperations operations, string resourceGroupName, string resourceGuardsName, ResourceGuardResource parameters) + { + return operations.PutAsync(resourceGroupName, resourceGuardsName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a ResourceGuard resource belonging to a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// The name of ResourceGuard + /// + /// + /// Request body for operation + /// + /// + /// The cancellation token. + /// + public static async Task PutAsync(this IResourceGuardsOperations operations, string resourceGroupName, string resourceGuardsName, ResourceGuardResource parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.PutWithHttpMessagesAsync(resourceGroupName, resourceGuardsName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Returns a ResourceGuard belonging to a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// The name of ResourceGuard + /// + public static ResourceGuardResource Get(this IResourceGuardsOperations operations, string resourceGroupName, string resourceGuardsName) + { + return operations.GetAsync(resourceGroupName, resourceGuardsName).GetAwaiter().GetResult(); + } + + /// + /// Returns a ResourceGuard belonging to a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// The name of ResourceGuard + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IResourceGuardsOperations operations, string resourceGroupName, string resourceGuardsName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, resourceGuardsName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a ResourceGuard resource from the resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// The name of ResourceGuard + /// + public static void Delete(this IResourceGuardsOperations operations, string resourceGroupName, string resourceGuardsName) + { + operations.DeleteAsync(resourceGroupName, resourceGuardsName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a ResourceGuard resource from the resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// The name of ResourceGuard + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IResourceGuardsOperations operations, string resourceGroupName, string resourceGuardsName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, resourceGuardsName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Updates a ResourceGuard resource belonging to a resource group. For + /// example, updating tags for a resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// The name of ResourceGuard + /// + /// + /// Request body for operation + /// + public static ResourceGuardResource Patch(this IResourceGuardsOperations operations, string resourceGroupName, string resourceGuardsName, PatchResourceRequestInput parameters) + { + return operations.PatchAsync(resourceGroupName, resourceGuardsName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates a ResourceGuard resource belonging to a resource group. For + /// example, updating tags for a resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// The name of ResourceGuard + /// + /// + /// Request body for operation + /// + /// + /// The cancellation token. + /// + public static async Task PatchAsync(this IResourceGuardsOperations operations, string resourceGroupName, string resourceGuardsName, PatchResourceRequestInput parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.PatchWithHttpMessagesAsync(resourceGroupName, resourceGuardsName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// + public static IPage GetDisableSoftDeleteRequestsObjects(this IResourceGuardsOperations operations, string resourceGroupName, string resourceGuardsName) + { + return operations.GetDisableSoftDeleteRequestsObjectsAsync(resourceGroupName, resourceGuardsName).GetAwaiter().GetResult(); + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task> GetDisableSoftDeleteRequestsObjectsAsync(this IResourceGuardsOperations operations, string resourceGroupName, string resourceGuardsName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetDisableSoftDeleteRequestsObjectsWithHttpMessagesAsync(resourceGroupName, resourceGuardsName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// + public static IPage GetDeleteResourceGuardProxyRequestsObjects(this IResourceGuardsOperations operations, string resourceGroupName, string resourceGuardsName) + { + return operations.GetDeleteResourceGuardProxyRequestsObjectsAsync(resourceGroupName, resourceGuardsName).GetAwaiter().GetResult(); + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task> GetDeleteResourceGuardProxyRequestsObjectsAsync(this IResourceGuardsOperations operations, string resourceGroupName, string resourceGuardsName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetDeleteResourceGuardProxyRequestsObjectsWithHttpMessagesAsync(resourceGroupName, resourceGuardsName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// + public static IPage GetBackupSecurityPINRequestsObjects(this IResourceGuardsOperations operations, string resourceGroupName, string resourceGuardsName) + { + return operations.GetBackupSecurityPINRequestsObjectsAsync(resourceGroupName, resourceGuardsName).GetAwaiter().GetResult(); + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task> GetBackupSecurityPINRequestsObjectsAsync(this IResourceGuardsOperations operations, string resourceGroupName, string resourceGuardsName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetBackupSecurityPINRequestsObjectsWithHttpMessagesAsync(resourceGroupName, resourceGuardsName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// + public static IPage GetDeleteProtectedItemRequestsObjects(this IResourceGuardsOperations operations, string resourceGroupName, string resourceGuardsName) + { + return operations.GetDeleteProtectedItemRequestsObjectsAsync(resourceGroupName, resourceGuardsName).GetAwaiter().GetResult(); + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task> GetDeleteProtectedItemRequestsObjectsAsync(this IResourceGuardsOperations operations, string resourceGroupName, string resourceGuardsName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetDeleteProtectedItemRequestsObjectsWithHttpMessagesAsync(resourceGroupName, resourceGuardsName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// + public static IPage GetUpdateProtectionPolicyRequestsObjects(this IResourceGuardsOperations operations, string resourceGroupName, string resourceGuardsName) + { + return operations.GetUpdateProtectionPolicyRequestsObjectsAsync(resourceGroupName, resourceGuardsName).GetAwaiter().GetResult(); + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task> GetUpdateProtectionPolicyRequestsObjectsAsync(this IResourceGuardsOperations operations, string resourceGroupName, string resourceGuardsName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetUpdateProtectionPolicyRequestsObjectsWithHttpMessagesAsync(resourceGroupName, resourceGuardsName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// + public static IPage GetUpdateProtectedItemRequestsObjects(this IResourceGuardsOperations operations, string resourceGroupName, string resourceGuardsName) + { + return operations.GetUpdateProtectedItemRequestsObjectsAsync(resourceGroupName, resourceGuardsName).GetAwaiter().GetResult(); + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task> GetUpdateProtectedItemRequestsObjectsAsync(this IResourceGuardsOperations operations, string resourceGroupName, string resourceGuardsName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetUpdateProtectedItemRequestsObjectsWithHttpMessagesAsync(resourceGroupName, resourceGuardsName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// + /// + /// + public static DppBaseResource GetDefaultDisableSoftDeleteRequestsObject(this IResourceGuardsOperations operations, string resourceGroupName, string resourceGuardsName, string requestName) + { + return operations.GetDefaultDisableSoftDeleteRequestsObjectAsync(resourceGroupName, resourceGuardsName, requestName).GetAwaiter().GetResult(); + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task GetDefaultDisableSoftDeleteRequestsObjectAsync(this IResourceGuardsOperations operations, string resourceGroupName, string resourceGuardsName, string requestName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetDefaultDisableSoftDeleteRequestsObjectWithHttpMessagesAsync(resourceGroupName, resourceGuardsName, requestName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// + /// + /// + public static DppBaseResource GetDefaultDeleteResourceGuardProxyRequestsObject(this IResourceGuardsOperations operations, string resourceGroupName, string resourceGuardsName, string requestName) + { + return operations.GetDefaultDeleteResourceGuardProxyRequestsObjectAsync(resourceGroupName, resourceGuardsName, requestName).GetAwaiter().GetResult(); + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task GetDefaultDeleteResourceGuardProxyRequestsObjectAsync(this IResourceGuardsOperations operations, string resourceGroupName, string resourceGuardsName, string requestName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetDefaultDeleteResourceGuardProxyRequestsObjectWithHttpMessagesAsync(resourceGroupName, resourceGuardsName, requestName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// + /// + /// + public static DppBaseResource GetDefaultBackupSecurityPINRequestsObject(this IResourceGuardsOperations operations, string resourceGroupName, string resourceGuardsName, string requestName) + { + return operations.GetDefaultBackupSecurityPINRequestsObjectAsync(resourceGroupName, resourceGuardsName, requestName).GetAwaiter().GetResult(); + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task GetDefaultBackupSecurityPINRequestsObjectAsync(this IResourceGuardsOperations operations, string resourceGroupName, string resourceGuardsName, string requestName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetDefaultBackupSecurityPINRequestsObjectWithHttpMessagesAsync(resourceGroupName, resourceGuardsName, requestName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// + /// + /// + public static DppBaseResource GetDefaultDeleteProtectedItemRequestsObject(this IResourceGuardsOperations operations, string resourceGroupName, string resourceGuardsName, string requestName) + { + return operations.GetDefaultDeleteProtectedItemRequestsObjectAsync(resourceGroupName, resourceGuardsName, requestName).GetAwaiter().GetResult(); + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task GetDefaultDeleteProtectedItemRequestsObjectAsync(this IResourceGuardsOperations operations, string resourceGroupName, string resourceGuardsName, string requestName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetDefaultDeleteProtectedItemRequestsObjectWithHttpMessagesAsync(resourceGroupName, resourceGuardsName, requestName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// + /// + /// + public static DppBaseResource GetDefaultUpdateProtectionPolicyRequestsObject(this IResourceGuardsOperations operations, string resourceGroupName, string resourceGuardsName, string requestName) + { + return operations.GetDefaultUpdateProtectionPolicyRequestsObjectAsync(resourceGroupName, resourceGuardsName, requestName).GetAwaiter().GetResult(); + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task GetDefaultUpdateProtectionPolicyRequestsObjectAsync(this IResourceGuardsOperations operations, string resourceGroupName, string resourceGuardsName, string requestName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetDefaultUpdateProtectionPolicyRequestsObjectWithHttpMessagesAsync(resourceGroupName, resourceGuardsName, requestName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// + /// + /// + public static DppBaseResource GetDefaultUpdateProtectedItemRequestsObject(this IResourceGuardsOperations operations, string resourceGroupName, string resourceGuardsName, string requestName) + { + return operations.GetDefaultUpdateProtectedItemRequestsObjectAsync(resourceGroupName, resourceGuardsName, requestName).GetAwaiter().GetResult(); + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task GetDefaultUpdateProtectedItemRequestsObjectAsync(this IResourceGuardsOperations operations, string resourceGroupName, string resourceGuardsName, string requestName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetDefaultUpdateProtectedItemRequestsObjectWithHttpMessagesAsync(resourceGroupName, resourceGuardsName, requestName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Returns ResourceGuards collection belonging to a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage GetResourcesInSubscriptionNext(this IResourceGuardsOperations operations, string nextPageLink) + { + return operations.GetResourcesInSubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Returns ResourceGuards collection belonging to a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> GetResourcesInSubscriptionNextAsync(this IResourceGuardsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetResourcesInSubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Returns ResourceGuards collection belonging to a ResourceGroup. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage GetResourcesInResourceGroupNext(this IResourceGuardsOperations operations, string nextPageLink) + { + return operations.GetResourcesInResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Returns ResourceGuards collection belonging to a ResourceGroup. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> GetResourcesInResourceGroupNextAsync(this IResourceGuardsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetResourcesInResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage GetDisableSoftDeleteRequestsObjectsNext(this IResourceGuardsOperations operations, string nextPageLink) + { + return operations.GetDisableSoftDeleteRequestsObjectsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> GetDisableSoftDeleteRequestsObjectsNextAsync(this IResourceGuardsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetDisableSoftDeleteRequestsObjectsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage GetDeleteResourceGuardProxyRequestsObjectsNext(this IResourceGuardsOperations operations, string nextPageLink) + { + return operations.GetDeleteResourceGuardProxyRequestsObjectsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> GetDeleteResourceGuardProxyRequestsObjectsNextAsync(this IResourceGuardsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetDeleteResourceGuardProxyRequestsObjectsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage GetBackupSecurityPINRequestsObjectsNext(this IResourceGuardsOperations operations, string nextPageLink) + { + return operations.GetBackupSecurityPINRequestsObjectsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> GetBackupSecurityPINRequestsObjectsNextAsync(this IResourceGuardsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetBackupSecurityPINRequestsObjectsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage GetDeleteProtectedItemRequestsObjectsNext(this IResourceGuardsOperations operations, string nextPageLink) + { + return operations.GetDeleteProtectedItemRequestsObjectsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> GetDeleteProtectedItemRequestsObjectsNextAsync(this IResourceGuardsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetDeleteProtectedItemRequestsObjectsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage GetUpdateProtectionPolicyRequestsObjectsNext(this IResourceGuardsOperations operations, string nextPageLink) + { + return operations.GetUpdateProtectionPolicyRequestsObjectsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> GetUpdateProtectionPolicyRequestsObjectsNextAsync(this IResourceGuardsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetUpdateProtectionPolicyRequestsObjectsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage GetUpdateProtectedItemRequestsObjectsNext(this IResourceGuardsOperations operations, string nextPageLink) + { + return operations.GetUpdateProtectedItemRequestsObjectsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Returns collection of operation request objects for a critical operation + /// protected by the given ResourceGuard resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> GetUpdateProtectedItemRequestsObjectsNextAsync(this IResourceGuardsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetUpdateProtectedItemRequestsObjectsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/FindRestorableTimeRangesOperations.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/RestorableTimeRangesOperations.cs similarity index 91% rename from sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/FindRestorableTimeRangesOperations.cs rename to sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/RestorableTimeRangesOperations.cs index 81c43ee4743be..2357ca365025c 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/FindRestorableTimeRangesOperations.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/RestorableTimeRangesOperations.cs @@ -23,12 +23,12 @@ namespace Microsoft.Azure.Management.DataProtection using System.Threading.Tasks; /// - /// FindRestorableTimeRangesOperations operations. + /// RestorableTimeRangesOperations operations. /// - internal partial class FindRestorableTimeRangesOperations : IServiceOperations, IFindRestorableTimeRangesOperations + internal partial class RestorableTimeRangesOperations : IServiceOperations, IRestorableTimeRangesOperations { /// - /// Initializes a new instance of the FindRestorableTimeRangesOperations class. + /// Initializes a new instance of the RestorableTimeRangesOperations class. /// /// /// Reference to the service client. @@ -36,7 +36,7 @@ internal partial class FindRestorableTimeRangesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal FindRestorableTimeRangesOperations(DataProtectionClient client) + internal RestorableTimeRangesOperations(DataProtectionClient client) { if (client == null) { @@ -56,7 +56,8 @@ internal FindRestorableTimeRangesOperations(DataProtectionClient client) /// /// The name of the resource group where the backup vault is present. /// - /// + /// + /// The name of the backup instance /// /// /// Request body for operation @@ -82,7 +83,7 @@ internal FindRestorableTimeRangesOperations(DataProtectionClient client) /// /// A response object containing the response body and response headers. /// - public async Task> PostWithHttpMessagesAsync(string vaultName, string resourceGroupName, string backupInstances, AzureBackupFindRestorableTimeRangesRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> FindWithHttpMessagesAsync(string vaultName, string resourceGroupName, string backupInstanceName, AzureBackupFindRestorableTimeRangesRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -100,9 +101,9 @@ internal FindRestorableTimeRangesOperations(DataProtectionClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (backupInstances == null) + if (backupInstanceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "backupInstances"); + throw new ValidationException(ValidationRules.CannotBeNull, "backupInstanceName"); } if (parameters == null) { @@ -121,18 +122,18 @@ internal FindRestorableTimeRangesOperations(DataProtectionClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("backupInstances", backupInstances); + tracingParameters.Add("backupInstanceName", backupInstanceName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Post", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Find", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstances}/findRestorableTimeRanges").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/findRestorableTimeRanges").ToString(); _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{backupInstances}", System.Uri.EscapeDataString(backupInstances)); + _url = _url.Replace("{backupInstanceName}", System.Uri.EscapeDataString(backupInstanceName)); List _queryParameters = new List(); if (Client.ApiVersion != null) { diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/FindRestorableTimeRangesOperationsExtensions.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/RestorableTimeRangesOperationsExtensions.cs similarity index 64% rename from sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/FindRestorableTimeRangesOperationsExtensions.cs rename to sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/RestorableTimeRangesOperationsExtensions.cs index 2db379e2a90b9..97be9ff2db1e5 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/FindRestorableTimeRangesOperationsExtensions.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/RestorableTimeRangesOperationsExtensions.cs @@ -17,9 +17,9 @@ namespace Microsoft.Azure.Management.DataProtection using System.Threading.Tasks; /// - /// Extension methods for FindRestorableTimeRangesOperations. + /// Extension methods for RestorableTimeRangesOperations. /// - public static partial class FindRestorableTimeRangesOperationsExtensions + public static partial class RestorableTimeRangesOperationsExtensions { /// /// The operations group for this extension method. @@ -30,14 +30,15 @@ public static partial class FindRestorableTimeRangesOperationsExtensions /// /// The name of the resource group where the backup vault is present. /// - /// + /// + /// The name of the backup instance /// /// /// Request body for operation /// - public static AzureBackupFindRestorableTimeRangesResponseResource Post(this IFindRestorableTimeRangesOperations operations, string vaultName, string resourceGroupName, string backupInstances, AzureBackupFindRestorableTimeRangesRequest parameters) + public static AzureBackupFindRestorableTimeRangesResponseResource Find(this IRestorableTimeRangesOperations operations, string vaultName, string resourceGroupName, string backupInstanceName, AzureBackupFindRestorableTimeRangesRequest parameters) { - return operations.PostAsync(vaultName, resourceGroupName, backupInstances, parameters).GetAwaiter().GetResult(); + return operations.FindAsync(vaultName, resourceGroupName, backupInstanceName, parameters).GetAwaiter().GetResult(); } /// @@ -49,7 +50,8 @@ public static AzureBackupFindRestorableTimeRangesResponseResource Post(this IFin /// /// The name of the resource group where the backup vault is present. /// - /// + /// + /// The name of the backup instance /// /// /// Request body for operation @@ -57,9 +59,9 @@ public static AzureBackupFindRestorableTimeRangesResponseResource Post(this IFin /// /// The cancellation token. /// - public static async Task PostAsync(this IFindRestorableTimeRangesOperations operations, string vaultName, string resourceGroupName, string backupInstances, AzureBackupFindRestorableTimeRangesRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task FindAsync(this IRestorableTimeRangesOperations operations, string vaultName, string resourceGroupName, string backupInstanceName, AzureBackupFindRestorableTimeRangesRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.PostWithHttpMessagesAsync(vaultName, resourceGroupName, backupInstances, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.FindWithHttpMessagesAsync(vaultName, resourceGroupName, backupInstanceName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/SdkInfo_DataProtectionClient.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/SdkInfo_DataProtectionClient.cs index 06ed32cdae184..d122a4fd5b9d8 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/SdkInfo_DataProtectionClient.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/SdkInfo_DataProtectionClient.cs @@ -19,32 +19,30 @@ public static IEnumerable> ApiInfo_DataProtectionC { return new Tuple[] { - new Tuple("DataProtection", "BackupInstances", "2021-01-01"), - new Tuple("DataProtection", "BackupPolicies", "2021-01-01"), - new Tuple("DataProtection", "BackupVaults", "2021-01-01"), - new Tuple("DataProtection", "CheckFeatureSupport", "2021-01-01"), - new Tuple("DataProtection", "ExportJobs", "2021-01-01"), - new Tuple("DataProtection", "ExportJobsOperationResult", "2021-01-01"), - new Tuple("DataProtection", "FindRestorableTimeRanges", "2021-01-01"), - new Tuple("DataProtection", "GetOperationResultPatch", "2021-01-01"), - new Tuple("DataProtection", "GetOperationStatus", "2021-01-01"), - new Tuple("DataProtection", "Job", "2021-01-01"), - new Tuple("DataProtection", "Jobs", "2021-01-01"), - new Tuple("DataProtection", "OperationResult", "2021-01-01"), - new Tuple("DataProtection", "Operations", "2021-01-01"), - new Tuple("DataProtection", "RecoveryPoint", "2021-01-01"), - new Tuple("DataProtection", "RecoveryPoints", "2021-01-01"), + new Tuple("DataProtection", "BackupInstances", "2021-07-01"), + new Tuple("DataProtection", "BackupPolicies", "2021-07-01"), + new Tuple("DataProtection", "BackupVaultOperationResults", "2021-07-01"), + new Tuple("DataProtection", "BackupVaults", "2021-07-01"), + new Tuple("DataProtection", "DataProtection", "2021-07-01"), + new Tuple("DataProtection", "DataProtectionOperations", "2021-07-01"), + new Tuple("DataProtection", "ExportJobs", "2021-07-01"), + new Tuple("DataProtection", "ExportJobsOperationResult", "2021-07-01"), + new Tuple("DataProtection", "Jobs", "2021-07-01"), + new Tuple("DataProtection", "OperationResult", "2021-07-01"), + new Tuple("DataProtection", "OperationStatus", "2021-07-01"), + new Tuple("DataProtection", "RecoveryPoints", "2021-07-01"), + new Tuple("DataProtection", "ResourceGuards", "2021-07-01"), + new Tuple("DataProtection", "RestorableTimeRanges", "2021-07-01"), }.AsEnumerable(); } } // BEGIN: Code Generation Metadata Section public static readonly String AutoRestVersion = "v2"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4413"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/dataprotection/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=C:\\One\\github\\mayank\\azure-sdk-for-net\\sdk"; - + public static readonly String AutoRestBootStrapperVersion = "autorest@3.3.2"; + public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/main/specification/dataprotection/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=D:\\SDK_DPP\\azure-sdk-for-net\\sdk"; public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "e1ab90da9a49c2f22ed2d836332a00a2b12cc4e1"; + public static readonly String GithubBranchName = "main"; + public static readonly String GithubCommidId = "b49af808cba06f45b01193623ce1ff9e2e017777"; public static readonly String CodeGenerationErrors = ""; public static readonly String GithubRepoName = "azure-rest-api-specs"; // END: Code Generation Metadata Section diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Microsoft.Azure.Management.DataProtection.Backup.csproj b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Microsoft.Azure.Management.DataProtection.Backup.csproj index dcac2e9826092..d2503c2d89509 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Microsoft.Azure.Management.DataProtection.Backup.csproj +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Microsoft.Azure.Management.DataProtection.Backup.csproj @@ -6,13 +6,13 @@ Microsoft.Azure.Management.DataProtection.Backup Provides developers with libraries for data protection under Azure Resource manager. - 1.0.0-beta.1 + 2.0.0.1 Microsoft.Azure.Management.DataProtection.Backup DataProtection;Backup; diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Properties/AssemblyInfo.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Properties/AssemblyInfo.cs index 5fa85127fae16..5c0c6a81b8357 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Properties/AssemblyInfo.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Properties/AssemblyInfo.cs @@ -8,7 +8,7 @@ [assembly: AssemblyDescription("Provides management functionality for Microsoft Azure DataProtection Resources.")] [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("2.0.0.1")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] [assembly: AssemblyProduct("Microsoft Azure .NET SDK")] diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/tests/SessionRecords/DPPDisksE2ETests/DisksE2ETests.json b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/tests/SessionRecords/DPPDisksE2ETests/DisksE2ETests.json index 19d52db9c4f92..865660bc0b779 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/tests/SessionRecords/DPPDisksE2ETests/DisksE2ETests.json +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/tests/SessionRecords/DPPDisksE2ETests/DisksE2ETests.json @@ -1,1890 +1,1890 @@ { "Entries": [ { - "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/backupVaults/DiskbackupVault2?api-version=2021-01-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Jlc291cmNlR3JvdXBzL21heWFnZ2FyRGlza1JHL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vYmFja3VwVmF1bHRzL0Rpc2tiYWNrdXBWYXVsdDI/YXBpLXZlcnNpb249MjAyMS0wMS0wMQ==", - "RequestMethod": "PUT", - "RequestBody": "{\r\n \"properties\": {\r\n \"storageSettings\": [\r\n {\r\n \"datastoreType\": \"VaultStore\",\r\n \"type\": \"ZonallyRedundant\"\r\n },\r\n {\r\n \"datastoreType\": \"OperationalStore\",\r\n \"type\": \"ZonallyRedundant\"\r\n }\r\n ]\r\n },\r\n \"identity\": {\r\n \"type\": \"systemAssigned\"\r\n },\r\n \"location\": \"southeastasia\"\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "9347cc14-3959-4ab7-b754-7e989a4bc7a7" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.29916.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "341" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Retry-After": [ - "10" - ], - "Azure-AsyncOperation": [ - "https://management.azure.com/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzYwZjEyMmM1LTY5YjktNGVlNi1hMzRiLTA0YmRkZmViNDhlMA==?api-version=2021-01-01" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "x-ms-request-id": [ - "" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-resource-requests": [ - "99" - ], - "x-ms-correlation-request-id": [ - "0a48fbd6-a591-42cd-b620-b1487058ce9a" - ], - "x-ms-routing-request-id": [ - "WESTINDIA:20210512T114637Z:0a48fbd6-a591-42cd-b620-b1487058ce9a" - ], - "Date": [ - "Wed, 12 May 2021 11:46:36 GMT" - ], - "Content-Length": [ - "445" - ], - "Content-Type": [ - "application/json" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"location\": \"southeastasia\",\r\n \"id\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/backupVaults/DiskbackupVault2\",\r\n \"name\": \"DiskbackupVault2\",\r\n \"type\": \"Microsoft.DataProtection/backupVaults\",\r\n \"properties\": {\r\n \"provisioningState\": \"Provisioning\",\r\n \"storageSettings\": [\r\n {\r\n \"datastoreType\": \"VaultStore\",\r\n \"type\": \"ZonallyRedundant\"\r\n },\r\n {\r\n \"datastoreType\": \"OperationalStore\",\r\n \"type\": \"ZonallyRedundant\"\r\n }\r\n ]\r\n }\r\n}", - "StatusCode": 201 + "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/backupVaults/DiskbackupVault2?api-version=2021-07-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Jlc291cmNlR3JvdXBzL21heWFnZ2FyRGlza1JHL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vYmFja3VwVmF1bHRzL0Rpc2tiYWNrdXBWYXVsdDI/YXBpLXZlcnNpb249MjAyMS0wNy0wMQ==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"storageSettings\": [\r\n {\r\n \"datastoreType\": \"VaultStore\",\r\n \"type\": \"ZonallyRedundant\"\r\n },\r\n {\r\n \"datastoreType\": \"OperationalStore\",\r\n \"type\": \"ZonallyRedundant\"\r\n }\r\n ]\r\n },\r\n \"identity\": {\r\n \"type\": \"systemAssigned\"\r\n },\r\n \"location\": \"southeastasia\"\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "9347cc14-3959-4ab7-b754-7e989a4bc7a7" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.29916.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "341" + ] }, - { - "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzYwZjEyMmM1LTY5YjktNGVlNi1hMzRiLTA0YmRkZmViNDhlMA==?api-version=2021-01-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vbG9jYXRpb25zL3NvdXRoZWFzdGFzaWEvb3BlcmF0aW9uU3RhdHVzL1pHTTRaVFJpT0RndFltWXlNeTAwT1RnMExUbG1aRFF0TURrNE56a3dOakkzTkRReE96WXdaakV5TW1NMUxUWTVZamt0TkdWbE5pMWhNelJpTFRBMFltUmtabVZpTkRobE1BPT0/YXBpLXZlcnNpb249MjAyMS0wMS0wMQ==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.29916.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "x-ms-request-id": [ - "" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11999" - ], - "x-ms-correlation-request-id": [ - "ef3a6bd3-4a50-45eb-b9e0-200d78fc4672" - ], - "x-ms-routing-request-id": [ - "WESTINDIA:20210512T114648Z:ef3a6bd3-4a50-45eb-b9e0-200d78fc4672" - ], - "Date": [ - "Wed, 12 May 2021 11:46:47 GMT" - ], - "Content-Length": [ - "443" - ], - "Content-Type": [ - "application/json" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzYwZjEyMmM1LTY5YjktNGVlNi1hMzRiLTA0YmRkZmViNDhlMA==\",\r\n \"name\": \"ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzYwZjEyMmM1LTY5YjktNGVlNi1hMzRiLTA0YmRkZmViNDhlMA==\",\r\n \"status\": \"Succeeded\",\r\n \"startTime\": \"2021-05-12T11:46:36.9721372Z\",\r\n \"endTime\": \"2021-05-12T11:46:40Z\"\r\n}", - "StatusCode": 200 + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "10" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzYwZjEyMmM1LTY5YjktNGVlNi1hMzRiLTA0YmRkZmViNDhlMA==?api-version=2021-07-01" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "99" + ], + "x-ms-correlation-request-id": [ + "0a48fbd6-a591-42cd-b620-b1487058ce9a" + ], + "x-ms-routing-request-id": [ + "WESTINDIA:20210512T114637Z:0a48fbd6-a591-42cd-b620-b1487058ce9a" + ], + "Date": [ + "Wed, 12 May 2021 11:46:36 GMT" + ], + "Content-Length": [ + "445" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ] }, - { - "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/backupVaults/DiskbackupVault2?api-version=2021-01-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Jlc291cmNlR3JvdXBzL21heWFnZ2FyRGlza1JHL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vYmFja3VwVmF1bHRzL0Rpc2tiYWNrdXBWYXVsdDI/YXBpLXZlcnNpb249MjAyMS0wMS0wMQ==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.29916.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "x-ms-request-id": [ - "" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11998" - ], - "x-ms-correlation-request-id": [ - "a3d0645e-d514-4f23-8f73-05a9545fc702" - ], - "x-ms-routing-request-id": [ - "WESTINDIA:20210512T114648Z:a3d0645e-d514-4f23-8f73-05a9545fc702" - ], - "Date": [ - "Wed, 12 May 2021 11:46:48 GMT" - ], - "Content-Length": [ - "582" - ], - "Content-Type": [ - "application/json" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"location\": \"southeastasia\",\r\n \"identity\": {\r\n \"type\": \"SystemAssigned\",\r\n \"principalId\": \"f5fb38ca-d125-4b34-9f58-93d2c6b721b7\",\r\n \"tenantId\": \"72f988bf-86f1-41af-91ab-2d7cd011db47\"\r\n },\r\n \"id\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/backupVaults/DiskbackupVault2\",\r\n \"name\": \"DiskbackupVault2\",\r\n \"type\": \"Microsoft.DataProtection/backupVaults\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"storageSettings\": [\r\n {\r\n \"datastoreType\": \"VaultStore\",\r\n \"type\": \"ZonallyRedundant\"\r\n },\r\n {\r\n \"datastoreType\": \"OperationalStore\",\r\n \"type\": \"ZonallyRedundant\"\r\n }\r\n ]\r\n }\r\n}", - "StatusCode": 200 + "ResponseBody": "{\r\n \"location\": \"southeastasia\",\r\n \"id\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/backupVaults/DiskbackupVault2\",\r\n \"name\": \"DiskbackupVault2\",\r\n \"type\": \"Microsoft.DataProtection/backupVaults\",\r\n \"properties\": {\r\n \"provisioningState\": \"Provisioning\",\r\n \"storageSettings\": [\r\n {\r\n \"datastoreType\": \"VaultStore\",\r\n \"type\": \"ZonallyRedundant\"\r\n },\r\n {\r\n \"datastoreType\": \"OperationalStore\",\r\n \"type\": \"ZonallyRedundant\"\r\n }\r\n ]\r\n }\r\n}", + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzYwZjEyMmM1LTY5YjktNGVlNi1hMzRiLTA0YmRkZmViNDhlMA==?api-version=2021-07-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vbG9jYXRpb25zL3NvdXRoZWFzdGFzaWEvb3BlcmF0aW9uU3RhdHVzL1pHTTRaVFJpT0RndFltWXlNeTAwT1RnMExUbG1aRFF0TURrNE56a3dOakkzTkRReE96WXdaakV5TW1NMUxUWTVZamt0TkdWbE5pMWhNelJpTFRBMFltUmtabVZpTkRobE1BPT0/YXBpLXZlcnNpb249MjAyMS0wNy0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.29916.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" + ] }, - { - "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/backupVaults/DiskbackupVault2?api-version=2021-01-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Jlc291cmNlR3JvdXBzL21heWFnZ2FyRGlza1JHL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vYmFja3VwVmF1bHRzL0Rpc2tiYWNrdXBWYXVsdDI/YXBpLXZlcnNpb249MjAyMS0wMS0wMQ==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "7d2fee9c-1621-4032-9357-66862325ebbe" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.29916.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "x-ms-request-id": [ - "" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11998" - ], - "x-ms-correlation-request-id": [ - "4c22c838-5daf-4c3a-a53e-ed1f8442fb51" - ], - "x-ms-routing-request-id": [ - "JIOINDIAWEST:20210512T123738Z:4c22c838-5daf-4c3a-a53e-ed1f8442fb51" - ], - "Date": [ - "Wed, 12 May 2021 12:37:38 GMT" - ], - "Content-Length": [ - "582" - ], - "Content-Type": [ - "application/json" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"location\": \"southeastasia\",\r\n \"identity\": {\r\n \"type\": \"SystemAssigned\",\r\n \"principalId\": \"f5fb38ca-d125-4b34-9f58-93d2c6b721b7\",\r\n \"tenantId\": \"72f988bf-86f1-41af-91ab-2d7cd011db47\"\r\n },\r\n \"id\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/backupVaults/DiskbackupVault2\",\r\n \"name\": \"DiskbackupVault2\",\r\n \"type\": \"Microsoft.DataProtection/backupVaults\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"storageSettings\": [\r\n {\r\n \"datastoreType\": \"VaultStore\",\r\n \"type\": \"ZonallyRedundant\"\r\n },\r\n {\r\n \"datastoreType\": \"OperationalStore\",\r\n \"type\": \"ZonallyRedundant\"\r\n }\r\n ]\r\n }\r\n}", - "StatusCode": 200 + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11999" + ], + "x-ms-correlation-request-id": [ + "ef3a6bd3-4a50-45eb-b9e0-200d78fc4672" + ], + "x-ms-routing-request-id": [ + "WESTINDIA:20210512T114648Z:ef3a6bd3-4a50-45eb-b9e0-200d78fc4672" + ], + "Date": [ + "Wed, 12 May 2021 11:46:47 GMT" + ], + "Content-Length": [ + "443" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ] }, - { - "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/backupVaults/DiskbackupVault2/backupPolicies/retentionpolicy2?api-version=2021-01-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Jlc291cmNlR3JvdXBzL21heWFnZ2FyRGlza1JHL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vYmFja3VwVmF1bHRzL0Rpc2tiYWNrdXBWYXVsdDIvYmFja3VwUG9saWNpZXMvcmV0ZW50aW9ucG9saWN5Mj9hcGktdmVyc2lvbj0yMDIxLTAxLTAx", - "RequestMethod": "PUT", - "RequestBody": "{\r\n \"properties\": {\r\n \"objectType\": \"BackupPolicy\",\r\n \"policyRules\": [\r\n {\r\n \"objectType\": \"AzureBackupRule\",\r\n \"backupParameters\": {\r\n \"objectType\": \"AzureBackupParams\",\r\n \"backupType\": \"Incremental\"\r\n },\r\n \"dataStore\": {\r\n \"dataStoreType\": \"OperationalStore\",\r\n \"objectType\": \"DataStoreInfoBase\"\r\n },\r\n \"trigger\": {\r\n \"objectType\": \"ScheduleBasedTriggerContext\",\r\n \"schedule\": {\r\n \"repeatingTimeIntervals\": [\r\n \"R/2019-12-26T13:08:27.8535071Z/PT4H\"\r\n ]\r\n },\r\n \"taggingCriteria\": [\r\n {\r\n \"isDefault\": true,\r\n \"taggingPriority\": 99,\r\n \"tagInfo\": {\r\n \"tagName\": \"Default\"\r\n }\r\n }\r\n ]\r\n },\r\n \"name\": \"BackupHourly\"\r\n },\r\n {\r\n \"objectType\": \"AzureRetentionRule\",\r\n \"isDefault\": true,\r\n \"lifecycles\": [\r\n {\r\n \"deleteAfter\": {\r\n \"objectType\": \"AbsoluteDeleteOption\",\r\n \"duration\": \"P1W\"\r\n },\r\n \"sourceDataStore\": {\r\n \"dataStoreType\": \"OperationalStore\",\r\n \"objectType\": \"DataStoreInfoBase\"\r\n }\r\n }\r\n ],\r\n \"name\": \"Default\"\r\n }\r\n ],\r\n \"datasourceTypes\": [\r\n \"Microsoft.Compute/disks\"\r\n ]\r\n }\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "c2c4df41-5165-44da-b43b-016ce1cb72d5" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.29916.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "1440" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "x-ms-request-id": [ - "" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" - ], - "x-ms-correlation-request-id": [ - "b6a81e63-4729-4801-af67-34a46bfe8310" - ], - "x-ms-routing-request-id": [ - "WESTINDIA:20210512T123903Z:b6a81e63-4729-4801-af67-34a46bfe8310" - ], - "Date": [ - "Wed, 12 May 2021 12:39:03 GMT" - ], - "Content-Length": [ - "1083" - ], - "Content-Type": [ - "application/json" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/backupVaults/DiskbackupVault2/backupPolicies/retentionpolicy2\",\r\n \"name\": \"retentionpolicy2\",\r\n \"type\": \"Microsoft.DataProtection/backupVaults/backupPolicies\",\r\n \"properties\": {\r\n \"policyRules\": [\r\n {\r\n \"backupParameters\": {\r\n \"backupType\": \"Incremental\",\r\n \"objectType\": \"AzureBackupParams\"\r\n },\r\n \"trigger\": {\r\n \"schedule\": {\r\n \"repeatingTimeIntervals\": [\r\n \"R/2019-12-26T13:08:27.8535071Z/PT4H\"\r\n ]\r\n },\r\n \"taggingCriteria\": [\r\n {\r\n \"tagInfo\": {\r\n \"tagName\": \"Default\",\r\n \"id\": \"Default_\"\r\n },\r\n \"taggingPriority\": 99,\r\n \"isDefault\": true\r\n }\r\n ],\r\n \"objectType\": \"ScheduleBasedTriggerContext\"\r\n },\r\n \"dataStore\": {\r\n \"dataStoreType\": \"OperationalStore\",\r\n \"objectType\": \"DataStoreInfoBase\"\r\n },\r\n \"name\": \"BackupHourly\",\r\n \"objectType\": \"AzureBackupRule\"\r\n },\r\n {\r\n \"lifecycles\": [\r\n {\r\n \"deleteAfter\": {\r\n \"objectType\": \"AbsoluteDeleteOption\",\r\n \"duration\": \"P1W\"\r\n },\r\n \"sourceDataStore\": {\r\n \"dataStoreType\": \"OperationalStore\",\r\n \"objectType\": \"DataStoreInfoBase\"\r\n }\r\n }\r\n ],\r\n \"isDefault\": true,\r\n \"name\": \"Default\",\r\n \"objectType\": \"AzureRetentionRule\"\r\n }\r\n ],\r\n \"datasourceTypes\": [\r\n \"Microsoft.Compute/disks\"\r\n ],\r\n \"objectType\": \"BackupPolicy\"\r\n }\r\n}", - "StatusCode": 200 + "ResponseBody": "{\r\n \"id\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzYwZjEyMmM1LTY5YjktNGVlNi1hMzRiLTA0YmRkZmViNDhlMA==\",\r\n \"name\": \"ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzYwZjEyMmM1LTY5YjktNGVlNi1hMzRiLTA0YmRkZmViNDhlMA==\",\r\n \"status\": \"Succeeded\",\r\n \"startTime\": \"2021-05-12T11:46:36.9721372Z\",\r\n \"endTime\": \"2021-05-12T11:46:40Z\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/backupVaults/DiskbackupVault2?api-version=2021-07-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Jlc291cmNlR3JvdXBzL21heWFnZ2FyRGlza1JHL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vYmFja3VwVmF1bHRzL0Rpc2tiYWNrdXBWYXVsdDI/YXBpLXZlcnNpb249MjAyMS0wNy0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.29916.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" + ] }, - { - "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/backupVaults/DiskbackupVault2/backupPolicies/retentionpolicy2?api-version=2021-01-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Jlc291cmNlR3JvdXBzL21heWFnZ2FyRGlza1JHL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vYmFja3VwVmF1bHRzL0Rpc2tiYWNrdXBWYXVsdDIvYmFja3VwUG9saWNpZXMvcmV0ZW50aW9ucG9saWN5Mj9hcGktdmVyc2lvbj0yMDIxLTAxLTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "f73f2145-e40c-4b99-8f25-77b2a37be94e" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.29916.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "x-ms-request-id": [ - "" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11999" - ], - "x-ms-correlation-request-id": [ - "f32557e6-7986-4450-9148-9be4ef7def63" - ], - "x-ms-routing-request-id": [ - "JIOINDIAWEST:20210512T124040Z:f32557e6-7986-4450-9148-9be4ef7def63" - ], - "Date": [ - "Wed, 12 May 2021 12:40:40 GMT" - ], - "Content-Length": [ - "1083" - ], - "Content-Type": [ - "application/json" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/backupVaults/DiskbackupVault2/backupPolicies/retentionpolicy2\",\r\n \"name\": \"retentionpolicy2\",\r\n \"type\": \"Microsoft.DataProtection/backupVaults/backupPolicies\",\r\n \"properties\": {\r\n \"policyRules\": [\r\n {\r\n \"backupParameters\": {\r\n \"backupType\": \"Incremental\",\r\n \"objectType\": \"AzureBackupParams\"\r\n },\r\n \"trigger\": {\r\n \"schedule\": {\r\n \"repeatingTimeIntervals\": [\r\n \"R/2019-12-26T13:08:27.8535071Z/PT4H\"\r\n ]\r\n },\r\n \"taggingCriteria\": [\r\n {\r\n \"tagInfo\": {\r\n \"tagName\": \"Default\",\r\n \"id\": \"Default_\"\r\n },\r\n \"taggingPriority\": 99,\r\n \"isDefault\": true\r\n }\r\n ],\r\n \"objectType\": \"ScheduleBasedTriggerContext\"\r\n },\r\n \"dataStore\": {\r\n \"dataStoreType\": \"OperationalStore\",\r\n \"objectType\": \"DataStoreInfoBase\"\r\n },\r\n \"name\": \"BackupHourly\",\r\n \"objectType\": \"AzureBackupRule\"\r\n },\r\n {\r\n \"lifecycles\": [\r\n {\r\n \"deleteAfter\": {\r\n \"objectType\": \"AbsoluteDeleteOption\",\r\n \"duration\": \"P1W\"\r\n },\r\n \"sourceDataStore\": {\r\n \"dataStoreType\": \"OperationalStore\",\r\n \"objectType\": \"DataStoreInfoBase\"\r\n }\r\n }\r\n ],\r\n \"isDefault\": true,\r\n \"name\": \"Default\",\r\n \"objectType\": \"AzureRetentionRule\"\r\n }\r\n ],\r\n \"datasourceTypes\": [\r\n \"Microsoft.Compute/disks\"\r\n ],\r\n \"objectType\": \"BackupPolicy\"\r\n }\r\n}", - "StatusCode": 200 + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11998" + ], + "x-ms-correlation-request-id": [ + "a3d0645e-d514-4f23-8f73-05a9545fc702" + ], + "x-ms-routing-request-id": [ + "WESTINDIA:20210512T114648Z:a3d0645e-d514-4f23-8f73-05a9545fc702" + ], + "Date": [ + "Wed, 12 May 2021 11:46:48 GMT" + ], + "Content-Length": [ + "582" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ] }, - { - "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/backupVaults/DiskbackupVault2/validateForBackup?api-version=2021-01-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Jlc291cmNlR3JvdXBzL21heWFnZ2FyRGlza1JHL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vYmFja3VwVmF1bHRzL0Rpc2tiYWNrdXBWYXVsdDIvdmFsaWRhdGVGb3JCYWNrdXA/YXBpLXZlcnNpb249MjAyMS0wMS0wMQ==", - "RequestMethod": "POST", - "RequestBody": "{\r\n \"backupInstance\": {\r\n \"dataSourceInfo\": {\r\n \"datasourceType\": \"Microsoft.Compute/disks\",\r\n \"objectType\": \"Datasource\",\r\n \"resourceID\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.Compute/disks/testingDisk\",\r\n \"resourceLocation\": \"southeastasia\",\r\n \"resourceName\": \"testingDisk\",\r\n \"resourceType\": \"Microsoft.Compute/disks\",\r\n \"resourceUri\": \"\"\r\n },\r\n \"policyInfo\": {\r\n \"policyId\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/BackupVaults/DiskbackupVault2/backupPolicies/retentionpolicy2\",\r\n \"policyParameters\": {\r\n \"dataStoreParametersList\": [\r\n {\r\n \"objectType\": \"AzureOperationalStoreParameters\",\r\n \"resourceGroupId\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarOTDSRG\",\r\n \"dataStoreType\": \"OperationalStore\"\r\n }\r\n ]\r\n }\r\n },\r\n \"objectType\": \"BackupInstance\"\r\n }\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "fcac9627-f828-4167-b822-6eb6a396f570" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.29916.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "1068" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationResults/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzZlY2M3MDYyLWQ5NDItNGU3ZC1iM2M5LTYwYWFhNTlhOTQ0Yg==?api-version=2021-01-01" - ], - "Retry-After": [ - "10" - ], - "Azure-AsyncOperation": [ - "https://management.azure.com/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzZlY2M3MDYyLWQ5NDItNGU3ZC1iM2M5LTYwYWFhNTlhOTQ0Yg==?api-version=2021-01-01" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "x-ms-request-id": [ - "" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" - ], - "x-ms-correlation-request-id": [ - "0af34d46-0fbc-40b4-a914-24010fb0c776" - ], - "x-ms-routing-request-id": [ - "WESTINDIA:20210512T133147Z:0af34d46-0fbc-40b4-a914-24010fb0c776" - ], - "Date": [ - "Wed, 12 May 2021 13:31:47 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 + "ResponseBody": "{\r\n \"location\": \"southeastasia\",\r\n \"identity\": {\r\n \"type\": \"SystemAssigned\",\r\n \"principalId\": \"f5fb38ca-d125-4b34-9f58-93d2c6b721b7\",\r\n \"tenantId\": \"72f988bf-86f1-41af-91ab-2d7cd011db47\"\r\n },\r\n \"id\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/backupVaults/DiskbackupVault2\",\r\n \"name\": \"DiskbackupVault2\",\r\n \"type\": \"Microsoft.DataProtection/backupVaults\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"storageSettings\": [\r\n {\r\n \"datastoreType\": \"VaultStore\",\r\n \"type\": \"ZonallyRedundant\"\r\n },\r\n {\r\n \"datastoreType\": \"OperationalStore\",\r\n \"type\": \"ZonallyRedundant\"\r\n }\r\n ]\r\n }\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/backupVaults/DiskbackupVault2?api-version=2021-07-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Jlc291cmNlR3JvdXBzL21heWFnZ2FyRGlza1JHL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vYmFja3VwVmF1bHRzL0Rpc2tiYWNrdXBWYXVsdDI/YXBpLXZlcnNpb249MjAyMS0wNy0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "7d2fee9c-1621-4032-9357-66862325ebbe" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.29916.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" + ] }, - { - "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzZlY2M3MDYyLWQ5NDItNGU3ZC1iM2M5LTYwYWFhNTlhOTQ0Yg==?api-version=2021-01-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vbG9jYXRpb25zL3NvdXRoZWFzdGFzaWEvb3BlcmF0aW9uU3RhdHVzL1pHTTRaVFJpT0RndFltWXlNeTAwT1RnMExUbG1aRFF0TURrNE56a3dOakkzTkRReE96WmxZMk0zTURZeUxXUTVOREl0TkdVM1pDMWlNMk01TFRZd1lXRmhOVGxoT1RRMFlnPT0/YXBpLXZlcnNpb249MjAyMS0wMS0wMQ==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.29916.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "x-ms-request-id": [ - "" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11997" - ], - "x-ms-correlation-request-id": [ - "76fc2825-2b94-45e1-8bc5-8a306a021562" - ], - "x-ms-routing-request-id": [ - "WESTINDIA:20210512T133158Z:76fc2825-2b94-45e1-8bc5-8a306a021562" - ], - "Date": [ - "Wed, 12 May 2021 13:31:57 GMT" - ], - "Content-Length": [ - "443" - ], - "Content-Type": [ - "application/json" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzZlY2M3MDYyLWQ5NDItNGU3ZC1iM2M5LTYwYWFhNTlhOTQ0Yg==\",\r\n \"name\": \"ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzZlY2M3MDYyLWQ5NDItNGU3ZC1iM2M5LTYwYWFhNTlhOTQ0Yg==\",\r\n \"status\": \"Inprogress\",\r\n \"startTime\": \"2021-05-12T13:31:47.6689002Z\",\r\n \"endTime\": \"0001-01-01T00:00:00\"\r\n}", - "StatusCode": 200 + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11998" + ], + "x-ms-correlation-request-id": [ + "4c22c838-5daf-4c3a-a53e-ed1f8442fb51" + ], + "x-ms-routing-request-id": [ + "JIOINDIAWEST:20210512T123738Z:4c22c838-5daf-4c3a-a53e-ed1f8442fb51" + ], + "Date": [ + "Wed, 12 May 2021 12:37:38 GMT" + ], + "Content-Length": [ + "582" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ] }, - { - "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzZlY2M3MDYyLWQ5NDItNGU3ZC1iM2M5LTYwYWFhNTlhOTQ0Yg==?api-version=2021-01-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vbG9jYXRpb25zL3NvdXRoZWFzdGFzaWEvb3BlcmF0aW9uU3RhdHVzL1pHTTRaVFJpT0RndFltWXlNeTAwT1RnMExUbG1aRFF0TURrNE56a3dOakkzTkRReE96WmxZMk0zTURZeUxXUTVOREl0TkdVM1pDMWlNMk01TFRZd1lXRmhOVGxoT1RRMFlnPT0/YXBpLXZlcnNpb249MjAyMS0wMS0wMQ==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.29916.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "x-ms-request-id": [ - "" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11996" - ], - "x-ms-correlation-request-id": [ - "3bc4af50-258c-46a8-8a79-5e0e7bbd8262" - ], - "x-ms-routing-request-id": [ - "WESTINDIA:20210512T133208Z:3bc4af50-258c-46a8-8a79-5e0e7bbd8262" - ], - "Date": [ - "Wed, 12 May 2021 13:32:07 GMT" - ], - "Content-Length": [ - "443" - ], - "Content-Type": [ - "application/json" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzZlY2M3MDYyLWQ5NDItNGU3ZC1iM2M5LTYwYWFhNTlhOTQ0Yg==\",\r\n \"name\": \"ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzZlY2M3MDYyLWQ5NDItNGU3ZC1iM2M5LTYwYWFhNTlhOTQ0Yg==\",\r\n \"status\": \"Inprogress\",\r\n \"startTime\": \"2021-05-12T13:31:47.6689002Z\",\r\n \"endTime\": \"0001-01-01T00:00:00\"\r\n}", - "StatusCode": 200 + "ResponseBody": "{\r\n \"location\": \"southeastasia\",\r\n \"identity\": {\r\n \"type\": \"SystemAssigned\",\r\n \"principalId\": \"f5fb38ca-d125-4b34-9f58-93d2c6b721b7\",\r\n \"tenantId\": \"72f988bf-86f1-41af-91ab-2d7cd011db47\"\r\n },\r\n \"id\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/backupVaults/DiskbackupVault2\",\r\n \"name\": \"DiskbackupVault2\",\r\n \"type\": \"Microsoft.DataProtection/backupVaults\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"storageSettings\": [\r\n {\r\n \"datastoreType\": \"VaultStore\",\r\n \"type\": \"ZonallyRedundant\"\r\n },\r\n {\r\n \"datastoreType\": \"OperationalStore\",\r\n \"type\": \"ZonallyRedundant\"\r\n }\r\n ]\r\n }\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/backupVaults/DiskbackupVault2/backupPolicies/retentionpolicy2?api-version=2021-07-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Jlc291cmNlR3JvdXBzL21heWFnZ2FyRGlza1JHL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vYmFja3VwVmF1bHRzL0Rpc2tiYWNrdXBWYXVsdDIvYmFja3VwUG9saWNpZXMvcmV0ZW50aW9ucG9saWN5Mj9hcGktdmVyc2lvbj0yMDIxLTA3LTAx", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"objectType\": \"BackupPolicy\",\r\n \"policyRules\": [\r\n {\r\n \"objectType\": \"AzureBackupRule\",\r\n \"backupParameters\": {\r\n \"objectType\": \"AzureBackupParams\",\r\n \"backupType\": \"Incremental\"\r\n },\r\n \"dataStore\": {\r\n \"dataStoreType\": \"OperationalStore\",\r\n \"objectType\": \"DataStoreInfoBase\"\r\n },\r\n \"trigger\": {\r\n \"objectType\": \"ScheduleBasedTriggerContext\",\r\n \"schedule\": {\r\n \"repeatingTimeIntervals\": [\r\n \"R/2019-12-26T13:08:27.8535071Z/PT4H\"\r\n ]\r\n },\r\n \"taggingCriteria\": [\r\n {\r\n \"isDefault\": true,\r\n \"taggingPriority\": 99,\r\n \"tagInfo\": {\r\n \"tagName\": \"Default\"\r\n }\r\n }\r\n ]\r\n },\r\n \"name\": \"BackupHourly\"\r\n },\r\n {\r\n \"objectType\": \"AzureRetentionRule\",\r\n \"isDefault\": true,\r\n \"lifecycles\": [\r\n {\r\n \"deleteAfter\": {\r\n \"objectType\": \"AbsoluteDeleteOption\",\r\n \"duration\": \"P1W\"\r\n },\r\n \"sourceDataStore\": {\r\n \"dataStoreType\": \"OperationalStore\",\r\n \"objectType\": \"DataStoreInfoBase\"\r\n }\r\n }\r\n ],\r\n \"name\": \"Default\"\r\n }\r\n ],\r\n \"datasourceTypes\": [\r\n \"Microsoft.Compute/disks\"\r\n ]\r\n }\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "c2c4df41-5165-44da-b43b-016ce1cb72d5" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.29916.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "1440" + ] }, - { - "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzZlY2M3MDYyLWQ5NDItNGU3ZC1iM2M5LTYwYWFhNTlhOTQ0Yg==?api-version=2021-01-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vbG9jYXRpb25zL3NvdXRoZWFzdGFzaWEvb3BlcmF0aW9uU3RhdHVzL1pHTTRaVFJpT0RndFltWXlNeTAwT1RnMExUbG1aRFF0TURrNE56a3dOakkzTkRReE96WmxZMk0zTURZeUxXUTVOREl0TkdVM1pDMWlNMk01TFRZd1lXRmhOVGxoT1RRMFlnPT0/YXBpLXZlcnNpb249MjAyMS0wMS0wMQ==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.29916.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "x-ms-request-id": [ - "" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11995" - ], - "x-ms-correlation-request-id": [ - "e3c7fec0-cf8b-4628-abb6-41bab99f3f24" - ], - "x-ms-routing-request-id": [ - "WESTINDIA:20210512T133218Z:e3c7fec0-cf8b-4628-abb6-41bab99f3f24" - ], - "Date": [ - "Wed, 12 May 2021 13:32:18 GMT" - ], - "Content-Length": [ - "443" - ], - "Content-Type": [ - "application/json" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzZlY2M3MDYyLWQ5NDItNGU3ZC1iM2M5LTYwYWFhNTlhOTQ0Yg==\",\r\n \"name\": \"ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzZlY2M3MDYyLWQ5NDItNGU3ZC1iM2M5LTYwYWFhNTlhOTQ0Yg==\",\r\n \"status\": \"Succeeded\",\r\n \"startTime\": \"2021-05-12T13:31:47.6689002Z\",\r\n \"endTime\": \"2021-05-12T13:32:10Z\"\r\n}", - "StatusCode": 200 + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-correlation-request-id": [ + "b6a81e63-4729-4801-af67-34a46bfe8310" + ], + "x-ms-routing-request-id": [ + "WESTINDIA:20210512T123903Z:b6a81e63-4729-4801-af67-34a46bfe8310" + ], + "Date": [ + "Wed, 12 May 2021 12:39:03 GMT" + ], + "Content-Length": [ + "1083" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ] }, - { - "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationResults/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzZlY2M3MDYyLWQ5NDItNGU3ZC1iM2M5LTYwYWFhNTlhOTQ0Yg==?api-version=2021-01-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vbG9jYXRpb25zL3NvdXRoZWFzdGFzaWEvb3BlcmF0aW9uUmVzdWx0cy9aR000WlRSaU9EZ3RZbVl5TXkwME9UZzBMVGxtWkRRdE1EazROemt3TmpJM05EUXhPelpsWTJNM01EWXlMV1E1TkRJdE5HVTNaQzFpTTJNNUxUWXdZV0ZoTlRsaE9UUTBZZz09P2FwaS12ZXJzaW9uPTIwMjEtMDEtMDE=", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.29916.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Retry-After": [ - "30" - ], - "Azure-AsyncOperation": [ - "https://management.azure.com/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzZlY2M3MDYyLWQ5NDItNGU3ZC1iM2M5LTYwYWFhNTlhOTQ0Yg==?api-version=2021-01-01" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "x-ms-request-id": [ - "" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11994" - ], - "x-ms-correlation-request-id": [ - "8d44e716-5d5f-478e-a808-bf0d9aa11238" - ], - "x-ms-routing-request-id": [ - "WESTINDIA:20210512T133219Z:8d44e716-5d5f-478e-a808-bf0d9aa11238" - ], - "Date": [ - "Wed, 12 May 2021 13:32:18 GMT" - ], - "Content-Length": [ - "41" - ], - "Content-Type": [ - "application/json" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"objectType\": \"OperationJobExtendedInfo\"\r\n}", - "StatusCode": 200 + "ResponseBody": "{\r\n \"id\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/backupVaults/DiskbackupVault2/backupPolicies/retentionpolicy2\",\r\n \"name\": \"retentionpolicy2\",\r\n \"type\": \"Microsoft.DataProtection/backupVaults/backupPolicies\",\r\n \"properties\": {\r\n \"policyRules\": [\r\n {\r\n \"backupParameters\": {\r\n \"backupType\": \"Incremental\",\r\n \"objectType\": \"AzureBackupParams\"\r\n },\r\n \"trigger\": {\r\n \"schedule\": {\r\n \"repeatingTimeIntervals\": [\r\n \"R/2019-12-26T13:08:27.8535071Z/PT4H\"\r\n ]\r\n },\r\n \"taggingCriteria\": [\r\n {\r\n \"tagInfo\": {\r\n \"tagName\": \"Default\",\r\n \"id\": \"Default_\"\r\n },\r\n \"taggingPriority\": 99,\r\n \"isDefault\": true\r\n }\r\n ],\r\n \"objectType\": \"ScheduleBasedTriggerContext\"\r\n },\r\n \"dataStore\": {\r\n \"dataStoreType\": \"OperationalStore\",\r\n \"objectType\": \"DataStoreInfoBase\"\r\n },\r\n \"name\": \"BackupHourly\",\r\n \"objectType\": \"AzureBackupRule\"\r\n },\r\n {\r\n \"lifecycles\": [\r\n {\r\n \"deleteAfter\": {\r\n \"objectType\": \"AbsoluteDeleteOption\",\r\n \"duration\": \"P1W\"\r\n },\r\n \"sourceDataStore\": {\r\n \"dataStoreType\": \"OperationalStore\",\r\n \"objectType\": \"DataStoreInfoBase\"\r\n }\r\n }\r\n ],\r\n \"isDefault\": true,\r\n \"name\": \"Default\",\r\n \"objectType\": \"AzureRetentionRule\"\r\n }\r\n ],\r\n \"datasourceTypes\": [\r\n \"Microsoft.Compute/disks\"\r\n ],\r\n \"objectType\": \"BackupPolicy\"\r\n }\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/backupVaults/DiskbackupVault2/backupPolicies/retentionpolicy2?api-version=2021-07-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Jlc291cmNlR3JvdXBzL21heWFnZ2FyRGlza1JHL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vYmFja3VwVmF1bHRzL0Rpc2tiYWNrdXBWYXVsdDIvYmFja3VwUG9saWNpZXMvcmV0ZW50aW9ucG9saWN5Mj9hcGktdmVyc2lvbj0yMDIxLTA3LTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "f73f2145-e40c-4b99-8f25-77b2a37be94e" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.29916.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" + ] }, - { - "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/backupVaults/DiskbackupVault2/backupInstances/testingDisk?api-version=2021-01-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Jlc291cmNlR3JvdXBzL21heWFnZ2FyRGlza1JHL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vYmFja3VwVmF1bHRzL0Rpc2tiYWNrdXBWYXVsdDIvYmFja3VwSW5zdGFuY2VzL3Rlc3RpbmdEaXNrP2FwaS12ZXJzaW9uPTIwMjEtMDEtMDE=", - "RequestMethod": "PUT", - "RequestBody": "{\r\n \"properties\": {\r\n \"dataSourceInfo\": {\r\n \"datasourceType\": \"Microsoft.Compute/disks\",\r\n \"objectType\": \"Datasource\",\r\n \"resourceID\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.Compute/disks/testingDisk\",\r\n \"resourceLocation\": \"southeastasia\",\r\n \"resourceName\": \"testingDisk\",\r\n \"resourceType\": \"Microsoft.Compute/disks\",\r\n \"resourceUri\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.Compute/disks/testingDisk\"\r\n },\r\n \"policyInfo\": {\r\n \"policyId\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/BackupVaults/DiskbackupVault2/backupPolicies/retentionpolicy2\",\r\n \"policyParameters\": {\r\n \"dataStoreParametersList\": [\r\n {\r\n \"objectType\": \"AzureOperationalStoreParameters\",\r\n \"resourceGroupId\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarOTDSRG\",\r\n \"dataStoreType\": \"OperationalStore\"\r\n }\r\n ]\r\n }\r\n },\r\n \"objectType\": \"BackupInstance\"\r\n }\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "fbda1019-f32d-408f-b9cf-cc44b86d3884" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.29916.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "1191" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Retry-After": [ - "15" - ], - "Azure-AsyncOperation": [ - "https://management.azure.com/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxO2ZlYjZiM2FjLTg0M2YtNGI2Ni1hODUxLTI3YjBjZWVjNzc3MQ==?api-version=2021-01-01" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "x-ms-request-id": [ - "" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" - ], - "x-ms-correlation-request-id": [ - "f13c9531-2b4a-4220-a02f-522f344508d3" - ], - "x-ms-routing-request-id": [ - "JIOINDIAWEST:20210512T130654Z:f13c9531-2b4a-4220-a02f-522f344508d3" - ], - "Date": [ - "Wed, 12 May 2021 13:06:54 GMT" - ], - "Content-Length": [ - "1401" - ], - "Content-Type": [ - "application/json" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/backupVaults/DiskbackupVault2/backupInstances/testingDisk\",\r\n \"name\": \"testingDisk\",\r\n \"type\": \"Microsoft.DataProtection/backupVaults/backupInstances\",\r\n \"properties\": {\r\n \"friendlyName\": \"testingDisk\",\r\n \"dataSourceInfo\": {\r\n \"resourceID\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.Compute/disks/testingDisk\",\r\n \"resourceUri\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.Compute/disks/testingDisk\",\r\n \"datasourceType\": \"Microsoft.Compute/disks\",\r\n \"resourceName\": \"testingDisk\",\r\n \"resourceType\": \"Microsoft.Compute/disks\",\r\n \"resourceLocation\": \"southeastasia\",\r\n \"objectType\": \"Datasource\"\r\n },\r\n \"policyInfo\": {\r\n \"policyId\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/backupVaults/DiskbackupVault2/backupPolicies/retentionpolicy2\",\r\n \"policyParameters\": {\r\n \"dataStoreParametersList\": [\r\n {\r\n \"objectType\": \"AzureOperationalStoreParameters\",\r\n \"resourceGroupId\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarOTDSRG\",\r\n \"dataStoreType\": \"OperationalStore\"\r\n }\r\n ]\r\n }\r\n },\r\n \"protectionStatus\": {\r\n \"status\": \"ConfiguringProtection\"\r\n },\r\n \"currentProtectionState\": \"ConfiguringProtection\",\r\n \"provisioningState\": \"Provisioning\",\r\n \"objectType\": \"BackupInstance\"\r\n }\r\n}", - "StatusCode": 201 + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11999" + ], + "x-ms-correlation-request-id": [ + "f32557e6-7986-4450-9148-9be4ef7def63" + ], + "x-ms-routing-request-id": [ + "JIOINDIAWEST:20210512T124040Z:f32557e6-7986-4450-9148-9be4ef7def63" + ], + "Date": [ + "Wed, 12 May 2021 12:40:40 GMT" + ], + "Content-Length": [ + "1083" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ] }, - { - "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxO2ZlYjZiM2FjLTg0M2YtNGI2Ni1hODUxLTI3YjBjZWVjNzc3MQ==?api-version=2021-01-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vbG9jYXRpb25zL3NvdXRoZWFzdGFzaWEvb3BlcmF0aW9uU3RhdHVzL1pHTTRaVFJpT0RndFltWXlNeTAwT1RnMExUbG1aRFF0TURrNE56a3dOakkzTkRReE8yWmxZalppTTJGakxUZzBNMll0TkdJMk5pMWhPRFV4TFRJM1lqQmpaV1ZqTnpjM01RPT0/YXBpLXZlcnNpb249MjAyMS0wMS0wMQ==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.29916.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "x-ms-request-id": [ - "" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11997" - ], - "x-ms-correlation-request-id": [ - "f28cb4a3-ab75-4247-81e0-a32b7dd207e7" - ], - "x-ms-routing-request-id": [ - "JIOINDIAWEST:20210512T130721Z:f28cb4a3-ab75-4247-81e0-a32b7dd207e7" - ], - "Date": [ - "Wed, 12 May 2021 13:07:20 GMT" - ], - "Content-Length": [ - "443" - ], - "Content-Type": [ - "application/json" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxO2ZlYjZiM2FjLTg0M2YtNGI2Ni1hODUxLTI3YjBjZWVjNzc3MQ==\",\r\n \"name\": \"ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxO2ZlYjZiM2FjLTg0M2YtNGI2Ni1hODUxLTI3YjBjZWVjNzc3MQ==\",\r\n \"status\": \"Succeeded\",\r\n \"startTime\": \"2021-05-12T13:06:54.1586653Z\",\r\n \"endTime\": \"2021-05-12T13:06:57Z\"\r\n}", - "StatusCode": 200 + "ResponseBody": "{\r\n \"id\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/backupVaults/DiskbackupVault2/backupPolicies/retentionpolicy2\",\r\n \"name\": \"retentionpolicy2\",\r\n \"type\": \"Microsoft.DataProtection/backupVaults/backupPolicies\",\r\n \"properties\": {\r\n \"policyRules\": [\r\n {\r\n \"backupParameters\": {\r\n \"backupType\": \"Incremental\",\r\n \"objectType\": \"AzureBackupParams\"\r\n },\r\n \"trigger\": {\r\n \"schedule\": {\r\n \"repeatingTimeIntervals\": [\r\n \"R/2019-12-26T13:08:27.8535071Z/PT4H\"\r\n ]\r\n },\r\n \"taggingCriteria\": [\r\n {\r\n \"tagInfo\": {\r\n \"tagName\": \"Default\",\r\n \"id\": \"Default_\"\r\n },\r\n \"taggingPriority\": 99,\r\n \"isDefault\": true\r\n }\r\n ],\r\n \"objectType\": \"ScheduleBasedTriggerContext\"\r\n },\r\n \"dataStore\": {\r\n \"dataStoreType\": \"OperationalStore\",\r\n \"objectType\": \"DataStoreInfoBase\"\r\n },\r\n \"name\": \"BackupHourly\",\r\n \"objectType\": \"AzureBackupRule\"\r\n },\r\n {\r\n \"lifecycles\": [\r\n {\r\n \"deleteAfter\": {\r\n \"objectType\": \"AbsoluteDeleteOption\",\r\n \"duration\": \"P1W\"\r\n },\r\n \"sourceDataStore\": {\r\n \"dataStoreType\": \"OperationalStore\",\r\n \"objectType\": \"DataStoreInfoBase\"\r\n }\r\n }\r\n ],\r\n \"isDefault\": true,\r\n \"name\": \"Default\",\r\n \"objectType\": \"AzureRetentionRule\"\r\n }\r\n ],\r\n \"datasourceTypes\": [\r\n \"Microsoft.Compute/disks\"\r\n ],\r\n \"objectType\": \"BackupPolicy\"\r\n }\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/backupVaults/DiskbackupVault2/validateForBackup?api-version=2021-07-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Jlc291cmNlR3JvdXBzL21heWFnZ2FyRGlza1JHL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vYmFja3VwVmF1bHRzL0Rpc2tiYWNrdXBWYXVsdDIvdmFsaWRhdGVGb3JCYWNrdXA/YXBpLXZlcnNpb249MjAyMS0wNy0wMQ==", + "RequestMethod": "POST", + "RequestBody": "{\r\n \"backupInstance\": {\r\n \"dataSourceInfo\": {\r\n \"datasourceType\": \"Microsoft.Compute/disks\",\r\n \"objectType\": \"Datasource\",\r\n \"resourceID\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.Compute/disks/testingDisk\",\r\n \"resourceLocation\": \"southeastasia\",\r\n \"resourceName\": \"testingDisk\",\r\n \"resourceType\": \"Microsoft.Compute/disks\",\r\n \"resourceUri\": \"\"\r\n },\r\n \"policyInfo\": {\r\n \"policyId\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/BackupVaults/DiskbackupVault2/backupPolicies/retentionpolicy2\",\r\n \"policyParameters\": {\r\n \"dataStoreParametersList\": [\r\n {\r\n \"objectType\": \"AzureOperationalStoreParameters\",\r\n \"resourceGroupId\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarOTDSRG\",\r\n \"dataStoreType\": \"OperationalStore\"\r\n }\r\n ]\r\n }\r\n },\r\n \"objectType\": \"BackupInstance\"\r\n }\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "fcac9627-f828-4167-b822-6eb6a396f570" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.29916.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "1068" + ] }, - { - "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/backupVaults/DiskbackupVault2/backupInstances/testingDisk?api-version=2021-01-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Jlc291cmNlR3JvdXBzL21heWFnZ2FyRGlza1JHL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vYmFja3VwVmF1bHRzL0Rpc2tiYWNrdXBWYXVsdDIvYmFja3VwSW5zdGFuY2VzL3Rlc3RpbmdEaXNrP2FwaS12ZXJzaW9uPTIwMjEtMDEtMDE=", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.29916.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "x-ms-request-id": [ - "" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11996" - ], - "x-ms-correlation-request-id": [ - "95793c6b-3998-434a-b34a-198cdafa9193" - ], - "x-ms-routing-request-id": [ - "JIOINDIAWEST:20210512T130722Z:95793c6b-3998-434a-b34a-198cdafa9193" - ], - "Date": [ - "Wed, 12 May 2021 13:07:21 GMT" - ], - "Content-Length": [ - "1398" - ], - "Content-Type": [ - "application/json" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/backupVaults/DiskbackupVault2/backupInstances/testingDisk\",\r\n \"name\": \"testingDisk\",\r\n \"type\": \"Microsoft.DataProtection/backupVaults/backupInstances\",\r\n \"properties\": {\r\n \"friendlyName\": \"testingDisk\",\r\n \"dataSourceInfo\": {\r\n \"resourceID\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.Compute/disks/testingDisk\",\r\n \"resourceUri\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.Compute/disks/testingDisk\",\r\n \"datasourceType\": \"Microsoft.Compute/disks\",\r\n \"resourceName\": \"testingDisk\",\r\n \"resourceType\": \"Microsoft.Compute/disks\",\r\n \"resourceLocation\": \"southeastasia\",\r\n \"objectType\": \"Datasource\"\r\n },\r\n \"policyInfo\": {\r\n \"policyId\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/backupVaults/DiskbackupVault2/backupPolicies/retentionpolicy2\",\r\n \"policyParameters\": {\r\n \"dataStoreParametersList\": [\r\n {\r\n \"objectType\": \"AzureOperationalStoreParameters\",\r\n \"resourceGroupId\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarOTDSRG\",\r\n \"dataStoreType\": \"OperationalStore\"\r\n }\r\n ]\r\n }\r\n },\r\n \"protectionStatus\": {\r\n \"status\": \"ConfiguringProtection\"\r\n },\r\n \"currentProtectionState\": \"ConfiguringProtection\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"objectType\": \"BackupInstance\"\r\n }\r\n}", - "StatusCode": 200 + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationResults/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzZlY2M3MDYyLWQ5NDItNGU3ZC1iM2M5LTYwYWFhNTlhOTQ0Yg==?api-version=2021-07-01" + ], + "Retry-After": [ + "10" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzZlY2M3MDYyLWQ5NDItNGU3ZC1iM2M5LTYwYWFhNTlhOTQ0Yg==?api-version=2021-07-01" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-correlation-request-id": [ + "0af34d46-0fbc-40b4-a914-24010fb0c776" + ], + "x-ms-routing-request-id": [ + "WESTINDIA:20210512T133147Z:0af34d46-0fbc-40b4-a914-24010fb0c776" + ], + "Date": [ + "Wed, 12 May 2021 13:31:47 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] }, - { - "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/backupVaults/DiskbackupVault2/backupInstances/testingDisk/backup?api-version=2021-01-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Jlc291cmNlR3JvdXBzL21heWFnZ2FyRGlza1JHL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vYmFja3VwVmF1bHRzL0Rpc2tiYWNrdXBWYXVsdDIvYmFja3VwSW5zdGFuY2VzL3Rlc3RpbmdEaXNrL2JhY2t1cD9hcGktdmVyc2lvbj0yMDIxLTAxLTAx", - "RequestMethod": "POST", - "RequestBody": "{\r\n \"backupRuleOptions\": {\r\n \"ruleName\": \"BackupHourly\",\r\n \"triggerOption\": {\r\n \"retentionTagOverride\": \"Default\"\r\n }\r\n }\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "7abddff2-cde5-4117-adb1-026b7a664e1a" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.29916.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "140" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationResults/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxO2U2MGYwOTA2LWFhOWMtNDAwOS04ZTM0LTVmNzk2OGQyZDRkYQ==?api-version=2021-01-01" - ], - "Retry-After": [ - "30" - ], - "Azure-AsyncOperation": [ - "https://management.azure.com/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxO2U2MGYwOTA2LWFhOWMtNDAwOS04ZTM0LTVmNzk2OGQyZDRkYQ==?api-version=2021-01-01" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "x-ms-request-id": [ - "" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1198" - ], - "x-ms-correlation-request-id": [ - "27aa0626-c333-49e4-b1c9-9e35f37ca567" - ], - "x-ms-routing-request-id": [ - "JIOINDIAWEST:20210512T130905Z:27aa0626-c333-49e4-b1c9-9e35f37ca567" - ], - "Date": [ - "Wed, 12 May 2021 13:09:05 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzZlY2M3MDYyLWQ5NDItNGU3ZC1iM2M5LTYwYWFhNTlhOTQ0Yg==?api-version=2021-07-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vbG9jYXRpb25zL3NvdXRoZWFzdGFzaWEvb3BlcmF0aW9uU3RhdHVzL1pHTTRaVFJpT0RndFltWXlNeTAwT1RnMExUbG1aRFF0TURrNE56a3dOakkzTkRReE96WmxZMk0zTURZeUxXUTVOREl0TkdVM1pDMWlNMk01TFRZd1lXRmhOVGxoT1RRMFlnPT0/YXBpLXZlcnNpb249MjAyMS0wNy0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.29916.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" + ] }, - { - "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxO2U2MGYwOTA2LWFhOWMtNDAwOS04ZTM0LTVmNzk2OGQyZDRkYQ==?api-version=2021-01-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vbG9jYXRpb25zL3NvdXRoZWFzdGFzaWEvb3BlcmF0aW9uU3RhdHVzL1pHTTRaVFJpT0RndFltWXlNeTAwT1RnMExUbG1aRFF0TURrNE56a3dOakkzTkRReE8yVTJNR1l3T1RBMkxXRmhPV010TkRBd09TMDRaVE0wTFRWbU56azJPR1F5WkRSa1lRPT0/YXBpLXZlcnNpb249MjAyMS0wMS0wMQ==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.29916.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "x-ms-request-id": [ - "" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11995" - ], - "x-ms-correlation-request-id": [ - "1655a584-2829-4ad1-858d-b843a69a37d8" - ], - "x-ms-routing-request-id": [ - "JIOINDIAWEST:20210512T130935Z:1655a584-2829-4ad1-858d-b843a69a37d8" - ], - "Date": [ - "Wed, 12 May 2021 13:09:35 GMT" - ], - "Content-Length": [ - "703" - ], - "Content-Type": [ - "application/json" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxO2U2MGYwOTA2LWFhOWMtNDAwOS04ZTM0LTVmNzk2OGQyZDRkYQ==\",\r\n \"name\": \"ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxO2U2MGYwOTA2LWFhOWMtNDAwOS04ZTM0LTVmNzk2OGQyZDRkYQ==\",\r\n \"status\": \"Succeeded\",\r\n \"startTime\": \"2021-05-12T13:09:05.2513266Z\",\r\n \"endTime\": \"2021-05-12T13:09:08Z\",\r\n \"properties\": {\r\n \"jobId\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/backupVaults/DiskbackupVault2/backupJobs/610fe9cb-4196-4508-ab4b-4dbcfdc44b57\",\r\n \"objectType\": \"OperationJobExtendedInfo\"\r\n }\r\n}", - "StatusCode": 200 + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11997" + ], + "x-ms-correlation-request-id": [ + "76fc2825-2b94-45e1-8bc5-8a306a021562" + ], + "x-ms-routing-request-id": [ + "WESTINDIA:20210512T133158Z:76fc2825-2b94-45e1-8bc5-8a306a021562" + ], + "Date": [ + "Wed, 12 May 2021 13:31:57 GMT" + ], + "Content-Length": [ + "443" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ] }, - { - "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationResults/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxO2U2MGYwOTA2LWFhOWMtNDAwOS04ZTM0LTVmNzk2OGQyZDRkYQ==?api-version=2021-01-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vbG9jYXRpb25zL3NvdXRoZWFzdGFzaWEvb3BlcmF0aW9uUmVzdWx0cy9aR000WlRSaU9EZ3RZbVl5TXkwME9UZzBMVGxtWkRRdE1EazROemt3TmpJM05EUXhPMlUyTUdZd09UQTJMV0ZoT1dNdE5EQXdPUzA0WlRNMExUVm1OemsyT0dReVpEUmtZUT09P2FwaS12ZXJzaW9uPTIwMjEtMDEtMDE=", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.29916.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Retry-After": [ - "30" - ], - "Azure-AsyncOperation": [ - "https://management.azure.com/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxO2U2MGYwOTA2LWFhOWMtNDAwOS04ZTM0LTVmNzk2OGQyZDRkYQ==?api-version=2021-01-01" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "x-ms-request-id": [ - "" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11994" - ], - "x-ms-correlation-request-id": [ - "978f7549-c428-4fc2-b3c7-99e4d9576db3" - ], - "x-ms-routing-request-id": [ - "JIOINDIAWEST:20210512T130936Z:978f7549-c428-4fc2-b3c7-99e4d9576db3" - ], - "Date": [ - "Wed, 12 May 2021 13:09:35 GMT" - ], - "Content-Length": [ - "246" - ], - "Content-Type": [ - "application/json" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"jobId\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/backupVaults/DiskbackupVault2/backupJobs/610fe9cb-4196-4508-ab4b-4dbcfdc44b57\",\r\n \"objectType\": \"OperationJobExtendedInfo\"\r\n}", - "StatusCode": 200 + "ResponseBody": "{\r\n \"id\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzZlY2M3MDYyLWQ5NDItNGU3ZC1iM2M5LTYwYWFhNTlhOTQ0Yg==\",\r\n \"name\": \"ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzZlY2M3MDYyLWQ5NDItNGU3ZC1iM2M5LTYwYWFhNTlhOTQ0Yg==\",\r\n \"status\": \"Inprogress\",\r\n \"startTime\": \"2021-05-12T13:31:47.6689002Z\",\r\n \"endTime\": \"0001-01-01T00:00:00\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzZlY2M3MDYyLWQ5NDItNGU3ZC1iM2M5LTYwYWFhNTlhOTQ0Yg==?api-version=2021-07-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vbG9jYXRpb25zL3NvdXRoZWFzdGFzaWEvb3BlcmF0aW9uU3RhdHVzL1pHTTRaVFJpT0RndFltWXlNeTAwT1RnMExUbG1aRFF0TURrNE56a3dOakkzTkRReE96WmxZMk0zTURZeUxXUTVOREl0TkdVM1pDMWlNMk01TFRZd1lXRmhOVGxoT1RRMFlnPT0/YXBpLXZlcnNpb249MjAyMS0wNy0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.29916.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" + ] }, - { - "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/backupVaults/DiskbackupVault2/backupInstances/testingDisk/validateRestore?api-version=2021-01-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Jlc291cmNlR3JvdXBzL21heWFnZ2FyRGlza1JHL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vYmFja3VwVmF1bHRzL0Rpc2tiYWNrdXBWYXVsdDIvYmFja3VwSW5zdGFuY2VzL3Rlc3RpbmdEaXNrL3ZhbGlkYXRlUmVzdG9yZT9hcGktdmVyc2lvbj0yMDIxLTAxLTAx", - "RequestMethod": "POST", - "RequestBody": "{\r\n \"restoreRequestObject\": {\r\n \"objectType\": \"AzureBackupRecoveryPointBasedRestoreRequest\",\r\n \"recoveryPointId\": \"7327d7065c4145b3b6d80bcb8a787ea6\",\r\n \"restoreTargetInfo\": {\r\n \"objectType\": \"RestoreTargetInfo\",\r\n \"datasourceInfo\": {\r\n \"datasourceType\": \"Microsoft.Compute/disks\",\r\n \"objectType\": \"Datasource\",\r\n \"resourceID\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggartargetrg/providers/Microsoft.Compute/disks/restoredisk1\",\r\n \"resourceLocation\": \"centraluseuap\",\r\n \"resourceName\": \"restoredisk1\",\r\n \"resourceType\": \"Microsoft.Compute/disks\",\r\n \"resourceUri\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggartargetrg/providers/Microsoft.Compute/disks/restoredisk1\"\r\n },\r\n \"restoreLocation\": \"southeastasia\",\r\n \"recoveryOption\": \"FailIfExists\"\r\n },\r\n \"sourceDataStoreType\": \"OperationalStore\"\r\n }\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "7036d956-39b9-4a14-8088-bd24cc314a0e" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.29916.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "953" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationResults/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==?api-version=2021-01-01" - ], - "Retry-After": [ - "10" - ], - "Azure-AsyncOperation": [ - "https://management.azure.com/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==?api-version=2021-01-01" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "x-ms-request-id": [ - "" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" - ], - "x-ms-correlation-request-id": [ - "50d3dd23-f6a3-4032-9989-3ac12c23a0b7" - ], - "x-ms-routing-request-id": [ - "JIOINDIAWEST:20210512T132024Z:50d3dd23-f6a3-4032-9989-3ac12c23a0b7" - ], - "Date": [ - "Wed, 12 May 2021 13:20:24 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11996" + ], + "x-ms-correlation-request-id": [ + "3bc4af50-258c-46a8-8a79-5e0e7bbd8262" + ], + "x-ms-routing-request-id": [ + "WESTINDIA:20210512T133208Z:3bc4af50-258c-46a8-8a79-5e0e7bbd8262" + ], + "Date": [ + "Wed, 12 May 2021 13:32:07 GMT" + ], + "Content-Length": [ + "443" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ] }, - { - "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==?api-version=2021-01-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vbG9jYXRpb25zL3NvdXRoZWFzdGFzaWEvb3BlcmF0aW9uU3RhdHVzL1pHTTRaVFJpT0RndFltWXlNeTAwT1RnMExUbG1aRFF0TURrNE56a3dOakkzTkRReE96VXlaR1JsWWpSaUxUVTVPVGt0TkRJME1TMDRZakptTFRSa1pUQXdOelppTURsak5RPT0/YXBpLXZlcnNpb249MjAyMS0wMS0wMQ==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.29916.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "x-ms-request-id": [ - "" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11994" - ], - "x-ms-correlation-request-id": [ - "0401d1d9-9369-4da2-b6bb-af477de69924" - ], - "x-ms-routing-request-id": [ - "JIOINDIAWEST:20210512T132034Z:0401d1d9-9369-4da2-b6bb-af477de69924" - ], - "Date": [ - "Wed, 12 May 2021 13:20:34 GMT" - ], - "Content-Length": [ - "443" - ], - "Content-Type": [ - "application/json" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==\",\r\n \"name\": \"ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==\",\r\n \"status\": \"Inprogress\",\r\n \"startTime\": \"2021-05-12T13:20:24.3776183Z\",\r\n \"endTime\": \"0001-01-01T00:00:00\"\r\n}", - "StatusCode": 200 + "ResponseBody": "{\r\n \"id\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzZlY2M3MDYyLWQ5NDItNGU3ZC1iM2M5LTYwYWFhNTlhOTQ0Yg==\",\r\n \"name\": \"ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzZlY2M3MDYyLWQ5NDItNGU3ZC1iM2M5LTYwYWFhNTlhOTQ0Yg==\",\r\n \"status\": \"Inprogress\",\r\n \"startTime\": \"2021-05-12T13:31:47.6689002Z\",\r\n \"endTime\": \"0001-01-01T00:00:00\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzZlY2M3MDYyLWQ5NDItNGU3ZC1iM2M5LTYwYWFhNTlhOTQ0Yg==?api-version=2021-07-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vbG9jYXRpb25zL3NvdXRoZWFzdGFzaWEvb3BlcmF0aW9uU3RhdHVzL1pHTTRaVFJpT0RndFltWXlNeTAwT1RnMExUbG1aRFF0TURrNE56a3dOakkzTkRReE96WmxZMk0zTURZeUxXUTVOREl0TkdVM1pDMWlNMk01TFRZd1lXRmhOVGxoT1RRMFlnPT0/YXBpLXZlcnNpb249MjAyMS0wNy0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.29916.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" + ] }, - { - "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==?api-version=2021-01-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vbG9jYXRpb25zL3NvdXRoZWFzdGFzaWEvb3BlcmF0aW9uU3RhdHVzL1pHTTRaVFJpT0RndFltWXlNeTAwT1RnMExUbG1aRFF0TURrNE56a3dOakkzTkRReE96VXlaR1JsWWpSaUxUVTVPVGt0TkRJME1TMDRZakptTFRSa1pUQXdOelppTURsak5RPT0/YXBpLXZlcnNpb249MjAyMS0wMS0wMQ==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.29916.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "x-ms-request-id": [ - "" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11993" - ], - "x-ms-correlation-request-id": [ - "8396405c-2ebc-4d54-92b2-a205eaf6285f" - ], - "x-ms-routing-request-id": [ - "JIOINDIAWEST:20210512T132045Z:8396405c-2ebc-4d54-92b2-a205eaf6285f" - ], - "Date": [ - "Wed, 12 May 2021 13:20:44 GMT" - ], - "Content-Length": [ - "443" - ], - "Content-Type": [ - "application/json" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==\",\r\n \"name\": \"ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==\",\r\n \"status\": \"Inprogress\",\r\n \"startTime\": \"2021-05-12T13:20:24.3776183Z\",\r\n \"endTime\": \"0001-01-01T00:00:00\"\r\n}", - "StatusCode": 200 + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11995" + ], + "x-ms-correlation-request-id": [ + "e3c7fec0-cf8b-4628-abb6-41bab99f3f24" + ], + "x-ms-routing-request-id": [ + "WESTINDIA:20210512T133218Z:e3c7fec0-cf8b-4628-abb6-41bab99f3f24" + ], + "Date": [ + "Wed, 12 May 2021 13:32:18 GMT" + ], + "Content-Length": [ + "443" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ] }, - { - "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==?api-version=2021-01-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vbG9jYXRpb25zL3NvdXRoZWFzdGFzaWEvb3BlcmF0aW9uU3RhdHVzL1pHTTRaVFJpT0RndFltWXlNeTAwT1RnMExUbG1aRFF0TURrNE56a3dOakkzTkRReE96VXlaR1JsWWpSaUxUVTVPVGt0TkRJME1TMDRZakptTFRSa1pUQXdOelppTURsak5RPT0/YXBpLXZlcnNpb249MjAyMS0wMS0wMQ==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.29916.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "x-ms-request-id": [ - "" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11992" - ], - "x-ms-correlation-request-id": [ - "55ef0e8d-be15-41c8-acb5-325d89d4aae4" - ], - "x-ms-routing-request-id": [ - "JIOINDIAWEST:20210512T132055Z:55ef0e8d-be15-41c8-acb5-325d89d4aae4" - ], - "Date": [ - "Wed, 12 May 2021 13:20:54 GMT" - ], - "Content-Length": [ - "443" - ], - "Content-Type": [ - "application/json" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==\",\r\n \"name\": \"ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==\",\r\n \"status\": \"Inprogress\",\r\n \"startTime\": \"2021-05-12T13:20:24.3776183Z\",\r\n \"endTime\": \"0001-01-01T00:00:00\"\r\n}", - "StatusCode": 200 + "ResponseBody": "{\r\n \"id\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzZlY2M3MDYyLWQ5NDItNGU3ZC1iM2M5LTYwYWFhNTlhOTQ0Yg==\",\r\n \"name\": \"ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzZlY2M3MDYyLWQ5NDItNGU3ZC1iM2M5LTYwYWFhNTlhOTQ0Yg==\",\r\n \"status\": \"Succeeded\",\r\n \"startTime\": \"2021-05-12T13:31:47.6689002Z\",\r\n \"endTime\": \"2021-05-12T13:32:10Z\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationResults/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzZlY2M3MDYyLWQ5NDItNGU3ZC1iM2M5LTYwYWFhNTlhOTQ0Yg==?api-version=2021-07-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vbG9jYXRpb25zL3NvdXRoZWFzdGFzaWEvb3BlcmF0aW9uUmVzdWx0cy9aR000WlRSaU9EZ3RZbVl5TXkwME9UZzBMVGxtWkRRdE1EazROemt3TmpJM05EUXhPelpsWTJNM01EWXlMV1E1TkRJdE5HVTNaQzFpTTJNNUxUWXdZV0ZoTlRsaE9UUTBZZz09P2FwaS12ZXJzaW9uPTIwMjEtMDctMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.29916.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" + ] }, - { - "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==?api-version=2021-01-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vbG9jYXRpb25zL3NvdXRoZWFzdGFzaWEvb3BlcmF0aW9uU3RhdHVzL1pHTTRaVFJpT0RndFltWXlNeTAwT1RnMExUbG1aRFF0TURrNE56a3dOakkzTkRReE96VXlaR1JsWWpSaUxUVTVPVGt0TkRJME1TMDRZakptTFRSa1pUQXdOelppTURsak5RPT0/YXBpLXZlcnNpb249MjAyMS0wMS0wMQ==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.29916.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "x-ms-request-id": [ - "" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11991" - ], - "x-ms-correlation-request-id": [ - "6afee5a4-9fe5-4018-afdc-06a90b4ccdda" - ], - "x-ms-routing-request-id": [ - "JIOINDIAWEST:20210512T132105Z:6afee5a4-9fe5-4018-afdc-06a90b4ccdda" - ], - "Date": [ - "Wed, 12 May 2021 13:21:04 GMT" - ], - "Content-Length": [ - "443" - ], - "Content-Type": [ - "application/json" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==\",\r\n \"name\": \"ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==\",\r\n \"status\": \"Inprogress\",\r\n \"startTime\": \"2021-05-12T13:20:24.3776183Z\",\r\n \"endTime\": \"0001-01-01T00:00:00\"\r\n}", - "StatusCode": 200 + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "30" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzZlY2M3MDYyLWQ5NDItNGU3ZC1iM2M5LTYwYWFhNTlhOTQ0Yg==?api-version=2021-07-01" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11994" + ], + "x-ms-correlation-request-id": [ + "8d44e716-5d5f-478e-a808-bf0d9aa11238" + ], + "x-ms-routing-request-id": [ + "WESTINDIA:20210512T133219Z:8d44e716-5d5f-478e-a808-bf0d9aa11238" + ], + "Date": [ + "Wed, 12 May 2021 13:32:18 GMT" + ], + "Content-Length": [ + "41" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ] }, - { - "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==?api-version=2021-01-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vbG9jYXRpb25zL3NvdXRoZWFzdGFzaWEvb3BlcmF0aW9uU3RhdHVzL1pHTTRaVFJpT0RndFltWXlNeTAwT1RnMExUbG1aRFF0TURrNE56a3dOakkzTkRReE96VXlaR1JsWWpSaUxUVTVPVGt0TkRJME1TMDRZakptTFRSa1pUQXdOelppTURsak5RPT0/YXBpLXZlcnNpb249MjAyMS0wMS0wMQ==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.29916.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "x-ms-request-id": [ - "" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11990" - ], - "x-ms-correlation-request-id": [ - "df7539c0-6fe7-4ca9-a71f-ebf7b49ef92a" - ], - "x-ms-routing-request-id": [ - "JIOINDIAWEST:20210512T132115Z:df7539c0-6fe7-4ca9-a71f-ebf7b49ef92a" - ], - "Date": [ - "Wed, 12 May 2021 13:21:15 GMT" - ], - "Content-Length": [ - "443" - ], - "Content-Type": [ - "application/json" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==\",\r\n \"name\": \"ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==\",\r\n \"status\": \"Inprogress\",\r\n \"startTime\": \"2021-05-12T13:20:24.3776183Z\",\r\n \"endTime\": \"0001-01-01T00:00:00\"\r\n}", - "StatusCode": 200 + "ResponseBody": "{\r\n \"objectType\": \"OperationJobExtendedInfo\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/backupVaults/DiskbackupVault2/backupInstances/testingDisk?api-version=2021-07-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Jlc291cmNlR3JvdXBzL21heWFnZ2FyRGlza1JHL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vYmFja3VwVmF1bHRzL0Rpc2tiYWNrdXBWYXVsdDIvYmFja3VwSW5zdGFuY2VzL3Rlc3RpbmdEaXNrP2FwaS12ZXJzaW9uPTIwMjEtMDctMDE=", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"dataSourceInfo\": {\r\n \"datasourceType\": \"Microsoft.Compute/disks\",\r\n \"objectType\": \"Datasource\",\r\n \"resourceID\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.Compute/disks/testingDisk\",\r\n \"resourceLocation\": \"southeastasia\",\r\n \"resourceName\": \"testingDisk\",\r\n \"resourceType\": \"Microsoft.Compute/disks\",\r\n \"resourceUri\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.Compute/disks/testingDisk\"\r\n },\r\n \"policyInfo\": {\r\n \"policyId\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/BackupVaults/DiskbackupVault2/backupPolicies/retentionpolicy2\",\r\n \"policyParameters\": {\r\n \"dataStoreParametersList\": [\r\n {\r\n \"objectType\": \"AzureOperationalStoreParameters\",\r\n \"resourceGroupId\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarOTDSRG\",\r\n \"dataStoreType\": \"OperationalStore\"\r\n }\r\n ]\r\n }\r\n },\r\n \"objectType\": \"BackupInstance\"\r\n }\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "fbda1019-f32d-408f-b9cf-cc44b86d3884" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.29916.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "1191" + ] }, - { - "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==?api-version=2021-01-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vbG9jYXRpb25zL3NvdXRoZWFzdGFzaWEvb3BlcmF0aW9uU3RhdHVzL1pHTTRaVFJpT0RndFltWXlNeTAwT1RnMExUbG1aRFF0TURrNE56a3dOakkzTkRReE96VXlaR1JsWWpSaUxUVTVPVGt0TkRJME1TMDRZakptTFRSa1pUQXdOelppTURsak5RPT0/YXBpLXZlcnNpb249MjAyMS0wMS0wMQ==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.29916.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "x-ms-request-id": [ - "" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11989" - ], - "x-ms-correlation-request-id": [ - "c1dfbf07-5be7-4ea3-af4e-010a3e1ea220" - ], - "x-ms-routing-request-id": [ - "JIOINDIAWEST:20210512T132126Z:c1dfbf07-5be7-4ea3-af4e-010a3e1ea220" - ], - "Date": [ - "Wed, 12 May 2021 13:21:25 GMT" - ], - "Content-Length": [ - "443" - ], - "Content-Type": [ - "application/json" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==\",\r\n \"name\": \"ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==\",\r\n \"status\": \"Inprogress\",\r\n \"startTime\": \"2021-05-12T13:20:24.3776183Z\",\r\n \"endTime\": \"0001-01-01T00:00:00\"\r\n}", - "StatusCode": 200 + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "15" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxO2ZlYjZiM2FjLTg0M2YtNGI2Ni1hODUxLTI3YjBjZWVjNzc3MQ==?api-version=2021-07-01" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-correlation-request-id": [ + "f13c9531-2b4a-4220-a02f-522f344508d3" + ], + "x-ms-routing-request-id": [ + "JIOINDIAWEST:20210512T130654Z:f13c9531-2b4a-4220-a02f-522f344508d3" + ], + "Date": [ + "Wed, 12 May 2021 13:06:54 GMT" + ], + "Content-Length": [ + "1401" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ] }, - { - "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==?api-version=2021-01-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vbG9jYXRpb25zL3NvdXRoZWFzdGFzaWEvb3BlcmF0aW9uU3RhdHVzL1pHTTRaVFJpT0RndFltWXlNeTAwT1RnMExUbG1aRFF0TURrNE56a3dOakkzTkRReE96VXlaR1JsWWpSaUxUVTVPVGt0TkRJME1TMDRZakptTFRSa1pUQXdOelppTURsak5RPT0/YXBpLXZlcnNpb249MjAyMS0wMS0wMQ==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.29916.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "x-ms-request-id": [ - "" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11988" - ], - "x-ms-correlation-request-id": [ - "81fcd9ee-6241-4b49-acf9-09535c3e9466" - ], - "x-ms-routing-request-id": [ - "JIOINDIAWEST:20210512T132136Z:81fcd9ee-6241-4b49-acf9-09535c3e9466" - ], - "Date": [ - "Wed, 12 May 2021 13:21:35 GMT" - ], - "Content-Length": [ - "443" - ], - "Content-Type": [ - "application/json" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==\",\r\n \"name\": \"ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==\",\r\n \"status\": \"Succeeded\",\r\n \"startTime\": \"2021-05-12T13:20:24.3776183Z\",\r\n \"endTime\": \"2021-05-12T13:21:28Z\"\r\n}", - "StatusCode": 200 + "ResponseBody": "{\r\n \"id\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/backupVaults/DiskbackupVault2/backupInstances/testingDisk\",\r\n \"name\": \"testingDisk\",\r\n \"type\": \"Microsoft.DataProtection/backupVaults/backupInstances\",\r\n \"properties\": {\r\n \"friendlyName\": \"testingDisk\",\r\n \"dataSourceInfo\": {\r\n \"resourceID\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.Compute/disks/testingDisk\",\r\n \"resourceUri\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.Compute/disks/testingDisk\",\r\n \"datasourceType\": \"Microsoft.Compute/disks\",\r\n \"resourceName\": \"testingDisk\",\r\n \"resourceType\": \"Microsoft.Compute/disks\",\r\n \"resourceLocation\": \"southeastasia\",\r\n \"objectType\": \"Datasource\"\r\n },\r\n \"policyInfo\": {\r\n \"policyId\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/backupVaults/DiskbackupVault2/backupPolicies/retentionpolicy2\",\r\n \"policyParameters\": {\r\n \"dataStoreParametersList\": [\r\n {\r\n \"objectType\": \"AzureOperationalStoreParameters\",\r\n \"resourceGroupId\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarOTDSRG\",\r\n \"dataStoreType\": \"OperationalStore\"\r\n }\r\n ]\r\n }\r\n },\r\n \"protectionStatus\": {\r\n \"status\": \"ConfiguringProtection\"\r\n },\r\n \"currentProtectionState\": \"ConfiguringProtection\",\r\n \"provisioningState\": \"Provisioning\",\r\n \"objectType\": \"BackupInstance\"\r\n }\r\n}", + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxO2ZlYjZiM2FjLTg0M2YtNGI2Ni1hODUxLTI3YjBjZWVjNzc3MQ==?api-version=2021-07-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vbG9jYXRpb25zL3NvdXRoZWFzdGFzaWEvb3BlcmF0aW9uU3RhdHVzL1pHTTRaVFJpT0RndFltWXlNeTAwT1RnMExUbG1aRFF0TURrNE56a3dOakkzTkRReE8yWmxZalppTTJGakxUZzBNMll0TkdJMk5pMWhPRFV4TFRJM1lqQmpaV1ZqTnpjM01RPT0/YXBpLXZlcnNpb249MjAyMS0wNy0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.29916.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" + ] }, - { - "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationResults/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==?api-version=2021-01-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vbG9jYXRpb25zL3NvdXRoZWFzdGFzaWEvb3BlcmF0aW9uUmVzdWx0cy9aR000WlRSaU9EZ3RZbVl5TXkwME9UZzBMVGxtWkRRdE1EazROemt3TmpJM05EUXhPelV5WkdSbFlqUmlMVFU1T1RrdE5ESTBNUzA0WWpKbUxUUmtaVEF3TnpaaU1EbGpOUT09P2FwaS12ZXJzaW9uPTIwMjEtMDEtMDE=", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.29916.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Retry-After": [ - "30" - ], - "Azure-AsyncOperation": [ - "https://management.azure.com/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==?api-version=2021-01-01" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "x-ms-request-id": [ - "" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11987" - ], - "x-ms-correlation-request-id": [ - "531cdff0-7807-49f0-a079-a680539054b6" - ], - "x-ms-routing-request-id": [ - "JIOINDIAWEST:20210512T132136Z:531cdff0-7807-49f0-a079-a680539054b6" - ], - "Date": [ - "Wed, 12 May 2021 13:21:35 GMT" - ], - "Content-Length": [ - "41" - ], - "Content-Type": [ - "application/json" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"objectType\": \"OperationJobExtendedInfo\"\r\n}", - "StatusCode": 200 + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11997" + ], + "x-ms-correlation-request-id": [ + "f28cb4a3-ab75-4247-81e0-a32b7dd207e7" + ], + "x-ms-routing-request-id": [ + "JIOINDIAWEST:20210512T130721Z:f28cb4a3-ab75-4247-81e0-a32b7dd207e7" + ], + "Date": [ + "Wed, 12 May 2021 13:07:20 GMT" + ], + "Content-Length": [ + "443" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ] }, - { - "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/backupVaults/DiskbackupVault2/backupInstances/testingDisk/restore?api-version=2021-01-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Jlc291cmNlR3JvdXBzL21heWFnZ2FyRGlza1JHL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vYmFja3VwVmF1bHRzL0Rpc2tiYWNrdXBWYXVsdDIvYmFja3VwSW5zdGFuY2VzL3Rlc3RpbmdEaXNrL3Jlc3RvcmU/YXBpLXZlcnNpb249MjAyMS0wMS0wMQ==", - "RequestMethod": "POST", - "RequestBody": "{\r\n \"objectType\": \"AzureBackupRecoveryPointBasedRestoreRequest\",\r\n \"recoveryPointId\": \"7327d7065c4145b3b6d80bcb8a787ea6\",\r\n \"restoreTargetInfo\": {\r\n \"objectType\": \"RestoreTargetInfo\",\r\n \"datasourceInfo\": {\r\n \"datasourceType\": \"Microsoft.Compute/disks\",\r\n \"objectType\": \"Datasource\",\r\n \"resourceID\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarTargetRG/providers/Microsoft.Compute/disks/restoreDisk1\",\r\n \"resourceLocation\": \"southeastasia\",\r\n \"resourceName\": \"restoreDisk1\",\r\n \"resourceType\": \"Microsoft.Compute/disks\",\r\n \"resourceUri\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarTargetRG/providers/Microsoft.Compute/disks/restoreDisk1\"\r\n },\r\n \"restoreLocation\": \"southeastasia\",\r\n \"recoveryOption\": \"FailIfExists\"\r\n },\r\n \"sourceDataStoreType\": \"OperationalStore\"\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "6ecc7029-64e4-4475-8d8a-8eaf343c47c4" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.29916.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "885" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationResults/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzlmYjc2NjdiLTIzMzYtNDFlNi1hMGE5LTYzNTNmMDYyMTkwNQ==?api-version=2021-01-01" - ], - "Retry-After": [ - "30" - ], - "Azure-AsyncOperation": [ - "https://management.azure.com/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzlmYjc2NjdiLTIzMzYtNDFlNi1hMGE5LTYzNTNmMDYyMTkwNQ==?api-version=2021-01-01" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "x-ms-request-id": [ - "" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1198" - ], - "x-ms-correlation-request-id": [ - "6df6f3c2-183c-47dc-939f-1c469090589e" - ], - "x-ms-routing-request-id": [ - "JIOINDIAWEST:20210512T132320Z:6df6f3c2-183c-47dc-939f-1c469090589e" - ], - "Date": [ - "Wed, 12 May 2021 13:23:20 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 + "ResponseBody": "{\r\n \"id\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxO2ZlYjZiM2FjLTg0M2YtNGI2Ni1hODUxLTI3YjBjZWVjNzc3MQ==\",\r\n \"name\": \"ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxO2ZlYjZiM2FjLTg0M2YtNGI2Ni1hODUxLTI3YjBjZWVjNzc3MQ==\",\r\n \"status\": \"Succeeded\",\r\n \"startTime\": \"2021-05-12T13:06:54.1586653Z\",\r\n \"endTime\": \"2021-05-12T13:06:57Z\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/backupVaults/DiskbackupVault2/backupInstances/testingDisk?api-version=2021-07-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Jlc291cmNlR3JvdXBzL21heWFnZ2FyRGlza1JHL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vYmFja3VwVmF1bHRzL0Rpc2tiYWNrdXBWYXVsdDIvYmFja3VwSW5zdGFuY2VzL3Rlc3RpbmdEaXNrP2FwaS12ZXJzaW9uPTIwMjEtMDctMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.29916.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" + ] }, - { - "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzlmYjc2NjdiLTIzMzYtNDFlNi1hMGE5LTYzNTNmMDYyMTkwNQ==?api-version=2021-01-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vbG9jYXRpb25zL3NvdXRoZWFzdGFzaWEvb3BlcmF0aW9uU3RhdHVzL1pHTTRaVFJpT0RndFltWXlNeTAwT1RnMExUbG1aRFF0TURrNE56a3dOakkzTkRReE96bG1ZamMyTmpkaUxUSXpNell0TkRGbE5pMWhNR0U1TFRZek5UTm1NRFl5TVRrd05RPT0/YXBpLXZlcnNpb249MjAyMS0wMS0wMQ==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.29916.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "x-ms-request-id": [ - "" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11986" - ], - "x-ms-correlation-request-id": [ - "9de2dfb9-2915-4bd0-8dee-3b1731a64dfa" - ], - "x-ms-routing-request-id": [ - "JIOINDIAWEST:20210512T132351Z:9de2dfb9-2915-4bd0-8dee-3b1731a64dfa" - ], - "Date": [ - "Wed, 12 May 2021 13:23:50 GMT" - ], - "Content-Length": [ - "703" - ], - "Content-Type": [ - "application/json" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzlmYjc2NjdiLTIzMzYtNDFlNi1hMGE5LTYzNTNmMDYyMTkwNQ==\",\r\n \"name\": \"ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzlmYjc2NjdiLTIzMzYtNDFlNi1hMGE5LTYzNTNmMDYyMTkwNQ==\",\r\n \"status\": \"Succeeded\",\r\n \"startTime\": \"2021-05-12T13:23:20.6280688Z\",\r\n \"endTime\": \"2021-05-12T13:23:23Z\",\r\n \"properties\": {\r\n \"jobId\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/backupVaults/DiskbackupVault2/backupJobs/0c4803ea-3c92-40f1-a1dc-a5d7c602f1d5\",\r\n \"objectType\": \"OperationJobExtendedInfo\"\r\n }\r\n}", - "StatusCode": 200 + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11996" + ], + "x-ms-correlation-request-id": [ + "95793c6b-3998-434a-b34a-198cdafa9193" + ], + "x-ms-routing-request-id": [ + "JIOINDIAWEST:20210512T130722Z:95793c6b-3998-434a-b34a-198cdafa9193" + ], + "Date": [ + "Wed, 12 May 2021 13:07:21 GMT" + ], + "Content-Length": [ + "1398" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ] }, - { - "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationResults/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzlmYjc2NjdiLTIzMzYtNDFlNi1hMGE5LTYzNTNmMDYyMTkwNQ==?api-version=2021-01-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vbG9jYXRpb25zL3NvdXRoZWFzdGFzaWEvb3BlcmF0aW9uUmVzdWx0cy9aR000WlRSaU9EZ3RZbVl5TXkwME9UZzBMVGxtWkRRdE1EazROemt3TmpJM05EUXhPemxtWWpjMk5qZGlMVEl6TXpZdE5ERmxOaTFoTUdFNUxUWXpOVE5tTURZeU1Ua3dOUT09P2FwaS12ZXJzaW9uPTIwMjEtMDEtMDE=", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.29916.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Retry-After": [ - "30" - ], - "Azure-AsyncOperation": [ - "https://management.azure.com/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzlmYjc2NjdiLTIzMzYtNDFlNi1hMGE5LTYzNTNmMDYyMTkwNQ==?api-version=2021-01-01" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "x-ms-request-id": [ - "" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11985" - ], - "x-ms-correlation-request-id": [ - "f39716a9-2769-465c-a915-e2baaa599806" - ], - "x-ms-routing-request-id": [ - "JIOINDIAWEST:20210512T132351Z:f39716a9-2769-465c-a915-e2baaa599806" - ], - "Date": [ - "Wed, 12 May 2021 13:23:50 GMT" - ], - "Content-Length": [ - "246" - ], - "Content-Type": [ - "application/json" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"jobId\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/backupVaults/DiskbackupVault2/backupJobs/0c4803ea-3c92-40f1-a1dc-a5d7c602f1d5\",\r\n \"objectType\": \"OperationJobExtendedInfo\"\r\n}", - "StatusCode": 200 - } - ], + "ResponseBody": "{\r\n \"id\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/backupVaults/DiskbackupVault2/backupInstances/testingDisk\",\r\n \"name\": \"testingDisk\",\r\n \"type\": \"Microsoft.DataProtection/backupVaults/backupInstances\",\r\n \"properties\": {\r\n \"friendlyName\": \"testingDisk\",\r\n \"dataSourceInfo\": {\r\n \"resourceID\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.Compute/disks/testingDisk\",\r\n \"resourceUri\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.Compute/disks/testingDisk\",\r\n \"datasourceType\": \"Microsoft.Compute/disks\",\r\n \"resourceName\": \"testingDisk\",\r\n \"resourceType\": \"Microsoft.Compute/disks\",\r\n \"resourceLocation\": \"southeastasia\",\r\n \"objectType\": \"Datasource\"\r\n },\r\n \"policyInfo\": {\r\n \"policyId\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/backupVaults/DiskbackupVault2/backupPolicies/retentionpolicy2\",\r\n \"policyParameters\": {\r\n \"dataStoreParametersList\": [\r\n {\r\n \"objectType\": \"AzureOperationalStoreParameters\",\r\n \"resourceGroupId\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarOTDSRG\",\r\n \"dataStoreType\": \"OperationalStore\"\r\n }\r\n ]\r\n }\r\n },\r\n \"protectionStatus\": {\r\n \"status\": \"ConfiguringProtection\"\r\n },\r\n \"currentProtectionState\": \"ConfiguringProtection\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"objectType\": \"BackupInstance\"\r\n }\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/backupVaults/DiskbackupVault2/backupInstances/testingDisk/backup?api-version=2021-07-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Jlc291cmNlR3JvdXBzL21heWFnZ2FyRGlza1JHL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vYmFja3VwVmF1bHRzL0Rpc2tiYWNrdXBWYXVsdDIvYmFja3VwSW5zdGFuY2VzL3Rlc3RpbmdEaXNrL2JhY2t1cD9hcGktdmVyc2lvbj0yMDIxLTA3LTAx", + "RequestMethod": "POST", + "RequestBody": "{\r\n \"backupRuleOptions\": {\r\n \"ruleName\": \"BackupHourly\",\r\n \"triggerOption\": {\r\n \"retentionTagOverride\": \"Default\"\r\n }\r\n }\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "7abddff2-cde5-4117-adb1-026b7a664e1a" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.29916.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "140" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationResults/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxO2U2MGYwOTA2LWFhOWMtNDAwOS04ZTM0LTVmNzk2OGQyZDRkYQ==?api-version=2021-07-01" + ], + "Retry-After": [ + "30" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxO2U2MGYwOTA2LWFhOWMtNDAwOS04ZTM0LTVmNzk2OGQyZDRkYQ==?api-version=2021-07-01" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1198" + ], + "x-ms-correlation-request-id": [ + "27aa0626-c333-49e4-b1c9-9e35f37ca567" + ], + "x-ms-routing-request-id": [ + "JIOINDIAWEST:20210512T130905Z:27aa0626-c333-49e4-b1c9-9e35f37ca567" + ], + "Date": [ + "Wed, 12 May 2021 13:09:05 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxO2U2MGYwOTA2LWFhOWMtNDAwOS04ZTM0LTVmNzk2OGQyZDRkYQ==?api-version=2021-07-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vbG9jYXRpb25zL3NvdXRoZWFzdGFzaWEvb3BlcmF0aW9uU3RhdHVzL1pHTTRaVFJpT0RndFltWXlNeTAwT1RnMExUbG1aRFF0TURrNE56a3dOakkzTkRReE8yVTJNR1l3T1RBMkxXRmhPV010TkRBd09TMDRaVE0wTFRWbU56azJPR1F5WkRSa1lRPT0/YXBpLXZlcnNpb249MjAyMS0wNy0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.29916.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11995" + ], + "x-ms-correlation-request-id": [ + "1655a584-2829-4ad1-858d-b843a69a37d8" + ], + "x-ms-routing-request-id": [ + "JIOINDIAWEST:20210512T130935Z:1655a584-2829-4ad1-858d-b843a69a37d8" + ], + "Date": [ + "Wed, 12 May 2021 13:09:35 GMT" + ], + "Content-Length": [ + "703" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxO2U2MGYwOTA2LWFhOWMtNDAwOS04ZTM0LTVmNzk2OGQyZDRkYQ==\",\r\n \"name\": \"ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxO2U2MGYwOTA2LWFhOWMtNDAwOS04ZTM0LTVmNzk2OGQyZDRkYQ==\",\r\n \"status\": \"Succeeded\",\r\n \"startTime\": \"2021-05-12T13:09:05.2513266Z\",\r\n \"endTime\": \"2021-05-12T13:09:08Z\",\r\n \"properties\": {\r\n \"jobId\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/backupVaults/DiskbackupVault2/backupJobs/610fe9cb-4196-4508-ab4b-4dbcfdc44b57\",\r\n \"objectType\": \"OperationJobExtendedInfo\"\r\n }\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationResults/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxO2U2MGYwOTA2LWFhOWMtNDAwOS04ZTM0LTVmNzk2OGQyZDRkYQ==?api-version=2021-07-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vbG9jYXRpb25zL3NvdXRoZWFzdGFzaWEvb3BlcmF0aW9uUmVzdWx0cy9aR000WlRSaU9EZ3RZbVl5TXkwME9UZzBMVGxtWkRRdE1EazROemt3TmpJM05EUXhPMlUyTUdZd09UQTJMV0ZoT1dNdE5EQXdPUzA0WlRNMExUVm1OemsyT0dReVpEUmtZUT09P2FwaS12ZXJzaW9uPTIwMjEtMDctMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.29916.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "30" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxO2U2MGYwOTA2LWFhOWMtNDAwOS04ZTM0LTVmNzk2OGQyZDRkYQ==?api-version=2021-07-01" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11994" + ], + "x-ms-correlation-request-id": [ + "978f7549-c428-4fc2-b3c7-99e4d9576db3" + ], + "x-ms-routing-request-id": [ + "JIOINDIAWEST:20210512T130936Z:978f7549-c428-4fc2-b3c7-99e4d9576db3" + ], + "Date": [ + "Wed, 12 May 2021 13:09:35 GMT" + ], + "Content-Length": [ + "246" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"jobId\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/backupVaults/DiskbackupVault2/backupJobs/610fe9cb-4196-4508-ab4b-4dbcfdc44b57\",\r\n \"objectType\": \"OperationJobExtendedInfo\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/backupVaults/DiskbackupVault2/backupInstances/testingDisk/validateRestore?api-version=2021-07-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Jlc291cmNlR3JvdXBzL21heWFnZ2FyRGlza1JHL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vYmFja3VwVmF1bHRzL0Rpc2tiYWNrdXBWYXVsdDIvYmFja3VwSW5zdGFuY2VzL3Rlc3RpbmdEaXNrL3ZhbGlkYXRlUmVzdG9yZT9hcGktdmVyc2lvbj0yMDIxLTA3LTAx", + "RequestMethod": "POST", + "RequestBody": "{\r\n \"restoreRequestObject\": {\r\n \"objectType\": \"AzureBackupRecoveryPointBasedRestoreRequest\",\r\n \"recoveryPointId\": \"7327d7065c4145b3b6d80bcb8a787ea6\",\r\n \"restoreTargetInfo\": {\r\n \"objectType\": \"RestoreTargetInfo\",\r\n \"datasourceInfo\": {\r\n \"datasourceType\": \"Microsoft.Compute/disks\",\r\n \"objectType\": \"Datasource\",\r\n \"resourceID\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggartargetrg/providers/Microsoft.Compute/disks/restoredisk1\",\r\n \"resourceLocation\": \"centraluseuap\",\r\n \"resourceName\": \"restoredisk1\",\r\n \"resourceType\": \"Microsoft.Compute/disks\",\r\n \"resourceUri\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggartargetrg/providers/Microsoft.Compute/disks/restoredisk1\"\r\n },\r\n \"restoreLocation\": \"southeastasia\",\r\n \"recoveryOption\": \"FailIfExists\"\r\n },\r\n \"sourceDataStoreType\": \"OperationalStore\"\r\n }\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "7036d956-39b9-4a14-8088-bd24cc314a0e" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.29916.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "953" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationResults/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==?api-version=2021-07-01" + ], + "Retry-After": [ + "10" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==?api-version=2021-07-01" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-correlation-request-id": [ + "50d3dd23-f6a3-4032-9989-3ac12c23a0b7" + ], + "x-ms-routing-request-id": [ + "JIOINDIAWEST:20210512T132024Z:50d3dd23-f6a3-4032-9989-3ac12c23a0b7" + ], + "Date": [ + "Wed, 12 May 2021 13:20:24 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==?api-version=2021-07-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vbG9jYXRpb25zL3NvdXRoZWFzdGFzaWEvb3BlcmF0aW9uU3RhdHVzL1pHTTRaVFJpT0RndFltWXlNeTAwT1RnMExUbG1aRFF0TURrNE56a3dOakkzTkRReE96VXlaR1JsWWpSaUxUVTVPVGt0TkRJME1TMDRZakptTFRSa1pUQXdOelppTURsak5RPT0/YXBpLXZlcnNpb249MjAyMS0wNy0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.29916.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11994" + ], + "x-ms-correlation-request-id": [ + "0401d1d9-9369-4da2-b6bb-af477de69924" + ], + "x-ms-routing-request-id": [ + "JIOINDIAWEST:20210512T132034Z:0401d1d9-9369-4da2-b6bb-af477de69924" + ], + "Date": [ + "Wed, 12 May 2021 13:20:34 GMT" + ], + "Content-Length": [ + "443" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==\",\r\n \"name\": \"ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==\",\r\n \"status\": \"Inprogress\",\r\n \"startTime\": \"2021-05-12T13:20:24.3776183Z\",\r\n \"endTime\": \"0001-01-01T00:00:00\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==?api-version=2021-07-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vbG9jYXRpb25zL3NvdXRoZWFzdGFzaWEvb3BlcmF0aW9uU3RhdHVzL1pHTTRaVFJpT0RndFltWXlNeTAwT1RnMExUbG1aRFF0TURrNE56a3dOakkzTkRReE96VXlaR1JsWWpSaUxUVTVPVGt0TkRJME1TMDRZakptTFRSa1pUQXdOelppTURsak5RPT0/YXBpLXZlcnNpb249MjAyMS0wNy0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.29916.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11993" + ], + "x-ms-correlation-request-id": [ + "8396405c-2ebc-4d54-92b2-a205eaf6285f" + ], + "x-ms-routing-request-id": [ + "JIOINDIAWEST:20210512T132045Z:8396405c-2ebc-4d54-92b2-a205eaf6285f" + ], + "Date": [ + "Wed, 12 May 2021 13:20:44 GMT" + ], + "Content-Length": [ + "443" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==\",\r\n \"name\": \"ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==\",\r\n \"status\": \"Inprogress\",\r\n \"startTime\": \"2021-05-12T13:20:24.3776183Z\",\r\n \"endTime\": \"0001-01-01T00:00:00\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==?api-version=2021-07-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vbG9jYXRpb25zL3NvdXRoZWFzdGFzaWEvb3BlcmF0aW9uU3RhdHVzL1pHTTRaVFJpT0RndFltWXlNeTAwT1RnMExUbG1aRFF0TURrNE56a3dOakkzTkRReE96VXlaR1JsWWpSaUxUVTVPVGt0TkRJME1TMDRZakptTFRSa1pUQXdOelppTURsak5RPT0/YXBpLXZlcnNpb249MjAyMS0wNy0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.29916.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11992" + ], + "x-ms-correlation-request-id": [ + "55ef0e8d-be15-41c8-acb5-325d89d4aae4" + ], + "x-ms-routing-request-id": [ + "JIOINDIAWEST:20210512T132055Z:55ef0e8d-be15-41c8-acb5-325d89d4aae4" + ], + "Date": [ + "Wed, 12 May 2021 13:20:54 GMT" + ], + "Content-Length": [ + "443" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==\",\r\n \"name\": \"ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==\",\r\n \"status\": \"Inprogress\",\r\n \"startTime\": \"2021-05-12T13:20:24.3776183Z\",\r\n \"endTime\": \"0001-01-01T00:00:00\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==?api-version=2021-07-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vbG9jYXRpb25zL3NvdXRoZWFzdGFzaWEvb3BlcmF0aW9uU3RhdHVzL1pHTTRaVFJpT0RndFltWXlNeTAwT1RnMExUbG1aRFF0TURrNE56a3dOakkzTkRReE96VXlaR1JsWWpSaUxUVTVPVGt0TkRJME1TMDRZakptTFRSa1pUQXdOelppTURsak5RPT0/YXBpLXZlcnNpb249MjAyMS0wNy0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.29916.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11991" + ], + "x-ms-correlation-request-id": [ + "6afee5a4-9fe5-4018-afdc-06a90b4ccdda" + ], + "x-ms-routing-request-id": [ + "JIOINDIAWEST:20210512T132105Z:6afee5a4-9fe5-4018-afdc-06a90b4ccdda" + ], + "Date": [ + "Wed, 12 May 2021 13:21:04 GMT" + ], + "Content-Length": [ + "443" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==\",\r\n \"name\": \"ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==\",\r\n \"status\": \"Inprogress\",\r\n \"startTime\": \"2021-05-12T13:20:24.3776183Z\",\r\n \"endTime\": \"0001-01-01T00:00:00\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==?api-version=2021-07-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vbG9jYXRpb25zL3NvdXRoZWFzdGFzaWEvb3BlcmF0aW9uU3RhdHVzL1pHTTRaVFJpT0RndFltWXlNeTAwT1RnMExUbG1aRFF0TURrNE56a3dOakkzTkRReE96VXlaR1JsWWpSaUxUVTVPVGt0TkRJME1TMDRZakptTFRSa1pUQXdOelppTURsak5RPT0/YXBpLXZlcnNpb249MjAyMS0wNy0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.29916.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11990" + ], + "x-ms-correlation-request-id": [ + "df7539c0-6fe7-4ca9-a71f-ebf7b49ef92a" + ], + "x-ms-routing-request-id": [ + "JIOINDIAWEST:20210512T132115Z:df7539c0-6fe7-4ca9-a71f-ebf7b49ef92a" + ], + "Date": [ + "Wed, 12 May 2021 13:21:15 GMT" + ], + "Content-Length": [ + "443" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==\",\r\n \"name\": \"ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==\",\r\n \"status\": \"Inprogress\",\r\n \"startTime\": \"2021-05-12T13:20:24.3776183Z\",\r\n \"endTime\": \"0001-01-01T00:00:00\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==?api-version=2021-07-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vbG9jYXRpb25zL3NvdXRoZWFzdGFzaWEvb3BlcmF0aW9uU3RhdHVzL1pHTTRaVFJpT0RndFltWXlNeTAwT1RnMExUbG1aRFF0TURrNE56a3dOakkzTkRReE96VXlaR1JsWWpSaUxUVTVPVGt0TkRJME1TMDRZakptTFRSa1pUQXdOelppTURsak5RPT0/YXBpLXZlcnNpb249MjAyMS0wNy0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.29916.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11989" + ], + "x-ms-correlation-request-id": [ + "c1dfbf07-5be7-4ea3-af4e-010a3e1ea220" + ], + "x-ms-routing-request-id": [ + "JIOINDIAWEST:20210512T132126Z:c1dfbf07-5be7-4ea3-af4e-010a3e1ea220" + ], + "Date": [ + "Wed, 12 May 2021 13:21:25 GMT" + ], + "Content-Length": [ + "443" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==\",\r\n \"name\": \"ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==\",\r\n \"status\": \"Inprogress\",\r\n \"startTime\": \"2021-05-12T13:20:24.3776183Z\",\r\n \"endTime\": \"0001-01-01T00:00:00\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==?api-version=2021-07-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vbG9jYXRpb25zL3NvdXRoZWFzdGFzaWEvb3BlcmF0aW9uU3RhdHVzL1pHTTRaVFJpT0RndFltWXlNeTAwT1RnMExUbG1aRFF0TURrNE56a3dOakkzTkRReE96VXlaR1JsWWpSaUxUVTVPVGt0TkRJME1TMDRZakptTFRSa1pUQXdOelppTURsak5RPT0/YXBpLXZlcnNpb249MjAyMS0wNy0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.29916.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11988" + ], + "x-ms-correlation-request-id": [ + "81fcd9ee-6241-4b49-acf9-09535c3e9466" + ], + "x-ms-routing-request-id": [ + "JIOINDIAWEST:20210512T132136Z:81fcd9ee-6241-4b49-acf9-09535c3e9466" + ], + "Date": [ + "Wed, 12 May 2021 13:21:35 GMT" + ], + "Content-Length": [ + "443" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==\",\r\n \"name\": \"ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==\",\r\n \"status\": \"Succeeded\",\r\n \"startTime\": \"2021-05-12T13:20:24.3776183Z\",\r\n \"endTime\": \"2021-05-12T13:21:28Z\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationResults/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==?api-version=2021-07-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vbG9jYXRpb25zL3NvdXRoZWFzdGFzaWEvb3BlcmF0aW9uUmVzdWx0cy9aR000WlRSaU9EZ3RZbVl5TXkwME9UZzBMVGxtWkRRdE1EazROemt3TmpJM05EUXhPelV5WkdSbFlqUmlMVFU1T1RrdE5ESTBNUzA0WWpKbUxUUmtaVEF3TnpaaU1EbGpOUT09P2FwaS12ZXJzaW9uPTIwMjEtMDctMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.29916.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "30" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzUyZGRlYjRiLTU5OTktNDI0MS04YjJmLTRkZTAwNzZiMDljNQ==?api-version=2021-07-01" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11987" + ], + "x-ms-correlation-request-id": [ + "531cdff0-7807-49f0-a079-a680539054b6" + ], + "x-ms-routing-request-id": [ + "JIOINDIAWEST:20210512T132136Z:531cdff0-7807-49f0-a079-a680539054b6" + ], + "Date": [ + "Wed, 12 May 2021 13:21:35 GMT" + ], + "Content-Length": [ + "41" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"objectType\": \"OperationJobExtendedInfo\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/backupVaults/DiskbackupVault2/backupInstances/testingDisk/restore?api-version=2021-07-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Jlc291cmNlR3JvdXBzL21heWFnZ2FyRGlza1JHL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vYmFja3VwVmF1bHRzL0Rpc2tiYWNrdXBWYXVsdDIvYmFja3VwSW5zdGFuY2VzL3Rlc3RpbmdEaXNrL3Jlc3RvcmU/YXBpLXZlcnNpb249MjAyMS0wNy0wMQ==", + "RequestMethod": "POST", + "RequestBody": "{\r\n \"objectType\": \"AzureBackupRecoveryPointBasedRestoreRequest\",\r\n \"recoveryPointId\": \"7327d7065c4145b3b6d80bcb8a787ea6\",\r\n \"restoreTargetInfo\": {\r\n \"objectType\": \"RestoreTargetInfo\",\r\n \"datasourceInfo\": {\r\n \"datasourceType\": \"Microsoft.Compute/disks\",\r\n \"objectType\": \"Datasource\",\r\n \"resourceID\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarTargetRG/providers/Microsoft.Compute/disks/restoreDisk1\",\r\n \"resourceLocation\": \"southeastasia\",\r\n \"resourceName\": \"restoreDisk1\",\r\n \"resourceType\": \"Microsoft.Compute/disks\",\r\n \"resourceUri\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarTargetRG/providers/Microsoft.Compute/disks/restoreDisk1\"\r\n },\r\n \"restoreLocation\": \"southeastasia\",\r\n \"recoveryOption\": \"FailIfExists\"\r\n },\r\n \"sourceDataStoreType\": \"OperationalStore\"\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "6ecc7029-64e4-4475-8d8a-8eaf343c47c4" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.29916.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "885" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationResults/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzlmYjc2NjdiLTIzMzYtNDFlNi1hMGE5LTYzNTNmMDYyMTkwNQ==?api-version=2021-07-01" + ], + "Retry-After": [ + "30" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzlmYjc2NjdiLTIzMzYtNDFlNi1hMGE5LTYzNTNmMDYyMTkwNQ==?api-version=2021-07-01" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1198" + ], + "x-ms-correlation-request-id": [ + "6df6f3c2-183c-47dc-939f-1c469090589e" + ], + "x-ms-routing-request-id": [ + "JIOINDIAWEST:20210512T132320Z:6df6f3c2-183c-47dc-939f-1c469090589e" + ], + "Date": [ + "Wed, 12 May 2021 13:23:20 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzlmYjc2NjdiLTIzMzYtNDFlNi1hMGE5LTYzNTNmMDYyMTkwNQ==?api-version=2021-07-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vbG9jYXRpb25zL3NvdXRoZWFzdGFzaWEvb3BlcmF0aW9uU3RhdHVzL1pHTTRaVFJpT0RndFltWXlNeTAwT1RnMExUbG1aRFF0TURrNE56a3dOakkzTkRReE96bG1ZamMyTmpkaUxUSXpNell0TkRGbE5pMWhNR0U1TFRZek5UTm1NRFl5TVRrd05RPT0/YXBpLXZlcnNpb249MjAyMS0wNy0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.29916.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11986" + ], + "x-ms-correlation-request-id": [ + "9de2dfb9-2915-4bd0-8dee-3b1731a64dfa" + ], + "x-ms-routing-request-id": [ + "JIOINDIAWEST:20210512T132351Z:9de2dfb9-2915-4bd0-8dee-3b1731a64dfa" + ], + "Date": [ + "Wed, 12 May 2021 13:23:50 GMT" + ], + "Content-Length": [ + "703" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzlmYjc2NjdiLTIzMzYtNDFlNi1hMGE5LTYzNTNmMDYyMTkwNQ==\",\r\n \"name\": \"ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzlmYjc2NjdiLTIzMzYtNDFlNi1hMGE5LTYzNTNmMDYyMTkwNQ==\",\r\n \"status\": \"Succeeded\",\r\n \"startTime\": \"2021-05-12T13:23:20.6280688Z\",\r\n \"endTime\": \"2021-05-12T13:23:23Z\",\r\n \"properties\": {\r\n \"jobId\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/backupVaults/DiskbackupVault2/backupJobs/0c4803ea-3c92-40f1-a1dc-a5d7c602f1d5\",\r\n \"objectType\": \"OperationJobExtendedInfo\"\r\n }\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationResults/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzlmYjc2NjdiLTIzMzYtNDFlNi1hMGE5LTYzNTNmMDYyMTkwNQ==?api-version=2021-07-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjJiODI5ZWUtNzkzNi00MGM5LWExYzktNDdhOTNmOWYzOTY1L3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YVByb3RlY3Rpb24vbG9jYXRpb25zL3NvdXRoZWFzdGFzaWEvb3BlcmF0aW9uUmVzdWx0cy9aR000WlRSaU9EZ3RZbVl5TXkwME9UZzBMVGxtWkRRdE1EazROemt3TmpJM05EUXhPemxtWWpjMk5qZGlMVEl6TXpZdE5ERmxOaTFoTUdFNUxUWXpOVE5tTURZeU1Ua3dOUT09P2FwaS12ZXJzaW9uPTIwMjEtMDctMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.29916.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.DataProtection.DataProtectionClient/4.1.4.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "30" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/providers/Microsoft.DataProtection/locations/southeastasia/operationStatus/ZGM4ZTRiODgtYmYyMy00OTg0LTlmZDQtMDk4NzkwNjI3NDQxOzlmYjc2NjdiLTIzMzYtNDFlNi1hMGE5LTYzNTNmMDYyMTkwNQ==?api-version=2021-07-01" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Server": [ + "Microsoft-IIS/10.0" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11985" + ], + "x-ms-correlation-request-id": [ + "f39716a9-2769-465c-a915-e2baaa599806" + ], + "x-ms-routing-request-id": [ + "JIOINDIAWEST:20210512T132351Z:f39716a9-2769-465c-a915-e2baaa599806" + ], + "Date": [ + "Wed, 12 May 2021 13:23:50 GMT" + ], + "Content-Length": [ + "246" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"jobId\": \"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggarDiskRG/providers/Microsoft.DataProtection/backupVaults/DiskbackupVault2/backupJobs/0c4803ea-3c92-40f1-a1dc-a5d7c602f1d5\",\r\n \"objectType\": \"OperationJobExtendedInfo\"\r\n}", + "StatusCode": 200 + } +], "Names": {}, "Variables": { "SubscriptionId": "62b829ee-7936-40c9-a1c9-47a93f9f3965" diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/tests/TestHelpers/TestHelper.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/tests/TestHelpers/TestHelper.cs index 5c24a7f313cd7..5de7453f10aca 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/tests/TestHelpers/TestHelper.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/tests/TestHelpers/TestHelper.cs @@ -103,7 +103,7 @@ public void ValidateForRestore(string backupInstanceName) { string requestData = "{\"objectType\":\"ValidateRestoreRequestObject\",\"restoreRequestObject\":{\"objectType\":\"AzureBackupRecoveryPointBasedRestoreRequest\",\"sourceDataStoreType\":\"OperationalStore\",\"restoreTargetInfo\":{\"objectType\":\"restoreTargetInfo\",\"recoveryOption\":\"FailIfExists\",\"dataSourceInfo\":{\"objectType\":\"Datasource\",\"resourceID\":\"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggartargetrg/providers/Microsoft.Compute/disks/restoredisk1\",\"resourceName\":\"restoredisk1\",\"resourceType\":\"Microsoft.Compute/disks\",\"resourceLocation\":\"centraluseuap\",\"resourceUri\":\"/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/mayaggartargetrg/providers/Microsoft.Compute/disks/restoredisk1\",\"datasourceType\":\"Microsoft.Compute/disks\"},\"restoreLocation\":\"southeastasia\"},\"recoveryPointId\":\"7327d7065c4145b3b6d80bcb8a787ea6\"}}"; ValidateRestoreRequestObject body = SafeJsonConvert.DeserializeObject(requestData.ToString(), BackupClient.DeserializationSettings); - var response = BackupClient.BackupInstances.ValidateRestore(VaultName, ResourceGroup, backupInstanceName, body.RestoreRequestObject); + var response = BackupClient.BackupInstances.ValidateForRestore(VaultName, ResourceGroup, backupInstanceName, body.RestoreRequestObject); Assert.NotNull(response); Assert.Null(response.JobId); }