cdn_domain_options
Creates, updates, deletes, gets or lists a cdn_domain_options resource.
Overview​
| Name | cdn_domain_options |
| Type | Resource |
| Id | ovh.hosting_web.cdn_domain_options |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
name | string | Option name |
config | object | Option configuration |
enabled | boolean | Enable / Disable the option |
extra | object | Additional information about option |
pattern | string | Url pattern |
type | string | Option type (brotli, cache_rule, cors, devmode, geo_headers, hsts, https_redirect, mixed_content, mobile_redirect, prefetch, prewarm, querystring, waf) |
Option details
| Name | Datatype | Description |
|---|---|---|
name | string | Option name |
config | object | Option configuration |
enabled | boolean | Enable / Disable the option |
extra | object | Additional information about option |
pattern | string | Url pattern |
type | string | Option type (brotli, cache_rule, cors, devmode, geo_headers, hsts, https_redirect, mixed_content, mobile_redirect, prefetch, prewarm, querystring, waf) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | domain_name, option_name, service_name | Get details for an option on a domain | |
list | select | domain_name, service_name | List all options for a domain | |
create | insert | domain_name, service_name, enabled, name, type | Add an option on a domain | |
update | update | domain_name, option_name, service_name, enabled, type | Update an option on a domain | |
delete | delete | domain_name, option_name, service_name | Remove or Reset an option to his default value |
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) |
option_name | string | Option name (wire: optionName) |
service_name | string | Service name (wire: serviceName) |
SELECT examples​
- get
- list
Get details for an option on a domain
SELECT
name,
config,
enabled,
extra,
pattern,
type
FROM ovh.hosting_web.cdn_domain_options
WHERE domain_name = '{{ domain_name }}' -- required
AND option_name = '{{ option_name }}' -- required
AND service_name = '{{ service_name }}' -- required
;
List all options for a domain
SELECT
name,
config,
enabled,
extra,
pattern,
type
FROM ovh.hosting_web.cdn_domain_options
WHERE domain_name = '{{ domain_name }}' -- required
AND service_name = '{{ service_name }}' -- required
;
INSERT examples​
- create
- Manifest
Add an option on a domain
INSERT INTO ovh.hosting_web.cdn_domain_options (
config,
enabled,
name,
pattern,
type,
domain_name,
service_name
)
SELECT
'{{ config }}',
{{ enabled }} /* required */,
'{{ name }}' /* required */,
'{{ pattern }}',
'{{ type }}' /* required */,
'{{ domain_name }}',
'{{ service_name }}'
RETURNING
name,
config,
enabled,
extra,
pattern,
type
;
# Description fields are for documentation purposes
- name: cdn_domain_options
props:
- name: domain_name
value: "{{ domain_name }}"
description: Required parameter for the cdn_domain_options resource.
- name: service_name
value: "{{ service_name }}"
description: Required parameter for the cdn_domain_options resource.
- name: config
description: |
Option configuration
value:
destination: "{{ destination }}"
followUri: {{ followUri }}
origins: "{{ origins }}"
patternType: "{{ patternType }}"
priority: {{ priority }}
queryParameters: "{{ queryParameters }}"
resources:
- "{{ resources }}"
statusCode: {{ statusCode }}
ttl: {{ ttl }}
- name: enabled
value: {{ enabled }}
description: |
Enable / Disable the option
- name: name
value: "{{ name }}"
description: |
Option name
- name: pattern
value: "{{ pattern }}"
description: |
Url pattern
- name: type
value: "{{ type }}"
description: |
Option type
valid_values: ['cache_rule']
UPDATE examples​
- update
Update an option on a domain
UPDATE ovh.hosting_web.cdn_domain_options
SET
config = '{{ config }}',
enabled = {{ enabled }},
extra = '{{ extra }}',
pattern = '{{ pattern }}',
type = '{{ type }}'
WHERE
domain_name = '{{ domain_name }}' --required
AND option_name = '{{ option_name }}' --required
AND service_name = '{{ service_name }}' --required
AND enabled = {{ enabled }} --required
AND type = '{{ type }}' --required
RETURNING
name,
config,
enabled,
extra,
pattern,
type;
DELETE examples​
- delete
Remove or Reset an option to his default value
DELETE FROM ovh.hosting_web.cdn_domain_options
WHERE domain_name = '{{ domain_name }}' --required
AND option_name = '{{ option_name }}' --required
AND service_name = '{{ service_name }}' --required
;