From c54d9817ab7a3062937d5fe8af69861b62268716 Mon Sep 17 00:00:00 2001 From: Himanshu Agarwal Date: Thu, 11 Sep 2025 08:17:52 +0530 Subject: [PATCH 1/2] Updates RS SDK Added ARG SDK Added support for vault soft delete - Get soft deleted vault - Undelete softdeleted vault - Get deleted backup items in a soft deleted vault using ARG --- .../Conversions/ConversionHelpers.cs | 496 +++++++ .../SoftDeletedVaultAzureVmItem.cs | 49 + .../SoftDeletedVaultAzureFileShareItem.cs | 48 + ...ureWorkloadSAPHanaDatabaseProtectedItem.cs | 48 + ...ltAzureWorkloadSQLDatabaseProtectedItem.cs | 48 + .../ModelHelpers.cs | 54 + .../ARGAPIs/ResourceGraphAPIs.cs | 181 +++ ...ervices.Backup.ServiceClientAdapter.csproj | 1 + .../ServiceClientAdapter.cs | 7 +- ...overyServicesSoftDeletedVaultBackupItem.cs | 199 +++ .../RecoveryServices.Backup.csproj | 1 + .../Generated/IOperations.cs | 37 + .../Generated/IResourceGraphClient.cs | 96 ++ .../Models/AuthorizationScopeFilter.cs | 63 + .../Generated/Models/Column.cs | 74 ++ .../Generated/Models/ColumnDataType.cs | 75 ++ .../Generated/Models/Error.cs | 100 ++ .../Generated/Models/ErrorDetails.cs | 91 ++ .../Generated/Models/ErrorResponse.cs | 68 + .../Models/ErrorResponseException.cs | 55 + .../Generated/Models/Facet.cs | 64 + .../Generated/Models/FacetError.cs | 77 ++ .../Generated/Models/FacetRequest.cs | 76 ++ .../Generated/Models/FacetRequestOptions.cs | 105 ++ .../Generated/Models/FacetResult.cs | 91 ++ .../Generated/Models/FacetSortOrder.cs | 51 + .../Generated/Models/Operation.cs | 68 + .../Generated/Models/OperationDisplay.cs | 78 ++ .../Generated/Models/Page.cs} | 6 +- .../Generated/Models/QueryRequest.cs | 121 ++ .../Generated/Models/QueryRequestOptions.cs | 142 ++ .../Generated/Models/QueryResponse.cs | 130 ++ .../Generated/Models/ResultFormat.cs | 51 + .../Generated/Models/ResultTruncated.cs | 51 + .../Generated/Models/Table.cs | 86 ++ .../Generated/Operations.cs | 224 ++++ .../Generated/OperationsExtensions.cs | 43 + .../Generated/ResourceGraphClient.cs | 538 ++++++++ .../ResourceGraphClientExtensions.cs | 45 + .../RecoveryServices.Helper/README.md | 66 + .../RecoveryServices.Helper.csproj | 18 + .../Generated/DeletedVaultsOperations.cs | 1170 +++++++++++++++++ .../DeletedVaultsOperationsExtensions.cs | 244 ++++ .../Generated/IDeletedVaultsOperations.cs | 176 +++ .../Generated/IOperations.cs | 8 +- .../Generated/IRecoveryServicesClient.cs | 55 +- .../Generated/IRecoveryServicesOperations.cs | 50 +- .../Generated/IReplicationUsagesOperations.cs | 27 +- .../Generated/IUsagesOperations.cs | 27 +- .../Generated/IVaultsOperations.cs | 78 +- .../Generated/Models/AssociatedIdentity.cs | 60 + .../Models/CloudErrorRecoveryService.cs | 48 + .../CloudErrorRecoveryServiceException.cs | 55 + .../Generated/Models/DeletedVault.cs | 64 + .../Models/DeletedVaultProperties.cs | 68 + .../Models/DeletedVaultUndeleteInput.cs | 65 + .../DeletedVaultUndeleteInputProperties.cs | 62 + .../Models/DeletedVaultsUndeleteHeaders.cs | 55 + .../Generated/Models/ErrorAdditionalInfo.cs | 20 +- .../Generated/Models/IdentityType.cs | 19 + .../Generated/Models/Page.cs | 2 +- .../Generated/Models/PatchTrackedResource.cs | 26 +- .../Generated/Models/PatchVault.cs | 19 +- .../Generated/Models/PrivateLinkResource.cs | 38 +- .../Generated/Models/ProxyResource.cs | 59 + .../Generated/Models/Resource.cs | 39 +- .../Generated/Models/SecuritySettings.cs | 12 +- .../Models/SourceScanConfiguration.cs | 58 + .../Generated/Models/State.cs | 20 + .../Generated/Models/SystemData.cs | 4 +- .../Generated/Models/TrackedResource.cs | 41 +- .../Generated/Models/Vault.cs | 50 +- .../Models/VaultCertificateResponse.cs | 2 +- .../Models/VaultExtendedInfoResource.cs | 28 +- .../Models/VaultsCreateOrUpdateHeaders.cs | 55 + .../Generated/Models/VaultsDeleteHeaders.cs | 12 +- .../Generated/Models/VaultsUpdateHeaders.cs | 55 + .../Generated/Operations.cs | 26 +- .../Generated/OperationsExtensions.cs | 8 +- .../PrivateLinkResourcesOperations.cs | 51 +- .../Generated/RecoveryServicesClient.cs | 125 +- .../RecoveryServicesClientExtensions.cs | 32 +- .../Generated/RecoveryServicesOperations.cs | 140 +- .../RecoveryServicesOperationsExtensions.cs | 64 +- .../RegisteredIdentitiesOperations.cs | 21 +- .../Generated/ReplicationUsagesOperations.cs | 200 ++- .../ReplicationUsagesOperationsExtensions.cs | 41 +- .../Generated/UsagesOperations.cs | 200 ++- .../Generated/UsagesOperationsExtensions.cs | 41 +- .../Generated/VaultCertificatesOperations.cs | 21 +- .../Generated/VaultExtendedInfoOperations.cs | 57 +- .../Generated/VaultsOperations.cs | 321 +++-- .../Generated/VaultsOperationsExtensions.cs | 108 +- .../RecoveryServices.Management.Sdk/README.md | 13 +- .../RecoveryServices.Management.Sdk.sln | 24 + .../ScenarioTests/RecoveryServicesTests.ps1 | 150 +++ src/RecoveryServices/RecoveryServices.sln | 6 + .../RecoveryServices/Az.RecoveryServices.psd1 | 10 +- .../Common/PSRecoveryServicesClient.cs | 23 + .../Common/PSRecoveryServicesVaultClient.cs | 37 + .../RecoveryServices/Models/PSObjects.cs | 110 ++ ...AzureRmRecoveryServicesSoftDeletedVault.cs | 145 ++ .../UndoAzRecoveryServicesVaultDeletion.cs | 95 ++ 103 files changed, 8077 insertions(+), 785 deletions(-) create mode 100644 src/RecoveryServices/RecoveryServices.Backup.Models/AzareVmModels/SoftDeletedVaultAzureVmItem.cs create mode 100644 src/RecoveryServices/RecoveryServices.Backup.Models/AzureFileShareModels/SoftDeletedVaultAzureFileShareItem.cs create mode 100644 src/RecoveryServices/RecoveryServices.Backup.Models/AzureVmWorkloadModels/SoftDeletedVaultAzureWorkloadSAPHanaDatabaseProtectedItem.cs create mode 100644 src/RecoveryServices/RecoveryServices.Backup.Models/AzureVmWorkloadModels/SoftDeletedVaultAzureWorkloadSQLDatabaseProtectedItem.cs create mode 100644 src/RecoveryServices/RecoveryServices.Backup.Models/ModelHelpers.cs create mode 100644 src/RecoveryServices/RecoveryServices.Backup.ServiceClientAdapter/ARGAPIs/ResourceGraphAPIs.cs create mode 100644 src/RecoveryServices/RecoveryServices.Backup/Cmdlets/Item/GetAzureRmRecoveryServicesSoftDeletedVaultBackupItem.cs create mode 100644 src/RecoveryServices/RecoveryServices.Helper/Generated/IOperations.cs create mode 100644 src/RecoveryServices/RecoveryServices.Helper/Generated/IResourceGraphClient.cs create mode 100644 src/RecoveryServices/RecoveryServices.Helper/Generated/Models/AuthorizationScopeFilter.cs create mode 100644 src/RecoveryServices/RecoveryServices.Helper/Generated/Models/Column.cs create mode 100644 src/RecoveryServices/RecoveryServices.Helper/Generated/Models/ColumnDataType.cs create mode 100644 src/RecoveryServices/RecoveryServices.Helper/Generated/Models/Error.cs create mode 100644 src/RecoveryServices/RecoveryServices.Helper/Generated/Models/ErrorDetails.cs create mode 100644 src/RecoveryServices/RecoveryServices.Helper/Generated/Models/ErrorResponse.cs create mode 100644 src/RecoveryServices/RecoveryServices.Helper/Generated/Models/ErrorResponseException.cs create mode 100644 src/RecoveryServices/RecoveryServices.Helper/Generated/Models/Facet.cs create mode 100644 src/RecoveryServices/RecoveryServices.Helper/Generated/Models/FacetError.cs create mode 100644 src/RecoveryServices/RecoveryServices.Helper/Generated/Models/FacetRequest.cs create mode 100644 src/RecoveryServices/RecoveryServices.Helper/Generated/Models/FacetRequestOptions.cs create mode 100644 src/RecoveryServices/RecoveryServices.Helper/Generated/Models/FacetResult.cs create mode 100644 src/RecoveryServices/RecoveryServices.Helper/Generated/Models/FacetSortOrder.cs create mode 100644 src/RecoveryServices/RecoveryServices.Helper/Generated/Models/Operation.cs create mode 100644 src/RecoveryServices/RecoveryServices.Helper/Generated/Models/OperationDisplay.cs rename src/RecoveryServices/{RecoveryServices.Management.Sdk/Generated/Models/Page1.cs => RecoveryServices.Helper/Generated/Models/Page.cs} (90%) create mode 100644 src/RecoveryServices/RecoveryServices.Helper/Generated/Models/QueryRequest.cs create mode 100644 src/RecoveryServices/RecoveryServices.Helper/Generated/Models/QueryRequestOptions.cs create mode 100644 src/RecoveryServices/RecoveryServices.Helper/Generated/Models/QueryResponse.cs create mode 100644 src/RecoveryServices/RecoveryServices.Helper/Generated/Models/ResultFormat.cs create mode 100644 src/RecoveryServices/RecoveryServices.Helper/Generated/Models/ResultTruncated.cs create mode 100644 src/RecoveryServices/RecoveryServices.Helper/Generated/Models/Table.cs create mode 100644 src/RecoveryServices/RecoveryServices.Helper/Generated/Operations.cs create mode 100644 src/RecoveryServices/RecoveryServices.Helper/Generated/OperationsExtensions.cs create mode 100644 src/RecoveryServices/RecoveryServices.Helper/Generated/ResourceGraphClient.cs create mode 100644 src/RecoveryServices/RecoveryServices.Helper/Generated/ResourceGraphClientExtensions.cs create mode 100644 src/RecoveryServices/RecoveryServices.Helper/README.md create mode 100644 src/RecoveryServices/RecoveryServices.Helper/RecoveryServices.Helper.csproj create mode 100644 src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/DeletedVaultsOperations.cs create mode 100644 src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/DeletedVaultsOperationsExtensions.cs create mode 100644 src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/IDeletedVaultsOperations.cs create mode 100644 src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/AssociatedIdentity.cs create mode 100644 src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/CloudErrorRecoveryService.cs create mode 100644 src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/CloudErrorRecoveryServiceException.cs create mode 100644 src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/DeletedVault.cs create mode 100644 src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/DeletedVaultProperties.cs create mode 100644 src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/DeletedVaultUndeleteInput.cs create mode 100644 src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/DeletedVaultUndeleteInputProperties.cs create mode 100644 src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/DeletedVaultsUndeleteHeaders.cs create mode 100644 src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/IdentityType.cs create mode 100644 src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/ProxyResource.cs create mode 100644 src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/SourceScanConfiguration.cs create mode 100644 src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/State.cs create mode 100644 src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/VaultsCreateOrUpdateHeaders.cs create mode 100644 src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/VaultsUpdateHeaders.cs create mode 100644 src/RecoveryServices/RecoveryServices.Management.Sdk/RecoveryServices.Management.Sdk.sln create mode 100644 src/RecoveryServices/RecoveryServices/Vault/GetAzureRmRecoveryServicesSoftDeletedVault.cs create mode 100644 src/RecoveryServices/RecoveryServices/Vault/UndoAzRecoveryServicesVaultDeletion.cs diff --git a/src/RecoveryServices/RecoveryServices.Backup.Helpers/Conversions/ConversionHelpers.cs b/src/RecoveryServices/RecoveryServices.Backup.Helpers/Conversions/ConversionHelpers.cs index 70d9338aaad0..4391999e35d7 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Helpers/Conversions/ConversionHelpers.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Helpers/Conversions/ConversionHelpers.cs @@ -18,6 +18,7 @@ using System.Collections.Generic; using ServiceClientModel = Microsoft.Azure.Management.RecoveryServices.Backup.Models; using CrrModel = Microsoft.Azure.Management.RecoveryServices.Backup.CrossRegionRestore.Models; +using Newtonsoft.Json; namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Helpers { @@ -913,5 +914,500 @@ public static List GetProtectableItemModelList(IEnumerable< return itemModels; } #endregion + + #region Soft Deleted Items + + /// + /// Helper function to convert ARG response to soft deleted backup item models + /// + public static List GetSoftDeletedItemsModelList(object argResponseItems) + { + List itemModels = new List(); + + if (argResponseItems == null) return itemModels; + + try + { + // ARG returns data as an array of objects, so we need to handle it properly + IEnumerable items = null; + + // Check if it's already an IEnumerable + if (argResponseItems is IEnumerable enumerable) + { + items = enumerable; + } + // If it's a single object that might be a JArray or similar + else if (argResponseItems is Newtonsoft.Json.Linq.JArray jArray) + { + items = jArray.ToObject(); + } + // If it's a JSON string, deserialize it + else if (argResponseItems is string jsonString) + { + var deserializedArray = JsonConvert.DeserializeObject(jsonString); + items = deserializedArray; + } + // If it's any other object, try to serialize/deserialize to handle dynamic types + else + { + var serializedArgResponse = JsonConvert.SerializeObject(argResponseItems); + var deserializedArray = JsonConvert.DeserializeObject(serializedArgResponse); + items = deserializedArray; + } + + if (items != null) + { + foreach (var item in items) + { + try + { + var softDeletedItem = GetSoftDeletedItemModel(item); + if (softDeletedItem != null) + { + itemModels.Add(softDeletedItem); + } + } + catch (Exception ex) + { + Logger.Instance.WriteWarning($"Failed to convert soft deleted item: {ex.Message}"); + } + } + } + } + catch (Exception ex) + { + Logger.Instance.WriteWarning($"Failed to process ARG response items: {ex.Message}"); + } + + return itemModels; + } + + /// + /// Helper function to convert single ARG response item to soft deleted backup item model + /// + public static ItemBase GetSoftDeletedItemModel(object argItem) + { + if (argItem == null) return null; + + try + { + // Parse ARG response item + var jsonItem = JsonConvert.SerializeObject(argItem); + var parsedItem = JsonConvert.DeserializeObject(jsonItem); + + // Extract dataSourceType to determine workload type + string dataSourceType = parsedItem.dataSourceType?.ToString(); + + if (string.IsNullOrEmpty(dataSourceType)) + { + Logger.Instance.WriteWarning("DataSourceType is null or empty for soft deleted item"); + return null; + } + + // Route to appropriate conversion method based on dataSourceType + if (dataSourceType.Contains("AzureIaasVM/VM")) + { + return GetSoftDeletedVaultAzureVmItemModel(parsedItem); + } + else if (dataSourceType.Contains("AzureFileShare")) + { + return GetSoftDeletedVaultAzureFileShareItemModel(parsedItem); + } + else if (dataSourceType.Contains("AzureWorkload") && dataSourceType.Contains("SQLDataBase")) + { + return GetSoftDeletedVaultAzureWorkloadSQLItemModel(parsedItem); + } + else if (dataSourceType.Contains("AzureWorkload") && dataSourceType.Contains("SAPHanaDatabase")) + { + return GetSoftDeletedVaultAzureWorkloadSAPHanaItemModel(parsedItem); + } + else + { + Logger.Instance.WriteWarning($"Unsupported soft deleted item dataSourceType: {dataSourceType}"); + return null; + } + } + catch (Exception ex) + { + Logger.Instance.WriteWarning($"Failed to parse soft deleted item: {ex.Message}"); + return null; + } + } + + private static ItemBase GetSoftDeletedVaultAzureVmItemModel(dynamic argItem) + { + try + { + var properties = argItem.properties; + + // Create a mock ProtectedItemResource to use existing constructors + var mockResource = CreateMockProtectedItemResource(argItem, "Microsoft.Compute/virtualMachines"); + + // Extract container URI using existing helper function + string itemId = argItem.id?.ToString(); + string containerUri = HelperUtils.GetContainerUri( + HelperUtils.ParseUri(itemId), + itemId); + + // Create soft deleted Azure VM item + var softDeletedItem = new SoftDeletedVaultAzureVmItem(mockResource, + IdUtils.GetNameFromUri(containerUri), + ContainerType.AzureVM, ""); + + // Set soft delete specific properties + SetSoftDeletedCommonProperties(softDeletedItem, properties); + + return softDeletedItem; + } + catch (Exception ex) + { + Logger.Instance.WriteWarning($"Failed to create soft deleted Azure VM item: {ex.Message}"); + return null; + } + } + + private static ItemBase GetSoftDeletedVaultAzureFileShareItemModel(dynamic argItem) + { + try + { + var properties = argItem.properties; + + var mockResource = CreateMockProtectedItemResource(argItem, "Microsoft.Storage/storageAccounts/fileServices/shares"); + string itemId = argItem.id?.ToString(); + string containerUri = HelperUtils.GetContainerUri( + HelperUtils.ParseUri(itemId), + itemId); + + var softDeletedItem = new SoftDeletedVaultAzureFileShareItem(mockResource, + containerUri, + ContainerType.AzureStorage, ""); + + SetSoftDeletedCommonProperties(softDeletedItem, properties); + + return softDeletedItem; + } + catch (Exception ex) + { + Logger.Instance.WriteWarning($"Failed to create soft deleted Azure FileShare item: {ex.Message}"); + return null; + } + } + + private static ItemBase GetSoftDeletedVaultAzureWorkloadSQLItemModel(dynamic argItem) + { + try + { + var properties = argItem.properties; + + var mockResource = CreateMockProtectedItemResource(argItem, "Microsoft.Compute/virtualMachines"); + string itemId = argItem.id?.ToString(); + string containerUri = HelperUtils.GetContainerUri( + HelperUtils.ParseUri(itemId), + itemId); + + var softDeletedItem = new SoftDeletedVaultAzureWorkloadSQLDatabaseProtectedItem(mockResource, + containerUri, + ContainerType.AzureVMAppContainer, ""); + + SetSoftDeletedCommonProperties(softDeletedItem, properties); + + return softDeletedItem; + } + catch (Exception ex) + { + Logger.Instance.WriteWarning($"Failed to create soft deleted Azure Workload SQL item: {ex.Message}"); + return null; + } + } + + private static ItemBase GetSoftDeletedVaultAzureWorkloadSAPHanaItemModel(dynamic argItem) + { + try + { + var properties = argItem.properties; + + var mockResource = CreateMockProtectedItemResource(argItem, "Microsoft.Compute/virtualMachines"); + string itemId = argItem.id?.ToString(); + string containerUri = HelperUtils.GetContainerUri( + HelperUtils.ParseUri(itemId), + itemId); + + var softDeletedItem = new SoftDeletedVaultAzureWorkloadSAPHanaDatabaseProtectedItem(mockResource, + containerUri, + ContainerType.AzureVMAppContainer, ""); + + SetSoftDeletedCommonProperties(softDeletedItem, properties); + + return softDeletedItem; + } + catch (Exception ex) + { + Logger.Instance.WriteWarning($"Failed to create soft deleted Azure Workload SAP HANA item: {ex.Message}"); + return null; + } + } + + private static ServiceClientModel.ProtectedItemResource CreateMockProtectedItemResource(dynamic argItem, string resourceType) + { + var properties = argItem.properties; + string itemId = argItem.id?.ToString(); + string name = argItem.name?.ToString(); + string location = argItem.location?.ToString(); + string backupManagementType = properties?.backupManagementType?.ToString(); + string workloadType = properties?.workloadType?.ToString(); + + ServiceClientModel.ProtectedItem protectedItemProperties = null; + + // Create the appropriate ProtectedItem type based on workload + if (backupManagementType == "AzureIaasVM" && workloadType == "VM") + { + protectedItemProperties = CreateAzureIaaSVMProtectedItem(properties); + } + else if (backupManagementType == "AzureStorage" && workloadType == "AzureFileShare") + { + protectedItemProperties = CreateAzureFileshareProtectedItem(properties); + } + else if (backupManagementType == "AzureWorkload" && workloadType == "SQLDataBase") + { + protectedItemProperties = CreateAzureVmWorkloadSQLDatabaseProtectedItem(properties); + } + else if (backupManagementType == "AzureWorkload" && workloadType == "SAPHanaDatabase") + { + protectedItemProperties = CreateAzureVmWorkloadSAPHanaDatabaseProtectedItem(properties); + } + else + { + // Default to AzureIaaSVMProtectedItem for unknown types + Logger.Instance.WriteWarning($"Unknown workload type: {backupManagementType}/{workloadType}, defaulting to AzureIaaSVMProtectedItem"); + protectedItemProperties = CreateAzureIaaSVMProtectedItem(properties); + } + + // Create ProtectedItemResource using constructor + var mockResource = new ServiceClientModel.ProtectedItemResource( + id: itemId, + name: name, + type: argItem.type?.ToString(), + location: location, + tags: null, + eTag: null, + properties: protectedItemProperties + ); + + return mockResource; + } + + private static ServiceClientModel.AzureIaaSVMProtectedItem CreateAzureIaaSVMProtectedItem(dynamic properties) + { + return new ServiceClientModel.AzureIaaSVMProtectedItem( + backupManagementType: properties?.backupManagementType?.ToString(), + workloadType: properties?.workloadType?.ToString(), + containerName: properties?.containerName?.ToString(), + sourceResourceId: properties?.sourceResourceId?.ToString(), + policyId: properties?.policyId?.ToString() ?? "", + lastRecoveryPoint: ParseDateTime(properties?.lastRecoveryPoint?.ToString()), + backupSetName: properties?.backupSetName?.ToString(), + createMode: properties?.createMode?.ToString(), + deferredDeleteTimeInUtc: ParseDateTime(properties?.deferredDeleteTimeInUTC?.ToString()), + isScheduledForDeferredDelete: ParseBool(properties?.isScheduledForDeferredDelete?.ToString()), + deferredDeleteTimeRemaining: properties?.deferredDeleteTimeRemaining?.ToString(), + isDeferredDeleteScheduleUpcoming: ParseBool(properties?.isDeferredDeleteScheduleUpcoming?.ToString()), + isRehydrate: ParseBool(properties?.isRehydrate?.ToString()), + resourceGuardOperationRequests: null, + isArchiveEnabled: ParseBool(properties?.isArchiveEnabled?.ToString()), + policyName: properties?.policyName?.ToString() ?? "", + softDeleteRetentionPeriodInDays: ParseInt(properties?.softDeleteRetentionPeriod?.ToString()), + vaultId: properties?.vaultId?.ToString(), + friendlyName: properties?.friendlyName?.ToString(), + virtualMachineId: properties?.virtualMachineId?.ToString(), + protectionStatus: properties?.protectionStatus?.ToString(), + protectionState: properties?.protectionState?.ToString(), + healthStatus: properties?.healthStatus?.ToString(), + healthDetails: null, + kpisHealths: null, + lastBackupStatus: properties?.lastBackupStatus?.ToString(), + lastBackupTime: ParseDateTime(properties?.lastBackupTime?.ToString()), + protectedItemDataId: properties?.protectedItemDataId?.ToString(), + extendedInfo: null, + extendedProperties: null, + policyType: properties?.policyType?.ToString() + ); + } + + private static ServiceClientModel.AzureFileshareProtectedItem CreateAzureFileshareProtectedItem(dynamic properties) + { + return new ServiceClientModel.AzureFileshareProtectedItem( + backupManagementType: properties?.backupManagementType?.ToString(), + workloadType: properties?.workloadType?.ToString(), + containerName: properties?.containerName?.ToString(), + sourceResourceId: properties?.sourceResourceId?.ToString(), + policyId: properties?.policyId?.ToString() ?? "", + lastRecoveryPoint: ParseDateTime(properties?.lastRecoveryPoint?.ToString()), + backupSetName: properties?.backupSetName?.ToString(), + createMode: properties?.createMode?.ToString(), + deferredDeleteTimeInUtc: ParseDateTime(properties?.deferredDeleteTimeInUTC?.ToString()), + isScheduledForDeferredDelete: ParseBool(properties?.isScheduledForDeferredDelete?.ToString()), + deferredDeleteTimeRemaining: properties?.deferredDeleteTimeRemaining?.ToString(), + isDeferredDeleteScheduleUpcoming: ParseBool(properties?.isDeferredDeleteScheduleUpcoming?.ToString()), + isRehydrate: ParseBool(properties?.isRehydrate?.ToString()), + resourceGuardOperationRequests: null, + isArchiveEnabled: ParseBool(properties?.isArchiveEnabled?.ToString()), + policyName: properties?.policyName?.ToString() ?? "", + softDeleteRetentionPeriodInDays: ParseInt(properties?.softDeleteRetentionPeriod?.ToString()), + vaultId: properties?.vaultId?.ToString(), + friendlyName: properties?.friendlyName?.ToString(), + protectionStatus: properties?.protectionStatus?.ToString(), + protectionState: properties?.protectionState?.ToString(), + //healthStatus: properties?.healthStatus?.ToString(), + lastBackupStatus: properties?.lastBackupStatus?.ToString(), + lastBackupTime: ParseDateTime(properties?.lastBackupTime?.ToString()), + //protectedItemDataId: properties?.protectedItemDataId?.ToString(), + extendedInfo: null + ); + } + + private static ServiceClientModel.AzureVmWorkloadSQLDatabaseProtectedItem CreateAzureVmWorkloadSQLDatabaseProtectedItem(dynamic properties) + { + return new ServiceClientModel.AzureVmWorkloadSQLDatabaseProtectedItem( + backupManagementType: properties?.backupManagementType?.ToString(), + workloadType: properties?.workloadType?.ToString(), + containerName: properties?.containerName?.ToString(), + sourceResourceId: properties?.sourceResourceId?.ToString(), + policyId: properties?.policyId?.ToString() ?? "", + lastRecoveryPoint: ParseDateTime(properties?.lastRecoveryPoint?.ToString()), + backupSetName: properties?.backupSetName?.ToString(), + createMode: properties?.createMode?.ToString(), + deferredDeleteTimeInUtc: ParseDateTime(properties?.deferredDeleteTimeInUTC?.ToString()), + isScheduledForDeferredDelete: ParseBool(properties?.isScheduledForDeferredDelete?.ToString()), + deferredDeleteTimeRemaining: properties?.deferredDeleteTimeRemaining?.ToString(), + isDeferredDeleteScheduleUpcoming: ParseBool(properties?.isDeferredDeleteScheduleUpcoming?.ToString()), + isRehydrate: ParseBool(properties?.isRehydrate?.ToString()), + resourceGuardOperationRequests: null, + isArchiveEnabled: ParseBool(properties?.isArchiveEnabled?.ToString()), + policyName: properties?.policyName?.ToString() ?? "", + softDeleteRetentionPeriodInDays: ParseInt(properties?.softDeleteRetentionPeriod?.ToString()), + vaultId: properties?.vaultId?.ToString(), + friendlyName: properties?.friendlyName?.ToString(), + protectionStatus: properties?.protectionStatus?.ToString(), + protectionState: properties?.protectionState?.ToString(), + //healthStatus: properties?.healthStatus?.ToString(), + lastBackupStatus: properties?.lastBackupStatus?.ToString(), + lastBackupTime: ParseDateTime(properties?.lastBackupTime?.ToString()), + //protectedItemDataId: properties?.protectedItemDataId?.ToString(), + extendedInfo: null, + parentName: properties?.parentName?.ToString(), + parentType: properties?.parentType?.ToString(), + serverName: properties?.serverName?.ToString() + //isCompression: ParseBool(properties?.isCompression?.ToString()), + //isEncryption: ParseBool(properties?.isEncryption?.ToString()) + ); + } + + private static ServiceClientModel.AzureVmWorkloadSAPHanaDatabaseProtectedItem CreateAzureVmWorkloadSAPHanaDatabaseProtectedItem(dynamic properties) + { + return new ServiceClientModel.AzureVmWorkloadSAPHanaDatabaseProtectedItem( + backupManagementType: properties?.backupManagementType?.ToString(), + workloadType: properties?.workloadType?.ToString(), + containerName: properties?.containerName?.ToString(), + sourceResourceId: properties?.sourceResourceId?.ToString(), + policyId: properties?.policyId?.ToString() ?? "", + lastRecoveryPoint: ParseDateTime(properties?.lastRecoveryPoint?.ToString()), + backupSetName: properties?.backupSetName?.ToString(), + createMode: properties?.createMode?.ToString(), + deferredDeleteTimeInUtc: ParseDateTime(properties?.deferredDeleteTimeInUTC?.ToString()), + isScheduledForDeferredDelete: ParseBool(properties?.isScheduledForDeferredDelete?.ToString()), + deferredDeleteTimeRemaining: properties?.deferredDeleteTimeRemaining?.ToString(), + isDeferredDeleteScheduleUpcoming: ParseBool(properties?.isDeferredDeleteScheduleUpcoming?.ToString()), + isRehydrate: ParseBool(properties?.isRehydrate?.ToString()), + resourceGuardOperationRequests: null, + isArchiveEnabled: ParseBool(properties?.isArchiveEnabled?.ToString()), + policyName: properties?.policyName?.ToString() ?? "", + softDeleteRetentionPeriodInDays: ParseInt(properties?.softDeleteRetentionPeriod?.ToString()), + vaultId: properties?.vaultId?.ToString(), + friendlyName: properties?.friendlyName?.ToString(), + protectionStatus: properties?.protectionStatus?.ToString(), + protectionState: properties?.protectionState?.ToString(), + //healthStatus: properties?.healthStatus?.ToString(), + lastBackupStatus: properties?.lastBackupStatus?.ToString(), + lastBackupTime: ParseDateTime(properties?.lastBackupTime?.ToString()), + //protectedItemDataId: properties?.protectedItemDataId?.ToString(), + extendedInfo: null, + parentName: properties?.parentName?.ToString(), + parentType: properties?.parentType?.ToString(), + serverName: properties?.serverName?.ToString() + //isCompression: ParseBool(properties?.isCompression?.ToString()), + //isEncryption: ParseBool(properties?.isEncryption?.ToString()) + ); + } + + private static void SetSoftDeletedCommonProperties(ItemBase item, dynamic properties) + { + if (item == null || properties == null) return; + + try + { + // Set common soft delete properties + if (item is AzureItem azureItem) + { + azureItem.DeleteState = ItemDeleteState.ToBeDeleted; + azureItem.IsScheduledForDeferredDelete = ParseBool(properties?.isScheduledForDeferredDelete?.ToString()) ?? true; + + var softDeletePeriod = ParseInt(properties?.softDeleteRetentionPeriod?.ToString()); + if (softDeletePeriod.HasValue) + { + azureItem.SoftDeleteRetentionPeriodInDays = softDeletePeriod.Value; + } + + var deferredDeleteTime = ParseDateTime(properties?.deferredDeleteTimeInUTC?.ToString()); + if (deferredDeleteTime.HasValue) + { + azureItem.DateOfPurge = deferredDeleteTime.Value; + } + + azureItem.LastBackupStatus = properties?.lastBackupStatus?.ToString(); + azureItem.LastBackupTime = ParseDateTime(properties?.lastBackupTime?.ToString()); + azureItem.ProtectionState = EnumUtils.GetEnum(properties?.protectionState?.ToString() ?? "ProtectionStopped"); + azureItem.IsArchiveEnabled = ParseBool(properties?.isArchiveEnabled?.ToString()) ?? false; + } + } + catch (Exception ex) + { + Logger.Instance.WriteWarning($"Failed to set soft deleted common properties: {ex.Message}"); + } + } + + private static DateTime? ParseDateTime(string dateTimeStr) + { + if (string.IsNullOrEmpty(dateTimeStr)) return null; + + if (DateTime.TryParse(dateTimeStr, out DateTime result)) + { + return result; + } + return null; + } + + private static bool? ParseBool(string boolStr) + { + if (string.IsNullOrEmpty(boolStr)) return null; + + if (bool.TryParse(boolStr, out bool result)) + { + return result; + } + return null; + } + + private static int? ParseInt(string intStr) + { + if (string.IsNullOrEmpty(intStr)) return null; + + if (int.TryParse(intStr, out int result)) + { + return result; + } + return null; + } + + #endregion } } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Models/AzareVmModels/SoftDeletedVaultAzureVmItem.cs b/src/RecoveryServices/RecoveryServices.Backup.Models/AzareVmModels/SoftDeletedVaultAzureVmItem.cs new file mode 100644 index 000000000000..c9899a27d37e --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Backup.Models/AzareVmModels/SoftDeletedVaultAzureVmItem.cs @@ -0,0 +1,49 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using Microsoft.Azure.Management.RecoveryServices.Backup.Models; +using System; +using System.Collections.Generic; + +namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models +{ + /// + /// Soft Deleted Azure VM Item Class + /// + public class SoftDeletedVaultAzureVmItem : AzureVmItem + { + /// + /// Vault ID from which the item was soft deleted + /// + public string VaultId { get; set; } + + /// + /// Constructor for soft deleted Azure VM item + /// + /// Mock protected item resource + /// Container name + /// Container type + /// Policy name + public SoftDeletedVaultAzureVmItem(ProtectedItemResource protectedItemResource, + string containerName, ContainerType containerType, string policyName) + : base(protectedItemResource, containerName, containerType, policyName) + { + // Extract vault ID from the protected item resource ID if available + if (!string.IsNullOrEmpty(protectedItemResource?.Id)) + { + VaultId = ModeHelpers.ExtractVaultIdFromSoftDeletedId(protectedItemResource.Id); + } + } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Models/AzureFileShareModels/SoftDeletedVaultAzureFileShareItem.cs b/src/RecoveryServices/RecoveryServices.Backup.Models/AzureFileShareModels/SoftDeletedVaultAzureFileShareItem.cs new file mode 100644 index 000000000000..e107c4205731 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Backup.Models/AzureFileShareModels/SoftDeletedVaultAzureFileShareItem.cs @@ -0,0 +1,48 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using Microsoft.Azure.Management.RecoveryServices.Backup.Models; +using System; +using System.Collections.Generic; + +namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models +{ + /// + /// Soft Deleted Azure FileShare Item Class + /// + public class SoftDeletedVaultAzureFileShareItem : AzureFileShareItem + { + /// + /// Vault ID from which the item was soft deleted + /// + public string VaultId { get; set; } + + /// + /// Constructor for soft deleted Azure FileShare item + /// + /// Mock protected item resource + /// Container name + /// Container type + /// Policy name + public SoftDeletedVaultAzureFileShareItem(ProtectedItemResource protectedItemResource, + string containerName, ContainerType containerType, string policyName) + : base(protectedItemResource, containerName, containerType, policyName) + { + if (!string.IsNullOrEmpty(protectedItemResource?.Id)) + { + VaultId = ModeHelpers.ExtractVaultIdFromSoftDeletedId(protectedItemResource.Id); + } + } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Models/AzureVmWorkloadModels/SoftDeletedVaultAzureWorkloadSAPHanaDatabaseProtectedItem.cs b/src/RecoveryServices/RecoveryServices.Backup.Models/AzureVmWorkloadModels/SoftDeletedVaultAzureWorkloadSAPHanaDatabaseProtectedItem.cs new file mode 100644 index 000000000000..6b87482e121d --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Backup.Models/AzureVmWorkloadModels/SoftDeletedVaultAzureWorkloadSAPHanaDatabaseProtectedItem.cs @@ -0,0 +1,48 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using Microsoft.Azure.Management.RecoveryServices.Backup.Models; +using System; +using System.Collections.Generic; + +namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models +{ + /// + /// Soft Deleted Azure Workload SAP HANA Database Item Class + /// + public class SoftDeletedVaultAzureWorkloadSAPHanaDatabaseProtectedItem : AzureWorkloadSAPHanaDatabaseProtectedItem + { + /// + /// Vault ID from which the item was soft deleted + /// + public string VaultId { get; set; } + + /// + /// Constructor for soft deleted Azure Workload SAP HANA Database item + /// + /// Mock protected item resource + /// Container name + /// Container type + /// Policy name + public SoftDeletedVaultAzureWorkloadSAPHanaDatabaseProtectedItem(ProtectedItemResource protectedItemResource, + string containerName, ContainerType containerType, string policyName) + : base(protectedItemResource, containerName, containerType, policyName) + { + if (!string.IsNullOrEmpty(protectedItemResource?.Id)) + { + VaultId = ModeHelpers.ExtractVaultIdFromSoftDeletedId(protectedItemResource.Id); + } + } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Models/AzureVmWorkloadModels/SoftDeletedVaultAzureWorkloadSQLDatabaseProtectedItem.cs b/src/RecoveryServices/RecoveryServices.Backup.Models/AzureVmWorkloadModels/SoftDeletedVaultAzureWorkloadSQLDatabaseProtectedItem.cs new file mode 100644 index 000000000000..b9709d396c73 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Backup.Models/AzureVmWorkloadModels/SoftDeletedVaultAzureWorkloadSQLDatabaseProtectedItem.cs @@ -0,0 +1,48 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using Microsoft.Azure.Management.RecoveryServices.Backup.Models; +using System; +using System.Collections.Generic; + +namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models +{ + /// + /// Soft Deleted Azure Workload SQL Database Item Class + /// + public class SoftDeletedVaultAzureWorkloadSQLDatabaseProtectedItem : AzureWorkloadSQLDatabaseProtectedItem + { + /// + /// Vault ID from which the item was soft deleted + /// + public string VaultId { get; set; } + + /// + /// Constructor for soft deleted Azure Workload SQL Database item + /// + /// Mock protected item resource + /// Container name + /// Container type + /// Policy name + public SoftDeletedVaultAzureWorkloadSQLDatabaseProtectedItem(ProtectedItemResource protectedItemResource, + string containerName, ContainerType containerType, string policyName) + : base(protectedItemResource, containerName, containerType, policyName) + { + if (!string.IsNullOrEmpty(protectedItemResource?.Id)) + { + VaultId = ModeHelpers.ExtractVaultIdFromSoftDeletedId(protectedItemResource.Id); + } + } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Models/ModelHelpers.cs b/src/RecoveryServices/RecoveryServices.Backup.Models/ModelHelpers.cs new file mode 100644 index 000000000000..f60268ee6da2 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Backup.Models/ModelHelpers.cs @@ -0,0 +1,54 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using Microsoft.Azure.Management.RecoveryServices.Backup.Models; +using System; +using System.Collections.Generic; + +namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models +{ + /// + /// Soft Deleted Azure Workload SQL Database Item Class + /// + public class ModeHelpers + { + public static string ExtractVaultIdFromSoftDeletedId(string itemId) + { + if (string.IsNullOrEmpty(itemId)) return ""; + + try + { + var parts = itemId.Split('/'); + for (int i = 0; i < parts.Length - 1; i++) + { + if (parts[i].Equals("deletedVaults", StringComparison.OrdinalIgnoreCase)) + { + // Build vault ID: /subscriptions/{sub}/providers/Microsoft.RecoveryServices/locations/{loc}/deletedVaults/{vault} + var vaultParts = new List(); + for (int j = 0; j <= i + 1; j++) + { + vaultParts.Add(parts[j]); + } + return string.Join("/", vaultParts); + } + } + return ""; + } + catch + { + return ""; + } + } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.ServiceClientAdapter/ARGAPIs/ResourceGraphAPIs.cs b/src/RecoveryServices/RecoveryServices.Backup.ServiceClientAdapter/ARGAPIs/ResourceGraphAPIs.cs new file mode 100644 index 000000000000..7660ceba5444 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Backup.ServiceClientAdapter/ARGAPIs/ResourceGraphAPIs.cs @@ -0,0 +1,181 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using Microsoft.Azure.Management.ResourceGraph.Models; +using System.Collections.Generic; +using RestAzureNS = Microsoft.Rest.Azure; +using System.Threading.Tasks; +using System; + +namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.ServiceClientAdapterNS +{ + public partial class ServiceClientAdapter + { + /// + /// Executes a Resource Graph query and returns the results + /// + /// KQL query string + /// List of subscription IDs to query + /// List of management group IDs to query + /// Skip token for pagination + /// Maximum number of results to return + /// Number of results to skip + /// Allow partial scopes if some subscriptions fail + /// Query response with resources + public RestAzureNS.AzureOperationResponse ExecuteResourceGraphQuery( + string query, + IList subscriptions = null, + IList managementGroups = null, + string skipToken = null, + int? top = null, + int? skip = null, + bool allowPartialScopes = false) + { + // Create query request options + var requestOptions = new QueryRequestOptions( + top: top, + skip: skip, + skipToken: skipToken, + resultFormat: ResultFormat.ObjectArray, + allowPartialScopes: allowPartialScopes); + + // Create the query request + var request = new QueryRequest( + query: query, + subscriptions: subscriptions, + managementGroups: managementGroups, + options: requestOptions); + + // Execute the query using ARG client + return ARGAdapter.Client.ResourcesWithHttpMessagesAsync(request).Result; + } + + /// + /// Execute Azure Resource Graph query with automatic pagination + /// + /// KQL query to execute + /// List of subscription IDs to query + /// List of management group IDs to query (optional) + /// Initial skip token for pagination (optional) + /// Number of items per page (max 1000) + /// Maximum number of pages to retrieve (safety limit) + /// Allow partial scopes in query + /// Consolidated results from all pages + public ARGPaginatedResult ExecuteResourceGraphQuery( + string query, + List subscriptions, + List managementGroups = null, + string initialSkipToken = null, + int pageSize = 1000, + int maxPages = 50, + bool allowPartialScopes = false) + { + if (pageSize > 1000) pageSize = 1000; // ARG maximum + if (pageSize < 1) pageSize = 100; // Reasonable minimum + + List allResults = new List(); + string skipToken = initialSkipToken; + int totalRetrieved = 0; + int pageNumber = 0; + List warnings = new List(); + List errors = new List(); + + do + { + pageNumber++; + + // Safety check to prevent infinite loops + if (pageNumber > maxPages) + { + warnings.Add($"Reached maximum page limit ({maxPages}). Total items retrieved: {totalRetrieved}. Some results may not be included."); + break; + } + + try + { + // Execute query for current page (call the original single-page method) + var response = ExecuteResourceGraphQuery( + query: query, + subscriptions: subscriptions, + managementGroups: managementGroups, + skipToken: skipToken, + top: pageSize, + skip: 0, + allowPartialScopes: allowPartialScopes + ); + + // Process results from current page + if (response.Body.Data != null && response.Body.Count > 0) + { + if (response.Body.Data is System.Collections.IEnumerable enumerable && !(response.Body.Data is string)) + { + foreach (var item in enumerable) + { + if (item != null) + { + allResults.Add(item); + totalRetrieved++; + } + } + } + else + { + // Handle single item response + allResults.Add(response.Body.Data); + totalRetrieved++; + } + } + + // Determine if more pages are available + skipToken = response.Body.SkipToken; + bool hasMorePages = !string.IsNullOrEmpty(skipToken) && response.Body.ResultTruncated == ResultTruncated.True; + + if (!hasMorePages) + { + break; + } + } + catch (Exception pageEx) + { + errors.Add(new Exception($"Error on page {pageNumber}: {pageEx.Message}", pageEx)); + break; + } + + } while (true); + + return new ARGPaginatedResult + { + Data = allResults, + TotalRetrieved = totalRetrieved, + PagesRetrieved = pageNumber, + Warnings = warnings, + Errors = errors, + IsComplete = errors.Count == 0 && warnings.Count == 0 + }; + } + } + + /// + /// Result from paginated ARG query execution + /// + public class ARGPaginatedResult + { + public List Data { get; set; } = new List(); + public int TotalRetrieved { get; set; } + public int PagesRetrieved { get; set; } + public List Warnings { get; set; } = new List(); + public List Errors { get; set; } = new List(); + public bool IsComplete { get; set; } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.ServiceClientAdapter/RecoveryServices.Backup.ServiceClientAdapter.csproj b/src/RecoveryServices/RecoveryServices.Backup.ServiceClientAdapter/RecoveryServices.Backup.ServiceClientAdapter.csproj index ec3514c3f3c9..1255153c80fa 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.ServiceClientAdapter/RecoveryServices.Backup.ServiceClientAdapter.csproj +++ b/src/RecoveryServices/RecoveryServices.Backup.ServiceClientAdapter/RecoveryServices.Backup.ServiceClientAdapter.csproj @@ -21,6 +21,7 @@ + diff --git a/src/RecoveryServices/RecoveryServices.Backup.ServiceClientAdapter/ServiceClientAdapter.cs b/src/RecoveryServices/RecoveryServices.Backup.ServiceClientAdapter/ServiceClientAdapter.cs index 84843833bb20..fcee8f4ce034 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.ServiceClientAdapter/ServiceClientAdapter.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.ServiceClientAdapter/ServiceClientAdapter.cs @@ -13,12 +13,11 @@ // ---------------------------------------------------------------------------------- using Microsoft.Azure.Commands.Common.Authentication.Abstractions; -using System.Configuration; -using System.Reflection; using RecoveryServicesBackupNS = Microsoft.Azure.Management.RecoveryServices.Backup; using RecoveryServicesBackupCRRNS = Microsoft.Azure.Management.RecoveryServices.Backup.CrossRegionRestore; using RecoveryServicesNS = Microsoft.Azure.Management.RecoveryServices; using ResourcesNS = Microsoft.Azure.Management.Internal.Resources; +using ARGNS = Microsoft.Azure.Management.ResourceGraph; namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.ServiceClientAdapterNS { @@ -32,7 +31,8 @@ public partial class ServiceClientAdapter public ClientProxy BmsAdapter; public ClientProxy CrrAdapter; - + public ClientProxy ARGAdapter; + ClientProxy RSAdapter; ClientProxy RMAdapter; @@ -56,6 +56,7 @@ public ServiceClientAdapter(IAzureContext context) CrrAdapter = new ClientProxy(context); RSAdapter = new ClientProxy(context); RMAdapter = new ClientProxy(context); + ARGAdapter = new ClientProxy(context); FeatureAdapter = new ClientProxy(context); SubscriptionId = context.Subscription.Id; } diff --git a/src/RecoveryServices/RecoveryServices.Backup/Cmdlets/Item/GetAzureRmRecoveryServicesSoftDeletedVaultBackupItem.cs b/src/RecoveryServices/RecoveryServices.Backup/Cmdlets/Item/GetAzureRmRecoveryServicesSoftDeletedVaultBackupItem.cs new file mode 100644 index 000000000000..3da75f8e6b3d --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Backup/Cmdlets/Item/GetAzureRmRecoveryServicesSoftDeletedVaultBackupItem.cs @@ -0,0 +1,199 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using System; +using System.Collections.Generic; +using System.Management.Automation; +using Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models; +using Microsoft.Azure.Commands.RecoveryServices.Backup.Helpers; + +namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets +{ + /// + /// Get list of backup items from soft deleted vaults using Azure Resource Graph + /// + [Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "RecoveryServicesSoftDeletedVaultBackupItem"), OutputType(typeof(PSObject))] + public class GetAzureRmRecoveryServicesSoftDeletedVaultBackupItem : RSBackupVaultCmdletBase + { + /// + /// Name of the vault + /// + [Parameter( + Mandatory = false, + Position = 0, + HelpMessage = "Name of the soft deleted recovery services vault")] + [ValidateNotNullOrEmpty] + public string VaultName { get; set; } + + /// + /// Resource group name of the vault + /// + [Parameter( + Mandatory = false, + Position = 1, + HelpMessage = "Resource group name of the soft deleted recovery services vault")] + [ValidateNotNullOrEmpty] + public string ResourceGroupName { get; set; } + + /// + /// ARM ID of the Recovery Services Vault (inherited from base class but redefined for clarity) + /// + [Parameter( + Mandatory = false, + Position = 2, + HelpMessage = "ARM ID of the Recovery Services Vault")] + [ValidateNotNullOrEmpty] + public new string VaultId { get; set; } + + /// + /// Executes the cmdlet. + /// + public override void ExecuteCmdlet() + { + ExecutionBlock(() => + { + base.ExecuteCmdlet(); + + WriteVerbose($"Parameters provided - VaultName: {VaultName}, ResourceGroupName: {ResourceGroupName}, VaultId: {VaultId}"); + + if (string.IsNullOrEmpty(VaultId) && string.IsNullOrEmpty(VaultName)) + { + throw new PSArgumentException("At least one of VaultId or VaultName must be provided.", "VaultIdentification"); + } + + try + { + // Get subscription - extract from VaultId if provided, otherwise use default from context + var subscriptions = new List(); + + if (!string.IsNullOrEmpty(VaultId)) + { + Dictionary keyValueDict = HelperUtils.ParseUri(VaultId); + string subscriptionId = HelperUtils.GetSubscriptionIdFromId(keyValueDict, VaultId); + subscriptions.Add(subscriptionId); + } + else + { + var defaultSub = this.DefaultContext?.Subscription?.Id; + WriteVerbose($"DefaultContext Subscription ID: {defaultSub}"); + + if (!string.IsNullOrEmpty(defaultSub)) + { + subscriptions.Add(defaultSub); + } + else + { + throw new PSInvalidOperationException("No subscription context available and VaultId not provided. Please set a default subscription context or provide VaultId."); + } + } + + // Build the KQL query dynamically based on input parameters + var query = @"Recoveryservicesresources +| where type == ""microsoft.recoveryservices/locations/deletedvaults/backupfabrics/protectioncontainers/protecteditems"" +| extend dataSourceType = strcat(properties.backupManagementType, '/', properties.workloadType)"; + + // Add filtering based on provided parameters + if (!string.IsNullOrEmpty(VaultId)) + { + query += $@" +| where tostring(id) contains ""{VaultId}"""; + } + else if (!string.IsNullOrEmpty(VaultName)) + { + if (!string.IsNullOrEmpty(ResourceGroupName)) + { + query += $@" +| where tostring(id) contains ""{VaultName}"" and tostring(id) contains ""{ResourceGroupName}"""; + } + else + { + query += $@" +| where tostring(id) contains ""{VaultName}"""; + } + } + + query += @" +| project id, type, name, location, resourceGroup, subscriptionId, dataSourceType, properties, tags"; + + WriteVerbose($"Generated ARG Query: {query}"); + + // Execute paginated ARG query + WriteVerbose("Starting ARG query execution"); + var paginatedResult = ServiceClientAdapter.ExecuteResourceGraphQuery( + query: query, + subscriptions: subscriptions, + managementGroups: null, + pageSize: 1000, + maxPages: 50 + ); + + // Handle warnings and errors from pagination + foreach (var warning in paginatedResult.Warnings) + { + WriteWarning(warning); + } + + foreach (var error in paginatedResult.Errors) + { + WriteError(new ErrorRecord(error, "ARGPaginationError", ErrorCategory.InvalidOperation, null)); + } + + WriteVerbose($"ARG query completed. Pages retrieved: {paginatedResult.PagesRetrieved}, Total items: {paginatedResult.TotalRetrieved}"); + + // Handle results based on what was retrieved + if (paginatedResult.TotalRetrieved == 0) + { + WriteWarning("No backup items found in soft deleted vaults matching the specified criteria."); + return; + } + + // Convert and output results + WriteVerbose($"Converting {paginatedResult.TotalRetrieved} raw ARG results to backup item models..."); + + try + { + // Convert ARG response to soft deleted backup item models + List itemModels = ConversionHelpers.GetSoftDeletedItemsModelList(paginatedResult.Data); + + WriteVerbose($"Successfully converted {itemModels.Count} out of {paginatedResult.TotalRetrieved} items to soft deleted backup item"); + + // Output the converted backup items + if (itemModels.Count > 0) + { + WriteVerbose($"Outputting {itemModels.Count} backup items..."); + foreach (var backupItem in itemModels) + { + WriteObject(backupItem); + } + } + else + { + WriteWarning("Retrieved items from ARG but failed to convert them to backup item models. Check logs for conversion errors."); + } + } + catch (Exception conversionEx) + { + WriteError(new ErrorRecord(conversionEx, "ResultConversionError", + ErrorCategory.InvalidData, paginatedResult.Data)); + } + } + catch (System.Exception ex) + { + WriteError(new ErrorRecord(ex, "QueryExecutionError", + ErrorCategory.InvalidOperation, null)); + } + }); + } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup/RecoveryServices.Backup.csproj b/src/RecoveryServices/RecoveryServices.Backup/RecoveryServices.Backup.csproj index 15b15da1b6c4..7fd7b22dc5a1 100644 --- a/src/RecoveryServices/RecoveryServices.Backup/RecoveryServices.Backup.csproj +++ b/src/RecoveryServices/RecoveryServices.Backup/RecoveryServices.Backup.csproj @@ -20,6 +20,7 @@ + diff --git a/src/RecoveryServices/RecoveryServices.Helper/Generated/IOperations.cs b/src/RecoveryServices/RecoveryServices.Helper/Generated/IOperations.cs new file mode 100644 index 000000000000..930030652e3b --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Helper/Generated/IOperations.cs @@ -0,0 +1,37 @@ +// 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.ResourceGraph +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// Operations operations. + /// + public partial interface IOperations + { + /// + /// Lists all of the available REST API operations. + /// + /// + /// Lists all of the available REST API operations. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Helper/Generated/IResourceGraphClient.cs b/src/RecoveryServices/RecoveryServices.Helper/Generated/IResourceGraphClient.cs new file mode 100644 index 000000000000..96c199d53c02 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Helper/Generated/IResourceGraphClient.cs @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.ResourceGraph +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + + /// + /// Azure Resource Graph API Reference + /// + public partial interface IResourceGraphClient : System.IDisposable + { + /// + /// The base URI of the service. + /// + System.Uri BaseUri { get; set; } + + /// + /// Gets or sets json serialization settings. + /// + Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; } + + /// + /// Gets or sets json deserialization settings. + /// + Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; } + + /// + /// Credentials needed for the client to connect to Azure. + /// + Microsoft.Rest.ServiceClientCredentials Credentials { get;} + + + /// + /// The API version to use for this operation. + /// + string ApiVersion { get;} + + + /// + /// The preferred language for the response. + /// + string AcceptLanguage { get; set;} + + + /// + /// The retry timeout in seconds for Long Running Operations. Default + /// /// value is 30. + /// + int? LongRunningOperationRetryTimeout { get; set;} + + + /// + /// Whether a unique x-ms-client-request-id should be generated. When + /// /// set to true a unique x-ms-client-request-id value is generated and + /// /// included in each request. Default is true. + /// + bool? GenerateClientRequestId { get; set;} + + + /// + /// Gets the IOperations + /// + IOperations Operations { get; } + + /// + /// Queries the resources managed by Azure Resource Manager for scopes + /// specified in the request. + /// + /// + /// Queries the resources managed by Azure Resource Manager for scopes + /// specified in the request. + /// + /// + /// Request specifying query and its options. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> ResourcesWithHttpMessagesAsync(QueryRequest query, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/AuthorizationScopeFilter.cs b/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/AuthorizationScopeFilter.cs new file mode 100644 index 000000000000..ccee3277e2c8 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/AuthorizationScopeFilter.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.ResourceGraph.Models +{ + + /// + /// Defines values for AuthorizationScopeFilter. + /// + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum AuthorizationScopeFilter + { + [System.Runtime.Serialization.EnumMember(Value = "AtScopeAndBelow")] + AtScopeAndBelow, + [System.Runtime.Serialization.EnumMember(Value = "AtScopeAndAbove")] + AtScopeAndAbove, + [System.Runtime.Serialization.EnumMember(Value = "AtScopeExact")] + AtScopeExact, + [System.Runtime.Serialization.EnumMember(Value = "AtScopeAboveAndBelow")] + AtScopeAboveAndBelow + } + internal static class AuthorizationScopeFilterEnumExtension + { + internal static string ToSerializedValue(this AuthorizationScopeFilter? value) + { + return value == null ? null : ((AuthorizationScopeFilter)value).ToSerializedValue(); + } + internal static string ToSerializedValue(this AuthorizationScopeFilter value) + { + switch( value ) + { + case AuthorizationScopeFilter.AtScopeAndBelow: + return "AtScopeAndBelow"; + case AuthorizationScopeFilter.AtScopeAndAbove: + return "AtScopeAndAbove"; + case AuthorizationScopeFilter.AtScopeExact: + return "AtScopeExact"; + case AuthorizationScopeFilter.AtScopeAboveAndBelow: + return "AtScopeAboveAndBelow"; + } + return null; + } + internal static AuthorizationScopeFilter? ParseAuthorizationScopeFilter(this string value) + { + switch( value ) + { + case "AtScopeAndBelow": + return AuthorizationScopeFilter.AtScopeAndBelow; + case "AtScopeAndAbove": + return AuthorizationScopeFilter.AtScopeAndAbove; + case "AtScopeExact": + return AuthorizationScopeFilter.AtScopeExact; + case "AtScopeAboveAndBelow": + return AuthorizationScopeFilter.AtScopeAboveAndBelow; + } + return null; + } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/Column.cs b/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/Column.cs new file mode 100644 index 000000000000..db9205a065c6 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/Column.cs @@ -0,0 +1,74 @@ +// 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.ResourceGraph.Models +{ + using System.Linq; + + /// + /// Query result column descriptor. + /// + public partial class Column + { + /// + /// Initializes a new instance of the Column class. + /// + public Column() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Column class. + /// + + /// Column name. + /// + + /// Column data type. + /// Possible values include: 'string', 'integer', 'number', 'boolean', + /// 'object', 'datetime' + public Column(string name, ColumnDataType type) + + { + this.Name = name; + this.Type = type; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets column name. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } + + /// + /// Gets or sets column data type. Possible values include: 'string', 'integer', 'number', 'boolean', 'object', 'datetime' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public ColumnDataType Type {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Name == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); + } + + + } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/ColumnDataType.cs b/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/ColumnDataType.cs new file mode 100644 index 000000000000..cb3387759907 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/ColumnDataType.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.ResourceGraph.Models +{ + + /// + /// Defines values for ColumnDataType. + /// + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum ColumnDataType + { + [System.Runtime.Serialization.EnumMember(Value = "string")] + String, + [System.Runtime.Serialization.EnumMember(Value = "integer")] + Integer, + [System.Runtime.Serialization.EnumMember(Value = "number")] + Number, + [System.Runtime.Serialization.EnumMember(Value = "boolean")] + Boolean, + [System.Runtime.Serialization.EnumMember(Value = "object")] + Object, + [System.Runtime.Serialization.EnumMember(Value = "datetime")] + Datetime + } + internal static class ColumnDataTypeEnumExtension + { + internal static string ToSerializedValue(this ColumnDataType? value) + { + return value == null ? null : ((ColumnDataType)value).ToSerializedValue(); + } + internal static string ToSerializedValue(this ColumnDataType value) + { + switch( value ) + { + case ColumnDataType.String: + return "string"; + case ColumnDataType.Integer: + return "integer"; + case ColumnDataType.Number: + return "number"; + case ColumnDataType.Boolean: + return "boolean"; + case ColumnDataType.Object: + return "object"; + case ColumnDataType.Datetime: + return "datetime"; + } + return null; + } + internal static ColumnDataType? ParseColumnDataType(this string value) + { + switch( value ) + { + case "string": + return ColumnDataType.String; + case "integer": + return ColumnDataType.Integer; + case "number": + return ColumnDataType.Number; + case "boolean": + return ColumnDataType.Boolean; + case "object": + return ColumnDataType.Object; + case "datetime": + return ColumnDataType.Datetime; + } + return null; + } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/Error.cs b/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/Error.cs new file mode 100644 index 000000000000..0d0de33f3eb7 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/Error.cs @@ -0,0 +1,100 @@ +// 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.ResourceGraph.Models +{ + using System.Linq; + + /// + /// Error details. + /// + /// + /// Error details. + /// + public partial class Error + { + /// + /// Initializes a new instance of the Error class. + /// + public Error() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Error class. + /// + + /// Error code identifying the specific error. + /// + + /// A human readable error message. + /// + + /// Error details + /// + public Error(string code, string message, System.Collections.Generic.IList details = default(System.Collections.Generic.IList)) + + { + this.Code = code; + this.Message = message; + this.Details = details; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets error code identifying the specific error. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "code")] + public string Code {get; set; } + + /// + /// Gets or sets a human readable error message. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "message")] + public string Message {get; set; } + + /// + /// Gets or sets error details + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "details")] + public System.Collections.Generic.IList Details {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Code == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Code"); + } + if (this.Message == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Message"); + } + + + if (this.Details != null) + { + foreach (var element in this.Details) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/ErrorDetails.cs b/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/ErrorDetails.cs new file mode 100644 index 000000000000..9b770f899c72 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/ErrorDetails.cs @@ -0,0 +1,91 @@ +// 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.ResourceGraph.Models +{ + using System.Linq; + + /// + /// Error details. + /// + /// + /// Error details. + /// + public partial class ErrorDetails + { + /// + /// Initializes a new instance of the ErrorDetails class. + /// + public ErrorDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorDetails class. + /// + + /// Error details. + /// + + /// Error code identifying the specific error. + /// + + /// A human readable error message. + /// + public ErrorDetails(string code, string message, System.Collections.Generic.IDictionary additionalProperties = default(System.Collections.Generic.IDictionary)) + + { + this.AdditionalProperties = additionalProperties; + this.Code = code; + this.Message = message; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets error details. + /// + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties {get; set; } + + /// + /// Gets or sets error code identifying the specific error. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "code")] + public string Code {get; set; } + + /// + /// Gets or sets a human readable error message. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "message")] + public string Message {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Code == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Code"); + } + if (this.Message == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Message"); + } + + + + } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/ErrorResponse.cs b/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/ErrorResponse.cs new file mode 100644 index 000000000000..6e2748c892c0 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/ErrorResponse.cs @@ -0,0 +1,68 @@ +// 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.ResourceGraph.Models +{ + using System.Linq; + + /// + /// An error response from the API. + /// + /// + /// An error response from the API. + /// + public partial class ErrorResponse + { + /// + /// Initializes a new instance of the ErrorResponse class. + /// + public ErrorResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorResponse class. + /// + + /// Error information. + /// + public ErrorResponse(Error error) + + { + this.Error = error; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets error information. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "error")] + public Error Error {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Error == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Error"); + } + if (this.Error != null) + { + this.Error.Validate(); + } + } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/ErrorResponseException.cs b/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/ErrorResponseException.cs new file mode 100644 index 000000000000..ac2b6328e53a --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/ErrorResponseException.cs @@ -0,0 +1,55 @@ +// 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.ResourceGraph.Models +{ + + /// + /// Exception thrown for an invalid response with ErrorResponse information. + /// + public partial class ErrorResponseException : Microsoft.Rest.RestException + { + /// + /// Gets information about the associated HTTP request. + /// + public Microsoft.Rest.HttpRequestMessageWrapper Request { get; set; } + + /// + /// Gets information about the associated HTTP response. + /// + public Microsoft.Rest.HttpResponseMessageWrapper Response { get; set; } + + /// + /// Gets or sets the body object. + /// + public ErrorResponse Body { get; set; } + + /// + /// Initializes a new instance of the ErrorResponseException class. + /// + public ErrorResponseException() + { + } + + /// + /// Initializes a new instance of the ErrorResponse class. + /// + /// The exception message. + public ErrorResponseException(string message) + : this(message, null) + { + } + + /// + /// Initializes a new instance of the ErrorResponse class. + /// + /// The exception message. + /// Inner exception. + public ErrorResponseException(string message, System.Exception innerException) + : base(message, innerException) + { + } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/Facet.cs b/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/Facet.cs new file mode 100644 index 000000000000..b5390968a317 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/Facet.cs @@ -0,0 +1,64 @@ +// 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.ResourceGraph.Models +{ + using System.Linq; + + /// + /// A facet containing additional statistics on the response of a query. Can be + /// either FacetResult or FacetError. + /// + [Newtonsoft.Json.JsonObject("Facet")] + public partial class Facet + { + /// + /// Initializes a new instance of the Facet class. + /// + public Facet() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Facet class. + /// + + /// Facet expression, same as in the corresponding facet request. + /// + public Facet(string expression) + + { + this.Expression = expression; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets facet expression, same as in the corresponding facet request. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "expression")] + public string Expression {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Expression == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Expression"); + } + + } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/FacetError.cs b/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/FacetError.cs new file mode 100644 index 000000000000..ab72c12b58c5 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/FacetError.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.ResourceGraph.Models +{ + using System.Linq; + + /// + /// A facet whose execution resulted in an error. + /// + [Newtonsoft.Json.JsonObject("FacetError")] + public partial class FacetError : Facet + { + /// + /// Initializes a new instance of the FacetError class. + /// + public FacetError() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the FacetError class. + /// + + /// Facet expression, same as in the corresponding facet request. + /// + + /// An array containing detected facet errors with details. + /// + public FacetError(string expression, System.Collections.Generic.IList errors) + + : base(expression) + { + this.Errors = errors; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets an array containing detected facet errors with details. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "errors")] + public System.Collections.Generic.IList Errors {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + if (this.Errors == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Errors"); + } + if (this.Errors != null) + { + foreach (var element in this.Errors) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/FacetRequest.cs b/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/FacetRequest.cs new file mode 100644 index 000000000000..f9bcbd1b17c4 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/FacetRequest.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.ResourceGraph.Models +{ + using System.Linq; + + /// + /// A request to compute additional statistics (facets) over the query results. + /// + public partial class FacetRequest + { + /// + /// Initializes a new instance of the FacetRequest class. + /// + public FacetRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the FacetRequest class. + /// + + /// The column or list of columns to summarize by + /// + + /// The options for facet evaluation + /// + public FacetRequest(string expression, FacetRequestOptions options = default(FacetRequestOptions)) + + { + this.Expression = expression; + this.Options = options; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the column or list of columns to summarize by + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "expression")] + public string Expression {get; set; } + + /// + /// Gets or sets the options for facet evaluation + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "options")] + public FacetRequestOptions Options {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Expression == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Expression"); + } + + if (this.Options != null) + { + this.Options.Validate(); + } + } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/FacetRequestOptions.cs b/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/FacetRequestOptions.cs new file mode 100644 index 000000000000..35a8d1e0110e --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/FacetRequestOptions.cs @@ -0,0 +1,105 @@ +// 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.ResourceGraph.Models +{ + using System.Linq; + + /// + /// The options for facet evaluation + /// + public partial class FacetRequestOptions + { + /// + /// Initializes a new instance of the FacetRequestOptions class. + /// + public FacetRequestOptions() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the FacetRequestOptions class. + /// + + /// The column name or query expression to sort on. Defaults to count if not + /// present. + /// + + /// The sorting order by the selected column (count by default). + /// Possible values include: 'asc', 'desc' + + /// Specifies the filter condition for the 'where' clause which will be run on + /// main query's result, just before the actual faceting. + /// + + /// The maximum number of facet rows that should be returned. + /// + public FacetRequestOptions(string sortBy = default(string), FacetSortOrder? sortOrder = default(FacetSortOrder?), string filter = default(string), int? top = default(int?)) + + { + this.SortBy = sortBy; + this.SortOrder = sortOrder; + this.Filter = filter; + this.Top = top; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the column name or query expression to sort on. Defaults to + /// count if not present. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sortBy")] + public string SortBy {get; set; } + + /// + /// Gets or sets the sorting order by the selected column (count by default). Possible values include: 'asc', 'desc' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sortOrder")] + public FacetSortOrder? SortOrder {get; set; } + + /// + /// Gets or sets specifies the filter condition for the 'where' clause which + /// will be run on main query's result, just before the actual faceting. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "filter")] + public string Filter {get; set; } + + /// + /// Gets or sets the maximum number of facet rows that should be returned. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "$top")] + public int? Top {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + + + if (this.Top != null) + { + if (this.Top > 1000) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "Top", 1000); + } + if (this.Top < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "Top", 1); + } + } + } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/FacetResult.cs b/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/FacetResult.cs new file mode 100644 index 000000000000..cfc97bf8983a --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/FacetResult.cs @@ -0,0 +1,91 @@ +// 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.ResourceGraph.Models +{ + using System.Linq; + + /// + /// Successfully executed facet containing additional statistics on the + /// response of a query. + /// + [Newtonsoft.Json.JsonObject("FacetResult")] + public partial class FacetResult : Facet + { + /// + /// Initializes a new instance of the FacetResult class. + /// + public FacetResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the FacetResult class. + /// + + /// Facet expression, same as in the corresponding facet request. + /// + + /// Number of total records in the facet results. + /// + + /// Number of records returned in the facet response. + /// + + /// A JObject array or Table containing the desired facets. Only present if the + /// facet is valid. + /// + public FacetResult(string expression, long totalRecords, int count, object data) + + : base(expression) + { + this.TotalRecords = totalRecords; + this.Count = count; + this.Data = data; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets number of total records in the facet results. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "totalRecords")] + public long TotalRecords {get; set; } + + /// + /// Gets or sets number of records returned in the facet response. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "count")] + public int Count {get; set; } + + /// + /// Gets or sets a JObject array or Table containing the desired facets. Only + /// present if the facet is valid. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "data")] + public object Data {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + if (this.Data == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Data"); + } + + } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/FacetSortOrder.cs b/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/FacetSortOrder.cs new file mode 100644 index 000000000000..c245ef7f4ef8 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/FacetSortOrder.cs @@ -0,0 +1,51 @@ +// 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.ResourceGraph.Models +{ + + /// + /// Defines values for FacetSortOrder. + /// + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum FacetSortOrder + { + [System.Runtime.Serialization.EnumMember(Value = "asc")] + Asc, + [System.Runtime.Serialization.EnumMember(Value = "desc")] + Desc + } + internal static class FacetSortOrderEnumExtension + { + internal static string ToSerializedValue(this FacetSortOrder? value) + { + return value == null ? null : ((FacetSortOrder)value).ToSerializedValue(); + } + internal static string ToSerializedValue(this FacetSortOrder value) + { + switch( value ) + { + case FacetSortOrder.Asc: + return "asc"; + case FacetSortOrder.Desc: + return "desc"; + } + return null; + } + internal static FacetSortOrder? ParseFacetSortOrder(this string value) + { + switch( value ) + { + case "asc": + return FacetSortOrder.Asc; + case "desc": + return FacetSortOrder.Desc; + } + return null; + } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/Operation.cs b/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/Operation.cs new file mode 100644 index 000000000000..6dcae4de6c43 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/Operation.cs @@ -0,0 +1,68 @@ +// 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.ResourceGraph.Models +{ + using System.Linq; + + /// + /// Resource Graph REST API operation definition. + /// + public partial class Operation + { + /// + /// Initializes a new instance of the Operation class. + /// + public Operation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Operation class. + /// + + /// Operation name: {provider}/{resource}/{operation} + /// + + /// Display metadata associated with the operation. + /// + + /// The origin of operations. + /// + public Operation(string name = default(string), OperationDisplay display = default(OperationDisplay), string origin = default(string)) + + { + this.Name = name; + this.Display = display; + this.Origin = origin; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets operation name: {provider}/{resource}/{operation} + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } + + /// + /// Gets or sets display metadata associated with the operation. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "display")] + public OperationDisplay Display {get; set; } + + /// + /// Gets or sets the origin of operations. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "origin")] + public string Origin {get; set; } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/OperationDisplay.cs b/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/OperationDisplay.cs new file mode 100644 index 000000000000..e08d95048b40 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/OperationDisplay.cs @@ -0,0 +1,78 @@ +// 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.ResourceGraph.Models +{ + using System.Linq; + + /// + /// Display metadata associated with the operation. + /// + public partial class OperationDisplay + { + /// + /// Initializes a new instance of the OperationDisplay class. + /// + public OperationDisplay() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationDisplay class. + /// + + /// Service provider: Microsoft Resource Graph. + /// + + /// Resource on which the operation is performed etc. + /// + + /// Type of operation: get, read, delete, etc. + /// + + /// Description for the operation. + /// + public OperationDisplay(string provider = default(string), string resource = default(string), string operation = default(string), string description = default(string)) + + { + this.Provider = provider; + this.Resource = resource; + this.Operation = operation; + this.Description = description; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets service provider: Microsoft Resource Graph. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provider")] + public string Provider {get; set; } + + /// + /// Gets or sets resource on which the operation is performed etc. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resource")] + public string Resource {get; set; } + + /// + /// Gets or sets type of operation: get, read, delete, etc. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "operation")] + public string Operation {get; set; } + + /// + /// Gets or sets description for the operation. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/Page1.cs b/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/Page.cs similarity index 90% rename from src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/Page1.cs rename to src/RecoveryServices/RecoveryServices.Helper/Generated/Models/Page.cs index be3bc41b53b1..d7a56b5b76bc 100644 --- a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/Page1.cs +++ b/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/Page.cs @@ -3,7 +3,7 @@ // 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.RecoveryServices.Models +namespace Microsoft.Azure.Management.ResourceGraph.Models { /// @@ -11,12 +11,12 @@ namespace Microsoft.Azure.Management.RecoveryServices.Models /// /// Type of the page content items [Newtonsoft.Json.JsonObject] - public class Page1 : Microsoft.Rest.Azure.IPage + public class Page : Microsoft.Rest.Azure.IPage { /// /// Gets the link to the next page. /// - [Newtonsoft.Json.JsonProperty("nextLink")] + [Newtonsoft.Json.JsonProperty("")] public System.String NextPageLink { get; private set; } [Newtonsoft.Json.JsonProperty("value")] diff --git a/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/QueryRequest.cs b/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/QueryRequest.cs new file mode 100644 index 000000000000..8791a3d58fee --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/QueryRequest.cs @@ -0,0 +1,121 @@ +// 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.ResourceGraph.Models +{ + using System.Linq; + + /// + /// Describes a query to be executed. + /// + public partial class QueryRequest + { + /// + /// Initializes a new instance of the QueryRequest class. + /// + public QueryRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the QueryRequest class. + /// + + /// Azure subscriptions against which to execute the query. + /// + + /// Azure management groups against which to execute the query. Example: [ + /// 'mg1', 'mg2' ] + /// + + /// The resources query. + /// + + /// The query evaluation options + /// + + /// An array of facet requests to be computed against the query result. + /// + public QueryRequest(string query, System.Collections.Generic.IList subscriptions = default(System.Collections.Generic.IList), System.Collections.Generic.IList managementGroups = default(System.Collections.Generic.IList), QueryRequestOptions options = default(QueryRequestOptions), System.Collections.Generic.IList facets = default(System.Collections.Generic.IList)) + + { + this.Subscriptions = subscriptions; + this.ManagementGroups = managementGroups; + this.Query = query; + this.Options = options; + this.Facets = facets; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets azure subscriptions against which to execute the query. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "subscriptions")] + public System.Collections.Generic.IList Subscriptions {get; set; } + + /// + /// Gets or sets azure management groups against which to execute the query. + /// Example: [ 'mg1', 'mg2' ] + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "managementGroups")] + public System.Collections.Generic.IList ManagementGroups {get; set; } + + /// + /// Gets or sets the resources query. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "query")] + public string Query {get; set; } + + /// + /// Gets or sets the query evaluation options + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "options")] + public QueryRequestOptions Options {get; set; } + + /// + /// Gets or sets an array of facet requests to be computed against the query + /// result. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "facets")] + public System.Collections.Generic.IList Facets {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Query == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Query"); + } + + + + if (this.Options != null) + { + this.Options.Validate(); + } + if (this.Facets != null) + { + foreach (var element in this.Facets) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/QueryRequestOptions.cs b/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/QueryRequestOptions.cs new file mode 100644 index 000000000000..259251254070 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/QueryRequestOptions.cs @@ -0,0 +1,142 @@ +// 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.ResourceGraph.Models +{ + using System.Linq; + + /// + /// The options for query evaluation + /// + public partial class QueryRequestOptions + { + /// + /// Initializes a new instance of the QueryRequestOptions class. + /// + public QueryRequestOptions() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the QueryRequestOptions class. + /// + + /// Continuation token for pagination, capturing the next page size and offset, + /// as well as the context of the query. + /// + + /// The maximum number of rows that the query should return. Overrides the page + /// size when ```$skipToken``` property is present. + /// + + /// The number of rows to skip from the beginning of the results. Overrides the + /// next page offset when ```$skipToken``` property is present. + /// + + /// Defines in which format query result returned. + /// Possible values include: 'table', 'objectArray' + + /// Only applicable for tenant and management group level queries to decide + /// whether to allow partial scopes for result in case the number of + /// subscriptions exceed allowed limits. + /// + + /// Defines what level of authorization resources should be returned based on + /// the which subscriptions and management groups are passed as scopes. + /// Possible values include: 'AtScopeAndBelow', 'AtScopeAndAbove', + /// 'AtScopeExact', 'AtScopeAboveAndBelow' + public QueryRequestOptions(string skipToken = default(string), int? top = default(int?), int? skip = default(int?), ResultFormat? resultFormat = default(ResultFormat?), bool? allowPartialScopes = default(bool?), AuthorizationScopeFilter? authorizationScopeFilter = default(AuthorizationScopeFilter?)) + + { + this.SkipToken = skipToken; + this.Top = top; + this.Skip = skip; + this.ResultFormat = resultFormat; + this.AllowPartialScopes = allowPartialScopes; + this.AuthorizationScopeFilter = authorizationScopeFilter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets continuation token for pagination, capturing the next page + /// size and offset, as well as the context of the query. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "$skipToken")] + public string SkipToken {get; set; } + + /// + /// Gets or sets the maximum number of rows that the query should return. + /// Overrides the page size when ```$skipToken``` property is present. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "$top")] + public int? Top {get; set; } + + /// + /// Gets or sets the number of rows to skip from the beginning of the results. + /// Overrides the next page offset when ```$skipToken``` property is present. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "$skip")] + public int? Skip {get; set; } + + /// + /// Gets or sets defines in which format query result returned. Possible values include: 'table', 'objectArray' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resultFormat")] + public ResultFormat? ResultFormat {get; set; } + + /// + /// Gets or sets only applicable for tenant and management group level queries + /// to decide whether to allow partial scopes for result in case the number of + /// subscriptions exceed allowed limits. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "allowPartialScopes")] + public bool? AllowPartialScopes {get; set; } + + /// + /// Gets or sets defines what level of authorization resources should be + /// returned based on the which subscriptions and management groups are passed + /// as scopes. Possible values include: 'AtScopeAndBelow', 'AtScopeAndAbove', 'AtScopeExact', 'AtScopeAboveAndBelow' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "authorizationScopeFilter")] + public AuthorizationScopeFilter? AuthorizationScopeFilter {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + if (this.Top != null) + { + if (this.Top > 1000) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "Top", 1000); + } + if (this.Top < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "Top", 1); + } + } + if (this.Skip != null) + { + if (this.Skip < 0) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "Skip", 0); + } + } + + + } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/QueryResponse.cs b/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/QueryResponse.cs new file mode 100644 index 000000000000..e9d3e1414870 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/QueryResponse.cs @@ -0,0 +1,130 @@ +// 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.ResourceGraph.Models +{ + using System.Linq; + + /// + /// Query result. + /// + public partial class QueryResponse + { + /// + /// Initializes a new instance of the QueryResponse class. + /// + public QueryResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the QueryResponse class. + /// + + /// Number of total records matching the query. + /// + + /// Number of records returned in the current response. In the case of paging, + /// this is the number of records in the current page. + /// + + /// Indicates whether the query results are truncated. + /// Possible values include: 'true', 'false' + + /// When present, the value can be passed to a subsequent query call (together + /// with the same query and scopes used in the current request) to retrieve the + /// next page of data. + /// + + /// Query output in JObject array or Table format. + /// + + /// Query facets. + /// + public QueryResponse(long totalRecords, long count, ResultTruncated resultTruncated, object data, string skipToken = default(string), System.Collections.Generic.IList facets = default(System.Collections.Generic.IList)) + + { + this.TotalRecords = totalRecords; + this.Count = count; + this.ResultTruncated = resultTruncated; + this.SkipToken = skipToken; + this.Data = data; + this.Facets = facets; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets number of total records matching the query. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "totalRecords")] + public long TotalRecords {get; set; } + + /// + /// Gets or sets number of records returned in the current response. In the + /// case of paging, this is the number of records in the current page. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "count")] + public long Count {get; set; } + + /// + /// Gets or sets indicates whether the query results are truncated. Possible values include: 'true', 'false' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resultTruncated")] + public ResultTruncated ResultTruncated {get; set; } + + /// + /// Gets or sets when present, the value can be passed to a subsequent query + /// call (together with the same query and scopes used in the current request) + /// to retrieve the next page of data. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "$skipToken")] + public string SkipToken {get; set; } + + /// + /// Gets or sets query output in JObject array or Table format. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "data")] + public object Data {get; set; } + + /// + /// Gets or sets query facets. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "facets")] + public System.Collections.Generic.IList Facets {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Data == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Data"); + } + + + + if (this.Facets != null) + { + foreach (var element in this.Facets) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/ResultFormat.cs b/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/ResultFormat.cs new file mode 100644 index 000000000000..add39bc7bc7a --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/ResultFormat.cs @@ -0,0 +1,51 @@ +// 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.ResourceGraph.Models +{ + + /// + /// Defines values for ResultFormat. + /// + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum ResultFormat + { + [System.Runtime.Serialization.EnumMember(Value = "table")] + Table, + [System.Runtime.Serialization.EnumMember(Value = "objectArray")] + ObjectArray + } + internal static class ResultFormatEnumExtension + { + internal static string ToSerializedValue(this ResultFormat? value) + { + return value == null ? null : ((ResultFormat)value).ToSerializedValue(); + } + internal static string ToSerializedValue(this ResultFormat value) + { + switch( value ) + { + case ResultFormat.Table: + return "table"; + case ResultFormat.ObjectArray: + return "objectArray"; + } + return null; + } + internal static ResultFormat? ParseResultFormat(this string value) + { + switch( value ) + { + case "table": + return ResultFormat.Table; + case "objectArray": + return ResultFormat.ObjectArray; + } + return null; + } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/ResultTruncated.cs b/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/ResultTruncated.cs new file mode 100644 index 000000000000..20bb12e694a4 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/ResultTruncated.cs @@ -0,0 +1,51 @@ +// 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.ResourceGraph.Models +{ + + /// + /// Defines values for ResultTruncated. + /// + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum ResultTruncated + { + [System.Runtime.Serialization.EnumMember(Value = "true")] + True, + [System.Runtime.Serialization.EnumMember(Value = "false")] + False + } + internal static class ResultTruncatedEnumExtension + { + internal static string ToSerializedValue(this ResultTruncated? value) + { + return value == null ? null : ((ResultTruncated)value).ToSerializedValue(); + } + internal static string ToSerializedValue(this ResultTruncated value) + { + switch( value ) + { + case ResultTruncated.True: + return "true"; + case ResultTruncated.False: + return "false"; + } + return null; + } + internal static ResultTruncated? ParseResultTruncated(this string value) + { + switch( value ) + { + case "true": + return ResultTruncated.True; + case "false": + return ResultTruncated.False; + } + return null; + } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/Table.cs b/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/Table.cs new file mode 100644 index 000000000000..fb21632f1876 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Helper/Generated/Models/Table.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.ResourceGraph.Models +{ + using System.Linq; + + /// + /// Query output in tabular format. + /// + public partial class Table + { + /// + /// Initializes a new instance of the Table class. + /// + public Table() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Table class. + /// + + /// Query result column descriptors. + /// + + /// Query result rows. + /// + public Table(System.Collections.Generic.IList columns, System.Collections.Generic.IList> rows) + + { + this.Columns = columns; + this.Rows = rows; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets query result column descriptors. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "columns")] + public System.Collections.Generic.IList Columns {get; set; } + + /// + /// Gets or sets query result rows. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "rows")] + public System.Collections.Generic.IList> Rows {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Columns == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Columns"); + } + if (this.Rows == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Rows"); + } + if (this.Columns != null) + { + foreach (var element in this.Columns) + { + if (element != null) + { + element.Validate(); + } + } + } + + } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Helper/Generated/Operations.cs b/src/RecoveryServices/RecoveryServices.Helper/Generated/Operations.cs new file mode 100644 index 000000000000..fb3dd20aac30 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Helper/Generated/Operations.cs @@ -0,0 +1,224 @@ +// 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.ResourceGraph +{ + using System.Linq; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + + /// + /// Operations operations. + /// + internal partial class Operations : Microsoft.Rest.IServiceOperations, IOperations + { + /// + /// Initializes a new instance of the Operations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal Operations (ResourceGraphClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + this.Client = client; + } + + /// + /// Gets a reference to the ResourceGraphClient + /// + public ResourceGraphClient Client { get; private set; } + + /// + /// Lists all of the available REST API operations. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.ResourceGraph/operations").ToString(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + } + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + // Serialize Request + string _requestContent = null; + // Set Credentials + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Helper/Generated/OperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Helper/Generated/OperationsExtensions.cs new file mode 100644 index 000000000000..c94a7e7fe9fa --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Helper/Generated/OperationsExtensions.cs @@ -0,0 +1,43 @@ +// 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.ResourceGraph +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for Operations + /// + public static partial class OperationsExtensions + { + /// + /// Lists all of the available REST API operations. + /// + /// + /// The operations group for this extension method. + /// + public static System.Collections.Generic.IEnumerable List(this IOperations operations) + { + return ((IOperations)operations).ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists all of the available REST API operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } +} diff --git a/src/RecoveryServices/RecoveryServices.Helper/Generated/ResourceGraphClient.cs b/src/RecoveryServices/RecoveryServices.Helper/Generated/ResourceGraphClient.cs new file mode 100644 index 000000000000..34e068ee86e3 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Helper/Generated/ResourceGraphClient.cs @@ -0,0 +1,538 @@ +// 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.ResourceGraph +{ + using System.Linq; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + + /// + /// Azure Resource Graph API Reference + /// + public partial class ResourceGraphClient : Microsoft.Rest.ServiceClient, IResourceGraphClient, IAzureClient + { + /// + /// The base URI of the service. + /// + public System.Uri BaseUri { get; set; } + /// + /// Gets or sets json serialization settings. + /// + public Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; private set; } + /// + /// Gets or sets json deserialization settings. + /// + public Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; private set; } + /// + /// Credentials needed for the client to connect to Azure. + /// + public Microsoft.Rest.ServiceClientCredentials Credentials { get; private set; } + + /// + /// The API version to use for this operation. + /// + public string ApiVersion { get; private set; } + + /// + /// The preferred language for the response. + /// + public string AcceptLanguage { get; set;} + + /// + /// The retry timeout in seconds for Long Running Operations. Default + /// /// value is 30. + /// + public int? LongRunningOperationRetryTimeout { get; set;} + + /// + /// Whether a unique x-ms-client-request-id should be generated. When + /// /// set to true a unique x-ms-client-request-id value is generated and + /// /// included in each request. Default is true. + /// + public bool? GenerateClientRequestId { get; set;} + + /// + /// Gets the IOperations + /// + public virtual IOperations Operations { get; private set; } + /// + /// Initializes a new instance of the ResourceGraphClient class. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling ResourceGraphClient.Dispose(). False: will not dispose provided httpClient + protected ResourceGraphClient(System.Net.Http.HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) + { + this.Initialize(); + } + /// + /// Initializes a new instance of the ResourceGraphClient class. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected ResourceGraphClient(params System.Net.Http.DelegatingHandler[] handlers) : base(handlers) + { + this.Initialize(); + } + /// + /// Initializes a new instance of the ResourceGraphClient class. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected ResourceGraphClient(System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : base(rootHandler, handlers) + { + this.Initialize(); + } + /// + /// Initializes a new instance of the ResourceGraphClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + protected ResourceGraphClient(System.Uri baseUri, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + this.BaseUri = baseUri; + } + /// + /// Initializes a new instance of the ResourceGraphClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + protected ResourceGraphClient(System.Uri baseUri, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + + this.BaseUri = baseUri; + } + /// + /// Initializes a new instance of the ResourceGraphClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public ResourceGraphClient(Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + this.Credentials = credentials; + if (this.Credentials != null) + { + this.Credentials.InitializeServiceClient(this); + } + + } + /// + /// Initializes a new instance of the ResourceGraphClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling ResourceGraphClient.Dispose(). False: will not dispose provided httpClient + /// + /// Thrown when a required parameter is null + /// + public ResourceGraphClient(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + this.Credentials = credentials; + if (this.Credentials != null) + { + this.Credentials.InitializeServiceClient(this); + } + + } + /// + /// Initializes a new instance of the ResourceGraphClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public ResourceGraphClient(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + this.Credentials = credentials; + if (this.Credentials != null) + { + this.Credentials.InitializeServiceClient(this); + } + + } + /// + /// Initializes a new instance of the ResourceGraphClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public ResourceGraphClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + this.BaseUri = baseUri; + this.Credentials = credentials; + if (this.Credentials != null) + { + this.Credentials.InitializeServiceClient(this); + } + + } + /// + /// Initializes a new instance of the ResourceGraphClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public ResourceGraphClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + this.BaseUri = baseUri; + this.Credentials = credentials; + if (this.Credentials != null) + { + this.Credentials.InitializeServiceClient(this); + } + + } + /// + /// An optional partial-method to perform custom initialization. + /// + partial void CustomInitialize(); + + /// + /// Initializes client properties. + /// + private void Initialize() + { + this.Operations = new Operations(this); + this.BaseUri = new System.Uri("https://management.azure.com"); + this.ApiVersion = "2024-04-01"; + this.AcceptLanguage = "en-US"; + this.LongRunningOperationRetryTimeout = 30; + this.GenerateClientRequestId = true; + SerializationSettings = new Newtonsoft.Json.JsonSerializerSettings + { + Formatting = Newtonsoft.Json.Formatting.Indented, + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, + ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), + Converters = new System.Collections.Generic.List + { + new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() + } + }; + DeserializationSettings = new Newtonsoft.Json.JsonSerializerSettings + { + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, + ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), + Converters = new System.Collections.Generic.List + { + new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() + } + }; + SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("resultType")); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("resultType")); + CustomInitialize(); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Azure.CloudErrorJsonConverter()); + } + /// + /// Queries the resources managed by Azure Resource Manager for scopes + /// specified in the request. + /// + /// + /// Request specifying query and its options. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async System.Threading.Tasks.Task> ResourcesWithHttpMessagesAsync(QueryRequest query, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (query == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "query"); + } + if (query != null) + { + query.Validate(); + } + if (this.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.ApiVersion"); + } + + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + + tracingParameters.Add("query", query); + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Resources", tracingParameters); + } + // Construct URL + + var _baseUrl = this.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.ResourceGraph/resources").ToString(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.GenerateClientRequestId != null && this.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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(query != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(query, this.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (this.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Helper/Generated/ResourceGraphClientExtensions.cs b/src/RecoveryServices/RecoveryServices.Helper/Generated/ResourceGraphClientExtensions.cs new file mode 100644 index 000000000000..d8df874ae58f --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Helper/Generated/ResourceGraphClientExtensions.cs @@ -0,0 +1,45 @@ +// 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.ResourceGraph +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for ResourceGraphClient + /// + public static partial class ResourceGraphClientExtensions + { + /// + /// Queries the resources managed by Azure Resource Manager for scopes + /// specified in the request. + /// + /// + /// The operations group for this extension method. + /// + public static QueryResponse Resources(this IResourceGraphClient operations, QueryRequest query) + { + return ((IResourceGraphClient)operations).ResourcesAsync(query).GetAwaiter().GetResult(); + } + + /// + /// Queries the resources managed by Azure Resource Manager for scopes + /// specified in the request. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ResourcesAsync(this IResourceGraphClient operations, QueryRequest query, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ResourcesWithHttpMessagesAsync(query, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } +} diff --git a/src/RecoveryServices/RecoveryServices.Helper/README.md b/src/RecoveryServices/RecoveryServices.Helper/README.md new file mode 100644 index 000000000000..814b28aaa0a5 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Helper/README.md @@ -0,0 +1,66 @@ +# Overall +This directory contains management plane service clients of Az.Storage module. + +## Run Generation +In this directory, run AutoRest: +``` +autorest --reset +autorest --use:@autorest/powershell@4.x --tag=ResourceGraph +``` + +### AutoRest Configuration +> see https://aka.ms/autorest +``` yaml +isSdkGenerator: true +powershell: true +clear-output-folder: true +reflect-api-versions: true +openapi-type: arm +azure-arm: true +license-header: MICROSOFT_MIT_NO_VERSION +payload-flattening-threshold: 0 +title: ResourceGraphClient +``` +### Validations + +Run validations when `--validate` is specified on command line + +``` yaml $(validate) +azure-validator: true +semantic-validator: true +model-validator: true +message-format: json +``` + + +### Tag: ResourceGraph +``` yaml $(tag) == 'ResourceGraph' +commit: cb843b318ece878394d127733abe5da858466daf +input-file: + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2024-04-01/resourcegraph.json + +output-folder: Generated + +namespace: Microsoft.Azure.Management.ResourceGraph + +directive: + - suppress: ListInOperationName + from: resourcegraph.json + where: '$.paths["/providers/Microsoft.ResourceGraph/resourceChanges"].post.operationId' + reason: |- + 1. Is this rule applicable? R1003 ListInOperationName says: "Per ARM SDK guidelines, each 'GET' operation on a resource should have "list" in the name...". However, this is POST, not GET. + + 2. If the rule is applicable anyway, how should we fix it? Renaming it to ResourceChanges_List causes another warning: + "OperationId should contain the verb: 'resourcechanges' in:'ResourceChanges_List'. Consider updating the operationId" + Renaming it to ResourceChanges_ListResourceChanges causes yet another warning: + "Per the Noun_Verb convention for Operation Ids, the noun 'ResourceChanges' should not appear after the underscore." + Renaming it to ResourceChanges_Listresourcechanges seems to get rid of warnings, but the result looks very strange. + - suppress: EnumInsteadOfBoolean + where: $.definitions.ResourceChangesRequestParameters.properties.fetchPropertyChanges + from: resourcegraph.json + reason: This is a clear scenario for a boolean and will not have more than 2 values in the future. + - suppress: XmsIdentifierValidation + from: resourcecopilot.json + where: $.definitions.Error.properties.details + reason: Adding x-ms-identifiers to Error details array results in SDK breaking changes. +``` \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Helper/RecoveryServices.Helper.csproj b/src/RecoveryServices/RecoveryServices.Helper/RecoveryServices.Helper.csproj new file mode 100644 index 000000000000..b1909fc38ada --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Helper/RecoveryServices.Helper.csproj @@ -0,0 +1,18 @@ + + + + RecoveryServices + + + + + + netstandard2.0 + Microsoft.Azure.PowerShell.RecoveryServices.Helper + Microsoft.Azure.Management.RecoveryServices.Helper + $(NoWarn);CS0108;CS1573;CS0114 + + + + + \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/DeletedVaultsOperations.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/DeletedVaultsOperations.cs new file mode 100644 index 000000000000..bd7d305c194e --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/DeletedVaultsOperations.cs @@ -0,0 +1,1170 @@ +// 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.RecoveryServices +{ + using System.Linq; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + + /// + /// DeletedVaultsOperations operations. + /// + internal partial class DeletedVaultsOperations : Microsoft.Rest.IServiceOperations, IDeletedVaultsOperations + { + /// + /// Initializes a new instance of the DeletedVaultsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal DeletedVaultsOperations (RecoveryServicesClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + this.Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesClient + /// + public RecoveryServicesClient Client { get; private set; } + + /// + /// List deleted vaults in a subscription. + /// + /// + /// The name of Azure region. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async System.Threading.Tasks.Task>> ListBySubscriptionIdWithHttpMessagesAsync(string location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (location == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); + } + if (location != null) + { + if (location.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "location", 1); + } + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("location", location); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListBySubscriptionId", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{location}/deletedVaults").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + } + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + // Serialize Request + string _requestContent = null; + // Set Credentials + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new CloudErrorRecoveryServiceException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudErrorRecoveryService _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Get a specific deleted vault. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the DeletedVault + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string location, string deletedVaultName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (location == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); + } + if (location != null) + { + if (location.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "location", 1); + } + } + if (deletedVaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "deletedVaultName"); + } + if (deletedVaultName != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(deletedVaultName, "^[-\\w\\._\\(\\)]+$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "deletedVaultName", "^[-\\w\\._\\(\\)]+$"); + } + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("location", location); + tracingParameters.Add("deletedVaultName", deletedVaultName); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{location}/deletedVaults/{deletedVaultName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + _url = _url.Replace("{deletedVaultName}", System.Uri.EscapeDataString(deletedVaultName)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + } + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + // Serialize Request + string _requestContent = null; + // Set Credentials + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new CloudErrorRecoveryServiceException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudErrorRecoveryService _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Get the operation status of a deleted vault. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of deleted vault. + /// + /// + /// + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async System.Threading.Tasks.Task> GetOperationStatusWithHttpMessagesAsync(string location, string deletedVaultName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (location == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); + } + if (location != null) + { + if (location.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "location", 1); + } + } + if (deletedVaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "deletedVaultName"); + } + if (deletedVaultName != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(deletedVaultName, "^[-\\w\\._\\(\\)]+$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "deletedVaultName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (operationId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "operationId"); + } + + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("location", location); + tracingParameters.Add("deletedVaultName", deletedVaultName); + tracingParameters.Add("operationId", operationId); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetOperationStatus", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{location}/deletedVaults/{deletedVaultName}/operations/{operationId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + _url = _url.Replace("{deletedVaultName}", System.Uri.EscapeDataString(deletedVaultName)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + } + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + // Serialize Request + string _requestContent = null; + // Set Credentials + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new CloudErrorRecoveryServiceException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudErrorRecoveryService _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Start undelete of a deleted vault. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the DeletedVault + /// + /// + /// Undelete input properties. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> UndeleteWithHttpMessagesAsync(string location, string deletedVaultName, DeletedVaultUndeleteInputProperties properties, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUndeleteWithHttpMessagesAsync(location, deletedVaultName, properties, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Start undelete of a deleted vault. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the DeletedVault + /// + /// + /// Undelete input properties. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async System.Threading.Tasks.Task> BeginUndeleteWithHttpMessagesAsync(string location, string deletedVaultName, DeletedVaultUndeleteInputProperties properties, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (location == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); + } + if (location != null) + { + if (location.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "location", 1); + } + } + if (deletedVaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "deletedVaultName"); + } + if (deletedVaultName != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(deletedVaultName, "^[-\\w\\._\\(\\)]+$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "deletedVaultName", "^[-\\w\\._\\(\\)]+$"); + } + } + DeletedVaultUndeleteInput body = new DeletedVaultUndeleteInput(); + if(properties != null) + { + body.Properties = properties; + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("location", location); + tracingParameters.Add("deletedVaultName", deletedVaultName); + + tracingParameters.Add("body", body); + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUndelete", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{location}/deletedVaults/{deletedVaultName}/undelete").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + _url = _url.Replace("{deletedVaultName}", System.Uri.EscapeDataString(deletedVaultName)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + } + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + // Serialize Request + string _requestContent = null; + if(body != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// List deleted vaults in 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 System.Threading.Tasks.Task>> ListBySubscriptionIdNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListBySubscriptionIdNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + } + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + // Serialize Request + string _requestContent = null; + // Set Credentials + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new CloudErrorRecoveryServiceException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudErrorRecoveryService _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/DeletedVaultsOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/DeletedVaultsOperationsExtensions.cs new file mode 100644 index 000000000000..d9e50a398962 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/DeletedVaultsOperationsExtensions.cs @@ -0,0 +1,244 @@ +// 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.RecoveryServices +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for DeletedVaultsOperations + /// + public static partial class DeletedVaultsOperationsExtensions + { + /// + /// List deleted vaults in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + public static Microsoft.Rest.Azure.IPage ListBySubscriptionId(this IDeletedVaultsOperations operations, string location) + { + return ((IDeletedVaultsOperations)operations).ListBySubscriptionIdAsync(location).GetAwaiter().GetResult(); + } + + /// + /// List deleted vaults in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListBySubscriptionIdAsync(this IDeletedVaultsOperations operations, string location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionIdWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Get a specific deleted vault. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the DeletedVault + /// + public static DeletedVault Get(this IDeletedVaultsOperations operations, string location, string deletedVaultName) + { + return ((IDeletedVaultsOperations)operations).GetAsync(location, deletedVaultName).GetAwaiter().GetResult(); + } + + /// + /// Get a specific deleted vault. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the DeletedVault + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IDeletedVaultsOperations operations, string location, string deletedVaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(location, deletedVaultName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Get the operation status of a deleted vault. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of deleted vault. + /// + /// + /// + /// + public static OperationResource GetOperationStatus(this IDeletedVaultsOperations operations, string location, string deletedVaultName, string operationId) + { + return ((IDeletedVaultsOperations)operations).GetOperationStatusAsync(location, deletedVaultName, operationId).GetAwaiter().GetResult(); + } + + /// + /// Get the operation status of a deleted vault. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of deleted vault. + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetOperationStatusAsync(this IDeletedVaultsOperations operations, string location, string deletedVaultName, string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetOperationStatusWithHttpMessagesAsync(location, deletedVaultName, operationId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Start undelete of a deleted vault. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the DeletedVault + /// + public static DeletedVault Undelete(this IDeletedVaultsOperations operations, string location, string deletedVaultName, DeletedVaultUndeleteInputProperties properties) + { + return ((IDeletedVaultsOperations)operations).UndeleteAsync(location, deletedVaultName, properties).GetAwaiter().GetResult(); + } + + /// + /// Start undelete of a deleted vault. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the DeletedVault + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UndeleteAsync(this IDeletedVaultsOperations operations, string location, string deletedVaultName, DeletedVaultUndeleteInputProperties properties, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UndeleteWithHttpMessagesAsync(location, deletedVaultName, properties, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Start undelete of a deleted vault. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the DeletedVault + /// + public static DeletedVault BeginUndelete(this IDeletedVaultsOperations operations, string location, string deletedVaultName, DeletedVaultUndeleteInputProperties properties) + { + return ((IDeletedVaultsOperations)operations).BeginUndeleteAsync(location, deletedVaultName, properties).GetAwaiter().GetResult(); + } + + /// + /// Start undelete of a deleted vault. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the DeletedVault + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUndeleteAsync(this IDeletedVaultsOperations operations, string location, string deletedVaultName, DeletedVaultUndeleteInputProperties properties, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUndeleteWithHttpMessagesAsync(location, deletedVaultName, properties, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// List deleted vaults in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListBySubscriptionIdNext(this IDeletedVaultsOperations operations, string nextPageLink) + { + return ((IDeletedVaultsOperations)operations).ListBySubscriptionIdNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List deleted vaults in 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 System.Threading.Tasks.Task> ListBySubscriptionIdNextAsync(this IDeletedVaultsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionIdNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } +} diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/IDeletedVaultsOperations.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/IDeletedVaultsOperations.cs new file mode 100644 index 000000000000..b3f9a0579b6d --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/IDeletedVaultsOperations.cs @@ -0,0 +1,176 @@ +// 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.RecoveryServices +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// DeletedVaultsOperations operations. + /// + public partial interface IDeletedVaultsOperations + { + /// + /// List deleted vaults in a subscription. + /// + /// + /// List deleted vaults in a subscription. + /// + /// + /// The name of Azure region. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListBySubscriptionIdWithHttpMessagesAsync(string location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Get a specific deleted vault. + /// + /// + /// Get a specific deleted vault. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the DeletedVault + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string location, string deletedVaultName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Get the operation status of a deleted vault. + /// + /// + /// Get the operation status of a deleted vault. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of deleted vault. + /// + /// + /// + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> GetOperationStatusWithHttpMessagesAsync(string location, string deletedVaultName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Start undelete of a deleted vault. + /// + /// + /// Start undelete of a deleted vault. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the DeletedVault + /// + /// + /// Undelete input properties. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> UndeleteWithHttpMessagesAsync(string location, string deletedVaultName, DeletedVaultUndeleteInputProperties properties, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Start undelete of a deleted vault. + /// + /// + /// Start undelete of a deleted vault. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the DeletedVault + /// + /// + /// Undelete input properties. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> BeginUndeleteWithHttpMessagesAsync(string location, string deletedVaultName, DeletedVaultUndeleteInputProperties properties, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// List deleted vaults in a subscription. + /// + /// + /// List deleted vaults in 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 + /// + System.Threading.Tasks.Task>> ListBySubscriptionIdNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/IOperations.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/IOperations.cs index d5cf997797ca..91e23cd08fa8 100644 --- a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/IOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/IOperations.cs @@ -14,10 +14,10 @@ namespace Microsoft.Azure.Management.RecoveryServices public partial interface IOperations { /// - /// Returns the list of available operations. + /// List the operations for the provider /// /// - /// Returns the list of available operations. + /// List the operations for the provider /// /// /// The headers that will be added to request. @@ -34,10 +34,10 @@ public partial interface IOperations System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Returns the list of available operations. + /// List the operations for the provider /// /// - /// Returns the list of available operations. + /// List the operations for the provider /// /// /// The NextLink from the previous successful call to List operation. diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/IRecoveryServicesClient.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/IRecoveryServicesClient.cs index 151c43d84382..05b5d460a351 100644 --- a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/IRecoveryServicesClient.cs +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/IRecoveryServicesClient.cs @@ -10,7 +10,7 @@ namespace Microsoft.Azure.Management.RecoveryServices using Models; /// - /// + /// Recovery Services Client /// public partial interface IRecoveryServicesClient : System.IDisposable { @@ -69,44 +69,49 @@ public partial interface IRecoveryServicesClient : System.IDisposable /// - /// Gets the IVaultCertificatesOperations + /// Gets the IOperations /// - IVaultCertificatesOperations VaultCertificates { get; } + IOperations Operations { get; } /// - /// Gets the IRegisteredIdentitiesOperations + /// Gets the IRecoveryServicesOperations /// - IRegisteredIdentitiesOperations RegisteredIdentities { get; } + IRecoveryServicesOperations RecoveryServices { get; } /// - /// Gets the IReplicationUsagesOperations + /// Gets the IDeletedVaultsOperations /// - IReplicationUsagesOperations ReplicationUsages { get; } + IDeletedVaultsOperations DeletedVaults { get; } /// - /// Gets the IPrivateLinkResourcesOperations + /// Gets the IVaultsOperations /// - IPrivateLinkResourcesOperations PrivateLinkResources { get; } + IVaultsOperations Vaults { get; } /// - /// Gets the IRecoveryServicesOperations + /// Gets the IVaultCertificatesOperations /// - IRecoveryServicesOperations RecoveryServices { get; } + IVaultCertificatesOperations VaultCertificates { get; } /// - /// Gets the IVaultsOperations + /// Gets the IVaultExtendedInfoOperations /// - IVaultsOperations Vaults { get; } + IVaultExtendedInfoOperations VaultExtendedInfo { get; } /// - /// Gets the IOperations + /// Gets the IPrivateLinkResourcesOperations /// - IOperations Operations { get; } + IPrivateLinkResourcesOperations PrivateLinkResources { get; } /// - /// Gets the IVaultExtendedInfoOperations + /// Gets the IRegisteredIdentitiesOperations /// - IVaultExtendedInfoOperations VaultExtendedInfo { get; } + IRegisteredIdentitiesOperations RegisteredIdentities { get; } + + /// + /// Gets the IReplicationUsagesOperations + /// + IReplicationUsagesOperations ReplicationUsages { get; } /// /// Gets the IUsagesOperations @@ -114,19 +119,19 @@ public partial interface IRecoveryServicesClient : System.IDisposable IUsagesOperations Usages { get; } /// - /// Gets the operation status for a resource. + /// Gets the operation result for a resource. /// /// - /// Gets the operation status for a resource. + /// Gets the operation result for a resource. /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. + /// The name of the Vault /// /// - /// + /// The name of the Vault /// /// /// The headers that will be added to request. @@ -140,13 +145,13 @@ public partial interface IRecoveryServicesClient : System.IDisposable /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> GetOperationStatusWithHttpMessagesAsync(string resourceGroupName, string vaultName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetOperationResultWithHttpMessagesAsync(string resourceGroupName, string vaultName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Gets the operation result for a resource. + /// Gets the operation status for a resource. /// /// - /// Gets the operation result for a resource. + /// Gets the operation status for a resource. /// /// /// The name of the resource group. The name is case insensitive. @@ -169,7 +174,7 @@ public partial interface IRecoveryServicesClient : System.IDisposable /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> GetOperationResultWithHttpMessagesAsync(string resourceGroupName, string vaultName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetOperationStatusWithHttpMessagesAsync(string resourceGroupName, string vaultName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/IRecoveryServicesOperations.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/IRecoveryServicesOperations.cs index 20da531f9430..c89ec96a651a 100644 --- a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/IRecoveryServicesOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/IRecoveryServicesOperations.cs @@ -14,30 +14,21 @@ namespace Microsoft.Azure.Management.RecoveryServices public partial interface IRecoveryServicesOperations { /// - /// API to check for resource name availability. - /// A name is available if no other resource exists that has the same - /// SubscriptionId, Resource Name and Type - /// or if one or more such resources exist, each of these must be GC'd and - /// their time of deletion be more than 24 Hours Ago + /// API to get details about capabilities provided by + /// Microsoft.RecoveryServices RP /// /// - /// API to check for resource name availability. - /// A name is available if no other resource exists that has the same - /// SubscriptionId, Resource Name and Type - /// or if one or more such resources exist, each of these must be GC'd and - /// their time of deletion be more than 24 Hours Ago + /// API to get details about capabilities provided by + /// Microsoft.RecoveryServices RP /// - /// - /// The name of the resource group. The name is case insensitive. - /// /// - /// Location of the resource + /// The location of the resource. /// /// /// Describes the Resource type: Microsoft.RecoveryServices/Vaults /// - /// - /// Resource name for which availability needs to be checked + /// + /// Capabilities information /// /// /// The headers that will be added to request. @@ -51,24 +42,33 @@ public partial interface IRecoveryServicesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> CheckNameAvailabilityWithHttpMessagesAsync(string resourceGroupName, string location, string type = default(string), string name = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> CapabilitiesWithHttpMessagesAsync(string location, string type, CapabilitiesProperties properties = default(CapabilitiesProperties), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// API to get details about capabilities provided by - /// Microsoft.RecoveryServices RP + /// API to check for resource name availability. + /// A name is available if no other resource exists that has the same + /// SubscriptionId, Resource Name and Type + /// or if one or more such resources exist, each of these must be GC'd and + /// their time of deletion be more than 24 Hours Ago /// /// - /// API to get details about capabilities provided by - /// Microsoft.RecoveryServices RP + /// API to check for resource name availability. + /// A name is available if no other resource exists that has the same + /// SubscriptionId, Resource Name and Type + /// or if one or more such resources exist, each of these must be GC'd and + /// their time of deletion be more than 24 Hours Ago /// + /// + /// The name of the resource group. The name is case insensitive. + /// /// - /// Location of the resource + /// The name of Azure region. /// /// /// Describes the Resource type: Microsoft.RecoveryServices/Vaults /// - /// - /// Capabilities information + /// + /// Resource name for which availability needs to be checked /// /// /// The headers that will be added to request. @@ -82,7 +82,7 @@ public partial interface IRecoveryServicesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> CapabilitiesWithHttpMessagesAsync(string location, string type, CapabilitiesProperties properties = default(CapabilitiesProperties), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> CheckNameAvailabilityWithHttpMessagesAsync(string resourceGroupName, string location, string type = default(string), string name = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/IReplicationUsagesOperations.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/IReplicationUsagesOperations.cs index 8151980d7bf0..9c0c403b70e4 100644 --- a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/IReplicationUsagesOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/IReplicationUsagesOperations.cs @@ -23,7 +23,7 @@ public partial interface IReplicationUsagesOperations /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. + /// The name of the Vault /// /// /// The headers that will be added to request. @@ -37,7 +37,30 @@ public partial interface IReplicationUsagesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string vaultName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string vaultName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Fetches the replication usages of the vault. + /// + /// + /// Fetches the replication usages of the vault. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/IUsagesOperations.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/IUsagesOperations.cs index 152304643f28..376f49b8222e 100644 --- a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/IUsagesOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/IUsagesOperations.cs @@ -23,7 +23,7 @@ public partial interface IUsagesOperations /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. + /// The name of the Vault /// /// /// The headers that will be added to request. @@ -37,7 +37,30 @@ public partial interface IUsagesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListByVaultsWithHttpMessagesAsync(string resourceGroupName, string vaultName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListByVaultsWithHttpMessagesAsync(string resourceGroupName, string vaultName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Fetches the usages of the vault. + /// + /// + /// Fetches the usages of the vault. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListByVaultsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/IVaultsOperations.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/IVaultsOperations.cs index 6716a164ecdc..01c9f73e10aa 100644 --- a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/IVaultsOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/IVaultsOperations.cs @@ -66,7 +66,7 @@ public partial interface IVaultsOperations /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. + /// The name of the Vault /// /// /// The headers that will be added to request. @@ -92,7 +92,7 @@ public partial interface IVaultsOperations /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. + /// The name of the Vault /// /// /// @@ -112,19 +112,25 @@ public partial interface IVaultsOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vaultName, Vault vault, string xMsAuthorizationAuxiliary = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vaultName, Vault vault, string xMsAuthorizationAuxiliary = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Deletes a vault. + /// Updates the vault. /// /// - /// Deletes a vault. + /// Updates the vault. /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. + /// The name of the Vault + /// + /// + /// + /// + /// + /// Recovery Services Vault to be created. /// /// /// The headers that will be added to request. @@ -135,25 +141,22 @@ public partial interface IVaultsOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string vaultName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string vaultName, PatchVault vault, string xMsAuthorizationAuxiliary = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Updates the vault. + /// Deletes a vault. /// /// - /// Updates the vault. + /// Deletes a vault. /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. - /// - /// - /// - /// - /// - /// Recovery Services Vault to be created. + /// The name of the Vault /// /// /// The headers that will be added to request. @@ -164,10 +167,7 @@ public partial interface IVaultsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// - System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string vaultName, PatchVault vault, string xMsAuthorizationAuxiliary = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string vaultName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Creates or updates a Recovery Services vault. @@ -179,7 +179,7 @@ public partial interface IVaultsOperations /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. + /// The name of the Vault /// /// /// @@ -199,19 +199,25 @@ public partial interface IVaultsOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vaultName, Vault vault, string xMsAuthorizationAuxiliary = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vaultName, Vault vault, string xMsAuthorizationAuxiliary = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Deletes a vault. + /// Updates the vault. /// /// - /// Deletes a vault. + /// Updates the vault. /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. + /// The name of the Vault + /// + /// + /// + /// + /// + /// Recovery Services Vault to be created. /// /// /// The headers that will be added to request. @@ -222,25 +228,22 @@ public partial interface IVaultsOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vaultName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string vaultName, PatchVault vault, string xMsAuthorizationAuxiliary = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Updates the vault. + /// Deletes a vault. /// /// - /// Updates the vault. + /// Deletes a vault. /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. - /// - /// - /// - /// - /// - /// Recovery Services Vault to be created. + /// The name of the Vault /// /// /// The headers that will be added to request. @@ -251,10 +254,7 @@ public partial interface IVaultsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// - System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string vaultName, PatchVault vault, string xMsAuthorizationAuxiliary = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vaultName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Fetches all the resources of the specified type in the subscription. diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/AssociatedIdentity.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/AssociatedIdentity.cs new file mode 100644 index 000000000000..88e10bfb9200 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/AssociatedIdentity.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.RecoveryServices.Models +{ + using System.Linq; + + /// + /// Identity details to be used for an operation + /// + public partial class AssociatedIdentity + { + /// + /// Initializes a new instance of the AssociatedIdentity class. + /// + public AssociatedIdentity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AssociatedIdentity class. + /// + + /// Identity type that should be used for an operation. + /// Possible values include: 'SystemAssigned', 'UserAssigned' + + /// User assigned identity to be used for an operation if operationIdentityType + /// is UserAssigned. + /// + public AssociatedIdentity(string operationIdentityType = default(string), string userAssignedIdentity = default(string)) + + { + this.OperationIdentityType = operationIdentityType; + this.UserAssignedIdentity = userAssignedIdentity; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets identity type that should be used for an operation. Possible values include: 'SystemAssigned', 'UserAssigned' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "operationIdentityType")] + public string OperationIdentityType {get; set; } + + /// + /// Gets or sets user assigned identity to be used for an operation if + /// operationIdentityType is UserAssigned. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "userAssignedIdentity")] + public string UserAssignedIdentity {get; set; } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/CloudErrorRecoveryService.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/CloudErrorRecoveryService.cs new file mode 100644 index 000000000000..245930cab2c3 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/CloudErrorRecoveryService.cs @@ -0,0 +1,48 @@ +// 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.RecoveryServices.Models +{ + using System.Linq; + + /// + /// An error response from Azure Backup. + /// + public partial class CloudErrorRecoveryService + { + /// + /// Initializes a new instance of the CloudErrorRecoveryService class. + /// + public CloudErrorRecoveryService() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CloudErrorRecoveryService class. + /// + + /// The resource management error response. + /// + public CloudErrorRecoveryService(Error error = default(Error)) + + { + this.Error = error; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the resource management error response. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "error")] + public Error Error {get; set; } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/CloudErrorRecoveryServiceException.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/CloudErrorRecoveryServiceException.cs new file mode 100644 index 000000000000..bd3d169cae93 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/CloudErrorRecoveryServiceException.cs @@ -0,0 +1,55 @@ +// 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.RecoveryServices.Models +{ + + /// + /// Exception thrown for an invalid response with CloudErrorRecoveryService information. + /// + public partial class CloudErrorRecoveryServiceException : Microsoft.Rest.RestException + { + /// + /// Gets information about the associated HTTP request. + /// + public Microsoft.Rest.HttpRequestMessageWrapper Request { get; set; } + + /// + /// Gets information about the associated HTTP response. + /// + public Microsoft.Rest.HttpResponseMessageWrapper Response { get; set; } + + /// + /// Gets or sets the body object. + /// + public CloudErrorRecoveryService Body { get; set; } + + /// + /// Initializes a new instance of the CloudErrorRecoveryServiceException class. + /// + public CloudErrorRecoveryServiceException() + { + } + + /// + /// Initializes a new instance of the CloudErrorRecoveryService class. + /// + /// The exception message. + public CloudErrorRecoveryServiceException(string message) + : this(message, null) + { + } + + /// + /// Initializes a new instance of the CloudErrorRecoveryService class. + /// + /// The exception message. + /// Inner exception. + public CloudErrorRecoveryServiceException(string message, System.Exception innerException) + : base(message, innerException) + { + } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/DeletedVault.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/DeletedVault.cs new file mode 100644 index 000000000000..849df56a3799 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/DeletedVault.cs @@ -0,0 +1,64 @@ +// 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.RecoveryServices.Models +{ + using System.Linq; + + /// + /// DeletedVault information as returned by the resource provider. + /// + public partial class DeletedVault : ProxyResource + { + /// + /// Initializes a new instance of the DeletedVault class. + /// + public DeletedVault() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DeletedVault class. + /// + + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + + /// The name of the resource + /// + + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. + /// + + /// The resource-specific properties for this resource. + /// + public DeletedVault(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), DeletedVaultProperties properties = default(DeletedVaultProperties)) + + : base(id, name, type, systemData) + { + this.Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the resource-specific properties for this resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + public DeletedVaultProperties Properties {get; set; } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/DeletedVaultProperties.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/DeletedVaultProperties.cs new file mode 100644 index 000000000000..cf0611874a52 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/DeletedVaultProperties.cs @@ -0,0 +1,68 @@ +// 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.RecoveryServices.Models +{ + using System.Linq; + + /// + /// Properties of the DeletedVault. + /// + public partial class DeletedVaultProperties + { + /// + /// Initializes a new instance of the DeletedVaultProperties class. + /// + public DeletedVaultProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DeletedVaultProperties class. + /// + + /// ARM Id of the Vault which was deleted. + /// + + /// Time in UTC at which the Vault was deleted. + /// + + /// Time in UTC at which the DeletedVault will be purged. + /// + public DeletedVaultProperties(string vaultId = default(string), System.DateTime? vaultDeletionTime = default(System.DateTime?), System.DateTime? purgeAt = default(System.DateTime?)) + + { + this.VaultId = vaultId; + this.VaultDeletionTime = vaultDeletionTime; + this.PurgeAt = purgeAt; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets aRM Id of the Vault which was deleted. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "vaultId")] + public string VaultId {get; private set; } + + /// + /// Gets time in UTC at which the Vault was deleted. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "vaultDeletionTime")] + public System.DateTime? VaultDeletionTime {get; private set; } + + /// + /// Gets time in UTC at which the DeletedVault will be purged. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "purgeAt")] + public System.DateTime? PurgeAt {get; private set; } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/DeletedVaultUndeleteInput.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/DeletedVaultUndeleteInput.cs new file mode 100644 index 000000000000..b78a3ff1566f --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/DeletedVaultUndeleteInput.cs @@ -0,0 +1,65 @@ +// 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.RecoveryServices.Models +{ + using System.Linq; + + /// + /// Input definition for DeletedVault undelete. + /// + public partial class DeletedVaultUndeleteInput + { + /// + /// Initializes a new instance of the DeletedVaultUndeleteInput class. + /// + public DeletedVaultUndeleteInput() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DeletedVaultUndeleteInput class. + /// + + /// Undelete input properties. + /// + public DeletedVaultUndeleteInput(DeletedVaultUndeleteInputProperties properties) + + { + this.Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets undelete input properties. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + public DeletedVaultUndeleteInputProperties Properties {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Properties == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Properties"); + } + if (this.Properties != null) + { + this.Properties.Validate(); + } + } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/DeletedVaultUndeleteInputProperties.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/DeletedVaultUndeleteInputProperties.cs new file mode 100644 index 000000000000..d982e9caee62 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/DeletedVaultUndeleteInputProperties.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Models +{ + using System.Linq; + + /// + /// Input definition for DeletedVault undelete properties. + /// + public partial class DeletedVaultUndeleteInputProperties + { + /// + /// Initializes a new instance of the DeletedVaultUndeleteInputProperties class. + /// + public DeletedVaultUndeleteInputProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DeletedVaultUndeleteInputProperties class. + /// + + /// Recovery resource group Id. + /// + public DeletedVaultUndeleteInputProperties(string recoveryResourceGroupId) + + { + this.RecoveryResourceGroupId = recoveryResourceGroupId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets recovery resource group Id. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "recoveryResourceGroupId")] + public string RecoveryResourceGroupId {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.RecoveryResourceGroupId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "RecoveryResourceGroupId"); + } + + } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/DeletedVaultsUndeleteHeaders.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/DeletedVaultsUndeleteHeaders.cs new file mode 100644 index 000000000000..8a3e78617f2f --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/DeletedVaultsUndeleteHeaders.cs @@ -0,0 +1,55 @@ +// 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.RecoveryServices.Models +{ + using System.Linq; + + public partial class DeletedVaultsUndeleteHeaders + { + /// + /// Initializes a new instance of the DeletedVaultsUndeleteHeaders class. + /// + public DeletedVaultsUndeleteHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DeletedVaultsUndeleteHeaders class. + /// + + /// + /// + + /// + /// + public DeletedVaultsUndeleteHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + { + this.AzureAsyncOperation = azureAsyncOperation; + this.Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] + public string AzureAsyncOperation {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/ErrorAdditionalInfo.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/ErrorAdditionalInfo.cs index 2149b9c043d5..be6e89c587e6 100644 --- a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/ErrorAdditionalInfo.cs +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/ErrorAdditionalInfo.cs @@ -24,16 +24,16 @@ public ErrorAdditionalInfo() /// Initializes a new instance of the ErrorAdditionalInfo class. /// - /// The additional info. + /// The additional info type. /// - /// The additional info type. + /// The additional info. /// - public ErrorAdditionalInfo(object info = default(object), string type = default(string)) + public ErrorAdditionalInfo(string type = default(string), object info = default(object)) { - this.Info = info; this.Type = type; + this.Info = info; CustomInit(); } @@ -43,16 +43,16 @@ public ErrorAdditionalInfo() partial void CustomInit(); - /// - /// Gets the additional info. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "info")] - public object Info {get; private set; } - /// /// Gets the additional info type. /// [Newtonsoft.Json.JsonProperty(PropertyName = "type")] public string Type {get; private set; } + + /// + /// Gets the additional info. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "info")] + public object Info {get; private set; } } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/IdentityType.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/IdentityType.cs new file mode 100644 index 000000000000..3bf0d5be8f07 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/IdentityType.cs @@ -0,0 +1,19 @@ +// 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.RecoveryServices.Models +{ + + /// + /// Defines values for IdentityType. + /// + + + public static class IdentityType + { + public const string SystemAssigned = "SystemAssigned"; + public const string UserAssigned = "UserAssigned"; + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/Page.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/Page.cs index 0ecc85c86915..4f14b48a00f1 100644 --- a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/Page.cs +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/Page.cs @@ -16,7 +16,7 @@ public class Page : Microsoft.Rest.Azure.IPage /// /// Gets the link to the next page. /// - [Newtonsoft.Json.JsonProperty("")] + [Newtonsoft.Json.JsonProperty("nextLink")] public System.String NextPageLink { get; private set; } [Newtonsoft.Json.JsonProperty("value")] diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/PatchTrackedResource.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/PatchTrackedResource.cs index 8d6c48747a21..b35f3d02daea 100644 --- a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/PatchTrackedResource.cs +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/PatchTrackedResource.cs @@ -24,17 +24,19 @@ public PatchTrackedResource() /// Initializes a new instance of the PatchTrackedResource class. /// - /// Resource Id represents the complete path to the resource. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// - /// Resource name associated with the resource. + /// The name of the resource /// - /// Resource type represents the complete path of the form - /// Namespace/ResourceType/ResourceType/... + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// - /// Optional ETag. + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. /// /// Resource location. @@ -42,12 +44,16 @@ public PatchTrackedResource() /// Resource tags. /// - public PatchTrackedResource(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary)) - : base(id, name, type, etag) + /// Optional ETag. + /// + public PatchTrackedResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string)) + + : base(id, name, type, systemData) { this.Location = location; this.Tags = tags; + this.Etag = etag; CustomInit(); } @@ -68,5 +74,11 @@ public PatchTrackedResource() /// [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] public System.Collections.Generic.IDictionary Tags {get; set; } + + /// + /// Gets or sets optional ETag. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; set; } } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/PatchVault.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/PatchVault.cs index 9e9a427a917a..3dae5dff0211 100644 --- a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/PatchVault.cs +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/PatchVault.cs @@ -24,17 +24,19 @@ public PatchVault() /// Initializes a new instance of the PatchVault class. /// - /// Resource Id represents the complete path to the resource. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// - /// Resource name associated with the resource. + /// The name of the resource /// - /// Resource type represents the complete path of the form - /// Namespace/ResourceType/ResourceType/... + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// - /// Optional ETag. + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. /// /// Resource location. @@ -43,6 +45,9 @@ public PatchVault() /// Resource tags. /// + /// Optional ETag. + /// + /// Properties of the vault. /// @@ -51,9 +56,9 @@ public PatchVault() /// Identity for the resource. /// - public PatchVault(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), VaultProperties properties = default(VaultProperties), Sku sku = default(Sku), IdentityData identity = default(IdentityData)) + public PatchVault(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string), VaultProperties properties = default(VaultProperties), Sku sku = default(Sku), IdentityData identity = default(IdentityData)) - : base(id, name, type, etag, location, tags) + : base(id, name, type, systemData, location, tags, etag) { this.Properties = properties; this.Sku = sku; diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/PrivateLinkResource.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/PrivateLinkResource.cs index 3bdca8f60e04..804363297649 100644 --- a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/PrivateLinkResource.cs +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/PrivateLinkResource.cs @@ -11,7 +11,7 @@ namespace Microsoft.Azure.Management.RecoveryServices.Models /// Information of the private link resource. /// [Microsoft.Rest.Serialization.JsonTransformation] - public partial class PrivateLinkResource + public partial class PrivateLinkResource : ProxyResource { /// /// Initializes a new instance of the PrivateLinkResource class. @@ -25,13 +25,19 @@ public PrivateLinkResource() /// Initializes a new instance of the PrivateLinkResource class. /// - /// Fully qualified identifier of the resource. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// - /// Name of the resource. + /// The name of the resource /// - /// e.g. Microsoft.RecoveryServices/vaults/privateLinkResources + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. /// /// e.g. f9ad6492-33d4-4690-9999-6bfd52a0d081 (Backup) or @@ -43,12 +49,10 @@ public PrivateLinkResource() /// The private link resource Private link DNS zone name. /// - public PrivateLinkResource(string id = default(string), string name = default(string), string type = default(string), string groupId = default(string), System.Collections.Generic.IList requiredMembers = default(System.Collections.Generic.IList), System.Collections.Generic.IList requiredZoneNames = default(System.Collections.Generic.IList)) + public PrivateLinkResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string groupId = default(string), System.Collections.Generic.IList requiredMembers = default(System.Collections.Generic.IList), System.Collections.Generic.IList requiredZoneNames = default(System.Collections.Generic.IList)) + : base(id, name, type, systemData) { - this.Id = id; - this.Name = name; - this.Type = type; this.GroupId = groupId; this.RequiredMembers = requiredMembers; this.RequiredZoneNames = requiredZoneNames; @@ -61,24 +65,6 @@ public PrivateLinkResource() partial void CustomInit(); - /// - /// Gets fully qualified identifier of the resource. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] - public string Id {get; private set; } - - /// - /// Gets name of the resource. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] - public string Name {get; private set; } - - /// - /// Gets e.g. Microsoft.RecoveryServices/vaults/privateLinkResources - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "type")] - public string Type {get; private set; } - /// /// Gets e.g. f9ad6492-33d4-4690-9999-6bfd52a0d081 (Backup) or /// f9ad6492-33d4-4690-9999-6bfd52a0d082 (SiteRecovery) diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/ProxyResource.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/ProxyResource.cs new file mode 100644 index 000000000000..bb9e31defa0f --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/ProxyResource.cs @@ -0,0 +1,59 @@ +// 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.RecoveryServices.Models +{ + using System.Linq; + + /// + /// The resource model definition for a Azure Resource Manager proxy resource. + /// It will not have tags and a location + /// + /// + /// The resource model definition for a Azure Resource Manager proxy resource. + /// It will not have tags and a location + /// + public partial class ProxyResource : Resource + { + /// + /// Initializes a new instance of the ProxyResource class. + /// + public ProxyResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ProxyResource class. + /// + + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + + /// The name of the resource + /// + + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. + /// + public ProxyResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData)) + + : base(id, name, type, systemData) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/Resource.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/Resource.cs index 37f9403b5c15..b56627bf0965 100644 --- a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/Resource.cs +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/Resource.cs @@ -8,8 +8,13 @@ namespace Microsoft.Azure.Management.RecoveryServices.Models using System.Linq; /// - /// ARM Resource. + /// Common fields that are returned in the response for all Azure Resource + /// Manager resources /// + /// + /// Common fields that are returned in the response for all Azure Resource + /// Manager resources + /// public partial class Resource : Microsoft.Rest.Azure.IResource { /// @@ -24,25 +29,27 @@ public Resource() /// Initializes a new instance of the Resource class. /// - /// Resource Id represents the complete path to the resource. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// - /// Resource name associated with the resource. + /// The name of the resource /// - /// Resource type represents the complete path of the form - /// Namespace/ResourceType/ResourceType/... + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// - /// Optional ETag. + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. /// - public Resource(string id = default(string), string name = default(string), string type = default(string), string etag = default(string)) + public Resource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData)) { this.Id = id; this.Name = name; this.Type = type; - this.Etag = etag; + this.SystemData = systemData; CustomInit(); } @@ -53,28 +60,30 @@ public Resource() /// - /// Gets resource Id represents the complete path to the resource. + /// Gets fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// [Newtonsoft.Json.JsonProperty(PropertyName = "id")] public string Id {get; private set; } /// - /// Gets resource name associated with the resource. + /// Gets the name of the resource /// [Newtonsoft.Json.JsonProperty(PropertyName = "name")] public string Name {get; private set; } /// - /// Gets resource type represents the complete path of the form - /// Namespace/ResourceType/ResourceType/... + /// Gets the type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// [Newtonsoft.Json.JsonProperty(PropertyName = "type")] public string Type {get; private set; } /// - /// Gets or sets optional ETag. + /// Gets azure Resource Manager metadata containing createdBy and modifiedBy + /// information. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] - public string Etag {get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "systemData")] + public SystemData SystemData {get; private set; } } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/SecuritySettings.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/SecuritySettings.cs index 007c1e93b639..737faafca20e 100644 --- a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/SecuritySettings.cs +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/SecuritySettings.cs @@ -32,12 +32,16 @@ public SecuritySettings() /// MUA Settings of a vault /// Possible values include: 'Invalid', 'Enabled', 'Disabled' - public SecuritySettings(ImmutabilitySettings immutabilitySettings = default(ImmutabilitySettings), SoftDeleteSettings softDeleteSettings = default(SoftDeleteSettings), string multiUserAuthorization = default(string)) + + /// Source scan configuration of vault + /// + public SecuritySettings(ImmutabilitySettings immutabilitySettings = default(ImmutabilitySettings), SoftDeleteSettings softDeleteSettings = default(SoftDeleteSettings), string multiUserAuthorization = default(string), SourceScanConfiguration sourceScanConfiguration = default(SourceScanConfiguration)) { this.ImmutabilitySettings = immutabilitySettings; this.SoftDeleteSettings = softDeleteSettings; this.MultiUserAuthorization = multiUserAuthorization; + this.SourceScanConfiguration = sourceScanConfiguration; CustomInit(); } @@ -64,5 +68,11 @@ public SecuritySettings() /// [Newtonsoft.Json.JsonProperty(PropertyName = "multiUserAuthorization")] public string MultiUserAuthorization {get; private set; } + + /// + /// Gets or sets source scan configuration of vault + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceScanConfiguration")] + public SourceScanConfiguration SourceScanConfiguration {get; set; } } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/SourceScanConfiguration.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/SourceScanConfiguration.cs new file mode 100644 index 000000000000..ac6ffddd25d0 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/SourceScanConfiguration.cs @@ -0,0 +1,58 @@ +// 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.RecoveryServices.Models +{ + using System.Linq; + + /// + /// Source scan configuration of vault + /// + public partial class SourceScanConfiguration + { + /// + /// Initializes a new instance of the SourceScanConfiguration class. + /// + public SourceScanConfiguration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SourceScanConfiguration class. + /// + + /// + /// Possible values include: 'Invalid', 'Enabled', 'Disabled' + + /// Identity details to be used for an operation + /// + public SourceScanConfiguration(string state = default(string), AssociatedIdentity sourceScanIdentity = default(AssociatedIdentity)) + + { + this.State = state; + this.SourceScanIdentity = sourceScanIdentity; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets Possible values include: 'Invalid', 'Enabled', 'Disabled' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "state")] + public string State {get; set; } + + /// + /// Gets or sets identity details to be used for an operation + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceScanIdentity")] + public AssociatedIdentity SourceScanIdentity {get; set; } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/State.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/State.cs new file mode 100644 index 000000000000..6889760975ef --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/State.cs @@ -0,0 +1,20 @@ +// 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.RecoveryServices.Models +{ + + /// + /// Defines values for State. + /// + + + public static class State + { + public const string Invalid = "Invalid"; + public const string Enabled = "Enabled"; + public const string Disabled = "Disabled"; + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/SystemData.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/SystemData.cs index 9a9a7a0336cd..8e79437ac129 100644 --- a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/SystemData.cs +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/SystemData.cs @@ -39,7 +39,7 @@ public SystemData() /// The type of identity that last modified the resource. /// Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' - /// The type of identity that last modified the resource. + /// The timestamp of resource last modification (UTC) /// public SystemData(string createdBy = default(string), string createdByType = default(string), System.DateTime? createdAt = default(System.DateTime?), string lastModifiedBy = default(string), string lastModifiedByType = default(string), System.DateTime? lastModifiedAt = default(System.DateTime?)) @@ -90,7 +90,7 @@ public SystemData() public string LastModifiedByType {get; set; } /// - /// Gets or sets the type of identity that last modified the resource. + /// Gets or sets the timestamp of resource last modification (UTC) /// [Newtonsoft.Json.JsonProperty(PropertyName = "lastModifiedAt")] public System.DateTime? LastModifiedAt {get; set; } diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/TrackedResource.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/TrackedResource.cs index 09a41444aeaf..7d61e7f62695 100644 --- a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/TrackedResource.cs +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/TrackedResource.cs @@ -8,8 +8,13 @@ namespace Microsoft.Azure.Management.RecoveryServices.Models using System.Linq; /// - /// Tracked resource with location. + /// The resource model definition for an Azure Resource Manager tracked top + /// level resource which has 'tags' and a 'location' /// + /// + /// The resource model definition for an Azure Resource Manager tracked top + /// level resource which has 'tags' and a 'location' + /// public partial class TrackedResource : Resource { /// @@ -24,30 +29,32 @@ public TrackedResource() /// Initializes a new instance of the TrackedResource class. /// - /// Resource Id represents the complete path to the resource. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// - /// Resource name associated with the resource. + /// The name of the resource /// - /// Resource type represents the complete path of the form - /// Namespace/ResourceType/ResourceType/... + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// - /// Optional ETag. + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. /// - /// Resource location. + /// Resource tags. /// - /// Resource tags. + /// The geo-location where the resource lives /// - public TrackedResource(string location, string id = default(string), string name = default(string), string type = default(string), string etag = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary)) + public TrackedResource(string location, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary)) - : base(id, name, type, etag) + : base(id, name, type, systemData) { - this.Location = location; this.Tags = tags; + this.Location = location; CustomInit(); } @@ -57,17 +64,17 @@ public TrackedResource() partial void CustomInit(); - /// - /// Gets or sets resource location. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] - public string Location {get; set; } - /// /// Gets or sets resource tags. /// [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] public System.Collections.Generic.IDictionary Tags {get; set; } + + /// + /// Gets or sets the geo-location where the resource lives + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } /// /// Validate the object. /// diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/Vault.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/Vault.cs index 67de8c1dedb5..07b79df1e548 100644 --- a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/Vault.cs +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/Vault.cs @@ -24,44 +24,46 @@ public Vault() /// Initializes a new instance of the Vault class. /// - /// Resource Id represents the complete path to the resource. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// - /// Resource name associated with the resource. + /// The name of the resource /// - /// Resource type represents the complete path of the form - /// Namespace/ResourceType/ResourceType/... + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// - /// Optional ETag. - /// - - /// Resource location. + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. /// /// Resource tags. /// - /// Identity for the resource. + /// The geo-location where the resource lives /// /// Properties of the vault. /// + /// Identity for the resource. + /// + /// Identifies the unique system identifier for each Azure resource. /// - /// Metadata pertaining to creation and last modification of the resource. + /// etag for the resource. /// - public Vault(string location, string id = default(string), string name = default(string), string type = default(string), string etag = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), IdentityData identity = default(IdentityData), VaultProperties properties = default(VaultProperties), Sku sku = default(Sku), SystemData systemData = default(SystemData)) + public Vault(string location, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), VaultProperties properties = default(VaultProperties), IdentityData identity = default(IdentityData), Sku sku = default(Sku), string etag = default(string)) - : base(location, id, name, type, etag, tags) + : base(location, id, name, type, systemData, tags) { - this.Identity = identity; this.Properties = properties; + this.Identity = identity; this.Sku = sku; - this.SystemData = systemData; + this.Etag = etag; CustomInit(); } @@ -71,18 +73,18 @@ public Vault() partial void CustomInit(); - /// - /// Gets or sets identity for the resource. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "identity")] - public IdentityData Identity {get; set; } - /// /// Gets or sets properties of the vault. /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] public VaultProperties Properties {get; set; } + /// + /// Gets or sets identity for the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "identity")] + public IdentityData Identity {get; set; } + /// /// Gets or sets identifies the unique system identifier for each Azure /// resource. @@ -91,10 +93,10 @@ public Vault() public Sku Sku {get; set; } /// - /// Gets metadata pertaining to creation and last modification of the resource. + /// Gets or sets etag for the resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "systemData")] - public SystemData SystemData {get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; set; } /// /// Validate the object. /// @@ -104,11 +106,11 @@ public Vault() public override void Validate() { base.Validate(); + if (this.Identity != null) { this.Identity.Validate(); } - if (this.Sku != null) { this.Sku.Validate(); diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/VaultCertificateResponse.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/VaultCertificateResponse.cs index f9f89867122b..2cb89848ddd8 100644 --- a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/VaultCertificateResponse.cs +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/VaultCertificateResponse.cs @@ -11,7 +11,7 @@ namespace Microsoft.Azure.Management.RecoveryServices.Models /// Certificate corresponding to a vault that can be used by clients to /// register themselves with the vault. /// - public partial class VaultCertificateResponse : Microsoft.Rest.Azure.IResource + public partial class VaultCertificateResponse { /// /// Initializes a new instance of the VaultCertificateResponse class. diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/VaultExtendedInfoResource.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/VaultExtendedInfoResource.cs index a1093b5575ee..3c0e217d7a88 100644 --- a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/VaultExtendedInfoResource.cs +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/VaultExtendedInfoResource.cs @@ -11,7 +11,7 @@ namespace Microsoft.Azure.Management.RecoveryServices.Models /// Vault extended information. /// [Microsoft.Rest.Serialization.JsonTransformation] - public partial class VaultExtendedInfoResource : Resource + public partial class VaultExtendedInfoResource : ProxyResource { /// /// Initializes a new instance of the VaultExtendedInfoResource class. @@ -25,17 +25,22 @@ public VaultExtendedInfoResource() /// Initializes a new instance of the VaultExtendedInfoResource class. /// - /// Resource Id represents the complete path to the resource. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// - /// Resource name associated with the resource. + /// The name of the resource /// - /// Resource type represents the complete path of the form - /// Namespace/ResourceType/ResourceType/... + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// - /// Optional ETag. + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. + /// + + /// etag for the resource. /// /// Integrity key. @@ -49,10 +54,11 @@ public VaultExtendedInfoResource() /// Algorithm for Vault ExtendedInfo /// - public VaultExtendedInfoResource(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string integrityKey = default(string), string encryptionKey = default(string), string encryptionKeyThumbprint = default(string), string algorithm = default(string)) + public VaultExtendedInfoResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string etag = default(string), string integrityKey = default(string), string encryptionKey = default(string), string encryptionKeyThumbprint = default(string), string algorithm = default(string)) - : base(id, name, type, etag) + : base(id, name, type, systemData) { + this.Etag = etag; this.IntegrityKey = integrityKey; this.EncryptionKey = encryptionKey; this.EncryptionKeyThumbprint = encryptionKeyThumbprint; @@ -66,6 +72,12 @@ public VaultExtendedInfoResource() partial void CustomInit(); + /// + /// Gets or sets etag for the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; set; } + /// /// Gets or sets integrity key. /// diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/VaultsCreateOrUpdateHeaders.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/VaultsCreateOrUpdateHeaders.cs new file mode 100644 index 000000000000..5406f52a856c --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/VaultsCreateOrUpdateHeaders.cs @@ -0,0 +1,55 @@ +// 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.RecoveryServices.Models +{ + using System.Linq; + + public partial class VaultsCreateOrUpdateHeaders + { + /// + /// Initializes a new instance of the VaultsCreateOrUpdateHeaders class. + /// + public VaultsCreateOrUpdateHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VaultsCreateOrUpdateHeaders class. + /// + + /// + /// + + /// + /// + public VaultsCreateOrUpdateHeaders(string location = default(string), int? retryAfter = default(int?)) + + { + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/VaultsDeleteHeaders.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/VaultsDeleteHeaders.cs index 184e523ec867..a7d35513eacc 100644 --- a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/VaultsDeleteHeaders.cs +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/VaultsDeleteHeaders.cs @@ -23,10 +23,14 @@ public VaultsDeleteHeaders() /// /// - public VaultsDeleteHeaders(string location = default(string)) + + /// + /// + public VaultsDeleteHeaders(string location = default(string), int? retryAfter = default(int?)) { this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -41,5 +45,11 @@ public VaultsDeleteHeaders() /// [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/VaultsUpdateHeaders.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/VaultsUpdateHeaders.cs new file mode 100644 index 000000000000..893167edfffd --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Models/VaultsUpdateHeaders.cs @@ -0,0 +1,55 @@ +// 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.RecoveryServices.Models +{ + using System.Linq; + + public partial class VaultsUpdateHeaders + { + /// + /// Initializes a new instance of the VaultsUpdateHeaders class. + /// + public VaultsUpdateHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VaultsUpdateHeaders class. + /// + + /// + /// + + /// + /// + public VaultsUpdateHeaders(string location = default(string), int? retryAfter = default(int?)) + + { + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Operations.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Operations.cs index 0f9cfc49f92f..d7a3f152e4b0 100644 --- a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Operations.cs +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/Operations.cs @@ -39,7 +39,7 @@ internal Operations (RecoveryServicesClient client) public RecoveryServicesClient Client { get; private set; } /// - /// Returns the list of available operations. + /// List the operations for the provider /// /// /// Headers that will be added to request. @@ -155,14 +155,13 @@ internal Operations (RecoveryServicesClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudErrorRecoveryServiceException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudErrorRecoveryService _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -172,10 +171,6 @@ internal Operations (RecoveryServicesClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -202,7 +197,7 @@ internal Operations (RecoveryServicesClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -226,7 +221,7 @@ internal Operations (RecoveryServicesClient client) } /// - /// Returns the list of available operations. + /// List the operations for the provider /// /// /// The NextLink from the previous successful call to List operation. @@ -337,14 +332,13 @@ internal Operations (RecoveryServicesClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudErrorRecoveryServiceException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudErrorRecoveryService _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -354,10 +348,6 @@ internal Operations (RecoveryServicesClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -384,7 +374,7 @@ internal Operations (RecoveryServicesClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/OperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/OperationsExtensions.cs index 30a0baf535a2..fa3f3c3e6fb7 100644 --- a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/OperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/OperationsExtensions.cs @@ -13,7 +13,7 @@ namespace Microsoft.Azure.Management.RecoveryServices public static partial class OperationsExtensions { /// - /// Returns the list of available operations. + /// List the operations for the provider /// /// /// The operations group for this extension method. @@ -24,7 +24,7 @@ public static Microsoft.Rest.Azure.IPage List( } /// - /// Returns the list of available operations. + /// List the operations for the provider /// /// /// The operations group for this extension method. @@ -40,7 +40,7 @@ public static Microsoft.Rest.Azure.IPage List( } } /// - /// Returns the list of available operations. + /// List the operations for the provider /// /// /// The operations group for this extension method. @@ -54,7 +54,7 @@ public static Microsoft.Rest.Azure.IPage ListN } /// - /// Returns the list of available operations. + /// List the operations for the provider /// /// /// The operations group for this extension method. diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/PrivateLinkResourcesOperations.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/PrivateLinkResourcesOperations.cs index 50580510f7d4..ed68e3c1c9e9 100644 --- a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/PrivateLinkResourcesOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/PrivateLinkResourcesOperations.cs @@ -75,6 +75,11 @@ internal PrivateLinkResourcesOperations (RecoveryServicesClient client) + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -106,11 +111,6 @@ internal PrivateLinkResourcesOperations (RecoveryServicesClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -198,14 +198,13 @@ internal PrivateLinkResourcesOperations (RecoveryServicesClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudErrorRecoveryServiceException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudErrorRecoveryService _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -215,10 +214,6 @@ internal PrivateLinkResourcesOperations (RecoveryServicesClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -245,7 +240,7 @@ internal PrivateLinkResourcesOperations (RecoveryServicesClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -308,6 +303,11 @@ internal PrivateLinkResourcesOperations (RecoveryServicesClient client) + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -339,11 +339,6 @@ internal PrivateLinkResourcesOperations (RecoveryServicesClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (privateLinkResourceName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "privateLinkResourceName"); @@ -438,14 +433,13 @@ internal PrivateLinkResourcesOperations (RecoveryServicesClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudErrorRecoveryServiceException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudErrorRecoveryService _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -455,10 +449,6 @@ internal PrivateLinkResourcesOperations (RecoveryServicesClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -621,14 +611,13 @@ internal PrivateLinkResourcesOperations (RecoveryServicesClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudErrorRecoveryServiceException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudErrorRecoveryService _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -638,10 +627,6 @@ internal PrivateLinkResourcesOperations (RecoveryServicesClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -668,7 +653,7 @@ internal PrivateLinkResourcesOperations (RecoveryServicesClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/RecoveryServicesClient.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/RecoveryServicesClient.cs index 3b4098b5500d..1969a40c6054 100644 --- a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/RecoveryServicesClient.cs +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/RecoveryServicesClient.cs @@ -10,6 +10,9 @@ namespace Microsoft.Azure.Management.RecoveryServices using Microsoft.Rest.Azure; using Models; + /// + /// Recovery Services Client + /// public partial class RecoveryServicesClient : Microsoft.Rest.ServiceClient, IRecoveryServicesClient, IAzureClient { /// @@ -58,38 +61,42 @@ public partial class RecoveryServicesClient : Microsoft.Rest.ServiceClient - /// Gets the IVaultCertificatesOperations - /// - public virtual IVaultCertificatesOperations VaultCertificates { get; private set; } - /// - /// Gets the IRegisteredIdentitiesOperations - /// - public virtual IRegisteredIdentitiesOperations RegisteredIdentities { get; private set; } - /// - /// Gets the IReplicationUsagesOperations - /// - public virtual IReplicationUsagesOperations ReplicationUsages { get; private set; } - /// - /// Gets the IPrivateLinkResourcesOperations + /// Gets the IOperations /// - public virtual IPrivateLinkResourcesOperations PrivateLinkResources { get; private set; } + public virtual IOperations Operations { get; private set; } /// /// Gets the IRecoveryServicesOperations /// public virtual IRecoveryServicesOperations RecoveryServices { get; private set; } /// + /// Gets the IDeletedVaultsOperations + /// + public virtual IDeletedVaultsOperations DeletedVaults { get; private set; } + /// /// Gets the IVaultsOperations /// public virtual IVaultsOperations Vaults { get; private set; } /// - /// Gets the IOperations + /// Gets the IVaultCertificatesOperations /// - public virtual IOperations Operations { get; private set; } + public virtual IVaultCertificatesOperations VaultCertificates { get; private set; } /// /// Gets the IVaultExtendedInfoOperations /// public virtual IVaultExtendedInfoOperations VaultExtendedInfo { get; private set; } /// + /// Gets the IPrivateLinkResourcesOperations + /// + public virtual IPrivateLinkResourcesOperations PrivateLinkResources { get; private set; } + /// + /// Gets the IRegisteredIdentitiesOperations + /// + public virtual IRegisteredIdentitiesOperations RegisteredIdentities { get; private set; } + /// + /// Gets the IReplicationUsagesOperations + /// + public virtual IReplicationUsagesOperations ReplicationUsages { get; private set; } + /// /// Gets the IUsagesOperations /// public virtual IUsagesOperations Usages { get; private set; } @@ -297,6 +304,9 @@ public RecoveryServicesClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCr /// /// Optional. The http client handler used to handle http transport. /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// /// /// Thrown when a required parameter is null /// @@ -328,17 +338,18 @@ public RecoveryServicesClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCr /// private void Initialize() { - this.VaultCertificates = new VaultCertificatesOperations(this); - this.RegisteredIdentities = new RegisteredIdentitiesOperations(this); - this.ReplicationUsages = new ReplicationUsagesOperations(this); - this.PrivateLinkResources = new PrivateLinkResourcesOperations(this); + this.Operations = new Operations(this); this.RecoveryServices = new RecoveryServicesOperations(this); + this.DeletedVaults = new DeletedVaultsOperations(this); this.Vaults = new VaultsOperations(this); - this.Operations = new Operations(this); + this.VaultCertificates = new VaultCertificatesOperations(this); this.VaultExtendedInfo = new VaultExtendedInfoOperations(this); + this.PrivateLinkResources = new PrivateLinkResourcesOperations(this); + this.RegisteredIdentities = new RegisteredIdentitiesOperations(this); + this.ReplicationUsages = new ReplicationUsagesOperations(this); this.Usages = new UsagesOperations(this); this.BaseUri = new System.Uri("https://management.azure.com"); - this.ApiVersion = "2024-04-01"; + this.ApiVersion = "2025-08-01"; this.AcceptLanguage = "en-US"; this.LongRunningOperationRetryTimeout = 30; this.GenerateClientRequestId = true; @@ -375,16 +386,16 @@ private void Initialize() DeserializationSettings.Converters.Add(new Microsoft.Rest.Azure.CloudErrorJsonConverter()); } /// - /// Gets the operation status for a resource. + /// Gets the operation result for a resource. /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. + /// The name of the Vault /// /// - /// + /// The name of the Vault /// /// /// Headers that will be added to request. @@ -407,12 +418,17 @@ private void Initialize() /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetOperationStatusWithHttpMessagesAsync(string resourceGroupName, string vaultName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetOperationResultWithHttpMessagesAsync(string resourceGroupName, string vaultName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (this.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.ApiVersion"); + } + if (this.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.SubscriptionId"); @@ -449,11 +465,6 @@ private void Initialize() throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "operationId"); } - if (this.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.ApiVersion"); - } - // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -467,12 +478,12 @@ private void Initialize() tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetOperationStatus", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetOperationResult", tracingParameters); } // Construct URL var _baseUrl = this.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/operationStatus/{operationId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/operationResults/{operationId}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); @@ -541,16 +552,15 @@ private void Initialize() cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudErrorRecoveryServiceException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); + CloudErrorRecoveryService _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -560,10 +570,6 @@ private void Initialize() } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -576,7 +582,7 @@ private void Initialize() throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -590,7 +596,7 @@ private void Initialize() _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -614,7 +620,7 @@ private void Initialize() } /// - /// Gets the operation result for a resource. + /// Gets the operation status for a resource. /// /// /// The name of the resource group. The name is case insensitive. @@ -646,12 +652,17 @@ private void Initialize() /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetOperationResultWithHttpMessagesAsync(string resourceGroupName, string vaultName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetOperationStatusWithHttpMessagesAsync(string resourceGroupName, string vaultName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (this.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.ApiVersion"); + } + if (this.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.SubscriptionId"); @@ -688,11 +699,6 @@ private void Initialize() throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "operationId"); } - if (this.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.ApiVersion"); - } - // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -706,12 +712,12 @@ private void Initialize() tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetOperationResult", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetOperationStatus", tracingParameters); } // Construct URL var _baseUrl = this.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/operationResults/{operationId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/operationStatus/{operationId}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); @@ -780,16 +786,15 @@ private void Initialize() cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudErrorRecoveryServiceException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); + CloudErrorRecoveryService _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -799,10 +804,6 @@ private void Initialize() } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -815,7 +816,7 @@ private void Initialize() throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -829,7 +830,7 @@ private void Initialize() _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/RecoveryServicesClientExtensions.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/RecoveryServicesClientExtensions.cs index d78107139c27..babc20ffd40b 100644 --- a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/RecoveryServicesClientExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/RecoveryServicesClientExtensions.cs @@ -13,7 +13,7 @@ namespace Microsoft.Azure.Management.RecoveryServices public static partial class RecoveryServicesClientExtensions { /// - /// Gets the operation status for a resource. + /// Gets the operation result for a resource. /// /// /// The operations group for this extension method. @@ -22,18 +22,18 @@ public static partial class RecoveryServicesClientExtensions /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. + /// The name of the Vault /// /// - /// + /// The name of the Vault /// - public static OperationResource GetOperationStatus(this IRecoveryServicesClient operations, string resourceGroupName, string vaultName, string operationId) + public static Vault GetOperationResult(this IRecoveryServicesClient operations, string resourceGroupName, string vaultName, string operationId) { - return ((IRecoveryServicesClient)operations).GetOperationStatusAsync(resourceGroupName, vaultName, operationId).GetAwaiter().GetResult(); + return ((IRecoveryServicesClient)operations).GetOperationResultAsync(resourceGroupName, vaultName, operationId).GetAwaiter().GetResult(); } /// - /// Gets the operation status for a resource. + /// Gets the operation result for a resource. /// /// /// The operations group for this extension method. @@ -42,23 +42,23 @@ public static OperationResource GetOperationStatus(this IRecoveryServicesClient /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. + /// The name of the Vault /// /// - /// + /// The name of the Vault /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetOperationStatusAsync(this IRecoveryServicesClient operations, string resourceGroupName, string vaultName, string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetOperationResultAsync(this IRecoveryServicesClient operations, string resourceGroupName, string vaultName, string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetOperationStatusWithHttpMessagesAsync(resourceGroupName, vaultName, operationId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetOperationResultWithHttpMessagesAsync(resourceGroupName, vaultName, operationId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets the operation result for a resource. + /// Gets the operation status for a resource. /// /// /// The operations group for this extension method. @@ -72,13 +72,13 @@ public static OperationResource GetOperationStatus(this IRecoveryServicesClient /// /// /// - public static Vault GetOperationResult(this IRecoveryServicesClient operations, string resourceGroupName, string vaultName, string operationId) + public static OperationResource GetOperationStatus(this IRecoveryServicesClient operations, string resourceGroupName, string vaultName, string operationId) { - return ((IRecoveryServicesClient)operations).GetOperationResultAsync(resourceGroupName, vaultName, operationId).GetAwaiter().GetResult(); + return ((IRecoveryServicesClient)operations).GetOperationStatusAsync(resourceGroupName, vaultName, operationId).GetAwaiter().GetResult(); } /// - /// Gets the operation result for a resource. + /// Gets the operation status for a resource. /// /// /// The operations group for this extension method. @@ -95,9 +95,9 @@ public static Vault GetOperationResult(this IRecoveryServicesClient operations, /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetOperationResultAsync(this IRecoveryServicesClient operations, string resourceGroupName, string vaultName, string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetOperationStatusAsync(this IRecoveryServicesClient operations, string resourceGroupName, string vaultName, string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetOperationResultWithHttpMessagesAsync(resourceGroupName, vaultName, operationId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetOperationStatusWithHttpMessagesAsync(resourceGroupName, vaultName, operationId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/RecoveryServicesOperations.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/RecoveryServicesOperations.cs index 7550237ac1b5..fcf9e114b97c 100644 --- a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/RecoveryServicesOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/RecoveryServicesOperations.cs @@ -39,23 +39,17 @@ internal RecoveryServicesOperations (RecoveryServicesClient client) public RecoveryServicesClient Client { get; private set; } /// - /// API to check for resource name availability. - /// A name is available if no other resource exists that has the same - /// SubscriptionId, Resource Name and Type - /// or if one or more such resources exist, each of these must be GC'd and - /// their time of deletion be more than 24 Hours Ago + /// API to get details about capabilities provided by + /// Microsoft.RecoveryServices RP /// - /// - /// The name of the resource group. The name is case insensitive. - /// /// - /// Location of the resource + /// The location of the resource. /// /// /// Describes the Resource type: Microsoft.RecoveryServices/Vaults /// - /// - /// Resource name for which availability needs to be checked + /// + /// Capabilities information /// /// /// Headers that will be added to request. @@ -78,12 +72,17 @@ internal RecoveryServicesOperations (RecoveryServicesClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> CheckNameAvailabilityWithHttpMessagesAsync(string resourceGroupName, string location, string type = default(string), string name = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> CapabilitiesWithHttpMessagesAsync(string location, string type, CapabilitiesProperties properties = default(CapabilitiesProperties), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -95,36 +94,16 @@ internal RecoveryServicesOperations (RecoveryServicesClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } - if (resourceGroupName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length > 90) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); - } - if (resourceGroupName.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); - } - } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (location == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } - CheckNameAvailabilityParameters input = new CheckNameAvailabilityParameters(); - if(type != null||name != null) + ResourceCapabilities input = new ResourceCapabilities(); + if(type != null||properties != null) { input.Type = type; - input.Name = name; + input.Properties = properties; } // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; @@ -133,20 +112,18 @@ internal RecoveryServicesOperations (RecoveryServicesClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("location", location); tracingParameters.Add("input", input); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CheckNameAvailability", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Capabilities", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/locations/{location}/checkNameAvailability").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{location}/capabilities").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); @@ -220,14 +197,13 @@ internal RecoveryServicesOperations (RecoveryServicesClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudErrorRecoveryServiceException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudErrorRecoveryService _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -237,10 +213,6 @@ internal RecoveryServicesOperations (RecoveryServicesClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -253,7 +225,7 @@ internal RecoveryServicesOperations (RecoveryServicesClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -267,7 +239,7 @@ internal RecoveryServicesOperations (RecoveryServicesClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -291,17 +263,23 @@ internal RecoveryServicesOperations (RecoveryServicesClient client) } /// - /// API to get details about capabilities provided by - /// Microsoft.RecoveryServices RP + /// API to check for resource name availability. + /// A name is available if no other resource exists that has the same + /// SubscriptionId, Resource Name and Type + /// or if one or more such resources exist, each of these must be GC'd and + /// their time of deletion be more than 24 Hours Ago /// + /// + /// The name of the resource group. The name is case insensitive. + /// /// - /// Location of the resource + /// The name of Azure region. /// /// /// Describes the Resource type: Microsoft.RecoveryServices/Vaults /// - /// - /// Capabilities information + /// + /// Resource name for which availability needs to be checked /// /// /// Headers that will be added to request. @@ -324,12 +302,17 @@ internal RecoveryServicesOperations (RecoveryServicesClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> CapabilitiesWithHttpMessagesAsync(string location, string type, CapabilitiesProperties properties = default(CapabilitiesProperties), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> CheckNameAvailabilityWithHttpMessagesAsync(string resourceGroupName, string location, string type = default(string), string name = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -341,21 +324,37 @@ internal RecoveryServicesOperations (RecoveryServicesClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } - if (this.Client.ApiVersion == null) + if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } } - if (location == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } - - ResourceCapabilities input = new ResourceCapabilities(); - if(type != null||properties != null) + if (location != null) + { + if (location.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "location", 1); + } + } + CheckNameAvailabilityParameters input = new CheckNameAvailabilityParameters(); + if(type != null||name != null) { input.Type = type; - input.Properties = properties; + input.Name = name; } // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; @@ -364,18 +363,20 @@ internal RecoveryServicesOperations (RecoveryServicesClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("location", location); tracingParameters.Add("input", input); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Capabilities", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CheckNameAvailability", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{location}/capabilities").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/locations/{location}/checkNameAvailability").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); @@ -449,14 +450,13 @@ internal RecoveryServicesOperations (RecoveryServicesClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudErrorRecoveryServiceException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudErrorRecoveryService _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -466,10 +466,6 @@ internal RecoveryServicesOperations (RecoveryServicesClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -482,7 +478,7 @@ internal RecoveryServicesOperations (RecoveryServicesClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -496,7 +492,7 @@ internal RecoveryServicesOperations (RecoveryServicesClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/RecoveryServicesOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/RecoveryServicesOperationsExtensions.cs index 8a5dc40fab45..4e3a1107ed09 100644 --- a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/RecoveryServicesOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/RecoveryServicesOperationsExtensions.cs @@ -13,83 +13,83 @@ namespace Microsoft.Azure.Management.RecoveryServices public static partial class RecoveryServicesOperationsExtensions { /// - /// API to check for resource name availability. - /// A name is available if no other resource exists that has the same - /// SubscriptionId, Resource Name and Type - /// or if one or more such resources exist, each of these must be GC'd and - /// their time of deletion be more than 24 Hours Ago + /// API to get details about capabilities provided by + /// Microsoft.RecoveryServices RP /// /// /// The operations group for this extension method. /// - /// - /// The name of the resource group. The name is case insensitive. - /// /// - /// Location of the resource + /// The location of the resource. /// - public static CheckNameAvailabilityResult CheckNameAvailability(this IRecoveryServicesOperations operations, string resourceGroupName, string location, string type = default(string), string name = default(string)) + public static CapabilitiesResponse Capabilities(this IRecoveryServicesOperations operations, string location, string type, CapabilitiesProperties properties = default(CapabilitiesProperties)) { - return ((IRecoveryServicesOperations)operations).CheckNameAvailabilityAsync(resourceGroupName, location, type, name).GetAwaiter().GetResult(); + return ((IRecoveryServicesOperations)operations).CapabilitiesAsync(location, type, properties).GetAwaiter().GetResult(); } /// - /// API to check for resource name availability. - /// A name is available if no other resource exists that has the same - /// SubscriptionId, Resource Name and Type - /// or if one or more such resources exist, each of these must be GC'd and - /// their time of deletion be more than 24 Hours Ago + /// API to get details about capabilities provided by + /// Microsoft.RecoveryServices RP /// /// /// The operations group for this extension method. /// - /// - /// The name of the resource group. The name is case insensitive. - /// /// - /// Location of the resource + /// The location of the resource. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CheckNameAvailabilityAsync(this IRecoveryServicesOperations operations, string resourceGroupName, string location, string type = default(string), string name = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task CapabilitiesAsync(this IRecoveryServicesOperations operations, string location, string type, CapabilitiesProperties properties = default(CapabilitiesProperties), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.CheckNameAvailabilityWithHttpMessagesAsync(resourceGroupName, location, type, name, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CapabilitiesWithHttpMessagesAsync(location, type, properties, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// API to get details about capabilities provided by - /// Microsoft.RecoveryServices RP + /// API to check for resource name availability. + /// A name is available if no other resource exists that has the same + /// SubscriptionId, Resource Name and Type + /// or if one or more such resources exist, each of these must be GC'd and + /// their time of deletion be more than 24 Hours Ago /// /// /// The operations group for this extension method. /// + /// + /// The name of the resource group. The name is case insensitive. + /// /// - /// Location of the resource + /// The name of Azure region. /// - public static CapabilitiesResponse Capabilities(this IRecoveryServicesOperations operations, string location, string type, CapabilitiesProperties properties = default(CapabilitiesProperties)) + public static CheckNameAvailabilityResult CheckNameAvailability(this IRecoveryServicesOperations operations, string resourceGroupName, string location, string type = default(string), string name = default(string)) { - return ((IRecoveryServicesOperations)operations).CapabilitiesAsync(location, type, properties).GetAwaiter().GetResult(); + return ((IRecoveryServicesOperations)operations).CheckNameAvailabilityAsync(resourceGroupName, location, type, name).GetAwaiter().GetResult(); } /// - /// API to get details about capabilities provided by - /// Microsoft.RecoveryServices RP + /// API to check for resource name availability. + /// A name is available if no other resource exists that has the same + /// SubscriptionId, Resource Name and Type + /// or if one or more such resources exist, each of these must be GC'd and + /// their time of deletion be more than 24 Hours Ago /// /// /// The operations group for this extension method. /// + /// + /// The name of the resource group. The name is case insensitive. + /// /// - /// Location of the resource + /// The name of Azure region. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CapabilitiesAsync(this IRecoveryServicesOperations operations, string location, string type, CapabilitiesProperties properties = default(CapabilitiesProperties), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task CheckNameAvailabilityAsync(this IRecoveryServicesOperations operations, string resourceGroupName, string location, string type = default(string), string name = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.CapabilitiesWithHttpMessagesAsync(location, type, properties, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CheckNameAvailabilityWithHttpMessagesAsync(resourceGroupName, location, type, name, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/RegisteredIdentitiesOperations.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/RegisteredIdentitiesOperations.cs index b41036069cb1..d6118a720200 100644 --- a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/RegisteredIdentitiesOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/RegisteredIdentitiesOperations.cs @@ -74,6 +74,11 @@ internal RegisteredIdentitiesOperations (RecoveryServicesClient client) + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -85,11 +90,6 @@ internal RegisteredIdentitiesOperations (RecoveryServicesClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -133,7 +133,7 @@ internal RegisteredIdentitiesOperations (RecoveryServicesClient client) // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/registeredIdentities/{identityName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/registeredIdentities/{identityName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); @@ -204,14 +204,13 @@ internal RegisteredIdentitiesOperations (RecoveryServicesClient client) if ((int)_statusCode != 204) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -221,10 +220,6 @@ internal RegisteredIdentitiesOperations (RecoveryServicesClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/ReplicationUsagesOperations.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/ReplicationUsagesOperations.cs index 0e18d6a96ad1..237e4fc808f0 100644 --- a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/ReplicationUsagesOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/ReplicationUsagesOperations.cs @@ -45,7 +45,7 @@ internal ReplicationUsagesOperations (RecoveryServicesClient client) /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. + /// The name of the Vault /// /// /// Headers that will be added to request. @@ -68,12 +68,17 @@ internal ReplicationUsagesOperations (RecoveryServicesClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string vaultName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string vaultName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -85,11 +90,6 @@ internal ReplicationUsagesOperations (RecoveryServicesClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -127,7 +127,7 @@ internal ReplicationUsagesOperations (RecoveryServicesClient client) // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/replicationUsages").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/replicationUsages").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); @@ -197,14 +197,13 @@ internal ReplicationUsagesOperations (RecoveryServicesClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -214,10 +213,183 @@ internal ReplicationUsagesOperations (RecoveryServicesClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Fetches the replication usages of the vault. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + } + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + // Serialize Request + string _requestContent = null; + // Set Credentials + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -230,7 +402,7 @@ internal ReplicationUsagesOperations (RecoveryServicesClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/ReplicationUsagesOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/ReplicationUsagesOperationsExtensions.cs index f273f24d1476..00933e39fd7d 100644 --- a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/ReplicationUsagesOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/ReplicationUsagesOperationsExtensions.cs @@ -22,9 +22,9 @@ public static partial class ReplicationUsagesOperationsExtensions /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. + /// The name of the Vault /// - public static System.Collections.Generic.IEnumerable List(this IReplicationUsagesOperations operations, string resourceGroupName, string vaultName) + public static Microsoft.Rest.Azure.IPage List(this IReplicationUsagesOperations operations, string resourceGroupName, string vaultName) { return ((IReplicationUsagesOperations)operations).ListAsync(resourceGroupName, vaultName).GetAwaiter().GetResult(); } @@ -39,17 +39,50 @@ public static System.Collections.Generic.IEnumerable List(this /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. + /// The name of the Vault /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListAsync(this IReplicationUsagesOperations operations, string resourceGroupName, string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListAsync(this IReplicationUsagesOperations operations, string resourceGroupName, string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, vaultName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } + /// + /// Fetches the replication usages of the vault. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IReplicationUsagesOperations operations, string nextPageLink) + { + return ((IReplicationUsagesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Fetches the replication usages of the vault. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IReplicationUsagesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/UsagesOperations.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/UsagesOperations.cs index 255e02a005f6..38db0ebcb3a8 100644 --- a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/UsagesOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/UsagesOperations.cs @@ -45,7 +45,7 @@ internal UsagesOperations (RecoveryServicesClient client) /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. + /// The name of the Vault /// /// /// Headers that will be added to request. @@ -68,12 +68,17 @@ internal UsagesOperations (RecoveryServicesClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListByVaultsWithHttpMessagesAsync(string resourceGroupName, string vaultName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListByVaultsWithHttpMessagesAsync(string resourceGroupName, string vaultName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -85,11 +90,6 @@ internal UsagesOperations (RecoveryServicesClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -127,7 +127,7 @@ internal UsagesOperations (RecoveryServicesClient client) // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/usages").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/usages").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); @@ -197,14 +197,13 @@ internal UsagesOperations (RecoveryServicesClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -214,10 +213,183 @@ internal UsagesOperations (RecoveryServicesClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Fetches the usages of the vault. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async System.Threading.Tasks.Task>> ListByVaultsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByVaultsNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + } + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + // Serialize Request + string _requestContent = null; + // Set Credentials + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -230,7 +402,7 @@ internal UsagesOperations (RecoveryServicesClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/UsagesOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/UsagesOperationsExtensions.cs index 86f8434da03e..099098428e83 100644 --- a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/UsagesOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/UsagesOperationsExtensions.cs @@ -22,9 +22,9 @@ public static partial class UsagesOperationsExtensions /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. + /// The name of the Vault /// - public static System.Collections.Generic.IEnumerable ListByVaults(this IUsagesOperations operations, string resourceGroupName, string vaultName) + public static Microsoft.Rest.Azure.IPage ListByVaults(this IUsagesOperations operations, string resourceGroupName, string vaultName) { return ((IUsagesOperations)operations).ListByVaultsAsync(resourceGroupName, vaultName).GetAwaiter().GetResult(); } @@ -39,17 +39,50 @@ public static System.Collections.Generic.IEnumerable ListByVaults(th /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. + /// The name of the Vault /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListByVaultsAsync(this IUsagesOperations operations, string resourceGroupName, string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListByVaultsAsync(this IUsagesOperations operations, string resourceGroupName, string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListByVaultsWithHttpMessagesAsync(resourceGroupName, vaultName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } + /// + /// Fetches the usages of the vault. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByVaultsNext(this IUsagesOperations operations, string nextPageLink) + { + return ((IUsagesOperations)operations).ListByVaultsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Fetches the usages of the vault. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByVaultsNextAsync(this IUsagesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByVaultsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/VaultCertificatesOperations.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/VaultCertificatesOperations.cs index 7bd722923c95..e57603116c26 100644 --- a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/VaultCertificatesOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/VaultCertificatesOperations.cs @@ -80,6 +80,11 @@ internal VaultCertificatesOperations (RecoveryServicesClient client) + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -91,11 +96,6 @@ internal VaultCertificatesOperations (RecoveryServicesClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -145,7 +145,7 @@ internal VaultCertificatesOperations (RecoveryServicesClient client) // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/certificates/{certificateName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/certificates/{certificateName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); @@ -222,14 +222,13 @@ internal VaultCertificatesOperations (RecoveryServicesClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -239,10 +238,6 @@ internal VaultCertificatesOperations (RecoveryServicesClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/VaultExtendedInfoOperations.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/VaultExtendedInfoOperations.cs index 47d69d517bf7..7d9076069905 100644 --- a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/VaultExtendedInfoOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/VaultExtendedInfoOperations.cs @@ -74,6 +74,11 @@ internal VaultExtendedInfoOperations (RecoveryServicesClient client) + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -85,11 +90,6 @@ internal VaultExtendedInfoOperations (RecoveryServicesClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -197,14 +197,13 @@ internal VaultExtendedInfoOperations (RecoveryServicesClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudErrorRecoveryServiceException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudErrorRecoveryService _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -214,10 +213,6 @@ internal VaultExtendedInfoOperations (RecoveryServicesClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -311,6 +306,11 @@ internal VaultExtendedInfoOperations (RecoveryServicesClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceExtendedInfoDetails"); } + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -342,11 +342,6 @@ internal VaultExtendedInfoOperations (RecoveryServicesClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -441,14 +436,13 @@ internal VaultExtendedInfoOperations (RecoveryServicesClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudErrorRecoveryServiceException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudErrorRecoveryService _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -458,10 +452,6 @@ internal VaultExtendedInfoOperations (RecoveryServicesClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -554,6 +544,11 @@ internal VaultExtendedInfoOperations (RecoveryServicesClient client) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceExtendedInfoDetails"); } + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -585,11 +580,6 @@ internal VaultExtendedInfoOperations (RecoveryServicesClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -684,14 +674,13 @@ internal VaultExtendedInfoOperations (RecoveryServicesClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudErrorRecoveryServiceException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudErrorRecoveryService _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -701,10 +690,6 @@ internal VaultExtendedInfoOperations (RecoveryServicesClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/VaultsOperations.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/VaultsOperations.cs index 2e1c814a6666..f1e5605183d4 100644 --- a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/VaultsOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/VaultsOperations.cs @@ -68,6 +68,11 @@ internal VaultsOperations (RecoveryServicesClient client) + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -79,11 +84,6 @@ internal VaultsOperations (RecoveryServicesClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -167,14 +167,13 @@ internal VaultsOperations (RecoveryServicesClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudErrorRecoveryServiceException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudErrorRecoveryService _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -184,10 +183,6 @@ internal VaultsOperations (RecoveryServicesClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -214,7 +209,7 @@ internal VaultsOperations (RecoveryServicesClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -270,6 +265,11 @@ internal VaultsOperations (RecoveryServicesClient client) + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -281,11 +281,6 @@ internal VaultsOperations (RecoveryServicesClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -386,14 +381,13 @@ internal VaultsOperations (RecoveryServicesClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudErrorRecoveryServiceException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudErrorRecoveryService _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -403,10 +397,6 @@ internal VaultsOperations (RecoveryServicesClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -433,7 +423,7 @@ internal VaultsOperations (RecoveryServicesClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -463,7 +453,7 @@ internal VaultsOperations (RecoveryServicesClient client) /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. + /// The name of the Vault /// /// /// Headers that will be added to request. @@ -492,6 +482,11 @@ internal VaultsOperations (RecoveryServicesClient client) + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -503,11 +498,6 @@ internal VaultsOperations (RecoveryServicesClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -615,14 +605,13 @@ internal VaultsOperations (RecoveryServicesClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudErrorRecoveryServiceException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudErrorRecoveryService _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -632,10 +621,6 @@ internal VaultsOperations (RecoveryServicesClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -692,7 +677,7 @@ internal VaultsOperations (RecoveryServicesClient client) /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. + /// The name of the Vault /// /// /// @@ -706,21 +691,27 @@ internal VaultsOperations (RecoveryServicesClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vaultName, Vault vault, string xMsAuthorizationAuxiliary = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vaultName, Vault vault, string xMsAuthorizationAuxiliary = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vaultName, vault, xMsAuthorizationAuxiliary, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vaultName, vault, xMsAuthorizationAuxiliary, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Deletes a vault. + /// Updates the vault. /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. + /// The name of the Vault + /// + /// + /// + /// + /// + /// Recovery Services Vault to be created. /// /// /// Headers that will be added to request. @@ -728,27 +719,21 @@ internal VaultsOperations (RecoveryServicesClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string vaultName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string vaultName, PatchVault vault, string xMsAuthorizationAuxiliary = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, vaultName, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, vaultName, vault, xMsAuthorizationAuxiliary, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Updates the vault. + /// Deletes a vault. /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. - /// - /// - /// - /// - /// - /// Recovery Services Vault to be created. + /// The name of the Vault /// /// /// Headers that will be added to request. @@ -756,11 +741,11 @@ internal VaultsOperations (RecoveryServicesClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string vaultName, PatchVault vault, string xMsAuthorizationAuxiliary = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string vaultName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, vaultName, vault, xMsAuthorizationAuxiliary, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, vaultName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -770,7 +755,7 @@ internal VaultsOperations (RecoveryServicesClient client) /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. + /// The name of the Vault /// /// /// @@ -799,7 +784,7 @@ internal VaultsOperations (RecoveryServicesClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vaultName, Vault vault, string xMsAuthorizationAuxiliary = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vaultName, Vault vault, string xMsAuthorizationAuxiliary = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -813,6 +798,11 @@ internal VaultsOperations (RecoveryServicesClient client) { vault.Validate(); } + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -824,11 +814,6 @@ internal VaultsOperations (RecoveryServicesClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -953,14 +938,13 @@ internal VaultsOperations (RecoveryServicesClient client) if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudErrorRecoveryServiceException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudErrorRecoveryService _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -970,10 +954,6 @@ internal VaultsOperations (RecoveryServicesClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -986,7 +966,7 @@ internal VaultsOperations (RecoveryServicesClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -1030,6 +1010,19 @@ internal VaultsOperations (RecoveryServicesClient client) throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -1042,13 +1035,19 @@ internal VaultsOperations (RecoveryServicesClient client) } /// - /// Deletes a vault. + /// Updates the vault. /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. + /// The name of the Vault + /// + /// + /// + /// + /// + /// Recovery Services Vault to be created. /// /// /// Headers that will be added to request. @@ -1059,6 +1058,9 @@ internal VaultsOperations (RecoveryServicesClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -1068,12 +1070,21 @@ internal VaultsOperations (RecoveryServicesClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vaultName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string vaultName, PatchVault vault, string xMsAuthorizationAuxiliary = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (vault == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vault"); + } + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -1085,11 +1096,6 @@ internal VaultsOperations (RecoveryServicesClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1110,6 +1116,7 @@ internal VaultsOperations (RecoveryServicesClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1119,10 +1126,12 @@ internal VaultsOperations (RecoveryServicesClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("xMsAuthorizationAuxiliary", xMsAuthorizationAuxiliary); + tracingParameters.Add("vault", vault); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL @@ -1144,7 +1153,7 @@ internal VaultsOperations (RecoveryServicesClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -1159,6 +1168,14 @@ internal VaultsOperations (RecoveryServicesClient client) } _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } + if (xMsAuthorizationAuxiliary != null) + { + if (_httpRequest.Headers.Contains("x-ms-authorization-auxiliary")) + { + _httpRequest.Headers.Remove("x-ms-authorization-auxiliary"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-authorization-auxiliary", xMsAuthorizationAuxiliary); + } if (customHeaders != null) { @@ -1173,6 +1190,12 @@ internal VaultsOperations (RecoveryServicesClient client) } // Serialize Request string _requestContent = null; + if(vault != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vault, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (this.Client.Credentials != null) { @@ -1195,13 +1218,13 @@ internal VaultsOperations (RecoveryServicesClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudErrorRecoveryServiceException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudErrorRecoveryService _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1225,7 +1248,7 @@ internal VaultsOperations (RecoveryServicesClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -1233,9 +1256,27 @@ internal VaultsOperations (RecoveryServicesClient client) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } catch (Newtonsoft.Json.JsonException ex) { @@ -1258,19 +1299,13 @@ internal VaultsOperations (RecoveryServicesClient client) } /// - /// Updates the vault. + /// Deletes a vault. /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. - /// - /// - /// - /// - /// - /// Recovery Services Vault to be created. + /// The name of the Vault /// /// /// Headers that will be added to request. @@ -1281,9 +1316,6 @@ internal VaultsOperations (RecoveryServicesClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -1293,16 +1325,17 @@ internal VaultsOperations (RecoveryServicesClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string vaultName, PatchVault vault, string xMsAuthorizationAuxiliary = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vaultName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (vault == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vault"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -1314,11 +1347,6 @@ internal VaultsOperations (RecoveryServicesClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1339,7 +1367,6 @@ internal VaultsOperations (RecoveryServicesClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } - // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1349,12 +1376,10 @@ internal VaultsOperations (RecoveryServicesClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vaultName", vaultName); - tracingParameters.Add("xMsAuthorizationAuxiliary", xMsAuthorizationAuxiliary); - tracingParameters.Add("vault", vault); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL @@ -1376,7 +1401,7 @@ internal VaultsOperations (RecoveryServicesClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -1391,14 +1416,6 @@ internal VaultsOperations (RecoveryServicesClient client) } _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (xMsAuthorizationAuxiliary != null) - { - if (_httpRequest.Headers.Contains("x-ms-authorization-auxiliary")) - { - _httpRequest.Headers.Remove("x-ms-authorization-auxiliary"); - } - _httpRequest.Headers.TryAddWithoutValidation("x-ms-authorization-auxiliary", xMsAuthorizationAuxiliary); - } if (customHeaders != null) { @@ -1413,12 +1430,6 @@ internal VaultsOperations (RecoveryServicesClient client) } // Serialize Request string _requestContent = null; - if(vault != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vault, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (this.Client.Credentials != null) { @@ -1441,16 +1452,15 @@ internal VaultsOperations (RecoveryServicesClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1460,10 +1470,6 @@ internal VaultsOperations (RecoveryServicesClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -1476,7 +1482,7 @@ internal VaultsOperations (RecoveryServicesClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -1484,23 +1490,18 @@ internal VaultsOperations (RecoveryServicesClient client) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) + try { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + _httpResponse.Dispose(); } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { @@ -1625,14 +1626,13 @@ internal VaultsOperations (RecoveryServicesClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudErrorRecoveryServiceException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudErrorRecoveryService _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1642,10 +1642,6 @@ internal VaultsOperations (RecoveryServicesClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -1672,7 +1668,7 @@ internal VaultsOperations (RecoveryServicesClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1807,14 +1803,13 @@ internal VaultsOperations (RecoveryServicesClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudErrorRecoveryServiceException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudErrorRecoveryService _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1824,10 +1819,6 @@ internal VaultsOperations (RecoveryServicesClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -1854,7 +1845,7 @@ internal VaultsOperations (RecoveryServicesClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/VaultsOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/VaultsOperationsExtensions.cs index e3d4b8e13744..2d528406b001 100644 --- a/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/VaultsOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/Generated/VaultsOperationsExtensions.cs @@ -82,7 +82,7 @@ public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this IVaults /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. + /// The name of the Vault /// public static Vault Get(this IVaultsOperations operations, string resourceGroupName, string vaultName) { @@ -99,7 +99,7 @@ public static Vault Get(this IVaultsOperations operations, string resourceGroupN /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. + /// The name of the Vault /// /// /// The cancellation token. @@ -121,7 +121,7 @@ public static Vault Get(this IVaultsOperations operations, string resourceGroupN /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. + /// The name of the Vault /// /// /// @@ -141,7 +141,7 @@ public static Vault Get(this IVaultsOperations operations, string resourceGroupN /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. + /// The name of the Vault /// /// /// @@ -157,7 +157,7 @@ public static Vault Get(this IVaultsOperations operations, string resourceGroupN } } /// - /// Deletes a vault. + /// Updates the vault. /// /// /// The operations group for this extension method. @@ -166,15 +166,18 @@ public static Vault Get(this IVaultsOperations operations, string resourceGroupN /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. + /// The name of the Vault /// - public static VaultsDeleteHeaders Delete(this IVaultsOperations operations, string resourceGroupName, string vaultName) + /// + /// + /// + public static Vault Update(this IVaultsOperations operations, string resourceGroupName, string vaultName, PatchVault vault, string xMsAuthorizationAuxiliary = default(string)) { - return ((IVaultsOperations)operations).DeleteAsync(resourceGroupName, vaultName).GetAwaiter().GetResult(); + return ((IVaultsOperations)operations).UpdateAsync(resourceGroupName, vaultName, vault, xMsAuthorizationAuxiliary).GetAwaiter().GetResult(); } /// - /// Deletes a vault. + /// Updates the vault. /// /// /// The operations group for this extension method. @@ -183,20 +186,23 @@ public static VaultsDeleteHeaders Delete(this IVaultsOperations operations, stri /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. + /// The name of the Vault + /// + /// + /// /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteAsync(this IVaultsOperations operations, string resourceGroupName, string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task UpdateAsync(this IVaultsOperations operations, string resourceGroupName, string vaultName, PatchVault vault, string xMsAuthorizationAuxiliary = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, vaultName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, vaultName, vault, xMsAuthorizationAuxiliary, null, cancellationToken).ConfigureAwait(false)) { - return _result.Headers; + return _result.Body; } } /// - /// Updates the vault. + /// Deletes a vault. /// /// /// The operations group for this extension method. @@ -205,18 +211,15 @@ public static VaultsDeleteHeaders Delete(this IVaultsOperations operations, stri /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. - /// - /// - /// + /// The name of the Vault /// - public static Vault Update(this IVaultsOperations operations, string resourceGroupName, string vaultName, PatchVault vault, string xMsAuthorizationAuxiliary = default(string)) + public static VaultsDeleteHeaders Delete(this IVaultsOperations operations, string resourceGroupName, string vaultName) { - return ((IVaultsOperations)operations).UpdateAsync(resourceGroupName, vaultName, vault, xMsAuthorizationAuxiliary).GetAwaiter().GetResult(); + return ((IVaultsOperations)operations).DeleteAsync(resourceGroupName, vaultName).GetAwaiter().GetResult(); } /// - /// Updates the vault. + /// Deletes a vault. /// /// /// The operations group for this extension method. @@ -225,19 +228,16 @@ public static VaultsDeleteHeaders Delete(this IVaultsOperations operations, stri /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. - /// - /// - /// + /// The name of the Vault /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task UpdateAsync(this IVaultsOperations operations, string resourceGroupName, string vaultName, PatchVault vault, string xMsAuthorizationAuxiliary = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task DeleteAsync(this IVaultsOperations operations, string resourceGroupName, string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, vaultName, vault, xMsAuthorizationAuxiliary, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, vaultName, null, cancellationToken).ConfigureAwait(false)) { - return _result.Body; + return _result.Headers; } } /// @@ -250,7 +250,7 @@ public static VaultsDeleteHeaders Delete(this IVaultsOperations operations, stri /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. + /// The name of the Vault /// /// /// @@ -270,7 +270,7 @@ public static VaultsDeleteHeaders Delete(this IVaultsOperations operations, stri /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. + /// The name of the Vault /// /// /// @@ -286,7 +286,7 @@ public static VaultsDeleteHeaders Delete(this IVaultsOperations operations, stri } } /// - /// Deletes a vault. + /// Updates the vault. /// /// /// The operations group for this extension method. @@ -295,15 +295,18 @@ public static VaultsDeleteHeaders Delete(this IVaultsOperations operations, stri /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. + /// The name of the Vault /// - public static VaultsDeleteHeaders BeginDelete(this IVaultsOperations operations, string resourceGroupName, string vaultName) + /// + /// + /// + public static Vault BeginUpdate(this IVaultsOperations operations, string resourceGroupName, string vaultName, PatchVault vault, string xMsAuthorizationAuxiliary = default(string)) { - return ((IVaultsOperations)operations).BeginDeleteAsync(resourceGroupName, vaultName).GetAwaiter().GetResult(); + return ((IVaultsOperations)operations).BeginUpdateAsync(resourceGroupName, vaultName, vault, xMsAuthorizationAuxiliary).GetAwaiter().GetResult(); } /// - /// Deletes a vault. + /// Updates the vault. /// /// /// The operations group for this extension method. @@ -312,20 +315,23 @@ public static VaultsDeleteHeaders BeginDelete(this IVaultsOperations operations, /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. + /// The name of the Vault + /// + /// + /// /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginDeleteAsync(this IVaultsOperations operations, string resourceGroupName, string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginUpdateAsync(this IVaultsOperations operations, string resourceGroupName, string vaultName, PatchVault vault, string xMsAuthorizationAuxiliary = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, vaultName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, vaultName, vault, xMsAuthorizationAuxiliary, null, cancellationToken).ConfigureAwait(false)) { - return _result.Headers; + return _result.Body; } } /// - /// Updates the vault. + /// Deletes a vault. /// /// /// The operations group for this extension method. @@ -334,18 +340,15 @@ public static VaultsDeleteHeaders BeginDelete(this IVaultsOperations operations, /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. - /// - /// - /// + /// The name of the Vault /// - public static Vault BeginUpdate(this IVaultsOperations operations, string resourceGroupName, string vaultName, PatchVault vault, string xMsAuthorizationAuxiliary = default(string)) + public static VaultsDeleteHeaders BeginDelete(this IVaultsOperations operations, string resourceGroupName, string vaultName) { - return ((IVaultsOperations)operations).BeginUpdateAsync(resourceGroupName, vaultName, vault, xMsAuthorizationAuxiliary).GetAwaiter().GetResult(); + return ((IVaultsOperations)operations).BeginDeleteAsync(resourceGroupName, vaultName).GetAwaiter().GetResult(); } /// - /// Updates the vault. + /// Deletes a vault. /// /// /// The operations group for this extension method. @@ -354,19 +357,16 @@ public static VaultsDeleteHeaders BeginDelete(this IVaultsOperations operations, /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. - /// - /// - /// + /// The name of the Vault /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginUpdateAsync(this IVaultsOperations operations, string resourceGroupName, string vaultName, PatchVault vault, string xMsAuthorizationAuxiliary = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IVaultsOperations operations, string resourceGroupName, string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, vaultName, vault, xMsAuthorizationAuxiliary, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, vaultName, null, cancellationToken).ConfigureAwait(false)) { - return _result.Body; + return _result.Headers; } } /// diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/README.md b/src/RecoveryServices/RecoveryServices.Management.Sdk/README.md index 99cb2557624f..be650182a168 100644 --- a/src/RecoveryServices/RecoveryServices.Management.Sdk/README.md +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/README.md @@ -23,14 +23,17 @@ payload-flattening-threshold: 2 ### ``` yaml -commit: 72f52bc8847a889488da885f40d6871a89e0470b +commit: 5db1734537e487a8e4f62947d520d6b5b040523a input-file: - - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/registeredidentities.json - - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/replicationusages.json - - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/vaults.json - - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/vaultusages.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/RecoveryServices/stable/2025-08-01/openapi.json output-folder: Generated namespace: Microsoft.Azure.Management.RecoveryServices + +directive: + - from: swagger-document + where: $.definitions["CloudError"] + transform: > + $["x-ms-client-name"] = "CloudErrorRecoveryService"; ``` \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Management.Sdk/RecoveryServices.Management.Sdk.sln b/src/RecoveryServices/RecoveryServices.Management.Sdk/RecoveryServices.Management.Sdk.sln new file mode 100644 index 000000000000..6549914be929 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Management.Sdk/RecoveryServices.Management.Sdk.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.2.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RecoveryServices.Management.Sdk", "RecoveryServices.Management.Sdk.csproj", "{2EE7D802-225C-4CC2-C061-BE5BD4326CB2}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {2EE7D802-225C-4CC2-C061-BE5BD4326CB2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2EE7D802-225C-4CC2-C061-BE5BD4326CB2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2EE7D802-225C-4CC2-C061-BE5BD4326CB2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2EE7D802-225C-4CC2-C061-BE5BD4326CB2}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {C03B258D-CDB7-40A7-A8C5-677908DA57EA} + EndGlobalSection +EndGlobal diff --git a/src/RecoveryServices/RecoveryServices.Test/ScenarioTests/RecoveryServicesTests.ps1 b/src/RecoveryServices/RecoveryServices.Test/ScenarioTests/RecoveryServicesTests.ps1 index 35b988705942..f992733acd14 100644 --- a/src/RecoveryServices/RecoveryServices.Test/ScenarioTests/RecoveryServicesTests.ps1 +++ b/src/RecoveryServices/RecoveryServices.Test/ScenarioTests/RecoveryServicesTests.ps1 @@ -168,3 +168,153 @@ function Test-GetRSVaultSettingsFile Cleanup-ResourceGroup $resourceGroupName } } + +<# +.SYNOPSIS +Recovery Services Soft Deleted Vault Tests - Delete, Get, and Undo deletion +#> +function Test-RecoveryServicesSoftDeletedVaultOperations +{ + $location = "centraluseuap" + $resourceGroupName = Create-ResourceGroup $location + $name = "PSTestRSV" + @(Get-RandomSuffix) + + try + { + # 1. Create a new Recovery Services Vault + $vault = New-AzRecoveryServicesVault -Name $name -ResourceGroupName $resourceGroupName -Location $location + + Assert-NotNull($vault.Name) + Assert-NotNull($vault.ID) + Assert-NotNull($vault.Type) + Assert-AreEqual $name $vault.Name + Assert-AreEqual $location $vault.Location + + # 2. Delete the vault (this will soft delete it) + Remove-AzRecoveryServicesVault -Vault $vault + + # Verify vault is no longer in active vaults list + $activeVaults = Get-AzRecoveryServicesVault -Name $name -ResourceGroupName $resourceGroupName + Assert-True { $activeVaults.Count -eq 0 } + + # 3. Get soft deleted vault + $softDeletedVaults = Get-AzRecoveryServicesSoftDeletedVault -Location $location + Assert-NotNull($softDeletedVaults) + Assert-True { $softDeletedVaults.Count -gt 0 } + + # Find our specific soft deleted vault + $targetSoftDeletedVault = $softDeletedVaults | Where-Object { + $_.Name -eq $name -and $_.ResourceGroupName -eq $resourceGroupName + } + + Assert-NotNull($targetSoftDeletedVault) + Assert-AreEqual $name $targetSoftDeletedVault.Name + Assert-AreEqual $location $targetSoftDeletedVault.Location + Assert-AreEqual $resourceGroupName $targetSoftDeletedVault.ResourceGroupName + Assert-NotNull($targetSoftDeletedVault.Properties.VaultId) + Assert-NotNull($targetSoftDeletedVault.Properties.VaultDeletionTime) + Assert-NotNull($targetSoftDeletedVault.Properties.PurgeAt) + + # 4. Get soft deleted vault by name + $specificSoftDeletedVault = Get-AzRecoveryServicesSoftDeletedVault -Location $location -Name $name + Assert-NotNull($specificSoftDeletedVault) + Assert-AreEqual $name $specificSoftDeletedVault.Name + Assert-AreEqual $location $specificSoftDeletedVault.Location + + # 5. Get soft deleted vault by resource group filter + $filteredSoftDeletedVaults = Get-AzRecoveryServicesSoftDeletedVault -Location $location -ResourceGroupName $resourceGroupName + Assert-NotNull($filteredSoftDeletedVaults) + $filteredTargetVault = $filteredSoftDeletedVaults | Where-Object { $_.Name -eq $name } + Assert-NotNull($filteredTargetVault) + + # 6. Undo vault deletion + $undoResult = Undo-AzRecoveryServicesVaultDeletion -ResourceGroupName $resourceGroupName -Name $name -Location $location + + Assert-NotNull($undoResult) + Assert-AreEqual $name $undoResult.Name + Assert-AreEqual $location $undoResult.Location + + # 7. Verify vault is restored and back in active vaults list + # Note: The restoration might take some time, so we may need to wait or poll + Start-Sleep -Seconds 30 # Wait for restoration to complete + + $restoredVaults = Get-AzRecoveryServicesVault -Name $name -ResourceGroupName $resourceGroupName + Assert-NotNull($restoredVaults) + Assert-True { $restoredVaults.Count -gt 0 } + + $restoredVault = $restoredVaults[0] + Assert-AreEqual $name $restoredVault.Name + Assert-AreEqual $location $restoredVault.Location + Assert-AreEqual $resourceGroupName $restoredVault.ResourceGroupName + + # 8. Verify soft deleted vault is no longer in soft deleted list + $remainingSoftDeletedVaults = Get-AzRecoveryServicesSoftDeletedVault -Location $location -Name $name + # After successful restoration, the vault should not be in soft deleted state + # This assertion might need adjustment based on actual API behavior + # Assert-Null($remainingSoftDeletedVaults) + + # Clean up the restored vault + Remove-AzRecoveryServicesVault -Vault $restoredVault + } + finally + { + Cleanup-ResourceGroup $resourceGroupName + } +} + +<# +.SYNOPSIS +Recovery Services Soft Deleted Vault Tests - Filter by existing vault pattern +#> +function Test-RecoveryServicesSoftDeletedVaultFiltering +{ + $location = "centraluseuap" + + try + { + # 1. Get all soft deleted vaults in the location + $allSoftDeletedVaults = Get-AzRecoveryServicesSoftDeletedVault -Location $location + + if ($allSoftDeletedVaults -ne $null -and $allSoftDeletedVaults.Count -gt 0) + { + Assert-True { $allSoftDeletedVaults.Count -gt 0 } + + foreach ($vault in $allSoftDeletedVaults) + { + Assert-NotNull($vault.Name) + Assert-NotNull($vault.Location) + Assert-AreEqual $location $vault.Location + Assert-NotNull($vault.Properties) + Assert-NotNull($vault.Properties.VaultId) + } + + # 2. Test filtering by vault name pattern (similar to your akkanaseTest23 example) + $filteredByPattern = $allSoftDeletedVaults | Where-Object { $_.Properties.VaultId -match "PSTestRSV" } + + # 3. Test resource group filtering + if ($allSoftDeletedVaults.Count -gt 0) + { + $firstVault = $allSoftDeletedVaults[0] + if ($firstVault.ResourceGroupName -ne $null) + { + $filteredByRG = Get-AzRecoveryServicesSoftDeletedVault -Location $location -ResourceGroupName $firstVault.ResourceGroupName + Assert-NotNull($filteredByRG) + + foreach ($vault in $filteredByRG) + { + Assert-AreEqual $firstVault.ResourceGroupName $vault.ResourceGroupName + } + } + } + } + else + { + Write-Warning "No soft deleted vaults found in location $location for filtering tests" + } + } + catch + { + Write-Warning "Soft deleted vault filtering test encountered an issue: $($_.Exception.Message)" + # Don't fail the test if there are no existing soft deleted vaults + } +} diff --git a/src/RecoveryServices/RecoveryServices.sln b/src/RecoveryServices/RecoveryServices.sln index f170da2aadc6..85578caebd89 100644 --- a/src/RecoveryServices/RecoveryServices.sln +++ b/src/RecoveryServices/RecoveryServices.sln @@ -67,6 +67,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestFx", "..\..\tools\TestF EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.Compute", "..\..\generated\Compute\Compute.Autorest\Az.Compute.csproj", "{F088516D-127C-4B07-9ACB-C636D3E121DD}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RecoveryServices.Helper", "RecoveryServices.Helper\RecoveryServices.Helper.csproj", "{91134B2C-68C4-1B02-F2D3-6B942FF713C6}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -192,6 +194,10 @@ Global {F088516D-127C-4B07-9ACB-C636D3E121DD}.Debug|Any CPU.Build.0 = Debug|Any CPU {F088516D-127C-4B07-9ACB-C636D3E121DD}.Release|Any CPU.ActiveCfg = Release|Any CPU {F088516D-127C-4B07-9ACB-C636D3E121DD}.Release|Any CPU.Build.0 = Release|Any CPU + {91134B2C-68C4-1B02-F2D3-6B942FF713C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {91134B2C-68C4-1B02-F2D3-6B942FF713C6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {91134B2C-68C4-1B02-F2D3-6B942FF713C6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {91134B2C-68C4-1B02-F2D3-6B942FF713C6}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(NestedProjects) = preSolution {34F69ECD-95B8-49DB-9D78-2B9D5C34D405} = {81B2982D-240C-47B0-9DB4-2D94D4DF8C6E} diff --git a/src/RecoveryServices/RecoveryServices/Az.RecoveryServices.psd1 b/src/RecoveryServices/RecoveryServices/Az.RecoveryServices.psd1 index 8f68afc462a2..e9049c558c85 100644 --- a/src/RecoveryServices/RecoveryServices/Az.RecoveryServices.psd1 +++ b/src/RecoveryServices/RecoveryServices/Az.RecoveryServices.psd1 @@ -67,6 +67,7 @@ RequiredAssemblies = 'Microsoft.Azure.PowerShell.AutoMapper.dll', 'Microsoft.Azure.PowerShell.RecoveryServices.Backup.Management.Sdk.dll', 'Microsoft.Azure.PowerShell.RecoveryServices.Management.Sdk.dll', 'Microsoft.Azure.PowerShell.RecoveryServices.SiteRecovery.Management.Sdk.dll', + 'Microsoft.Azure.PowerShell.RecoveryServices.Helper.dll', 'System.Configuration.ConfigurationManager.dll', 'TimeZoneConverter.dll' @@ -116,8 +117,8 @@ CmdletsToExport = 'Add-AzRecoveryServicesAsrReplicationProtectedItemDisk', 'Get-AzRecoveryServicesAsrVaultContext', 'Get-AzRecoveryServicesAsrvCenter', 'Get-AzRecoveryServicesBackupContainer', - 'Get-AzRecoveryServicesBackupItem', - 'Get-AzRecoveryServicesBackupJob', + 'Get-AzRecoveryServicesBackupItem', + 'Get-AzRecoveryServicesBackupJob', 'Get-AzRecoveryServicesBackupJobDetail', 'Get-AzRecoveryServicesBackupManagementServer', 'Get-AzRecoveryServicesBackupProperty', @@ -217,7 +218,10 @@ CmdletsToExport = 'Add-AzRecoveryServicesAsrReplicationProtectedItemDisk', 'Update-AzRecoveryServicesAsrServicesProvider', 'Update-AzRecoveryServicesAsrvCenter', 'Update-AzRecoveryServicesVault', - 'Wait-AzRecoveryServicesBackupJob' + 'Wait-AzRecoveryServicesBackupJob', + 'Get-AzRecoveryServicesSoftDeletedVault', + 'Get-AzRecoveryServicesSoftDeletedVaultBackupItem', + 'Undo-AzRecoveryServicesVaultDeletion' # Variables to export from this module # VariablesToExport = @() diff --git a/src/RecoveryServices/RecoveryServices/Common/PSRecoveryServicesClient.cs b/src/RecoveryServices/RecoveryServices/Common/PSRecoveryServicesClient.cs index 34bd496370cf..b09485444925 100644 --- a/src/RecoveryServices/RecoveryServices/Common/PSRecoveryServicesClient.cs +++ b/src/RecoveryServices/RecoveryServices/Common/PSRecoveryServicesClient.cs @@ -152,6 +152,29 @@ public static string GetSubscriptionId(string resourceId) return resourceId.Substring(startIndex, endIndex - startIndex); } + /// + /// Helper method to extract location from deleted vault ID + /// + /// Deleted vault resource ID + /// Location name + public static string GetLocationFromDeletedVaultId(string deletedVaultId) + { + if (string.IsNullOrEmpty(deletedVaultId)) + return string.Empty; + + // Pattern: /subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{location}/deletedVaults/{vaultName} + const string locations = "locations"; + var startIndex = deletedVaultId.IndexOf(locations, StringComparison.OrdinalIgnoreCase) + locations.Length + 1; + var endIndex = deletedVaultId.IndexOf("/", startIndex, StringComparison.OrdinalIgnoreCase); + + if (startIndex > locations.Length && endIndex > startIndex) + { + return deletedVaultId.Substring(startIndex, endIndex - startIndex); + } + + return string.Empty; + } + /// /// Gets request headers. /// diff --git a/src/RecoveryServices/RecoveryServices/Common/PSRecoveryServicesVaultClient.cs b/src/RecoveryServices/RecoveryServices/Common/PSRecoveryServicesVaultClient.cs index 77f03cf8c0a8..0cd93a44b527 100644 --- a/src/RecoveryServices/RecoveryServices/Common/PSRecoveryServicesVaultClient.cs +++ b/src/RecoveryServices/RecoveryServices/Common/PSRecoveryServicesVaultClient.cs @@ -204,5 +204,42 @@ public List ListResourceGuardMapping(string vaul return proxyList; } + + /// + /// Method to list soft deleted Azure Recovery Services Vaults by location + /// + /// Name of the Azure region + /// list of soft deleted vaults. + public List GetSoftDeletedVaultsByLocation(string location) + { + return GetRecoveryServicesClient.DeletedVaults.ListBySubscriptionIdWithHttpMessagesAsync( + location, GetRequestHeaders()).Result.Body.ToList(); + } + + /// + /// Method to get a specific soft deleted Azure Recovery Services Vault + /// + /// Name of the Azure region + /// Name of the deleted vault + /// soft deleted vault object. + public DeletedVault GetSoftDeletedVault(string location, string deletedVaultName) + { + return GetRecoveryServicesClient.DeletedVaults.GetWithHttpMessagesAsync( + location, deletedVaultName, GetRequestHeaders()).Result.Body; + } + + /// + /// Method to undelete a soft deleted Azure Recovery Services Vault + /// + /// Name of the Azure region + /// Name of the deleted vault + /// Recovery resource group ID + /// undeleted vault object. + public DeletedVault UndeleteSoftDeletedVault(string location, string deletedVaultName, string recoveryResourceGroupId) + { + var properties = new DeletedVaultUndeleteInputProperties(recoveryResourceGroupId); + return GetRecoveryServicesClient.DeletedVaults.UndeleteWithHttpMessagesAsync( + location, deletedVaultName, properties, GetRequestHeaders()).Result.Body; + } } } diff --git a/src/RecoveryServices/RecoveryServices/Models/PSObjects.cs b/src/RecoveryServices/RecoveryServices/Models/PSObjects.cs index fd0319db09c1..9a51a839efbc 100644 --- a/src/RecoveryServices/RecoveryServices/Models/PSObjects.cs +++ b/src/RecoveryServices/RecoveryServices/Models/PSObjects.cs @@ -583,4 +583,114 @@ public ASRSite() #endregion } + + /// + /// Azure Recovery Services Soft Deleted Vault object. + /// + public class ARSSoftDeletedVault + { + #region Constructor + + /// + /// Initializes a new instance of the class. + /// + public ARSSoftDeletedVault() + { + } + + /// + /// Initializes a new instance of the class. + /// + /// deleted vault object + public ARSSoftDeletedVault(DeletedVault deletedVault) + { + if(deletedVault != null) + { + this.ID = deletedVault.Id; + this.Name = deletedVault.Name; + this.Type = deletedVault.Type; + this.Location = PSRecoveryServicesClient.GetLocationFromDeletedVaultId(deletedVault.Id); + this.Properties = new ARSSoftDeletedVaultProperties(); + + if (deletedVault.Properties != null) + { + this.Properties.VaultId = deletedVault.Properties.VaultId; + this.Properties.VaultDeletionTime = deletedVault.Properties.VaultDeletionTime; + this.Properties.PurgeAt = deletedVault.Properties.PurgeAt; + + if (!string.IsNullOrEmpty(deletedVault.Properties.VaultId)) + { + this.ResourceGroupName = PSRecoveryServicesClient.GetResourceGroup(deletedVault.Properties.VaultId); + this.SubscriptionId = PSRecoveryServicesClient.GetSubscriptionId(deletedVault.Properties.VaultId); + } + } + } + } + + #endregion + + #region Properties + + /// + /// Gets or sets Vault name. + /// + public string Name { get; set; } + + /// + /// Gets or sets Vault ID. + /// + public string ID { get; set; } + + /// + /// Gets or sets type. + /// + public string Type { get; set; } + + /// + /// Gets or sets Resource group name. + /// + public string ResourceGroupName { get; set; } + + /// + /// Gets or sets Subscription. + /// + public string SubscriptionId { get; set; } + + /// + /// Gets or sets Location of the Recovery services vault. + /// + public string Location { get; set; } + + /// + /// Gets or sets Properties. + /// + public ARSSoftDeletedVaultProperties Properties { get; set; } + + #endregion + } + + /// + /// Azure Site Recovery Soft Deleted Vault properties. + /// + public class ARSSoftDeletedVaultProperties + { + #region Properties + + /// + /// Gets or sets the original vault ID. + /// + public string VaultId { get; set; } + + /// + /// Gets or sets vault deletion time. + /// + public DateTime? VaultDeletionTime { get; set; } + + /// + /// Gets or sets purge time. + /// + public DateTime? PurgeAt { get; set; } + + #endregion + } } diff --git a/src/RecoveryServices/RecoveryServices/Vault/GetAzureRmRecoveryServicesSoftDeletedVault.cs b/src/RecoveryServices/RecoveryServices/Vault/GetAzureRmRecoveryServicesSoftDeletedVault.cs new file mode 100644 index 000000000000..09dc21c3bb37 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices/Vault/GetAzureRmRecoveryServicesSoftDeletedVault.cs @@ -0,0 +1,145 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; +using Microsoft.Azure.Management.RecoveryServices.Models; +using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; + +namespace Microsoft.Azure.Commands.RecoveryServices +{ + /// + /// Retrieves Azure Recovery Services Soft Deleted Vaults. + /// + [Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "RecoveryServicesSoftDeletedVault")] + [OutputType(typeof(ARSSoftDeletedVault))] + public class GetAzureRmRecoveryServicesSoftDeletedVault : RecoveryServicesCmdletBase + { + #region Parameters + + /// + /// Gets or sets Resource Group name. + /// + [Parameter(Position = 1)] + [ResourceGroupCompleter] + public string ResourceGroupName { get; set; } + + /// + /// Gets or sets Resource Name (Vault Name). + /// + [Parameter(Position = 2)] + public string Name { get; set; } + + /// + /// Gets or sets Location. + /// + [Parameter(Position = 3, Mandatory = true)] + [LocationCompleter] + public string Location { get; set; } + + #endregion Parameters + + /// + /// ProcessRecord of the command. + /// + public override void ExecuteCmdlet() + { + try + { + if (string.IsNullOrEmpty(this.Name)) + { + this.GetSoftDeletedVaultsByLocation(); + } + else + { + this.GetSoftDeletedVaultByName(); + } + } + catch (Exception exception) + { + this.HandleException(exception); + } + } + + /// + /// Get soft deleted vaults by location. + /// + private void GetSoftDeletedVaultsByLocation() + { + List deletedVaults = RecoveryServicesClient.GetSoftDeletedVaultsByLocation(this.Location); + + if (!string.IsNullOrEmpty(this.ResourceGroupName)) + { + var filteredVaults = FilterVaultsByResourceGroup(deletedVaults, this.ResourceGroupName); + this.WriteSoftDeletedVaults(filteredVaults); + } + else + { + this.WriteSoftDeletedVaults(deletedVaults); + } + } + + /// + /// Get soft deleted vault by name. + /// + private void GetSoftDeletedVaultByName() + { + DeletedVault deletedVault = RecoveryServicesClient.GetSoftDeletedVault(this.Location, this.Name); + + if (!string.IsNullOrEmpty(this.ResourceGroupName) && deletedVault != null) + { + // Verify resource group matches if specified using the common filter function + var filteredVaults = FilterVaultsByResourceGroup(new List { deletedVault }, this.ResourceGroupName); + if (filteredVaults.Count == 0) + { + WriteDebug($"The soft deleted vault '{this.Name}' was found but does not belong to resource group '{this.ResourceGroupName}'."); + return; + } + deletedVault = filteredVaults.First(); + } + + this.WriteObject(new ARSSoftDeletedVault(deletedVault)); + } + + /// + /// Filters deleted vaults by resource group name. + /// + /// List of deleted vaults to filter + /// Resource group name to filter by + /// Filtered list of deleted vaults + private List FilterVaultsByResourceGroup(List deletedVaults, string resourceGroupName) + { + return deletedVaults.Where(v => + { + if (v.Properties?.VaultId != null) + { + var vaultResourceGroup = PSRecoveryServicesClient.GetResourceGroup(v.Properties.VaultId); + return string.Equals(vaultResourceGroup, resourceGroupName, StringComparison.OrdinalIgnoreCase); + } + return false; + }).ToList(); + } + + /// + /// Write Soft Deleted Vaults. + /// + /// List of Deleted Vaults + private void WriteSoftDeletedVaults(IList deletedVaults) + { + this.WriteObject(deletedVaults.Select(v => new ARSSoftDeletedVault(v)), true); + } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices/Vault/UndoAzRecoveryServicesVaultDeletion.cs b/src/RecoveryServices/RecoveryServices/Vault/UndoAzRecoveryServicesVaultDeletion.cs new file mode 100644 index 000000000000..83dfc0d15e42 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices/Vault/UndoAzRecoveryServicesVaultDeletion.cs @@ -0,0 +1,95 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using System; +using System.Management.Automation; +using Microsoft.Azure.Management.RecoveryServices.Models; +using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; +using Microsoft.Azure.Commands.RecoveryServices.Properties; + +namespace Microsoft.Azure.Commands.RecoveryServices +{ + /// + /// Undeletes a soft deleted Azure Recovery Services Vault. + /// + [Cmdlet("Undo", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "RecoveryServicesVaultDeletion", SupportsShouldProcess = true)] + [OutputType(typeof(ARSSoftDeletedVault))] + public class UndoAzRecoveryServicesVaultDeletion : RecoveryServicesCmdletBase + { + #region Parameters + + /// + /// Gets or sets Resource Group name. + /// + [Parameter(Position = 1, Mandatory = true)] + [ResourceGroupCompleter] + [ValidateNotNullOrEmpty] + public string ResourceGroupName { get; set; } + + /// + /// Gets or sets Vault Name. + /// + [Parameter(Position = 2, Mandatory = true)] + [ValidateNotNullOrEmpty] + public string Name { get; set; } + + /// + /// Gets or sets Location. + /// + [Parameter(Position = 3, Mandatory = true)] + [LocationCompleter] + [ValidateNotNullOrEmpty] + public string Location { get; set; } + + /// + /// Prevents the confirmation dialog when specified. + /// + [Parameter(Mandatory = false)] + public SwitchParameter Force { get; set; } + + #endregion Parameters + + /// + /// ProcessRecord of the command. + /// + public override void ExecuteCmdlet() + { + if (ShouldProcess(this.Name, "Undelete Recovery Services Vault") || Force.IsPresent) + { + try + { + // Construct the recovery resource group ID + string subscriptionId = DefaultProfile.DefaultContext.Subscription.Id; + string recoveryResourceGroupId = $"/subscriptions/{subscriptionId}/resourceGroups/{this.ResourceGroupName}"; + + WriteVerbose($"Starting undelete operation for vault '{this.Name}' in location '{this.Location}'"); + WriteVerbose($"Recovery Resource Group ID: {recoveryResourceGroupId}"); + + DeletedVault undeleteResult = RecoveryServicesClient.UndeleteSoftDeletedVault( + this.Location, + this.Name, + recoveryResourceGroupId); + + WriteVerbose($"Undelete operation completed for vault '{this.Name}'"); + + this.WriteObject(new ARSSoftDeletedVault(undeleteResult)); + } + catch (Exception exception) + { + this.HandleException(exception); + } + } + } + } +} \ No newline at end of file From 8ef5f4813008152de8d87b5d68154dc43a833170 Mon Sep 17 00:00:00 2001 From: Himanshu Agarwal Date: Mon, 29 Sep 2025 08:46:09 +0530 Subject: [PATCH 2/2] Added test case --- .../Conversions/ConversionHelpers.cs | 2 +- .../ScenarioTests/RecoveryServicesTests.cs | 7 + .../ScenarioTests/RecoveryServicesTests.ps1 | 207 ++- ...eryServicesSoftDeletedVaultOperations.json | 1127 +++++++++++++++++ .../RecoveryServices/ChangeLog.md | 1 + .../UndoAzRecoveryServicesVaultDeletion.cs | 6 +- .../help/Az.RecoveryServices.md | 15 +- .../Get-AzRecoveryServicesSoftDeletedVault.md | 121 ++ ...overyServicesSoftDeletedVaultBackupItem.md | 116 ++ .../Undo-AzRecoveryServicesVaultDeletion.md | 155 +++ 10 files changed, 1633 insertions(+), 124 deletions(-) create mode 100644 src/RecoveryServices/RecoveryServices.Test/SessionRecords/Microsoft.Azure.Commands.RecoveryServices.Test.ScenarioTests.RecoveryServicesTests/TestRecoveryServicesSoftDeletedVaultOperations.json create mode 100644 src/RecoveryServices/RecoveryServices/help/Get-AzRecoveryServicesSoftDeletedVault.md create mode 100644 src/RecoveryServices/RecoveryServices/help/Get-AzRecoveryServicesSoftDeletedVaultBackupItem.md create mode 100644 src/RecoveryServices/RecoveryServices/help/Undo-AzRecoveryServicesVaultDeletion.md diff --git a/src/RecoveryServices/RecoveryServices.Backup.Helpers/Conversions/ConversionHelpers.cs b/src/RecoveryServices/RecoveryServices.Backup.Helpers/Conversions/ConversionHelpers.cs index 4391999e35d7..72efe811849f 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Helpers/Conversions/ConversionHelpers.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Helpers/Conversions/ConversionHelpers.cs @@ -1371,7 +1371,7 @@ private static void SetSoftDeletedCommonProperties(ItemBase item, dynamic proper } catch (Exception ex) { - Logger.Instance.WriteWarning($"Failed to set soft deleted common properties: {ex.Message}"); + Logger.Instance.WriteDebug($"Warning: Failed to set soft deleted common properties: {ex.Message}"); } } diff --git a/src/RecoveryServices/RecoveryServices.Test/ScenarioTests/RecoveryServicesTests.cs b/src/RecoveryServices/RecoveryServices.Test/ScenarioTests/RecoveryServicesTests.cs index 2ac69f7bfd0a..11f95f61baba 100644 --- a/src/RecoveryServices/RecoveryServices.Test/ScenarioTests/RecoveryServicesTests.cs +++ b/src/RecoveryServices/RecoveryServices.Test/ScenarioTests/RecoveryServicesTests.cs @@ -41,5 +41,12 @@ public void TestGetRSVaultSettingsFile() { TestRunner.RunTestScript("Test-GetRSVaultSettingsFile"); } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestRecoveryServicesSoftDeletedVaultOperations() + { + TestRunner.RunTestScript("Test-RecoveryServicesSoftDeletedVaultOperations"); + } } } diff --git a/src/RecoveryServices/RecoveryServices.Test/ScenarioTests/RecoveryServicesTests.ps1 b/src/RecoveryServices/RecoveryServices.Test/ScenarioTests/RecoveryServicesTests.ps1 index f992733acd14..eb1b5620a805 100644 --- a/src/RecoveryServices/RecoveryServices.Test/ScenarioTests/RecoveryServicesTests.ps1 +++ b/src/RecoveryServices/RecoveryServices.Test/ScenarioTests/RecoveryServicesTests.ps1 @@ -171,150 +171,121 @@ function Test-GetRSVaultSettingsFile <# .SYNOPSIS -Recovery Services Soft Deleted Vault Tests - Delete, Get, and Undo deletion +Recovery Services Soft Deleted Vault Tests #> function Test-RecoveryServicesSoftDeletedVaultOperations { - $location = "centraluseuap" - $resourceGroupName = Create-ResourceGroup $location - $name = "PSTestRSV" + @(Get-RandomSuffix) + $location = "westus" + $resourceGroupName = "hiagawus-rg" + $softDeletedVaultNamePattern = "hiagawus-rg_*" # Pattern to match the vault name + $expectedBackupItems = @("hiagaCRRRVM23", "hiagawusCRR-vm") + $subscriptionId = "f879818f-5b29-4a43-8961-34169783144f" # use this subscription for this test + $originalRSVname = "hiagawusCRR-vault" try { - # 1. Create a new Recovery Services Vault - $vault = New-AzRecoveryServicesVault -Name $name -ResourceGroupName $resourceGroupName -Location $location - - Assert-NotNull($vault.Name) - Assert-NotNull($vault.ID) - Assert-NotNull($vault.Type) - Assert-AreEqual $name $vault.Name - Assert-AreEqual $location $vault.Location - - # 2. Delete the vault (this will soft delete it) - Remove-AzRecoveryServicesVault -Vault $vault - - # Verify vault is no longer in active vaults list - $activeVaults = Get-AzRecoveryServicesVault -Name $name -ResourceGroupName $resourceGroupName - Assert-True { $activeVaults.Count -eq 0 } - - # 3. Get soft deleted vault + # 1. Get-AzRecoveryServicesSoftDeletedVault - Get all soft deleted vaults in location $softDeletedVaults = Get-AzRecoveryServicesSoftDeletedVault -Location $location + Assert-NotNull($softDeletedVaults) Assert-True { $softDeletedVaults.Count -gt 0 } - - # Find our specific soft deleted vault + + # Find the target soft deleted vault by resource group and name pattern $targetSoftDeletedVault = $softDeletedVaults | Where-Object { - $_.Name -eq $name -and $_.ResourceGroupName -eq $resourceGroupName + $_.ResourceGroupName -eq $resourceGroupName -and $_.Name -like $softDeletedVaultNamePattern } - Assert-NotNull($targetSoftDeletedVault) - Assert-AreEqual $name $targetSoftDeletedVault.Name - Assert-AreEqual $location $targetSoftDeletedVault.Location Assert-AreEqual $resourceGroupName $targetSoftDeletedVault.ResourceGroupName - Assert-NotNull($targetSoftDeletedVault.Properties.VaultId) - Assert-NotNull($targetSoftDeletedVault.Properties.VaultDeletionTime) - Assert-NotNull($targetSoftDeletedVault.Properties.PurgeAt) - - # 4. Get soft deleted vault by name - $specificSoftDeletedVault = Get-AzRecoveryServicesSoftDeletedVault -Location $location -Name $name - Assert-NotNull($specificSoftDeletedVault) - Assert-AreEqual $name $specificSoftDeletedVault.Name - Assert-AreEqual $location $specificSoftDeletedVault.Location - - # 5. Get soft deleted vault by resource group filter - $filteredSoftDeletedVaults = Get-AzRecoveryServicesSoftDeletedVault -Location $location -ResourceGroupName $resourceGroupName - Assert-NotNull($filteredSoftDeletedVaults) - $filteredTargetVault = $filteredSoftDeletedVaults | Where-Object { $_.Name -eq $name } - Assert-NotNull($filteredTargetVault) - - # 6. Undo vault deletion - $undoResult = Undo-AzRecoveryServicesVaultDeletion -ResourceGroupName $resourceGroupName -Name $name -Location $location - - Assert-NotNull($undoResult) - Assert-AreEqual $name $undoResult.Name - Assert-AreEqual $location $undoResult.Location + Assert-AreEqual $location $targetSoftDeletedVault.Location + Assert-NotNull($targetSoftDeletedVault.Properties) - # 7. Verify vault is restored and back in active vaults list - # Note: The restoration might take some time, so we may need to wait or poll - Start-Sleep -Seconds 30 # Wait for restoration to complete + # Get the actual vault name for subsequent operations + $vaultName = $targetSoftDeletedVault.Name + Write-Host "Found soft-deleted vault: $vaultName" - $restoredVaults = Get-AzRecoveryServicesVault -Name $name -ResourceGroupName $resourceGroupName - Assert-NotNull($restoredVaults) - Assert-True { $restoredVaults.Count -gt 0 } + # 2. Get-AzRecoveryServicesSoftDeletedVault - Get specific soft deleted vault by name + $specificSoftDeletedVault = Get-AzRecoveryServicesSoftDeletedVault -Location $location -Name $vaultName -ResourceGroupName $resourceGroupName - $restoredVault = $restoredVaults[0] - Assert-AreEqual $name $restoredVault.Name - Assert-AreEqual $location $restoredVault.Location - Assert-AreEqual $resourceGroupName $restoredVault.ResourceGroupName - - # 8. Verify soft deleted vault is no longer in soft deleted list - $remainingSoftDeletedVaults = Get-AzRecoveryServicesSoftDeletedVault -Location $location -Name $name - # After successful restoration, the vault should not be in soft deleted state - # This assertion might need adjustment based on actual API behavior - # Assert-Null($remainingSoftDeletedVaults) - - # Clean up the restored vault - Remove-AzRecoveryServicesVault -Vault $restoredVault - } - finally - { - Cleanup-ResourceGroup $resourceGroupName - } -} + Assert-NotNull($specificSoftDeletedVault) + Assert-AreEqual $vaultName $specificSoftDeletedVault.Name + Assert-AreEqual $resourceGroupName $specificSoftDeletedVault.ResourceGroupName -<# -.SYNOPSIS -Recovery Services Soft Deleted Vault Tests - Filter by existing vault pattern -#> -function Test-RecoveryServicesSoftDeletedVaultFiltering -{ - $location = "centraluseuap" - - try - { - # 1. Get all soft deleted vaults in the location - $allSoftDeletedVaults = Get-AzRecoveryServicesSoftDeletedVault -Location $location + # 3. Get-AzRecoveryServicesSoftDeletedVaultBackupItem - Using VaultId + $backupItemsUsingVaultId = Get-AzRecoveryServicesSoftDeletedVaultBackupItem -VaultId $targetSoftDeletedVault.ID - if ($allSoftDeletedVaults -ne $null -and $allSoftDeletedVaults.Count -gt 0) + Assert-NotNull($backupItemsUsingVaultId) + Assert-True { $backupItemsUsingVaultId.Count -ge 2 } + + # Verify expected backup items exist + $foundBackupItems = @() + foreach ($item in $backupItemsUsingVaultId) { - Assert-True { $allSoftDeletedVaults.Count -gt 0 } - - foreach ($vault in $allSoftDeletedVaults) + foreach ($expectedItem in $expectedBackupItems) { - Assert-NotNull($vault.Name) - Assert-NotNull($vault.Location) - Assert-AreEqual $location $vault.Location - Assert-NotNull($vault.Properties) - Assert-NotNull($vault.Properties.VaultId) - } - - # 2. Test filtering by vault name pattern (similar to your akkanaseTest23 example) - $filteredByPattern = $allSoftDeletedVaults | Where-Object { $_.Properties.VaultId -match "PSTestRSV" } - - # 3. Test resource group filtering - if ($allSoftDeletedVaults.Count -gt 0) - { - $firstVault = $allSoftDeletedVaults[0] - if ($firstVault.ResourceGroupName -ne $null) + if ($item.Name -like "*$expectedItem*" -or $item.SourceResourceId -like "*$expectedItem*") { - $filteredByRG = Get-AzRecoveryServicesSoftDeletedVault -Location $location -ResourceGroupName $firstVault.ResourceGroupName - Assert-NotNull($filteredByRG) - - foreach ($vault in $filteredByRG) - { - Assert-AreEqual $firstVault.ResourceGroupName $vault.ResourceGroupName - } + $foundBackupItems += $expectedItem + break } } } - else - { - Write-Warning "No soft deleted vaults found in location $location for filtering tests" + Assert-True { $foundBackupItems.Count -eq $expectedBackupItems.Count } + + # 4. Get-AzRecoveryServicesSoftDeletedVaultBackupItem - Using VaultName and ResourceGroupName + $backupItemsUsingVaultName = Get-AzRecoveryServicesSoftDeletedVaultBackupItem -VaultName $vaultName -ResourceGroupName $resourceGroupName + + Assert-NotNull($backupItemsUsingVaultName) + Assert-True { $backupItemsUsingVaultName.Count -ge 2 } + Assert-AreEqual $backupItemsUsingVaultId.Count $backupItemsUsingVaultName.Count + + # 5. Undo-AzRecoveryServicesVaultDeletion - Restore the soft deleted vault + $undeleteResult = Undo-AzRecoveryServicesVaultDeletion -ResourceGroupName $resourceGroupName -Name $vaultName -Location $location -Force + + Assert-NotNull($undeleteResult) + + # Wait a bit for the restoration to complete + Start-Sleep -Seconds 30 + + # 6. Get-AzRecoveryServicesVault - Verify vault is now active again + $activeVault = Get-AzRecoveryServicesVault -Name $originalRSVname -ResourceGroupName $resourceGroupName + + Assert-NotNull($activeVault) + Assert-AreEqual $originalRSVname $activeVault.Name + Assert-AreEqual $resourceGroupName $activeVault.ResourceGroupName + Assert-AreEqual $location $activeVault.Location + Assert-NotNull($activeVault.ID) + Assert-NotNull($activeVault.Type) + + # 7. Verify the vault is no longer in soft deleted state + $softDeletedVaultsAfterRestore = Get-AzRecoveryServicesSoftDeletedVault -Location $location + $softDeletedVaultAfterRestore = $softDeletedVaultsAfterRestore | Where-Object { $_.Properties.VaultId -match $originalRSVname } + Assert-Null($softDeletedVaultAfterRestore) + + # 8. Remove-AzRecoveryServicesVault - Delete the vault again to maintain original test state + Remove-AzRecoveryServicesVault -Vault $activeVault + + # Wait a bit for the deletion to complete + Start-Sleep -Seconds 30 + + # 9. Verify vault is back to soft deleted state (note: name may have changed due to new GUID) + $softDeletedVaultsFinal = Get-AzRecoveryServicesSoftDeletedVault -Location $location + $finalSoftDeletedVault = $softDeletedVaultsFinal | Where-Object { + $_.ResourceGroupName -eq $resourceGroupName -and $_.Name -like $softDeletedVaultNamePattern } + Assert-NotNull($finalSoftDeletedVault) + Write-Host "Vault back in soft-deleted state with name: $($finalSoftDeletedVault.Name)" + + # 10. Verify active vault no longer exists (check by resource group and original pattern) + $activeVaultsCheck = Get-AzRecoveryServicesVault -Name $originalRSVname -ResourceGroupName $resourceGroupName -ErrorAction SilentlyContinue + Assert-Null($activeVaultCheck) } - catch + finally { - Write-Warning "Soft deleted vault filtering test encountered an issue: $($_.Exception.Message)" - # Don't fail the test if there are no existing soft deleted vaults + # If test fails, attempt to clean up by ensuring vault is in soft deleted state + $activeVaultsCleanup = Get-AzRecoveryServicesVault -Name $originalRSVname -ResourceGroupName $resourceGroupName -ErrorAction SilentlyContinue + if ($activeVaultCleanup -ne $null) + { + Remove-AzRecoveryServicesVault -Vault $activeVaultCleanup + } } } diff --git a/src/RecoveryServices/RecoveryServices.Test/SessionRecords/Microsoft.Azure.Commands.RecoveryServices.Test.ScenarioTests.RecoveryServicesTests/TestRecoveryServicesSoftDeletedVaultOperations.json b/src/RecoveryServices/RecoveryServices.Test/SessionRecords/Microsoft.Azure.Commands.RecoveryServices.Test.ScenarioTests.RecoveryServicesTests/TestRecoveryServicesSoftDeletedVaultOperations.json new file mode 100644 index 000000000000..b0e997f1314a --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Test/SessionRecords/Microsoft.Azure.Commands.RecoveryServices.Test.ScenarioTests.RecoveryServicesTests/TestRecoveryServicesSoftDeletedVaultOperations.json @@ -0,0 +1,1127 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/f879818f-5b29-4a43-8961-34169783144f/providers/Microsoft.RecoveryServices/locations/westus/deletedVaults?api-version=2025-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjg3OTgxOGYtNWIyOS00YTQzLTg5NjEtMzQxNjk3ODMxNDRmL3Byb3ZpZGVycy9NaWNyb3NvZnQuUmVjb3ZlcnlTZXJ2aWNlcy9sb2NhdGlvbnMvd2VzdHVzL2RlbGV0ZWRWYXVsdHM/YXBpLXZlcnNpb249MjAyNS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept-Language": [ + "en-US" + ], + "x-ms-client-request-id": [ + "3b4463ee-c235-438f-a012-0d49242218a2" + ], + "User-Agent": [ + "FxVersion/8.0.2025.41914", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.26100", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/7.8.0" + ] + }, + "RequestBody": "", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-operation-identifier": [ + "tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=8bf5ba20-c970-4c38-b2a6-95f5726c959a/southeastasia/929f9828-51c9-434c-b4bd-f9183cbac860" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "13b73cf8-5b09-4fc5-b007-33cb61545b29" + ], + "x-ms-client-request-id": [ + "3b4463ee-c235-438f-a012-0d49242218a2" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "1099" + ], + "x-ms-ratelimit-remaining-subscription-global-reads": [ + "16499" + ], + "x-ms-correlation-request-id": [ + "13b73cf8-5b09-4fc5-b007-33cb61545b29" + ], + "x-ms-routing-request-id": [ + "SOUTHEASTASIA:20250929T025618Z:13b73cf8-5b09-4fc5-b007-33cb61545b29" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: 7E7988D465234765A239276E148ED494 Ref B: MAA201060515033 Ref C: 2025-09-29T02:56:17Z" + ], + "Date": [ + "Mon, 29 Sep 2025 02:56:18 GMT" + ], + "Content-Length": [ + "587" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/f879818f-5b29-4a43-8961-34169783144f/providers/Microsoft.RecoveryServices/locations/westus/deletedVaults/hiagawus-rg_a957eb97-ecba-46c6-94a1-a03173ab47a6\",\r\n \"name\": \"hiagawus-rg_a957eb97-ecba-46c6-94a1-a03173ab47a6\",\r\n \"type\": \"Microsoft.RecoveryServices/locations/deletedVaults\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"vaultId\": \"/subscriptions/f879818f-5b29-4a43-8961-34169783144f/resourceGroups/hiagawus-rg/providers/Microsoft.RecoveryServices/vaults/hiagawusCRR-vault\",\r\n \"vaultDeletionTime\": \"2025-09-29T02:49:19.1537325Z\",\r\n \"purgeAt\": \"2025-10-10T10:00:52.5983457Z\"\r\n }\r\n }\r\n ]\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/f879818f-5b29-4a43-8961-34169783144f/providers/Microsoft.RecoveryServices/locations/westus/deletedVaults?api-version=2025-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjg3OTgxOGYtNWIyOS00YTQzLTg5NjEtMzQxNjk3ODMxNDRmL3Byb3ZpZGVycy9NaWNyb3NvZnQuUmVjb3ZlcnlTZXJ2aWNlcy9sb2NhdGlvbnMvd2VzdHVzL2RlbGV0ZWRWYXVsdHM/YXBpLXZlcnNpb249MjAyNS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept-Language": [ + "en-US" + ], + "x-ms-client-request-id": [ + "4ce0a1ba-6afb-47f4-91eb-8208d6f7159b" + ], + "User-Agent": [ + "FxVersion/8.0.2025.41914", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.26100", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/7.8.0" + ] + }, + "RequestBody": "", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-operation-identifier": [ + "tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=8bf5ba20-c970-4c38-b2a6-95f5726c959a/southeastasia/fb42212c-b1c0-4ce8-9bbc-cf67d40cd8b1" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "8b011b42-08ba-4086-9012-0eb038693df6" + ], + "x-ms-client-request-id": [ + "4ce0a1ba-6afb-47f4-91eb-8208d6f7159b" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "1099" + ], + "x-ms-ratelimit-remaining-subscription-global-reads": [ + "16499" + ], + "x-ms-correlation-request-id": [ + "8b011b42-08ba-4086-9012-0eb038693df6" + ], + "x-ms-routing-request-id": [ + "SOUTHEASTASIA:20250929T025759Z:8b011b42-08ba-4086-9012-0eb038693df6" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: 71DACF3478234C7CA27265F942E49478 Ref B: MAA201060515031 Ref C: 2025-09-29T02:57:59Z" + ], + "Date": [ + "Mon, 29 Sep 2025 02:57:59 GMT" + ], + "Content-Length": [ + "12" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"value\": []\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/f879818f-5b29-4a43-8961-34169783144f/providers/Microsoft.RecoveryServices/locations/westus/deletedVaults?api-version=2025-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjg3OTgxOGYtNWIyOS00YTQzLTg5NjEtMzQxNjk3ODMxNDRmL3Byb3ZpZGVycy9NaWNyb3NvZnQuUmVjb3ZlcnlTZXJ2aWNlcy9sb2NhdGlvbnMvd2VzdHVzL2RlbGV0ZWRWYXVsdHM/YXBpLXZlcnNpb249MjAyNS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept-Language": [ + "en-US" + ], + "x-ms-client-request-id": [ + "533c01e4-3b53-4b24-8890-f757e2f6493a" + ], + "User-Agent": [ + "FxVersion/8.0.2025.41914", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.26100", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/7.8.0" + ] + }, + "RequestBody": "", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-operation-identifier": [ + "tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=8bf5ba20-c970-4c38-b2a6-95f5726c959a/westus/a4395c54-9734-4c29-8c28-7c825cc0752b" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "1a87121f-b701-4ec2-a459-13d1a2cf3e13" + ], + "x-ms-client-request-id": [ + "533c01e4-3b53-4b24-8890-f757e2f6493a" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "1099" + ], + "x-ms-ratelimit-remaining-subscription-global-reads": [ + "16499" + ], + "x-ms-correlation-request-id": [ + "1a87121f-b701-4ec2-a459-13d1a2cf3e13" + ], + "x-ms-routing-request-id": [ + "WESTUS:20250929T025935Z:1a87121f-b701-4ec2-a459-13d1a2cf3e13" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: EC7896DCD93E49BDA067F721B57F568D Ref B: MAA201060516037 Ref C: 2025-09-29T02:59:35Z" + ], + "Date": [ + "Mon, 29 Sep 2025 02:59:35 GMT" + ], + "Content-Length": [ + "587" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/f879818f-5b29-4a43-8961-34169783144f/providers/Microsoft.RecoveryServices/locations/westus/deletedVaults/hiagawus-rg_d2df7ee8-2fc8-4ed4-b8f4-f15f7a38c4bf\",\r\n \"name\": \"hiagawus-rg_d2df7ee8-2fc8-4ed4-b8f4-f15f7a38c4bf\",\r\n \"type\": \"Microsoft.RecoveryServices/locations/deletedVaults\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"vaultId\": \"/subscriptions/f879818f-5b29-4a43-8961-34169783144f/resourceGroups/hiagawus-rg/providers/Microsoft.RecoveryServices/vaults/hiagawusCRR-vault\",\r\n \"vaultDeletionTime\": \"2025-09-29T02:58:04.7259583Z\",\r\n \"purgeAt\": \"2025-10-10T10:00:52.5983457Z\"\r\n }\r\n }\r\n ]\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/f879818f-5b29-4a43-8961-34169783144f/providers/Microsoft.RecoveryServices/locations/westus/deletedVaults/hiagawus-rg_a957eb97-ecba-46c6-94a1-a03173ab47a6?api-version=2025-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjg3OTgxOGYtNWIyOS00YTQzLTg5NjEtMzQxNjk3ODMxNDRmL3Byb3ZpZGVycy9NaWNyb3NvZnQuUmVjb3ZlcnlTZXJ2aWNlcy9sb2NhdGlvbnMvd2VzdHVzL2RlbGV0ZWRWYXVsdHMvaGlhZ2F3dXMtcmdfYTk1N2ViOTctZWNiYS00NmM2LTk0YTEtYTAzMTczYWI0N2E2P2FwaS12ZXJzaW9uPTIwMjUtMDgtMDE=", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept-Language": [ + "en-US" + ], + "x-ms-client-request-id": [ + "31988278-c795-47ff-9ce9-9fc7d945c957" + ], + "User-Agent": [ + "FxVersion/8.0.2025.41914", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.26100", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/7.8.0" + ] + }, + "RequestBody": "", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-operation-identifier": [ + "tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=8bf5ba20-c970-4c38-b2a6-95f5726c959a/westus/a44e6054-1899-46d2-8971-e2b07ce40fe7" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "9aaeb09d-bf24-4e36-be81-f5499329ff38" + ], + "x-ms-client-request-id": [ + "31988278-c795-47ff-9ce9-9fc7d945c957" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "1099" + ], + "x-ms-ratelimit-remaining-subscription-global-reads": [ + "16499" + ], + "x-ms-correlation-request-id": [ + "9aaeb09d-bf24-4e36-be81-f5499329ff38" + ], + "x-ms-routing-request-id": [ + "WESTUS:20250929T025620Z:9aaeb09d-bf24-4e36-be81-f5499329ff38" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: 4B43A83CDAFA4D3885FCA42470C22524 Ref B: MAA201060514039 Ref C: 2025-09-29T02:56:20Z" + ], + "Date": [ + "Mon, 29 Sep 2025 02:56:19 GMT" + ], + "Content-Length": [ + "575" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/f879818f-5b29-4a43-8961-34169783144f/providers/Microsoft.RecoveryServices/locations/westus/deletedVaults/hiagawus-rg_a957eb97-ecba-46c6-94a1-a03173ab47a6\",\r\n \"name\": \"hiagawus-rg_a957eb97-ecba-46c6-94a1-a03173ab47a6\",\r\n \"type\": \"Microsoft.RecoveryServices/locations/deletedVaults\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"vaultId\": \"/subscriptions/f879818f-5b29-4a43-8961-34169783144f/resourceGroups/hiagawus-rg/providers/Microsoft.RecoveryServices/vaults/hiagawusCRR-vault\",\r\n \"vaultDeletionTime\": \"2025-09-29T02:49:19.1537325Z\",\r\n \"purgeAt\": \"2025-10-10T10:00:52.5983457Z\"\r\n }\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/providers/Microsoft.ResourceGraph/resources?api-version=2024-04-01", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuUmVzb3VyY2VHcmFwaC9yZXNvdXJjZXM/YXBpLXZlcnNpb249MjAyNC0wNC0wMQ==", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept-Language": [ + "en-US" + ], + "x-ms-client-request-id": [ + "793af590-5d12-4329-9d85-340d608aa6df" + ], + "User-Agent": [ + "FxVersion/8.0.2025.41914", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.26100", + "Microsoft.Azure.Management.ResourceGraph.ResourceGraphClient/0.0.0.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "775" + ] + }, + "RequestBody": "{\r\n \"subscriptions\": [\r\n \"f879818f-5b29-4a43-8961-34169783144f\"\r\n ],\r\n \"query\": \"Recoveryservicesresources\\r\\n| where type == \\\"microsoft.recoveryservices/locations/deletedvaults/backupfabrics/protectioncontainers/protecteditems\\\"\\r\\n| extend dataSourceType = strcat(properties.backupManagementType, '/', properties.workloadType)\\r\\n| where tostring(id) contains \\\"/subscriptions/f879818f-5b29-4a43-8961-34169783144f/providers/Microsoft.RecoveryServices/locations/westus/deletedVaults/hiagawus-rg_a957eb97-ecba-46c6-94a1-a03173ab47a6\\\"\\r\\n| project id, type, name, location, resourceGroup, subscriptionId, dataSourceType, properties, tags\",\r\n \"options\": {\r\n \"$top\": 1000,\r\n \"$skip\": 0,\r\n \"resultFormat\": \"objectArray\",\r\n \"allowPartialScopes\": false\r\n }\r\n}", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-correlation-request-id": [ + "5c856e8e-f8e5-46ee-8130-4f4861788ce1" + ], + "x-ms-ratelimit-remaining-tenant-resource-requests": [ + "14" + ], + "x-ms-user-quota-remaining": [ + "14" + ], + "x-ms-user-quota-resets-after": [ + "00:00:05" + ], + "x-ms-resource-graph-request-duration": [ + "0:00:00:01.0084558" + ], + "x-ms-operation-identifier": [ + "" + ], + "x-ms-ratelimit-remaining-tenant-reads": [ + "2199" + ], + "x-ms-request-id": [ + "5c856e8e-f8e5-46ee-8130-4f4861788ce1" + ], + "x-ms-routing-request-id": [ + "SOUTHEASTASIA:20250929T025622Z:5c856e8e-f8e5-46ee-8130-4f4861788ce1" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: 0B852680702549B9BFFA713FE5173F9A Ref B: MAA201060513045 Ref C: 2025-09-29T02:56:21Z" + ], + "Date": [ + "Mon, 29 Sep 2025 02:56:22 GMT" + ], + "Content-Length": [ + "8159" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"totalRecords\": 2,\r\n \"count\": 2,\r\n \"data\": [\r\n {\r\n \"id\": \"/subscriptions/f879818f-5b29-4a43-8961-34169783144f/providers/Microsoft.RecoveryServices/locations/westus/deletedVaults/hiagawus-rg_a957eb97-ecba-46c6-94a1-a03173ab47a6/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainerv2;hiagawus-rg;hiagacrrrvm23/protectedItems/VM;iaasvmcontainerv2;hiagawus-rg;hiagacrrrvm23\",\r\n \"type\": \"microsoft.recoveryservices/locations/deletedvaults/backupfabrics/protectioncontainers/protecteditems\",\r\n \"name\": \"VM;iaasvmcontainerv2;hiagawus-rg;hiagacrrrvm23\",\r\n \"location\": \"westus\",\r\n \"resourceGroup\": \"\",\r\n \"subscriptionId\": \"f879818f-5b29-4a43-8961-34169783144f\",\r\n \"dataSourceType\": \"AzureIaasVM/VM\",\r\n \"properties\": {\r\n \"backupManagementType\": \"AzureIaasVM\",\r\n \"dataSourceId\": \"hiagaCRRRVM23\",\r\n \"sourceSideScanInfo\": {\r\n \"sourceSideScanSummary\": \"Unknown\",\r\n \"sourceSideScanStatus\": \"NotConfigured\"\r\n },\r\n \"containerName\": \"iaasvmcontainerv2;hiagawus-rg;hiagacrrrvm23\",\r\n \"extendedInfo\": {\r\n \"oldestRecoveryPoint\": \"2025-08-27T12:11:58.0132035Z\",\r\n \"newestRecoveryPointInArchive\": null,\r\n \"oldestRecoveryPointInArchive\": null,\r\n \"oldestRecoveryPointInVault\": null,\r\n \"recoveryPointCount\": 22,\r\n \"policyInconsistent\": false\r\n },\r\n \"isAzureManagedLinkedResource\": true,\r\n \"deferredDeleteTimeRemaining\": \"11.07:11:07.7937105\",\r\n \"allowedOperations\": [\r\n \"Undelete\"\r\n ],\r\n \"configuredRPGenerationFrequencyInSecondaryRegion\": \"-10675199.02:48:05.4775808\",\r\n \"protectionStatus\": \"Healthy\",\r\n \"configuredMaximumRetentionInSecondaryRegion\": \"-10675199.02:48:05.4775808\",\r\n \"friendlyName\": \"hiagaCRRRVM23\",\r\n \"rpoWarningThresholdInSecondaryRegion\": \"-10675199.02:48:05.4775808\",\r\n \"oldestRecoveryPointInSecondaryRegion\": \"2025-08-27T12:11:58.0132035Z\",\r\n \"latestRecoveryPointInSecondaryRegion\": \"2025-09-25T12:15:33.6459136Z\",\r\n \"currentProtectionState\": \"SoftDeleted\",\r\n \"rpoWarningThresholdInPrimaryRegion\": \"-10675199.02:48:05.4775808\",\r\n \"protectionStateInSecondaryRegion\": \"ProtectionStopped\",\r\n \"resourceGuardOperationRequests\": null,\r\n \"isDeferredDeleteScheduleUpcoming\": null,\r\n \"configuredRPGenerationFrequency\": \"-10675199.02:48:05.4775808\",\r\n \"policyId\": \"\",\r\n \"isScheduledForDeferredDelete\": true,\r\n \"protectedItemType\": \"Microsoft.Compute/virtualMachines\",\r\n \"workloadType\": \"VM\",\r\n \"configuredMaximumRetention\": \"-10675199.02:48:05.4775808\",\r\n \"lastRecoveryPoint\": \"2025-09-25T12:15:33.6459136Z\",\r\n \"softDeleteRetentionPeriod\": 14,\r\n \"protectionState\": \"ProtectionStopped\",\r\n \"deferredDeleteTimeInUTC\": \"2025-09-26T10:00:27.5110798Z\",\r\n \"protectedPrimaryRegion\": \"westus\",\r\n \"dataSourceInfo\": {\r\n \"resourceLocation\": \"westus\",\r\n \"datasourceType\": \"Microsoft.Compute/virtualMachines\",\r\n \"objectType\": \"DatasourceInfo\",\r\n \"resourceID\": \"/subscriptions/f879818f-5b29-4a43-8961-34169783144f/resourceGroups/hiagawus-rg/providers/Microsoft.Compute/virtualMachines/hiagaCRRRVM23\"\r\n },\r\n \"dataSourceSetInfo\": {\r\n \"resourceLocation\": \"westus\",\r\n \"datasourceType\": \"Microsoft.Compute/virtualMachines\",\r\n \"objectType\": \"DatasourceSetInfo\",\r\n \"resourceID\": \"/subscriptions/f879818f-5b29-4a43-8961-34169783144f/resourceGroups/hiagawus-rg/providers/Microsoft.Compute/virtualMachines/hiagaCRRRVM23\"\r\n },\r\n \"policyName\": \"\",\r\n \"isArchiveEnabled\": false,\r\n \"sourceResourceId\": \"/subscriptions/f879818f-5b29-4a43-8961-34169783144f/resourceGroups/hiagawus-rg/providers/Microsoft.Compute/virtualMachines/hiagaCRRRVM23\",\r\n \"lastBackupStatus\": \"Completed\",\r\n \"isInlineInquiry\": null,\r\n \"lastBackupTime\": \"2025-09-25T12:15:31.2701315Z\",\r\n \"backupSetName\": null,\r\n \"vaultId\": \"/subscriptions/f879818f-5b29-4a43-8961-34169783144f/providers/Microsoft.RecoveryServices/locations/westus/deletedVaults/hiagawus-rg_a957eb97-ecba-46c6-94a1-a03173ab47a6\",\r\n \"isRehydrate\": null,\r\n \"kpisHealths\": null,\r\n \"policyInfo\": {\r\n \"policyId\": \"\",\r\n \"name\": \"\"\r\n },\r\n \"createMode\": null,\r\n \"protectedItemDataId\": \"193515495398405\",\r\n \"extendedProperties\": {\r\n \"diskExclusionProperties\": null,\r\n \"linuxVmApplicationName\": \"\"\r\n },\r\n \"virtualMachineId\": \"/subscriptions/f879818f-5b29-4a43-8961-34169783144f/resourceGroups/hiagawus-rg/providers/Microsoft.Compute/virtualMachines/hiagaCRRRVM23\",\r\n \"healthDetails\": [\r\n {\r\n \"recommendations\": [],\r\n \"message\": \"Backup pre-check status of this virtual machine is OK.\",\r\n \"code\": 400239,\r\n \"title\": \"IaasVmHealthGreenDefault\"\r\n }\r\n ],\r\n \"healthStatus\": \"Passed\",\r\n \"policyType\": \"\",\r\n \"protectedSecondaryRegion\": \"eastus\"\r\n },\r\n \"tags\": null\r\n },\r\n {\r\n \"id\": \"/subscriptions/f879818f-5b29-4a43-8961-34169783144f/providers/Microsoft.RecoveryServices/locations/westus/deletedVaults/hiagawus-rg_a957eb97-ecba-46c6-94a1-a03173ab47a6/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainerv2;hiagawus-rg;hiagawuscrr-vm/protectedItems/VM;iaasvmcontainerv2;hiagawus-rg;hiagawuscrr-vm\",\r\n \"type\": \"microsoft.recoveryservices/locations/deletedvaults/backupfabrics/protectioncontainers/protecteditems\",\r\n \"name\": \"VM;iaasvmcontainerv2;hiagawus-rg;hiagawuscrr-vm\",\r\n \"location\": \"westus\",\r\n \"resourceGroup\": \"\",\r\n \"subscriptionId\": \"f879818f-5b29-4a43-8961-34169783144f\",\r\n \"dataSourceType\": \"AzureIaasVM/VM\",\r\n \"properties\": {\r\n \"backupManagementType\": \"AzureIaasVM\",\r\n \"dataSourceId\": \"hiagawusCRR-vm\",\r\n \"sourceSideScanInfo\": {\r\n \"sourceSideScanSummary\": \"Unknown\",\r\n \"sourceSideScanStatus\": \"NotConfigured\"\r\n },\r\n \"containerName\": \"iaasvmcontainerv2;hiagawus-rg;hiagawuscrr-vm\",\r\n \"extendedInfo\": {\r\n \"oldestRecoveryPoint\": \"2025-08-17T12:09:41.6690793Z\",\r\n \"newestRecoveryPointInArchive\": null,\r\n \"oldestRecoveryPointInArchive\": null,\r\n \"oldestRecoveryPointInVault\": null,\r\n \"recoveryPointCount\": 32,\r\n \"policyInconsistent\": false\r\n },\r\n \"isAzureManagedLinkedResource\": true,\r\n \"deferredDeleteTimeRemaining\": \"11.07:11:32.7872163\",\r\n \"allowedOperations\": [\r\n \"Undelete\"\r\n ],\r\n \"configuredRPGenerationFrequencyInSecondaryRegion\": \"-10675199.02:48:05.4775808\",\r\n \"protectionStatus\": \"Healthy\",\r\n \"configuredMaximumRetentionInSecondaryRegion\": \"-10675199.02:48:05.4775808\",\r\n \"friendlyName\": \"hiagawusCRR-vm\",\r\n \"rpoWarningThresholdInSecondaryRegion\": \"-10675199.02:48:05.4775808\",\r\n \"oldestRecoveryPointInSecondaryRegion\": \"2025-08-17T12:09:41.6690793Z\",\r\n \"latestRecoveryPointInSecondaryRegion\": \"2025-09-25T12:09:14.7355564Z\",\r\n \"currentProtectionState\": \"SoftDeleted\",\r\n \"rpoWarningThresholdInPrimaryRegion\": \"-10675199.02:48:05.4775808\",\r\n \"protectionStateInSecondaryRegion\": \"ProtectionStopped\",\r\n \"resourceGuardOperationRequests\": null,\r\n \"isDeferredDeleteScheduleUpcoming\": null,\r\n \"configuredRPGenerationFrequency\": \"-10675199.02:48:05.4775808\",\r\n \"policyId\": \"\",\r\n \"isScheduledForDeferredDelete\": true,\r\n \"protectedItemType\": \"Microsoft.Compute/virtualMachines\",\r\n \"workloadType\": \"VM\",\r\n \"configuredMaximumRetention\": \"-10675199.02:48:05.4775808\",\r\n \"lastRecoveryPoint\": \"2025-09-25T12:09:14.7355564Z\",\r\n \"softDeleteRetentionPeriod\": 14,\r\n \"protectionState\": \"ProtectionStopped\",\r\n \"deferredDeleteTimeInUTC\": \"2025-09-26T10:00:52.5983457Z\",\r\n \"protectedPrimaryRegion\": \"westus\",\r\n \"dataSourceInfo\": {\r\n \"resourceLocation\": \"westus\",\r\n \"datasourceType\": \"Microsoft.Compute/virtualMachines\",\r\n \"objectType\": \"DatasourceInfo\",\r\n \"resourceID\": \"/subscriptions/f879818f-5b29-4a43-8961-34169783144f/resourceGroups/hiagawus-rg/providers/Microsoft.Compute/virtualMachines/hiagawusCRR-vm\"\r\n },\r\n \"dataSourceSetInfo\": {\r\n \"resourceLocation\": \"westus\",\r\n \"datasourceType\": \"Microsoft.Compute/virtualMachines\",\r\n \"objectType\": \"DatasourceSetInfo\",\r\n \"resourceID\": \"/subscriptions/f879818f-5b29-4a43-8961-34169783144f/resourceGroups/hiagawus-rg/providers/Microsoft.Compute/virtualMachines/hiagawusCRR-vm\"\r\n },\r\n \"policyName\": \"\",\r\n \"isArchiveEnabled\": false,\r\n \"sourceResourceId\": \"/subscriptions/f879818f-5b29-4a43-8961-34169783144f/resourceGroups/hiagawus-rg/providers/Microsoft.Compute/virtualMachines/hiagawusCRR-vm\",\r\n \"lastBackupStatus\": \"Completed\",\r\n \"isInlineInquiry\": null,\r\n \"lastBackupTime\": \"2025-09-25T12:09:11.5400262Z\",\r\n \"backupSetName\": null,\r\n \"vaultId\": \"/subscriptions/f879818f-5b29-4a43-8961-34169783144f/providers/Microsoft.RecoveryServices/locations/westus/deletedVaults/hiagawus-rg_a957eb97-ecba-46c6-94a1-a03173ab47a6\",\r\n \"isRehydrate\": null,\r\n \"kpisHealths\": null,\r\n \"policyInfo\": {\r\n \"policyId\": \"\",\r\n \"name\": \"\"\r\n },\r\n \"createMode\": null,\r\n \"protectedItemDataId\": \"193514920098137\",\r\n \"extendedProperties\": {\r\n \"diskExclusionProperties\": null,\r\n \"linuxVmApplicationName\": \"\"\r\n },\r\n \"virtualMachineId\": \"/subscriptions/f879818f-5b29-4a43-8961-34169783144f/resourceGroups/hiagawus-rg/providers/Microsoft.Compute/virtualMachines/hiagawusCRR-vm\",\r\n \"healthDetails\": [\r\n {\r\n \"recommendations\": [],\r\n \"message\": \"Backup pre-check status of this virtual machine is OK.\",\r\n \"code\": 400239,\r\n \"title\": \"IaasVmHealthGreenDefault\"\r\n }\r\n ],\r\n \"healthStatus\": \"Passed\",\r\n \"policyType\": \"\",\r\n \"protectedSecondaryRegion\": \"eastus\"\r\n },\r\n \"tags\": null\r\n }\r\n ],\r\n \"facets\": [],\r\n \"resultTruncated\": \"false\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/providers/Microsoft.ResourceGraph/resources?api-version=2024-04-01", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuUmVzb3VyY2VHcmFwaC9yZXNvdXJjZXM/YXBpLXZlcnNpb249MjAyNC0wNC0wMQ==", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept-Language": [ + "en-US" + ], + "x-ms-client-request-id": [ + "542ed4cb-8680-45f4-9500-0408032c0d1c" + ], + "User-Agent": [ + "FxVersion/8.0.2025.41914", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.26100", + "Microsoft.Azure.Management.ResourceGraph.ResourceGraphClient/0.0.0.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "697" + ] + }, + "RequestBody": "{\r\n \"subscriptions\": [\r\n \"f879818f-5b29-4a43-8961-34169783144f\"\r\n ],\r\n \"query\": \"Recoveryservicesresources\\r\\n| where type == \\\"microsoft.recoveryservices/locations/deletedvaults/backupfabrics/protectioncontainers/protecteditems\\\"\\r\\n| extend dataSourceType = strcat(properties.backupManagementType, '/', properties.workloadType)\\r\\n| where tostring(id) contains \\\"hiagawus-rg_a957eb97-ecba-46c6-94a1-a03173ab47a6\\\" and tostring(id) contains \\\"hiagawus-rg\\\"\\r\\n| project id, type, name, location, resourceGroup, subscriptionId, dataSourceType, properties, tags\",\r\n \"options\": {\r\n \"$top\": 1000,\r\n \"$skip\": 0,\r\n \"resultFormat\": \"objectArray\",\r\n \"allowPartialScopes\": false\r\n }\r\n}", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-correlation-request-id": [ + "d7c22fce-d511-4fed-99b0-f33282579d18" + ], + "x-ms-ratelimit-remaining-tenant-resource-requests": [ + "13" + ], + "x-ms-user-quota-remaining": [ + "13" + ], + "x-ms-user-quota-resets-after": [ + "00:00:05" + ], + "x-ms-resource-graph-request-duration": [ + "0:00:00:00.6873231" + ], + "x-ms-operation-identifier": [ + "" + ], + "x-ms-ratelimit-remaining-tenant-reads": [ + "2199" + ], + "x-ms-request-id": [ + "d7c22fce-d511-4fed-99b0-f33282579d18" + ], + "x-ms-routing-request-id": [ + "SOUTHEASTASIA:20250929T025624Z:d7c22fce-d511-4fed-99b0-f33282579d18" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: A412884F806749A2B3219EA02C3495F8 Ref B: MAA201060513049 Ref C: 2025-09-29T02:56:23Z" + ], + "Date": [ + "Mon, 29 Sep 2025 02:56:24 GMT" + ], + "Content-Length": [ + "8159" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"totalRecords\": 2,\r\n \"count\": 2,\r\n \"data\": [\r\n {\r\n \"id\": \"/subscriptions/f879818f-5b29-4a43-8961-34169783144f/providers/Microsoft.RecoveryServices/locations/westus/deletedVaults/hiagawus-rg_a957eb97-ecba-46c6-94a1-a03173ab47a6/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainerv2;hiagawus-rg;hiagacrrrvm23/protectedItems/VM;iaasvmcontainerv2;hiagawus-rg;hiagacrrrvm23\",\r\n \"type\": \"microsoft.recoveryservices/locations/deletedvaults/backupfabrics/protectioncontainers/protecteditems\",\r\n \"name\": \"VM;iaasvmcontainerv2;hiagawus-rg;hiagacrrrvm23\",\r\n \"location\": \"westus\",\r\n \"resourceGroup\": \"\",\r\n \"subscriptionId\": \"f879818f-5b29-4a43-8961-34169783144f\",\r\n \"dataSourceType\": \"AzureIaasVM/VM\",\r\n \"properties\": {\r\n \"backupManagementType\": \"AzureIaasVM\",\r\n \"sourceSideScanInfo\": {\r\n \"sourceSideScanSummary\": \"Unknown\",\r\n \"sourceSideScanStatus\": \"NotConfigured\"\r\n },\r\n \"isAzureManagedLinkedResource\": true,\r\n \"dataSourceId\": \"hiagaCRRRVM23\",\r\n \"deferredDeleteTimeRemaining\": \"11.07:11:07.7937105\",\r\n \"allowedOperations\": [\r\n \"Undelete\"\r\n ],\r\n \"protectionStatus\": \"Healthy\",\r\n \"configuredRPGenerationFrequencyInSecondaryRegion\": \"-10675199.02:48:05.4775808\",\r\n \"containerName\": \"iaasvmcontainerv2;hiagawus-rg;hiagacrrrvm23\",\r\n \"configuredMaximumRetentionInSecondaryRegion\": \"-10675199.02:48:05.4775808\",\r\n \"extendedInfo\": {\r\n \"oldestRecoveryPoint\": \"2025-08-27T12:11:58.0132035Z\",\r\n \"newestRecoveryPointInArchive\": null,\r\n \"oldestRecoveryPointInArchive\": null,\r\n \"oldestRecoveryPointInVault\": null,\r\n \"recoveryPointCount\": 22,\r\n \"policyInconsistent\": false\r\n },\r\n \"friendlyName\": \"hiagaCRRRVM23\",\r\n \"currentProtectionState\": \"SoftDeleted\",\r\n \"oldestRecoveryPointInSecondaryRegion\": \"2025-08-27T12:11:58.0132035Z\",\r\n \"rpoWarningThresholdInSecondaryRegion\": \"-10675199.02:48:05.4775808\",\r\n \"latestRecoveryPointInSecondaryRegion\": \"2025-09-25T12:15:33.6459136Z\",\r\n \"rpoWarningThresholdInPrimaryRegion\": \"-10675199.02:48:05.4775808\",\r\n \"policyId\": \"\",\r\n \"protectionStateInSecondaryRegion\": \"ProtectionStopped\",\r\n \"resourceGuardOperationRequests\": null,\r\n \"isDeferredDeleteScheduleUpcoming\": null,\r\n \"configuredRPGenerationFrequency\": \"-10675199.02:48:05.4775808\",\r\n \"workloadType\": \"VM\",\r\n \"protectedItemType\": \"Microsoft.Compute/virtualMachines\",\r\n \"isScheduledForDeferredDelete\": true,\r\n \"lastRecoveryPoint\": \"2025-09-25T12:15:33.6459136Z\",\r\n \"configuredMaximumRetention\": \"-10675199.02:48:05.4775808\",\r\n \"protectionState\": \"ProtectionStopped\",\r\n \"softDeleteRetentionPeriod\": 14,\r\n \"deferredDeleteTimeInUTC\": \"2025-09-26T10:00:27.5110798Z\",\r\n \"dataSourceInfo\": {\r\n \"resourceLocation\": \"westus\",\r\n \"datasourceType\": \"Microsoft.Compute/virtualMachines\",\r\n \"objectType\": \"DatasourceInfo\",\r\n \"resourceID\": \"/subscriptions/f879818f-5b29-4a43-8961-34169783144f/resourceGroups/hiagawus-rg/providers/Microsoft.Compute/virtualMachines/hiagaCRRRVM23\"\r\n },\r\n \"protectedPrimaryRegion\": \"westus\",\r\n \"dataSourceSetInfo\": {\r\n \"resourceLocation\": \"westus\",\r\n \"datasourceType\": \"Microsoft.Compute/virtualMachines\",\r\n \"objectType\": \"DatasourceSetInfo\",\r\n \"resourceID\": \"/subscriptions/f879818f-5b29-4a43-8961-34169783144f/resourceGroups/hiagawus-rg/providers/Microsoft.Compute/virtualMachines/hiagaCRRRVM23\"\r\n },\r\n \"policyName\": \"\",\r\n \"sourceResourceId\": \"/subscriptions/f879818f-5b29-4a43-8961-34169783144f/resourceGroups/hiagawus-rg/providers/Microsoft.Compute/virtualMachines/hiagaCRRRVM23\",\r\n \"isArchiveEnabled\": false,\r\n \"lastBackupStatus\": \"Completed\",\r\n \"isInlineInquiry\": null,\r\n \"lastBackupTime\": \"2025-09-25T12:15:31.2701315Z\",\r\n \"backupSetName\": null,\r\n \"vaultId\": \"/subscriptions/f879818f-5b29-4a43-8961-34169783144f/providers/Microsoft.RecoveryServices/locations/westus/deletedVaults/hiagawus-rg_a957eb97-ecba-46c6-94a1-a03173ab47a6\",\r\n \"kpisHealths\": null,\r\n \"isRehydrate\": null,\r\n \"policyInfo\": {\r\n \"policyId\": \"\",\r\n \"name\": \"\"\r\n },\r\n \"createMode\": null,\r\n \"protectedItemDataId\": \"193515495398405\",\r\n \"extendedProperties\": {\r\n \"diskExclusionProperties\": null,\r\n \"linuxVmApplicationName\": \"\"\r\n },\r\n \"virtualMachineId\": \"/subscriptions/f879818f-5b29-4a43-8961-34169783144f/resourceGroups/hiagawus-rg/providers/Microsoft.Compute/virtualMachines/hiagaCRRRVM23\",\r\n \"healthDetails\": [\r\n {\r\n \"recommendations\": [],\r\n \"message\": \"Backup pre-check status of this virtual machine is OK.\",\r\n \"code\": 400239,\r\n \"title\": \"IaasVmHealthGreenDefault\"\r\n }\r\n ],\r\n \"policyType\": \"\",\r\n \"healthStatus\": \"Passed\",\r\n \"protectedSecondaryRegion\": \"eastus\"\r\n },\r\n \"tags\": null\r\n },\r\n {\r\n \"id\": \"/subscriptions/f879818f-5b29-4a43-8961-34169783144f/providers/Microsoft.RecoveryServices/locations/westus/deletedVaults/hiagawus-rg_a957eb97-ecba-46c6-94a1-a03173ab47a6/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainerv2;hiagawus-rg;hiagawuscrr-vm/protectedItems/VM;iaasvmcontainerv2;hiagawus-rg;hiagawuscrr-vm\",\r\n \"type\": \"microsoft.recoveryservices/locations/deletedvaults/backupfabrics/protectioncontainers/protecteditems\",\r\n \"name\": \"VM;iaasvmcontainerv2;hiagawus-rg;hiagawuscrr-vm\",\r\n \"location\": \"westus\",\r\n \"resourceGroup\": \"\",\r\n \"subscriptionId\": \"f879818f-5b29-4a43-8961-34169783144f\",\r\n \"dataSourceType\": \"AzureIaasVM/VM\",\r\n \"properties\": {\r\n \"backupManagementType\": \"AzureIaasVM\",\r\n \"sourceSideScanInfo\": {\r\n \"sourceSideScanSummary\": \"Unknown\",\r\n \"sourceSideScanStatus\": \"NotConfigured\"\r\n },\r\n \"isAzureManagedLinkedResource\": true,\r\n \"dataSourceId\": \"hiagawusCRR-vm\",\r\n \"deferredDeleteTimeRemaining\": \"11.07:11:32.7872163\",\r\n \"allowedOperations\": [\r\n \"Undelete\"\r\n ],\r\n \"protectionStatus\": \"Healthy\",\r\n \"configuredRPGenerationFrequencyInSecondaryRegion\": \"-10675199.02:48:05.4775808\",\r\n \"containerName\": \"iaasvmcontainerv2;hiagawus-rg;hiagawuscrr-vm\",\r\n \"configuredMaximumRetentionInSecondaryRegion\": \"-10675199.02:48:05.4775808\",\r\n \"extendedInfo\": {\r\n \"oldestRecoveryPoint\": \"2025-08-17T12:09:41.6690793Z\",\r\n \"newestRecoveryPointInArchive\": null,\r\n \"oldestRecoveryPointInArchive\": null,\r\n \"oldestRecoveryPointInVault\": null,\r\n \"recoveryPointCount\": 32,\r\n \"policyInconsistent\": false\r\n },\r\n \"friendlyName\": \"hiagawusCRR-vm\",\r\n \"currentProtectionState\": \"SoftDeleted\",\r\n \"oldestRecoveryPointInSecondaryRegion\": \"2025-08-17T12:09:41.6690793Z\",\r\n \"rpoWarningThresholdInSecondaryRegion\": \"-10675199.02:48:05.4775808\",\r\n \"latestRecoveryPointInSecondaryRegion\": \"2025-09-25T12:09:14.7355564Z\",\r\n \"rpoWarningThresholdInPrimaryRegion\": \"-10675199.02:48:05.4775808\",\r\n \"policyId\": \"\",\r\n \"protectionStateInSecondaryRegion\": \"ProtectionStopped\",\r\n \"resourceGuardOperationRequests\": null,\r\n \"isDeferredDeleteScheduleUpcoming\": null,\r\n \"configuredRPGenerationFrequency\": \"-10675199.02:48:05.4775808\",\r\n \"workloadType\": \"VM\",\r\n \"protectedItemType\": \"Microsoft.Compute/virtualMachines\",\r\n \"isScheduledForDeferredDelete\": true,\r\n \"lastRecoveryPoint\": \"2025-09-25T12:09:14.7355564Z\",\r\n \"configuredMaximumRetention\": \"-10675199.02:48:05.4775808\",\r\n \"protectionState\": \"ProtectionStopped\",\r\n \"softDeleteRetentionPeriod\": 14,\r\n \"deferredDeleteTimeInUTC\": \"2025-09-26T10:00:52.5983457Z\",\r\n \"dataSourceInfo\": {\r\n \"resourceLocation\": \"westus\",\r\n \"datasourceType\": \"Microsoft.Compute/virtualMachines\",\r\n \"objectType\": \"DatasourceInfo\",\r\n \"resourceID\": \"/subscriptions/f879818f-5b29-4a43-8961-34169783144f/resourceGroups/hiagawus-rg/providers/Microsoft.Compute/virtualMachines/hiagawusCRR-vm\"\r\n },\r\n \"protectedPrimaryRegion\": \"westus\",\r\n \"dataSourceSetInfo\": {\r\n \"resourceLocation\": \"westus\",\r\n \"datasourceType\": \"Microsoft.Compute/virtualMachines\",\r\n \"objectType\": \"DatasourceSetInfo\",\r\n \"resourceID\": \"/subscriptions/f879818f-5b29-4a43-8961-34169783144f/resourceGroups/hiagawus-rg/providers/Microsoft.Compute/virtualMachines/hiagawusCRR-vm\"\r\n },\r\n \"policyName\": \"\",\r\n \"sourceResourceId\": \"/subscriptions/f879818f-5b29-4a43-8961-34169783144f/resourceGroups/hiagawus-rg/providers/Microsoft.Compute/virtualMachines/hiagawusCRR-vm\",\r\n \"isArchiveEnabled\": false,\r\n \"lastBackupStatus\": \"Completed\",\r\n \"isInlineInquiry\": null,\r\n \"lastBackupTime\": \"2025-09-25T12:09:11.5400262Z\",\r\n \"backupSetName\": null,\r\n \"vaultId\": \"/subscriptions/f879818f-5b29-4a43-8961-34169783144f/providers/Microsoft.RecoveryServices/locations/westus/deletedVaults/hiagawus-rg_a957eb97-ecba-46c6-94a1-a03173ab47a6\",\r\n \"kpisHealths\": null,\r\n \"isRehydrate\": null,\r\n \"policyInfo\": {\r\n \"policyId\": \"\",\r\n \"name\": \"\"\r\n },\r\n \"createMode\": null,\r\n \"protectedItemDataId\": \"193514920098137\",\r\n \"extendedProperties\": {\r\n \"diskExclusionProperties\": null,\r\n \"linuxVmApplicationName\": \"\"\r\n },\r\n \"virtualMachineId\": \"/subscriptions/f879818f-5b29-4a43-8961-34169783144f/resourceGroups/hiagawus-rg/providers/Microsoft.Compute/virtualMachines/hiagawusCRR-vm\",\r\n \"healthDetails\": [\r\n {\r\n \"recommendations\": [],\r\n \"message\": \"Backup pre-check status of this virtual machine is OK.\",\r\n \"code\": 400239,\r\n \"title\": \"IaasVmHealthGreenDefault\"\r\n }\r\n ],\r\n \"policyType\": \"\",\r\n \"healthStatus\": \"Passed\",\r\n \"protectedSecondaryRegion\": \"eastus\"\r\n },\r\n \"tags\": null\r\n }\r\n ],\r\n \"facets\": [],\r\n \"resultTruncated\": \"false\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/f879818f-5b29-4a43-8961-34169783144f/providers/Microsoft.RecoveryServices/locations/westus/deletedVaults/hiagawus-rg_a957eb97-ecba-46c6-94a1-a03173ab47a6/undelete?api-version=2025-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjg3OTgxOGYtNWIyOS00YTQzLTg5NjEtMzQxNjk3ODMxNDRmL3Byb3ZpZGVycy9NaWNyb3NvZnQuUmVjb3ZlcnlTZXJ2aWNlcy9sb2NhdGlvbnMvd2VzdHVzL2RlbGV0ZWRWYXVsdHMvaGlhZ2F3dXMtcmdfYTk1N2ViOTctZWNiYS00NmM2LTk0YTEtYTAzMTczYWI0N2E2L3VuZGVsZXRlP2FwaS12ZXJzaW9uPTIwMjUtMDgtMDE=", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept-Language": [ + "en-US" + ], + "x-ms-client-request-id": [ + "100d9964-1a1e-4b7b-bbf9-a981ec10873f" + ], + "User-Agent": [ + "FxVersion/8.0.2025.41914", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.26100", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/7.8.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "141" + ] + }, + "RequestBody": "{\r\n \"properties\": {\r\n \"recoveryResourceGroupId\": \"/subscriptions/f879818f-5b29-4a43-8961-34169783144f/resourceGroups/hiagawus-rg\"\r\n }\r\n}", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/f879818f-5b29-4a43-8961-34169783144f/providers/Microsoft.RecoveryServices/locations/westus/deletedVaults/hiagawus-rg_a957eb97-ecba-46c6-94a1-a03173ab47a6/operations/b89373fa-3988-4543-934f-f3379b325239?api-version=2025-08-01&t=638947113857630343&c=MIIIpTCCBo2gAwIBAgITFgGt2JEpNowfqCnGHAABAa3YkTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZP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orcznQffBeqYHKDoKrwaxPJZMQ&h=pm7r5_O4EA-ew7GH1MFv2ltGM3piPPu4LKrpEmwp6Xw" + ], + "Retry-After": [ + "60" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/f879818f-5b29-4a43-8961-34169783144f/providers/Microsoft.RecoveryServices/locations/westus/deletedVaults/hiagawus-rg_a957eb97-ecba-46c6-94a1-a03173ab47a6/operations/b89373fa-3988-4543-934f-f3379b325239?api-version=2025-08-01&t=638947113857630343&c=MIIIpTCCBo2gAwIBAgITFgGt2JEpNowfqCnGHAABAa3YkTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDMwHhcNMjUwNzE5MTQ1NzQwWhcNMjYwMTE1MTQ1NzQwWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL5TQVW0Qals2t66nORtdmQwb00kVPjniCGDLLX4mwKZ-fxkHqwHO7g_esL2deyq8HcN36C0DLwWukkoVGn0ufXbKd1pJ4b5N_sx4zsPY-9cZffSeCobK9SMjDw_Z2FngZDr6jynqhn1LqM5oTNDC7WkeOTSdwhN3w0-wgZgYR6l5slOSYIk0nAkZj-Pt4UIneFIDrvRJ0f0vA3lPPcQ94RHxKqVM21jHUI1dgUO5gb4nv5xUsEJBSTgKA9pH4sWzyETRwvAn6ZtvhRLAT4VGssZKaNe9Fd-Fpp40QwiARBKySjS1MpVsyVhuGwxdWHhXfUscU5Ux_dlfgHy3RvE4PUCAwEAAaOCBJIwggSOMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDj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W3rMpuHJ5YsLmwsmVRl75UWaMJMBHcE71_39&s=n4Hm6369m8WiYXTNHsjiEBom_8bm9O3N10xD1dDc5Mrzi_-KI4X2N1wescefpEan5Ky3gMaOBmkqGZ87XmkXhat2zrV5pAjzApXCbwSyl9cz_1TFNtwzn2XvuVMUm_aMdVmW_lsjGHTPXVJd7IKaunYnEQ_kKTdkPx0nE0g6oXPfkzwzs9wiS5OY94elIaDMigUQoXrPMBFCHqpf7JTr8VQtj4L6zZplVud1zBQvimv6UFdvs6B1nljtzWR_VmR71WCRx6o6x0paCqxiBqiIPXEIzdyj71JSJzUCHx7dqEE3LRnW3nS3qCgVdPtHorcznQffBeqYHKDoKrwaxPJZMQ&h=pm7r5_O4EA-ew7GH1MFv2ltGM3piPPu4LKrpEmwp6Xw" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "00000000-0000-0000-0000-000000000000" + ], + "x-ms-client-request-id": [ + "00000000-0000-0000-0000-000000000000" + ], + "x-ms-operation-identifier": [ + "tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=8bf5ba20-c970-4c38-b2a6-95f5726c959a/southeastasia/fdb88959-25cb-4a2f-b94a-9729cb9c52af" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "799" + ], + "x-ms-ratelimit-remaining-subscription-global-writes": [ + "11999" + ], + "x-ms-correlation-request-id": [ + "75918e16-21b3-429c-9258-86281848988f" + ], + "x-ms-routing-request-id": [ + "SOUTHEASTASIA:20250929T025625Z:75918e16-21b3-429c-9258-86281848988f" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: 39D83AB5734C495FB775172019969AB3 Ref B: MAA201060514023 Ref C: 2025-09-29T02:56:25Z" + ], + "Date": [ + "Mon, 29 Sep 2025 02:56:25 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/f879818f-5b29-4a43-8961-34169783144f/providers/Microsoft.RecoveryServices/locations/westus/deletedVaults/hiagawus-rg_a957eb97-ecba-46c6-94a1-a03173ab47a6/operations/b89373fa-3988-4543-934f-f3379b325239?api-version=2025-08-01&t=638947113857630343&c=MIIIpTCCBo2gAwIBAgITFgGt2JEpNowfqCnGHAABAa3YkTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDMwHhcNMjUwNzE5MTQ1NzQwWhcNMjYwMTE1MTQ1NzQwWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL5TQVW0Qals2t66nORtdmQwb00kVPjniCGDLLX4mwKZ-fxkHqwHO7g_esL2deyq8HcN36C0DLwWukkoVGn0ufXbKd1pJ4b5N_sx4zsPY-9cZffSeCobK9SMjDw_Z2FngZDr6jynqhn1LqM5oTNDC7WkeOTSdwhN3w0-wgZgYR6l5slOSYIk0nAkZj-Pt4UIneFIDrvRJ0f0vA3lPPcQ94RHxKqVM21jHUI1dgUO5gb4nv5xUsEJBSTgKA9pH4sWzyETRwvAn6ZtvhRLAT4VGssZKaNe9Fd-Fpp40QwiARBKySjS1MpVsyVhuGwxdWHhXfUscU5Ux_dlfgHy3RvE4PUCAwEAAaOCBJIwggSOMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFghfmRS4WsmTQCAWQCAQcwggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlp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User-Agent": [ + "FxVersion/8.0.2025.41914", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.26100", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/7.8.0" + ] + }, + "RequestBody": "", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-operation-identifier": [ + "tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=8bf5ba20-c970-4c38-b2a6-95f5726c959a/southeastasia/22e88860-e366-4feb-8dc9-fd8c47f7c449" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "d1217b1e-b22c-49dc-94f1-3961d1b5ffde" + ], + "x-ms-client-request-id": [ + "100d9964-1a1e-4b7b-bbf9-a981ec10873f" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "249" + ], + "x-ms-correlation-request-id": [ + "d1217b1e-b22c-49dc-94f1-3961d1b5ffde" + ], + "x-ms-routing-request-id": [ + "SOUTHEASTASIA:20250929T025726Z:d1217b1e-b22c-49dc-94f1-3961d1b5ffde" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: BDE0A333B9F441DC892157BF98B4A3E9 Ref B: MAA201060514023 Ref C: 2025-09-29T02:57:25Z" + ], + "Date": [ + "Mon, 29 Sep 2025 02:57:25 GMT" + ], + "Content-Length": [ + "376" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/f879818f-5b29-4a43-8961-34169783144f/providers/Microsoft.RecoveryServices/locations/westus/deletedVaults/hiagawus-rg_a957eb97-ecba-46c6-94a1-a03173ab47a6/operations/b89373fa-3988-4543-934f-f3379b325239\",\r\n \"name\": \"b89373fa-3988-4543-934f-f3379b325239\",\r\n \"status\": \"Succeeded\",\r\n \"startTime\": \"2025-09-29T02:56:25.6285828Z\",\r\n \"endTime\": \"2025-09-29T02:57:26.5221359Z\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/f879818f-5b29-4a43-8961-34169783144f/providers/Microsoft.RecoveryServices/locations/westus/deletedVaults/hiagawus-rg_a957eb97-ecba-46c6-94a1-a03173ab47a6/operations/b89373fa-3988-4543-934f-f3379b325239?api-version=2025-08-01&t=638947113857630343&c=MIIIpTCCBo2gAwIBAgITFgGt2JEpNowfqCnGHAABAa3YkTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDMwHhcNMjUwNzE5MTQ1NzQwWhcNMjYwMTE1MTQ1NzQwWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL5TQVW0Qals2t66nORtdmQwb00kVPjniCGDLLX4mwKZ-fxkHqwHO7g_esL2deyq8HcN36C0DLwWukkoVGn0ufXbKd1pJ4b5N_sx4zsPY-9cZffSeCobK9SMjDw_Z2FngZDr6jynqhn1LqM5oTNDC7WkeOTSdwhN3w0-wgZgYR6l5slOSYIk0nAkZj-Pt4UIneFIDrvRJ0f0vA3lPPcQ94RHxKqVM21jHUI1dgUO5gb4nv5xUsEJBSTgKA9pH4sWzyETRwvAn6ZtvhRLAT4VGssZKaNe9Fd-Fpp40QwiARBKySjS1MpVsyVhuGwxdWHhXfUscU5Ux_dlfgHy3RvE4PUCAwEAAaOCBJIwggSOMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFghfmRS4WsmTQCAW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"x-ms-client-request-id": [ + "100d9964-1a1e-4b7b-bbf9-a981ec10873f" + ], + "User-Agent": [ + "FxVersion/8.0.2025.41914", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.26100", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/7.8.0" + ] + }, + "RequestBody": "", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-operation-identifier": [ + "tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=8bf5ba20-c970-4c38-b2a6-95f5726c959a/southeastasia/3c93f29c-b315-496f-873a-c7c6b269d2b1" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "f2e219f7-b736-469e-9ab9-9c98f3698d8e" + ], + "x-ms-client-request-id": [ + "100d9964-1a1e-4b7b-bbf9-a981ec10873f" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "248" + ], + "x-ms-correlation-request-id": [ + "f2e219f7-b736-469e-9ab9-9c98f3698d8e" + ], + "x-ms-routing-request-id": [ + "SOUTHEASTASIA:20250929T025726Z:f2e219f7-b736-469e-9ab9-9c98f3698d8e" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: 3B747183A91544B39594FDAEEB8C5109 Ref B: MAA201060514023 Ref C: 2025-09-29T02:57:26Z" + ], + "Date": [ + "Mon, 29 Sep 2025 02:57:26 GMT" + ], + "Content-Length": [ + "376" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/f879818f-5b29-4a43-8961-34169783144f/providers/Microsoft.RecoveryServices/locations/westus/deletedVaults/hiagawus-rg_a957eb97-ecba-46c6-94a1-a03173ab47a6/operations/b89373fa-3988-4543-934f-f3379b325239\",\r\n \"name\": \"b89373fa-3988-4543-934f-f3379b325239\",\r\n \"status\": \"Succeeded\",\r\n \"startTime\": \"2025-09-29T02:56:25.6285828Z\",\r\n \"endTime\": \"2025-09-29T02:57:26.912756Z\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/f879818f-5b29-4a43-8961-34169783144f/resourceGroups/hiagawus-rg/providers/Microsoft.RecoveryServices/vaults/hiagawusCRR-vault?api-version=2025-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjg3OTgxOGYtNWIyOS00YTQzLTg5NjEtMzQxNjk3ODMxNDRmL3Jlc291cmNlR3JvdXBzL2hpYWdhd3VzLXJnL3Byb3ZpZGVycy9NaWNyb3NvZnQuUmVjb3ZlcnlTZXJ2aWNlcy92YXVsdHMvaGlhZ2F3dXNDUlItdmF1bHQ/YXBpLXZlcnNpb249MjAyNS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept-Language": [ + "en-US" + ], + "x-ms-client-request-id": [ + "eb9474b6-ace3-4954-b456-e19baea26e05" + ], + "User-Agent": [ + "FxVersion/8.0.2025.41914", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.26100", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/7.8.0" + ] + }, + "RequestBody": "", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "1099" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "89a19710-89bb-4c6a-8e1f-560b6bff2773" + ], + "x-ms-client-request-id": [ + "eb9474b6-ace3-4954-b456-e19baea26e05" + ], + "x-ms-ratelimit-remaining-subscription-global-reads": [ + "16499" + ], + "x-ms-correlation-request-id": [ + "89a19710-89bb-4c6a-8e1f-560b6bff2773" + ], + "x-ms-routing-request-id": [ + "WESTUS:20250929T025758Z:89a19710-89bb-4c6a-8e1f-560b6bff2773" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: 9E38DBFDBEDC4F4091F10D1DF658D0A0 Ref B: MAA201060513019 Ref C: 2025-09-29T02:57:58Z" + ], + "Date": [ + "Mon, 29 Sep 2025 02:57:57 GMT" + ], + "Content-Length": [ + "932" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"location\": \"westus\",\r\n \"name\": \"hiagawusCRR-vault\",\r\n \"etag\": \"W/\\\"datetime'2025-09-29T02%3A56%3A29.3183212Z'\\\"\",\r\n \"tags\": {\r\n \"MABUsed\": \"Yes\",\r\n \"Owner\": \"hiaga\",\r\n \"DeleteBy\": \"10-2021\",\r\n \"Purpose\": \"Testing\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"privateEndpointStateForBackup\": \"None\",\r\n \"privateEndpointStateForSiteRecovery\": \"None\",\r\n \"securitySettings\": {\r\n \"multiUserAuthorization\": \"Invalid\",\r\n \"sourceScanConfiguration\": {\r\n \"state\": \"Disabled\"\r\n }\r\n },\r\n \"redundancySettings\": {\r\n \"standardTierStorageRedundancy\": \"GeoRedundant\",\r\n \"crossRegionRestore\": \"Enabled\"\r\n },\r\n \"secureScore\": \"None\",\r\n \"bcdrSecurityLevel\": \"Poor\",\r\n \"publicNetworkAccess\": \"Enabled\",\r\n \"restoreSettings\": {\r\n \"crossSubscriptionRestoreSettings\": {\r\n \"crossSubscriptionRestoreState\": \"Enabled\"\r\n }\r\n }\r\n },\r\n \"id\": \"/subscriptions/f879818f-5b29-4a43-8961-34169783144f/resourceGroups/hiagawus-rg/providers/Microsoft.RecoveryServices/vaults/hiagawusCRR-vault\",\r\n \"type\": \"Microsoft.RecoveryServices/vaults\",\r\n \"sku\": {\r\n \"name\": \"RS0\",\r\n \"tier\": \"Standard\"\r\n }\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/f879818f-5b29-4a43-8961-34169783144f/resourceGroups/hiagawus-rg/providers/Microsoft.RecoveryServices/vaults/hiagawusCRR-vault?api-version=2025-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjg3OTgxOGYtNWIyOS00YTQzLTg5NjEtMzQxNjk3ODMxNDRmL3Jlc291cmNlR3JvdXBzL2hpYWdhd3VzLXJnL3Byb3ZpZGVycy9NaWNyb3NvZnQuUmVjb3ZlcnlTZXJ2aWNlcy92YXVsdHMvaGlhZ2F3dXNDUlItdmF1bHQ/YXBpLXZlcnNpb249MjAyNS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept-Language": [ + "en-US" + ], + "x-ms-client-request-id": [ + "453128ca-f93b-4a76-9c36-8444e3b315c5" + ], + "User-Agent": [ + "FxVersion/8.0.2025.41914", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.26100", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/7.8.0" + ] + }, + "RequestBody": "", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-failure-cause": [ + "gateway" + ], + "x-ms-request-id": [ + "5dd35db0-6f15-4204-a0bb-15eee83d5867" + ], + "x-ms-correlation-request-id": [ + "5dd35db0-6f15-4204-a0bb-15eee83d5867" + ], + "x-ms-routing-request-id": [ + "SOUTHEASTASIA:20250929T025936Z:5dd35db0-6f15-4204-a0bb-15eee83d5867" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: A622BA390A6342109C3C4B813E428964 Ref B: MAA201060513023 Ref C: 2025-09-29T02:59:36Z" + ], + "Date": [ + "Mon, 29 Sep 2025 02:59:35 GMT" + ], + "Content-Length": [ + "234" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"The Resource 'Microsoft.RecoveryServices/vaults/hiagawusCRR-vault' under resource group 'hiagawus-rg' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix\"\r\n }\r\n}", + "StatusCode": 404 + }, + { + "RequestUri": "/subscriptions/f879818f-5b29-4a43-8961-34169783144f/resourceGroups/hiagawus-rg/providers/Microsoft.RecoveryServices/vaults/hiagawusCRR-vault?api-version=2025-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjg3OTgxOGYtNWIyOS00YTQzLTg5NjEtMzQxNjk3ODMxNDRmL3Jlc291cmNlR3JvdXBzL2hpYWdhd3VzLXJnL3Byb3ZpZGVycy9NaWNyb3NvZnQuUmVjb3ZlcnlTZXJ2aWNlcy92YXVsdHMvaGlhZ2F3dXNDUlItdmF1bHQ/YXBpLXZlcnNpb249MjAyNS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept-Language": [ + "en-US" + ], + "x-ms-client-request-id": [ + "93bce773-dc85-4d49-b2af-e4374217706b" + ], + "User-Agent": [ + "FxVersion/8.0.2025.41914", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.26100", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/7.8.0" + ] + }, + "RequestBody": "", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-failure-cause": [ + "gateway" + ], + "x-ms-request-id": [ + "2f38acb7-34b3-4edf-8be3-36d70313d8f5" + ], + "x-ms-correlation-request-id": [ + "2f38acb7-34b3-4edf-8be3-36d70313d8f5" + ], + "x-ms-routing-request-id": [ + "WESTUS:20250929T025937Z:2f38acb7-34b3-4edf-8be3-36d70313d8f5" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: 0B88D866E7204C1D93844405C630B966 Ref B: MAA201060513011 Ref C: 2025-09-29T02:59:37Z" + ], + "Date": [ + "Mon, 29 Sep 2025 02:59:37 GMT" + ], + "Content-Length": [ + "234" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"The Resource 'Microsoft.RecoveryServices/vaults/hiagawusCRR-vault' under resource group 'hiagawus-rg' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix\"\r\n }\r\n}", + "StatusCode": 404 + }, + { + "RequestUri": "/subscriptions/f879818f-5b29-4a43-8961-34169783144f/resourceGroups/hiagawus-rg/providers/Microsoft.RecoveryServices/vaults/hiagawusCRR-vault?api-version=2025-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjg3OTgxOGYtNWIyOS00YTQzLTg5NjEtMzQxNjk3ODMxNDRmL3Jlc291cmNlR3JvdXBzL2hpYWdhd3VzLXJnL3Byb3ZpZGVycy9NaWNyb3NvZnQuUmVjb3ZlcnlTZXJ2aWNlcy92YXVsdHMvaGlhZ2F3dXNDUlItdmF1bHQ/YXBpLXZlcnNpb249MjAyNS0wOC0wMQ==", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept-Language": [ + "en-US" + ], + "x-ms-client-request-id": [ + "beb8de97-bbeb-411f-b619-efd9bcfbd663" + ], + "User-Agent": [ + "FxVersion/8.0.2025.41914", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.26100", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/7.8.0" + ] + }, + "RequestBody": "", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/f879818f-5b29-4a43-8961-34169783144f/resourceGroups/hiagawus-rg/providers/Microsoft.Recove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aOXJcf0B3m0aOxVhKaev5pJxZ4xV5JTVQcLNm_p33kTEdhTt8_O2j5dTn3KUc8nv8NFE0dwpXIFdGTqprzbC3HCTE1n_51ndjxGXZ8YTOk9Il4yWEGxAjUMmPg7d-nqqLcKZrsWUB7bZuO7LOA0RSdaNJPbEp0Jl9CZ2EiMxEBPhOF3HO8rBvDRjwsbOcyybqbimF3zeOQBJEUX57XuTZonQ&h=4L6cDKDNPCKcv6NdyfK099DwUwHXA-E3h4jVvbRWwj0" + ], + "Retry-After": [ + "60" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/f879818f-5b29-4a43-8961-34169783144f/resourceGroups/hiagawus-rg/providers/Microsoft.RecoveryServices/vaults/hiagawusCRR-vault/operationStatus/MTAyMztkOTcwZjQxMC00NWM5LTRmYmMtODIwNS02OTIwMDE0MmU3MzQ=?api-version=2025-08-01&t=638947114840312687&c=MIIIpTCCBo2gAwIBAgITFgGt2JEpNowfqCnGHAABAa3YkTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDMwHhcNMjUwNzE5MTQ1NzQwWhcNMjYwMTE1MTQ1NzQwWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL5TQVW0Qals2t66nORtdmQwb00kVPjniCGDLLX4mwKZ-fxkHqwHO7g_esL2deyq8HcN36C0DLwWukkoVGn0ufXbKd1pJ4b5N_sx4zsPY-9cZffSeCobK9SMjDw_Z2FngZDr6jynqhn1LqM5oTNDC7WkeOTSdwhN3w0-wgZgYR6l5slOSYIk0nAkZj-Pt4UIneFIDrvRJ0f0vA3lPPcQ94RHxKqVM21jHUI1dgUO5gb4nv5xUsEJBSTg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WhUZ3mReiEiPAQbpA9wLUYLD7dkPDG5rJSpGnHGchUX-pvHsmlMmM5s9exP-Hxg6BSoQ8-7gO-SvTPuUVHK_3aCp7hNpoyD3cosIrbNQC5Fyi7rRlHTOKuttA9ZZQYWafSnDXdrpHBegHh2RFywnulrzw9pqevDo5FG-M6WUlsPV6lm9aGRWuXs98kExP_g3yzbXRfZ2MaG7c_G6aX2W3rMpuHJ5YsLmwsmVRl75UWaMJMBHcE71_39&s=Dz0xZ67hF1dk6_DYQyZag3WowXTHqvGdHeoepUcOXrh5q-djNs3mu00UIjvVQzPiGh4OJaEr1ZEXejcZZzx63ZAcKoX5fxU2LnfzQqdVzwpr5TMxW5YJ3dK_yc5ZvjPlBhAIXv_GNeWDOioKlIT8ST2C_uoYMJ-dyDMgAwwzUD6lQ6PyZVHBOjSSxUvvaae_4PqRHILGszbdov-8x7Lc79JE0Q8vj7jbx5g2iUivZfmQ9INS2Pig93AKojAOL2txTpWtMNduYVALUDtwsWk0tuPfzYfUWOVpC6DqbmBDIPi7CUJ6VMqp3gALHA-QQW0CE-5XgmO06HPAB4C3qldLxg&h=EYkgiM3j2cVnwK2oKVe4tfH5fb4gNKLDn2RJhKCaZSo" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "00000000-0000-0000-0000-000000000000" + ], + "x-ms-client-request-id": [ + "00000000-0000-0000-0000-000000000000" + ], + "x-ms-operation-identifier": [ + "tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=8bf5ba20-c970-4c38-b2a6-95f5726c959a/southeastasia/3ea7372f-c409-40d7-afa0-4d5ce6916f66" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "99" + ], + "x-ms-correlation-request-id": [ + "64d1683d-d8c0-49bb-8aa6-acdfef6ff993" + ], + "x-ms-routing-request-id": [ + "SOUTHEASTASIA:20250929T025804Z:64d1683d-d8c0-49bb-8aa6-acdfef6ff993" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: 0B22D6D74B39494987168C4D705B598D Ref B: MAA201060516045 Ref C: 2025-09-29T02:58:00Z" + ], + "Date": [ + "Mon, 29 Sep 2025 02:58:03 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/f879818f-5b29-4a43-8961-34169783144f/resourceGroups/hiagawus-rg/providers/Microsoft.RecoveryServices/vaults/hiagawusCRR-vault/operationStatus/MTAyMztkOTcwZjQxMC00NWM5LTRmYmMtODIwNS02OTIwMDE0MmU3MzQ=?api-version=2025-08-01&t=638947114840312687&c=MIIIpTCCBo2gAwIBAgITFgGt2JEpNowfqCnGHAABAa3YkTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDMwHhcNMjUwNzE5MTQ1NzQwWhcNMjYwMTE1MTQ1NzQwWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL5TQVW0Qals2t66nORtdmQwb00kVPjniCGDLLX4mwKZ-fxkHqwHO7g_esL2deyq8HcN36C0DLwWukkoVGn0ufXbKd1pJ4b5N_sx4zsPY-9cZffSeCobK9SMjDw_Z2FngZDr6jynqhn1LqM5oTNDC7WkeOTSdwhN3w0-wgZgYR6l5slOSYIk0nAkZj-Pt4UIneFIDrvRJ0f0vA3lPPcQ94RHxKqVM21jHUI1dgUO5gb4nv5xUsEJBSTgKA9pH4sWzyETRwvAn6ZtvhRLAT4VGssZKaNe9Fd-Fpp40QwiARBKySjS1MpVsyVhuGwxdWHhXfUscU5Ux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QZnpZZlVXT1ZwQzZEcWJtQkRJUGk3Q1VKNlZNcXAzZ0FMSEEtUVFXMENFLTVYZ21PMDZIUEFCNEMzcWxkTHhnJmg9RVlrZ2lNM2oyY1Zud0syb0tWZTR0Zkg1ZmI0Z05LTERuMlJKaEtDYVpTbw==", + "RequestMethod": "GET", + "RequestHeaders": { + "x-ms-client-request-id": [ + "beb8de97-bbeb-411f-b619-efd9bcfbd663" + ], + "User-Agent": [ + "FxVersion/8.0.2025.41914", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.26100", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/7.8.0" + ] + }, + "RequestBody": "", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "b4feca49-f52e-46ac-bbb9-8d736f90ee31" + ], + "x-ms-client-request-id": [ + "beb8de97-bbeb-411f-b619-efd9bcfbd663" + ], + "x-ms-operation-identifier": [ + "tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=8bf5ba20-c970-4c38-b2a6-95f5726c959a/westus/3e49f42f-154c-4db0-9d6d-8be661812ea1" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "1099" + ], + "x-ms-ratelimit-remaining-subscription-global-reads": [ + "16499" + ], + "x-ms-correlation-request-id": [ + "b4feca49-f52e-46ac-bbb9-8d736f90ee31" + ], + "x-ms-routing-request-id": [ + "WESTUS:20250929T025904Z:b4feca49-f52e-46ac-bbb9-8d736f90ee31" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: F7021AFD9467491D86C5F7B815F25CE4 Ref B: MAA201060516045 Ref C: 2025-09-29T02:59:04Z" + ], + "Date": [ + "Mon, 29 Sep 2025 02:59:04 GMT" + ], + "Content-Length": [ + "326" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/f879818f-5b29-4a43-8961-34169783144f/resourceGroups/hiagawus-rg/providers/Microsoft.RecoveryServices/vaults/hiagawusCRR-vault/operationStatus/MTAyMztkOTcwZjQxMC00NWM5LTRmYmMtODIwNS02OTIwMDE0MmU3MzQ=\",\r\n \"name\": \"MTAyMztkOTcwZjQxMC00NWM5LTRmYmMtODIwNS02OTIwMDE0MmU3MzQ=\",\r\n \"status\": \"Succeeded\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/f879818f-5b29-4a43-8961-34169783144f/resourceGroups/hiagawus-rg/providers/Microsoft.RecoveryServices/vaults/hiagawusCRR-vault/operationResults/MTAyMztkOTcwZjQxMC00NWM5LTRmYmMtODIwNS02OTIwMDE0MmU3MzQ=?api-version=2025-08-01&t=638947114840312687&c=MIIIpTCCBo2gAwIBAgITFgGt2JEpNowfqCnGHAABAa3YkTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDMwHhcNMjUwNzE5MTQ1NzQwWhcNMjYwMTE1MTQ1NzQwWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL5TQVW0Qals2t66nORtdmQwb00kVPjniCGDLLX4mwKZ-fxkHqwHO7g_esL2deyq8HcN36C0DLwWukkoVGn0ufXbKd1pJ4b5N_sx4zsPY-9cZffSeCobK9SMjDw_Z2FngZDr6jynqhn1LqM5oTNDC7WkeOTSdwhN3w0-wgZgYR6l5slOSYIk0nAkZj-Pt4UIneFIDrvRJ0f0vA3lPPcQ94RHxKqVM21jHUI1dgUO5gb4nv5xUsEJB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2s5SWw0eVdFR3hBalVNbVBnN2QtbnFxTGNLWnJzV1VCN2JadU83TE9BMFJTZGFOSlBiRXAwSmw5Q1oyRWlNeEVCUGhPRjNITzhyQnZEUmp3c2JPY3l5YnFiaW1GM3plT1FCSkVVWDU3WHVUWm9uUSZoPTRMNmNES0ROUENLY3Y2TmR5ZkswOTlEd1V3SFhBLUUzaDRqVnZiUld3ajA=", + "RequestMethod": "GET", + "RequestHeaders": { + "x-ms-client-request-id": [ + "beb8de97-bbeb-411f-b619-efd9bcfbd663" + ], + "User-Agent": [ + "FxVersion/8.0.2025.41914", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.26100", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/7.8.0" + ] + }, + "RequestBody": "", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "00000000-0000-0000-0000-000000000000" + ], + "x-ms-client-request-id": [ + "00000000-0000-0000-0000-000000000000" + ], + "x-ms-operation-identifier": [ + "tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=8bf5ba20-c970-4c38-b2a6-95f5726c959a/westus/ed9a881a-9f29-4df4-a166-7da7db09c31c" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "1098" + ], + "x-ms-ratelimit-remaining-subscription-global-reads": [ + "16498" + ], + "x-ms-correlation-request-id": [ + "c47ae9e5-0d65-4816-b4cc-ae3d63dbe770" + ], + "x-ms-routing-request-id": [ + "WESTUS:20250929T025904Z:c47ae9e5-0d65-4816-b4cc-ae3d63dbe770" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: 7AA04E4C7E26459B8CF353ED38045E23 Ref B: MAA201060516045 Ref C: 2025-09-29T02:59:04Z" + ], + "Date": [ + "Mon, 29 Sep 2025 02:59:04 GMT" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "", + "StatusCode": 204 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "f879818f-5b29-4a43-8961-34169783144f" + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices/ChangeLog.md b/src/RecoveryServices/RecoveryServices/ChangeLog.md index 154c9c5b16c0..8d9a396f7f7b 100644 --- a/src/RecoveryServices/RecoveryServices/ChangeLog.md +++ b/src/RecoveryServices/RecoveryServices/ChangeLog.md @@ -19,6 +19,7 @@ --> ## Upcoming Release * Added Cross region restore support for new region - eastus3. +* Added support for vault soft delete feature - Get soft deleted vault, Undelete softdeleted vault, Get deleted backup items in a soft deleted vault using ARG. ## Version 7.8.0 diff --git a/src/RecoveryServices/RecoveryServices/Vault/UndoAzRecoveryServicesVaultDeletion.cs b/src/RecoveryServices/RecoveryServices/Vault/UndoAzRecoveryServicesVaultDeletion.cs index 83dfc0d15e42..3cd45e6f6bcc 100644 --- a/src/RecoveryServices/RecoveryServices/Vault/UndoAzRecoveryServicesVaultDeletion.cs +++ b/src/RecoveryServices/RecoveryServices/Vault/UndoAzRecoveryServicesVaultDeletion.cs @@ -15,8 +15,8 @@ using System; using System.Management.Automation; using Microsoft.Azure.Management.RecoveryServices.Models; +using ServiceClientModel = Microsoft.Azure.Management.RecoveryServices.Backup.Models; using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; -using Microsoft.Azure.Commands.RecoveryServices.Properties; namespace Microsoft.Azure.Commands.RecoveryServices { @@ -24,7 +24,7 @@ namespace Microsoft.Azure.Commands.RecoveryServices /// Undeletes a soft deleted Azure Recovery Services Vault. /// [Cmdlet("Undo", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "RecoveryServicesVaultDeletion", SupportsShouldProcess = true)] - [OutputType(typeof(ARSSoftDeletedVault))] + [OutputType(typeof(Object))] // chck: ServeClientModel.OperationStatus public class UndoAzRecoveryServicesVaultDeletion : RecoveryServicesCmdletBase { #region Parameters @@ -83,7 +83,7 @@ public override void ExecuteCmdlet() WriteVerbose($"Undelete operation completed for vault '{this.Name}'"); - this.WriteObject(new ARSSoftDeletedVault(undeleteResult)); + this.WriteObject(new ARSSoftDeletedVault(undeleteResult)); // chck with Rishav what should be the output type here. } catch (Exception exception) { diff --git a/src/RecoveryServices/RecoveryServices/help/Az.RecoveryServices.md b/src/RecoveryServices/RecoveryServices/help/Az.RecoveryServices.md index 5e66e3b7fcb2..75bbb0a5c90e 100644 --- a/src/RecoveryServices/RecoveryServices/help/Az.RecoveryServices.md +++ b/src/RecoveryServices/RecoveryServices/help/Az.RecoveryServices.md @@ -149,6 +149,12 @@ This command constructs the recovery configuration of a backed up item such as S ### [Get-AzRecoveryServicesResourceGuardMapping](Get-AzRecoveryServicesResourceGuardMapping.md) Gets the resource guard mapping added to the recovery services vault. +### [Get-AzRecoveryServicesSoftDeletedVault](Get-AzRecoveryServicesSoftDeletedVault.md) +Gets soft-deleted Recovery Services vaults in a specified location. + +### [Get-AzRecoveryServicesSoftDeletedVaultBackupItem](Get-AzRecoveryServicesSoftDeletedVaultBackupItem.md) +Gets backup items from soft-deleted Recovery Services vault. + ### [Get-AzRecoveryServicesVault](Get-AzRecoveryServicesVault.md) Gets a list of Recovery Services vaults. @@ -279,7 +285,8 @@ Deletes a Recovery Services vault. Restarts an Azure Site Recovery job. ### [Restore-AzRecoveryServicesBackupItem](Restore-AzRecoveryServicesBackupItem.md) -Restores the data and configuration for a Backup item to the specified recovery point. The required parameters vary with the backup item type. The same command is used to restore Azure Virtual machines, databases running within Azure Virtual machines and Azure file shares as well. +Restores the data and configuration for a Backup item to the specified recovery point. The required parameters vary with the backup item type. +The same command is used to restore Azure Virtual machines, databases running within Azure Virtual machines and Azure file shares as well. ### [Resume-AzRecoveryServicesAsrJob](Resume-AzRecoveryServicesAsrJob.md) Resumes a suspended Azure Site Recovery job. @@ -371,6 +378,9 @@ Undeletes a previously soft-deleted backup container in a recovery services vaul ### [Undo-AzRecoveryServicesBackupItemDeletion](Undo-AzRecoveryServicesBackupItemDeletion.md) If a backup item is deleted and present in a soft-deleted state, this command brings the item back to a state where the data is retained forever +### [Undo-AzRecoveryServicesVaultDeletion](Undo-AzRecoveryServicesVaultDeletion.md) +Undeletes a soft-deleted Recovery Services vault. + ### [Unregister-AzRecoveryServicesBackupContainer](Unregister-AzRecoveryServicesBackupContainer.md) Unregisters a Windows Server or other container from the vault. @@ -378,7 +388,8 @@ Unregisters a Windows Server or other container from the vault. Unregisters a SCDPM server or Backup server from the vault. ### [Update-AzRecoveryServicesAsrClusterProtectionDirection](Update-AzRecoveryServicesAsrClusterProtectionDirection.md) -Updates the replication direction for the specified replication protection cluster. Used to re-protect/reverse replicate a failed over replication protection cluster. +Updates the replication direction for the specified replication protection cluster. +Used to re-protect/reverse replicate a failed over replication protection cluster. ### [Update-AzRecoveryServicesAsrMobilityService](Update-AzRecoveryServicesAsrMobilityService.md) Push mobility service agent updates to protected machines. diff --git a/src/RecoveryServices/RecoveryServices/help/Get-AzRecoveryServicesSoftDeletedVault.md b/src/RecoveryServices/RecoveryServices/help/Get-AzRecoveryServicesSoftDeletedVault.md new file mode 100644 index 000000000000..671714a351ae --- /dev/null +++ b/src/RecoveryServices/RecoveryServices/help/Get-AzRecoveryServicesSoftDeletedVault.md @@ -0,0 +1,121 @@ +--- +external help file: Microsoft.Azure.PowerShell.Cmdlets.RecoveryServices.dll-Help.xml +Module Name: Az.RecoveryServices +online version: +schema: 2.0.0 +--- + +# Get-AzRecoveryServicesSoftDeletedVault + +## SYNOPSIS +Gets soft-deleted Recovery Services vaults in a specified location. + +## SYNTAX + +``` +Get-AzRecoveryServicesSoftDeletedVault [[-ResourceGroupName] ] [[-Name] ] [-Location] + [-DefaultProfile ] [] +``` + +## DESCRIPTION +The Get-AzRecoveryServicesSoftDeletedVault cmdlet retrieves Recovery Services vaults that have been soft-deleted in a specified Azure location. Soft-deleted vaults are vaults that have been deleted but are still recoverable for a certain retention period. You can optionally filter by resource group name and vault name. + +## EXAMPLES + +### Example 1: Get all soft-deleted vaults in a location +```powershell +PS C:\> Get-AzRecoveryServicesSoftDeletedVault -Location "westus" +``` + +Gets all soft-deleted Recovery Services vaults in the West US location within the subscription context. + +### Example 2: Get a specific soft-deleted vault by name +```powershell +PS C:\> Get-AzRecoveryServicesSoftDeletedVault -Location "westus" -Name "wus-rg_fe7567gh-9d2b-4376-aa4a-de1c7176e40e" -ResourceGroupName "wus-rg" +``` + +Gets a specific soft-deleted Recovery Services vault named "wus-rg_fe7567gh-9d2b-4376-aa4a-de1c7176e40e" in the "wus-rg" resource group. + +### Example 3: Filter soft-deleted vaults by original vault name +```powershell +PS C:\> $sdVault = Get-AzRecoveryServicesSoftDeletedVault -Location westus | Where-Object { $_.Properties.VaultId -match "wus-vault" } +``` + +Gets soft-deleted vaults in West US and filters them to find vaults with "wus-vault" in ARM ID of the original Recovery Services vault. + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer +Parameter Sets: (All) +Aliases: AzContext, AzureRmContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Location +The Azure location where the soft-deleted vaults are located. This parameter is required to specify which Azure region to search for soft-deleted Recovery Services vaults. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The name of the specific soft-deleted Recovery Services vault to retrieve. When specified, only the vault with this exact name will be returned. If not specified, all soft-deleted vaults in the location will be returned. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group that contained the soft-deleted Recovery Services vault. When specified along with the Name parameter, it helps to uniquely identify a specific soft-deleted vault. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### None + +## OUTPUTS + +### Microsoft.Azure.Commands.RecoveryServices.ARSSoftDeletedVault + +## NOTES + +## RELATED LINKS diff --git a/src/RecoveryServices/RecoveryServices/help/Get-AzRecoveryServicesSoftDeletedVaultBackupItem.md b/src/RecoveryServices/RecoveryServices/help/Get-AzRecoveryServicesSoftDeletedVaultBackupItem.md new file mode 100644 index 000000000000..6257671d8599 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices/help/Get-AzRecoveryServicesSoftDeletedVaultBackupItem.md @@ -0,0 +1,116 @@ +--- +external help file: Microsoft.Azure.PowerShell.Cmdlets.RecoveryServices.Backup.dll-Help.xml +Module Name: Az.RecoveryServices +online version: +schema: 2.0.0 +--- + +# Get-AzRecoveryServicesSoftDeletedVaultBackupItem + +## SYNOPSIS +Gets backup items from soft-deleted Recovery Services vaults. + +## SYNTAX + +``` +Get-AzRecoveryServicesSoftDeletedVaultBackupItem [[-VaultName] ] [[-ResourceGroupName] ] + [[-VaultId] ] [-DefaultProfile ] [] +``` + +## DESCRIPTION +The Get-AzRecoveryServicesSoftDeletedVaultBackupItem cmdlet retrieves backup items from soft-deleted Recovery Services vaults using Azure Resource Graph. This allows you to view what backup items were contained in a vault before it was deleted. You can specify the vault by either VaultId or by VaultName and ResourceGroupName. + +## EXAMPLES + +### Example 1: Get backup items using VaultId +```powershell +PS C:\> $sdVault = Get-AzRecoveryServicesSoftDeletedVault -Location westus | Where-Object { $_.Properties.VaultId -match "wus-vault" } +PS C:\> Get-AzRecoveryServicesSoftDeletedVaultBackupItem -VaultId $sdVault.ID +``` + +Gets backup items from a soft-deleted vault using the vault's ARM ID. + +### Example 2: Get backup items using VaultName and ResourceGroupName +```powershell +PS C:\> $sdVault = Get-AzRecoveryServicesSoftDeletedVault -Location westus -Name "wus-rg_fe7567gh-9d2b-4376-aa4a-de1c7176e40e" +PS C:\> Get-AzRecoveryServicesSoftDeletedVaultBackupItem -VaultName $sdVault.Name -ResourceGroupName $sdVault.ResourceGroupName +``` + +Gets backup items from a soft-deleted vault using the vault name and resource group name. + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer +Parameter Sets: (All) +Aliases: AzContext, AzureRmContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +Resource group name of the soft deleted recovery services vault + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -VaultId +ARM ID of the soft deleted Recovery Services Vault + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -VaultName +Name of the soft deleted recovery services vault + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 0 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### None + +## OUTPUTS + +### System.Management.Automation.PSObject + +## NOTES + +## RELATED LINKS diff --git a/src/RecoveryServices/RecoveryServices/help/Undo-AzRecoveryServicesVaultDeletion.md b/src/RecoveryServices/RecoveryServices/help/Undo-AzRecoveryServicesVaultDeletion.md new file mode 100644 index 000000000000..24b3d65e9823 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices/help/Undo-AzRecoveryServicesVaultDeletion.md @@ -0,0 +1,155 @@ +--- +external help file: Microsoft.Azure.PowerShell.Cmdlets.RecoveryServices.dll-Help.xml +Module Name: Az.RecoveryServices +online version: +schema: 2.0.0 +--- + +# Undo-AzRecoveryServicesVaultDeletion + +## SYNOPSIS +Undeletes a soft-deleted Recovery Services vault. + +## SYNTAX + +``` +Undo-AzRecoveryServicesVaultDeletion [-ResourceGroupName] [-Name] [-Location] + [-Force] [-DefaultProfile ] [-WhatIf] [-Confirm] + [] +``` + +## DESCRIPTION +The Undo-AzRecoveryServicesVaultDeletion cmdlet undeletes a soft-deleted Recovery Services vault back to an active state. When a Recovery Services vault is deleted, it enters a soft-deleted state where it can be recovered within the retention period. This cmdlet reverses the deletion operation and makes the vault active again with all its previous configuration. + +## EXAMPLES + +### Example 1: Undelete a soft-deleted vault +```powershell +PS C:\> $sdVault = Get-AzRecoveryServicesSoftDeletedVault -Location westus | Where-Object { $_.Properties.VaultId -match "wus-vault" } +PS C:\> Undo-AzRecoveryServicesVaultDeletion -ResourceGroupName $sdVault.ResourceGroupName -Name $sdVault.Name -Location "westus" +``` + +Undeletes a soft-deleted Recovery Services vault by specifying the resource group name, vault name, and location. + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer +Parameter Sets: (All) +Aliases: AzContext, AzureRmContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Force +Forces the command to run without asking for user confirmation. When specified, the cmdlet will not prompt for confirmation before undeleting the vault. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Location +The Azure location where the soft-deleted vault is located. This must match the location where the vault was originally created and deleted. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The name of the soft-deleted Recovery Services vault to undelete. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group where the vault was located before deletion. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### None + +## OUTPUTS + +### System.Object + +## NOTES + +## RELATED LINKS