Skip to content

Commit 2183e6a

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

File tree

4 files changed

+64
-3
lines changed

4 files changed

+64
-3
lines changed

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]

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

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,23 @@
2323

2424
namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets
2525
{
26+
/// <summary>
27+
/// Waits for the given job to finish its operation and returns the corresponding job object.
28+
/// </summary>
2629
[Cmdlet("Wait", "AzureRmRecoveryServicesBackupJob"), OutputType(typeof(JobBase), typeof(IList<JobBase>))]
2730
public class WaitAzureRmRecoveryServicesBackupJob : RecoveryServicesBackupCmdletBase
2831
{
32+
/// <summary>
33+
/// Job or List of jobs until end of which the cmdlet should wait.
34+
/// </summary>
2935
[Parameter(Mandatory = true, HelpMessage = ParamHelpMsgs.Job.WaitJobOrListFilter,
3036
ValueFromPipeline = true, Position = 1)]
3137
[ValidateNotNull]
3238
public object Job { get; set; }
3339

40+
/// <summary>
41+
/// Maximum time to wait before aborting wait in seconds.
42+
/// </summary>
3443
[Parameter(Mandatory = false, HelpMessage = ParamHelpMsgs.Job.WaitJobTimeoutFilter, Position = 2)]
3544
public long? Timeout { get; set; }
3645

@@ -131,6 +140,13 @@ public override void ExecuteCmdlet()
131140
});
132141
}
133142

143+
/// <summary>
144+
/// Gets casted object of type T from the input object obj if possible.
145+
/// </summary>
146+
/// <typeparam name="T">Type into which the object has to be casted.</typeparam>
147+
/// <param name="obj">Object to be casted.</param>
148+
/// <param name="castedJob">Object after casting.</param>
149+
/// <returns></returns>
134150
private bool GetCastedObjFromPSObj<T>(object obj, out object castedJob) where T : class
135151
{
136152
if (obj is PSObject)
@@ -147,8 +163,13 @@ private bool GetCastedObjFromPSObj<T>(object obj, out object castedJob) where T
147163
return true;
148164
}
149165

150-
// Move the following function to a common helper file later when
151-
// more functions of this type are required.
166+
/// <summary>
167+
/// Checks if the job is already in progress.
168+
/// TODO: Move the following function to a common helper file later when
169+
/// more functions of this type are required.
170+
/// </summary>
171+
/// <param name="job">Job to check if it is in progress.</param>
172+
/// <returns></returns>
152173
private bool IsJobInProgress(JobBase job)
153174
{
154175
if (job.Status.CompareTo("InProgress") == 0 ||

0 commit comments

Comments
 (0)