tcp_routes
Creates, updates, deletes, gets or lists a tcp_routes resource.
Overview​
| Name | tcp_routes |
| Type | Resource |
| Id | ovh.ip_loadbalancing.tcp_routes |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
frontend_id | integer | Route traffic for this frontend (wire: frontendId) |
route_id | integer | Id of your route (wire: routeId) |
display_name | string | Human readable name for your route, this field is for you (wire: displayName) |
action | object | Action triggered when all rules match |
rules | array | List of rules to match to trigger action |
status | string | Route status. Routes in "ok" state are ready to operate (creating, deleting, internal, ok, updating) |
weight | integer | Route priority ([0..255]). 0 if null. Highest priority routes are evaluated last. Only the first matching route will trigger an action |
TCP Route
| Name | Datatype | Description |
|---|---|---|
frontend_id | integer | Route traffic for this frontend (wire: frontendId) |
route_id | integer | Id of your route (wire: routeId) |
display_name | string | Human readable name for your route, this field is for you (wire: displayName) |
action | object | Action triggered when all rules match |
rules | array | List of rules to match to trigger action |
status | string | Route status. Routes in "ok" state are ready to operate (creating, deleting, internal, ok, updating) |
weight | integer | Route 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | route_id, service_name | Get a TCP route | |
list | select | service_name | frontend_id, x_pagination_mode | List TCP routes |
create | insert | service_name, action | Create a TCP route | |
update | update | route_id, service_name | Update a TCP route | |
delete | delete | route_id, service_name | Delete 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.
| 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) |
service_name | string | The internal name of your IP load balancing (wire: serviceName) |
frontend_id | integer | Filter the value of frontendId property (=) (wire: frontendId) |
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 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
;
List TCP routes
SELECT
frontend_id,
route_id,
display_name,
action,
rules,
status,
weight
FROM ovh.ip_loadbalancing.tcp_routes
WHERE service_name = '{{ service_name }}' -- required
AND frontend_id = '{{ frontend_id }}'
AND x_pagination_mode = '{{ x_pagination_mode }}'
;
INSERT examples​
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: tcp_routes
props:
- name: service_name
value: "{{ service_name }}"
description: Required parameter for the tcp_routes resource.
- name: action
description: |
Action triggered when all rules match
value:
target: "{{ target }}"
type: "{{ type }}"
- name: display_name
value: "{{ display_name }}"
description: |
Human readable name for your route, this field is for you
- name: frontend_id
value: {{ frontend_id }}
description: |
Route traffic for this frontend
- name: weight
value: {{ weight }}
description: |
Route priority ([0..255]). 0 if null. Highest priority routes are evaluated last. Only the first matching route will trigger an action
UPDATE examples​
- update
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
Delete a TCP route
DELETE FROM ovh.ip_loadbalancing.tcp_routes
WHERE route_id = '{{ route_id }}' --required
AND service_name = '{{ service_name }}' --required
;