public RestAzureNS.AzureOperationResponse TriggerBackup() { string vaultName = (string)ProviderData[VaultParams.VaultName]; string vaultResourceGroupName = (string)ProviderData[VaultParams.ResourceGroupName]; ItemBase item = (ItemBase)ProviderData[ItemParams.Item]; DateTime? expiryDateTime = (DateTime?)ProviderData[ItemParams.ExpiryDateTimeUTC]; AzureFileShareItem azureFileShareItem = item as AzureFileShareItem; BackupRequestResource triggerBackupRequest = new BackupRequestResource(); AzureFileShareBackupRequest azureFileShareBackupRequest = new AzureFileShareBackupRequest(); azureFileShareBackupRequest.RecoveryPointExpiryTimeInUTC = expiryDateTime; triggerBackupRequest.Properties = azureFileShareBackupRequest; return(ServiceClientAdapter.TriggerBackup( IdUtils.GetValueByName(azureFileShareItem.Id, IdUtils.IdNames.ProtectionContainerName), IdUtils.GetValueByName(azureFileShareItem.Id, IdUtils.IdNames.ProtectedItemName), triggerBackupRequest, vaultName: vaultName, resourceGroupName: vaultResourceGroupName)); }
public RestAzureNS.AzureOperationResponse TriggerBackup() { string vaultName = (string)ProviderData[VaultParams.VaultName]; string vaultResourceGroupName = (string)ProviderData[VaultParams.ResourceGroupName]; ItemBase item = (ItemBase)ProviderData[ItemParams.Item]; DateTime?expiryDateTime = (DateTime?)ProviderData[ItemParams.ExpiryDateTimeUTC]; string backupType = ProviderData[ItemParams.BackupType].ToString(); bool enableCompression = (bool)ProviderData[ItemParams.EnableCompression]; AzureWorkloadSQLDatabaseProtectedItem azureWorkloadProtectedItem = item as AzureWorkloadSQLDatabaseProtectedItem; BackupRequestResource triggerBackupRequest = new BackupRequestResource(); AzureWorkloadBackupRequest azureWorkloadBackupRequest = new AzureWorkloadBackupRequest(); azureWorkloadBackupRequest.RecoveryPointExpiryTimeInUTC = expiryDateTime; azureWorkloadBackupRequest.BackupType = backupType; azureWorkloadBackupRequest.EnableCompression = enableCompression; triggerBackupRequest.Properties = azureWorkloadBackupRequest; return(ServiceClientAdapter.TriggerBackup( IdUtils.GetValueByName(azureWorkloadProtectedItem.Id, IdUtils.IdNames.ProtectionContainerName), IdUtils.GetValueByName(azureWorkloadProtectedItem.Id, IdUtils.IdNames.ProtectedItemName), triggerBackupRequest, vaultName: vaultName, resourceGroupName: vaultResourceGroupName)); }