diff --git a/CHANGELOG.md b/CHANGELOG.md index ed549b3..6e8b1c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,23 +1,43 @@ -2015 May, 19. - 0.4 - - Added support for specifying sockets as a TCP socket: - - support for -k tcp://1.2.3.4:port - - support for -k unix:///some/path - -2013 Nov, 4. - 0.3.1 - - Fixed wrong self accidentally passed to self._getResult. - -2013 Oct, 31. - 0.3 - - Added new commands (frontends, backends) - -2013 May, 8. - 0.2 - - Added new commands (get weight, set weight, servers) - - Fixed problems with the buffer size while reading from the socket. - - Restructured command execution and arguments in haproxyctl - -2013 May, 7. - 0.1 - - Initial development. +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). + +## v0.5.0 - 2015-05-24 + +### Changed +* Support for Python3 + +## v0.4.0 - 2015-05-19 + +### Added +* Added support for specifying sockets as a TCP socket: +* support for -k tcp://1.2.3.4:port +* support for -k unix:///some/path + +## v0.3.1 - 2013-11-04 + +### Fixed +* Fixed wrong self accidentally passed to self._getResult. + +## v0.3.0 - 2013-10-31 + +### Added +* Added new commands (frontends, backends) + +## v0.2.0 - 2013-05-08 + +### Added +* Added new commands (get weight, set weight, servers) + +### Changed +* Restructured command execution and arguments in haproxyctl + +### Fixed +* Fixed problems with the buffer size while reading from the socket. + +## v0.1.0 - 2013-05-07 + +Initial release of haproxyctl. diff --git a/README.md b/README.md index f2f1fd7..bf71e72 100644 --- a/README.md +++ b/README.md @@ -1,49 +1,47 @@ -haproxy-cli -========== +# haproxy-cli -A tool to interact with HAProxy +[![CI](https://github.com/andeman/opn-cli/actions/workflows/build.yaml/badge.svg)](https://github.com/andeman/opn-cli/actions/workflows/build.yaml) +[![PyPI version](https://badge.fury.io/py/opn-cli.svg)](https://badge.fury.io/py/opn-cli) -About --------- +haproxy-cli - A tool to interact with HAProxy. -haproxy-cli is a tool to manage the various aspects of HAProxy that can be controlled by means of its socket. +#### Table of Contents -With haproxy-cli, it is possible to do the following: +1. [Overview](#overview) +1. [Install](#install) +1. [Modes](#modes) +1. [CLI Usage](#cli-usage) +1. [Development](#development) + - [Contributing](#contributing) -(New in 0.5) -* Support for Python3. -(New in 0.4) -* Ability to pass a tcp:// or a unix:// socket address to -k|--socket +## Overview -(New in 0.3) -* frontends - Lists available Frontends. Arguments: None -* backends - Lists available Backends. Arguments: None +haproxy-cli is a tool to manage the various aspects of HAProxy that can be controlled by means of its socket. +It is based on [haproxyctl](https://github.com/neurogeek/haproxyctl/) and is actively used in the OPNsense [HAProxy plugin](https://github.com/opnsense/plugins). -(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 +## Install + +``` +pip install haproxy-cli +``` -Modes ------ +## Modes -haproxy-cli can be used in 2 modes. CLI mode and Python API mode. +haproxy-cli can be used in 2 modes: CLI mode and Python API mode. CLI mode, as the name implies, gives you a command, haproxy-cli, that can be used to control HAProxy. You can use the Python API mode to integrate haproxy-cli directly in your Python project. -Every command in haproxy-cli has at least two methods: getResult and getResultObj. +Every command in haproxy-cli 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 ---------- +## CLI Usage ``` +$ haproxy-cli --help + usage: haproxy-cli [-h] [-v] [-c COMMAND] [-l] [-H] [-s SERVER] [-b BACKEND] [-w WEIGHT] [-k SOCKET] @@ -68,3 +66,9 @@ optional arguments: addresses. If there is no match for protocol, then it assumes a UNIX socket file. ``` + +## Development + +### Contributing + +Please use the GitHub issues functionality to report any bugs or requests for new features. Feel free to fork and submit pull requests for potential contributions.