Skip to content

[RecoveryServices.Backup] Added cmdlets to enable or disable SoftdeleteFeature in a vault #10571

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 11 commits into from
Nov 21, 2019

Conversation

sambitratha
Copy link
Contributor

Description

Checklist

  • I have read the Submitting Changes section of CONTRIBUTING.md
  • The title of the PR is clear and informative
  • The appropriate ChangeLog.md file(s) has been updated:
    • For any service, the ChangeLog.md file can be found at src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md
    • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header -- no new version header should be added
  • The PR does not introduce breaking changes
  • If applicable, the changes made in the PR have proper test coverage
  • For public API changes to cmdlets:
    • a cmdlet design review was approved for the changes in this repository (Microsoft internal only)
    • the markdown help files have been regenerated using the commands listed here

@adxsdkps
Copy link
Collaborator

Can one of the admins verify this patch?

@VeryEarly VeryEarly self-assigned this Nov 20, 2019
{
[Parameter(Mandatory = true, ValueFromPipeline = false)]
[ValidateNotNullOrEmpty]
public VaultSoftDeleteFeatureState SoftDeleteFeatureState { 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.

It will be better to set the type of SoftDeleteFeatureState as string and set the value range to Enabled and Disabled. You can find example here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wyunchi-ms : I have seen the example but I am still not convinced/clear. I want to set the feature state with this command and hence I want to "enable/disable" it. Later when I get the value, I am expecting the feature to be either "Enabled/Disabled". May I know what is incorrect in this assumption?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both Enable and Enabled are fine. You can choose by youself. But I suggest to use ValidateSet to make sure user input the right value that you expect.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type of SoftDeleteFeatureState should be string and VaultSoftDeleteFeatureState is no need any more. You can use ValidateSet to ensure the user input the right value, and there is no need to add a new type for this.


BackupResourceVaultConfigResource param = new BackupResourceVaultConfigResource();
param.Properties = new BackupResourceVaultConfig();
param.Properties.SoftDeleteFeatureState = SoftDeleteFeatureState.ToString() + "d";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After set the type to string, "d" is no need

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wyunchi-ms as per the cmdlet review https://github.com/Azure/azure-powershell-cmdlet-review-pr/issues/437 it was decided to accept enable/disable as values for set command.
Adding @pvrk for reference

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented above.

wyunchi-ms
wyunchi-ms previously approved these changes Nov 21, 2019
@VeryEarly VeryEarly assigned wyunchi-ms and unassigned VeryEarly Nov 21, 2019
@wyunchi-ms wyunchi-ms dismissed their stale review November 21, 2019 03:21

The type of SoftDeleteFeatureState need more discus

@wyunchi-ms wyunchi-ms merged commit a539624 into Azure:master Nov 21, 2019
@sambitratha sambitratha deleted the users/sarath/set-vault-props branch November 21, 2019 05:57
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.

7 participants