A python library for the HAProxy Runtime API
Project description
HAPrapi
HAPrapi is a Python library for interacting with HAProxy's runtime API. It provides a simple and intuitive interface to manage and monitor HAProxy instances programmatically.
Features
- Connect to HAProxy's runtime API
- Retrieve HAProxy information and statistics
- Manage backend servers (enable/disable)
- Manage frontends (enable/disable)
- Parse and structure HAProxy data
Installation
To install HAPrapi, run the following command:
pip install haprapi
Usage
Here's a basic example of how to use HAPrapi:
from haprapi import Client
# Initialize the client
client = Client('localhost', 9999)
# Get HAProxy information
info = client.get_info()
print(info)
# Get statistics
stats = client.get_stat()
print(stats)
# Enable a server
client.enable_server('backend_name', 'server_name')
# Disable a frontend
client.disable_frontend('frontend_name')
Documentation
For detailed documentation, please refer to the docstrings in the source code.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is open source and available under the GPL-3.0 License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file haprapi-0.1.2.tar.gz.
File metadata
- Download URL: haprapi-0.1.2.tar.gz
- Upload date:
- Size: 16.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.10.6 Linux/6.9.3-76060903-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
47b72fc9b0c67b452a934ca5eaa277641d0bc17ee1d41bc868657464403d0201
|
|
| MD5 |
c14958e11b8a9627b65d7849487a78f1
|
|
| BLAKE2b-256 |
3673c4b8bc719966fe8d4558fef07f7136340aea70dcde13256d797db53db8ac
|
File details
Details for the file haprapi-0.1.2-py3-none-any.whl.
File metadata
- Download URL: haprapi-0.1.2-py3-none-any.whl
- Upload date:
- Size: 17.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.10.6 Linux/6.9.3-76060903-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c4cb3c69b75447167e39aa738d59c5c1ef8b3356edf46903fad7b0acc7eff0e
|
|
| MD5 |
44c457b983e38797269498bd7cda99c6
|
|
| BLAKE2b-256 |
03c0b502fe5a534b91312a52349e39afe8608f0258d5dace06fb2e8b00afdcbb
|