Load Balancer Actions
Add Target
Adds a target to a Load Balancer.
Operation specific errors
| Status | Code | Description |
|---|---|---|
| 422 | ip_not_in_vswitch_subnet | The IP you are trying to add does not belong to the vswitch subnet of the attached network |
| 422 | ip_not_owned | The IP you are trying to add as a target is not owned by the Project owner |
| 422 | ip_not_assigned_to_server | The specified IP is neither the Primary IPv4 address nor in the IPv6 subnet of the given Server |
| 422 | load_balancer_public_interface_disabled | The Load Balancer's public network interface is disabled |
| 422 | load_balancer_not_attached_to_network | The Load Balancer is not attached to a network |
| 422 | network_has_no_vswitch_subnet | The given IP is private but attached network does not have a vswitch subnet |
| 422 | resolve_cloud_private_targets_error | The server you are trying to add as a target is not attached to the same network as the Load Balancer |
| 422 | resolve_cloud_public_targets_error | The server that you are trying to add as a public target does not have a public IPv4 address |
| 422 | target_already_defined | The Load Balancer target you are trying to define is already defined |
post/load_balancers/{id}/actions/add_target
Request
- Base URL: https://api.hetzner.cloud/v1
- URL: https://api.hetzner.cloud/v1/load_balancers/{id}/actions/add_target
- Auth: HTTP bearer
Path parameters
idinteger required
ID of the Load Balancer.
Example:42
ID of the Load Balancer.
Request body
Example request
{
"server": {
"id": 80,
"ip": "2001:db8::1"
},
"label_selector": {
"selector": "env=prod"
},
"ip": {
"ip": "203.0.113.1"
},
"use_private_ip": true
}Response
Request succeeded.
Example response
{
"action": {
"id": 42,
"command": "start_resource",
"started": "2016-01-30T23:55:00Z",
"finished": "2016-01-30T23:55:00Z",
"progress": 100,
"resources": [
{
"id": 42,
"type": "server"
}
],
"error": {
"code": "action_failed",
"message": "Action failed"
}
}
}Changes
No recorded changes to this operation across all 1 revision of this API.