diff --git a/src/RecoveryServices/RecoveryServices.Backup.Models/CommonModels/PolicyRetentionObjects.cs b/src/RecoveryServices/RecoveryServices.Backup.Models/CommonModels/PolicyRetentionObjects.cs index 6e40d663739a..721297f8204a 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Models/CommonModels/PolicyRetentionObjects.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Models/CommonModels/PolicyRetentionObjects.cs @@ -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; @@ -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; @@ -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; diff --git a/src/RecoveryServices/RecoveryServices.Backup.Models/CommonModels/Utils.cs b/src/RecoveryServices/RecoveryServices.Backup.Models/CommonModels/Utils.cs index 625d5d9f6c96..0dfdb1650540 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Models/CommonModels/Utils.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Models/CommonModels/Utils.cs @@ -29,6 +29,10 @@ public class PolicyConstants /// Maximum allowed duration length of retention. /// 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; @@ -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; + } /// diff --git a/src/RecoveryServices/RecoveryServices/ChangeLog.md b/src/RecoveryServices/RecoveryServices/ChangeLog.md index 11ef431f48c3..1e11b4b4f4f5 100644 --- a/src/RecoveryServices/RecoveryServices/ChangeLog.md +++ b/src/RecoveryServices/RecoveryServices/ChangeLog.md @@ -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