Dynatrace platform subscription API v1 - GET consumption
Gets the overall DPS-unit consumption of a subscription.
The request produces an application/json
payload.
GET |
|
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 Authentication.
Parameters
Parameter | Type | Description | In | Required |
---|---|---|---|---|
accountUuid | string | The ID of the required account. You can find the UUID on the Account > Account management API page, during creation of an OAuth client. | path | required |
subscriptionId | number | The ID of the required subscription. You can fetch the list of subscriptions with the GET subscriptions call. | path | required |
resolution | string | The resolution at which you want to see the consumption. You have the following options:
| query | required |
from | string | The start of the requested timeframe in | query | optional |
to | string | The end of the requested timeframe in | query | optional |
calculationMode | string | The calculation mode at which you want the consumption to return. RATED consumption (default) is returned in DPS units according to your rate card. UNRATED consumption is returned in the consumed native units, for example Host Unit Hours and the rate card is not applied.
| query | required |
Response
Response codes
Code | Type | Description |
---|---|---|
200 | ConsumptionReturnListDto | Success. The response contains your consumption information. |
Response body objects
The ConsumptionReturnListDto
object
Element | Type | Description |
---|---|---|
totalCount | number | The number of entries in the list. |
records | ConsumptionReturnDto[] | A list of consumption records. |
The ConsumptionReturnDto
object
Element | Type | Description |
---|---|---|
timeFrameStart | string | The start date and time of the report interval in |
timeFrameEnd | string | The end date and time of the report interval in |
consumptionType | string | The name of the consumed units (for example, |
quantity | number | The quantity that has been deducted from the available unit's pool. |
Response body JSON model
{"totalCount": 1,"records": [{"timeFrameStart": "string","timeFrameEnd": "string","consumptionType": "string","quantity": 1}]}
Example
In this example, the request shows the monitoring consumption of the subscription with the ID of 40655 for the account with the ID of 2b794097-8ad2-4b32-b923-0131da2eeddf.
The result is truncated to three entries.
curl --request GET \--url 'https://api.dynatrace.com/sub/v1/accounts/2b794097-8ad2-4b32-b923-0131da2eeddf/subscriptions/40655/consumption' \--header 'Authorization: Bearer abcdefjhij1234567890'
Request URL
https://api.dynatrace.com/sub/v1/accounts/2b794097-8ad2-4b32-b923-0131da2eeddf/subscriptions/40655/consumption
Response body
{"totalCount": 3,"records": [{"timeFrameStart": "2020-07-23T00:00:00Z","timeFrameEnd": "2020-08-22T23:59:59Z","consumptionType": "Mainframe","quantity": 747.3972616},{"timeFrameStart": "2020-07-23T00:00:00Z","timeFrameEnd": "2020-08-22T23:59:59Z","consumptionType": "Total","quantity": 747.3972616},{"timeFrameStart": "2020-10-23T00:00:00Z","timeFrameEnd": "2020-11-22T23:59:59Z","consumptionType": "Host unit hours","quantity": 35095.5596490444}]}