Skip to main content

loadbalancers

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

Overview​

Nameloadbalancers
TypeResource
Idovh.public_cloud_network.loadbalancers

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
idstring (uuid)Unique identifier of the load balancer
checksumstringComputed hash representing the current target specification value
created_atstring (date-time)Creation date of the load balancer (wire: createdAt)
current_stateobjectCurrent state of the load balancer (wire: currentState)
current_tasksarrayOngoing asynchronous tasks related to the load balancer (wire: currentTasks)
resource_statusstringLoad balancer readiness in the system (CREATING, CREATION_PLANNED, DELETING, ERROR, OUT_OF_SYNC, READY, SUSPENDED, UNKNOWN, UPDATING) (wire: resourceStatus)
target_specobjectLast target specification of the load balancer (wire: targetSpec)
updated_atstring (date-time)Last update date of the load balancer (wire: updatedAt)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectloadbalancer_id, project_idReturns the load balancer, including its VIP network and operating status.
listselectproject_idx_pagination_cursor, x_pagination_size, flavor, name, regionReturns the load balancers of the project.<br /><br />### Filters<br />The optional name, flavor and region query parameters narrow the list. Each one can be repeated (for example ?flavor=SMALL&flavor=MEDIUM): repeated values of the same parameter are combined with OR, and different parameters are combined with AND. An unknown flavor value, or an unavailable region, is rejected with a 400 InvalidParameter. The resourceStatus is computed from the live state of each resource, so it is not a filter: a status query parameter is rejected with a 400 InvalidParameter.
createinsertproject_id, target_specCreates a load balancer with the given Octavia flavor, attaching its virtual IP to a private network and subnet.
updateupdateloadbalancer_id, project_id, target_specUpdates the load balancer's name, description or flavor. A flavor other than the current one resizes the load balancer in place: it is failed over onto amphorae of the new flavor, which takes several minutes and can briefly interrupt traffic. The VIP network is immutable after creation.
deletedeleteloadbalancer_id, project_idDeletes the load balancer.

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"}})
loadbalancer_idstring (uuid)Loadbalancer ID (wire: loadbalancerId)
project_idstringThe Public Cloud project ID. Resolved from OVH_CLOUD_PROJECT_SERVICE when set.
flavorarrayFilter by load balancer flavor name. Repeatable.
namearrayFilter by load balancer name (case-insensitive substring match). Repeatable.
regionarrayFilter by load balancer region. An unavailable region is rejected. Repeatable.
x_pagination_cursorstringPagination cursor (wire: X-Pagination-Cursor)
x_pagination_sizeintegerPagination size (wire: X-Pagination-Size)

SELECT examples​

Returns the load balancer, including its VIP network and operating status.

SELECT
id,
checksum,
created_at,
current_state,
current_tasks,
resource_status,
target_spec,
updated_at
FROM ovh.public_cloud_network.loadbalancers
WHERE loadbalancer_id = '{{ loadbalancer_id }}' -- required
AND project_id = '{{ project_id }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
;

INSERT examples​

Creates a load balancer with the given Octavia flavor, attaching its virtual IP to a private network and subnet.

INSERT INTO ovh.public_cloud_network.loadbalancers (
target_spec,
project_id
)
SELECT
'{{ target_spec }}' /* required */,
'{{ project_id }}'
RETURNING
id,
checksum,
created_at,
current_state,
current_tasks,
resource_status,
target_spec,
updated_at
;

UPDATE examples​

Updates the load balancer's name, description or flavor. A flavor other than the current one resizes the load balancer in place: it is failed over onto amphorae of the new flavor, which takes several minutes and can briefly interrupt traffic. The VIP network is immutable after creation.

UPDATE ovh.public_cloud_network.loadbalancers
SET
checksum = '{{ checksum }}',
target_spec = '{{ target_spec }}'
WHERE
loadbalancer_id = '{{ loadbalancer_id }}' --required
AND project_id = '{{ project_id }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
AND target_spec = '{{ target_spec }}' --required
RETURNING
id,
checksum,
created_at,
current_state,
current_tasks,
resource_status,
target_spec,
updated_at;

DELETE examples​

Deletes the load balancer.

DELETE FROM ovh.public_cloud_network.loadbalancers
WHERE loadbalancer_id = '{{ loadbalancer_id }}' --required
AND project_id = '{{ project_id }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
;