Metric units API - GET a unit
Gets properties of a metric unit.
The request produces an application/json
payload.
GET | ManagedDynatrace for Government | https://{your-domain}/e/{your-environment-id}/api/v2/units/{unitId} |
SaaS | https://{your-environment-id}.live.dynatrace.com/api/v2/units/{unitId} | |
Environment and Cluster ActiveGate (default port 9999) | https://{your-activegate-domain}:9999/e/{your-environment-id}/api/v2/units/{unitId} |
Authentication
To execute this request, you need an access token with metrics.read
scope.
To learn how to obtain and use it, see Tokens and authentication.
Parameters
Parameter | Type | Description | In | Required |
---|---|---|---|---|
unitId | string | The ID of the required unit. | path | required |
Response
Response codes
Code | Type | Description |
---|---|---|
200 | Unit | Success |
404 | - | Not found. The requested resource is not found or the query is incorrect. |
Response body objects
The Unit
object
The metadata of a unit.
Element | Type | Description |
---|---|---|
description | string | A short description of the unit. |
displayName | string | The display name of the unit. |
displayNamePlural | string | The plural display name of the unit. |
symbol | string | The symbol of the unit. |
unitId | string | The ID of the unit. |
Response body JSON model
1{2 "description": "The second is the base unit of time and defined as 1/86400 of a day.",3 "displayName": "second",4 "displayNamePlural": "seconds",5 "symbol": "s",6 "unitId": "Second"7}
Example
In this example, the request retrieves metadata of the Ratio unit.
The API token is passed in the Authorization header.
Curl
1curl --request GET \2 --url https://mySampleEnv.live.dynatrace.com//api/v2/units/MebiByte \3 --header 'Authorization: Api-Token dt0c01.abc123.abcdefjhij1234567890'
Request URL
1https://mySampleEnv.live.dynatrace.com//api/v2/units/MebiByte
Response body
1{2 "unitId": "MebiByte",3 "displayName": "mebibyte",4 "symbol": "MiB",5 "description": "1048576.0 byte"6}
Response code
200