diff --git a/README-uri-scheme.md b/README-uri-scheme.md index 7f4c35ba..fb29ae5c 100644 --- a/README-uri-scheme.md +++ b/README-uri-scheme.md @@ -1,100 +1,113 @@ URI scheme ========== Browsing namespace ------------------ ### Global -To be anchored where browsing starts (e.g., at /browse) +To be anchored where browsing starts (e.g., at /api/1) * /revision/: show commit information * /directory/: show directory information (including ls) * /directory//path/to/file-or-dir: ditto, but for dir pointed by path - note: this is the same as /dir/, where is the sha1_git ID of the dir pointed by path * /content/[:]: show content information - content is specified by HASH, according to HASH_ALGO, where HASH_ALGO is one of: sha1, sha1_git, sha256. This means that several different URLs (at least one per HASH_ALGO) will point to the same content - HASH_ALGO defaults to "sha1" (?) * /release/: show release information Sample: - $ curl -X GET http://localhost:6543/api/1/release/4a1b6d7dd0a923ed90156c4e2f5db030095d8e08 + $ curl -X GET http://localhost:6543/api/1/release/4a1b6d7dd0a923ed90156c4e2f5db030095d8e08 { "release": { "author": 1, "comment": "synthetic release message", "date": "Sat, 04 Mar 2000 07:50:35 GMT", "date_offset": 0, "id": "4a1b6d7dd0a923ed90156c4e2f5db030095d8e08", "name": "4.0.6", "revision": "5c7814ce9978d4e16f3858925b5cea611e500eec", "synthetic": true } - } + }% * /person/: show person information * /origin/: show origin information +Sample: + + $ curl -X GET http://localhost:6543/api/1/origin/1 + { + "origin": { + "id": 1, + "lister": null, + "project": null, + "type": "ftp", + "url": "rsync://ftp.gnu.org/old-gnu/solfege" + } + }% + * /project/: show project information * /organization/: show organization information ### Occurrence Origin/Branch do not contain `|` so it is used as a terminator. Origin is . Timestamp is one of: latest or an ISO8601 date (TODO: decide the time matching policy). * /directory//|/|/path/to/file-or-dir - Same as /directory/ but looking up sha1 git using origin and branch at a given timestamp * /revision//|/ - Same as /revision/ but looking up sha1 git using origin and branch at a given timestamp * /revision//| - Show all branches of origin at a given timestamp * /revision//|/| - Show all revisions (~git log) of origin and branch at a given timestamp ### Upload and search * /1/api/uploadnsearch/ Post a file's content to api. Api computes the sha1 hash and checks in the storage if such sha1 exists. Json answer: {'sha1': hexadecimal sha1, 'found': true or false} Sample: $ curl -X POST -F filename=@/path/to/file http://localhost:6543/api/1/uploadnsearch/ { "found": false, "sha1": "e95097ad2d607b4c89c1ce7ca1fef2a1e4450558" }% Search namespace ----------------