Coder Social home page Coder Social logo

haproxyctl's Introduction

HAProxyctl

HAProxy control tool

Build Status

Build Status

About

HAProxyctl is a tool to manage the various aspects of HAProxy that can be controlled by means of its socket.

With HAProxyctl, it is possible to do the following:

(New in 0.5)

  • Support for Python3.

(New in 0.4)

  • Ability to pass a tcp:// or a unix:// socket address to -k|--socket

(New in 0.3)

  • frontends - Lists available Frontends. Arguments: None
  • backends - Lists available Backends. Arguments: None

(New in 0.2)

  • info - Shows errors on HAProxy instance. Arguments: None
  • enable - Enables given backend/server Arguments: backend,server
  • disable - Disables given backend/server Arguments: backend,server
  • get-weight - Get weight for a given backend/server. Arguments: backend,server
  • set-weight - Set weight for a given backend/server. Arguments: backend,server,weight
  • servers - Lists servers in the given backend Arguments: backend

Modes

HAProxyctl can be used in 2 modes. CLI mode and Python API mode. CLI mode, as the name implies, gives you a command, haproxyctl, that can be used to control HAProxy.

You can use the Python API mode to integrate HAProxyctl directly in your Python project.

Every command in HAProxyctl has at least two methods: getResult and getResultObj.

The method getResult returns a formatted string with the results obtained by executing the given HAProxy command, while getResultObj returns a Python object with the results, making it easy to use this results in some Python code.

CLI Usage

usage: haproxyctl [-h] [-v] [-c COMMAND] [-l] [-H] [-s SERVER] [-b BACKEND]
                  [-w WEIGHT] [-k SOCKET]

Tool to interact with HAProxy

optional arguments:
  -h, --help            show this help message and exit
  -v, --verbose         Be verbose.
  -c COMMAND, --command COMMAND
                        Type of command. Default info
  -l, --list-commands   Lists available commands.
  -H, --help-command    Shows help for the given command.
  -s SERVER, --server SERVER
                        Attempt action on given server.
  -b BACKEND, --backend BACKEND
                        Set backend to act upon.
  -w WEIGHT, --weight WEIGHT
                        Specify weight for a server.
  -k SOCKET, --socket SOCKET
                        Socket to talk to HAProxy. It accepts
                        unix:///path/to/socket or tcp://1.2.3.4[:port]
                        addresses. If there is no match
                        for protocol, then it assumes a UNIX socket file.

haproxyctl's People

Contributors

neurogeek avatar egroeper avatar gordonfierce avatar ticosax avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.