Skip to content

Commit 7f3624d

Browse files
committed
PR comment
1 parent 514c9df commit 7f3624d

File tree

5 files changed

+5
-68
lines changed

5 files changed

+5
-68
lines changed

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

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,7 @@ namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.HydraAdapterN
2323
{
2424
public partial class HydraAdapter
2525
{
26-
/// <summary>
27-
/// Fetch the details of given Recovery point
28-
/// </summary>
29-
/// <param name="containerName"></param>
30-
/// <param name="protectedItemName"></param>
31-
/// <param name="recoveryPointId"></param>
32-
/// <returns></returns>
26+
3327
public RecoveryPointResponse GetRecoveryPointDetails(string containerName, string protectedItemName, string recoveryPointId)
3428
{
3529
string resourceGroupName = BmsAdapter.GetResourceGroupName();
@@ -41,15 +35,7 @@ public RecoveryPointResponse GetRecoveryPointDetails(string containerName, strin
4135
return response;
4236
}
4337

44-
/// <summary>
45-
/// Fetch the Recovery points of protectedItem which satisfy specified query
46-
/// </summary>
47-
/// <param name="resourceGroupName"></param>
48-
/// <param name="resourceName"></param>
49-
/// <param name="containerName"></param>
50-
/// <param name="protectedItemName"></param>
51-
/// <param name="queryFilter"></param>
52-
/// <returns></returns>
38+
5339
public RecoveryPointListResponse GetRecoveryPoints(string containerName, string protectedItemName, RecoveryPointQueryParameters queryFilter)
5440
{
5541
string resourceGroupName = BmsAdapter.GetResourceGroupName();

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

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,7 @@ namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.HydraAdapterN
1111
{
1212
public partial class HydraAdapter
1313
{
14-
/// <summary>
15-
/// Restore the given Recovery point of protectedItem to given storage account
16-
/// </summary>
17-
/// <param name="resourceGroupName"></param>
18-
/// <param name="resourceName"></param>
19-
/// <param name="containerName"></param>
20-
/// <param name="protectedItemName"></param>
21-
/// <param name="recoveryPointId"></param>
22-
/// <returns></returns>
14+
2315
public BaseRecoveryServicesJobResponse RestoreDisk(AzureRmRecoveryServicesBackupIaasVmRecoveryPoint rp, string storageAccountId,
2416
string storageAccountLocation, string storageAccountType)
2517
{

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ internal static class Item
7474
public const string Container = "Container where the item resides";
7575
public const string RemoveProtectionOption = "If this option is used, all the backup data for this item will also be deleted and restoring data will not be possible.";
7676
public const string ExpiryDate = "Retention period for the recovery points created by this backup operaiton";
77+
public const string ForceOption = "Force disables backup protection (prevents confirmation dialog). This parameter is optional.";
7778
}
7879

7980
internal static class RecoveryPoint

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public SwitchParameter RemoveRecoveryPoints
4444
set { DeleteBackupData = value; }
4545
}
4646

47-
[Parameter(Mandatory = false, HelpMessage = "Don't ask for confirmation.")]
47+
[Parameter(Mandatory = false, HelpMessage = ParamHelpMsg.Item.ForceOption)]
4848
public SwitchParameter Force { get; set; }
4949

5050
private bool DeleteBackupData;

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup/Cmdlets/Restore/RestoreAzureRMRecoveryServicesBackupItem.cs

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -94,47 +94,5 @@ public override void ExecuteCmdlet()
9494
HandleCreatedJob(jobResponse, Resources.RestoreOperation);
9595
});
9696
}
97-
98-
/// <summary>
99-
/// This code is not getting used. Will delete it once things will be closed.
100-
/// </summary>
101-
/// <param name="storageAccountName"></param>
102-
/// <param name="id"></param>
103-
/// <param name="location"></param>
104-
/// <param name="resourceType"></param>
105-
internal void GetStorageResource(string storageAccountName, out string id, out string location, out string resourceType)
106-
{
107-
using (System.Management.Automation.PowerShell ps = System.Management.Automation.PowerShell.Create())
108-
{
109-
//Get-AzureRmResource | Where-Object { ($_.Name -eq "<StorageAccName>") -and ($_.ResourceType -eq "Microsoft.Storage/storageAccounts" -or $_.ResourceType -eq "Microsoft.ClassicStorage/storageAccounts")}
110-
ps.AddCommand("Get-AzureRmResource");
111-
ps.AddCommand("where-object");
112-
string filterString = String.Format(@"($_.Name -eq ""{0}"") -and ($_.ResourceType -eq ""Microsoft.Storage/storageAccounts"" -or $_.ResourceType -eq ""Microsoft.ClassicStorage/storageAccounts"")");
113-
ScriptBlock filter = ScriptBlock.Create(filterString);
114-
115-
ps.AddParameter("FilterScript", filter);
116-
var result = ps.Invoke();
117-
118-
if (ps.HadErrors)
119-
{
120-
WriteVerbose(string.Format("Error in Get-AzureRmResource"));
121-
throw new Exception(ps.HadErrors.ToString());
122-
}
123-
124-
if(result.Count == 0)
125-
{
126-
WriteVerbose(string.Format("Storage Account not fount"));
127-
throw new ArgumentException(Resources.RestoreAzureStorageNotFound);
128-
}
129-
else if (result.Count > 1)
130-
{
131-
WriteVerbose(string.Format("Found more than one StorageAccount with same name. Some thing went wrong"));
132-
throw new Exception(Resources.RestoreDiskMoreThanOneAccFound);
133-
}
134-
id = result[0].Members["ResourceId"].Value.ToString();
135-
location = result[0].Members["Location"].Value.ToString();
136-
resourceType = result[0].Members["ResourceType"].Value.ToString();
137-
}
138-
}
13997
}
14098
}

0 commit comments

Comments
 (0)