Metric units API - GET convert units

Converts a source unit into a target unit.

If no target unit is set, the request finds an appropriate target unit automatically, taking into account the preferred number format (if specified).

The request produces an application/json payload.

GETSaaShttps://{your-environment-id}.live.dynatrace.com/api/v2/units/{unitId}/convert
Environment ActiveGateCluster ActiveGatehttps://{your-activegate-domain}:9999/e/{your-environment-id}/api/v2/units/{unitId}/convert

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

ParameterTypeDescriptionInRequired
unitIdstring

The ID of the source unit.

pathrequired
valuenumber

The value to be converted.

queryrequired
targetUnitstring

The ID of the target unit.

If not set, the request finds an appropriate target unit automatically, based on the specified number format.

queryoptional
numberFormatstring

The preferred number format of the target value. You can specify the following formats:

  • binary
  • decimal

`Only used if the target unit if not set.

queryoptional

Response

Response codes

CodeTypeDescription
200UnitConversionResult

Success

404-

Not found. The requested resource is not found or the query is incorrect.

4XXErrorEnvelope

Client side error.

5XXErrorEnvelope

Server side error.

Response body objects

The UnitConversionResult object

The result of a unit conversion.

ElementTypeDescription
resultValuenumber

The result of the unit conversion.

unitIdstring

The ID of the unit of this conversion result.

Response body JSON model

{
"resultValue": 1,
"unitId": "string"
}