curl --request GET \ --url 'https://api.e2enetworks.com/myaccount/api/v1/appliances/load-balancers/{lb_id}/historical_data/?project_id=<PROJECT_ID>&apikey=<API_KEY>&location=<LOCATION>' \ --header 'Authorization: Bearer <API_TOKEN>'import requests
response = requests.get( "https://api.e2enetworks.com/myaccount/api/v1/appliances/load-balancers/{lb_id}/historical_data/", params={"project_id": "<PROJECT_ID>", "apikey": "<API_KEY>", "location": "<LOCATION>"}, headers={"Authorization": "Bearer <API_TOKEN>"},)print(response.json())const url = new URL("https://api.e2enetworks.com/myaccount/api/v1/appliances/load-balancers/{lb_id}/historical_data/");url.search = new URLSearchParams({ project_id: "<PROJECT_ID>", apikey: "<API_KEY>", location: "<LOCATION>" });
const response = await fetch(url, { method: "GET", headers: { "Authorization": "Bearer <API_TOKEN>" },});console.log(await response.json());Returns historical (time-series) HAProxy metrics for a load balancer, sourced from Prometheus. The metric is selected by the metric_name query parameter and the look-back window by interval (in seconds). Frontend metrics return data for the load balancer’s frontend; backend metrics return data for the backend named by the server parameter.
The HTTP response-code metrics (haproxy_backend_http_responses_total, haproxy_frontend_http_responses_total) return the current value bucketed by response class - labels is ["2xx","3xx","4xx","5xx"] and results holds the matching counts. All other metrics return a range series over interval. See metric_name for the full list of metrics the console requests.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The id of the load balancer, as returned by the List Load Balancers endpoint.
Example
12345Query Parameters
Section titled “Query Parameters”Name of the HAProxy/Prometheus metric to fetch. The backend does not restrict this to a fixed enum (any metric the HAProxy exporter publishes will work), but the console requests the specific frontend and backend metrics listed below. Defaults to haproxy_backend_http_responses_total.
Example
haproxy_backend_http_responses_totalLook-back window in seconds for the time-series query. Defaults to 3600 (1 hour).
Example
3600Name of the backend to scope backend metrics to. Defaults to the load balancer’s first backend.
Example
backend-group-1Identifier of the project to scope the request to. Required integer project ID.
Example
<PROJECT_ID>API key used to authenticate the request
Example
<API_KEY>Region of the load balancer.
Example
<LOCATION>Responses
Section titled “Responses”Successful response
For the HTTP response-code metrics, labels holds the response classes and results the matching counts. For range metrics, labels holds timestamps and results the per-timestamp values.
object
object
Series labels (response classes for response-code metrics, timestamps for range metrics).
Series values aligned with labels.
object
Example
{ "code": 200, "data": { "labels": [ "2xx", "3xx", "4xx", "5xx" ], "results": [ "0", "0", "0", "2" ] }, "message": "Success"}