Skip to content
Odinex Cloud
API reference

Load Balancers

List load balancers

GET
/load_balancers

Authorization

headerAuthorizationBearer <token>

Query Parameters

label_selector?string

Filter by labels: env=prod, env!=prod, env (has key), !env; comma = AND

Response Body

Load balancers

application/json
  1. response
load_balancers*array<>
curl -X GET "https://example.com/load_balancers"
{  "load_balancers": [    {      "id": 0,      "name": "string",      "status": "creating",      "load_balancer_type": "string",      "location": "string",      "algorithm": "round_robin",      "public_net": {        "ipv4": "string",        "ipv6": "string"      },      "services": [        {          "protocol": "tcp",          "listen_port": 1,          "destination_port": 1,          "proxyprotocol": true,          "health_check": {            "protocol": "tcp",            "port": 0,            "interval": 0,            "timeout": 0,            "retries": 0,            "http": {              "path": "string",              "status_codes": [                "2??",                "3??"              ]            }          },          "http": {            "sticky_sessions": true          }        }      ],      "targets": [        {          "type": "server",          "server": 0,          "label_selector": "string",          "ip": "string",          "servers": [            0          ],          "health": [            {              "listen_port": 0,              "address": "string",              "status": "healthy"            }          ]        }      ],      "protection": {        "delete": true      },      "labels": {        "property1": "string",        "property2": "string"      },      "created": "2019-08-24T14:15:22Z"    }  ]}

Create load balancer

POST
/load_balancers

Authorization

headerAuthorizationBearer <token>

Request Body

application/json
  1. body
name*string
Length1 <= length <= 64
load_balancer_type*string
location*string
algorithm?string
Default"round_robin"
Value in"round_robin""least_connections"
services?array<>
targets?array<>
labels?

Up to 64 key/value pairs; keys and values up to 63 characters

Response Body

Being created

application/json
  1. response
load_balancer*
action*
curl -X POST "https://example.com/load_balancers" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "load_balancer_type": "lb11",    "location": "string"  }'
{  "load_balancer": {    "id": 0,    "name": "string",    "status": "creating",    "load_balancer_type": "string",    "location": "string",    "algorithm": "round_robin",    "public_net": {      "ipv4": "string",      "ipv6": "string"    },    "services": [      {        "protocol": "tcp",        "listen_port": 1,        "destination_port": 1,        "proxyprotocol": true,        "health_check": {          "protocol": "tcp",          "port": 0,          "interval": 0,          "timeout": 0,          "retries": 0,          "http": {            "path": "string",            "status_codes": [              "2??",              "3??"            ]          }        },        "http": {          "sticky_sessions": true        }      }    ],    "targets": [      {        "type": "server",        "server": 0,        "label_selector": "string",        "ip": "string",        "servers": [          0        ],        "health": [          {            "listen_port": 0,            "address": "string",            "status": "healthy"          }        ]      }    ],    "protection": {      "delete": true    },    "labels": {      "property1": "string",      "property2": "string"    },    "created": "2019-08-24T14:15:22Z"  },  "action": {    "id": 0,    "command": "create_server",    "status": "running",    "progress": 0,    "started": "2019-08-24T14:15:22Z",    "finished": "2019-08-24T14:15:22Z",    "resources": [      {        "id": 0,        "type": "server"      }    ],    "error": {      "code": "string",      "message": "string"    }  }}
GET
/load_balancers/{id}

Authorization

headerAuthorizationBearer <token>

Path Parameters

id*integer
Formatint64

Response Body

Load balancer

application/json
  1. response
load_balancer*
curl -X GET "https://example.com/load_balancers/0"
{  "load_balancer": {    "id": 0,    "name": "string",    "status": "creating",    "load_balancer_type": "string",    "location": "string",    "algorithm": "round_robin",    "public_net": {      "ipv4": "string",      "ipv6": "string"    },    "services": [      {        "protocol": "tcp",        "listen_port": 1,        "destination_port": 1,        "proxyprotocol": true,        "health_check": {          "protocol": "tcp",          "port": 0,          "interval": 0,          "timeout": 0,          "retries": 0,          "http": {            "path": "string",            "status_codes": [              "2??",              "3??"            ]          }        },        "http": {          "sticky_sessions": true        }      }    ],    "targets": [      {        "type": "server",        "server": 0,        "label_selector": "string",        "ip": "string",        "servers": [          0        ],        "health": [          {            "listen_port": 0,            "address": "string",            "status": "healthy"          }        ]      }    ],    "protection": {      "delete": true    },    "labels": {      "property1": "string",      "property2": "string"    },    "created": "2019-08-24T14:15:22Z"  }}

Delete load balancer

DELETE
/load_balancers/{id}

Authorization

headerAuthorizationBearer <token>

Path Parameters

id*integer
Formatint64

Response Body

Deletion started

application/json
  1. response
action*
curl -X DELETE "https://example.com/load_balancers/0"
{  "action": {    "id": 0,    "command": "create_server",    "status": "running",    "progress": 0,    "started": "2019-08-24T14:15:22Z",    "finished": "2019-08-24T14:15:22Z",    "resources": [      {        "id": 0,        "type": "server"      }    ],    "error": {      "code": "string",      "message": "string"    }  }}

Update load balancer

PUT
/load_balancers/{id}

Authorization

headerAuthorizationBearer <token>

Path Parameters

id*integer
Formatint64

Request Body

application/json
  1. body
name?string
Length1 <= length <= 64
labels?

Up to 64 key/value pairs; keys and values up to 63 characters

protection?

Response Body

Updated

application/json
  1. response
load_balancer*
curl -X PUT "https://example.com/load_balancers/0" \  -H "Content-Type: application/json" \  -d '{}'
{  "load_balancer": {    "id": 0,    "name": "string",    "status": "creating",    "load_balancer_type": "string",    "location": "string",    "algorithm": "round_robin",    "public_net": {      "ipv4": "string",      "ipv6": "string"    },    "services": [      {        "protocol": "tcp",        "listen_port": 1,        "destination_port": 1,        "proxyprotocol": true,        "health_check": {          "protocol": "tcp",          "port": 0,          "interval": 0,          "timeout": 0,          "retries": 0,          "http": {            "path": "string",            "status_codes": [              "2??",              "3??"            ]          }        },        "http": {          "sticky_sessions": true        }      }    ],    "targets": [      {        "type": "server",        "server": 0,        "label_selector": "string",        "ip": "string",        "servers": [          0        ],        "health": [          {            "listen_port": 0,            "address": "string",            "status": "healthy"          }        ]      }    ],    "protection": {      "delete": true    },    "labels": {      "property1": "string",      "property2": "string"    },    "created": "2019-08-24T14:15:22Z"  }}

Replace all services

POST
/load_balancers/{id}/actions/update_services

Authorization

headerAuthorizationBearer <token>

Path Parameters

id*integer
Formatint64

Request Body

application/json
  1. body
services*array<>
algorithm?string
Value in"round_robin""least_connections"

Response Body

Action started

application/json
  1. response
action*
curl -X POST "https://example.com/load_balancers/0/actions/update_services" \  -H "Content-Type: application/json" \  -d '{    "services": [      {        "protocol": "tcp",        "listen_port": 1      }    ]  }'
{  "action": {    "id": 0,    "command": "create_server",    "status": "running",    "progress": 0,    "started": "2019-08-24T14:15:22Z",    "finished": "2019-08-24T14:15:22Z",    "resources": [      {        "id": 0,        "type": "server"      }    ],    "error": {      "code": "string",      "message": "string"    }  }}

Add a target

POST
/load_balancers/{id}/actions/add_target

Authorization

headerAuthorizationBearer <token>

Path Parameters

id*integer
Formatint64

Request Body

application/json
  1. body
type*string
Value in"server""label_selector""ip"
server?integer
Formatint64
label_selector?string
ip?string

Response Body

Action started

application/json
  1. response
action*
curl -X POST "https://example.com/load_balancers/0/actions/add_target" \  -H "Content-Type: application/json" \  -d '{    "type": "server"  }'
{  "action": {    "id": 0,    "command": "create_server",    "status": "running",    "progress": 0,    "started": "2019-08-24T14:15:22Z",    "finished": "2019-08-24T14:15:22Z",    "resources": [      {        "id": 0,        "type": "server"      }    ],    "error": {      "code": "string",      "message": "string"    }  }}

Remove a target

POST
/load_balancers/{id}/actions/remove_target

Authorization

headerAuthorizationBearer <token>

Path Parameters

id*integer
Formatint64

Request Body

application/json
  1. body
type*string
Value in"server""label_selector""ip"
server?integer
Formatint64
label_selector?string
ip?string

Response Body

Action started

application/json
  1. response
action*
curl -X POST "https://example.com/load_balancers/0/actions/remove_target" \  -H "Content-Type: application/json" \  -d '{    "type": "server"  }'
{  "action": {    "id": 0,    "command": "create_server",    "status": "running",    "progress": 0,    "started": "2019-08-24T14:15:22Z",    "finished": "2019-08-24T14:15:22Z",    "resources": [      {        "id": 0,        "type": "server"      }    ],    "error": {      "code": "string",      "message": "string"    }  }}
POST
/load_balancers/{id}/actions/change_type

Authorization

headerAuthorizationBearer <token>

Path Parameters

id*integer
Formatint64

Request Body

application/json
  1. body
load_balancer_type*string

Response Body

Changed (finished action)

application/json
  1. response
action*
curl -X POST "https://example.com/load_balancers/0/actions/change_type" \  -H "Content-Type: application/json" \  -d '{    "load_balancer_type": "string"  }'
{  "action": {    "id": 0,    "command": "create_server",    "status": "running",    "progress": 0,    "started": "2019-08-24T14:15:22Z",    "finished": "2019-08-24T14:15:22Z",    "resources": [      {        "id": 0,        "type": "server"      }    ],    "error": {      "code": "string",      "message": "string"    }  }}