26 Jun 2018 06:06 AM - last edited on 09 Dec 2021 12:36 PM by MaciejNeumann
Hi there,
I'm developing a docker image that will run on a PaaS for several customer (tenants), the thing is the image is the same for all my customer the only thing that I need to change is the tenant (DT_TENANT and DT_TENANTTOKEN).
I can see that the dynatrace-env.sh accepts the user to customize both environment variables the issue that I'm facing is that DT_TENANTTOKEN has a "random" value that I'm not able to recreate. Looks like it is set during the installation script, WHICH I don't want to execute for every new customer that I get!
Who can help me understanding how this value is create?
Thanks
26 Jun 2018 06:42 AM
Hello,
You can set and get this tenant token using this cluster API:
/api/v1.0/control/tenantManagement/tokens/<tenant ID>
The scope in the payload must contain:
"InstallerDownload"
The installation token is given in return in the value tokenId.
Payload example:
{
"scopes": ["DataExport", "MaintenanceWindows","InstallerDownload"],
"label": "Admin_token",
"expirationDurationInSeconds": "60"
}
Regards,
26 Jun 2018 03:02 PM
I tried the following script without lucky. I get an "Operation timed out"
curl -v -L -XPOST -H "Authorization: Api-Token DT_TOKEN" --header "Content-Type: application/json" --data '{"scopes": ["DataExport", "MaintenanceWindows","InstallerDownload"],"label": "Admin_token","expirationDurationInSeconds": "60"}' https://DT_TENANTID.live.dynatrace.com/api/v1.0/c...DT_TENANTID
Am I doing something wrong?