28 Apr 2023 03:57 PM - last edited on 08 May 2023 12:34 PM by MaciejNeumann
The Cluster API has an endpoint to create new Tokens, but I need a Token to authorize and use that endpoint, so it's a circular dependency.
I noticed an "afterInstallation" token in the Cluster Management Console (CMC), is there any way I might be able to retrieve that token? My idea was to somehow grab the "afterInstallation" token right after installing dynatrace managed, but I don't know how.
I have ssh access to the nodes in the cluster and the admin username/password. The manual way would be to login to the CMC and go to Settings > API Tokens > Cluster tokens > Generate token.
Is there a way to generate or obtain a token via CLI that doesn't depend on already having a token?
(Question originally posted on: How to get Dynatrace Managed Cluster Token Automatically after installation? - Stack Overflow)
Solved! Go to Solution.
01 May 2023 08:43 AM
Hello,
You can use this endpoint to create a new cluster token
https://www.dynatrace.com/support/help/shortlink/api-cluster-tokens-create-new
For that, you need to generate an API token with ClusterTokenManagement permission, please check the below document.
https://www.dynatrace.com/support/help/shortlink/api-authentication#create-token
BR,
Islam