Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Az.RecoveryServices.Backup] modifying policy validation limits as per backup service #14006

Merged
merged 2 commits into from
Jan 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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