UsageDetail attribute pretax_cost has wrong type.
Closed this issue · 3 comments
aheumaier commented
In Module Azure::Consumption::Mgmt the class UsageDetail uses an Integer class for attribute :pretax_cost. This results in values of 0 - while most of the values are in the form Float as 0.0005.
This field has to be a float for accurate cost calculations (correctly implemented in Python SDK)
# Poor mans monthly cost calculator
#
response = Azure::Consumption::Profiles::Latest::Mgmt::Client.new.usage_details.list(filter: "properties/usageEnd ge '2019-04-01' AND properties/usageEnd le '2019-04-30'")
sum = 0.0
response.each do |item|
sum += item.pretax_cost
end
puts sum
Please let me know if you have any questions - happy to help!
sgiacomel commented
This applies also to these properties:
usageQuantity
billableQuantity
sgiacomel commented
kurtzeborn commented
Thank you for your interest in Azure SDKs. As detailed in this retirement announcement, this repo is no longer supported as of December 31st 2021. Please find the up-to-date list of languages and services supported with Azure SDKs here: https://aka.ms/azsdk