defaults
Creates, updates, deletes, gets or lists a defaults
resource.
Overview
Name | defaults |
Type | Resource |
Id | digitalocean.projects.defaults |
Fields
The following fields are returned by SELECT
queries:
- projects_get_default
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
Name | Datatype | Description |
---|---|---|
id | string (uuid) | The unique universal identifier of this project. (example: 4e1bfbc3-dc3e-41f2-a18f-1b4d7ba71679) |
name | string | The human-readable name for the project. The maximum length is 175 characters and the name must be unique. (example: my-web-api) |
owner_id | integer | The integer id of the project owner. |
created_at | string (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) |
description | string | The description of the project. The maximum length is 255 characters. (example: My website API) |
environment | string | The environment of the project's resources. (example: Production) |
is_default | boolean | If true, all resources will be added to this project if no project is specified. |
owner_uuid | string | The unique universal identifier of the project owner. (example: 99525febec065ca37b2ffe4f852fd2b2581895e7) |
purpose | string | The 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_at | string (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:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
projects_get_default | select | To get your default project, send a GET request to /v2/projects/default . | ||
projects_patch_default | update | 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. | ||
projects_update_default | replace | data__name , data__description , data__purpose , data__environment , data__is_default | To 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.
Name | Datatype | Description |
---|
SELECT
examples
- projects_get_default
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
- projects_patch_default
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
- projects_update_default
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;