POST /load_balancers/{id}/actions/add_target
Adds a target to a Load Balancer.
Call specific error codes
Code | Description |
---|---|
cloud_resource_ip_not_allowed | The IP you are trying to add as a target belongs to a Hetzner Cloud resource |
ip_not_owned | The IP you are trying to add as a target is not owned by the Project owner |
load_balancer_not_attached_to_network | The Load Balancer is not attached to a network |
robot_unavailable | Robot was not available. The caller may retry the operation after a short delay. |
server_not_attached_to_network | The server you are trying to add as a target is not attached to the same network as the Load Balancer |
missing_ipv4 | The server that you are trying to add as a public target does not have a public IPv4 address |
target_already_defined | The Load Balancer target you are trying to define is already defined |
Servers
- https://api.hetzner.cloud/v1
Path parameters
Name | Type | Required | Description |
---|---|---|---|
id |
Integer | Yes |
ID of the Load Balancer. |
Request headers
Name | Type | Required | Description |
---|---|---|---|
Content-Type |
String | Yes |
The media type of the request body.
Default value: "application/json" |
Request body fields
Name | Type | Required | Description |
---|---|---|---|
label_selector |
Object | No |
Configuration for label selector targets, only valid and required if type is |
label_selector.selector |
String | Yes |
Label selector |
type |
String | Yes |
Type of the resource Possible values:
|
server |
Object | No |
Configuration for type Server, only valid and required if type is |
server.id |
Integer | Yes |
ID of the Server |
use_private_ip |
Boolean | No |
Use the private network IP instead of the public IP of the Server, requires the Server and Load Balancer to be in the same network. Default value: false |
ip |
Object | No |
Configuration for an IP target. It is only possible to use the (Public or vSwitch) IPs of Hetzner Online Root Servers belonging to the project owner. IPs belonging to other users are blocked. Additionally IPs belonging to services provided by Hetzner Cloud (Servers, Load Balancers, ...) are blocked as well. Only valid and required if type is |
ip.ip |
String | Yes |
IP of a server that belongs to the same customer (public IPv4/IPv6) or private IP in a subnet type vswitch. |
How to start integrating
- Add HTTP Task to your workflow definition.
- Search for the API you want to integrate with and click on the name.
- This loads the API reference documentation and prepares the Http request settings.
- Click Test request to test run your request to the API and see the API's response.