Creates a new ActiveGate token.
The token will be owned by the user who owns the token used to authenticate the call.
The request consumes and produces an application/json
payload.
POST | SaaS | https://{your-environment-id}.live.dynatrace.com/api/v2/activeGateTokens |
Environment ActiveGateCluster ActiveGate | https://{your-activegate-domain}:9999/e/{your-environment-id}/api/v2/activeGateTokens |
To execute this request, you need an access token with one of the following scopes:
activeGateTokenManagement.create
activeGateTokenManagement.write
To learn how to obtain and use it, see Tokens and authentication.
The JSON body of the request. Contains parameters of the new ActiveGate token.
ActiveGateTokenCreate
objectParameters of a new ActiveGate token.
The type of the ActiveGate for which the token is valid.
ENVIRONMENT
CLUSTER
The expiration date of the token.
You can use one of the following formats:
2021-01-25T05:57:01.123+01:00
. If no time zone is specified, UTC is used. You can use a space character instead of the T
. Seconds and fractions of a second are optional.now-NU/A
, where N
is the amount of time, U
is the unit of time, and A
is an alignment. The alignment rounds all the smaller values to the nearest zero in the past. For example, now-1y/w
is one year back, aligned by a week.
You can also specify relative timeframe without an alignment: now-NU
.
Supported time units for the relative timeframe are:
m
: minutesh
: hoursd
: daysw
: weeksM
: monthsy
: yearsIf not set, the token never expires.
Ensure that it is not set in the past and does not exceed 2 years
from the moment of creation."
The name of the token.
The token is a seed token (true
) or an individual token (false
).
We recommend the individual token option (false).
This is a model of the request body, showing the possible elements. It has to be adjusted for usage in an actual request.
{"activeGateType": "ENVIRONMENT","expirationDate": "now+6M","name": "myToken","seedToken": false}
Success. The token has been created. The body of the response contains the token secret.
ActiveGateTokenCreated
objectThe newly created ActiveGate token.
The token expiration date in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
).
The secret of the token.
{"expirationDate": "2020-11-24T08:15:30.144Z","id": "dt0g02.4KWZO5EF","token": "dt0g02.4KWZO5EF.XT47R5DRADJIZUFOX4UDNOKTSUSABGLN7XSMJG7UXHRXKNY4WLORH4OF4T75MG7E"}
In this example, the request creates a new ActiveGate token for an environment ActiveGate. The token is valid for two weeks (14 days) from the moment of creation.
The API token is passed in the Authorization header.
curl --request GET \--url https://mySampleEnv.live.dynatrace.com//api/v2/activeGateTokens \--header 'Authorization: Api-Token dt0c01.abc123.abcdefjhij1234567890' \--header 'Content-Type: application/json' \--data '{"name": "REST test","expirationDate": "now+14d","seedToken": false,"activeGateType": "ENVIRONMENT"}'
https://mySampleEnv.live.dynatrace.com//api/v2/activeGateTokens
{"name": "REST test","expirationDate": "now+14d","seedToken": false,"activeGateType": "ENVIRONMENT"}
{"id": "dt0g02.xyz789","token": "dt0g02.xyz789.987654321zyxwvutsrq","expirationDate": "2021-12-14T13:42:31.148Z"}
201