tcp_route_rules
Creates, updates, deletes, gets or lists a tcp_route_rules resource.
Overview​
| Name | tcp_route_rules |
| Type | Resource |
| Id | ovh.ip_loadbalancing.tcp_route_rules |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
rule_id | integer | Id of your rule (wire: ruleId) |
display_name | string | Human readable name for your rule (wire: displayName) |
field | string | Name of the field to match like "protocol" or "host". See "/ipLoadbalancing/{serviceName}/availableRouteRules" for a list of available rules |
match | string | Matching operator. Not all operators are available for all fields. See "/ipLoadbalancing/{serviceName}/availableRouteRules" (contains, endswith, exists, in, internal, is, matches, startswith) |
negate | boolean | Invert the matching operator effect |
pattern | string | Value to match against this match. Interpretation if this field depends on the match and field |
sub_field | string | Name of sub-field, if applicable. This may be a Cookie or Header name for instance (wire: subField) |
Rule of a route
| Name | Datatype | Description |
|---|---|---|
rule_id | integer | Id of your rule (wire: ruleId) |
display_name | string | Human readable name for your rule (wire: displayName) |
field | string | Name of the field to match like "protocol" or "host". See "/ipLoadbalancing/{serviceName}/availableRouteRules" for a list of available rules |
match | string | Matching operator. Not all operators are available for all fields. See "/ipLoadbalancing/{serviceName}/availableRouteRules" (contains, endswith, exists, in, internal, is, matches, startswith) |
negate | boolean | Invert the matching operator effect |
pattern | string | Value to match against this match. Interpretation if this field depends on the match and field |
sub_field | string | Name 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | route_id, rule_id, service_name | Get a route rule | |
list | select | route_id, service_name | x_pagination_mode | List route rules |
create | insert | route_id, service_name, field, match | Create a route rule | |
update | update | route_id, rule_id, service_name | Update a route rule | |
delete | delete | route_id, rule_id, service_name | Delete 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.
| 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"}}) |
route_id | integer | Id of your route (wire: routeId) |
rule_id | integer | Id of your rule (wire: ruleId) |
service_name | string | The internal name of your IP load balancing (wire: serviceName) |
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
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
;
List route rules
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 service_name = '{{ service_name }}' -- required
AND x_pagination_mode = '{{ x_pagination_mode }}'
;
INSERT examples​
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: tcp_route_rules
props:
- name: route_id
value: {{ route_id }}
description: Required parameter for the tcp_route_rules resource.
- name: service_name
value: "{{ service_name }}"
description: Required parameter for the tcp_route_rules resource.
- name: display_name
value: "{{ display_name }}"
description: |
Human readable name for your rule
- name: field
value: "{{ field }}"
description: |
Name of the field to match like "protocol" or "host". See "/ipLoadbalancing/{serviceName}/availableRouteRules" for a list of available rules
- name: match
value: "{{ match }}"
description: |
Matching operator. Not all operators are available for all fields. See "/ipLoadbalancing/{serviceName}/availableRouteRules"
valid_values: ['contains', 'endswith', 'exists', 'in', 'internal', 'is', 'matches', 'startswith']
- name: negate
value: {{ negate }}
description: |
Invert the matching operator effect
- name: pattern
value: "{{ pattern }}"
description: |
Value to match against this match. Interpretation if this field depends on the match and field
- name: sub_field
value: "{{ sub_field }}"
description: |
Name of sub-field, if applicable. This may be a Cookie or Header name for instance
UPDATE examples​
- update
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
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
;