-
Notifications
You must be signed in to change notification settings - Fork 4k
Upgrade parameters on Cmdlet Get-AzureRmConsumptionUsageDetail #6023
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
Can one of the admins verify this patch? |
@azuresdkci Just joined Azure, please verify the status. |
@azuresdkci Add to whitelist |
@bgsky Please fill out a cmdlet design review here: https://github.com/Azure/azure-powershell-cmdlet-review-pr/issues |
@markcowl Please refer to issue request |
@@ -84,6 +85,14 @@ | |||
<SpecificVersion>False</SpecificVersion> | |||
<HintPath>..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.28.3\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll</HintPath> | |||
</Reference> | |||
<Reference Include="Microsoft.Rest.ClientRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> |
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.
Remove these two references, as it is included in the common targets.
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.
Thanks for pointing out. Removed.
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Consumption.1.1.0-preview\lib\net452\Microsoft.Azure.Management.Consumption.dll</HintPath> | ||
<Reference Include="Microsoft.Azure.Management.Consumption, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> | ||
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Consumption.3.0.0\lib\net452\Microsoft.Azure.Management.Consumption.dll</HintPath> | ||
<Private>True</Private> |
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.
Why do you need this private tag?
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.
This tag was added by accident. Already removed.
$usageDetails = Get-AzureRmConsumptionUsageDetail -MaxCount 10 | ||
|
||
$usageDetails = Get-AzureRmConsumptionUsageDetail -Top 10 | ||
Assert-NotNull $usageDetails |
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.
Do these tests only work on a specific subscription?
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.
No, we have the same internal implementation for MaxCount and Top.
@@ -14,6 +14,8 @@ | |||
<package id="Microsoft.Bcl.Build" version="1.0.14" targetFramework="net45" /> | |||
<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="2.28.3" targetFramework="net45" /> | |||
<package id="Microsoft.Net.Http" version="2.2.28" targetFramework="net45" /> | |||
<package id="Microsoft.Rest.ClientRuntime" version="2.3.10" targetFramework="net452" /> |
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.
Remove these two packages as well.
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.
Thanks for pointing out. Removed.
|
||
[Parameter(Mandatory = false, HelpMessage = "The tag of the usages to filter.")] | ||
[ValidateNotNull] | ||
public string Tags { 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.
Rename to "Tag" (powershell guidelines)
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.
Tags is renamed as Tag, and .md file and recorded sessions are regenerated accordingly.
|
||
[Parameter(Mandatory = false, HelpMessage = "Name of a specific invoice to get the usage details that associate with.")] | ||
[ValidateNotNullOrEmpty] | ||
public string InvoiceName { 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.
Add obsolete tag on this parameter: https://github.com/Azure/azure-powershell/blob/preview/documentation/breaking-changes/breaking-changes-attribute-help.md
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 an attribute of CmdletParameterBreakingChange on InvoiceName.
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Consumption.1.1.0-preview\lib\net452\Microsoft.Azure.Management.Consumption.dll</HintPath> | ||
<Reference Include="Microsoft.Azure.Management.Consumption, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> | ||
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Consumption.3.0.0\lib\net452\Microsoft.Azure.Management.Consumption.dll</HintPath> | ||
<Private>True</Private> |
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.
Why the private tag?
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 by accident. Already removed.
public string Id { get; private set; } | ||
public string Name { get; private 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.
Renaming properties is a breaking change - please add back InvoiceName and BillingPeriodName
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.
Sorry for confusion of shuffling the parameters on alphabetic order. InvoiceName and BillingPeriodName were added back.
``` | ||
|
||
Get usage details of the invoice with specified name, and include MeterDetails property in the result. |
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 provide example output for these examples.
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.
@maddieclayton Our model of usage detail has 28 output parameters. Can we skip output example to avoid user distraction?
Accept wildcard characters: False | ||
``` | ||
|
||
### -Tags |
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.
Be sure to rengenerate the file after changing Tags to Tag to reflect the change.
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.
.md file is regenerated accordingly.
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.
Looks like it is still tags
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.
Change it to tag
…sing parameters in PSUsage model
@maddieclayton @ms-premp We addressed your comments on Tag, redundant csproj references, depreciated InvoiceName attribute, missing parameters in PSUsageDetail model. Please review the latest iteration. Pull request description is also updated with the latest changes. |
@@ -21,6 +21,7 @@ | |||
|
|||
## Version 0.3.2 | |||
* Set minimum dependency of module to PowerShell 5.0 | |||
* Add new parameters Expand, ResourceGroup, InstanceName, InstanceId, Tags, and Top on Cmdlet Get-AzureRmConsumptionUsageDetail |
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.
Move this to "Current Release"
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.
Will move to Current Release
public string Product { get; set; } | ||
public string SubscriptionGuid { get; set; } | ||
public string SubscriptionName { get; set; } | ||
public IDictionary<string, string> Tag { get; private 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.
Keep this one as "Tags" because otherwise it is a breaking change.
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.
Will keep it as Tags
Accept wildcard characters: False | ||
``` | ||
|
||
### -Tags |
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.
Looks like it is still tags
public DateTime? UsageStart { get; private set; } | ||
public DateTime? UsageEnd { get; private set; } | ||
public string AccountName { get; set; } | ||
public string AdditionalProperties { 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.
Looks like this changed type - please change back.
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.
@maddieclayton @ms-premp As we need this output as string, we keep AdditionalProperties as dictionary type (will depreciate it and label as future breaking change), and introduce a new output parameter as AdditionalInfo with string type.
@maddieclayton @ms-premp The new iteration fixed typo on Tag parameter. In terms of a parameter of AdditionalProperties, we need string type, therefore keep it as dictionary type, and introduce a new parameter AdditionalInfo as string type. Recorded test sessions are also regenerated with those changes. Please review and let me know any comments |
this.UsageStart = usageDetail.UsageStart; | ||
this.UsageEnd = usageDetail.UsageEnd; | ||
this.AccountName = usageDetail.AccountName; | ||
this.AdditionalInfo = usageDetail.AdditionalProperties; |
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 AdditionalProperties before? It seems like now a property that was previously populated will always be null. Is it possible to populate this value?
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.
It will always be null. AdditionalProperties of dictionary type was developed by previous team long ago. We don't have information on how to populate it in a dictionary type. Instead we do AdditionInfo in string type, and mark AdditionalProperties as future breaking change. Let me know your advice in that case.
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.
As long as the current behavior is that it always returns null, it is fine that it now will not be populated.
Description
Checklist
CONTRIBUTING.md
platyPS
module