service_domains
Creates, updates, deletes, gets or lists a service_domains resource.
Overview​
| Name | service_domains |
| Type | Resource |
| Id | ovh.email_exchange.service_domains |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
name | string | Domain name |
task_pending_id | integer | Pending taks id (wire: taskPendingId) |
cname_to_check | string | Cname that will be checked to prove the domain ownership (wire: cnameToCheck) |
dkim_diagnostics | object | DKIM diagnostics on this domain (wire: dkimDiagnostics) |
domain_aliases | array | List of aliases for this domain (wire: domainAliases) |
domain_validated | boolean | Domain validation status (wire: domainValidated) |
expected_autodiscover_srv | string | Expected SRV record on this domain (wire: expectedAutodiscoverSRV) |
expected_mx | array | Expected MX record(s) on this domain (wire: expectedMX) |
expected_spf | string | Expected SPF record on this domain (wire: expectedSPF) |
is_alias_domain | boolean | Indicate if this domain is an alias for another domain (wire: isAliasDomain) |
main | boolean | If true this is an organization (Exchange 2010 only) |
mx_is_valid | boolean | If true your dns mx configuration is valid (wire: mxIsValid) |
mx_record | array | Domain MX record configured in DNS (wire: mxRecord) |
mx_relay | string | If specified, emails to not existing address will be redirected to that domain (wire: mxRelay) |
organization_2010 | string | If specified, indicates to which organization this domain belongs (Exchange 2010 only) (wire: organization2010) |
sbr_default | string | Relay domain address that will be used to all newly created accounts (wire: sbrDefault) |
send_connector_id_default | integer | Send connector id that will be used to all newly created accounts (wire: sendConnectorIdDefault) |
spf_is_valid | boolean | Wether your SPF record is valid (wire: spfIsValid) |
spf_record | array | Domain's SPF record configured in the DNS (wire: spfRecord) |
srv_is_valid | boolean | If true your dns srv record is valid (wire: srvIsValid) |
srv_record | array | Domain SRV record configured in DNS (wire: srvRecord) |
state | string | Domain state (creating, deleting, internalMigration, ok, reopening, suspended, suspending) |
type | string | Domain type (authoritative, nonAuthoritative) |
Exchange domain
| Name | Datatype | Description |
|---|---|---|
name | string | Domain name |
task_pending_id | integer | Pending taks id (wire: taskPendingId) |
cname_to_check | string | Cname that will be checked to prove the domain ownership (wire: cnameToCheck) |
dkim_diagnostics | object | DKIM diagnostics on this domain (wire: dkimDiagnostics) |
domain_aliases | array | List of aliases for this domain (wire: domainAliases) |
domain_validated | boolean | Domain validation status (wire: domainValidated) |
expected_autodiscover_srv | string | Expected SRV record on this domain (wire: expectedAutodiscoverSRV) |
expected_mx | array | Expected MX record(s) on this domain (wire: expectedMX) |
expected_spf | string | Expected SPF record on this domain (wire: expectedSPF) |
is_alias_domain | boolean | Indicate if this domain is an alias for another domain (wire: isAliasDomain) |
main | boolean | If true this is an organization (Exchange 2010 only) |
mx_is_valid | boolean | If true your dns mx configuration is valid (wire: mxIsValid) |
mx_record | array | Domain MX record configured in DNS (wire: mxRecord) |
mx_relay | string | If specified, emails to not existing address will be redirected to that domain (wire: mxRelay) |
organization_2010 | string | If specified, indicates to which organization this domain belongs (Exchange 2010 only) (wire: organization2010) |
sbr_default | string | Relay domain address that will be used to all newly created accounts (wire: sbrDefault) |
send_connector_id_default | integer | Send connector id that will be used to all newly created accounts (wire: sendConnectorIdDefault) |
spf_is_valid | boolean | Wether your SPF record is valid (wire: spfIsValid) |
spf_record | array | Domain's SPF record configured in the DNS (wire: spfRecord) |
srv_is_valid | boolean | If true your dns srv record is valid (wire: srvIsValid) |
srv_record | array | Domain SRV record configured in DNS (wire: srvRecord) |
state | string | Domain state (creating, deleting, internalMigration, ok, reopening, suspended, suspending) |
type | string | Domain type (authoritative, nonAuthoritative) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | domain_name, exchange_service, organization_name | 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. | |
list | select | exchange_service, organization_name | main, state, x_pagination_mode | List domains. Returns the names of the domains of the service. Filter them by state, or set main to get the main domain only. |
create | insert | exchange_service, organization_name, name, type | 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. | |
update | update | domain_name, exchange_service, organization_name | Update a domain. Updates the type of the domain and mxRelay, the domain that receives the emails sent to addresses that do not exist. | |
delete | delete | domain_name, exchange_service, organization_name | Remove a domain. Detaches the domain from the Exchange service, which no longer serves email addresses on it, and returns the task. | |
change_default_sbr | exec | domainName, exchangeService, organizationName | Change 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.
| 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"}}) |
domainName | string | Domain name |
domain_name | string | Domain name (wire: domainName) |
exchangeService | string | The internal name of your exchange service |
exchange_service | string | The internal name of your exchange service (wire: exchangeService) |
organizationName | string | The internal name of your exchange organization |
organization_name | string | The internal name of your exchange organization (wire: organizationName) |
main | boolean | Filter the value of main property (like) |
state | string | Filter the value of state property (=) |
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
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
;
List domains. Returns the names of the domains of the service. Filter them by state, or set main to get the main domain only.
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 exchange_service = '{{ exchange_service }}' -- required
AND organization_name = '{{ organization_name }}' -- required
AND main = '{{ main }}'
AND state = '{{ state }}'
AND x_pagination_mode = '{{ x_pagination_mode }}'
;
INSERT examples​
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: service_domains
props:
- name: exchange_service
value: "{{ exchange_service }}"
description: Required parameter for the service_domains resource.
- name: organization_name
value: "{{ organization_name }}"
description: Required parameter for the service_domains resource.
- name: auto_enable_dkim
value: {{ auto_enable_dkim }}
description: |
Enable DKIM automatically after DKIM configuration
- name: configure_autodiscover
value: {{ configure_autodiscover }}
description: |
If you host domain in OVH we can configure autodiscover record automatically
- name: configure_dkim
value: {{ configure_dkim }}
description: |
Launch configuration of DKIM automatically for the domain
- name: configure_mx
value: {{ configure_mx }}
description: |
If you host domain in OVH we can configure mx record automatically
- name: configure_spf
value: {{ configure_spf }}
description: |
Enable automatic SPF record (only for domains hosted by OVHcloud)
- name: main
value: {{ main }}
description: |
This newly created domain will be an organization (Exchange 2010 only)
- name: mx_relay
value: "{{ mx_relay }}"
description: |
If specified, emails to not existing address will be redirected to that domain
- name: name
value: "{{ name }}"
description: |
Domain to install on server
- name: organization_2010
value: "{{ organization_2010 }}"
description: |
If specified, indicates which organization this newly created domain will be part of (Exchange 2010 only)
- name: sbr_default
value: "{{ sbr_default }}"
description: |
Default Sender base routing destination domain applied on all new created accounts
- name: send_connector_id_default
value: {{ send_connector_id_default }}
description: |
Default Sender Connector id applied on all new created accounts
- name: type
value: "{{ type }}"
description: |
Type of domain that You want to install
valid_values: ['authoritative', 'nonAuthoritative']
UPDATE examples​
- update
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​
- delete
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_default_sbr
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 }}
}'
;