Skip to main content

auth_tokens

Creates, updates, deletes, gets or lists an auth_tokens resource.

Overview

Nameauth_tokens
TypeResource
Idgoogle.redis.auth_tokens

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringIdentifier. Name of the auth token. Format: projects/{project}/locations/{location}/clusters/{cluster}/tokenAuthUsers/{token_auth_user}/authTokens/{auth_token}
createTimestring (google-datetime)Output only. Create time of the auth token.
statestringOutput only. State of the auth token. (STATE_UNSPECIFIED, ACTIVE, CREATING, DELETING)
tokenstringOutput only. The service generated authentication token used to connect to the Redis cluster.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, clustersId, tokenAuthUsersId, authTokensIdGets a specific auth token for a specific token auth user.
listselectprojectsId, locationsId, clustersId, tokenAuthUsersIdorderBy, pageSize, pageToken, filterLists all the auth tokens for a specific token auth user.
deletedeleteprojectsId, locationsId, clustersId, tokenAuthUsersId, authTokensIdRemoves a auth token for a user of a token based auth enabled instance.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
authTokensIdstring
clustersIdstring
locationsIdstring
projectsIdstring
tokenAuthUsersIdstring
filterstring
orderBystring
pageSizeinteger (int32)
pageTokenstring

SELECT examples

Gets a specific auth token for a specific token auth user.

SELECT
name,
createTime,
state,
token
FROM google.redis.auth_tokens
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND clustersId = '{{ clustersId }}' -- required
AND tokenAuthUsersId = '{{ tokenAuthUsersId }}' -- required
AND authTokensId = '{{ authTokensId }}' -- required
;

DELETE examples

Removes a auth token for a user of a token based auth enabled instance.

DELETE FROM google.redis.auth_tokens
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND clustersId = '{{ clustersId }}' --required
AND tokenAuthUsersId = '{{ tokenAuthUsersId }}' --required
AND authTokensId = '{{ authTokensId }}' --required
;