dedicated_inference_tokens
Creates, updates, deletes, gets or lists a dedicated_inference_tokens resource.
Overview
| Name | dedicated_inference_tokens |
| Type | Resource |
| Id | digitalocean.inference.dedicated_inference_tokens |
Fields
The following fields are returned by SELECT queries:
- dedicated_inferences_list_tokens
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).
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | Unique ID of the token. (example: 01333f14-a903-4b8e-92b3-363a767aa052) |
name | string | Name of the token. (example: first-token) |
created_at | string (date-time) | (example: 2024-01-09T20:44:32Z) |
is_managed | boolean | When true, the token is managed by DigitalOcean (for example, system-provisioned). When false, the token was created by the user. |
value | string | Token value; only returned once on create. Store securely. (example: di_xxxxxxxxxxxxxxxxxxxxxxxx) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
dedicated_inferences_list_tokens | select | dedicated_inference_id | per_page, page | 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. |
dedicated_inferences_create_tokens | insert | dedicated_inference_id, name | Create a new access token for a Dedicated Inference instance. Send a POST request to /v2/dedicated-inferences/{dedicated_inference_id}/tokens with aname. The token value is returned only once in the response; store it securely. | |
dedicated_inferences_delete_tokens | delete | dedicated_inference_id, token_id | Revoke (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.
| Name | Datatype | Description |
|---|---|---|
dedicated_inference_id | string (uuid) | A unique identifier for a Dedicated Inference instance. (example: 6b5c619c-359c-44ca-87e2-47e98170c01d) |
token_id | string (uuid) | A unique identifier for a Dedicated Inference access token. (example: f11d4795-c1db-4ac3-9aa6-a0ea3c58877e) |
page | integer | Which 'page' of paginated results to return. (example: 1) |
per_page | integer | Number of items returned per page (example: 2) |
SELECT examples
- dedicated_inferences_list_tokens
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
- dedicated_inferences_create_tokens
- Manifest
Create a new access token for a Dedicated Inference instance. Send a POST
request to /v2/dedicated-inferences/{dedicated_inference_id}/tokens with aname. 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
;
# Description fields are for documentation purposes
- name: dedicated_inference_tokens
props:
- name: dedicated_inference_id
value: "{{ dedicated_inference_id }}"
description: Required parameter for the dedicated_inference_tokens resource.
- name: name
value: "{{ name }}"
description: |
Name for the new token.
DELETE examples
- dedicated_inferences_delete_tokens
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
;