Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

haprapi-0.1.1.tar.gz (16.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

haprapi-0.1.1-py3-none-any.whl (17.7 kB view details)

Uploaded Python 3

File details

Details for the file haprapi-0.1.1.tar.gz.

File metadata

  • Download URL: haprapi-0.1.1.tar.gz
  • Upload date:
  • Size: 16.6 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

Hashes for haprapi-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9c15470a6625b3ad92791710038dd42ef7fda1340d7ed04fefd2fc130f3b7625
MD5 61c069f28f4286daa40bf4babc9d20d0
BLAKE2b-256 bf529d5cef449654eb367d7d8bc96eab17a07e84808c4ff538d4be1e7cd0f352

See more details on using hashes here.

File details

Details for the file haprapi-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: haprapi-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 17.7 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

Hashes for haprapi-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0b3c1adf8adf7fa9a479bffb382e19088da62305bd6fc48eb140cec59b11174b
MD5 723154a58d03caffdc05aaf711200ab0
BLAKE2b-256 e9e0adccdcda4a27807f9cd363c716868b62c68401206fa552222f4e19774f64

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page