Skip to content

Commit c8676c5

Browse files
author
Samuel Anudeep
committed
Merge pull request #328 from MabOneSdk/anudeeb-dev1
Fixing 7349803 in Cmdlet Layer
2 parents 57d8200 + 1a1941b commit c8676c5

24 files changed

+307
-19
lines changed

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup/Cmdlets/Backup/BackupAzureRmRecoveryServicesBackupItem.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,16 @@
2626
namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets
2727
{
2828
/// <summary>
29-
/// Backup Item
29+
/// Enables backup of an item protected by the recovery services vault.
30+
/// Returns the corresponding job created in the service to track this backup operation.
3031
/// </summary>
3132
[Cmdlet(VerbsData.Backup, "AzureRmRecoveryServicesBackupItem"), OutputType(typeof(JobBase))]
3233
public class BackupAzureRmRecoveryServicesBackupItem : RecoveryServicesBackupCmdletBase
3334
{
34-
[Parameter(Mandatory = true, HelpMessage = ParamHelpMsgs.Item.ProtectedItem,
35+
/// <summary>
36+
/// The protected item on which backup has to be enabled.
37+
/// </summary>
38+
[Parameter(Mandatory = true, HelpMessage = ParamHelpMsgs.Item.ProtectedItem,
3539
ValueFromPipeline = true)]
3640
[ValidateNotNullOrEmpty]
3741
public ItemBase Item { get; set; }
@@ -40,13 +44,13 @@ public override void ExecuteCmdlet()
4044
{
4145
base.ExecuteCmdlet();
4246

43-
PsBackupProviderManager providerManager =
47+
PsBackupProviderManager providerManager =
4448
new PsBackupProviderManager(new Dictionary<System.Enum, object>()
4549
{
4650
{ItemParams.Item, Item},
4751
}, ServiceClientAdapter);
4852

49-
IPsBackupProvider psBackupProvider =
53+
IPsBackupProvider psBackupProvider =
5054
providerManager.GetProviderInstance(Item.WorkloadType, Item.BackupManagementType);
5155
var jobResponse = psBackupProvider.TriggerBackup();
5256

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup/Cmdlets/Container/GetAzureRmRecoveryServicesBackupContainer.cs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,32 +25,47 @@
2525
namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets
2626
{
2727
/// <summary>
28-
/// Get list of containers
28+
/// Fetches containers registered to the item according to the filters passed via the cmdlet parameters.
2929
/// </summary>
3030
[Cmdlet(VerbsCommon.Get, "AzureRmRecoveryServicesBackupContainer"),
3131
OutputType(typeof(ContainerBase), typeof(IList<ContainerBase>))]
3232
public class GetAzureRmRecoveryServicesBackupContainer : RecoveryServicesBackupCmdletBase
3333
{
34+
/// <summary>
35+
/// The type of the container(s) to be fetched.
36+
/// </summary>
3437
[Parameter(Mandatory = true, Position = 1, HelpMessage = ParamHelpMsgs.Container.ContainerType)]
3538
[ValidateNotNullOrEmpty]
3639
public ContainerType ContainerType { get; set; }
3740

41+
/// <summary>
42+
/// The backup management type of the container(s) to be fetched.
43+
/// </summary>
3844
[Parameter(Mandatory = false, Position = 2,
3945
HelpMessage = ParamHelpMsgs.Container.BackupManagementType)]
4046
[ValidateNotNullOrEmpty]
4147
[ValidateSet("AzureVM", "MARS")]
4248
public string BackupManagementType { get; set; }
4349

50+
/// <summary>
51+
/// Friendly name of the container(s) to be fetched.
52+
/// </summary>
4453
[Parameter(Mandatory = false, Position = 3,
4554
HelpMessage = ParamHelpMsgs.Container.Name)]
4655
[ValidateNotNullOrEmpty]
4756
public string Name { get; set; }
4857

58+
/// <summary>
59+
/// Resource group name of the container(s) to be fetched.
60+
/// </summary>
4961
[Parameter(Mandatory = false, Position = 4,
5062
HelpMessage = ParamHelpMsgs.Container.ResourceGroupName)]
5163
[ValidateNotNullOrEmpty]
5264
public string ResourceGroupName { get; set; }
5365

66+
/// <summary>
67+
/// Status of the registration of the container with the recovery services vault.
68+
/// </summary>
5469
[Parameter(Mandatory = false, Position = 5,
5570
HelpMessage = ParamHelpMsgs.Container.Status)]
5671
[ValidateNotNullOrEmpty]

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup/Cmdlets/Container/GetAzureRmRecoveryServicesBackupManagementServer.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,16 @@
2525
namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets
2626
{
2727
/// <summary>
28-
/// Get list of containers
28+
/// Fetches backup management servers registered to the recovery services vault.
2929
/// </summary>
3030
[Cmdlet(VerbsCommon.Get, "AzureRmRecoveryServicesBackupManagementServer"),
3131
OutputType(typeof(BackupEngineBase), typeof(IList<BackupEngineBase>))]
3232
public class GetAzureRmRecoveryServicesBackupManagementServer
3333
: RecoveryServicesBackupCmdletBase
3434
{
35+
/// <summary>
36+
/// Name of the backup management server(s) to be fetched.
37+
/// </summary>
3538
[Parameter(Mandatory = false, Position = 1,
3639
HelpMessage = ParamHelpMsgs.Container.Name)]
3740
[ValidateNotNullOrEmpty]

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup/Cmdlets/Container/UnregisterAzureRmRecoveryServicesBackupContainer.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,15 @@
2626
namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets
2727
{
2828
/// <summary>
29-
/// Get list of containers
29+
/// Unregisters container from the recovery services vault.
3030
/// </summary>
3131
[Cmdlet(VerbsLifecycle.Unregister, "AzureRmRecoveryServicesBackupContainer")]
3232
public class UnregisterAzureRmRecoveryServicesBackupContainer
3333
: RecoveryServicesBackupCmdletBase
3434
{
35+
/// <summary>
36+
/// Container model object to be unregistered from the vault.
37+
/// </summary>
3538
[Parameter(Mandatory = true, Position = 1,
3639
HelpMessage = ParamHelpMsgs.Container.RegisteredContainer)]
3740
[ValidateNotNullOrEmpty]

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup/Cmdlets/Container/UnregisterAzureRmRecoveryServicesBackupManagementServer.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,16 @@
2525

2626
namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Container
2727
{
28+
/// <summary>
29+
/// Unregisters the backup management server from the vault.
30+
/// </summary>
2831
[Cmdlet(VerbsLifecycle.Unregister, "AzureRmRecoveryServicesBackupManagementServer")]
2932
public class UnregisterAzureRmRecoveryServicesBackupManagementServer
3033
: RecoveryServicesBackupCmdletBase
3134
{
35+
/// <summary>
36+
/// The backup management server to be unregistered from the vault.
37+
/// </summary>
3238
[Parameter(Mandatory = true, Position = 1,
3339
HelpMessage = ParamHelpMsgs.Container.RegisteredContainer)]
3440
[ValidateNotNullOrEmpty]

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup/Cmdlets/Item/DisableAzureRmRecoveryServicesBackupProtection.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,25 @@
2828
namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets
2929
{
3030
/// <summary>
31-
/// Enable Azure Backup protection
31+
/// Disable protection of an item protected by the recovery services vault.
32+
/// Returns the corresponding job created in the service to track this operation.
3233
/// </summary>
3334
[Cmdlet(VerbsLifecycle.Disable, "AzureRmRecoveryServicesBackupProtection"),
3435
OutputType(typeof(JobBase))]
3536
public class DisableAzureRmRecoveryServicesBackupProtection : RecoveryServicesBackupCmdletBase
3637
{
38+
/// <summary>
39+
/// The protected item whose protection needs to be disabled.
40+
/// </summary>
3741
[Parameter(Position = 1, Mandatory = true, HelpMessage = ParamHelpMsgs.Item.ProtectedItem,
3842
ValueFromPipeline = true)]
3943
[ValidateNotNullOrEmpty]
4044
public ItemBase Item { get; set; }
4145

46+
/// <summary>
47+
/// If this option is used, all the data backed up for this item will
48+
/// also be deleted and restoring the data will not be possible.
49+
/// </summary>
4250
[Parameter(Position = 2, Mandatory = false,
4351
HelpMessage = ParamHelpMsgs.Item.RemoveProtectionOption)]
4452
public SwitchParameter RemoveRecoveryPoints
@@ -47,6 +55,9 @@ public SwitchParameter RemoveRecoveryPoints
4755
set { DeleteBackupData = value; }
4856
}
4957

58+
/// <summary>
59+
/// Prevents the confirmation dialog when specified.
60+
/// </summary>
5061
[Parameter(Mandatory = false, HelpMessage = ParamHelpMsgs.Item.ForceOption)]
5162
public SwitchParameter Force { get; set; }
5263

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup/Cmdlets/Item/EnableAzureRmRecoveryServicesBackupProtection.cs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets
2929
{
3030
/// <summary>
31-
/// Enable Azure Backup protection
31+
/// Enable protection of an item with the recovery services vault.
32+
/// Returns the corresponding job created in the service to track this operation.
3233
/// </summary>
3334
[Cmdlet(VerbsLifecycle.Enable, "AzureRmRecoveryServicesBackupProtection",
3435
DefaultParameterSetName = AzureVMComputeParameterSet), OutputType(typeof(JobBase))]
@@ -38,26 +39,41 @@ public class EnableAzureRmRecoveryServicesBackupProtection : RecoveryServicesBac
3839
internal const string AzureVMComputeParameterSet = "AzureVMComputeEnableProtection";
3940
internal const string ModifyProtectionParameterSet = "ModifyProtection";
4041

42+
/// <summary>
43+
/// Policy to be associated with this item as part of the protection operation.
44+
/// </summary>
4145
[Parameter(Position = 1, Mandatory = true, HelpMessage = ParamHelpMsgs.Policy.ProtectionPolicy)]
4246
[ValidateNotNullOrEmpty]
4347
public PolicyBase Policy { get; set; }
4448

49+
/// <summary>
50+
/// Name of the Azure VM whose representative item needs to be protected.
51+
/// </summary>
4552
[Parameter(Position = 2, Mandatory = true, ValueFromPipelineByPropertyName = true,
4653
ParameterSetName = AzureVMClassicComputeParameterSet, HelpMessage = ParamHelpMsgs.Item.AzureVMName)]
4754
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true,
4855
ParameterSetName = AzureVMComputeParameterSet, HelpMessage = ParamHelpMsgs.Item.AzureVMName)]
4956
public string Name { get; set; }
5057

58+
/// <summary>
59+
/// Service name of the classic Azure VM whose representative item needs to be protected.
60+
/// </summary>
5161
[Parameter(Position = 3, Mandatory = true, ValueFromPipelineByPropertyName = true,
5262
ParameterSetName = AzureVMClassicComputeParameterSet,
5363
HelpMessage = ParamHelpMsgs.Item.AzureVMServiceName)]
5464
public string ServiceName { get; set; }
5565

66+
/// <summary>
67+
/// Resource group name of the compute Azure VM whose representative item needs to be protected.
68+
/// </summary>
5669
[Parameter(Position = 3, Mandatory = true, ValueFromPipelineByPropertyName = true,
5770
ParameterSetName = AzureVMComputeParameterSet,
5871
HelpMessage = ParamHelpMsgs.Item.AzureVMResourceGroupName)]
5972
public string ResourceGroupName { get; set; }
6073

74+
/// <summary>
75+
/// Item whose protection needs to be modified.
76+
/// </summary>
6177
[Parameter(Position = 4, Mandatory = true, ParameterSetName = ModifyProtectionParameterSet,
6278
HelpMessage = ParamHelpMsgs.Item.ProtectedItem, ValueFromPipeline = true)]
6379
[ValidateNotNullOrEmpty]

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup/Cmdlets/Item/GetAzureRmRecoveryServicesBackupItem.cs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets
2525
{
2626
/// <summary>
27-
/// Get list of items
27+
/// Get list of items associated with the recovery services vault
28+
/// according to the filters passed via the cmdlet parameters.
2829
/// </summary>
2930
[Cmdlet(VerbsCommon.Get, "AzureRmRecoveryServicesBackupItem",
3031
DefaultParameterSetName = GetItemsForContainerParamSet), OutputType(typeof(ItemBase),
@@ -34,28 +35,46 @@ public class GetAzureRmRecoveryServicesBackupItem : RecoveryServicesBackupCmdlet
3435
internal const string GetItemsForContainerParamSet = "GetItemsForContainer";
3536
internal const string GetItemsForVaultParamSet = "GetItemsForVault";
3637

38+
/// <summary>
39+
/// When this option is specified, only those items which belong to this container will be returned.
40+
/// </summary>
3741
[Parameter(Mandatory = true, Position = 1, HelpMessage = ParamHelpMsgs.Item.Container,
3842
ParameterSetName = GetItemsForContainerParamSet)]
3943
[ValidateNotNullOrEmpty]
4044
public ContainerBase Container { get; set; }
4145

46+
/// <summary>
47+
/// Backup management type of the items to be returned.
48+
/// </summary>
4249
[Parameter(Mandatory = true, Position = 1, HelpMessage = ParamHelpMsgs.Common.BackupManagementType,
4350
ParameterSetName = GetItemsForVaultParamSet)]
4451
[ValidateNotNullOrEmpty]
4552
public BackupManagementType BackupManagementType { get; set; }
4653

54+
/// <summary>
55+
/// Friendly name of the item to be returned.
56+
/// </summary>
4757
[Parameter(Mandatory = false, Position = 2, HelpMessage = ParamHelpMsgs.Item.AzureVMName)]
4858
[ValidateNotNullOrEmpty]
4959
public string Name { get; set; }
5060

61+
/// <summary>
62+
/// Status of protection of the item to be returned.
63+
/// </summary>
5164
[Parameter(Mandatory = false, Position = 3, HelpMessage = ParamHelpMsgs.Item.ProtectionStatus)]
5265
[ValidateNotNullOrEmpty]
5366
public ItemProtectionStatus ProtectionStatus { get; set; }
5467

68+
/// <summary>
69+
/// State of protection of the item to be returned.
70+
/// </summary>
5571
[Parameter(Mandatory = false, Position = 4, HelpMessage = ParamHelpMsgs.Item.Status)]
5672
[ValidateNotNullOrEmpty]
5773
public ItemProtectionState ProtectionState { get; set; }
5874

75+
/// <summary>
76+
/// Workload type of the item to be returned.
77+
/// </summary>
5978
[Parameter(Mandatory = true, Position = 5, HelpMessage = ParamHelpMsgs.Common.WorkloadType)]
6079
[ValidateNotNullOrEmpty]
6180
public WorkloadType WorkloadType { get; set; }

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup/Cmdlets/Jobs/GetAzureRmRecoveryServicesBackupJob.cs

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,36 +22,58 @@
2222
namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets
2323
{
2424
/// <summary>
25-
/// Get list of jobs
25+
/// Gets the list of jobs associated with this recovery services vault
26+
/// according to the filters passed via the cmdlet parameters.
2627
/// </summary>
2728
[Cmdlet(VerbsCommon.Get, "AzureRmRecoveryServicesBackupJob"),
2829
OutputType(typeof(JobBase), typeof(IList<JobBase>))]
2930
public class GetAzureRmRecoveryServicesBackupJob : RecoveryServicesBackupCmdletBase
3031
{
32+
/// <summary>
33+
/// Filter value for status of job.
34+
/// </summary>
3135
[Parameter(Mandatory = false, HelpMessage = ParamHelpMsgs.Job.StatusFilter, Position = 1)]
3236
[ValidateNotNullOrEmpty]
3337
public JobStatus? Status { get; set; }
3438

39+
/// <summary>
40+
/// Filter value for type of job.
41+
/// </summary>
3542
[Parameter(Mandatory = false, HelpMessage = ParamHelpMsgs.Job.OperationFilter, Position = 2)]
3643
[ValidateNotNullOrEmpty]
3744
public JobOperation? Operation { get; set; }
3845

46+
/// <summary>
47+
/// Beginning value of time range for which jobs have to be fetched.
48+
/// </summary>
3949
[Parameter(Mandatory = false, HelpMessage = ParamHelpMsgs.Job.FromFilter, Position = 3)]
4050
[ValidateNotNull]
4151
public DateTime? From { get; set; }
4252

53+
/// <summary>
54+
/// Ending value of time range for which jobs have to be fetched.
55+
/// </summary>
4356
[Parameter(Mandatory = false, HelpMessage = ParamHelpMsgs.Job.ToFilter, Position = 4)]
4457
[ValidateNotNull]
4558
public DateTime? To { get; set; }
4659

60+
/// <summary>
61+
/// Filter value for ID of job.
62+
/// </summary>
4763
[Parameter(Mandatory = false, HelpMessage = ParamHelpMsgs.Job.JobIdFilter, Position = 5)]
4864
[ValidateNotNullOrEmpty]
4965
public string JobId { get; set; }
5066

67+
/// <summary>
68+
/// Job whose latest object has to be fetched.
69+
/// </summary>
5170
[Parameter(Mandatory = false, HelpMessage = ParamHelpMsgs.Job.JobFilter, Position = 6)]
5271
[ValidateNotNull]
5372
public JobBase Job { get; set; }
5473

74+
/// <summary>
75+
/// Filter value for backup management type of job.
76+
/// </summary>
5577
[Parameter(Mandatory = false, HelpMessage = ParamHelpMsgs.Job.BackupManagementTypeFilter)]
5678
[ValidateNotNullOrEmpty]
5779
public BackupManagementType? BackupManagementType { get; set; }

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup/Cmdlets/Jobs/GetAzureRmRecoveryServicesBackupJobDetails.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,27 @@
1818

1919
namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets
2020
{
21+
/// <summary>
22+
/// Gets detailed information about a particular job.
23+
/// </summary>
2124
[Cmdlet(VerbsCommon.Get, "AzureRmRecoveryServicesBackupJobDetails",
2225
DefaultParameterSetName = JobFilterSet), OutputType(typeof(JobBase))]
2326
public class GetAzureRmRecoveryServicesBackupJobDetails : RecoveryServicesBackupCmdletBase
2427
{
2528
protected const string IdFilterSet = "IdFilterSet";
2629
protected const string JobFilterSet = "JobFilterSet";
2730

31+
/// <summary>
32+
/// Job whose details are to be fetched.
33+
/// </summary>
2834
[Parameter(Mandatory = true, HelpMessage = ParamHelpMsgs.Job.JobFilter,
2935
ParameterSetName = JobFilterSet, Position = 1)]
3036
[ValidateNotNull]
3137
public JobBase Job { get; set; }
3238

39+
/// <summary>
40+
/// ID of job whose details are to be fetched.
41+
/// </summary>
3342
[Parameter(Mandatory = true, HelpMessage = ParamHelpMsgs.Job.JobIdFilter,
3443
ParameterSetName = IdFilterSet, Position = 2)]
3544
[ValidateNotNullOrEmpty]

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup/Cmdlets/Jobs/StopAzureRmRecoveryServicesBackupJob.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,27 @@
2424

2525
namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets
2626
{
27+
/// <summary>
28+
/// Cancels a job. Returns the corresponding job object after this operation finishes.
29+
/// </summary>
2730
[Cmdlet("Stop", "AzureRmRecoveryServicesBackupJob", DefaultParameterSetName = JobFilterSet),
2831
OutputType(typeof(JobBase))]
2932
public class StopAzureRmRecoveryServicesBackupJob : RecoveryServicesBackupCmdletBase
3033
{
3134
protected const string IdFilterSet = "IdFilterSet";
3235
protected const string JobFilterSet = "JobFilterSet";
3336

37+
/// <summary>
38+
/// Job which needs to be canceled.
39+
/// </summary>
3440
[Parameter(Mandatory = true, HelpMessage = ParamHelpMsgs.Job.StopJobJobFilter,
3541
ParameterSetName = JobFilterSet, Position = 1)]
3642
[ValidateNotNull]
3743
public JobBase Job { get; set; }
3844

45+
/// <summary>
46+
/// ID of the job which needs to be canceled.
47+
/// </summary>
3948
[Parameter(Mandatory = true, HelpMessage = ParamHelpMsgs.Job.StopJobJobIdFilter,
4049
ParameterSetName = IdFilterSet, Position = 2)]
4150
[ValidateNotNull]

0 commit comments

Comments
 (0)