loadbalancers
Creates, updates, deletes, gets or lists a loadbalancers resource.
Overview​
| Name | loadbalancers |
| Type | Resource |
| Id | ovh.public_cloud_network.loadbalancers |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | Unique identifier of the load balancer |
checksum | string | Computed hash representing the current target specification value |
created_at | string (date-time) | Creation date of the load balancer (wire: createdAt) |
current_state | object | Current state of the load balancer (wire: currentState) |
current_tasks | array | Ongoing asynchronous tasks related to the load balancer (wire: currentTasks) |
resource_status | string | Load balancer readiness in the system (CREATING, CREATION_PLANNED, DELETING, ERROR, OUT_OF_SYNC, READY, SUSPENDED, UNKNOWN, UPDATING) (wire: resourceStatus) |
target_spec | object | Last target specification of the load balancer (wire: targetSpec) |
updated_at | string (date-time) | Last update date of the load balancer (wire: updatedAt) |
A Public Cloud load balancer
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | Unique identifier of the load balancer |
checksum | string | Computed hash representing the current target specification value |
created_at | string (date-time) | Creation date of the load balancer (wire: createdAt) |
current_state | object | Current state of the load balancer (wire: currentState) |
current_tasks | array | Ongoing asynchronous tasks related to the load balancer (wire: currentTasks) |
resource_status | string | Load balancer readiness in the system (CREATING, CREATION_PLANNED, DELETING, ERROR, OUT_OF_SYNC, READY, SUSPENDED, UNKNOWN, UPDATING) (wire: resourceStatus) |
target_spec | object | Last target specification of the load balancer (wire: targetSpec) |
updated_at | string (date-time) | Last update date of the load balancer (wire: updatedAt) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | loadbalancer_id, project_id | Returns the load balancer, including its VIP network and operating status. | |
list | select | project_id | x_pagination_cursor, x_pagination_size, flavor, name, region | Returns 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. |
create | insert | project_id, target_spec | Creates a load balancer with the given Octavia flavor, attaching its virtual IP to a private network and subnet. | |
update | update | loadbalancer_id, project_id, target_spec | 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. | |
delete | delete | loadbalancer_id, project_id | Deletes 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.
| 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"}}) |
loadbalancer_id | string (uuid) | Loadbalancer ID (wire: loadbalancerId) |
project_id | string | The Public Cloud project ID. Resolved from OVH_CLOUD_PROJECT_SERVICE when set. |
flavor | array | Filter by load balancer flavor name. Repeatable. |
name | array | Filter by load balancer name (case-insensitive substring match). Repeatable. |
region | array | Filter by load balancer region. An unavailable region is rejected. Repeatable. |
x_pagination_cursor | string | Pagination cursor (wire: X-Pagination-Cursor) |
x_pagination_size | integer | Pagination size (wire: X-Pagination-Size) |
SELECT examples​
- get
- list
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
;
Returns 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.
SELECT
id,
checksum,
created_at,
current_state,
current_tasks,
resource_status,
target_spec,
updated_at
FROM ovh.public_cloud_network.loadbalancers
WHERE project_id = '{{ project_id }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
AND x_pagination_cursor = '{{ x_pagination_cursor }}'
AND x_pagination_size = '{{ x_pagination_size }}'
AND flavor = '{{ flavor }}'
AND name = '{{ name }}'
AND region = '{{ region }}'
;
INSERT examples​
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: loadbalancers
props:
- name: project_id
value: "{{ project_id }}"
description: Required parameter for the loadbalancers resource.
- name: target_spec
description: |
Desired target specification for the load balancer to create
value:
description: "{{ description }}"
flavor:
name: "{{ name }}"
location:
availabilityZone: "{{ availabilityZone }}"
region: "{{ region }}"
name: "{{ name }}"
network:
id: "{{ id }}"
ip: "{{ ip }}"
subnetId: "{{ subnetId }}"
UPDATE examples​
- update
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​
- delete
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
;