From f56a893238c1e82f4fbbac531ae1c2d316a98eef Mon Sep 17 00:00:00 2001 From: hiaga Date: Sat, 23 Jan 2021 08:55:18 +0530 Subject: [PATCH 1/2] modifying policy validation limits as per backup service --- .../CommonModels/PolicyRetentionObjects.cs | 6 +++--- .../CommonModels/Utils.cs | 11 ++++++++--- 2 files changed, 11 insertions(+), 6 deletions(-) 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; + } /// From e945e3ceaaef4d603850096bb72e43e9fdc84860 Mon Sep 17 00:00:00 2001 From: hiaga Date: Mon, 25 Jan 2021 10:07:02 +0530 Subject: [PATCH 2/2] updated changelog --- src/RecoveryServices/RecoveryServices/ChangeLog.md | 1 + 1 file changed, 1 insertion(+) 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