[tahoe-lafs-trac-stream] [tahoe-lafs] #1732: consider changes to webapi "Move" API before release
tahoe-lafs
trac at tahoe-lafs.org
Thu Mar 14 17:26:55 UTC 2013
#1732: consider changes to webapi "Move" API before release
-------------------------------+-------------------------------------------
Reporter: warner | Owner: warner
Type: enhancement | Status: new
Priority: major | Milestone: 1.10.0
Component: code- | Version: 1.9.1
frontend-web | Keywords: forward-compatibility blocker
Resolution: |
Launchpad Bug: |
-------------------------------+-------------------------------------------
Comment (by davidsarah):
Proposed doc:
{{{
Moving A Child
--------------
``POST
/uri/$DIRCAP/[SUBDIRS../]?t=move&from_name=OLD&to=$NEWDIRCAP/[NEWSUBDIRS../]NEW``
This instructs the node to move a child of the given directory to a
different directory, both of which must be mutable. The to= parameter
should contain a path to the destination directory (multiple levels of
descent are supported) ending with the new name. The new name must be
included even if it is the same as the old name.
The default behavior is to overwrite any existing object at the given
location. To prevent this (and make the operation return an error instead
of overwriting), add a "replace=false" argument. With replace=false, this
operation will return an HTTP 409 "Conflict" error if there is already an
object at the given location, rather than overwriting the existing
object.
To allow the operation to overwrite a file, but return an error when
trying
to overwrite a directory, use "replace=only-files" (this behavior is
closer
to the traditional UNIX "mv" command). Note that "true", "t", and "1" are
all synonyms for "True", and "false", "f", and "0" are synonyms for
"False",
and the parameter is case-insensitive.
For safety, the child is not unlinked from the old directory until it has
been successfully added to the new directory.
}}}
This includes the "replace=only-files" option to avoid accidentally
clobbering a directory, as discussed on the Dev Chat.
--
Ticket URL: <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/1732#comment:22>
tahoe-lafs <https://tahoe-lafs.org>
secure decentralized storage
More information about the tahoe-lafs-trac-stream
mailing list