Skip to content

Commit 08e83ee

Browse files
author
dragonfly91
committed
[RS Backup] Fixing 7349803 (documentation fixes) for Policy in Cmdlet Layer
1 parent 2183e6a commit 08e83ee

7 files changed

+80
-4
lines changed

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup/Cmdlets/ProtectionPolicy/GetAzureRmRecoveryServicesBackupProtectionPolicy.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets
2828
{
2929
/// <summary>
30-
/// Get list of protection policies
30+
/// Gets the list of protection policies associated with this recovery services vault
31+
/// according to the filters passed via the cmdlet parameters.
3132
/// </summary>
3233
[Cmdlet(VerbsCommon.Get, "AzureRmRecoveryServicesBackupProtectionPolicy", DefaultParameterSetName = NoParamSet),
3334
OutputType(typeof(PolicyBase), typeof(IList<PolicyBase>))]
@@ -38,18 +39,27 @@ public class GetAzureRmRecoveryServicesBackupProtectionPolicy : RecoveryServices
3839
protected const string NoParamSet = "NoParamSet";
3940
protected const string WorkloadBackupMangementTypeParamSet = "WorkloadBackupManagementTypeParamSet";
4041

42+
/// <summary>
43+
/// Name of the policy to be fetched.
44+
/// </summary>
4145
[Parameter(ParameterSetName = PolicyNameParamSet, Position = 1,
4246
Mandatory = true, HelpMessage = ParamHelpMsgs.Policy.Name)]
4347
[ValidateNotNullOrEmpty]
4448
public string Name { get; set; }
4549

50+
/// <summary>
51+
/// Workload type of the policy to be fetched
52+
/// </summary>
4653
[Parameter(ParameterSetName = WorkloadParamSet, Position = 2,
4754
Mandatory = true, HelpMessage = ParamHelpMsgs.Common.WorkloadType)]
4855
[Parameter(ParameterSetName = WorkloadBackupMangementTypeParamSet, Position = 2,
4956
Mandatory = true, HelpMessage = ParamHelpMsgs.Common.WorkloadType)]
5057
[ValidateNotNullOrEmpty]
5158
public WorkloadType? WorkloadType { get; set; }
5259

60+
/// <summary>
61+
/// Backup management type of the policy to be fetched
62+
/// </summary>
5363
[Parameter(ParameterSetName = WorkloadBackupMangementTypeParamSet, Position = 3,
5464
Mandatory = true, HelpMessage = ParamHelpMsgs.Common.BackupManagementType)]
5565
[ValidateNotNullOrEmpty]

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup/Cmdlets/ProtectionPolicy/GetAzureRmRecoveryServicesBackupRetentionPolicyObject.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,25 @@
2323

2424
namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets
2525
{
26+
/// <summary>
27+
/// Returns a retention policy PS object which can be modified in the PS shell
28+
/// and fed to other cmdlets which accept it.
29+
/// </summary>
2630
[Cmdlet(VerbsCommon.Get, "AzureRmRecoveryServicesBackupRetentionPolicyObject"),
2731
OutputType(typeof(RetentionPolicyBase))]
2832
public class GetAzureRmRecoveryServicesBackupRetentionPolicyObject : RecoveryServicesBackupCmdletBase
2933
{
34+
/// <summary>
35+
/// Workload type of the policy to be created.
36+
/// </summary>
3037
[Parameter(Mandatory = true, Position = 0,
3138
HelpMessage = ParamHelpMsgs.Common.WorkloadType)]
3239
[ValidateNotNullOrEmpty]
3340
public WorkloadType WorkloadType { get; set; }
3441

42+
/// <summary>
43+
/// Backup management type of the policy to be created.
44+
/// </summary>
3545
[Parameter(Mandatory = false, Position = 1,
3646
HelpMessage = ParamHelpMsgs.Common.BackupManagementType)]
3747
[ValidateNotNullOrEmpty]

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup/Cmdlets/ProtectionPolicy/GetAzureRmRecoveryServicesBackupSchedulePolicyObject.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,25 @@
2323

2424
namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets
2525
{
26+
/// <summary>
27+
/// Returns a schedule policy PS object which can be modified in the PS shell
28+
/// and fed to other cmdlets which accept it.
29+
/// </summary>
2630
[Cmdlet(VerbsCommon.Get, "AzureRmRecoveryServicesBackupSchedulePolicyObject"),
2731
OutputType(typeof(SchedulePolicyBase))]
2832
public class GetAzureRmRecoveryServicesBackupSchedulePolicyObject : RecoveryServicesBackupCmdletBase
2933
{
34+
/// <summary>
35+
/// Workload type of the policy to be created.
36+
/// </summary>
3037
[Parameter(Mandatory = true, Position = 0,
3138
HelpMessage = ParamHelpMsgs.Common.WorkloadType)]
3239
[ValidateNotNullOrEmpty]
3340
public WorkloadType WorkloadType { get; set; }
3441

42+
/// <summary>
43+
/// Backup management type of the policy to be created.
44+
/// </summary>
3545
[Parameter(Mandatory = false, Position = 1,
3646
HelpMessage = ParamHelpMsgs.Common.BackupManagementType)]
3747
[ValidateNotNullOrEmpty]

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup/Cmdlets/ProtectionPolicy/NewAzureRmRecoveryServicesBackupProtectionPolicy.cs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,30 +27,45 @@
2727
namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets
2828
{
2929
/// <summary>
30-
/// Create new protection policy
30+
/// Creates a new protection policy based on the parameters provided in to the recovery services vault.
3131
/// </summary>
3232
[Cmdlet(VerbsCommon.New, "AzureRmRecoveryServicesBackupProtectionPolicy"), OutputType(typeof(PolicyBase))]
3333
public class NewAzureRmRecoveryServicesBackupProtectionPolicy : RecoveryServicesBackupCmdletBase
3434
{
35+
/// <summary>
36+
/// Name of the policy to be created
37+
/// </summary>
3538
[Parameter(Position = 1, Mandatory = true, HelpMessage = ParamHelpMsgs.Policy.Name)]
3639
[ValidateNotNullOrEmpty]
3740
public string Name { get; set; }
3841

42+
/// <summary>
43+
/// Workload type that is managed by this policy
44+
/// </summary>
3945
[Parameter(Position = 2, Mandatory = true, HelpMessage = ParamHelpMsgs.Common.WorkloadType,
4046
ValueFromPipelineByPropertyName = true)]
4147
[ValidateNotNullOrEmpty]
4248
public WorkloadType WorkloadType { get; set; }
4349

50+
/// <summary>
51+
/// Backup management type of the policy to be created
52+
/// </summary>
4453
[Parameter(Position = 3, Mandatory = false, HelpMessage = ParamHelpMsgs.Common.BackupManagementType,
4554
ValueFromPipelineByPropertyName = true)]
4655
[ValidateNotNullOrEmpty]
4756
public BackupManagementType? BackupManagementType { get; set; }
4857

58+
/// <summary>
59+
/// Retention policy object associated with the policy to be created
60+
/// </summary>
4961
[Parameter(Position = 4, Mandatory = false, HelpMessage = ParamHelpMsgs.Policy.RetentionPolicy,
5062
ValueFromPipelineByPropertyName = true)]
5163
[ValidateNotNullOrEmpty]
5264
public RetentionPolicyBase RetentionPolicy { get; set; }
5365

66+
/// <summary>
67+
/// Schedule policy object assoicated with the policy to be created
68+
/// </summary>
5469
[Parameter(Position = 5, Mandatory = false, HelpMessage = ParamHelpMsgs.Policy.SchedulePolicy,
5570
ValueFromPipelineByPropertyName = true)]
5671
[ValidateNotNullOrEmpty]

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup/Cmdlets/ProtectionPolicy/PolicyCmdletHelpers.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,17 @@
3030

3131
namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets
3232
{
33+
/// <summary>
34+
/// Class hosting helper methods for policy related cmdlets.
35+
/// </summary>
3336
public class PolicyCmdletHelpers
3437
{
3538
public static Regex policyNameRgx = new Regex(@"^[A-Za-z][-A-Za-z0-9]*[A-Za-z0-9]$");
3639

40+
/// <summary>
41+
/// Validates name of the policy
42+
/// </summary>
43+
/// <param name="policyName">Name of the policy</param>
3744
public static void ValidateProtectionPolicyName(string policyName)
3845
{
3946
if(string.IsNullOrEmpty(policyName))
@@ -53,6 +60,12 @@ public static void ValidateProtectionPolicyName(string policyName)
5360
}
5461
}
5562

63+
/// <summary>
64+
/// Fetches policies by name
65+
/// </summary>
66+
/// <param name="policyName">Name of the policy to be fetched</param>
67+
/// <param name="serviceClientAdapter">Service client adapter with which to make calls</param>
68+
/// <returns></returns>
5669
public static ProtectionPolicyResponse GetProtectionPolicyByName(string policyName,
5770
ServiceClientAdapter serviceClientAdapter)
5871
{

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup/Cmdlets/ProtectionPolicy/RemoveAzureRmRecoveryServicesBackupProtectionPolicy.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets
2828
{
2929
/// <summary>
30-
/// Update existing protection policy
30+
/// Deletes an existing protection policy from the recovery services vault
3131
/// </summary>
3232
[Cmdlet(VerbsCommon.Remove, "AzureRmRecoveryServicesBackupProtectionPolicy",
3333
DefaultParameterSetName = PolicyNameParameterSet)]
@@ -36,17 +36,26 @@ public class RemoveAzureRmRecoveryServicesBackupProtectionPolicy : RecoveryServi
3636
internal const string PolicyNameParameterSet = "PolicyName";
3737
internal const string PolicyObjectParameterSet = "PolicyObject";
3838

39+
/// <summary>
40+
/// Name of the policy to be deleted
41+
/// </summary>
3942
[Parameter(Position = 1, Mandatory = true, HelpMessage = ParamHelpMsgs.Policy.Name,
4043
ParameterSetName = PolicyNameParameterSet)]
4144
[ValidateNotNullOrEmpty]
4245
public string Name { get; set; }
4346

47+
/// <summary>
48+
/// Policy object to be deleted
49+
/// </summary>
4450
[Parameter(Position = 1, Mandatory = true, HelpMessage = ParamHelpMsgs.Policy.ProtectionPolicy,
4551
ValueFromPipeline = true,
4652
ParameterSetName = PolicyObjectParameterSet)]
4753
[ValidateNotNullOrEmpty]
4854
public PolicyBase Policy { get; set; }
4955

56+
/// <summary>
57+
/// When provided, force delete policy, without asking for user confirmation
58+
/// </summary>
5059
[Parameter(Mandatory = false, HelpMessage = ParamHelpMsgs.Common.ConfirmationMessage)]
5160
public SwitchParameter Force { get; set; }
5261

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup/Cmdlets/ProtectionPolicy/SetAzureRmRecoveryServicesBackupProtectionPolicy.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,30 @@
2828
namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets
2929
{
3030
/// <summary>
31-
/// Update existing protection policy
31+
/// Update existing protection policy in the recovery services vault
3232
/// </summary>
3333
[Cmdlet(VerbsCommon.Set, "AzureRmRecoveryServicesBackupProtectionPolicy"),
3434
OutputType(typeof(List<CmdletModel.JobBase>))]
3535
public class SetAzureRmRecoveryServicesBackupProtectionPolicy : RecoveryServicesBackupCmdletBase
3636
{
37+
/// <summary>
38+
/// Policy object to be modified
39+
/// </summary>
3740
[Parameter(Position = 1, Mandatory = true, HelpMessage = ParamHelpMsgs.Policy.ProtectionPolicy,
3841
ValueFromPipeline = true)]
3942
[ValidateNotNullOrEmpty]
4043
public PolicyBase Policy { get; set; }
4144

45+
/// <summary>
46+
/// Retention policy object to be modified
47+
/// </summary>
4248
[Parameter(Position = 2, Mandatory = false, HelpMessage = ParamHelpMsgs.Policy.RetentionPolicy)]
4349
[ValidateNotNullOrEmpty]
4450
public RetentionPolicyBase RetentionPolicy { get; set; }
4551

52+
/// <summary>
53+
/// Schedule policy object to be modified
54+
/// </summary>
4655
[Parameter(Position = 3, Mandatory = false, HelpMessage = ParamHelpMsgs.Policy.SchedulePolicy)]
4756
[ValidateNotNullOrEmpty]
4857
public SchedulePolicyBase SchedulePolicy { get; set; }

0 commit comments

Comments
 (0)