domains
Creates, updates, deletes, gets or lists a domains resource.
Overview​
| Name | domains |
| Type | Resource |
| Id | ovh.email_pro.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 tasks id (wire: taskPendingId) |
cname_to_check | string | Cname that will be checked to prove the domain ownership (wire: cnameToCheck) |
dkim_diagnostics | object | Dkim selectors and DNS configuration state (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) |
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) |
spf_is_valid | boolean | SPF record validation passed (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, ok, reopening, suspended, suspending, unknown) |
type | string | Domain type (authoritative, nonAuthoritative) |
Domain
| Name | Datatype | Description |
|---|---|---|
name | string | Domain name |
task_pending_id | integer | Pending tasks id (wire: taskPendingId) |
cname_to_check | string | Cname that will be checked to prove the domain ownership (wire: cnameToCheck) |
dkim_diagnostics | object | Dkim selectors and DNS configuration state (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) |
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) |
spf_is_valid | boolean | SPF record validation passed (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, ok, reopening, suspended, suspending, unknown) |
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, service | 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) | |
list | select | service | state, x_pagination_mode | Returns the names of the domains attached to the service. Filter them by state, such as ok or suspended. (Alpha version) |
create | insert | service, name, type | 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. | |
update | update | domain_name, service | 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. | |
delete | delete | domain_name, service | Remove 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.
| 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"}}) |
domain_name | string | Domain name (wire: domainName) |
service | string | The internal name of your pro organization |
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
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
;
Returns the names of the domains attached to the service. Filter them by state, such as ok or suspended. (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 service = '{{ service }}' -- required
AND state = '{{ state }}'
AND x_pagination_mode = '{{ x_pagination_mode }}'
;
INSERT examples​
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: domains
props:
- name: service
value: "{{ service }}"
description: Required parameter for the 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: 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: 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, 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​
- delete
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
;