Setup HTTP Server for Pomegranate File System

macan edited this page Dec 22, 2010 · 3 revisions

Setup a HTTP Server to access Pomegranate FS


  1. Python (>=2.5)
  2. Cherrypy Module (>=3.1)

We have written a small HTTP server in Python with Cherrypy. This server can serve REST-like HTTP requests, such as PUT, GET, POST, and DELETE (refer to REST API). There is also a simple python client to describe how to use python httplib to access the server.

import httplib
import time

# Prepare a connection
conn = httplib.HTTPConnection("")

# Build the header
headers = {
    "Host" : "hvfs://global",
    "Command" : "list",
    "Args" : "/",
    "Date" : time.ctime(),

# Make a request and send it
conn.request("GET", "/hvfs", "", headers)

# Get the response
r1 = conn.getresponse()

# Read the response data and display them
data1 =
print r1.status, r1.reason
print data1

By executing it, you can get the following result:

200 OK
- 100644         200000000008 a
- 100644         200000000009 b

Start it up!

$ cd test/python
$ python