Skip to navigation

Query Cost Data

Retrieves cost and usage data for the given time frame.

Use Query Cost Data to analyze backup costs by cloud provider, resource type, and resource. For details on exploring your costs visually in the Eon console, see About Cost Explorer.

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Query parameters

pageSizeintegerOptional>=1
Maximum number of cost records to return in a single response.
pageTokenstringOptional
Cursor that points to the first record of the next page of results. Get this value from the previous response. To preserve the results in the same order, use the same time frame, grouping, and filters in the first request as all subsequent requests.

Request

This endpoint expects an object.
timeFrameobjectRequired
Time range to retrieve cost data for.
costUnitenumOptionalDefaults to CREDITS

Currency unit for cost amounts. Use CREDITS for Eon credits and USD for U.S. dollars. UNSPECIFIED is supported only in responses.

Allowed values:
usageUnitenumOptionalDefaults to BYTE_MONTHS

Whether usage is returned in byte-months, raw bytes, operations, or object-months for the specified timeFrame. UNSPECIFIED is supported only in responses.

Allowed values:
granularityenumOptionalDefaults to MONTHLY
Time granularity for cost aggregation.
Allowed values:
filtersobjectOptional
Filter conditions for cost data query. If omitted, no filtering is applied.
groupByenumOptionalDefaults to SOURCE_ACCOUNT
Dimensions to group cost data by.
Allowed values:
topNintegerOptional>=1

Limits the response to the top n resources by total cost over timeFrame, and folds all other matching resources into one aggregated record per time period in granularity. Use this when a resource-level query would return too many records—for example, to build an efficient top-spenders chart without requesting every resource for every period.

Applies only when grouping by RESOURCE or RESOURCE_AND_VAULT. Otherwise, ignored. Omit to return all matching resources.

Aggregated records have no dimensions and typically have resourceCount greater than 1.

Response

Cost data retrieved.
recordslist of objects
Array of cost data records matching the requested query criteria. Each record contains cost and usage information grouped by the specified dimensions and time granularity.
totalCountinteger>=0
Total number of cost records that matched the time frame and filter options.
resourceCountinteger>=0
Total number of resources that incurred costs during the specified time frame.
nextTokenstringOptional
Cursor that points to the first record of the next page of results. Pass this value in the next request.

Errors

400
Bad Request Error