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 |
target_already_defined | The Load Balancer target you are trying to define is already defined |
curl --location --request POST 'https://api.hetzner.cloud/v1/load_balancers//actions/add_target' \
--header 'Content-Type: application/json' \
--data-raw '{
"ip": {
"ip": "203.0.113.1"
},
"label_selector": {
"selector": "env=prod"
},
"server": {
"id": 80
},
"type": "server",
"use_private_ip": true
}'
{
"action": {
"command": "add_target",
"error": {
"code": "action_failed",
"message": "Action failed"
},
"finished": "2016-01-30T23:56:00.000Z",
"id": 13,
"progress": 100,
"resources": [
{
"id": 4711,
"type": "load_balancer"
}
],
"started": "2016-01-30T23:55:00.000Z",
"status": "success"
}
}