Skip to main content

http_farms

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

Overview​

Namehttp_farms
TypeResource
Idovh.ip_loadbalancing.http_farms

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
farm_idintegerId of your farm (wire: farmId)
vrack_network_idintegerInternal Load Balancer identifier of the vRack private network attached to your farm, mandatory when your Load Balancer is attached to a vRack (wire: vrackNetworkId)
display_namestringHuman readable name for your backend, this field is for you (wire: displayName)
balancestringLoad balancing algorithm. 'roundrobin' if null (first, leastconn, roundrobin, source, uri)
portintegerPort attached to your farm. Inherited from frontend if null
probeobjectProbe used to determine if a backend is alive and can handle requests. Defaults to tcp on the same port as the farm
stickinessstringStickiness type. No stickiness if null (cookie, sourceIp)
zonestringZone of you farm

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectfarm_id, service_nameGet an HTTP farm
listselectservice_namevrack_network_id, zone, x_pagination_modeList HTTP farms
createinsertservice_name, zoneCreate an HTTP farm
updateupdatefarm_id, service_nameUpdate an HTTP farm
deletedeletefarm_id, service_nameDelete an HTTP farm

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)
service_namestringThe internal name of your IP load balancing (wire: serviceName)
vrack_network_idintegerFilter the value of vrackNetworkId property (=) (wire: vrackNetworkId)
x_pagination_modestringSent as CachedObjectList-Pages by default so the list returns the full objects rather than their identifiers. (wire: X-Pagination-Mode)
zonestringFilter the value of zone property (=)

SELECT examples​

Get an HTTP farm

SELECT
farm_id,
vrack_network_id,
display_name,
balance,
port,
probe,
stickiness,
zone
FROM ovh.ip_loadbalancing.http_farms
WHERE farm_id = '{{ farm_id }}' -- required
AND service_name = '{{ service_name }}' -- required
;

INSERT examples​

Create an HTTP farm

INSERT INTO ovh.ip_loadbalancing.http_farms (
balance,
display_name,
port,
probe,
stickiness,
vrack_network_id,
zone,
service_name
)
SELECT
'{{ balance }}',
'{{ display_name }}',
{{ port }},
'{{ probe }}',
'{{ stickiness }}',
{{ vrack_network_id }},
'{{ zone }}' /* required */,
'{{ service_name }}'
RETURNING
farm_id,
vrack_network_id,
display_name,
balance,
port,
probe,
stickiness,
zone
;

UPDATE examples​

Update an HTTP farm

UPDATE ovh.ip_loadbalancing.http_farms
SET
balance = '{{ balance }}',
display_name = '{{ display_name }}',
port = {{ port }},
probe = '{{ probe }}',
stickiness = '{{ stickiness }}',
vrack_network_id = {{ vrack_network_id }}
WHERE
farm_id = '{{ farm_id }}' --required
AND service_name = '{{ service_name }}' --required;

DELETE examples​

Delete an HTTP farm

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