Keep manifest format » History » Version 1

Tom Clegg, 02/04/2014 01:35 AM

1 1 Tom Clegg
h1. Keep manifest format
2 1 Tom Clegg
3 1 Tom Clegg
h2. Manifest v1
4 1 Tom Clegg
5 1 Tom Clegg
A manifest consists of one or more newline-terminated streams.
6 1 Tom Clegg
7 1 Tom Clegg
Each stream consists of three or more space-delimited tokens:
8 1 Tom Clegg
* The first token is a stream name, consisting of one or more tokens, delimited by @"/"@, the first of which is always @"."@.
9 1 Tom Clegg
* The second token is a data blob locator, consisting of one or more tokens, delimited by @"+"@, the first of which is an MD5 hexdigest.
10 1 Tom Clegg
** If a subsequent token ("hint") in the locator is numeric, it indicates the size of the data blob, in bytes.
11 1 Tom Clegg
** If a hint starts with @"A"@, it is an authorization token (used by the Keep server to confirm that the block is readable by a specific API auth token).
12 1 Tom Clegg
* ...possibly followed by more data blob locators...
13 1 Tom Clegg
* The first token that is not a block locator, and all subsequent tokens, are file tokens.
14 1 Tom Clegg
** A file token has three parts, delimited by @":"@: position, size, filename.
15 1 Tom Clegg
** Position and size are given in decimal, and are counted from the beginning of the first data blob.
16 1 Tom Clegg
** Filename may contain @"/"@ characters, but must not start or end with @"/"@, and must not contain @"//"@.
17 1 Tom Clegg
18 1 Tom Clegg
h2. Normalized manifest v1
19 1 Tom Clegg
20 1 Tom Clegg
A normalized manifest has the following additional restrictions.
21 1 Tom Clegg
* Streams are in alphanumeric order.
22 1 Tom Clegg
* Each stream name is unique within the manifest.
23 1 Tom Clegg
* Files within a stream are in alphanumeric order.
24 1 Tom Clegg
* -Concatenation @stream_name/filename@ is unique within the manifest.- (This can be impossible to accomplish without rewriting blobs.)
25 1 Tom Clegg
* Filename must not contain @"/"@.
26 1 Tom Clegg
27 1 Tom Clegg
An API call -exists- will exist to normalize a manifest.
28 1 Tom Clegg
29 1 Tom Clegg
Request:
30 1 Tom Clegg
* @POST /arvados/v1/collections/{hash}/normalize@
31 1 Tom Clegg
* request body: @{"collection":{"manifest_text":"...."}}@
32 1 Tom Clegg
33 1 Tom Clegg
Response:
34 1 Tom Clegg
* @{"uuid":"...","manifest_text":"..."}@
35 1 Tom Clegg
36 1 Tom Clegg
Notes:
37 1 Tom Clegg
* POST despite no side effects.
38 1 Tom Clegg
* Returns object with uuid even though no object was stored.