2

我正在使用使用详细信息 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?

4

0 回答 0