Skip to main content

tcp_route_rules

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

Overview​

Nametcp_route_rules
TypeResource
Idovh.ip_loadbalancing.tcp_route_rules

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
rule_idintegerId of your rule (wire: ruleId)
display_namestringHuman readable name for your rule (wire: displayName)
fieldstringName of the field to match like "protocol" or "host". See "/ipLoadbalancing/{serviceName}/availableRouteRules" for a list of available rules
matchstringMatching operator. Not all operators are available for all fields. See "/ipLoadbalancing/{serviceName}/availableRouteRules" (contains, endswith, exists, in, internal, is, matches, startswith)
negatebooleanInvert the matching operator effect
patternstringValue to match against this match. Interpretation if this field depends on the match and field
sub_fieldstringName of sub-field, if applicable. This may be a Cookie or Header name for instance (wire: subField)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectroute_id, rule_id, service_nameGet a route rule
listselectroute_id, service_namex_pagination_modeList route rules
createinsertroute_id, service_name, field, matchCreate a route rule
updateupdateroute_id, rule_id, service_nameUpdate a route rule
deletedeleteroute_id, rule_id, service_nameDelete a route rule

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)
rule_idintegerId of your rule (wire: ruleId)
service_namestringThe internal name of your IP load balancing (wire: serviceName)
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 route rule

SELECT
rule_id,
display_name,
field,
match,
negate,
pattern,
sub_field
FROM ovh.ip_loadbalancing.tcp_route_rules
WHERE route_id = '{{ route_id }}' -- required
AND rule_id = '{{ rule_id }}' -- required
AND service_name = '{{ service_name }}' -- required
;

INSERT examples​

Create a route rule

INSERT INTO ovh.ip_loadbalancing.tcp_route_rules (
display_name,
field,
match,
negate,
pattern,
sub_field,
route_id,
service_name
)
SELECT
'{{ display_name }}',
'{{ field }}' /* required */,
'{{ match }}' /* required */,
{{ negate }},
'{{ pattern }}',
'{{ sub_field }}',
'{{ route_id }}',
'{{ service_name }}'
RETURNING
rule_id,
display_name,
field,
match,
negate,
pattern,
sub_field
;

UPDATE examples​

Update a route rule

UPDATE ovh.ip_loadbalancing.tcp_route_rules
SET
display_name = '{{ display_name }}',
field = '{{ field }}',
match = '{{ match }}',
negate = {{ negate }},
pattern = '{{ pattern }}',
sub_field = '{{ sub_field }}'
WHERE
route_id = '{{ route_id }}' --required
AND rule_id = '{{ rule_id }}' --required
AND service_name = '{{ service_name }}' --required;

DELETE examples​

Delete a route rule

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