This command creates an API token, which can be used to securely authenticate calls to the VMS REST API.
The token is displayed in the command output and cannot be displayed again.
The number of tokens per user is limited to five by default and configurable using vms set_max_api_tokens_per_user.
The command enables you to create a token for yourself or for another user.
Note
Creating a token for another user requires Create permission for the Security realm.
Usage
apitoken create [--name TOKEN_NAME] [--expiry-date EXPIRATION_TIME] [--owner OWNER]
Options
| Customizes the name of the API token. If not specified, the token is named |
| Sets the token's expiration date by specifying an amount of time from token creation until the token should expire. The expiration date is equal to the token creation date in UTC + the specified time period. Specify The maximum and default expiration time is the password expiration timeout, which is set by the Example: To set the token to expire after 180 days: |
| Sets the owner of the token. Use this parameter to create a token for another user. If not specified, the token is owned by the requesting user.
|
Examples
This example creates a token for the admin user, named admin_api_token:
vcli: admin> apitoken create ApiToken with id: JhxND7ci has been created, your token is: JhxND7ci.AWrRmHXRtbcjUSCANl9KLrxRT6sMqesu please keep it safe
This example creates a token for the user admin_jb, named AWS_TOKEN that will expire in one day:
vcli: admin> apitoken create --name AWS_TOKEN --expiry-date 1D --owner adminjb ApiToken with id: L7k8ljIC has been created, your token is: L7k8ljIC.jm1P5Y0ONaJfUJhslJbAjRAyr9jcy89X please keep it safe