apitoken modify

Prev Next

This command modifies an API token.

Usage

apitoken modify --id ID
               [--name NAME]
               [--expiry-date EXPIRATION_TIME]

Required Parameters

--id ID

Specifies the API token to modify.

Options

--name NAME

Customizes the name of the API token.

If not specified, the token is named OWNER_api_token, where OWNER is the user name of the token owner.

--expiry-date EXPIRATION_TIME

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 EXPIRATION_TIME as a whole integer followed by a unit of time: 'Y' for (365 day) years, 'M' for (30 day) months, 'w' or 'W' for weeks, 'd' or 'D' for days, 'h' or 'H' for hours, 'm' for minutes, 's' or 'S' for seconds. For example: to set the expiration date to be six months after creating the token: --expiry-date 6M

The maximum and default expiration time is the password expiration timeout, which is set by the --pwd-expiration-timeout parameter of the vms modify_pwd_settings command. If password expiration is not enabled, tokens do not expire unless --expiry-date is set.

Example: To set the token to expire after 180 days: --expiry-date 180D

Example

vcli: admin> apitoken modify --id SwpND4dt --name manager1token2 --expiry-date 24M