Skip to main content

domains

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

Overview​

Namedomains
TypeResource
Idovh.cdn_dedicated.domains

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
cache_rule_useinteger (wire: cacheRuleUse)
cnamestring
domainstringDomain of this object
statusstringAll states a status can be in (error, off, on, removing)
typestringAll type of Domain (plain, ssl)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectdomain, service_nameGet a domain
listselectservice_namex_pagination_modeList domains
createinsertservice_name, domainCreate a domain
updateupdatedomain, service_nameUpdate a domain
deletedeletedomain, service_nameDelete a domain
flushexecdomain, serviceNameFlush the domain cache
logsexecdomain, serviceNameGenerate a domain real time logs URL (Beta version)

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 of this object
serviceNamestringThe internal name of your CDN offer
service_namestringThe internal name of your CDN offer (wire: serviceName)
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

SELECT
cache_rule_use,
cname,
domain,
status,
type
FROM ovh.cdn_dedicated.domains
WHERE domain = '{{ domain }}' -- required
AND service_name = '{{ service_name }}' -- required
;

INSERT examples​

Create a domain

INSERT INTO ovh.cdn_dedicated.domains (
domain,
service_name
)
SELECT
'{{ domain }}' /* required */,
'{{ service_name }}'
RETURNING
cache_rule_use,
cname,
domain,
status,
type
;

UPDATE examples​

Update a domain

UPDATE ovh.cdn_dedicated.domains
SET
status = '{{ status }}'
WHERE
domain = '{{ domain }}' --required
AND service_name = '{{ service_name }}' --required;

DELETE examples​

Delete a domain

DELETE FROM ovh.cdn_dedicated.domains
WHERE domain = '{{ domain }}' --required
AND service_name = '{{ service_name }}' --required
;

Lifecycle Methods​

EXEC variables use wire (API) names.

Flush the domain cache

EXEC ovh.cdn_dedicated.domains.flush
@domain='{{ domain }}' --required,
@serviceName='{{ serviceName }}' --required
;