Dynatrace platform subscription API v1 - GET cluster consumption
Gets the DPS-unit consumption of a subscription per each Dynatrace Managed cluster of an account.
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 |
clusterUuids | string[] | Filter the result to specified clusters only. To specify several IDs, use the following format: You can fetch the list of clusters with the GET clusters request. | query | optional |
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 | ClusterOrEnvironmentAggregatedReturnDto[] | Success. The response contains your consumption information on cluster level. |
Response body objects
The ResponseBody
object
The ClusterOrEnvironmentAggregatedReturnDto
object
Element | Type | Description |
---|---|---|
resourceName | string | The name of the resource. |
resourceType | string | The type of the resource: environment or cluster. |
consumptionRecords | object | A list of consumption records. |
Response body JSON model
[{"resourceName": "string","resourceType": "string","consumptionRecords": {}}]
Example
In this example, the request shows consumption of each Dynatrace Managed cluster in 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/clusters/consumption' \--header 'Authorization: Bearer abcdefjhij1234567890'
Request URL
https://api.dynatrace.com/sub/v1/accounts/2b794097-8ad2-4b32-b923-0131da2eeddf/subscriptions/40655/clusters/consumption
Response body
[{"resourceName": "mySampleCluster","resourceType": "cluster","consumptionRecords": {"totalCount": 3,"records": [{"timeFrameStart": "2020-10-23T00:00:00Z","timeFrameEnd": "2020-11-22T23:59:59Z","consumptionType": "Host unit hours","quantity": 35095.5596490444},{"timeFrameStart": "2020-10-23T00:00:00Z","timeFrameEnd": "2020-11-22T23:59:59Z","consumptionType": "Digital experience monitoring","quantity": 18256.18615},{"timeFrameStart": "2020-10-23T00:00:00Z","timeFrameEnd": "2020-11-22T23:59:59Z","consumptionType": "Davis data units","quantity": 14429.26446936}]}}]