NAME Pcapstore2Alpha2 HTTP

Pcapstore2Alpha2 HTTP Interface


SYNOPSIS

    http://pcap.lbl.gov:9876/cgi-bin/Pcapstore/commit
    http://pcap.lbl.gov:9876/cgi-bin/Pcapstore/object
    http://pcap.lbl.gov:9876/cgi-bin/Pcapstore/vue.pl
    # To upload a file
    curl -F upload=@localfile.txt;type=text/plain;filename=newname.txt http://pcap.lbl.gov:9876/cgi-bin/Pcapstore/commit
    # returns object ID in line with header 'X-Pcapstore-id:'
    # To access file content
    curl http://pcap.lbl.gov:9876/cgi-bin/Pcapstore/object/ID
    # where 'ID' is a Pcapstore object ID
    # file contents returned via standard output
    # To access file properties and information
    curl -I http://pcap.lbl.gov:9876/cgi-bin/Pcapstore/object/ID
    # where 'ID' is a Pcapstore object ID
    # file properties returned both as HTTP headers and from stdout
    # For browser-based access, 'vue.pl' might be more conventient
    curl http://pcap.lbl.gov:9876/cgi-bin/Pcapstore/vue.pl/ID/FILENAME
    # where 'ID' is a Pcapstore object ID
    # and 'FILENAME' is the desired filename


OVERVIEW

This document describes the protocol used between clients using the Pcapstore2Alpha2 library and the server processes. This document articulates the details of this protocol to support ad hoc access by command line tools and to allow interoperable access from multiple environments.


STANDARDS COMPLIANCE

The Pcapstore2Alpha2 protocol is designed within the framework of HTTP. All Pcapstore2Alpha2 interactions must comply with the HTTP protocol to support the broadest possible range of options for implementing client as well as server components. All Pcapstore2Alpha2 functionality must comply with standard HTTP (version 1.1 at the time of this writing). is supported by the use of extension headers.

Standard HTTP Header Utilization

As stated earlier, the published standards and specifications for HTTP are authoritative for all Pcapstore2Alpha2 transactions and servers must use and interpret all standard headers in a manner compliant with all effective standards. Specifics on particular HTTP headers are not intended to redefine header semantics but indicate how particular parts of Pcapstore use the standard headers.

Status

Content-Type

Content-Length

Pcapstore2Alpha2 Extension Headers

X-Pcapstore-id

This header is reserved for server use to return ID's for Pcapstore objects.

X-pcapstore-sysproperty

This header is used by servers to deliver standard system properties to clients. Specifically, all properties delivered with this header are defined in the 'sys' namespace which is reserved for Pcapstore internal use.

X-pcapstore-clientproperty

This header is used by servers to deliver user-defined properties to clients. The 'client' namespace is reserved for use by applications and shall never be used by Pcapstore.


SYSTEM BEHAVIOR

Mapping between HTTP and API properties

property names must start with a letter, and may only use letters and the hyphen character.

property names are case-insensitive, and upper-case letters are quietly folded to lower case by the API.

property names may be at most thirty-two characters in length.

property names are internally defined in namespaces.

At this time only the 'sys' namespace, reserved for the sole use of Pcapstore2Alpha2, is used for Pcapstore-defined properties.

The 'client' namespace is reserved for user-defined properties, but is not yet in active use.

Several examples of how properties are mapped:

The 'mimetype' property is one of the standard properties used by Pcapstore2Alpha2 and as such it appears in the 'sys' namespace. So its value will appear as follows:

    X-pcapstore-sysproperty-mimetype: mime/type

Client properties when fully implemented will appear as something like the following:

    X-pcapstore-clientproperty-propertyname: propertyvalue

Client Behavior

Pcapstore2Alpha2 clients

Server Behavior

The first requirement for Pcapstore2Alpha2 servers is that


REPOSITORY MANAGEMENT

Access Control

The URL's described here define the exclusive point of access for all Pcapstore2Alpha2 processes, so access controls can be applied to the system by applying access controls to the URL's. One may lock out new objects by restricting access to the commit URL while leaving the other URL's intact.