resources
Creates, updates, deletes, gets or lists a resources resource.
Overview
| Name | resources |
| Type | Resource |
| Id | digitalocean.addons.resources |
Fields
The following fields are returned by SELECT queries:
- addons_get
- addons_list
The response will be a JSON object with a key called resource.
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the addon resource. (title: name, example: my-resource-01) |
app_name | string | The name of the application associated with the resource. (title: app_name, example: Example App) |
plan_name | string | The name of the plan associated with the resource. (title: plan_name, example: Basic Plan) |
app_slug | string | The slug identifier for the application associated with the resource. (title: app_slug, example: example_app) |
has_config | boolean | Indicates if the resource has configuration values set by the vendor. (title: has_config) |
message | string | A message related to the resource, if applicable. (title: message, example: Resource is provisioned successfully.) |
metadata | array | Metadata associated with the resource, set by the user. (title: metadata) |
plan_price_per_month | integer | The price of the plan per month in US dollars. (title: plan_price_per_month) |
plan_slug | string | The slug identifier for the plan associated with the resource. (title: plan_slug, example: basic_plan) |
sso_url | string | The Single Sign-On URL for the resource, if applicable. (title: sso_url, example: https://example.com/sso) |
state | string | The state the resource is currently in. (pending, provisioning, provisioned, deprovisioning, deprovisioned, provisioning-failed, deprovisioning-failed, suspended) (title: state, example: provisioned) |
uuid | string | The unique identifier for the addon resource. (title: uuid, example: 123e4567-e89b-12d3-a456-426614174000) |
The response will be an array of JSON objects with a key called resources.
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the addon resource. (title: name, example: my-resource-01) |
app_name | string | The name of the application associated with the resource. (title: app_name, example: Example App) |
plan_name | string | The name of the plan associated with the resource. (title: plan_name, example: Basic Plan) |
app_slug | string | The slug identifier for the application associated with the resource. (title: app_slug, example: example_app) |
has_config | boolean | Indicates if the resource has configuration values set by the vendor. (title: has_config) |
message | string | A message related to the resource, if applicable. (title: message, example: Resource is provisioned successfully.) |
metadata | array | Metadata associated with the resource, set by the user. (title: metadata) |
plan_price_per_month | integer | The price of the plan per month in US dollars. (title: plan_price_per_month) |
plan_slug | string | The slug identifier for the plan associated with the resource. (title: plan_slug, example: basic_plan) |
sso_url | string | The Single Sign-On URL for the resource, if applicable. (title: sso_url, example: https://example.com/sso) |
state | string | The state the resource is currently in. (pending, provisioning, provisioned, deprovisioning, deprovisioned, provisioning-failed, deprovisioning-failed, suspended) (title: state, example: provisioned) |
uuid | string | The unique identifier for the addon resource. (title: uuid, example: 123e4567-e89b-12d3-a456-426614174000) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
addons_get | select | resource_uuid | To fetch details of a specific Add-On Resource, send a GET request to /v2/add-ons/saas/{resource_uuid}.Replace {resource_uuid} with the UUID of the resource you want to retrieve. | |
addons_list | select | To fetch all Add-On Resources under your team, send a GET request to /v2/add-ons/saas. | ||
addons_create | insert | name, app_slug, plan_slug, metadata | To create an add-on resource, send a POST request to /v2/add-ons/saas with required parameters.Some add-ons require additional metadata to be provided in the request body. To find out what metadata is required for a specific add-on, send a GET request to /v2/add-ons/apps/{app_slug}/metadata. | |
addons_patch | update | resource_uuid, name | To change the name of an Add-On Resource, send a PATCH request to /v2/add-ons/saas/{resource_uuid}.Replace {resource_uuid} with the UUID of the resource for which you want to change the name. | |
addons_patch_plan | update | resource_uuid, plan_slug | To change the plan associated with an Add-On Resource, send a PATCH request to /v2/add-ons/saas/{resource_uuid}/plan.Replace {resource_uuid} with the UUID of the resource for which you want to change the plan. | |
addons_delete | delete | resource_uuid | To delete an add-on resource, send a DELETE request to /v2/add-ons/saas/{resource_uuid} with the UUID of the resource to delete. You cannot retrieve the resource after it has been deleted. The response indicates a request was sent to the 3rd party add-on provider to delete the resource. You will no longer be billed for this resource. |
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 |
|---|---|---|
resource_uuid | string (uuid) | A unique identifier for the add-on resource. (example: 4de7ac8b-495b-4884-9a69-1050c6793cd6) |
SELECT examples
- addons_get
- addons_list
To fetch details of a specific Add-On Resource, send a GET request to /v2/add-ons/saas/{resource_uuid}.
Replace {resource_uuid} with the UUID of the resource you want to retrieve.
SELECT
name,
app_name,
plan_name,
app_slug,
has_config,
message,
metadata,
plan_price_per_month,
plan_slug,
sso_url,
state,
uuid
FROM digitalocean.addons.resources
WHERE resource_uuid = '{{ resource_uuid }}' -- required
;
To fetch all Add-On Resources under your team, send a GET request to /v2/add-ons/saas.
SELECT
name,
app_name,
plan_name,
app_slug,
has_config,
message,
metadata,
plan_price_per_month,
plan_slug,
sso_url,
state,
uuid
FROM digitalocean.addons.resources
;
INSERT examples
- addons_create
- Manifest
To create an add-on resource, send a POST request to /v2/add-ons/saas with required parameters.
Some add-ons require additional metadata to be provided in the request body. To find out
what metadata is required for a specific add-on, send a GET request to /v2/add-ons/apps/{app_slug}/metadata.
INSERT INTO digitalocean.addons.resources (
app_slug,
plan_slug,
name,
metadata,
linked_droplet_id,
fleet_uuid
)
SELECT
'{{ app_slug }}' /* required */,
'{{ plan_slug }}' /* required */,
'{{ name }}' /* required */,
'{{ metadata }}' /* required */,
{{ linked_droplet_id }},
'{{ fleet_uuid }}'
RETURNING
resource
;
# Description fields are for documentation purposes
- name: resources
props:
- name: app_slug
value: "{{ app_slug }}"
description: |
The slug identifier for the application associated with the resource.
- name: plan_slug
value: "{{ plan_slug }}"
description: |
The slug identifier for the plan associated with the resource.
- name: name
value: "{{ name }}"
description: |
The name of the addon resource.
- name: metadata
description: |
Metadata associated with the resource, set by the user. Metadata expected varies per app, and can be verified with a GET request to "/v2/add-ons/apps/{app_slug}/metadata"
value:
- name: "{{ name }}"
value: "{{ value }}"
- name: linked_droplet_id
value: {{ linked_droplet_id }}
description: |
ID of the droplet to be linked to this resource, if applicable.
- name: fleet_uuid
value: "{{ fleet_uuid }}"
description: |
UUID of the fleet/project to which this resource will belong.
UPDATE examples
- addons_patch
- addons_patch_plan
To change the name of an Add-On Resource, send a PATCH request to /v2/add-ons/saas/{resource_uuid}.
Replace {resource_uuid} with the UUID of the resource for which you want to change the name.
UPDATE digitalocean.addons.resources
SET
name = '{{ name }}'
WHERE
resource_uuid = '{{ resource_uuid }}' --required
AND name = '{{ name }}' --required
RETURNING
resource;
To change the plan associated with an Add-On Resource, send a PATCH request to /v2/add-ons/saas/{resource_uuid}/plan.
Replace {resource_uuid} with the UUID of the resource for which you want to change the plan.
UPDATE digitalocean.addons.resources
SET
plan_slug = '{{ plan_slug }}'
WHERE
resource_uuid = '{{ resource_uuid }}' --required
AND plan_slug = '{{ plan_slug }}' --required
RETURNING
resource;
DELETE examples
- addons_delete
To delete an add-on resource, send a DELETE request to /v2/add-ons/saas/{resource_uuid} with the UUID of the resource to delete.
You cannot retrieve the resource after it has been deleted. The response indicates a request was sent to the 3rd party add-on provider to delete the resource.
You will no longer be billed for this resource.
DELETE FROM digitalocean.addons.resources
WHERE resource_uuid = '{{ resource_uuid }}' --required
;