Skip to content

Commit

Permalink
[Az.RecoveryServices.Backup] modifying policy validation limits as pe…
Browse files Browse the repository at this point in the history
…r backup service (#14006)

* modifying policy validation limits as per backup service

* updated changelog
  • Loading branch information
hiaga authored Jan 25, 2021
1 parent baeddc8 commit efd4321
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ public class WeeklyRetentionSchedule : RetentionScheduleBase

public override void Validate()
{
int MinDurationCountInWeeks = 1, MaxDurationCountInWeeks = PolicyConstants.MaxAllowedRetentionDurationCount;
int MinDurationCountInWeeks = 1, MaxDurationCountInWeeks = PolicyConstants.MaxAllowedRetentionDurationCountWeekly;
if(BackupManagementType == Management.RecoveryServices.Backup.Models.BackupManagementType.AzureStorage)
{
MinDurationCountInWeeks = PolicyConstants.AfsWeeklyRetentionMin;
Expand Down Expand Up @@ -342,7 +342,7 @@ public override void Validate()
{
base.Validate();

int MinDurationCountInMonths = 1, MaxDurationCountInMonths = PolicyConstants.MaxAllowedRetentionDurationCount;
int MinDurationCountInMonths = 1, MaxDurationCountInMonths = PolicyConstants.MaxAllowedRetentionDurationCountMonthly;
if (BackupManagementType == Management.RecoveryServices.Backup.Models.BackupManagementType.AzureStorage)
{
MinDurationCountInMonths = PolicyConstants.AfsMonthlyRetentionMin;
Expand Down Expand Up @@ -426,7 +426,7 @@ public override void Validate()
{
base.Validate();

int MinDurationCountInYears = 1, MaxDurationCountInYears = 10;
int MinDurationCountInYears = 1, MaxDurationCountInYears = PolicyConstants.MaxAllowedRetentionDurationCountYearly;
if (BackupManagementType == Management.RecoveryServices.Backup.Models.BackupManagementType.AzureStorage)
{
MinDurationCountInYears = PolicyConstants.AfsYearlyRetentionMin;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ public class PolicyConstants
/// Maximum allowed duration length of retention.
/// </summary>
public const int MaxAllowedRetentionDurationCount = 9999;
public const int MaxAllowedRetentionDurationCountWeekly = 5163;
public const int MaxAllowedRetentionDurationCountMonthly = 1188;
public const int MaxAllowedRetentionDurationCountYearly = 99;

public const int AfsDailyRetentionDaysMax = 200;
public const int AfsDailyRetentionDaysMin = 1;
public const int AfsWeeklyRetentionMax = 200;
Expand Down Expand Up @@ -56,9 +60,10 @@ public class PolicyConstants
public const int NumOfMonthsInYear = 12;

// SQL constants
public const int MaxAllowedRetentionDurationCountWeeklySql = 520;
public const int MaxAllowedRetentionDurationCountMonthlySql = 120;
public const int MaxAllowedRetentionDurationCountYearlySql = 10;
public const int MaxAllowedRetentionDurationCountWeeklySql = 5163;
public const int MaxAllowedRetentionDurationCountMonthlySql = 1188;
public const int MaxAllowedRetentionDurationCountYearlySql = 99;

}

/// <summary>
Expand Down
1 change: 1 addition & 0 deletions src/RecoveryServices/RecoveryServices/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- Additional information about change #1
-->
## Upcoming Release
* modified policy validation limits as per backup service.
* Added Zone Redundancy for Recovery Service Vaults.

## Version 3.3.0
Expand Down

0 comments on commit efd4321

Please sign in to comment.