forked from syncthing/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dev/rest: Document /rest/system/browse (fixes syncthing#112)
GitHub-Pull-Request: syncthing#300
- Loading branch information
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
GET /rest/system/browse | ||
======================= | ||
|
||
Returns a list of directories matching the path given by the optional parameter | ||
``current``. The path can use `patterns as described in Go's filepath package | ||
<https://golang.org/pkg/path/filepath/#Match>`_. A '*' will always be appended | ||
to the given path (e.g. ``/tmp/`` matches all its subdirectories). If the option | ||
``current`` is not given, filesystem root paths are returned. | ||
|
||
.. code-block:: bash | ||
$ curl -H "X-API-Key: yourkey" localhost:8384/rest/system/browse | json_pp | ||
[ | ||
"/" | ||
] | ||
$ curl -H "X-API-Key: yourkey" localhost:8384/rest/system/browse?current=/var/ | json_pp | ||
[ | ||
"/var/backups/", | ||
"/var/cache/", | ||
"/var/lib/", | ||
"/var/local/", | ||
"/var/lock/", | ||
"/var/log/", | ||
"/var/mail/", | ||
"/var/opt/", | ||
"/var/run/", | ||
"/var/spool/", | ||
"/var/tmp/" | ||
] | ||
$ curl -H "X-API-Key: yourkey" localhost:8384/rest/system/browse?current=/var/*o | json_pp | ||
[ | ||
"/var/local/", | ||
"/var/lock/", | ||
"/var/log/", | ||
"/var/opt/", | ||
"/var/spool/" | ||
] |