octavia.amphorae.backends.utils package

octavia.amphorae.backends.utils package


octavia.amphorae.backends.utils.haproxy_query module

class HAProxyQuery(stats_socket)[source]

Bases: object

Class used for querying the HAProxy statistics socket.

The CSV output is defined in the HAProxy documentation:



Get status for each server and the pool as a whole.

Returns:pool data structure {<pool-name>: { ‘uuid’: <uuid>, ‘status’: ‘UP’|’DOWN’, ‘members’: [<name>: ‘UP’|’DOWN’|’DRAIN’|’no check’] }}

Get and parse output from ‘show info’ command.

show_stat(proxy_iid=-1, object_type=-1, server_id=-1)[source]

Get and parse output from ‘show status’ command.

  • proxy_iid – Proxy ID (column 27 in CSV output). -1 for all.
  • object_type – Select the type of dumpable object. Values can be ORed. -1 - everything 1 - frontends 2 - backends 4 - servers
  • server_id – Server ID (column 28 in CSV output?), or -1 for everything.

stats (split into an array by newline)

Module contents

Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.