Manage a Linode Token.
NOTE: The full Personal Access Token is only returned when a new token has been created.
Field | Type | Required | Description |
---|---|---|---|
api_token |
str |
Required | The Linode account personal access token. It is necessary to run the module. It can be exposed by the environment variable LINODE_API_TOKEN instead. See details in Usage. |
- name: Create a simple token
linode.cloud.token:
label: my-token
state: present
- name: Create a token with expiry date and scopes
linode.cloud.token:
label: my-token
expiry: 2022-07-09T16:59:26
scope: '*'
state: present
- name: Delete a token
linode.cloud.token:
label: my-token
state: absent
Field | Type | Required | Description |
---|---|---|---|
label |
str |
Required | This token's unique label. |
state |
str |
Required | The state of this token. (Choices: present , absent ) |
expiry |
str |
Optional | When this token should be valid until. |
scopes |
str |
Optional | The OAuth scopes to create the token with. |
-
token
- The token in JSON serialized form.- Sample Response:
{ "created": "2018-01-01T00:01:01", "expiry": "2018-01-01T13:46:32", "id": 123, "label": "linode-cli", "scopes": "*", "token": "abcdefghijklmnop" }
- See the Linode API response documentation for a list of returned fields
- Sample Response: