Skip to main content

records

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

Overview

Namerecords
TypeResource
Iddigitalocean.domains.records

Fields

NameDatatypeDescription
column_anon``

Methods

NameAccessible byRequired ParamsDescription
domains_get_recordSELECTdomain_name, domain_record_idTo retrieve a specific domain record, send a GET request to /v2/domains/$DOMAIN_NAME/records/$RECORD_ID.
domains_list_recordsSELECTdomain_nameTo get a listing of all records configured for a domain, send a GET request to /v2/domains/$DOMAIN_NAME/records. The list of records returned can be filtered by using the name and type query parameters. For example, to only include A records for a domain, send a GET request to /v2/domains/$DOMAIN_NAME/records?type=A. name must be a fully qualified record name. For example, to only include records matching sub.example.com, send a GET request to /v2/domains/$DOMAIN_NAME/records?name=sub.example.com. Both name and type may be used together.
domains_create_recordINSERTdomain_nameTo create a new record to a domain, send a POST request to /v2/domains/$DOMAIN_NAME/records. The request must include all of the required fields for the domain record type being added. See the attribute table for details regarding record types and their respective required attributes.
domains_delete_recordDELETEdomain_name, domain_record_idTo delete a record for a domain, send a DELETE request to /v2/domains/$DOMAIN_NAME/records/$DOMAIN_RECORD_ID. The record will be deleted and the response status will be a 204. This indicates a successful request with no body returned.
domains_patch_recordUPDATEdomain_name, domain_record_id, data__typeTo update an existing record, send a PATCH request to /v2/domains/$DOMAIN_NAME/records/$DOMAIN_RECORD_ID. Any attribute valid for the record type can be set to a new value for the record. See the attribute table for details regarding record types and their respective attributes.
domains_update_recordEXECdomain_name, domain_record_id, data__typeTo update an existing record, send a PUT request to /v2/domains/$DOMAIN_NAME/records/$DOMAIN_RECORD_ID. Any attribute valid for the record type can be set to a new value for the record. See the attribute table for details regarding record types and their respective attributes.

SELECT examples

To get a listing of all records configured for a domain, send a GET request to /v2/domains/$DOMAIN_NAME/records. The list of records returned can be filtered by using the name and type query parameters. For example, to only include A records for a domain, send a GET request to /v2/domains/$DOMAIN_NAME/records?type=A. name must be a fully qualified record name. For example, to only include records matching sub.example.com, send a GET request to /v2/domains/$DOMAIN_NAME/records?name=sub.example.com. Both name and type may be used together.

SELECT
column_anon
FROM digitalocean.domains.records
WHERE domain_name = '{{ domain_name }}';

INSERT example

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

/*+ create */
INSERT INTO digitalocean.domains.records (
data__type,
data__name,
data__data,
data__priority,
data__port,
data__ttl,
data__weight,
data__flags,
data__tag,
domain_name
)
SELECT
'{{ type }}',
'{{ name }}',
'{{ data }}',
'{{ priority }}',
'{{ port }}',
'{{ ttl }}',
'{{ weight }}',
'{{ flags }}',
'{{ tag }}',
'{{ domain_name }}'
;

UPDATE example

Updates a records resource.

/*+ update */
UPDATE digitalocean.domains.records
SET
type = '{{ type }}',
name = '{{ name }}',
data = '{{ data }}',
priority = '{{ priority }}',
port = '{{ port }}',
ttl = '{{ ttl }}',
weight = '{{ weight }}',
flags = '{{ flags }}',
tag = '{{ tag }}'
WHERE
domain_name = '{{ domain_name }}'
AND domain_record_id = '{{ domain_record_id }}'
AND data__type = '{{ data__type }}';

DELETE example

Deletes the specified records resource.

/*+ delete */
DELETE FROM digitalocean.domains.records
WHERE domain_name = '{{ domain_name }}'
AND domain_record_id = '{{ domain_record_id }}';