#533 closed enhancement (fixed)
wapi: add mkdir-with-children
Reported by: | warner | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.6.0 |
Component: | code-frontend-web | Version: | 1.2.0 |
Keywords: | news-done | Cc: | |
Launchpad Bug: |
Description
the "tahoe cp -r" command would benefit from this: instead of two operations (mkdir, set-children), we could create the directory in a single frontend call. This would be faster on the backend too, basically create-mutable-file with initial contents, instead of a create-empty-mutable-file followed by a modify.
This API could also be used for immutable dirnodes.
Change History (5)
comment:1 Changed at 2008-11-06T22:15:32Z by warner
comment:2 Changed at 2009-11-12T00:39:04Z by warner
- Milestone changed from undecided to 1.6.0
I implemented this in 768c76aa5fbe2c7f, using (safer) t=mkdir-with-children instead of (unsafe) just adding an argument to the old t=mkdir (which would cause problems when a new client sent ignored arguments to an old webapi server).
"cp -r" and "tahoe backup" do not yet use this API, though. (see #828 for that part)
comment:3 Changed at 2009-11-18T07:38:45Z by warner
- Resolution set to fixed
- Status changed from new to closed
I just updated t=mkdir-with-children to accept the JSON dictionary of children as the full POST request body, rather than as the children= portion of a multipart/form body. This should be a lot easier to use.
Finally closing this ticket. #828 is still open (to update the CLI commands to use the new API).
comment:4 Changed at 2010-02-02T05:50:19Z by davidsarah
- Summary changed from wapi: add mkdir-with-initial-children to wapi: add mkdir-with-children
comment:5 Changed at 2010-02-02T05:51:15Z by davidsarah
- Keywords news-done added
The initial children would be provided as a JSON-encoded PUT body or POST field to the existing t=mkdir operation. The syntax for this would be as follows:
Creating A New Directory
POST /uri?t=mkdir PUT /uri?t=mkdir
POST /uri/$DIRCAP/[SUBDIRS../]SUBDIR?t=mkdir PUT /uri/$DIRCAP/[SUBDIRS../]SUBDIR?t=mkdir
POST /uri/$DIRCAP/[SUBDIRS../]?t=mkdir&name=NAME