Skip to main content

zone_records

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

Overview​

Namezone_records
TypeResource
Idovh.domain.zone_records

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
idintegerId of the record
field_typestringResource 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_domainstringRecord subDomain (wire: subDomain)
targetstringTarget of the record
ttlintegerTTL of the record
zonestringResource record zone

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectid, zone_nameReturns a record: type, subdomain, target and TTL.
listselectzone_namefield_type, sub_domain, x_pagination_modeReturns the identifiers of the zone records. Can be filtered by subdomain and record type.
createinsertzone_name, field_type, targetCreates a record in the zone. The change applies after the zone is refreshed.
updateupdateid, zone_nameUpdates the subdomain, target and TTL of a record. The change applies after the zone is refreshed.
deletedeleteid, zone_nameDeletes 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.

NameDatatypeDescription
api_hoststringThe 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"}})
idintegerId
zone_namestringZone name (wire: zoneName)
field_typestringFilter the value of fieldType property (like) (wire: fieldType)
sub_domainstringFilter the value of subDomain property (ilike) (wire: subDomain)
x_pagination_modestringSent as CachedObjectList-Pages by default so the list returns the full objects rather than their identifiers. (wire: X-Pagination-Mode)

SELECT examples​

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
;

INSERT examples​

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
;

UPDATE examples​

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​

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
;