Skip to main content

endpoints

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

Overview

Nameendpoints
TypeResource
Iddigitalocean.cdn.endpoints

Fields

NameDatatypeDescription
column_anon``

Methods

NameAccessible byRequired ParamsDescription
cdn_get_endpointSELECTcdn_idTo show information about an existing CDN endpoint, send a GET request to /v2/cdn/endpoints/$ENDPOINT_ID.
cdn_list_endpointsSELECTTo list all of the CDN endpoints available on your account, send a GET request to /v2/cdn/endpoints.
cdn_create_endpointINSERTdata__originTo create a new CDN endpoint, send a POST request to /v2/cdn/endpoints. The origin attribute must be set to the fully qualified domain name (FQDN) of a DigitalOcean Space. Optionally, the TTL may be configured by setting the ttl attribute. A custom subdomain may be configured by specifying the custom_domain and certificate_id attributes.
cdn_delete_endpointDELETEcdn_idTo delete a specific CDN endpoint, send a DELETE request to /v2/cdn/endpoints/$ENDPOINT_ID. A status of 204 will be given. This indicates that the request was processed successfully, but that no response body is needed.
cdn_purge_cacheEXECcdn_id, data__filesTo purge cached content from a CDN endpoint, send a DELETE request to /v2/cdn/endpoints/$ENDPOINT_ID/cache. The body of the request should include a files attribute containing a list of cached file paths to be purged. A path may be for a single file or may contain a wildcard (*) to recursively purge all files under a directory. When only a wildcard is provided, all cached files will be purged. There is a rate limit of 50 files per 20 seconds that can be purged. CDN endpoints have a rate limit of 5 requests per 10 seconds. Purging files using a wildcard path counts as a single request against the API's rate limit. Two identical purge requests cannot be sent at the same time.
cdn_update_endpointsEXECcdn_idTo update the TTL, certificate ID, or the FQDN of the custom subdomain for an existing CDN endpoint, send a PUT request to /v2/cdn/endpoints/$ENDPOINT_ID.

SELECT examples

To list all of the CDN endpoints available on your account, send a GET request to /v2/cdn/endpoints.

SELECT
column_anon
FROM digitalocean.cdn.endpoints
;

INSERT example

Use the following StackQL query and manifest file to create a new endpoints resource.

/*+ create */
INSERT INTO digitalocean.cdn.endpoints (
data__origin,
data__ttl,
data__certificate_id,
data__custom_domain
)
SELECT
'{{ origin }}',
'{{ ttl }}',
'{{ certificate_id }}',
'{{ custom_domain }}'
;

DELETE example

Deletes the specified endpoints resource.

/*+ delete */
DELETE FROM digitalocean.cdn.endpoints
WHERE cdn_id = '{{ cdn_id }}';