-
Notifications
You must be signed in to change notification settings - Fork 2
[REBASE] Added AFS support to Get Policy cmdlet #360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -191,6 +191,31 @@ public static PolicyBase GetPolicyModel(ServiceClientModel.ProtectionPolicyResou | |||
sqlPolicyModel.RetentionPolicy = | |||
PolicyHelpers.GetPSSimpleRetentionPolicy(azureSqlRetentionPolicy, null); | |||
} | |||
else if (serviceClientResponse.Properties.GetType() == | |||
typeof(ServiceClientModel.AzureFileShareProtectionPolicy)) | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the interest of keeping the method size short, can we introduce smaller methods like GetAzureVmPolicyModel, GetAzureFileSharePolicyModel etc?
return null; | ||
} | ||
|
||
policyModel = new AzureFileSharePolicy(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Schedule policy is missing
/// <summary> | ||
/// Azure FileShare specific backup policy class. | ||
/// </summary> | ||
public class AzureFileSharePolicy : PolicyBase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use interim base class, AzureWorkloadPolicy, for all Azure workloads
|
||
try | ||
{ | ||
$vault = Get-AzureRmRecoveryServicesVault -ResourceGroupName $resourceGroupName |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use Create-RecoveryServicesVault here. You can move it to a Common.ps1 under the SenarioTests folder.
73b65f9
to
9275e8a
Compare
AzureFileSharePolicy fileSharePolicyModel = policyModel as AzureFileSharePolicy; | ||
fileSharePolicyModel.WorkloadType = WorkloadType.AzureFiles; | ||
fileSharePolicyModel.BackupManagementType = BackupManagementType.AzureStorage; | ||
fileSharePolicyModel.RetentionPolicy = PolicyHelpers.GetPSLongTermRetentionPolicy((ServiceClientModel.LongTermRetentionPolicy) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Make sure all lines in the edits you make are < 100 chars long.
@@ -17,17 +17,8 @@ namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models | |||
/// <summary> | |||
/// Azure FileShare specific backup policy class. | |||
/// </summary> | |||
public class AzureFileSharePolicy : PolicyBase | |||
public class AzureFileSharePolicy : AzureWorkloadPolicy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be renamed to AzurePolicy instead of AzureWorkloadPolicy, to maintain consistency with other similar objects.
One good practice is to run "Ctrl + K + D" in all the touched files. |
Found merge conflicts in PR. Author needs to fix it before review can be done. |
6da94a1
to
3bfe94e
Compare
changed base class for AzureFileSharePolicy rebase changes renaming azurefileshareextended info rebase changes
bae582e
to
7ca71b0
Compare
/// <summary> | ||
/// Helper function to convert ps backup policy model for AzureVM from service response. | ||
/// </summary> | ||
public static PolicyBase GetPolicyModelForAzureIaaSVM(ServiceClientModel.ProtectionPolicyResource serviceClientResponse, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please limit to 100 chars
Description
This checklist is used to make sure that common guidelines for a pull request are followed. You can find a more complete discussion of PowerShell cmdlet best practices here.
General Guidelines
Testing Guidelines
Cmdlet Signature Guidelines
ShouldProcess
and haveSupportShouldProcess=true
specified in the cmdlet attribute. You can find more information onShouldProcess
here.OutputType
attribute if any output is produced - if the cmdlet produces no output, it should implement aPassThrough
parameter.Cmdlet Parameter Guidelines