Simple Python interface for the Varnish management port
Switch branches/tags
Nothing to show
Pull request Compare This branch is 23 commits behind justquick:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
AUTHORS.txt
LICENSE.txt
MANIFEST
README.rst
runtests.py
setup.py
varnish.py

README.rst

Simple Python interface for the Varnish management port

Author: Justin Quick <justquick@gmail.com>, Sandy Walsh <github@darksecretsoftware.com>
Version: 0.1
pip install python-varnish==0.1.2

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 server

This 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.)
  • Unittests

Example:

manager = VarnishManager( ('server1:6082', 'server2:6082') )
manager.run('purge.url', '^/$')
manager.close()

Testing:

python runtests.py