-
Notifications
You must be signed in to change notification settings - Fork 4k
[RecoveryServices.Backup] SDK Update #8529
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
[RecoveryServices.Backup] SDK Update #8529
Conversation
ad07e94
to
d07e7ca
Compare
@siddharth7 Please either link your existing design review or fill out a new one here: https://github.com/Azure/azure-powershell-cmdlet-review-pr/issues |
@maddieclayton Updated in description |
d07e7ca
to
779b509
Compare
779b509
to
48cd964
Compare
var containerModels = ConversionHelpers.GetContainerModelList(listResponse); | ||
WriteObject(containerModels, enumerateCollection: true); | ||
}, ShouldProcess(ResourceId, VerbsLifecycle.Register)); | ||
} |
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.
Notice that to automatically skip prompts you may want to enable the Force parameter.
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.
Added
[Alias("Id")] | ||
[ValidateNotNullOrEmpty] | ||
public string InputItem { get; set; } | ||
|
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 see a couple of problems here:
- PowerShell only matches parameter name, not alias for the ValueFromPipelineByPropertyName.
- It's a little confusing to use
Id
as alias.
Please consider using the InputObject parameter instead.
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.
The object that GetProtectableItem returns has the InputItem
property as Id
. To enable piping, an alias was added. Is there any other way to enable that?
/// </summary> | ||
[Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "RecoveryServicesBackupWorkloadRecoveryConfig", | ||
DefaultParameterSetName = RpParameterSet, SupportsShouldProcess = true), OutputType(typeof(RecoveryConfigBase))] | ||
public class GetAzureRmRecoveryServicesBackupWorkloadRecoveryConfig : RSBackupVaultCmdletBase |
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.
Remind me please why you need SupportsShouldProcess = true
in the cmdlet. Does it change the system?
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.
Removed
"AssemblyFileName","ClassName","Target","Severity","ProblemId","Description","Remediation" | ||
"Microsoft.Azure.PowerShell.Cmdlets.RecoveryServices.Backup.dll","Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.RestoreAzureRmRecoveryServicesBackupItem","Restore-AzRecoveryServicesBackupItem","0","1050","The parameter set '__AllParameterSets' for cmdlet 'Restore-AzRecoveryServicesBackupItem' has been removed.","Add parameter set '__AllParameterSets' back to cmdlet 'Restore-AzRecoveryServicesBackupItem'." |
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.
What was the reason to suppress the exception?
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.
The restore cmdlet used to have a parameter RecoveryPoint
which was used by all paramsets and was mandatory. With the introduction of a new workload, WLRecoveryConfig
is the only parameter required for this cmdlet.
-BackupManagementType "AzureWorkload" ` | ||
-WorkloadType "MSSQL" ` | ||
-Policy $policy; | ||
|
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.
What is your approach to check the cmdlet works as expected without using Assert-*
through the test?
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.
AutoProtection APIs are intents rather than long-running operations and we dont have any cmdlet to get intent's status. We have added this in our ToDos to come up with a better test plan.
Some comments are not addressed (discussed offline). |
9fe5e15
to
b925475
Compare
3cd35b2
to
0322f7f
Compare
<PackageReference Include="Microsoft.Azure.Management.RecoveryServices.Backup" Version="3.0.1-preview" /> | ||
<PackageReference Include="Microsoft.Azure.Management.RecoveryServices.Backup" Version="3.1.1-preview" /> | ||
<PackageReference Include="Microsoft.Rest.ClientRuntime" Version="2.3.19" /> | ||
<PackageReference Include="Microsoft.Rest.ClientRuntime.Azure" Version="3.3.19" /> | ||
</ItemGroup> |
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 remove all references of ClientRuntime
packages from all your .csproj
files.
This Import
adds all common deps for you:
azure-powershell/src/RecoveryServices/RecoveryServices.Backup/RecoveryServices.Backup.csproj
Line 7 in 0322f7f
<Import Project="$(MSBuildThisFileDirectory)..\..\Az.props" /> |
Description
https://github.com/Azure/azure-powershell-cmdlet-review-pr/issues/203
Checklist
CONTRIBUTING.md
platyPS
module