Azure消耗API:Azure使用情况详细信息列表中使用的计量费率

时间:2019-05-25 07:58:52

标签: azure api billing rate consumption

我正在使用使用情况详细信息API提取基于订阅的“使用情况详细信息”列表,并且试图确定每个列表项中使用的费率。 我用了这个电话 GET https://management.azure.com/{scope}/providers/Microsoft.Consumption/usageDetails?api-version=2019-01-01

以下是响应格式-

{
  "value": [
{
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201702/providers/Microsoft.Consumption/usageDetails/usageDetailsId1",
  "name": "usageDetailsId1",
  "type": "Microsoft.Consumption/usageDetails",
  "tags": {
    "env": "newcrp",
    "dev": "tools"
  },
  "properties": {
    "billingPeriodId": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201702",
    "invoiceId": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/invoices/201703-123456789",
    "usageStart": "2017-02-13T00:00:00Z",
    "usageEnd": "2017-02-13T23:59:59Z",
    "instanceName": "shared1",
    "instanceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Default-Web-eastasia/providers/Microsoft.Web/sites/shared1",
    "instanceLocation": "eastasia",
    "currency": "USD",
    "usageQuantity": 0.00328,
    "billableQuantity": 0.00328,
    "pretaxCost": 0.67,
    "isEstimated": false,
    "meterId": "00000000-0000-0000-0000-000000000000",
    "partNumber": "Part Number 1",
    "resourceGuid": "00000000-0000-0000-0000-000000000000",
    "offerId": "Offer Id 1",
    "chargesBilledSeparately": true,
    "location": "EU West"
  }
 }
 ]
}

有人知道该比率是否可以按以下方式计算: meterRate = pretaxCost / usageQuantity?

0 个答案:

没有答案