This API call creates a new cluster token.
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.
Creates a new Dynatrace Cluster token. The response contains the newly created token.
The request consumes and produces an application/json
payload.
/api/cluster/v2/tokens
CreateToken
objectThe name of the token.
The list of scopes to be assigned to the token.
DiagnosticExport
: DiagnosticExport.ControlManagement
: ControlManagement.UnattendedInstall
: UnattendedInstall.ServiceProviderAPI
: Service Provider API.ExternalSyntheticIntegration
: Create and read synthetic monitors, locations, and nodes.ClusterTokenManagement
: Cluster token management.ReadSyntheticData
: Read synthetic monitors, locations, and nodes.Nodekeeper
: Nodekeeper access for node management.EnvironmentTokenManagement
: "Token Management" Token creation for existing environments.activeGateTokenManagement.read
: Read ActiveGate tokens.activeGateTokenManagement.create
: Create ActiveGate tokens.activeGateTokenManagement.write
: Write ActiveGate tokens.settings.read
: Read settings.settings.write
: Write settings.apiTokens.read
: Read API tokens.apiTokens.write
: Write API tokens.DiagnosticExport
ControlManagement
UnattendedInstall
ServiceProviderAPI
ExternalSyntheticIntegration
ClusterTokenManagement
ReadSyntheticData
Nodekeeper
EnvironmentTokenManagement
activeGateTokenManagement.read
activeGateTokenManagement.create
activeGateTokenManagement.write
settings.read
settings.write
apiTokens.read
apiTokens.write
Duration
objectDefines a period of time.
The amount of time.
The unit of time.
If not set, millisecond is used.
DAYS
HOURS
MILLIS
MINUTES
SECONDS
This is a model of the request body, showing the possible elements. It has to be adjusted for usage in an actual request.
{"name": "string","expiresIn": {"value": 1,"unit": "DAYS"},"scopes": ["DiagnosticExport"]}
Token
objectDynatrace API authentication token.
{"token": "abcdefjhij1234567890"}
In this example, the request creates a new token named Mytoken
that is valid for 24 hours. With this token you will be able to perform a diagnostic export (DiagnosticExport
) and unattended install (UnattendedInstall
).
curl -X POST "https://myManaged.cluster.com/api/cluster/v2/tokens"-H "accept: application/json; charset=utf-8"-H "Content-Type: application/json; charset=utf-8"-d "{ \"name\": \"MyToken\", \"scopes\": [ \"DiagnosticExport\", \"UnattendedInstall\" ], \"expiresIn\": { \"value\": 24, \"unit\": \"HOURS\" }}"
https://myManaged.cluster.com/api/cluster/v2/tokens
{"name": "MyToken","scopes": ["DiagnosticExport", "UnattendedInstall"],"expiresIn": {"value": 24,"unit": "HOURS"}}
{"token": "abcdefjhij1234567890"}
201