Skip to main content

attached_domains

Creates, updates, deletes, gets or lists an attached_domains resource.

Overview​

Nameattached_domains
TypeResource
Idovh.hosting_web.attached_domains

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
runtime_idintegerThe runtime configuration ID used on this domain (wire: runtimeId)
task_idintegerThe task ID working on this domain (wire: taskId)
capabilitiesarrayProvides the capabilities related to your attachedDomain
cdnstringwhether or not attachedDomain is linked to the hosting cdn (active, none)
domainstringDomain linked (fqdn)
firewallstringFirewall state for this path (active, none)
ip_locationstringIP location of the domain linked (BE, CA, CZ, DE, ES, FI, FR, IE, IT, LT, NL, PL, PT, UK) (wire: ipLocation)
is_flushablebooleanWhether your CDN can be flushed (wire: isFlushable)
own_logstringDomain for separate the logs (wire: ownLog)
pathstringAttached domain path
sslbooleanPut domain in SSL certificate
statusstringDomain status (created, creating, deleting, updating)
vcs_statusstringThe status of the VCS synchronization (created, creating, deleting, deploying, disabled, error, initialError) (wire: vcsStatus)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectdomain, service_nameReturns the path, CDN, firewall, SSL, IP location and status of the attached domain.
list_by_service_nameselectservice_namedomain, path, x_pagination_modeReturns the domains and subdomains attached to the hosting. Filter them by domain or path.
listselectdomainReturns the service names of the hostings that have the given domain attached.
createinsertservice_nameAttaches a domain to a folder of the hosting, with its CDN, firewall, SSL and IP location settings, and returns the task. Set bypassDNSConfiguration to true to leave the DNS zone unchanged.
updateupdatedomain, service_nameUpdates the path, CDN, firewall, SSL, IP location or log domain of the attached domain.
deletedeletedomain, service_namebypass_dns_configurationDetaches the domain from the hosting and returns the task. Set bypassDNSConfiguration to true to leave the DNS zone unchanged.
purge_cacheexecdomain, serviceNamePurge the attached domain cache. Purges the CDN cache of the attached domain and returns the task. Available when isFlushable is true on the attached domain.
restartexecdomain, serviceNameRestart the attached domain virtual host. Restarts the virtual host serving the attached domain 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"}})
domainstringDomain linked (fqdn)
serviceNamestringThe internal name of your hosting
service_namestringService name (wire: serviceName)
bypass_dns_configurationbooleanIf set to true, DNS zone will not be updated by the operation (wire: bypassDNSConfiguration)
domainstringFilter the value of domain property (like)
pathstringFilter the value of path property (like)
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 path, CDN, firewall, SSL, IP location and status of the attached domain.

SELECT
runtime_id,
task_id,
capabilities,
cdn,
domain,
firewall,
ip_location,
is_flushable,
own_log,
path,
ssl,
status,
vcs_status
FROM ovh.hosting_web.attached_domains
WHERE domain = '{{ domain }}' -- required
AND service_name = '{{ service_name }}' -- required
;

INSERT examples​

Attaches a domain to a folder of the hosting, with its CDN, firewall, SSL and IP location settings, and returns the task. Set bypassDNSConfiguration to true to leave the DNS zone unchanged.

INSERT INTO ovh.hosting_web.attached_domains (
bypass_dns_configuration,
cdn,
domain,
firewall,
ip_location,
own_log,
path,
runtime_id,
ssl,
service_name
)
SELECT
{{ bypass_dns_configuration }},
'{{ cdn }}',
'{{ domain }}',
'{{ firewall }}',
'{{ ip_location }}',
'{{ own_log }}',
'{{ path }}',
{{ runtime_id }},
{{ ssl }},
'{{ service_name }}'
RETURNING
id,
object_id,
done_date,
function,
last_update,
object_type,
start_date,
status
;

UPDATE examples​

Updates the path, CDN, firewall, SSL, IP location or log domain of the attached domain.

UPDATE ovh.hosting_web.attached_domains
SET
bypass_dns_configuration = {{ bypass_dns_configuration }},
cdn = '{{ cdn }}',
domain = '{{ domain }}',
firewall = '{{ firewall }}',
ip_location = '{{ ip_location }}',
own_log = '{{ own_log }}',
path = '{{ path }}',
runtime_id = {{ runtime_id }},
ssl = {{ ssl }}
WHERE
domain = '{{ domain }}' --required
AND service_name = '{{ service_name }}' --required;

DELETE examples​

Detaches the domain from the hosting and returns the task. Set bypassDNSConfiguration to true to leave the DNS zone unchanged.

DELETE FROM ovh.hosting_web.attached_domains
WHERE domain = '{{ domain }}' --required
AND service_name = '{{ service_name }}' --required
AND bypass_dns_configuration = '{{ bypass_dns_configuration }}'
;

Lifecycle Methods​

EXEC variables use wire (API) names.

Purge the attached domain cache. Purges the CDN cache of the attached domain and returns the task. Available when isFlushable is true on the attached domain.

EXEC ovh.hosting_web.attached_domains.purge_cache
@domain='{{ domain }}' --required,
@serviceName='{{ serviceName }}' --required
;