-
Notifications
You must be signed in to change notification settings - Fork 4.1k
[Storage] Support share usage #12470
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
| ### ShareResourceId | ||
| ``` | ||
| Get-AzRmStorageShare [-ResourceId] <String> [-Name <String>] [-DefaultProfile <IAzureContextContainer>] | ||
| Get-AzRmStorageShare [-ResourceId] <String> [-GetShareUsage] [-DefaultProfile <IAzureContextContainer>] |
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.
ShareResourceId still will cause breaking changes for the users who both use -ResourceId and -Name. I think you should do the same thing with AccountObject.
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.
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.
@wyunchi-ms
Thanks for the catch!
Actually, parameterset "ShareResourceId" should not container "-Name", since resource ID already contains share name information, and my code always get share name from resource ID when use parameterset "ShareResourceId", "-Name" will be omit.
So it should be a bug to include "-Name" in parameterset "ShareResourceId".
Anyway, to avoid breaking change, I have add "-Name" back to parameterset "ShareResourceId", and give a warning that -Name will be omit.
Do you have any suggestion how to display breaking change notice only when use "-Name" in parameterset "ShareResourceId"?
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 adding the attribute CmdletParameterBreakingChange("Name", deprecateByVersion="3.0.0", ChangeDescription="Name info is already incloud by ShareResourceId, so it's not necessary any more.") is OK. What do you think?
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.
If use CmdletParameterBreakingChange, the breaking change notice will be show when use -Name, that might be too bother. I only want to show it when user use both -ResourceID and -Name.
If there any way to raise the breaking notice in cmdlet ExecuteCmdlet(), then I can raise the breaking notice after check user input both -ResourceID and -Name. (I think there will be very small amount of customer can be impact by the breaking, since this is not a very valid usage. So don't want to bother the normal user too much.)
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Description
Share Usage pass review in (part of the design): Azure/azure-powershell-cmdlet-review-pr#559
The code change has been in preview module before by part of the following 2 PRs:
#11779
#12013
Please note, I have change the parameter set of "Get-AzRmStorageShare", add add breaking change exception (align with the design).
But this change won't break any script, see the change reason in : https://github.com/Azure/azure-powershell-cmdlet-review-pr/issues/559#issuecomment-617209043
Please let me know if this change is not OK for stable PSH, I will revert to original parameter set , and add error message when user don't input correct parameter combination.
Checklist
CONTRIBUTING.mdChangeLog.mdfile(s) has been updated:ChangeLog.mdfile can be found atsrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md## Upcoming Releaseheader -- no new version header should be added