records
Creates, updates, deletes, gets or lists a records
resource.
Overview
Name | records |
Type | Resource |
Id | digitalocean.domains.records |
Fields
Name | Datatype | Description |
---|---|---|
column_anon | `` |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
domains_get_record | SELECT | domain_name, domain_record_id | To retrieve a specific domain record, send a GET request to /v2/domains/$DOMAIN_NAME/records/$RECORD_ID . |
domains_list_records | SELECT | domain_name | 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. |
domains_create_record | INSERT | domain_name | To 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_record | DELETE | domain_name, domain_record_id | To 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_record | UPDATE | domain_name, domain_record_id, data__type | To 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_record | EXEC | domain_name, domain_record_id, data__type | To 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.
- Required Properties
- All Properties
- Manifest
/*+ 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 }}'
;
/*+ create */
INSERT INTO digitalocean.domains.records (
data__type,
data__name,
data__data,
domain_name
)
SELECT
'{{ type }}',
'{{ name }}',
'{{ data }}',
'{{ domain_name }}'
;
- name: records
props:
- name: domain_name
value: string
- name: type
value: string
- name: name
value: string
- name: data
value: string
- name: priority
value: integer
- name: port
value: integer
- name: ttl
value: integer
- name: weight
value: integer
- name: flags
value: integer
- name: tag
value: string
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 }}';