【发布时间】:2020-11-10 12:45:48
【问题描述】:
我尝试使用 Azure 成本管理 - 查询使用 API 来获取给定订阅的所有成本的详细信息(某些列)。我用于请求的正文是
{
"type": "Usage",
"timeframe": " BillingMonthToDate ",
"dataset": {
"granularity": "Daily",
"configuration": {
"columns": [
"MeterCategory",
"CostInBillingCurrency",
"ResourceGroup"
]
}
}
但是我得到的回复是这样的:
{
"id": "xxxx",
"name": "xxxx",
"type": "Microsoft.CostManagement/query",
"location": null,
"sku": null,
"eTag": null,
"properties": {
"nextLink": null,
"columns": [
{
"name": "UsageDate",
"type": "Number"
},
{
"name": "Currency",
"type": "String"
} ],
"rows": [
[
20201101,
"EUR"
],
[
20201102,
"EUR"
],
[
20201103,
"EUR"
],
...
]
}
JSON 继续列出所有带有货币的日期。
当我在 JSON 中使用 dataset.aggregation 或 dataset.grouping 子句时,我确实会在我的 JSON 中返回成本,但我没有获得所需的详细列信息。当然,不可能将这两个子句与 dataset.columns 子句结合起来。有人知道我做错了什么吗?
【问题讨论】: