Skip to main content

redirections

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

Overview​

Nameredirections
TypeResource
Idovh.email_domain.redirections

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
idstringId of redirection
fromstringName of redirection
tostringTarget of redirection

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectdomain, idReturns the ID, the source address (from) and the target address (to) of the redirection. (Alpha version)
listselectdomainfrom, to, x_pagination_modeReturns the IDs of the redirections of the domain. Filter them by from or to address. (Alpha version)
createinsertdomain, from, local_copy, toCreates 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)
deletedeletedomain, idDeletes the redirection and returns the task. (Alpha version)
change_redirectionexecdomain, id, toSets 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.

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"}})
domainstringName of your domain name
idstringId
fromstringName of redirection
tostringEmail of redirection target
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 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
;

INSERT examples​

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
;

DELETE examples​

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.

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 }}"
}'
;