redirections
Creates, updates, deletes, gets or lists a redirections resource.
Overview​
| Name | redirections |
| Type | Resource |
| Id | ovh.email_domain.redirections |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
id | string | Id of redirection |
from | string | Name of redirection |
to | string | Target of redirection |
Global Redirection
| Name | Datatype | Description |
|---|---|---|
id | string | Id of redirection |
from | string | Name of redirection |
to | string | Target of redirection |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | domain, id | Returns the ID, the source address (from) and the target address (to) of the redirection. (Alpha version) | |
list | select | domain | from, to, x_pagination_mode | Returns the IDs of the redirections of the domain. Filter them by from or to address. (Alpha version) |
create | insert | domain, from, local_copy, to | Creates a redirection from the from address to the to address, and returns the task. Set localCopy to true to keep a local copy. (Alpha version) | |
delete | delete | domain, id | Deletes the redirection and returns the task. (Alpha version) | |
change_redirection | exec | domain, id, to | Sets the new target address (to) of the redirection and returns the task. (Alpha 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.
| 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 | string | Name of your domain name |
id | string | Id |
from | string | Name of redirection |
to | string | Email of redirection target |
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 ID, the source address (from) and the target address (to) of the redirection. (Alpha version)
SELECT
id,
from,
to
FROM ovh.email_domain.redirections
WHERE domain = '{{ domain }}' -- required
AND id = '{{ id }}' -- required
;
Returns the IDs of the redirections of the domain. Filter them by from or to address. (Alpha version)
SELECT
id,
from,
to
FROM ovh.email_domain.redirections
WHERE domain = '{{ domain }}' -- required
AND from = '{{ from }}'
AND to = '{{ to }}'
AND x_pagination_mode = '{{ x_pagination_mode }}'
;
INSERT examples​
- create
- Manifest
Creates a redirection from the from address to the to address, and returns the task. Set localCopy to true to keep a local copy. (Alpha version)
INSERT INTO ovh.email_domain.redirections (
from,
local_copy,
to,
domain
)
SELECT
'{{ from }}' /* required */,
{{ local_copy }} /* required */,
'{{ to }}' /* required */,
'{{ domain }}'
RETURNING
id,
account,
action,
date,
domain,
type
;
# Description fields are for documentation purposes
- name: redirections
props:
- name: domain
value: "{{ domain }}"
description: Required parameter for the redirections resource.
- name: from
value: "{{ from }}"
description: |
Name of redirection
- name: local_copy
value: {{ local_copy }}
description: |
If true keep a local copy
- name: to
value: "{{ to }}"
description: |
Target of account
DELETE examples​
- delete
Deletes the redirection and returns the task. (Alpha version)
DELETE FROM ovh.email_domain.redirections
WHERE domain = '{{ domain }}' --required
AND id = '{{ id }}' --required
;
Lifecycle Methods​
EXEC variables use wire (API) names.
- change_redirection
Sets the new target address (to) of the redirection and returns the task. (Alpha version)
EXEC ovh.email_domain.redirections.change_redirection
@domain='{{ domain }}' --required,
@id='{{ id }}' --required
@@json=
'{
"to": "{{ to }}"
}'
;