@@ -56,7 +56,7 @@ public BaseRecoveryServicesJobResponse EnableProtection()
56
56
if ( policy == null )
57
57
{
58
58
// throw error -- TBD
59
- }
59
+ }
60
60
61
61
AzureRmRecoveryServicesIaasVmItem item = ( AzureRmRecoveryServicesIaasVmItem )
62
62
ProviderData . ProviderParameters [ ItemParams . Item ] ;
@@ -176,7 +176,7 @@ public List<AzureRmRecoveryServicesRecoveryPointBase> ListRecoveryPoints()
176
176
TimeSpan duration = endDate - startDate ;
177
177
178
178
if ( duration . TotalDays > 30 )
179
- {
179
+ {
180
180
throw new Exception ( "Time difference should not be more than 30 days" ) ; //tbd: Correct nsg and exception type
181
181
}
182
182
@@ -192,7 +192,7 @@ public List<AzureRmRecoveryServicesRecoveryPointBase> ListRecoveryPoints()
192
192
public ProtectionPolicyResponse CreatePolicy ( )
193
193
{
194
194
string policyName = ( string ) ProviderData . ProviderParameters [ PolicyParams . PolicyName ] ;
195
- Microsoft . Azure . Commands . RecoveryServices . Backup . Cmdlets . Models . WorkloadType workloadType =
195
+ Microsoft . Azure . Commands . RecoveryServices . Backup . Cmdlets . Models . WorkloadType workloadType =
196
196
( Microsoft . Azure . Commands . RecoveryServices . Backup . Cmdlets . Models . WorkloadType ) ProviderData . ProviderParameters [ PolicyParams . WorkloadType ] ;
197
197
BackupManagementType backupManagementType = ( BackupManagementType ) ProviderData . ProviderParameters [
198
198
PolicyParams . BackupManagementType ] ;
@@ -307,7 +307,6 @@ public List<AzureRmRecoveryServicesContainerBase> ListProtectionContainers()
307
307
{
308
308
string name = ( string ) this . ProviderData . ProviderParameters [ ContainerParams . Name ] ;
309
309
ContainerRegistrationStatus status = ( ContainerRegistrationStatus ) this . ProviderData . ProviderParameters [ ContainerParams . Status ] ;
310
- ARSVault vault = ( ARSVault ) this . ProviderData . ProviderParameters [ ContainerParams . Vault ] ;
311
310
string resourceGroupName = ( string ) this . ProviderData . ProviderParameters [ ContainerParams . ResourceGroupName ] ;
312
311
313
312
ProtectionContainerListQueryParams queryParams = new ProtectionContainerListQueryParams ( ) ;
@@ -321,7 +320,7 @@ public List<AzureRmRecoveryServicesContainerBase> ListProtectionContainers()
321
320
// 3. Filter by Status
322
321
queryParams . RegistrationStatus = status . ToString ( ) ;
323
322
324
- var listResponse = HydraAdapter . ListContainers ( vault . ResouceGroupName , vault . Name , queryParams ) ;
323
+ var listResponse = HydraAdapter . ListContainers ( queryParams ) ;
325
324
326
325
List < AzureRmRecoveryServicesContainerBase > containerModels = ConversionHelpers . GetContainerModelList ( listResponse ) ;
327
326
@@ -365,9 +364,9 @@ public AzureRmRecoveryServicesSchedulePolicyBase GetDefaultSchedulePolicyObject(
365
364
public AzureRmRecoveryServicesRetentionPolicyBase GetDefaultRetentionPolicyObject ( )
366
365
{
367
366
AzureRmRecoveryServicesLongTermRetentionPolicy defaultRetention = new AzureRmRecoveryServicesLongTermRetentionPolicy ( ) ;
368
-
367
+
369
368
//Default time is 10:30 local time
370
- DateTime retentionTime = GenerateRandomTime ( ) ;
369
+ DateTime retentionTime = GenerateRandomTime ( ) ;
371
370
372
371
//Daily Retention policy
373
372
defaultRetention . IsDailyScheduleEnabled = true ;
@@ -392,7 +391,7 @@ public AzureRmRecoveryServicesRetentionPolicyBase GetDefaultRetentionPolicyObjec
392
391
defaultRetention . MonthlySchedule . RetentionScheduleFormatType = Models . RetentionScheduleFormat . Weekly ;
393
392
394
393
//Initialize day based schedule
395
- defaultRetention . MonthlySchedule . RetentionScheduleDaily = GetDailyRetentionFormat ( ) ;
394
+ defaultRetention . MonthlySchedule . RetentionScheduleDaily = GetDailyRetentionFormat ( ) ;
396
395
397
396
//Initialize Week based schedule
398
397
defaultRetention . MonthlySchedule . RetentionScheduleWeekly = GetWeeklyRetentionFormat ( ) ;
@@ -458,7 +457,7 @@ private void ValidateAzureVMProtectionPolicy(AzureRmRecoveryServicesPolicyBase p
458
457
if ( policy == null || policy . GetType ( ) != typeof ( AzureRmRecoveryServicesIaasVmPolicy ) )
459
458
{
460
459
throw new ArgumentException ( string . Format ( Resources . InvalidProtectionPolicyException ,
461
- typeof ( AzureRmRecoveryServicesIaasVmPolicy ) . ToString ( ) ) ) ;
460
+ typeof ( AzureRmRecoveryServicesIaasVmPolicy ) . ToString ( ) ) ) ;
462
461
}
463
462
464
463
ValidateAzureVMWorkloadType ( policy . WorkloadType ) ;
@@ -472,7 +471,7 @@ private void ValidateAzureVMSchedulePolicy(AzureRmRecoveryServicesSchedulePolicy
472
471
if ( policy == null || policy . GetType ( ) != typeof ( AzureRmRecoveryServicesSimpleSchedulePolicy ) )
473
472
{
474
473
throw new ArgumentException ( string . Format ( Resources . InvalidSchedulePolicyException ,
475
- typeof ( AzureRmRecoveryServicesSimpleSchedulePolicy ) . ToString ( ) ) ) ;
474
+ typeof ( AzureRmRecoveryServicesSimpleSchedulePolicy ) . ToString ( ) ) ) ;
476
475
}
477
476
478
477
// call validation
@@ -484,14 +483,14 @@ private void ValidateAzureVMRetentionPolicy(AzureRmRecoveryServicesRetentionPoli
484
483
if ( policy == null || policy . GetType ( ) != typeof ( AzureRmRecoveryServicesLongTermRetentionPolicy ) )
485
484
{
486
485
throw new ArgumentException ( string . Format ( Resources . InvalidRetentionPolicyException ,
487
- typeof ( AzureRmRecoveryServicesLongTermRetentionPolicy ) . ToString ( ) ) ) ;
486
+ typeof ( AzureRmRecoveryServicesLongTermRetentionPolicy ) . ToString ( ) ) ) ;
488
487
}
489
488
490
489
// call validation
491
490
policy . Validate ( ) ;
492
491
}
493
492
494
- private AzureIaaSVMProtectableItem GetAzureVMProtectableObject ( string azureVMName , string azureVMRGName , bool isComputeAzureVM )
493
+ private AzureIaaSVMProtectableItem GetAzureVMProtectableObject ( string azureVMName , string azureVMRGName , bool isComputeAzureVM )
495
494
{
496
495
//TriggerDiscovery if needed
497
496
@@ -512,7 +511,7 @@ private AzureIaaSVMProtectableItem GetAzureVMProtectableObject( string azureVMNa
512
511
//ThrowTerminatingError(new ErrorRecord(new Exception(Resources.AzureVMNotFound), string.Empty, ErrorCategory.InvalidArgument, null));
513
512
}
514
513
}
515
- if ( protectableObject == null )
514
+ if ( protectableObject == null )
516
515
{
517
516
// TBD throw exception.
518
517
}
@@ -623,9 +622,9 @@ private HttpStatusCode TrackRefreshContainerOperation(string operationResultLink
623
622
}
624
623
catch ( Exception ex )
625
624
{
626
- // TBD throw exception
625
+ // TBD throw exception
627
626
throw ex ;
628
- }
627
+ }
629
628
}
630
629
631
630
if ( status == HttpStatusCode . NoContent )
0 commit comments