Azion CLI personal-token
Azion CLI commands that create, list, describe, and delete personal tokens, with every flag, its type, and its default.
The Azion CLI personal-token commands create, list, describe, and delete your personal tokens, the credentials that authenticate your calls to the Azion API and your CLI commands. Each token has a UUID, which the --id flag takes. The options every command accepts, such as --format, --out, and -y, are on Global options.
Create
azion create personal-token creates a personal token with the name, expiration, and description you pass:
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
--description | — | string | — | Description of the personal token. |
--expiration | — | string | — | Required unless --file is set. Time until the token expires: a number followed by d for days or m for months, such as 1d or 9m. Without it, the command asks for the expiration. |
--file | — | string | — | Path to a JSON file with the attributes of the personal token. Use - to read the JSON from standard input. |
--name | — | string | — | Name of the personal token. |
In --expiration, m stands for months, not minutes: 9m creates a token that expires nine months later. A value without a number, such as tomorrow, is refused with Error: expected integer.
This command creates a token named my-token that expires the next day:
The command prints the value of the token. No other personal-token command prints it, so store the value when you create the token:
List
azion list personal-token lists your personal tokens. The list shows the UUID, the name, and the expiration of each token, never its value:
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
--details | — | — | — | Adds the CREATED AT and DESCRIPTION columns to the ID, NAME, and EXPIRES AT columns. |
This command lists the personal tokens of the user:
The command prints one row per token. A token past its expiration stays in the list until you delete it, such as old-token below:
Describe
azion describe personal-token prints the attributes of one personal token, without its value:
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
--id | — | string | — | UUID of the personal token to describe. |
This command describes the token with UUID 11111111-2222-4333-8444-555555555555:
The command prints the UUID, the name, the dates, and the description of the token:
With --format json, the command prints the same attributes under the keys created, description, expires_at, name, and uuid.
A UUID that matches no token of the user fails with this error:
Delete
azion delete personal-token deletes a personal token:
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
--id | — | string | — | Required. UUID of the personal token to delete. Without it, the command asks for the UUID. |
This command deletes the token with UUID 11111111-2222-4333-8444-555555555555:
The command confirms the deletion:
A UUID that matches no token, such as the UUID of a token you already deleted, fails with this error:
Use a JSON file
azion create personal-token reads the attributes of the token from a JSON file with --file. The command reads name, expires_at, and description, and expires_at takes the same values as --expiration.
This file creates a token named my-file-token that expires nine months after it is created:
Pass the file to the create command:
The command prints the value of the token: