Skip to main content

service_domains

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

Overview​

Nameservice_domains
TypeResource
Idovh.email_exchange.service_domains

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
namestringDomain name
task_pending_idintegerPending taks id (wire: taskPendingId)
cname_to_checkstringCname that will be checked to prove the domain ownership (wire: cnameToCheck)
dkim_diagnosticsobjectDKIM diagnostics on this domain (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)
mainbooleanIf true this is an organization (Exchange 2010 only)
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)
organization_2010stringIf specified, indicates to which organization this domain belongs (Exchange 2010 only) (wire: organization2010)
sbr_defaultstringRelay domain address that will be used to all newly created accounts (wire: sbrDefault)
send_connector_id_defaultintegerSend connector id that will be used to all newly created accounts (wire: sendConnectorIdDefault)
spf_is_validbooleanWether your SPF record is valid (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, internalMigration, ok, reopening, suspended, suspending)
typestringDomain type (authoritative, nonAuthoritative)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectdomain_name, exchange_service, organization_nameGet a domain. Returns the type, state and validation status of the domain, its expected and configured MX, SPF and SRV records, and its DKIM diagnostics.
listselectexchange_service, organization_namemain, state, x_pagination_modeList domains. Returns the names of the domains of the service. Filter them by state, or set main to get the main domain only.
createinsertexchange_service, organization_name, name, typeAdd a domain. Adds an authoritative or non-authoritative domain to the service and returns the task. For a domain hosted by OVHcloud, the MX, SPF, autodiscover and DKIM records can be configured automatically.
updateupdatedomain_name, exchange_service, organization_nameUpdate a domain. Updates the type of the domain and mxRelay, the domain that receives the emails sent to addresses that do not exist.
deletedeletedomain_name, exchange_service, organization_nameRemove a domain. Detaches the domain from the Exchange service, which no longer serves email addresses on it, and returns the task.
change_default_sbrexecdomainName, exchangeService, organizationNameChange the default sender-based routing. Sets the destination domain (sbrDefault) and the send connector (sendConnectorIdDefault) applied to all new accounts of the domain.

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"}})
domainNamestringDomain name
domain_namestringDomain name (wire: domainName)
exchangeServicestringThe internal name of your exchange service
exchange_servicestringThe internal name of your exchange service (wire: exchangeService)
organizationNamestringThe internal name of your exchange organization
organization_namestringThe internal name of your exchange organization (wire: organizationName)
mainbooleanFilter the value of main property (like)
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​

Get a domain. Returns the type, state and validation status of the domain, its expected and configured MX, SPF and SRV records, and its DKIM diagnostics.

SELECT
name,
task_pending_id,
cname_to_check,
dkim_diagnostics,
domain_aliases,
domain_validated,
expected_autodiscover_srv,
expected_mx,
expected_spf,
is_alias_domain,
main,
mx_is_valid,
mx_record,
mx_relay,
organization_2010,
sbr_default,
send_connector_id_default,
spf_is_valid,
spf_record,
srv_is_valid,
srv_record,
state,
type
FROM ovh.email_exchange.service_domains
WHERE domain_name = '{{ domain_name }}' -- required
AND exchange_service = '{{ exchange_service }}' -- required
AND organization_name = '{{ organization_name }}' -- required
;

INSERT examples​

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

INSERT INTO ovh.email_exchange.service_domains (
auto_enable_dkim,
configure_autodiscover,
configure_dkim,
configure_mx,
configure_spf,
main,
mx_relay,
name,
organization_2010,
sbr_default,
send_connector_id_default,
type,
exchange_service,
organization_name
)
SELECT
{{ auto_enable_dkim }},
{{ configure_autodiscover }},
{{ configure_dkim }},
{{ configure_mx }},
{{ configure_spf }},
{{ main }},
'{{ mx_relay }}',
'{{ name }}' /* required */,
'{{ organization_2010 }}',
'{{ sbr_default }}',
{{ send_connector_id_default }},
'{{ type }}' /* required */,
'{{ exchange_service }}',
'{{ organization_name }}'
RETURNING
id,
finish_date,
function,
status,
todo_date
;

UPDATE examples​

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

UPDATE ovh.email_exchange.service_domains
SET
mx_relay = '{{ mx_relay }}',
type = '{{ type }}'
WHERE
domain_name = '{{ domain_name }}' --required
AND exchange_service = '{{ exchange_service }}' --required
AND organization_name = '{{ organization_name }}' --required;

DELETE examples​

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

DELETE FROM ovh.email_exchange.service_domains
WHERE domain_name = '{{ domain_name }}' --required
AND exchange_service = '{{ exchange_service }}' --required
AND organization_name = '{{ organization_name }}' --required
;

Lifecycle Methods​

EXEC variables use wire (API) names.

Change the default sender-based routing. Sets the destination domain (sbrDefault) and the send connector (sendConnectorIdDefault) applied to all new accounts of the domain.

EXEC ovh.email_exchange.service_domains.change_default_sbr
@domainName='{{ domainName }}' --required,
@exchangeService='{{ exchangeService }}' --required,
@organizationName='{{ organizationName }}' --required
@@json=
'{
"sbrDefault": "{{ sbrDefault }}",
"sendConnectorIdDefault": {{ sendConnectorIdDefault }}
}'
;