Skip to content

Commit

Permalink
reformat documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Frank Wall committed Dec 5, 2023
1 parent 2f63cd9 commit 4b933e6
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 50 deletions.
66 changes: 43 additions & 23 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
58 changes: 31 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -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]
Expand All @@ -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.

0 comments on commit 4b933e6

Please sign in to comment.