Skip to main content

defaults

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

Overview

Namedefaults
TypeResource
Iddigitalocean.projects.defaults

Fields

The following fields are returned by SELECT queries:

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

NameDatatypeDescription
idstring (uuid)The unique universal identifier of this project. (example: 4e1bfbc3-dc3e-41f2-a18f-1b4d7ba71679)
namestringThe human-readable name for the project. The maximum length is 175 characters and the name must be unique. (example: my-web-api)
owner_idintegerThe integer id of the project owner.
created_atstring (date-time)A time value given in ISO8601 combined date and time format that represents when the project was created. (example: 2018-09-27T20:10:35Z)
descriptionstringThe description of the project. The maximum length is 255 characters. (example: My website API)
environmentstringThe environment of the project's resources. (example: Production)
is_defaultbooleanIf true, all resources will be added to this project if no project is specified.
owner_uuidstringThe unique universal identifier of the project owner. (example: 99525febec065ca37b2ffe4f852fd2b2581895e7)
purposestringThe purpose of the project. The maximum length is 255 characters. It can have one of the following values: - Just trying out DigitalOcean - Class project / Educational purposes - Website or blog - Web Application - Service or API - Mobile Application - Machine learning / AI / Data processing - IoT - Operational / Developer tooling If another value for purpose is specified, for example, "your custom purpose", your purpose will be stored as Other: your custom purpose. (example: Service or API)
updated_atstring (date-time)A time value given in ISO8601 combined date and time format that represents when the project was updated. (example: 2018-09-27T20:10:35Z)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_get_defaultselectTo get your default project, send a GET request to /v2/projects/default.
projects_patch_defaultupdateTo update only specific attributes of your default project, send a PATCH request to /v2/projects/default. At least one of the following attributes needs to be sent.
projects_update_defaultreplacedata__name, data__description, data__purpose, data__environment, data__is_defaultTo update you default project, send a PUT request to /v2/projects/default. All of the following attributes must be sent.

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 get your default project, send a GET request to /v2/projects/default.

SELECT
id,
name,
owner_id,
created_at,
description,
environment,
is_default,
owner_uuid,
purpose,
updated_at
FROM digitalocean.projects.defaults;

UPDATE examples

To update only specific attributes of your default project, send a PATCH request to /v2/projects/default. At least one of the following attributes needs to be sent.

UPDATE digitalocean.projects.defaults
SET
data__name = '{{ name }}',
data__description = '{{ description }}',
data__purpose = '{{ purpose }}',
data__environment = '{{ environment }}',
data__is_default = {{ is_default }}
WHERE

RETURNING
project;

REPLACE examples

To update you default project, send a PUT request to /v2/projects/default. All of the following attributes must be sent.

REPLACE digitalocean.projects.defaults
SET
data__name = '{{ name }}',
data__description = '{{ description }}',
data__purpose = '{{ purpose }}',
data__environment = '{{ environment }}',
data__is_default = {{ is_default }}
WHERE
data__name = '{{ name }}' --required
AND data__description = '{{ description }}' --required
AND data__purpose = '{{ purpose }}' --required
AND data__environment = '{{ environment }}' --required
AND data__is_default = {{ is_default }} --required
RETURNING
project;