Skip to main content

http_routes

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

Overview​

Namehttp_routes
TypeResource
Idovh.ip_loadbalancing.http_routes

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
frontend_idintegerRoute traffic for this frontend (wire: frontendId)
route_idintegerId of your route (wire: routeId)
display_namestringHuman readable name for your route, this field is for you (wire: displayName)
actionobjectAction triggered when all rules match
rulesarrayList of rules to match to trigger action
statusstringRoute status. Routes in "ok" state are ready to operate (creating, deleting, internal, ok, updating)
weightintegerRoute priority ([0..255]). 0 if null. Highest priority routes are evaluated last. Only the first matching route will trigger an action

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectroute_id, service_nameGet an HTTP route
listselectservice_namefrontend_id, x_pagination_modeList HTTP routes
createinsertservice_name, actionCreate an HTTP route
updateupdateroute_id, service_nameUpdate an HTTP route
deletedeleteroute_id, service_nameDelete an HTTP route

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"}})
route_idintegerId of your route (wire: routeId)
service_namestringThe internal name of your IP load balancing (wire: serviceName)
frontend_idintegerFilter the value of frontendId property (=) (wire: frontendId)
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 an HTTP route

SELECT
frontend_id,
route_id,
display_name,
action,
rules,
status,
weight
FROM ovh.ip_loadbalancing.http_routes
WHERE route_id = '{{ route_id }}' -- required
AND service_name = '{{ service_name }}' -- required
;

INSERT examples​

Create an HTTP route

INSERT INTO ovh.ip_loadbalancing.http_routes (
action,
display_name,
frontend_id,
weight,
service_name
)
SELECT
'{{ action }}' /* required */,
'{{ display_name }}',
{{ frontend_id }},
{{ weight }},
'{{ service_name }}'
RETURNING
frontend_id,
route_id,
display_name,
action,
rules,
status,
weight
;

UPDATE examples​

Update an HTTP route

UPDATE ovh.ip_loadbalancing.http_routes
SET
action = '{{ action }}',
display_name = '{{ display_name }}',
frontend_id = {{ frontend_id }},
weight = {{ weight }}
WHERE
route_id = '{{ route_id }}' --required
AND service_name = '{{ service_name }}' --required;

DELETE examples​

Delete an HTTP route

DELETE FROM ovh.ip_loadbalancing.http_routes
WHERE route_id = '{{ route_id }}' --required
AND service_name = '{{ service_name }}' --required
;