Skip to main content

dedicated_inference_tokens

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

Overview

Namededicated_inference_tokens
TypeResource
Iddigitalocean.inference.dedicated_inference_tokens

Fields

The following fields are returned by SELECT queries:

The response will be a JSON object with a key called tokens. This will be set to an array of objects (id, name, created_at, is_managed; value is not returned). Pagination uses the same links and meta structure as other list endpoints (e.g. VPC peerings).

NameDatatypeDescription
idstring (uuid)Unique ID of the token. (example: 01333f14-a903-4b8e-92b3-363a767aa052)
namestringName of the token. (example: first-token)
created_atstring (date-time) (example: 2024-01-09T20:44:32Z)
is_managedbooleanWhen true, the token is managed by DigitalOcean (for example, system-provisioned). When false, the token was created by the user.
valuestringToken value; only returned once on create. Store securely. (example: di_xxxxxxxxxxxxxxxxxxxxxxxx)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
dedicated_inferences_list_tokensselectdedicated_inference_idper_page, pageList all access tokens for a Dedicated Inference instance. Token values are
not returned; only id, name, created_at, and is_managed. Send a GET request to
/v2/dedicated-inferences/{dedicated_inference_id}/tokens.
dedicated_inferences_create_tokensinsertdedicated_inference_id, nameCreate a new access token for a Dedicated Inference instance. Send a POST
request to /v2/dedicated-inferences/{dedicated_inference_id}/tokens with a
name. The token value is returned only once in the response; store it securely.
dedicated_inferences_delete_tokensdeletededicated_inference_id, token_idRevoke (delete) an access token for a Dedicated Inference instance. Send a
DELETE request to /v2/dedicated-inferences/{dedicated_inference_id}/tokens/{token_id}.

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
dedicated_inference_idstring (uuid)A unique identifier for a Dedicated Inference instance. (example: 6b5c619c-359c-44ca-87e2-47e98170c01d)
token_idstring (uuid)A unique identifier for a Dedicated Inference access token. (example: f11d4795-c1db-4ac3-9aa6-a0ea3c58877e)
pageintegerWhich 'page' of paginated results to return. (example: 1)
per_pageintegerNumber of items returned per page (example: 2)

SELECT examples

List all access tokens for a Dedicated Inference instance. Token values are
not returned; only id, name, created_at, and is_managed. Send a GET request to
/v2/dedicated-inferences/{dedicated_inference_id}/tokens.

SELECT
id,
name,
created_at,
is_managed,
value
FROM digitalocean.inference.dedicated_inference_tokens
WHERE dedicated_inference_id = '{{ dedicated_inference_id }}' -- required
AND per_page = '{{ per_page }}'
AND page = '{{ page }}'
;

INSERT examples

Create a new access token for a Dedicated Inference instance. Send a POST
request to /v2/dedicated-inferences/{dedicated_inference_id}/tokens with a
name. The token value is returned only once in the response; store it securely.

INSERT INTO digitalocean.inference.dedicated_inference_tokens (
name,
dedicated_inference_id
)
SELECT
'{{ name }}' /* required */,
'{{ dedicated_inference_id }}'
RETURNING
token
;

DELETE examples

Revoke (delete) an access token for a Dedicated Inference instance. Send a
DELETE request to /v2/dedicated-inferences/{dedicated_inference_id}/tokens/{token_id}.

DELETE FROM digitalocean.inference.dedicated_inference_tokens
WHERE dedicated_inference_id = '{{ dedicated_inference_id }}' --required
AND token_id = '{{ token_id }}' --required
;