Skip to main content

tcp_routes

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

Overview​

Nametcp_routes
TypeResource
Idovh.ip_loadbalancing.tcp_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 a TCP route
listselectservice_namefrontend_id, x_pagination_modeList TCP routes
createinsertservice_name, actionCreate a TCP route
updateupdateroute_id, service_nameUpdate a TCP route
deletedeleteroute_id, service_nameDelete a TCP 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 a TCP route

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

INSERT examples​

Create a TCP route

INSERT INTO ovh.ip_loadbalancing.tcp_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 a TCP route

UPDATE ovh.ip_loadbalancing.tcp_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 a TCP route

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