Create and manage access tokens of Telemetry Router
Last updated on
Access Token are JSON Web Token (JWT) required in order to interact with a telemetry routers’ endpoint.
Prerequisites
Section titled “Prerequisites”- You have a Telemetry Router instance Create and manage instances
API Prerequisites & Variables
Section titled “API Prerequisites & Variables”To execute the API commands in this guide, you must first export the following path parameters as environment variables in your terminal (or replace them directly in the commands):
$PROJECT_ID: Your unique STACKIT project ID (e.g.,16dbfb51...).$REGION_ID: The region where your instance is located (e.g.,eu01oreu02).$TELEMETRY_ROUTER_ID: The unique ID of your Telemetry Router instance.$ACCESS_TOKEN_ID: The specific identifier of an access token (required for View, Edit, and Delete operations).
Create an access token
Section titled “Create an access token”To create a Telemetry Router access token, you need to call the appropriate endpoint.
Choose the properties for your new access token
Section titled “Choose the properties for your new access token”| Parameter | Meaning | Example |
|---|---|---|
| ttl | An integer or null to define the lifetime of the token in days. null represents a token with an infinite lifespan. | 28800 |
| displayName | A name for the Telemetry Router instance | my-telemetry-router |
| description | An optional description for your reference | My Telemetry Router instance |
stackit curl -X POST \"https://telemetry-router.api.stackit.cloud/v1/projects/$PROJECT_ID/regions/$REGION_ID/telemetry-routers/$TELEMETRY_ROUTER_ID/access-tokens" \-H "Content-Type: application/json" \--data '{ "ttl": <TTL>, "displayName": "<DISPLAY_NAME>", "description": "<DESCRIPTION>"}'Example
Section titled “Example”stackit curl -X POST \"https://telemetry-router.api.stackit.cloud/v1/projects/16dbfb51-7a75-42d3-a51d-99f87f48cd32/regions/eu01/telemetry-routers/d5b5cdcc-c155-4d66-82ef-4289db8e4557/access-tokens" \-H "Content-Type: application/json" \--data '{ "ttl": 180, "displayName": "my-telemetry-router-access-token", "description": "My Telemetry Router access token"}'Follow the steps in the Portal to create a Telemetry Router access token.
-
On the sidebar, click on Telemetry Router.
-
Navigate to the instance, for that you want to create an access token and click on the entry.
-
On the sidebar, click on Access tokens.
-
On the bar on the top, click on Create access token.
-
On the overlay, configure your new access token.
Enter a name of your new access token. This name is for your reference. The token can have either an unlimited lifetime or a lifetime between 1 and 180 days.
After defining all information, click on Create.
-
Copy the created token to a secure and safe location. You can not retrieve the token later.
List all access tokens
Section titled “List all access tokens”stackit curl -X GET \"https://telemetry-router.api.stackit.cloud/v1/projects/$PROJECT_ID/regions/$REGION_ID/telemetry-routers/$TELEMETRY_ROUTER_ID/access-tokens" \-H "Content-Type: application/json"Example
Section titled “Example”stackit curl -X GET \"https://telemetry-router.api.stackit.cloud/v1/projects/16dbfb51-7a75-42d3-a51d-99f87f48cd32/regions/eu01/telemetry-routers/d5b5cdcc-c155-4d66-82ef-4289db8e4557/access-tokens" \-H "Content-Type: application/json"Follow the steps in the Portal to see a list of all Telemetry Router access token.
- On the sidebar, click on Telemetry Router.
- Navigate to the instance, for that you want to create an access token and click on the entry.
- On the sidebar, click on Access tokens.
- You see a list of all access tokens with their state.
View an access token
Section titled “View an access token”stackit curl -X GET \"https://telemetry-router.api.stackit.cloud/v1/projects/$PROJECT_ID/regions/$REGION_ID/telemetry-routers/$TELEMETRY_ROUTER_ID/access-tokens/$ACCESS_TOKEN_ID" \-H "Content-Type: application/json"Example
Section titled “Example”stackit curl -X GET \"https://telemetry-router.api.stackit.cloud/v1/projects/16dbfb51-7a75-42d3-a51d-99f87f48cd32/regions/eu01/telemetry-routers/d5b5cdcc-c155-4d66-82ef-4289db8e4557/access-tokens/988d3545-68fb-47f2-acd7-b3ea96036ba9" \-H "Content-Type: application/json"Follow the steps in the Portal to view a Telemetry Router access token.
-
On the sidebar, click on Telemetry Router.
-
Navigate to the instance, for that you want to create an access token and click on the entry.
-
On the sidebar, click on Access tokens.
-
You see a list of all access tokens with their state. Click on an entry you want to view to see the details.
Edit an access token
Section titled “Edit an access token”| Parameter | Meaning | Example |
|---|---|---|
| displayName | A name for the Telemetry Router instance. In this endpoint, the parameter is optional. | my-telemetry-router |
| description | An optional description for your reference | My Telemetry Router instance |
stackit curl -X PUT \"https://telemetry-router.api.stackit.cloud/v1/projects/$PROJECT_ID/regions/$REGION_ID/telemetry-routers/$TELEMETRY_ROUTER_ID/access-tokens/$ACCESS_TOKEN_ID" \-H "Content-Type: application/json" \--data '{ "displayName": "<DISPLAY_NAME>", "description": "<DESCRIPTION>"}'Example
Section titled “Example”stackit curl -X PUT \"https://telemetry-router.api.stackit.cloud/v1/projects/16dbfb51-7a75-42d3-a51d-99f87f48cd32/regions/eu01/telemetry-routers/d5b5cdcc-c155-4d66-82ef-4289db8e4557/access-tokens/988d3545-68fb-47f2-acd7-b3ea96036ba9" \-H "Content-Type: application/json" \--data '{ "displayName": "my-new-access-token-name", "description": "My new description for the access token"}'Follow the steps in the Portal to edit a Telemetry Router access token.
- On the sidebar, click on Telemetry Router.
- Navigate to the instance, for that you want to create an access token and click on the entry.
- On the sidebar, click on Access tokens.
- You see a list of all access tokens with their state. Click on an entry you want to view to see the details.
- In this detail view you can change the name and the description of the access token.
- After editing click on Save.
Delete an access token
Section titled “Delete an access token”To delete a Telemetry Router instance, you need to call the DELETE endpoint.
stackit curl -X DELETE \"https://telemetry-router.api.stackit.cloud/v1/projects/$PROJECT_ID/regions/$REGION_ID/telemetry-routers/$TELEMETRY_ROUTER_ID/access-tokens/$ACCESS_TOKEN_ID" \-H "Content-Type: application/json"Example:
stackit curl -X DELETE \"https://telemetry-router.api.stackit.cloud/v1/projects/16dbfb51-7a75-42d3-a51d-99f87f48cd32/regions/eu01/telemetry-routers/d5b5cdcc-c155-4d66-82ef-4289db8e4557/access-tokens/988d3545-68fb-47f2-acd7-b3ea96036ba9" \-H "Content-Type: application/json"Follow the steps in the Portal to delete a Telemetry Router access token.
- On the sidebar, click on Telemetry Router.
- Navigate to the instance, for that you want to create an access token and click on the entry.
- On the sidebar, click on Access tokens.
- You see a list of all access tokens with their state. Navigate to the entry you want to delete and click on the three-dots-menu.
- On the menu, click on Delete. Enter the name of the token and click on Delete.