HAProxy Data Plane API (1.0)

Download OpenAPI specification:Download

API for editing and managing haproxy instances. Provides process information, configuration management, haproxy stats and logs.

Authentication

basic_auth

Security scheme type: HTTP
HTTP Authorization Scheme basic

Discovery

API autodiscover endpoints

Return list of root endpoints

Returns a list of root endpoints.

Authorizations:

Responses

200

Success

default

General Error

get /
/v1/

Response samples

application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Return list of service endpoints

Returns a list of API managed services endpoints.

Authorizations:

Responses

200

Success

default

General Error

get /services
/v1/services

Response samples

application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Return list of HAProxy related endpoints

Returns a list of HAProxy related endpoints.

Authorizations:

Responses

200

Success

default

General Error

get /services/haproxy
/v1/services/haproxy

Response samples

application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Return list of HAProxy stats endpoints

Returns a list of HAProxy stats endpoints.

Authorizations:

Responses

200

Success

default

General Error

get /services/haproxy/stats
/v1/services/haproxy/stats

Response samples

application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Return list of HAProxy advanced configuration endpoints

Returns a list of endpoints to be used for advanced configuration of HAProxy objects.

Authorizations:

Responses

200

Success

default

General Error

get /services/haproxy/configuration
/v1/services/haproxy/configuration

Response samples

application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Information

Return HAProxy process information

Return HAProxy process information

Authorizations:

Responses

200

Success

default

General Error

get /services/haproxy/info
/v1/services/haproxy/info

Response samples

application/json
Copy
Expand all Collapse all
{
  • "haproxy":
    {
    }
}

Specification

Data Plane API Specification

Return Data Plane API OpenAPI specification

Authorizations:

Responses

200

Success

default

General Error

get /specification
/v1/specification

Response samples

application/json
Copy
Expand all Collapse all
{ }

Transactions

Managing transactions. Configuration changes can be grouped in the transaction. You start the transaction with trasactions POST, and call the configuration changes you need with parameter transaction_id. When you want to commit the transaction, you call the transactions PUT and all changes in that transaction is commited. If you call a configuration change without the transaction_id, transaction mechanism is implicitly called with one operation in transaction.

Return list of HAProxy configuration transactions.

Returns a list of HAProxy configuration transactions. Transactions can be filtered by their status.

Authorizations:
query Parameters
status
string
Enum:"failed" "in_progress"

Filter by transaction status

Responses

200

Success

default

General Error

get /services/haproxy/transactions
/v1/services/haproxy/transactions

Response samples

application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Start a new transaction

Starts a new transaction and returns it's id

Authorizations:
query Parameters
version
required
integer

Configuration version on which to work on

Responses

201

Transaction started

default

General Error

post /services/haproxy/transactions
/v1/services/haproxy/transactions

Response samples

application/json
Copy
Expand all Collapse all
{
  • "_version": 2,
  • "id": "273e3385-2d0c-4fb1-aa27-93cbb31ff203",
  • "status": "in_progress"
}

Delete a transaction

Deletes a transaction.

Authorizations:
path Parameters
id
required
string

Transaction id

Responses

204

Transaction deleted

404

The specified resource was not found

default

General Error

delete /services/haproxy/transactions/{id}
/v1/services/haproxy/transactions/{id}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "code": 0,
  • "message": "string",
  • "property1": "string",
  • "property2": "string"
}

Return one HAProxy configuration transactions

Returns one HAProxy configuration transactions.

Authorizations:
path Parameters
id
required
string

Transaction id

Responses

200

Successful operation

404

The specified resource was not found

default

General Error

get /services/haproxy/transactions/{id}
/v1/services/haproxy/transactions/{id}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "_version": 2,
  • "id": "273e3385-2d0c-4fb1-aa27-93cbb31ff203",
  • "status": "in_progress"
}

Commit transaction

Commit transaction, execute all operations in transaction and return msg

Authorizations:
path Parameters
id
required
string

Transaction id

query Parameters
force_reload
boolean
Default: false

If set, do a force reload, do not wait for the configured reload-delay. Cannot be used when transaction is specified, as changes in transaction are not applied directly to configuration.

Responses

200

Transaction succesfully commited

202

Configuration change accepted and reload requested

400

Bad request

404

The specified resource was not found

default

General Error

put /services/haproxy/transactions/{id}
/v1/services/haproxy/transactions/{id}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "_version": 2,
  • "id": "273e3385-2d0c-4fb1-aa27-93cbb31ff203",
  • "status": "in_progress"
}

Reloads

Checking reload success. To avoid constant reloading we reload in intervals that are configurable when with reload-delay option. When a change to configuration is made and force_reload url query string parameter is false we issue a request for reload, and return the reload ID in response header. You can then use reloads endpoints to check the status of that reload ID. If force_reload is true, we override all of this and reload immediately.

Return list of HAProxy Reloads.

Returns a list of HAProxy reloads.

Authorizations:

Responses

200

Success

default

General Error

get /services/haproxy/reloads
/v1/services/haproxy/reloads

Response samples

application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Return one HAProxy reload status

Returns one HAProxy reload status.

Authorizations:
path Parameters
id
required
string^\d{4}-\d{2}-\d{2}-\d+$

Reload id

Responses

200

Successful operation

404

The specified resource was not found

default

General Error

get /services/haproxy/reloads/{id}
/v1/services/haproxy/reloads/{id}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": "2019-01-03-44",
  • "status": "in_progress"
}

Sites

Managing sites (simple configuration mode). Sites are considered as one frontend with multiple backends connected to it via default_backend or use-backend directives.

Return an array of sites

Returns an array of all configured sites.

Authorizations:
query Parameters
transaction_id
string

ID of the transaction where we want to add the operation. Cannot be used when version is specified.

Responses

200

Successful operation

default

General Error

get /services/haproxy/sites
/v1/services/haproxy/sites

Response samples

application/json
Copy
Expand all Collapse all
{
  • "_version": 0,
  • "data":
    [
    ]
}

Add a site

Adds a new site to the configuration file.

Authorizations:
query Parameters
transaction_id
string

ID of the transaction where we want to add the operation. Cannot be used when version is specified.

version
integer

Version used for checking configuration version. Cannot be used when transaction is specified, transaction has it's own version.

force_reload
boolean
Default: false

If set, do a force reload, do not wait for the configured reload-delay. Cannot be used when transaction is specified, as changes in transaction are not applied directly to configuration.

Request Body schema: application/json
farms
Array of objects
name
required
string^[A-Za-z0-9-_.:]+$
service