Skip to content

[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

Merged
merged 6 commits into from
Feb 24, 2019

Conversation

siddharth7
Copy link
Contributor

@siddharth7 siddharth7 commented Feb 13, 2019

Description

https://github.com/Azure/azure-powershell-cmdlet-review-pr/issues/203

Checklist

@maddieclayton
Copy link
Contributor

@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

@siddharth7
Copy link
Contributor Author

@maddieclayton Updated in description

…dev_test"

This reverts commit e766f60, reversing
changes made to 8c3b2d1.
var containerModels = ConversionHelpers.GetContainerModelList(listResponse);
WriteObject(containerModels, enumerateCollection: true);
}, ShouldProcess(ResourceId, VerbsLifecycle.Register));
}
Copy link
Contributor

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.

Copy link
Contributor Author

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; }

Copy link
Contributor

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:

  1. PowerShell only matches parameter name, not alias for the ValueFromPipelineByPropertyName.
  2. It's a little confusing to use Id as alias.

Please consider using the InputObject parameter instead.

Copy link
Contributor Author

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
Copy link
Contributor

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?

Copy link
Contributor Author

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'."
Copy link
Contributor

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?

Copy link
Contributor Author

@siddharth7 siddharth7 Feb 20, 2019

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;

Copy link
Contributor

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?

Copy link
Contributor Author

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.

@vladimir-shcherbakov
Copy link
Contributor

vladimir-shcherbakov commented Feb 21, 2019

Some comments are not addressed (discussed offline).

<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>
Copy link
Contributor

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:

<Import Project="$(MSBuildThisFileDirectory)..\..\Az.props" />

@vladimir-shcherbakov vladimir-shcherbakov merged commit 866ef22 into Azure:master Feb 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants