Skip to content

Commit 1a1941b

Browse files
author
dragonfly91
committed
[RS Backup] Fixing 7349803 (documentation fixes) for common files in Cmdlet Layer
1 parent 21b3b91 commit 1a1941b

File tree

3 files changed

+49
-2
lines changed

3 files changed

+49
-2
lines changed

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup/Constants.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,17 @@
1414

1515
namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets
1616
{
17+
/// <summary>
18+
/// Constants used by Job Cmdlets
19+
/// </summary>
1720
public class JobConstants
1821
{
1922
public const int MaximumJobsToFetch = 1000;
2023
}
2124

25+
/// <summary>
26+
/// Constants used by Policy Cmdlets
27+
/// </summary>
2228
public class PolicyConstants
2329
{
2430
public const int MinPolicyNameLength = 3;

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup/ParamHelpMsgs.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020

2121
namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets
2222
{
23+
/// <summary>
24+
/// Class enclosing the cmdlet parameter help messages
25+
/// </summary>
2326
internal static class ParamHelpMsgs
2427
{
2528
internal static class Container

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup/RecoveryServicesBackupCmdletBase.cs

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,24 @@ namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets
4141
/// </summary>
4242
public abstract class RecoveryServicesBackupCmdletBase : AzureRMCmdlet
4343
{
44-
// in seconds
44+
/// <summary>
45+
/// Defines the time (in seconds) to sleep in between calls while tracking operations
46+
/// </summary>
4547
private int _defaultSleepForOperationTracking = 5;
4648

49+
/// <summary>
50+
/// Service client adapter is used to make calls to the backend service
51+
/// </summary>
4752
protected ServiceClientAdapter ServiceClientAdapter { get; set; }
4853

54+
/// <summary>
55+
/// Resource management client is used to make calls to the Compute service
56+
/// </summary>
4957
protected ResourcesNS.ResourceManagementClient RmClient { get; set; }
5058

59+
/// <summary>
60+
/// Initializes the service clients and the logging utility
61+
/// </summary>
5162
protected void InitializeAzureBackupCmdlet()
5263
{
5364
var cloudServicesClient = AzureSession.ClientFactory.CreateClient<CloudServiceManagementClient>(DefaultContext, AzureEnvironment.Endpoint.ResourceManager);
@@ -60,6 +71,11 @@ protected void InitializeAzureBackupCmdlet()
6071
Logger.Instance = new Logger(WriteWarning, WriteDebug, WriteVerbose, ThrowTerminatingError);
6172
}
6273

74+
/// <summary>
75+
/// Wrapper method which executes the cmdlet processing blocks.
76+
/// Catches and logs any exception occuring during the execution.
77+
/// </summary>
78+
/// <param name="action">Delegate representing the cmdlet processing block</param>
6379
protected void ExecutionBlock(Action action)
6480
{
6581
try
@@ -76,7 +92,7 @@ protected void ExecutionBlock(Action action)
7692
/// <summary>
7793
/// Handles set of exceptions thrown by client
7894
/// </summary>
79-
/// <param name="ex"></param>
95+
/// <param name="ex">Exception thrown by the client</param>
8096
private void HandleException(Exception exception)
8197
{
8298
if (exception is AggregateException && ((AggregateException)exception).InnerExceptions != null
@@ -137,11 +153,21 @@ protected override void BeginProcessing()
137153
InitializeAzureBackupCmdlet();
138154
}
139155

156+
/// <summary>
157+
/// Get the job PS model after fetching the job object from the service given the job ID.
158+
/// </summary>
159+
/// <param name="jobId">ID of the job to be fetched</param>
160+
/// <returns></returns>
140161
public CmdletModel.JobBase GetJobObject(string jobId)
141162
{
142163
return JobConversions.GetPSJob(ServiceClientAdapter.GetJob(jobId));
143164
}
144165

166+
/// <summary>
167+
/// Gets list of job PS models after fetching the job objects from the service given the list of job IDs.
168+
/// </summary>
169+
/// <param name="jobIds">List of IDs of jobs to be fetched</param>
170+
/// <returns></returns>
145171
public List<CmdletModel.JobBase> GetJobObject(IList<string> jobIds)
146172
{
147173
List<CmdletModel.JobBase> result = new List<CmdletModel.JobBase>();
@@ -152,6 +178,13 @@ public CmdletModel.JobBase GetJobObject(string jobId)
152178
return result;
153179
}
154180

181+
/// <summary>
182+
/// Block to track the operation to completion.
183+
/// Waits till the status of the operation becomes something other than InProgress.
184+
/// </summary>
185+
/// <param name="statusUrlLink"></param>
186+
/// <param name="serviceClientMethod"></param>
187+
/// <returns></returns>
155188
public BackUpOperationStatusResponse WaitForOperationCompletionUsingStatusLink(
156189
string statusUrlLink,
157190
Func<string, BackUpOperationStatusResponse> serviceClientMethod)
@@ -174,6 +207,11 @@ public BackUpOperationStatusResponse WaitForOperationCompletionUsingStatusLink(
174207
return response;
175208
}
176209

210+
/// <summary>
211+
/// Based on the response from the service, handles the job created in the service appropriately.
212+
/// </summary>
213+
/// <param name="itemResponse">Response from service</param>
214+
/// <param name="operationName">Name of the operation</param>
177215
protected void HandleCreatedJob(BaseRecoveryServicesJobResponse itemResponse, string operationName)
178216
{
179217
WriteDebug(Resources.TrackingOperationStatusURLForCompletion +

0 commit comments

Comments
 (0)