Load Balancer Actions

Add Service

Adds a service to a Load Balancer.

Operation specific errors

StatusCodeDescription
412source_port_already_usedThe source port you are trying to add is already in use
post/load_balancers/{id}/actions/add_service

Request

  • Base URL: https://api.hetzner.cloud/v1
  • URL: https://api.hetzner.cloud/v1/load_balancers/{id}/actions/add_service
  • Auth: HTTP bearer

Path parameters

idinteger required

ID of the Load Balancer.

Example:42

ID of the Load Balancer.

Request body

protocol'tcp' | 'http' | 'https' required

Protocol of the Load Balancer.

listen_portinteger required

Port the Load Balancer listens on.

destination_portinteger required

Port the Load Balancer will balance to.

proxyprotocolboolean required

Is Proxyprotocol enabled or not.

Example request

{
  "protocol": "https",
  "listen_port": 443,
  "destination_port": 80,
  "health_check": {
    "protocol": "http",
    "port": 4711,
    "interval": 15,
    "timeout": 10,
    "retries": 3,
    "http": {
      "domain": "example.com",
      "path": "/",
      "response": "{\"status\": \"ok\"}",
      "status_codes": [
        "2??",
        "3??"
      ]
    }
  },
  "http": {
    "cookie_name": "HCLBSTICKY",
    "cookie_lifetime": 300,
    "timeout_idle": 50,
    "certificates": [
      897
    ],
    "redirect_http": true,
    "sticky_sessions": 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.