zone_redirections
Creates, updates, deletes, gets or lists a zone_redirections resource.
Overview​
| Name | zone_redirections |
| Type | Resource |
| Id | ovh.domain.zone_redirections |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
id | integer | Id of the redirection |
description | string | Description for the invisible redirection |
keywords | string | Keywords for the invisible redirection |
sub_domain | string | Subdomain to redirect (wire: subDomain) |
target | string | Target of the redirection |
title | string | Title for the invisible redirection |
type | string | Redirection type: - visible -> Redirection by http code 302 - visiblePermanent -> Redirection by http code 301 - invisible -> Redirection by html frame (invisible, visible, visiblePermanent) |
zone | string | Redirection zone |
DNS zone redirections
| Name | Datatype | Description |
|---|---|---|
id | integer | Id of the redirection |
description | string | Description for the invisible redirection |
keywords | string | Keywords for the invisible redirection |
sub_domain | string | Subdomain to redirect (wire: subDomain) |
target | string | Target of the redirection |
title | string | Title for the invisible redirection |
type | string | Redirection type: - visible -> Redirection by http code 302 - visiblePermanent -> Redirection by http code 301 - invisible -> Redirection by html frame (invisible, visible, visiblePermanent) |
zone | string | Redirection zone |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | id, zone_name | Returns a redirection: subdomain, target, type and, for an invisible one, title, description and keywords. | |
list | select | zone_name | sub_domain, x_pagination_mode | Returns the identifiers of the zone redirections. Can be filtered by subdomain. |
create | insert | zone_name, target, type | Creates a redirection of type visible (HTTP 302), visiblePermanent (HTTP 301) or invisible (HTML frame). The change applies after the zone is refreshed. | |
update | update | id, zone_name | Updates the target, type, title, description and keywords of a redirection. | |
delete | delete | id, zone_name | Deletes a redirection. The change applies after the zone is refreshed. |
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"}}) |
id | integer | Id |
zone_name | string | Zone name (wire: zoneName) |
sub_domain | string | Filter the value of subDomain property (wire: subDomain) |
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 a redirection: subdomain, target, type and, for an invisible one, title, description and keywords.
SELECT
id,
description,
keywords,
sub_domain,
target,
title,
type,
zone
FROM ovh.domain.zone_redirections
WHERE id = '{{ id }}' -- required
AND zone_name = '{{ zone_name }}' -- required
;
Returns the identifiers of the zone redirections. Can be filtered by subdomain.
SELECT
id,
description,
keywords,
sub_domain,
target,
title,
type,
zone
FROM ovh.domain.zone_redirections
WHERE zone_name = '{{ zone_name }}' -- required
AND sub_domain = '{{ sub_domain }}'
AND x_pagination_mode = '{{ x_pagination_mode }}'
;
INSERT examples​
- create
- Manifest
Creates a redirection of type visible (HTTP 302), visiblePermanent (HTTP 301) or invisible (HTML frame). The change applies after the zone is refreshed.
INSERT INTO ovh.domain.zone_redirections (
description,
keywords,
sub_domain,
target,
title,
type,
zone_name
)
SELECT
'{{ description }}',
'{{ keywords }}',
'{{ sub_domain }}',
'{{ target }}' /* required */,
'{{ title }}',
'{{ type }}' /* required */,
'{{ zone_name }}'
RETURNING
id,
description,
keywords,
sub_domain,
target,
title,
type,
zone
;
# Description fields are for documentation purposes
- name: zone_redirections
props:
- name: zone_name
value: "{{ zone_name }}"
description: Required parameter for the zone_redirections resource.
- name: description
value: "{{ description }}"
description: |
Description for the invisible redirection
- name: keywords
value: "{{ keywords }}"
description: |
Keywords for the invisible redirection
- name: sub_domain
value: "{{ sub_domain }}"
description: |
Subdomain to redirect
- name: target
value: "{{ target }}"
description: |
Target of the redirection
- name: title
value: "{{ title }}"
description: |
Title for the invisible redirection
- name: type
value: "{{ type }}"
description: |
Redirection type:
- visible -> Redirection by http code 302
- visiblePermanent -> Redirection by http code 301
- invisible -> Redirection by html frame
valid_values: ['invisible', 'visible', 'visiblePermanent']
UPDATE examples​
- update
Updates the target, type, title, description and keywords of a redirection.
UPDATE ovh.domain.zone_redirections
SET
description = '{{ description }}',
keywords = '{{ keywords }}',
target = '{{ target }}',
title = '{{ title }}',
type = '{{ type }}'
WHERE
id = '{{ id }}' --required
AND zone_name = '{{ zone_name }}' --required;
DELETE examples​
- delete
Deletes a redirection. The change applies after the zone is refreshed.
DELETE FROM ovh.domain.zone_redirections
WHERE id = '{{ id }}' --required
AND zone_name = '{{ zone_name }}' --required
;