v1

latestSwagger 2.02026-07-17172265595.1 KB
analytics

List spend metrics

Retrieving cost metrics with respect to specified filters. The API returns information such as the total cost and costs per each service based on the specified filters.

get/inventory/api/v2/analytics/spend/metric

Query parameters

filterstring

Filter costs

connectorstring[]

Connector type to filter by

connectionIdstring[]

Connection IDs to filter by - mutually exclusive with connectionGroup

connectionGroupstring[]

Connection group to filter by - mutually exclusive with connectionId

startTimeinteger

timestamp for start in epoch seconds

endTimeinteger

timestamp for end in epoch seconds

sortBy'dimension' | 'cost' | 'growth' | 'growth_rate'

Sort by field - default is cost

pageSizeinteger

page size - default is 20

pageNumberinteger

page number - default is 1

metricIDsstring[]

Metric IDs

Response

OK

total_costnumber
total_countinteger

Example response

{
  "metrics": [
    {
      "cost_dimension_id": "microsoft_compute_disks",
      "cost_dimension_name": "microsoft.compute/disks",
      "daily_cost_at_end_time": 14118.81523108568,
      "daily_cost_at_start_time": 21232.10443638001,
      "integration_types": [
        "Azure"
      ],
      "total_cost": 621041.2436112489
    }
  ],
  "total_cost": 1000,
  "total_count": 10
}