Skip to main content

default_resources

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

Overview

Namedefault_resources
TypeResource
Iddigitalocean.projects.default_resources

Fields

The following fields are returned by SELECT queries:

The response will be a JSON object with a key called resources.
The value of this will be an object with the standard resource attributes.

Only resources that you are authorized to see will be returned.

NameDatatypeDescription
assigned_atstring (date-time)A time value given in ISO8601 combined date and time format that represents when the project was created. (example: 2018-09-28T19:26:37Z)
linksobjectThe links object contains the self object, which contains the resource relationship.
statusstringThe status of assigning and fetching the resources. (example: ok)
urnstringThe uniform resource name (URN) for the resource in the format do:resource_type:resource_id. (pattern: ^do:(dbaas|domain|droplet|floatingip|loadbalancer|space|volume|kubernetes|vpc):.*, example: do💧13457723)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_list_resources_defaultselectTo list all your resources in your default project, send a GET request to /v2/projects/default/resources.

Only resources that you are authorized to see will be returned. For example, to see Droplets in a project, include the droplet:read scope.
projects_assign_resources_defaultinsertTo assign resources to your default project, send a POST request to /v2/projects/default/resources.

You must have both project:update and <resource>:read scopes to assign new resources. For example, to assign a Droplet to the default project, include both the project:update and droplet:read scopes.

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

SELECT examples

To list all your resources in your default project, send a GET request to /v2/projects/default/resources.

Only resources that you are authorized to see will be returned. For example, to see Droplets in a project, include the droplet:read scope.

SELECT
assigned_at,
links,
status,
urn
FROM digitalocean.projects.default_resources;

INSERT examples

To assign resources to your default project, send a POST request to /v2/projects/default/resources.

You must have both project:update and <resource>:read scopes to assign new resources. For example, to assign a Droplet to the default project, include both the project:update and droplet:read scopes.

INSERT INTO digitalocean.projects.default_resources (
data__resources
)
SELECT
'{{ resources }}'
RETURNING
resources
;