Skip to content

Commit 8ebbb6f

Browse files
author
dragonfly91
committed
[RS Backup] Fixing 7349803 (documentation fixes) in Provider Layer
1 parent c469de1 commit 8ebbb6f

File tree

4 files changed

+77
-0
lines changed

4 files changed

+77
-0
lines changed

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.Providers/Providers/DpmPsBackupProvider.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ public class DpmPsBackupProvider : IPsBackupProvider
3232
Dictionary<System.Enum, object> ProviderData { get; set; }
3333
ServiceClientAdapter ServiceClientAdapter { get; set; }
3434

35+
/// <summary>
36+
/// Initializes the provider with the data recieved from the cmdlet layer
37+
/// </summary>
38+
/// <param name="providerData">Data from the cmdlet layer intended for the provider</param>
39+
/// <param name="serviceClientAdapter">Service client adapter for communicating with the backend service</param>
3540
public void Initialize(Dictionary<System.Enum, object> providerData, ServiceClientAdapter serviceClientAdapter)
3641
{
3742
this.ProviderData = providerData;
@@ -88,6 +93,10 @@ public ServiceClientModel.ProtectionPolicyResponse ModifyPolicy()
8893
throw new NotImplementedException();
8994
}
9095

96+
/// <summary>
97+
/// Lists backup management servers registered with the recovery services vault
98+
/// </summary>
99+
/// <returns></returns>
91100
public List<Models.BackupEngineBase> ListBackupManagementServers()
92101
{
93102
string name = (string)this.ProviderData[ContainerParams.Name];

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.Providers/Providers/IaasVmPsBackupProvider.cs

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,21 @@ public class IaasVmPsBackupProvider : IPsBackupProvider
4141
Dictionary<System.Enum, object> ProviderData { get; set; }
4242
ServiceClientAdapter ServiceClientAdapter { get; set; }
4343

44+
/// <summary>
45+
/// Initializes the provider with the data recieved from the cmdlet layer
46+
/// </summary>
47+
/// <param name="providerData">Data from the cmdlet layer intended for the provider</param>
48+
/// <param name="serviceClientAdapter">Service client adapter for communicating with the backend service</param>
4449
public void Initialize(Dictionary<System.Enum, object> providerData, ServiceClientAdapter serviceClientAdapter)
4550
{
4651
this.ProviderData = providerData;
4752
this.ServiceClientAdapter = serviceClientAdapter;
4853
}
4954

55+
/// <summary>
56+
/// Triggers the enable protection operation for the given item
57+
/// </summary>
58+
/// <returns>The job response returned from the service</returns>
5059
public BaseRecoveryServicesJobResponse EnableProtection()
5160
{
5261
string azureVMName = (string)ProviderData[ItemParams.AzureVMName];
@@ -130,6 +139,10 @@ public BaseRecoveryServicesJobResponse EnableProtection()
130139
serviceClientRequest);
131140
}
132141

142+
/// <summary>
143+
/// Triggers the disable protection operation for the given item
144+
/// </summary>
145+
/// <returns>The job response returned from the service</returns>
133146
public BaseRecoveryServicesJobResponse DisableProtection()
134147
{
135148
bool deleteBackupData = (bool)ProviderData[ItemParams.DeleteBackupData];
@@ -189,6 +202,10 @@ public BaseRecoveryServicesJobResponse DisableProtection()
189202
}
190203
}
191204

205+
/// <summary>
206+
/// Triggers the backup operation for the given item
207+
/// </summary>
208+
/// <returns>The job response returned from the service</returns>
192209
public BaseRecoveryServicesJobResponse TriggerBackup()
193210
{
194211
ItemBase item = (ItemBase)ProviderData[ItemParams.Item];
@@ -197,6 +214,10 @@ public BaseRecoveryServicesJobResponse TriggerBackup()
197214
IdUtils.GetValueByName(iaasVmItem.Id, IdUtils.IdNames.ProtectedItemName));
198215
}
199216

217+
/// <summary>
218+
/// Triggers the recovery operation for the given recovery point
219+
/// </summary>
220+
/// <returns>The job response returned from the service</returns>
200221
public BaseRecoveryServicesJobResponse TriggerRestore()
201222
{
202223
AzureVmRecoveryPoint rp = ProviderData[RestoreBackupItemParams.RecoveryPoint]
@@ -216,6 +237,10 @@ public ProtectedItemResponse GetProtectedItem()
216237
throw new NotImplementedException();
217238
}
218239

240+
/// <summary>
241+
/// Fetches the detail info for the given recovery point
242+
/// </summary>
243+
/// <returns>Recovery point detail as returned by the service</returns>
219244
public CmdletModel.RecoveryPointBase GetRecoveryPointDetails()
220245
{
221246
AzureVmItem item = ProviderData[GetRecoveryPointParams.Item]
@@ -231,6 +256,10 @@ public CmdletModel.RecoveryPointBase GetRecoveryPointDetails()
231256
return RecoveryPointConversions.GetPSAzureRecoveryPoints(rpResponse, item);
232257
}
233258

259+
/// <summary>
260+
/// Lists recovery points generated for the given item
261+
/// </summary>
262+
/// <returns>List of recovery point PowerShell model objects</returns>
234263
public List<CmdletModel.RecoveryPointBase> ListRecoveryPoints()
235264
{
236265
DateTime startDate = (DateTime)(ProviderData[GetRecoveryPointParams.StartDate]);
@@ -258,6 +287,10 @@ public CmdletModel.RecoveryPointBase GetRecoveryPointDetails()
258287
return RecoveryPointConversions.GetPSAzureRecoveryPoints(rpListResponse, item);
259288
}
260289

290+
/// <summary>
291+
/// Creates policy given the provider data
292+
/// </summary>
293+
/// <returns>Created policy object as returned by the service</returns>
261294
public ProtectionPolicyResponse CreatePolicy()
262295
{
263296
string policyName = (string)ProviderData[PolicyParams.PolicyName];
@@ -312,6 +345,10 @@ public ProtectionPolicyResponse CreatePolicy()
312345
serviceClientRequest);
313346
}
314347

348+
/// <summary>
349+
/// Modifies policy using the provider data
350+
/// </summary>
351+
/// <returns>Modified policy object as returned by the service</returns>
315352
public ProtectionPolicyResponse ModifyPolicy()
316353
{
317354
RetentionPolicyBase retentionPolicy =
@@ -383,6 +420,10 @@ public ProtectionPolicyResponse ModifyPolicy()
383420
serviceClientRequest);
384421
}
385422

423+
/// <summary>
424+
/// Lists protection containers according to the provider data
425+
/// </summary>
426+
/// <returns>List of protection containers</returns>
386427
public List<ContainerBase> ListProtectionContainers()
387428
{
388429
Models.ContainerType containerType =
@@ -433,6 +474,10 @@ public List<ContainerBase> ListProtectionContainers()
433474
throw new NotImplementedException();
434475
}
435476

477+
/// <summary>
478+
/// Lists protected items protected by the recovery services vault according to the provider data
479+
/// </summary>
480+
/// <returns>List of protected items</returns>
436481
public List<ItemBase> ListProtectedItems()
437482
{
438483
ContainerBase container =
@@ -550,6 +595,10 @@ public List<ItemBase> ListProtectedItems()
550595
return itemModels;
551596
}
552597

598+
/// <summary>
599+
/// Constructs the schedule policy object with default inits
600+
/// </summary>
601+
/// <returns>Default schedule policy object</returns>
553602
public SchedulePolicyBase GetDefaultSchedulePolicyObject()
554603
{
555604
CmdletModel.SimpleSchedulePolicy defaultSchedule = new CmdletModel.SimpleSchedulePolicy();
@@ -566,6 +615,10 @@ public SchedulePolicyBase GetDefaultSchedulePolicyObject()
566615
return defaultSchedule;
567616
}
568617

618+
/// <summary>
619+
/// Constructs the retention policy object with default inits
620+
/// </summary>
621+
/// <returns>Default retention policy object</returns>
569622
public RetentionPolicyBase GetDefaultRetentionPolicyObject()
570623
{
571624
CmdletModel.LongTermRetentionPolicy defaultRetention = new CmdletModel.LongTermRetentionPolicy();

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.Providers/Providers/MabPsBackupProvider.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ public class MabPsBackupProvider : IPsBackupProvider
3434
Dictionary<System.Enum, object> ProviderData { get; set; }
3535
ServiceClientAdapter ServiceClientAdapter { get; set; }
3636

37+
/// <summary>
38+
/// Initializes the provider with the data recieved from the cmdlet layer
39+
/// </summary>
40+
/// <param name="providerData">Data from the cmdlet layer intended for the provider</param>
41+
/// <param name="serviceClientAdapter">Service client adapter for communicating with the backend service</param>
3742
public void Initialize(Dictionary<System.Enum, object> providerData, ServiceClientAdapter serviceClientAdapter)
3843
{
3944
this.ProviderData = providerData;
@@ -85,6 +90,10 @@ public ProtectionPolicyResponse ModifyPolicy()
8590
throw new NotImplementedException();
8691
}
8792

93+
/// <summary>
94+
/// Lists containers registered to the recovery services vault according to the provider data
95+
/// </summary>
96+
/// <returns>List of protection containers</returns>
8897
public List<Models.ContainerBase> ListProtectionContainers()
8998
{
9099
string name = (string)this.ProviderData[ContainerParams.Name];

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.Providers/PsBackupProviderManager.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ public PsBackupProviderManager(Dictionary<System.Enum, object> providerDataIn, S
4545
serviceClientAdapter = serviceClientAdapterIn;
4646
}
4747

48+
/// <summary>
49+
/// Gets an instance of the provider based on the container type and backup management type (optional)
50+
/// </summary>
51+
/// <param name="containerType">Type of the container</param>
52+
/// <param name="backupManagementType">Type of the backup management type (optional)</param>
53+
/// <returns></returns>
4854
public IPsBackupProvider GetProviderInstance
4955
(
5056
ContainerType containerType,

0 commit comments

Comments
 (0)