Skip to content

Commit cfd0a88

Browse files
committed
Incorporating PM feedback changes
1 parent 9002a70 commit cfd0a88

File tree

5 files changed

+14
-18
lines changed

5 files changed

+14
-18
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@ public BaseRecoveryServicesJobResponse RestoreDisk(AzureRmRecoveryServicesIaasVm
4848
CreateNewCloudService = false,
4949
RecoveryPointId = recoveryPointId,
5050
RecoveryType = RecoveryType.RestoreDisks,
51-
Region = vaultLocation // TBD - To be fixed by Mkherani
51+
Region = vaultLocation,
52+
StorageAccountId = storageAccountId,
53+
SubnetId = string.Empty,
54+
VirtualMachineName = string.Empty,
55+
VirtualNetworkId = string.Empty,
5256
};
5357

5458
TriggerRestoreRequest triggerRestoreRequest = new TriggerRestoreRequest();

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ public BaseRecoveryServicesJobResponse EnableProtection()
5252
string azureVMResourceGroupName = (string)ProviderData.ProviderParameters[ItemParams.AzureVMResourceGroupName];
5353
string parameterSetName = (string)ProviderData.ProviderParameters[ItemParams.ParameterSetName];
5454

55-
Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models.WorkloadType workloadType =
56-
(Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models.WorkloadType)ProviderData.ProviderParameters[ItemParams.WorkloadType];
57-
5855
AzureRmRecoveryServicesBackupPolicyBase policy = (AzureRmRecoveryServicesBackupPolicyBase)
5956
ProviderData.ProviderParameters[ItemParams.Policy];
6057

@@ -74,7 +71,7 @@ public BaseRecoveryServicesJobResponse EnableProtection()
7471
isComputeAzureVM = string.IsNullOrEmpty(azureVMCloudServiceName) ? true : false;
7572
string azureVMRGName = (isComputeAzureVM) ? azureVMResourceGroupName : azureVMCloudServiceName;
7673

77-
ValidateAzureVMWorkloadType(workloadType, policy.WorkloadType);
74+
ValidateAzureVMWorkloadType(policy.WorkloadType);
7875

7976
ValidateAzureVMEnableProtectionRequest(azureVMName, azureVMCloudServiceName, azureVMResourceGroupName, policy);
8077

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets
3030
/// <summary>
3131
/// Enable Azure Backup protection
3232
/// </summary>
33-
[Cmdlet(VerbsLifecycle.Disable, "AzureRmRecoveryServicesProtection"), OutputType(typeof(AzureRmRecoveryServicesJobBase))]
34-
public class DisableAzureRmRecoveryServicesProtection : RecoveryServicesBackupCmdletBase
33+
[Cmdlet(VerbsLifecycle.Disable, "AzureRmRecoveryServicesBackupProtection"), OutputType(typeof(AzureRmRecoveryServicesJobBase))]
34+
public class DisableAzureRmRecoveryServicesBackupProtection : RecoveryServicesBackupCmdletBase
3535
{
3636
[Parameter(Position = 1, Mandatory = true, HelpMessage = ParamHelpMsg.Item.ProtectedItem, ValueFromPipeline = true)]
3737
[ValidateNotNullOrEmpty]

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

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets
3030
/// <summary>
3131
/// Enable Azure Backup protection
3232
/// </summary>
33-
[Cmdlet(VerbsLifecycle.Enable, "AzureRmRecoveryServicesProtection", DefaultParameterSetName = ModifyProtectionParameterSet), OutputType(typeof(AzureRmRecoveryServicesJobBase))]
34-
public class EnableAzureRmRecoveryServicesProtection : RecoveryServicesBackupCmdletBase
33+
[Cmdlet(VerbsLifecycle.Enable, "AzureRmRecoveryServicesBackupProtection", DefaultParameterSetName = ModifyProtectionParameterSet), OutputType(typeof(AzureRmRecoveryServicesJobBase))]
34+
public class EnableAzureRmRecoveryServicesBackupProtection : RecoveryServicesBackupCmdletBase
3535
{
3636
internal const string AzureVMClassicComputeParameterSet = "AzureVMClassicComputeEnableProtection";
3737
internal const string AzureVMComputeParameterSet = "AzureVMComputeEnableProtection";
@@ -51,11 +51,7 @@ public class EnableAzureRmRecoveryServicesProtection : RecoveryServicesBackupCmd
5151
[Parameter(Position = 3, Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = AzureVMComputeParameterSet, HelpMessage = ParamHelpMsg.Item.AzureVMResourceGroupName)]
5252
public string ResourceGroupName { get; set; }
5353

54-
[Parameter(Position = 4, Mandatory = true, ParameterSetName = AzureVMClassicComputeParameterSet, HelpMessage = ParamHelpMsg.Common.WorkloadType)]
55-
[Parameter(Position = 4, Mandatory = true, ParameterSetName = AzureVMComputeParameterSet, HelpMessage = ParamHelpMsg.Common.WorkloadType)]
56-
public WorkloadType WorkLoadType { get; set; }
57-
58-
[Parameter(Position = 5, Mandatory = true, ParameterSetName = ModifyProtectionParameterSet, HelpMessage = ParamHelpMsg.Item.ProtectedItem, ValueFromPipeline = true)]
54+
[Parameter(Position = 4, Mandatory = true, ParameterSetName = ModifyProtectionParameterSet, HelpMessage = ParamHelpMsg.Item.ProtectedItem, ValueFromPipeline = true)]
5955
[ValidateNotNullOrEmpty]
6056
public AzureRmRecoveryServicesItemBase Item { get; set; }
6157

@@ -70,14 +66,13 @@ public override void ExecuteCmdlet()
7066
{ItemParams.AzureVMName, Name},
7167
{ItemParams.AzureVMCloudServiceName, ServiceName},
7268
{ItemParams.AzureVMResourceGroupName, ResourceGroupName},
73-
{ItemParams.WorkloadType, WorkLoadType},
7469
{ItemParams.Policy, Policy},
7570
{ItemParams.Item, Item},
7671
{ItemParams.ParameterSetName, this.ParameterSetName},
7772
}, HydraAdapter);
7873

7974
IPsBackupProvider psBackupProvider = (Item != null) ? providerManager.GetProviderInstance(Item.WorkloadType, Item.BackupManagementType)
80-
: providerManager.GetProviderInstance(WorkLoadType);
75+
: providerManager.GetProviderInstance(Policy.WorkloadType);
8176

8277
var itemResponse = psBackupProvider.EnableProtection();
8378

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets
2626
/// <summary>
2727
/// Get list of items
2828
/// </summary>
29-
[Cmdlet(VerbsCommon.Get, "AzureRmRecoveryServicesItem"), OutputType(typeof(AzureRmRecoveryServicesItemBase))]
30-
public class GetAzureRmRecoveryServicesItem : RecoveryServicesBackupCmdletBase
29+
[Cmdlet(VerbsCommon.Get, "AzureRmRecoveryServicesBackupItem"), OutputType(typeof(AzureRmRecoveryServicesItemBase))]
30+
public class GetAzureRmRecoveryServicesBackupItem : RecoveryServicesBackupCmdletBase
3131
{
3232
[Parameter(Mandatory = true, HelpMessage = ParamHelpMsg.Item.Container)]
3333
[ValidateNotNullOrEmpty]

0 commit comments

Comments
 (0)