{ "info": { "author": "Pavlos Parissis", "author_email": "pavlos.parissis@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Information Technology", "Intended Audience :: System Administrators", "Natural Language :: English", "Operating System :: POSIX", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.4", "Topic :: Utilities" ], "description": ".. haproxyadmin\n.. README.rst\n\n============\nhaproxyadmin\n============\n\n *A Python library to manage HAProxy via stats socket.*\n\n.. contents::\n\n\nIntroduction\n------------\n\n**haproxyadmin** is a Python library for interacting with `HAProxy`_\nload balancer to perform operations such as enabling/disabling servers.\nIt does that by issuing the appropriate commands over the `stats socket`_\nprovided by HAProxy. It also uses that stats socket for retrieving\nstatistics and changing settings.\n\nHAProxy is a multi-process daemon and each process can only be accessed by a\ndistinct stats socket. There isn't any shared memory for all these processes.\nThat means that if a frontend or backend is managed by more than one processes,\nyou have to find which stats socket you need to send the query/command.\nThis makes the life of a sysadmin a bit difficult as he has to keep track of\nwhich stats socket to use for a given object(frontend/backend/server).\n\n**haproxyadmin** resolves this problem by presenting objects as single entities\neven when they are managed by multiple processes. It also supports aggregation\nfor various statistics provided by HAProxy. For instance, to report the\nrequests processed by a frontend it queries all processes which manage that\nfrontend and return the sum.\n\nThe library works with Python 2.7 and Python 3.6, but for development and\ntesting Python 3.6 is used. The `Six Python 2 and 3 Compatibility Library`_\nis being used to provide the necessary wrapping over the differences between\nthese 2 major versions of Python.\n\n\n.. code-block:: python\n\n\n >>> from haproxyadmin import haproxy\n >>> hap = haproxy.HAProxy(socket_dir='/run/haproxy')\n >>> frontends = hap.frontends()\n >>> for frontend in frontends:\n ... print(frontend.name, frontend.requests, frontend.process_nb)\n ...\n frontend_proc2 0 [2]\n haproxy 0 [4, 3, 2, 1]\n frontend_proc1 0 [1]\n frontend1_proc34 0 [4, 3]\n frontend2_proc34 0 [4, 3]\n >>>\n >>>\n >>> backends = hap.backends()\n >>> for backend in backends:\n ... print(backend.name, backend.requests, backend.process_nb)\n ... servers = backend.servers()\n ... for server in servers:\n ... print(\" \", server.name, server.requests)\n ...\n backend_proc2 100 [2]\n bck_proc2_srv4_proc2 25\n bck_proc2_srv3_proc2 25\n bck_proc2_srv1_proc2 25\n bck_proc2_srv2_proc2 25\n haproxy 0 [4, 3, 2, 1]\n backend1_proc34 16 [4, 3]\n bck1_proc34_srv1 6\n bck_all_srv1 5\n bck1_proc34_srv2 5\n backend_proc1 29 [1]\n member2_proc1 14\n member1_proc1 15\n bck_all_srv1 0\n backend2_proc34 100 [4, 3]\n bck2_proc34_srv2 97\n bck2_proc34_srv1 2\n bck_all_srv1 1\n >>>\n\n\nThe documentation of the library is available at http://haproxyadmin.readthedocs.org\n\n\nFeatures\n--------\n\n- HAProxy in multi-process mode (nbproc >1)\n- UNIX stats socket, no support for querying HTTP statistics page\n- Frontend operations\n- Backend operations\n- Server operations\n- ACL operations\n- MAP operations\n- Aggregation on various statistics\n- Change global options for HAProxy\n\n\nInstallation\n------------\n\nUse pip::\n\n pip install haproxyadmin\n\nFrom Source::\n\n sudo python setup.py install\n\nBuild (source) RPMs::\n\n python setup.py clean --all; python setup.py bdist_rpm\n\nBuild a source archive for manual installation::\n\n python setup.py sdist\n\nRelease\n-------\n\n#. Bump versions in docs/source/conf.py and haproxyadmin/__init__.py\n\n#. Commit above change with::\n\n git commit -av -m'RELEASE 0.1.3 version'\n\n#. Create a signed tag, pbr will use this for the version number::\n\n git tag -s 0.1.3 -m 'bump release'\n\n#. Create the source distribution archive (the archive will be placed in the **dist** directory)::\n\n python setup.py sdist\n\n#. pbr will update ChangeLog file and we want to squeeze them to the previous commit thus we run::\n\n git commit -av --amend\n\n#. Move current tag to the last commit::\n\n git tag -fs 0.1.3 -m 'bump release'\n\n#. Push changes::\n\n git push;git push --tags\n\n\nDevelopment\n-----------\nI would love to hear what other people think about **haproxyadmin** and provide\nfeedback. Please post your comments, bug reports, wishes on my `issues page\n`_.\n\nLicensing\n---------\n\nApache 2.0\n\n\nAcknowledgement\n---------------\nThis program was originally developed for Booking.com. With approval\nfrom Booking.com, the code was generalised and published as Open Source\non github, for which the author would like to express his gratitude.\n\nContacts\n--------\n\n**Project website**: https://github.com/unixsurfer/haproxyadmin\n\n**Author**: Pavlos Parissis \n\n.. _HAProxy: http://www.haproxy.org/\n.. _stats socket: http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#9.2\n.. _Six Python 2 and 3 Compatibility Library: https://pythonhosted.org/six/", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "haproxy", "license": "Apache 2.0", "maintainer": "Pavlos Parissis", "maintainer_email": "pavlos.parissis@gmail.com", "name": "haproxyadmin", "package_url": "https://pypi.org/project/haproxyadmin/", "platform": "", "project_url": "https://pypi.org/project/haproxyadmin/", "project_urls": null, "release_url": "https://pypi.org/project/haproxyadmin/0.2.2/", "requires_dist": null, "requires_python": "", "summary": "A library to work with HAProxy via the stats socket", "version": "0.2.2" }, "last_serial": 5129356, "releases": { "0.2.1": [ { "comment_text": "", "digests": { "md5": "7d63931b0f0ecbebcb22c60a663d45d6", "sha256": "8121b2c12b7cdc520dab302e74411ba12688b38189e239a3c17c3c8e0453ffc4" }, "downloads": -1, "filename": "haproxyadmin-0.2.1.tar.gz", "has_sig": true, "md5_digest": "7d63931b0f0ecbebcb22c60a663d45d6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 55275, "upload_time": "2016-04-11T12:38:49", "url": "https://files.pythonhosted.org/packages/f4/0b/92e53fd58820f9b2daf2a27d952f2a74d1a118c81c31f21270e94c69ed01/haproxyadmin-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "b240ec1be1deb33bd1d8358976cf5879", "sha256": "6ca3158d50af87f59449c2bd2d9ece19d3c358326bc3fd09c0114cd537e2f46b" }, "downloads": -1, "filename": "haproxyadmin-0.2.2.tar.gz", "has_sig": false, "md5_digest": "b240ec1be1deb33bd1d8358976cf5879", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 55461, "upload_time": "2019-04-11T14:53:00", "url": "https://files.pythonhosted.org/packages/12/43/75b6c063ab78b5349b0faaa3c2f4c7728d2a6af4830ee4a34fada1ae69ed/haproxyadmin-0.2.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b240ec1be1deb33bd1d8358976cf5879", "sha256": "6ca3158d50af87f59449c2bd2d9ece19d3c358326bc3fd09c0114cd537e2f46b" }, "downloads": -1, "filename": "haproxyadmin-0.2.2.tar.gz", "has_sig": false, "md5_digest": "b240ec1be1deb33bd1d8358976cf5879", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 55461, "upload_time": "2019-04-11T14:53:00", "url": "https://files.pythonhosted.org/packages/12/43/75b6c063ab78b5349b0faaa3c2f4c7728d2a6af4830ee4a34fada1ae69ed/haproxyadmin-0.2.2.tar.gz" } ] }