Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified docs/frontends/webapi.rst

    rb7e76c7 r705dc85  
    7272======================================
    7373
    74 As described in :doc:`../architecture`, each file and directory in a Tahoe
    75 virtual filesystem is referenced by an identifier that combines the
     74As described in :doc:`../architecture`, each file and directory in a
     75Tahoe-LAFS file store is referenced by an identifier that combines the
    7676designation of the object with the authority to do something with it (such as
    7777read or modify the contents). This identifier is called a "read-cap" or
     
    9494operations are required to have no side-effects.
    9595
    96 PUT is used to upload new objects into the filesystem, or to replace an
     96PUT is used to upload new objects into the file store, or to replace an
    9797existing link or the contents of a mutable file. DELETE is used to unlink
    9898objects from directories. Both PUT and DELETE are required to be idempotent:
     
    108108also be done with a POST.
    109109
    110 Tahoe's web API is designed for two different kinds of consumer. The first is
    111 a program that needs to manipulate the virtual file system. Such programs are
     110Tahoe-LAFS' web API is designed for two different kinds of consumer. The
     111first is a program that needs to manipulate the file store. Such programs are
    112112expected to use the RESTful interface described above. The second is a human
    113 using a standard web browser to work with the filesystem. This user is given
    114 a series of HTML pages with links to download files, and forms that use POST
    115 actions to upload, rename, and unlink files.
     113using a standard web browser to work with the file store. This user is
     114presented with a series of HTML pages with links to download files, and forms
     115that use POST actions to upload, rename, and unlink files.
    116116
    117117When an error occurs, the HTTP response code will be set to an appropriate
     
    333333
    334334Now that we know how to build URLs that refer to files and directories in a
    335 Tahoe virtual filesystem, what sorts of operations can we do with those URLs?
     335Tahoe-LAFS file store, what sorts of operations can we do with those URLs?
    336336This section contains a catalog of GET, PUT, DELETE, and POST operations that
    337337can be performed on these URLs. This set of operations are aimed at programs
     
    420420
    421421 This uploads a file, and produces a file-cap for the contents, but does not
    422  attach the file into the filesystem. No directories will be modified by
     422 attach the file into the file store. No directories will be modified by
    423423 this operation. The file-cap is returned as the body of the HTTP response.
    424424
     
    436436 Create a new empty directory and return its write-cap as the HTTP response
    437437 body. This does not make the newly created directory visible from the
    438  filesystem. The "PUT" operation is provided for backwards compatibility:
     438 file store. The "PUT" operation is provided for backwards compatibility:
    439439 new code should use POST.
    440440
     
    808808under that name.
    809809
    810 Note however, that if the edge in the Tahoe filesystem points to a mutable
    811 file and the contents of that mutable file is changed, then the
     810Note however, that if the edge in the Tahoe-LAFS file store points to a
     811mutable file and the contents of that mutable file is changed, then the
    812812'tahoe':'linkmotime' value on that edge will *not* be updated, since the
    813813edge itself wasn't updated -- only the mutable file was.
     
    836836"tahoe backup" command (in Tahoe v1.3.0 and later) to set the 'mtime' and
    837837'ctime' values when backing up files from a local filesystem into the
    838 Tahoe filesystem. As of Tahoe v1.4.0, the set_children API cannot be used
    839 to set anything under the 'tahoe' key of the metadata dict -- if you
     838Tahoe-LAFS file store. As of Tahoe v1.4.0, the set_children API cannot be
     839used to set anything under the 'tahoe' key of the metadata dict -- if you
    840840include 'tahoe' keys in your 'metadata' arguments then it will silently
    841841ignore those keys.
     
    865865
    8668661. You might be confused about whether it reflects the time of the creation
    867    of a link in the Tahoe filesystem (by a version of Tahoe < v1.7.0) or a
    868    timestamp copied in by "tahoe backup" from a local filesystem.
     867   of a link in the Tahoe-LAFS file store (by a version of Tahoe < v1.7.0)
     868   or a timestamp copied in by "tahoe backup" from a local filesystem.
    869869
    8708702. You might be confused about whether it is a copy of the file creation
     
    896896
    897897 This attaches a child object (either a file or directory) to a specified
    898  location in the virtual filesystem. The child object is referenced by its
     898 location in the Tahoe-LAFS file store. The child object is referenced by its
    899899 read- or write- cap, as provided in the HTTP request body. This will create
    900900 intermediate directories as necessary.
     
    10091009This section describes the HTTP operations that provide support for humans
    10101010running a web browser. Most of these operations use HTML forms that use POST
    1011 to drive the Tahoe node. This section is intended for HTML authors who want
    1012 to write web pages that contain forms and buttons which manipulate the Tahoe
    1013 filesystem.
     1011to drive the Tahoe-LAFS node. This section is intended for HTML authors who
     1012want to write web pages containing user interfaces for manipulating the
     1013Tahoe-LAFS file store.
    10141014
    10151015Note that for all POST operations, the arguments listed can be provided
     
    11081108``POST /uri?t=mkdir``
    11091109
    1110  This creates a new empty directory, but does not attach it to the virtual
    1111  filesystem.
     1110 This creates a new empty directory, but does not attach it to any other
     1111 directory in the Tahoe-LAFS file store.
    11121112
    11131113 If a "redirect_to_result=true" argument is provided, then the HTTP response
     
    11511151
    11521152 This uploads a file, and produces a file-cap for the contents, but does not
    1153  attach the file into the filesystem. No directories will be modified by
    1154  this operation.
     1153 attach the file to any directory in the Tahoe-LAFS file store. That is, no
     1154 directories will be modified by this operation.
    11551155
    11561156 The file must be provided as the "file" field of an HTML encoded form body,
     
    17001700 reachable from the starting directory. The path will be slash-joined, and
    17011701 the filecap/dircap will contain a link to the object in question. This page
    1702  gives immediate access to every object in the virtual filesystem subtree.
     1702 gives immediate access to every object in the file store subtree.
    17031703
    17041704 This operation uses the same ophandle= mechanism as deep-check. The
     
    18341834
    18351835The portion of the web namespace that begins with "/uri" (and "/named") is
    1836 dedicated to giving users (both humans and programs) access to the Tahoe
    1837 virtual filesystem. The rest of the namespace provides status information
    1838 about the state of the Tahoe node.
     1836dedicated to giving users (both humans and programs) access to the Tahoe-LAFS
     1837file store. The rest of the namespace provides status information about the
     1838state of the Tahoe-LAFS node.
    18391839
    18401840``GET /``   (the root page)
     
    18441844 Node information: library versions, local nodeid, services being provided.
    18451845
    1846  Filesystem Access Forms: create a new directory, view a file/directory by
     1846 File store access forms: create a new directory, view a file/directory by
    18471847                          URI, upload a file (unlinked), download a file by
    18481848                          URI.
    18491849
    1850  Grid Status: introducer information, helper information, connected storage
     1850 Grid status: introducer information, helper information, connected storage
    18511851              servers.
    18521852
     
    19951995
    19961996Summary: use explicit file- and dir- caps whenever possible, to reduce the
    1997 potential for surprises when the filesystem structure is changed.
    1998 
    1999 Tahoe provides a mutable filesystem, but the ways that the filesystem can
    2000 change are limited. The only thing that can change is that the mapping from
    2001 child names to child objects that each directory contains can be changed by
    2002 adding a new child name pointing to an object, removing an existing child name,
    2003 or changing an existing child name to point to a different object.
    2004 
    2005 Obviously if you query Tahoe for information about the filesystem and then act
    2006 to change the filesystem (such as by getting a listing of the contents of a
    2007 directory and then adding a file to the directory), then the filesystem might
    2008 have been changed after you queried it and before you acted upon it.  However,
    2009 if you use the URI instead of the pathname of an object when you act upon the
    2010 object, then the only change that can happen is if the object is a directory
    2011 then the set of child names it has might be different. If, on the other hand,
    2012 you act upon the object using its pathname, then a different object might be in
    2013 that place, which can result in more kinds of surprises.
     1997potential for surprises when the file store structure is changed.
     1998
     1999Tahoe-LAFS provides a mutable file store, but the ways that the store can
     2000change are limited. The only things that can change are:
     2001 * the mapping from child names to child objects inside mutable directories
     2002   (by adding a new child, removing an existing child, or changing an
     2003   existing child to point to a different object)
     2004 * the contents of mutable files
     2005
     2006Obviously if you query for information about the file store and then act
     2007to change it (such as by getting a listing of the contents of a mutable
     2008directory and then adding a file to the directory), then the store might
     2009have been changed after you queried it and before you acted upon it.
     2010However, if you use the URI instead of the pathname of an object when you
     2011act upon the object, then it will be the same object; only its contents
     2012can change (if it is mutable). If, on the other hand, you act upon the
     2013object using its pathname, then a different object might be in that place,
     2014which can result in more kinds of surprises.
    20142015
    20152016For example, suppose you are writing code which recursively downloads the
     
    20192020then it recurses into that directory. Now, if the download and the recurse
    20202021actions are performed using the child's name, then the results might be
    2021 wrong, because for example a child name that pointed to a sub-directory when
     2022wrong, because for example a child name that pointed to a subdirectory when
    20222023you listed the directory might have been changed to point to a file (in which
    2023 case your attempt to recurse into it would result in an error and the file
    2024 would be skipped), or a child name that pointed to a file when you listed the
    2025 directory might now point to a sub-directory (in which case your attempt to
    2026 download the child would result in a file containing HTML text describing the
    2027 sub-directory!).
    2028 
    2029 If your recursive algorithm uses the uri of the child instead of the name of
     2024case your attempt to recurse into it would result in an error), or a child
     2025name that pointed to a file when you listed the directory might now point to
     2026a subdirectory (in which case your attempt to download the child would result
     2027in a file containing HTML text describing the subdirectory!).
     2028
     2029If your recursive algorithm uses the URI of the child instead of the name of
    20302030the child, then those kinds of mistakes just can't happen. Note that both the
    20312031child's name and the child's URI are included in the results of listing the
Note: See TracChangeset for help on using the changeset viewer.