Skip to main content

domains

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

Overview​

Namedomains
TypeResource
Idovh.email_pro.domains

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
namestringDomain name
task_pending_idintegerPending tasks id (wire: taskPendingId)
cname_to_checkstringCname that will be checked to prove the domain ownership (wire: cnameToCheck)
dkim_diagnosticsobjectDkim selectors and DNS configuration state (wire: dkimDiagnostics)
domain_aliasesarrayList of aliases for this domain (wire: domainAliases)
domain_validatedbooleanDomain validation status (wire: domainValidated)
expected_autodiscover_srvstringExpected SRV record on this domain (wire: expectedAutodiscoverSRV)
expected_mxarrayExpected MX record(s) on this domain (wire: expectedMX)
expected_spfstringExpected SPF record on this domain (wire: expectedSPF)
is_alias_domainbooleanIndicate if this domain is an alias for another domain (wire: isAliasDomain)
mx_is_validbooleanIf true your DNS MX configuration is valid (wire: mxIsValid)
mx_recordarrayDomain MX record configured in DNS (wire: mxRecord)
mx_relaystringIf specified, emails to not existing address will be redirected to that domain (wire: mxRelay)
spf_is_validbooleanSPF record validation passed (wire: spfIsValid)
spf_recordarrayDomain's SPF record configured in the DNS (wire: spfRecord)
srv_is_validbooleanIf true your DNS SRV record is valid (wire: srvIsValid)
srv_recordarrayDomain SRV record configured in DNS (wire: srvRecord)
statestringDomain state (creating, deleting, ok, reopening, suspended, suspending, unknown)
typestringDomain type (authoritative, nonAuthoritative)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectdomain_name, serviceReturns the type and state of the domain, its MX, SRV and SPF records with their validation status, the expected records, its DKIM diagnostics, its MX relay and its aliases. (Alpha version)
listselectservicestate, x_pagination_modeReturns the names of the domains attached to the service. Filter them by state, such as ok or suspended. (Alpha version)
createinsertservice, name, typeAdd a domain. Adds an authoritative or nonAuthoritative domain to the service and returns the task. For a domain hosted by OVHcloud, the MX, autodiscover SRV, SPF and DKIM records can be configured automatically.
updateupdatedomain_name, serviceUpdate a domain. Updates the type of the domain, authoritative or nonAuthoritative, and its mxRelay, the domain that receives the emails sent to addresses that do not exist.
deletedeletedomain_name, serviceRemove a domain. Detaches the domain from the Email Pro service, which no longer serves email addresses on it, and returns the task.

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"}})
domain_namestringDomain name (wire: domainName)
servicestringThe internal name of your pro organization
statestringFilter the value of state property (=)
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 the type and state of the domain, its MX, SRV and SPF records with their validation status, the expected records, its DKIM diagnostics, its MX relay and its aliases. (Alpha version)

SELECT
name,
task_pending_id,
cname_to_check,
dkim_diagnostics,
domain_aliases,
domain_validated,
expected_autodiscover_srv,
expected_mx,
expected_spf,
is_alias_domain,
mx_is_valid,
mx_record,
mx_relay,
spf_is_valid,
spf_record,
srv_is_valid,
srv_record,
state,
type
FROM ovh.email_pro.domains
WHERE domain_name = '{{ domain_name }}' -- required
AND service = '{{ service }}' -- required
;

INSERT examples​

Add a domain. Adds an authoritative or nonAuthoritative domain to the service and returns the task. For a domain hosted by OVHcloud, the MX, autodiscover SRV, SPF and DKIM records can be configured automatically.

INSERT INTO ovh.email_pro.domains (
auto_enable_dkim,
configure_autodiscover,
configure_dkim,
configure_mx,
configure_spf,
mx_relay,
name,
type,
service
)
SELECT
{{ auto_enable_dkim }},
{{ configure_autodiscover }},
{{ configure_dkim }},
{{ configure_mx }},
{{ configure_spf }},
'{{ mx_relay }}',
'{{ name }}' /* required */,
'{{ type }}' /* required */,
'{{ service }}'
RETURNING
id,
finish_date,
function,
status,
todo_date
;

UPDATE examples​

Update a domain. Updates the type of the domain, authoritative or nonAuthoritative, and its mxRelay, the domain that receives the emails sent to addresses that do not exist.

UPDATE ovh.email_pro.domains
SET
mx_relay = '{{ mx_relay }}',
type = '{{ type }}'
WHERE
domain_name = '{{ domain_name }}' --required
AND service = '{{ service }}' --required;

DELETE examples​

Remove a domain. Detaches the domain from the Email Pro service, which no longer serves email addresses on it, and returns the task.

DELETE FROM ovh.email_pro.domains
WHERE domain_name = '{{ domain_name }}' --required
AND service = '{{ service }}' --required
;