Skip to main content

tokens

Creates, updates, deletes, gets or lists a tokens resource.

Overview​

Nametokens
TypeResource
Idovh.cloud_ai.tokens

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
idstring (uuid)Application token Id
created_atstring (date-time)Application token creation date (wire: createdAt)
specobjectApplication token spec
statusobjectApplication token status
updated_atstring (date-time)Application token update date (wire: updatedAt)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectid, service_nameGet application token information
listselectservice_nameList application tokens
createinsertservice_name, name, region, roleCreate a new application token
deletedeleteid, service_nameDelete this application token
renewexecid, service_nameRenew an application token

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
api_hoststringThe OVHcloud API host. Selected by OVH_ENDPOINT (ovh-eu, ovh-ca or ovh-us; default ovh-eu). (default: api.eu.ovhcloud.com, x-stackQL-envVarSelector: {"envVar":"OVH_ENDPOINT","default":"ovh-eu","values":{"ovh-eu":"api.eu.ovhcloud.com","ovh-ca":"api.ca.ovhcloud.com","ovh-us":"api.us.ovhcloud.com"}})
idstring (uuid)Id
service_namestringThe Public Cloud project ID. Resolved from OVH_CLOUD_PROJECT_SERVICE when set.

SELECT examples​

Get application token information

SELECT
id,
created_at,
spec,
status,
updated_at
FROM ovh.cloud_ai.tokens
WHERE id = '{{ id }}' -- required
AND service_name = '{{ service_name }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
;

INSERT examples​

Create a new application token

INSERT INTO ovh.cloud_ai.tokens (
label_selector,
name,
region,
role,
service_name
)
SELECT
'{{ label_selector }}',
'{{ name }}' /* required */,
'{{ region }}' /* required */,
'{{ role }}' /* required */,
'{{ service_name }}'
RETURNING
id,
created_at,
spec,
status,
updated_at
;

DELETE examples​

Delete this application token

DELETE FROM ovh.cloud_ai.tokens
WHERE id = '{{ id }}' --required
AND service_name = '{{ service_name }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
;

Lifecycle Methods​

EXEC variables use wire (API) names.

Renew an application token

EXEC ovh.cloud_ai.tokens.renew
@id='{{ id }}' --required,
@service_name='{{ service_name }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
;