Skip to main content

tcp_farm_servers

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

Overview​

Nametcp_farm_servers
TypeResource
Idovh.ip_loadbalancing.tcp_farm_servers

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
backend_idintegerFarm id (wire: backendId)
server_idintegerId of your server (wire: serverId)
display_namestringHuman readable name for your server, this field is for you (wire: displayName)
addressstring (ipv4)Address of your server (example: 192.0.2.0)
backupbooleanBackup state. Default: 'false'
chainstringCertificate chain. Allow server certificate verification (Avoid man-in-the-middle attacks)
on_marked_downstringSet action when backend marked down. (No action if null) (shutdown-sessions) (wire: onMarkedDown)
portintegerPort attached to your server. Inherited from farm if null
probebooleanProbe state. Default: 'false'
proxy_protocol_versionstringDisabled if null. Send PROXY protocol header. Requires a compatible server. (v1, v2, v2-ssl, v2-ssl-cn) (wire: proxyProtocolVersion)
server_statearrayServer state (wire: serverState)
sslbooleanSSL ciphering. Probes will also be sent ciphered
statusstringStatus attached to your server (active, inactive)
weightintegerWeight value. Defaults to 1. 0 if not used in load balancing. Servers with higher weight get more requests.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectfarm_id, server_id, service_nameGet a farm server
listselectfarm_id, service_nameaddress, status, x_pagination_modeList farm servers
createinsertfarm_id, service_name, address, statusCreate a farm server
updateupdatefarm_id, server_id, service_nameUpdate a farm server
deletedeletefarm_id, server_id, service_nameDelete a farm server

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"}})
farm_idintegerId of your farm (wire: farmId)
server_idintegerId of your server (wire: serverId)
service_namestringThe internal name of your IP load balancing (wire: serviceName)
addressstring (ipv4)Filter the value of address property (=)
statusstringFilter the value of status property (=)
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 farm server

SELECT
backend_id,
server_id,
display_name,
address,
backup,
chain,
on_marked_down,
port,
probe,
proxy_protocol_version,
server_state,
ssl,
status,
weight
FROM ovh.ip_loadbalancing.tcp_farm_servers
WHERE farm_id = '{{ farm_id }}' -- required
AND server_id = '{{ server_id }}' -- required
AND service_name = '{{ service_name }}' -- required
;

INSERT examples​

Create a farm server

INSERT INTO ovh.ip_loadbalancing.tcp_farm_servers (
address,
backup,
chain,
display_name,
on_marked_down,
port,
probe,
proxy_protocol_version,
ssl,
status,
weight,
farm_id,
service_name
)
SELECT
'{{ address }}' /* required */,
{{ backup }},
'{{ chain }}',
'{{ display_name }}',
'{{ on_marked_down }}',
{{ port }},
{{ probe }},
'{{ proxy_protocol_version }}',
{{ ssl }},
'{{ status }}' /* required */,
{{ weight }},
'{{ farm_id }}',
'{{ service_name }}'
RETURNING
backend_id,
server_id,
display_name,
address,
backup,
chain,
on_marked_down,
port,
probe,
proxy_protocol_version,
server_state,
ssl,
status,
weight
;

UPDATE examples​

Update a farm server

UPDATE ovh.ip_loadbalancing.tcp_farm_servers
SET
backup = {{ backup }},
chain = '{{ chain }}',
display_name = '{{ display_name }}',
on_marked_down = '{{ on_marked_down }}',
port = {{ port }},
probe = {{ probe }},
proxy_protocol_version = '{{ proxy_protocol_version }}',
ssl = {{ ssl }},
status = '{{ status }}',
weight = {{ weight }}
WHERE
farm_id = '{{ farm_id }}' --required
AND server_id = '{{ server_id }}' --required
AND service_name = '{{ service_name }}' --required;

DELETE examples​

Delete a farm server

DELETE FROM ovh.ip_loadbalancing.tcp_farm_servers
WHERE farm_id = '{{ farm_id }}' --required
AND server_id = '{{ server_id }}' --required
AND service_name = '{{ service_name }}' --required
;