List Cluster token metadata with id

  • Published Feb 12, 2020

This API call lists the metadata of a Dynatrace Cluster token by the ID of the token.

Authentication

To execute this request, you need the Cluster token management (ClusterTokenManagement) permission assigned to your API token. Generate your API token via Cluster Management Console (CMC). To learn how to obtain and use it, see Cluster API - Authentication.

Endpoint

/api/cluster/v2/tokens

Parameters

ParameterTypeDescriptionInRequired
idstring

The ID of the required token.

pathrequired

Response

Response codes

CodeTypeDescription
200TokenMetadata

Success

404ErrorEnvelope

Failed. The requested token has not been found.

Response body objects

The TokenMetadata object

Metadata of a token.

ElementTypeDescription
idstring

The ID of the token.

namestring

The name of the token.

userIdstring

The owner of the token.

revokedboolean

Revocation status of the token. Revoked tokens are disabled.

createdinteger

The creation time as a unix timestamp in milliseconds.

expiresinteger

The expiration time as a unix timestamp in milliseconds.

lastUseinteger

The unix timestamp in milliseconds when the token was last used.

scopesstring[]

A list of scopes assigned to the token.

  • ClusterTokenManagement
  • ControlManagement
  • DiagnosticExport
  • EnvironmentTokenManagement
  • ExternalSyntheticIntegration
  • Nodekeeper
  • ReadSyntheticData
  • ServiceProviderAPI
  • UnattendedInstall
  • activeGateTokenManagement.create
  • activeGateTokenManagement.read
  • activeGateTokenManagement.write
  • apiTokens.read
  • apiTokens.write
  • settings.read
  • settings.write
personalAccessTokenboolean

The token is a personal access token (true) or an API token (false).

Response body JSON model

{
"id": "acbed0c4-4ef1-4303-991f-102510a69322",
"name": "myToken",
"userId": "john.smith",
"revoked": true,
"created": 1554076800000,
"expires": 1585976400000,
"lastUse": 1554354000000,
"personalAccessToken": true,
"scopes": [
"DataExport",
"ReadConfig",
"WriteConfig"
]
}

Example

In this example, the request queries the metadata of the token, which has the ID of 4e9f128e-04f9-4795-pj319-8b7c-3c14a5e885e4.

Curl

curl -X GET "https://myManaged.cluster.com/api/cluster/v2/tokens/4e9f128e-04f9-4795-pj319-8b7c-3c14a5e885e4"
-H "accept: application/json; charset=utf-8"

Request URL

https://myManaged.cluster.com/api/cluster/v2/tokens/4e9f128e-04f9-4795-pj319-8b7c-3c14a5e885e4

Response body

{
"id": "4e9f128e-04f9-4795-pj319-8b7c-3c14a5e885e4",
"name": "myToken",
"userId": "john.smith",
"revoked": true,
"created": 1554076800000,
"expires": 1585976400000,
"lastUse": 1554354000000,
"scopes": [
"DataExport",
"ReadConfig",
"WriteConfig"
]
}

Response code

204