zone_records
Creates, updates, deletes, gets or lists a zone_records resource.
Overview​
| Name | zone_records |
| Type | Resource |
| Id | ovh.domain.zone_records |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
id | integer | Id of the record |
field_type | string | Resource record name (A, AAAA, CAA, CNAME, DKIM, DMARC, DNAME, HTTPS, LOC, MX, NAPTR, NS, PTR, RP, SPF, SRV, SSHFP, SVCB, TLSA, TXT) (wire: fieldType) |
sub_domain | string | Record subDomain (wire: subDomain) |
target | string | Target of the record |
ttl | integer | TTL of the record |
zone | string | Resource record zone |
DNS zone history
| Name | Datatype | Description |
|---|---|---|
id | integer | Id of the record |
field_type | string | Resource record name (A, AAAA, CAA, CNAME, DKIM, DMARC, DNAME, HTTPS, LOC, MX, NAPTR, NS, PTR, RP, SPF, SRV, SSHFP, SVCB, TLSA, TXT) (wire: fieldType) |
sub_domain | string | Record subDomain (wire: subDomain) |
target | string | Target of the record |
ttl | integer | TTL of the record |
zone | string | Resource record zone |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | id, zone_name | Returns a record: type, subdomain, target and TTL. | |
list | select | zone_name | field_type, sub_domain, x_pagination_mode | Returns the identifiers of the zone records. Can be filtered by subdomain and record type. |
create | insert | zone_name, field_type, target | Creates a record in the zone. The change applies after the zone is refreshed. | |
update | update | id, zone_name | Updates the subdomain, target and TTL of a record. The change applies after the zone is refreshed. | |
delete | delete | id, zone_name | Deletes a record from the zone. The change applies after the zone is refreshed. |
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 |
|---|---|---|
api_host | string | The OVHcloud API host. Selected by OVH_ENDPOINT (ovh-eu, ovh-ca or ovh-us; default ovh-eu). (default: api.eu.ovhcloud.com, x-stackQL-envVarSelector: {"envVar":"OVH_ENDPOINT","default":"ovh-eu","values":{"ovh-eu":"api.eu.ovhcloud.com","ovh-ca":"api.ca.ovhcloud.com","ovh-us":"api.us.ovhcloud.com"}}) |
id | integer | Id |
zone_name | string | Zone name (wire: zoneName) |
field_type | string | Filter the value of fieldType property (like) (wire: fieldType) |
sub_domain | string | Filter the value of subDomain property (ilike) (wire: subDomain) |
x_pagination_mode | string | Sent as CachedObjectList-Pages by default so the list returns the full objects rather than their identifiers. (wire: X-Pagination-Mode) |
SELECT examples​
- get
- list
Returns a record: type, subdomain, target and TTL.
SELECT
id,
field_type,
sub_domain,
target,
ttl,
zone
FROM ovh.domain.zone_records
WHERE id = '{{ id }}' -- required
AND zone_name = '{{ zone_name }}' -- required
;
Returns the identifiers of the zone records. Can be filtered by subdomain and record type.
SELECT
id,
field_type,
sub_domain,
target,
ttl,
zone
FROM ovh.domain.zone_records
WHERE zone_name = '{{ zone_name }}' -- required
AND field_type = '{{ field_type }}'
AND sub_domain = '{{ sub_domain }}'
AND x_pagination_mode = '{{ x_pagination_mode }}'
;
INSERT examples​
- create
- Manifest
Creates a record in the zone. The change applies after the zone is refreshed.
INSERT INTO ovh.domain.zone_records (
field_type,
sub_domain,
target,
ttl,
zone_name
)
SELECT
'{{ field_type }}' /* required */,
'{{ sub_domain }}',
'{{ target }}' /* required */,
{{ ttl }},
'{{ zone_name }}'
RETURNING
id,
field_type,
sub_domain,
target,
ttl,
zone
;
# Description fields are for documentation purposes
- name: zone_records
props:
- name: zone_name
value: "{{ zone_name }}"
description: Required parameter for the zone_records resource.
- name: field_type
value: "{{ field_type }}"
description: |
Resource record name
valid_values: ['A', 'AAAA', 'CAA', 'CNAME', 'DKIM', 'DMARC', 'DNAME', 'HTTPS', 'LOC', 'MX', 'NAPTR', 'NS', 'PTR', 'RP', 'SPF', 'SRV', 'SSHFP', 'SVCB', 'TLSA', 'TXT']
- name: sub_domain
value: "{{ sub_domain }}"
description: |
Record subDomain
- name: target
value: "{{ target }}"
description: |
Target of the record
- name: ttl
value: {{ ttl }}
description: |
TTL of the record
UPDATE examples​
- update
Updates the subdomain, target and TTL of a record. The change applies after the zone is refreshed.
UPDATE ovh.domain.zone_records
SET
sub_domain = '{{ sub_domain }}',
target = '{{ target }}',
ttl = {{ ttl }}
WHERE
id = '{{ id }}' --required
AND zone_name = '{{ zone_name }}' --required;
DELETE examples​
- delete
Deletes a record from the zone. The change applies after the zone is refreshed.
DELETE FROM ovh.domain.zone_records
WHERE id = '{{ id }}' --required
AND zone_name = '{{ zone_name }}' --required
;