Load Balancers /
Create load balancer
Creates a new load balancer
Required permission
Account > LoadBalancers > General > Create
Request body
- {object}
name
string requiredThe name of the load balancer.min length3max length39pattern^[a-zA-Z]((-|\s)?[a-zA-Z0-9]+((-|\s)[a-zA-Z0-9]+)*)?$description
stringThe description of the load balancer.max length200pattern^[a-zA-Z0-9.,?\s\\/'"()[\];`%^&*\-_:!]+$spec
{object} requiredLoad balancer specification
Response body
- {object}Response object.
data
{object} requiredResult data.id
string requiredID of the load balancerpattern^[A-Za-z0-9-]+$name
string requiredThe name of the load balancer.min length3max length39pattern^[a-zA-Z]((-|\s)?[a-zA-Z0-9]+((-|\s)[a-zA-Z0-9]+)*)?$description
stringThe description of the load balancer.max length200pattern^[a-zA-Z0-9.,?\s\\/'"()[\];`%^&*\-_:!]+$spec
{object} requiredLoad balancer specificationstate
{object}endpoints
[array]Public IP addresses (endpoints) of the load balancer- string
status
string requiredCurrent status of the load balancerone ofpending, provisioning, provisioned, error, deleting, deletedlastTransitionTime
string requiredTime of the last status transitioncreatedAt
string requiredThe time the load balancer was created.updatedAt
string requiredThe time the load balancer was last updated.
API
CLI
JS Client
POST /v1/load-balancers
Example request
Request body
curl --header "Content-Type: application/json" \
--header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
--request POST \
--data '{"name":"my-load-balancer","description":"This is a new load balancer.","spec":{"type":"tcp","target":{"type":"region","targetId":"europe-west"},"ports":[{"id":"port-80","backends":[{"id":"my-project/my-service","type":"service","port":3000,"weight":1}]}]}}' \
https://api.northflank.com/v1/load-balancersExample response
200 OK
Details about the newly created load balancer.
JSON
{
"data": {
"id": "my-load-balancer",
"name": "my-load-balancer",
"description": "This is a new load balancer.",
"spec": {
"type": "tcp",
"target": {
"type": "region",
"targetId": "europe-west"
},
"ports": [
{
"id": "port-80",
"backends": [
{
"id": "my-project/my-service",
"type": "service",
"port": 3000,
"weight": 1
}
]
}
]
},
"state": {
"status": "provisioned"
},
"createdAt": "2021-01-20T11:19:53.175Z",
"updatedAt": "2021-01-20T11:19:53.175Z"
}
}