Dynatrace Platform Subscription API - GET cost per environment

  • Reference
  • Published Mar 30, 2023

Gets the cost data for a Dynatrace Platform Subscription split by monitoring environment.

The request produces an application/json payload.

GET

https://api.dynatrace.com/sub/v3/accounts/{accountUuid}/subscriptions/{subscriptionUuid}/environments/cost

Authentication

To execute this request, you need the Allow read access for usage and consumption resources (account-uac-read) scope assigned to your token. To learn how to obtain and use it, see OAuth clients.

Parameters

ParameterTypeDescriptionInRequired
accountUuidstring

The ID of the required account.

You can find the UUID on the Account Management > Identity & access management > OAuth clients page, during creation of an OAuth client.

pathRequired
subscriptionUuidstring

The UUID of the requested subscription.

Fetch the list of subscriptions via the GET all subscriptions request.

pathRequired
startTimestring

The start time of the query in 2021-05-01T15:11:00Z format. Timeframe limits (startTime, endTime) are both required, unless a "page-key" is provided instead.

queryOptional
endTimestring

The end time of the query in 2021-05-01T15:11:00Z format. Timeframe limits (startTime, endTime) are both required, unless a "page-key" is provided instead.

queryOptional
environmentIdsstring[]

A list of environments for which you want to read the usage data. To specify several environments, separate them with a comma (,).

queryOptional
capabilityKeysstring[]

A list of capabilities for which you want to read the usage data. To specify several capabilities, separate them with a comma (,).

To obtain capability keys, use the GET subscriptions call and look for the capabilities field of the response.

queryOptional
clusterIdsstring[]

A list of Managed clusters for which you want to read the usage data.

Not applicable to SaaS environments.

queryOptional
page-keystring

The cursor for the next page of results. You can find it in the nextPageKey field of the previous response.

queryOptional
page-sizenumber

Defines the requested number of entries for the next page.

queryOptional

Response

Response codes

CodeTypeDescription
200SubscriptionEnvironmentCostListV3Dto

Success. The response contains the costs of the subscription, split by environment.

400-

Failed. The request was unacceptable, often due to missing a required parameter

401-

Failed. The bearer token is incorrect/expired or the requested account information does not match the bearer token

403-

Access denied

404-

Failed. The requested resource was not found

500-

Failed. Something went wrong in Account Management API

Response body objects

The SubscriptionEnvironmentCostListV3Dto object

ElementTypeDescription
dataSubscriptionEnvironmentCostV3Dto[]

Subscription cost data

lastModifiedTimestring

The time the subscription data was last modified in 2021-05-01T15:11:00Z format.

nextPageKeystring

The next page key for pagination if next page exists

The SubscriptionEnvironmentCostV3Dto object

ElementTypeDescription
clusterIdstring

The UUID of the Managed cluster

environmentIdstring

The UUID of the environment.

costSubscriptionCapabilityCostReceivedDto[]

Subscription costs for the environment.

The SubscriptionCapabilityCostReceivedDto object

ElementTypeDescription
startTimestring

The start time for the capability cost in 2021-05-01T15:11:00Z format.

endTimestring

The end time for the capability cost in 2021-05-01T15:11:00Z format.

valuenumber

The total cost for all the capabilities.

currencyCodestring

The currency of the cost.

capabilityKeystring

The key of the subscription capability.

capabilityNamestring

The display name of the subscription capability.

bookingDatestring

The booking date of the subscription capability in 2021-05-01T15:11:00Z format.

Response body JSON models

{
"data": [
{
"clusterId": "string",
"environmentId": "string",
"cost": [
{
"startTime": "string",
"endTime": "string",
"value": 1,
"currencyCode": "string",
"capabilityKey": "string",
"capabilityName": "string",
"bookingDate": "string"
}
]
}
],
"lastModifiedTime": "string",
"nextPageKey": "string"
}