Skip to main content

Billing data

Cloud visibility: Billing data (1.0.0)

Download OpenAPI specification:Download

API for interacting with cloud billing data.

Dimension values

Get key values

Returns a collection of values for a given key.

Authorizations:
bearerAuth
query Parameters
required
Keys (string) or Tags (string)

The dimension to return values for.

The Tags key returns all tag keys and Tags.* is a pattern where * matches the concrete tag key. This will result in a list of tag values for the specified tag key. It will contain missingTagKey for records that do not have a specified tag key, and missingTagValue for records with an empty tag value. Example tag key path: ?key=Tags.MyKey.

For any other dimension, a missingValue label will be included in the results in case any record does not contain the key.

groupBy
string (DimensionValues)
Enum: "CloudProvider" "AccountId" "ServiceType" "RegionCode" "ResourceGroup" "InstanceType" "PurchaseOption" "CostCategory"
Example: groupBy=CloudProvider

The dimension by which the billing data should be grouped.

filter
required
string
Example: filter=(CostDate -ge 2022-03-31T22:00:00Z) -and (CostDate -le 2022-04-30T21:59:59Z)

Filter the collection of billing records. The format of the query string parameter:

<filter name> <operator> <value>
Field name Description Supported operators Example
CostDate The date the cost was incurred -eq,-ne,-gt,-ge,-lt,-le (CostDate -ge 2022-03-31T22:00:00Z) -and (CostDate -le 2022-04-30T21:59:59Z)

For more information on the available operators and which data types those operators work on, see Filter API call results.

Responses

Response samples

Content type
application/json
{
  • "items": [
    ]
}

Grouped billing records

Get aggregated billing records

Returns a collection of billing records grouped by a given method.

Authorizations:
bearerAuth
query Parameters
required
Grouping (string) or Tags (string)

The primary grouping level is a way to divide data into buckets, and it cannot be the same as secondaryGroupBy.

Tags.* is a pattern where * matches the concrete tag key. It aggregates the results using the values for the tag key. Example tag key path: ?key=Tags.MyKey.

Grouping (string) or Tags (string)

The secondary grouping level is a way to divide data even further within buckets, and it cannot be the same as primaryGroupBy.

Tags.* is a pattern where * matches the concrete tag key. It aggregates the results using the values for the tag key. Example tag key path: ?key=Tags.MyKey.

secondaryGroupByMaxValues
integer >= 1
Example: secondaryGroupByMaxValues=5

The number of top secondary group buckets to return. For example, if you specify 5, the API will return 5 unique values. Other values will be aggregated to a bucket with the name "aggregatedCostsKey". This requires that there be a value for secondaryGroupBy.

filter
string
Example: filter=(CostDate -ge 2022-03-31T22:00:00Z) -and (CostDate -le 2022-04-30T21:59:59Z)

Filter the collection of grouped billing records. Format of the query string parameter:

<filter name> <operator> <value>

To filter by No tag value use (Tags.value -eq "")

To filter by No Tag key use negative equality for all other existing keys, like (Tags.key -ne "tag1") -and (Tags.key -ne "tagN").

Field name Description Supported operators Example
CostDate The date the cost was incurred -eq,-ne,-gt,-ge,-lt,-le, -in (CostDate -ge 2022-03-31T22:00:00Z) -and (CostDate -le 2022-04-30T21:59:59Z)
CloudProvider The cloud provider that hosts the resource -eq,-ne, -in (CloudProvider -eq "aws")
AccountId The unique ID of the cloud account that hosts the resource -eq,-ne, -in (AccountId -eq "73209182")
ServiceType The service type of the resource -eq,-ne, -in (ServiceType -eq "Azure Instances")
CostCategory The cost category used to bill the resource -eq,-ne,-exists, -in (CostCategory -eq "Tax")
RegionCode The region code for the geographical region where the resource is hosted -eq,-ne,-exists, -in (RegionCode -eq "eastus")
ResourceGroup The resource group containing the resource -eq,-ne,-exists, -in (ResourceGroup -eq "main-resources")
InstanceType The instance type used by the resource -eq,-ne,-exists, -in (InstanceType -eq "T2 Micro")
PurchaseOption The purchase option for the cloud subscription -eq,-ne,-exists, -in (PurchaseOption -eq "Partner")
Tags.key The tag key associated with the resource -eq,-ne, -in (Tags.key -eq "Backup")
Tags.value The tag value associated with the resource -eq,-ne, -in (Tags.value -eq "kubernetes:free")

For more information on the available operators and which data types those operators work on, see Filter API call results.

page_number
integer >= 1
Default: 1

The page number.

page_size
integer >= 1
Default: 100

The maximum number of items in the response.

Responses

Response samples

Content type
application/json
{
  • "currency": "USD",
  • "groupedBy": [
    ],
  • "items": [
    ],
  • "pagination": {
    },
  • "topItems": [
    ]
}