wiki:Extensions

Version 9 (modified by warner, at 2009-01-14T23:43:07Z) (diff)

wapi.txt got renamed back to webapi.txt

Extension Development

Tahoe has a programmatic API which enables building custom applications on top of the storage infrastructure. This RESTful interface uses HTTP, so extensions can be implemented as separate processes across a network.

Extension Projects

None known yet...

Extension Implementation Issues

Caching Tips

Tahoe URIs may refer to either immutable or mutable content. URIs for immutable data are simple to cache by mapping the URI to the contents.

Mutability is independent of read-only capabilities. A read-only capability may refer to mutable content.

To determine the mutability of a URI, parse the second field of the URI (delimited by ':'):

  • URI:CHK:... : immutable
  • URI:LIT:... : immutable
  • URI:DIR:... : mutable, writable
  • URI:DIR-RO:... : mutable, not writable

Note: Currently all files are immutable, and all directories are mutable, but in the future the node type (file or directory) and the mutability will be independent. It's a bad idea to rely on the node type to determine mutability.

HTTP methods

The api relies on four HTTP methods defined as per the standard GET, POST, PUT, and DELETE, which map intuitively to storage operations.

Although these are standard HTTP methods, some clients do not offer good support for them.

  • The following clients are known to support all methods:
    • curl is an open source client which supports arbitrary methods with the '-X' option.
  • The following clients do not seem to support either PUT and DELETE:
    • ...
  • We have not yet determined if the following have support for arbitrary methods:
    • Common web browsers.
    • Python 2.5's stdlib:
      • httplib
      • urllib

Race Conditions

Race conditions commonly exist in programs which use traditional directory structure interfaces. The webapi.txt document describes how to avoid many of these situations by relying on file URI's, instead of their vdrive names.