Skip to content

Commit 646fd54

Browse files
author
dragonfly91
committed
[RS Backup] Fixing 7349803 (documentation fixes) in Service Client Adapter Layer
1 parent 8ebbb6f commit 646fd54

File tree

11 files changed

+167
-15
lines changed

11 files changed

+167
-15
lines changed

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.ServiceClientAdapter/BMSAPIs/ContainerAPIs.cs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ public partial class ServiceClientAdapter
2727
/// <summary>
2828
/// Fetches protection containers in the vault according to the query params
2929
/// </summary>
30-
/// <param name="parameters"></param>
31-
/// <returns></returns>
30+
/// <param name="parameters">Query parameters</param>
31+
/// <returns>List of protection containers</returns>
3232
public IEnumerable<ProtectionContainerResource> ListContainers(
3333
ProtectionContainerListQueryParams queryParams)
3434
{
@@ -42,10 +42,10 @@ public IEnumerable<ProtectionContainerResource> ListContainers(
4242
}
4343

4444
/// <summary>
45-
/// Fetches backup engine in the vault according to the query params
45+
/// Fetches backup engines in the vault according to the query params
4646
/// </summary>
47-
/// <param name="parameters"></param>
48-
/// <returns></returns>
47+
/// <param name="parameters">Query parameters</param>
48+
/// <returns>List of backup engines</returns>
4949
public IEnumerable<BackupEngineResource> ListBackupEngines(BackupEngineListQueryParams queryParams)
5050
{
5151
PaginationRequest paginationParam = new PaginationRequest();
@@ -63,7 +63,7 @@ public IEnumerable<BackupEngineResource> ListBackupEngines(BackupEngineListQuery
6363
/// <summary>
6464
/// Triggers refresh of container catalog in service
6565
/// </summary>
66-
/// <returns></returns>
66+
/// <returns>Response of the job created in the service</returns>
6767
public BaseRecoveryServicesJobResponse RefreshContainers()
6868
{
6969
string resourceName = BmsAdapter.GetResourceName();
@@ -78,9 +78,8 @@ public BaseRecoveryServicesJobResponse RefreshContainers()
7878
}
7979

8080
/// <summary>
81-
/// Unregister a container in service
81+
/// Triggers unregister of a container in service
8282
/// </summary>
83-
/// <returns></returns>
8483
public AzureOperationResponse UnregisterContainers(string containerName)
8584
{
8685
string resourceName = BmsAdapter.GetResourceName();

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.ServiceClientAdapter/BMSAPIs/ItemAPIs.cs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.ServiceClient
2323
{
2424
public partial class ServiceClientAdapter
2525
{
26+
/// <summary>
27+
/// Creates a new protected item or updates an already existing protected item
28+
/// </summary>
29+
/// <param name="containerName">Name of the container which this item belongs to</param>
30+
/// <param name="protectedItemName">Name of the item</param>
31+
/// <param name="request">Protected item create or update request</param>
32+
/// <returns>Job created in the service for this operation</returns>
2633
public BaseRecoveryServicesJobResponse CreateOrUpdateProtectedItem(
2734
string containerName,
2835
string protectedItemName,
@@ -42,6 +49,12 @@ public BaseRecoveryServicesJobResponse CreateOrUpdateProtectedItem(
4249
BmsAdapter.CmdletCancellationToken).Result;
4350
}
4451

52+
/// <summary>
53+
/// Deletes a protected item
54+
/// </summary>
55+
/// <param name="containerName">Name of the container which this item belongs to</param>
56+
/// <param name="protectedItemName">Name of the item</param>
57+
/// <returns>Job created in the service for this operation</returns>
4558
public BaseRecoveryServicesJobResponse DeleteProtectedItem(
4659
string containerName,
4760
string protectedItemName)
@@ -59,6 +72,13 @@ public BaseRecoveryServicesJobResponse DeleteProtectedItem(
5972
BmsAdapter.CmdletCancellationToken).Result;
6073
}
6174

75+
/// <summary>
76+
/// Gets a protected item
77+
/// </summary>
78+
/// <param name="containerName">Name of the container which this item belongs to</param>
79+
/// <param name="protectedItemName">Name of the item</param>
80+
/// <param name="queryFilter">Query filter</param>
81+
/// <returns>Protected item</returns>
6282
public ProtectedItemResponse GetProtectedItem(
6383
string containerName,
6484
string protectedItemName,
@@ -78,6 +98,13 @@ public ProtectedItemResponse GetProtectedItem(
7898
BmsAdapter.CmdletCancellationToken).Result;
7999
}
80100

101+
/// <summary>
102+
/// List protected items protected by the Recovery Services vault according to the query params
103+
/// and pagination params.
104+
/// </summary>
105+
/// <param name="queryFilter">Query params</param>
106+
/// <param name="paginationParams">Pagination params</param>
107+
/// <returns>List of protected items</returns>
81108
public ProtectedItemListResponse ListProtectedItem(
82109
ProtectedItemListQueryParam queryFilter,
83110
PaginationRequest paginationParams = null)

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.ServiceClientAdapter/BMSAPIs/JobAPIs.cs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.ServiceClient
1919
{
2020
public partial class ServiceClientAdapter
2121
{
22+
/// <summary>
23+
/// Gets a job
24+
/// </summary>
25+
/// <param name="jobId">ID of the job</param>
26+
/// <returns>Job response returned by the service</returns>
2227
public JobResponse GetJob(string jobId)
2328
{
2429
string resourceName = BmsAdapter.GetResourceName();
@@ -32,6 +37,18 @@ public JobResponse GetJob(string jobId)
3237
BmsAdapter.CmdletCancellationToken).Result;
3338
}
3439

40+
/// <summary>
41+
/// Lists jobs according to the parameters
42+
/// </summary>
43+
/// <param name="jobId">ID of the job</param>
44+
/// <param name="status">Status of the job</param>
45+
/// <param name="operation">Operation represented by the job</param>
46+
/// <param name="startTime">Time when the job started</param>
47+
/// <param name="endTime">Time when the job finished</param>
48+
/// <param name="backupManagementType">Backup management type of the item represented by the job</param>
49+
/// <param name="top">Top pagination param</param>
50+
/// <param name="skipToken">Skip token pagination param</param>
51+
/// <returns>Job list response from the service</returns>
3552
public JobListResponse GetJobs(
3653
string jobId,
3754
string status,
@@ -73,6 +90,11 @@ public JobListResponse GetJobs(
7390
BmsAdapter.CmdletCancellationToken).Result;
7491
}
7592

93+
/// <summary>
94+
/// Cancels a job
95+
/// </summary>
96+
/// <param name="jobId">ID of the job to cancel</param>
97+
/// <returns>Cancelled job response from the service</returns>
7698
public BaseRecoveryServicesJobResponse CancelJob(string jobId)
7799
{
78100
string resourceName = BmsAdapter.GetResourceName();
@@ -86,6 +108,12 @@ public BaseRecoveryServicesJobResponse CancelJob(string jobId)
86108
BmsAdapter.CmdletCancellationToken).Result;
87109
}
88110

111+
/// <summary>
112+
/// Gets the job operation status
113+
/// </summary>
114+
/// <param name="jobId">ID of the job</param>
115+
/// <param name="operationId">ID of the operation associated with the job</param>
116+
/// <returns>Job response returned by the service</returns>
89117
public JobResponse GetJobOperationStatus(string jobId, string operationId)
90118
{
91119
string resourceName = BmsAdapter.GetResourceName();
@@ -102,6 +130,16 @@ public JobResponse GetJobOperationStatus(string jobId, string operationId)
102130

103131
#region private helpers
104132

133+
/// <summary>
134+
/// Constructs the query object based on the input parameters
135+
/// </summary>
136+
/// <param name="backupManagementType">Backup management type of the item associated with the job</param>
137+
/// <param name="startTime">Time when the job started</param>
138+
/// <param name="endTime">Time when the job ended</param>
139+
/// <param name="jobId">ID of the job</param>
140+
/// <param name="status">Status of the job</param>
141+
/// <param name="operation">ID of operation associated with the job</param>
142+
/// <returns></returns>
105143
public CommonJobQueryFilters GetQueryObject(
106144
string backupManagementType,
107145
DateTime startTime,

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.ServiceClientAdapter/BMSAPIs/OperationStatusAPIs.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.ServiceClient
2323
{
2424
public partial class ServiceClientAdapter
2525
{
26+
/// <summary>
27+
/// Gets result of the refresh container operation using the operation tracking URL
28+
/// </summary>
29+
/// <param name="operationResultLink">Operation tracking URL</param>
30+
/// <returns>Job response returned by the service</returns>
2631
public BaseRecoveryServicesJobResponse GetRefreshContainerOperationResultByURL(
2732
string operationResultLink)
2833
{
@@ -34,6 +39,11 @@ public BaseRecoveryServicesJobResponse GetRefreshContainerOperationResultByURL(
3439
BmsAdapter.CmdletCancellationToken).Result;
3540
}
3641

42+
/// <summary>
43+
/// Gets result of a generic operation on the protected item using the operation tracking URL
44+
/// </summary>
45+
/// <param name="operationResultLink">Operation tracking URL</param>
46+
/// <returns>Operation status response returned by the service</returns>
3747
public BackUpOperationStatusResponse GetProtectedItemOperationStatusByURL(
3848
string operationResultLink)
3949
{

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.ServiceClientAdapter/BMSAPIs/PolicyAPIs.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.ServiceClient
2323
{
2424
public partial class ServiceClientAdapter
2525
{
26+
/// <summary>
27+
/// Creates a new policy or updates an already existing policy
28+
/// </summary>
29+
/// <param name="policyName">Name of the policy</param>
30+
/// <param name="request">Policy create or update request</param>
31+
/// <returns>Policy created by this operation</returns>
2632
public ProtectionPolicyResponse CreateOrUpdateProtectionPolicy(
2733
string policyName,
2834
ProtectionPolicyRequest request)
@@ -36,6 +42,11 @@ public ProtectionPolicyResponse CreateOrUpdateProtectionPolicy(
3642
BmsAdapter.CmdletCancellationToken).Result;
3743
}
3844

45+
/// <summary>
46+
/// Gets a protection policy given the name
47+
/// </summary>
48+
/// <param name="policyName">Name of the policy</param>
49+
/// <returns>Policy response returned by the service</returns>
3950
public ProtectionPolicyResponse GetProtectionPolicy(string policyName)
4051
{
4152
return BmsAdapter.Client.ProtectionPolicies.GetAsync(
@@ -46,6 +57,11 @@ public ProtectionPolicyResponse GetProtectionPolicy(string policyName)
4657
BmsAdapter.CmdletCancellationToken).Result;
4758
}
4859

60+
/// <summary>
61+
/// Lists protection policies according to the input query filter
62+
/// </summary>
63+
/// <param name="queryFilter">Query filter</param>
64+
/// <returns>List of protection policies</returns>
4965
public ProtectionPolicyListResponse ListProtectionPolicy(
5066
ProtectionPolicyQueryParameters queryFilter)
5167
{
@@ -57,6 +73,11 @@ public ProtectionPolicyListResponse ListProtectionPolicy(
5773
BmsAdapter.CmdletCancellationToken).Result;
5874
}
5975

76+
/// <summary>
77+
/// Gets protection policy operation status using the operation tracking URL
78+
/// </summary>
79+
/// <param name="url">Operation tracking URL</param>
80+
/// <returns>Operation status response returned by the service</returns>
6081
public BackUpOperationStatusResponse GetProtectionPolicyOperationStatusByURL(string url)
6182
{
6283
return BmsAdapter.Client.GetOperationStatusByURLAsync(
@@ -65,6 +86,10 @@ public BackUpOperationStatusResponse GetProtectionPolicyOperationStatusByURL(str
6586
BmsAdapter.CmdletCancellationToken).Result;
6687
}
6788

89+
/// <summary>
90+
/// Deletes protection policy from the vault specified by the name
91+
/// </summary>
92+
/// <param name="policyName">Name of the policy to be deleted</param>
6893
public AzureOperationResponse RemoveProtectionPolicy(
6994
string policyName)
7095
{

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.ServiceClientAdapter/BMSAPIs/ProtectableItemAPI.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.ServiceClient
2323
{
2424
public partial class ServiceClientAdapter
2525
{
26+
/// <summary>
27+
/// Lists protectable items according to the query filter and the pagination params
28+
/// </summary>
29+
/// <param name="queryFilter">Query filter</param>
30+
/// <param name="paginationRequest">Pagination parameters</param>
31+
/// <returns>List of protectable items</returns>
2632
public ProtectableObjectListResponse ListProtectableItem(
2733
ProtectableObjectListQueryParameters queryFilter,
2834
PaginationRequest paginationRequest = null)
@@ -39,6 +45,12 @@ public ProtectableObjectListResponse ListProtectableItem(
3945
BmsAdapter.CmdletCancellationToken).Result;
4046
}
4147

48+
/// <summary>
49+
/// Triggers backup on the specified item
50+
/// </summary>
51+
/// <param name="containerName">Name of the container which this item belongs to</param>
52+
/// <param name="itemName">Name of the item</param>
53+
/// <returns>Job created by this operation</returns>
4254
public BaseRecoveryServicesJobResponse TriggerBackup(string containerName, string itemName)
4355
{
4456
return BmsAdapter.Client.Backups.TriggerBackupAsync(

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.ServiceClientAdapter/BMSAPIs/RecoveryPointsAPIs.cs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,13 @@ namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.ServiceClient
2323
{
2424
public partial class ServiceClientAdapter
2525
{
26-
26+
/// <summary>
27+
/// Gets detail about the recovery point identified by the input parameters
28+
/// </summary>
29+
/// <param name="containerName">Name of the container which the item belongs to</param>
30+
/// <param name="protectedItemName">Name of the item</param>
31+
/// <param name="recoveryPointId">ID of the recovery point</param>
32+
/// <returns>Recovery point response returned by the service</returns>
2733
public RecoveryPointResponse GetRecoveryPointDetails
2834
(
2935
string containerName,
@@ -47,7 +53,13 @@ string recoveryPointId
4753
return response;
4854
}
4955

50-
56+
/// <summary>
57+
/// Lists recovery points according to the input parameters
58+
/// </summary>
59+
/// <param name="containerName">Name of the container which the item belongs to</param>
60+
/// <param name="protectedItemName">Name of the item</param>
61+
/// <param name="queryFilter">Query filter</param>
62+
/// <returns>List of recovery points</returns>
5163
public RecoveryPointListResponse GetRecoveryPoints
5264
(
5365
string containerName,

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.ServiceClientAdapter/BMSAPIs/RestoreDiskAPIs.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,14 @@ namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.ServiceClient
2525
{
2626
public partial class ServiceClientAdapter
2727
{
28-
28+
/// <summary>
29+
/// Restores the disk based on the recovery point and other input parameters
30+
/// </summary>
31+
/// <param name="rp">Recovery point to restore the disk to</param>
32+
/// <param name="storageAccountId">ID of the storage account where to restore the disk</param>
33+
/// <param name="storageAccountLocation">Location of the storage account where to restore the disk</param>
34+
/// <param name="storageAccountType">Type of the storage account where to restore the disk</param>
35+
/// <returns>Job created by this operation</returns>
2936
public BaseRecoveryServicesJobResponse RestoreDisk(AzureVmRecoveryPoint rp, string storageAccountId,
3037
string storageAccountLocation, string storageAccountType)
3138
{

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.ServiceClientAdapter/ClientProxy.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public partial class ClientProxy<TClient, THeader> : ClientProxyBase
3636
private Func<string, THeader> CustomRequestHeaderGenerator;
3737

3838
/// <summary>
39-
/// Get Azure backup client.
39+
/// Get Recovery Services Backup service client.
4040
/// </summary>
4141
public TClient Client
4242
{
@@ -57,6 +57,9 @@ public ClientProxy(Func<string, THeader> headerGenerator, params object[] parame
5757
CustomRequestHeaderGenerator = headerGenerator;
5858
}
5959

60+
/// <summary>
61+
/// Gets customer request headers
62+
/// </summary>
6063
public THeader GetCustomRequestHeaders()
6164
{
6265
return CustomRequestHeaderGenerator(this.ClientRequestId);

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.ServiceClientAdapter/ClientProxyBase.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ public ClientProxyBase(params object[] parameters)
4949
ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
5050
}
5151

52+
/// <summary>
53+
/// Assigns a new client request ID to be used in each service client call - for logging purposes
54+
/// </summary>
5255
public void RefreshClientRequestId()
5356
{
5457
ClientRequestId = Guid.NewGuid().ToString() + "-" + DateTime.Now.ToUniversalTime().ToString("yyyy-MM-dd HH:mm:ssZ") + "-PS";
@@ -59,6 +62,10 @@ public string GetClientRequestId()
5962
return ClientRequestId;
6063
}
6164

65+
/// <summary>
66+
/// Gets Recovery Services vault name from the vault context
67+
/// </summary>
68+
/// <returns></returns>
6269
public string GetResourceName()
6370
{
6471
if (string.IsNullOrEmpty(PSRecoveryServicesClient.arsVault.Name))
@@ -68,6 +75,10 @@ public string GetResourceName()
6875
return PSRecoveryServicesClient.arsVault.Name;
6976
}
7077

78+
/// <summary>
79+
/// Gets Recovery Services Vault's resource group name from the vault context
80+
/// </summary>
81+
/// <returns></returns>
7182
public string GetResourceGroupName()
7283
{
7384
if (string.IsNullOrEmpty(PSRecoveryServicesClient.arsVault.ResouceGroupName))
@@ -77,6 +88,10 @@ public string GetResourceGroupName()
7788
return PSRecoveryServicesClient.arsVault.ResouceGroupName;
7889
}
7990

91+
/// <summary>
92+
/// Gets Recovery Services Vault's location from the vault context
93+
/// </summary>
94+
/// <returns></returns>
8095
public string GetResourceLocation()
8196
{
8297
if (string.IsNullOrEmpty(PSRecoveryServicesClient.arsVault.Location))

0 commit comments

Comments
 (0)