Skip to main content

resources

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

Overview

Nameresources
TypeResource
Iddigitalocean.addons.resources

Fields

The following fields are returned by SELECT queries:

The response will be a JSON object with a key called resource.

NameDatatypeDescription
namestringThe name of the addon resource. (title: name, example: my-resource-01)
app_namestringThe name of the application associated with the resource. (title: app_name, example: Example App)
plan_namestringThe name of the plan associated with the resource. (title: plan_name, example: Basic Plan)
app_slugstringThe slug identifier for the application associated with the resource. (title: app_slug, example: example_app)
has_configbooleanIndicates if the resource has configuration values set by the vendor. (title: has_config)
messagestringA message related to the resource, if applicable. (title: message, example: Resource is provisioned successfully.)
metadataarrayMetadata associated with the resource, set by the user. (title: metadata)
plan_price_per_monthintegerThe price of the plan per month in US dollars. (title: plan_price_per_month)
plan_slugstringThe slug identifier for the plan associated with the resource. (title: plan_slug, example: basic_plan)
sso_urlstringThe Single Sign-On URL for the resource, if applicable. (title: sso_url, example: https://example.com/sso)
statestringThe state the resource is currently in. (pending, provisioning, provisioned, deprovisioning, deprovisioned, provisioning-failed, deprovisioning-failed, suspended) (title: state, example: provisioned)
uuidstringThe unique identifier for the addon resource. (title: uuid, example: 123e4567-e89b-12d3-a456-426614174000)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
addons_getselectresource_uuidTo 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_listselectTo fetch all Add-On Resources under your team, send a GET request to /v2/add-ons/saas.
addons_createinsertname, app_slug, plan_slug, metadataTo 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_patchupdateresource_uuid, nameTo 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_planupdateresource_uuid, plan_slugTo 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_deletedeleteresource_uuidTo 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.

NameDatatypeDescription
resource_uuidstring (uuid)A unique identifier for the add-on resource. (example: 4de7ac8b-495b-4884-9a69-1050c6793cd6)

SELECT examples

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
;

INSERT examples

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
;

UPDATE examples

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;

DELETE examples

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
;