Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/justquick/python-varnish
Simple Python interface for the Varnish management port
https://github.com/justquick/python-varnish
Last synced: 14 days ago
JSON representation
Simple Python interface for the Varnish management port
- Host: GitHub
- URL: https://github.com/justquick/python-varnish
- Owner: justquick
- License: bsd-3-clause
- Created: 2009-09-24T15:45:19.000Z (about 15 years ago)
- Default Branch: master
- Last Pushed: 2021-09-08T20:31:51.000Z (about 3 years ago)
- Last Synced: 2024-10-15T08:45:06.970Z (30 days ago)
- Language: Python
- Homepage:
- Size: 239 KB
- Stars: 135
- Watchers: 12
- Forks: 42
- Open Issues: 9
-
Metadata Files:
- Readme: README.rst
- License: LICENSE.txt
Awesome Lists containing this project
README
Simple Python interface for the Varnish management port
=========================================================:Author:
Justin Quick , Sandy Walsh
:Version: 0.2::
pip install python-varnish==0.2.1
If you are running a version of varnish older than 3.0 then install python-varnish==0.1.2 instead.
Varnish is a state-of-the-art, high-performance HTTP accelerator.
For more information checkout `Varnish Site `_Varnish provides a simple telnet management interface for doing things like:
* reloading configurations
* purging URLs from cache
* view statistics
* start and stop the serverThis Python API takes full advantage of the available commands and can run
across multiple Varnish instances. Here are the features of this python module
(compared to `python-varnishadm `_)* Uses ``telnetlib`` instead of raw sockets
* Implements ``threading`` module
* Can run commands across multiple Varnish instances
* More comprehensive methods, closely matching the management API (``purge_*``, ``vcl_*``, etc.)
* UnittestsExample::
manager = VarnishManager( ('server1:6082', 'server2:6082') )
manager.run('ping')
manager.run('ban.url', '^/secret/$')
manager.run('ban.list')
manager.run('purge.url', 'http://mydomain.com/articles/.*')
manager.close()Testing::
python runtests.py