Fix ReadIndex spec and add JSON5 remark to doc
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing

This commit is contained in:
Alex 2022-05-16 11:54:37 +02:00
parent 5768bf3622
commit 176715c5b2
Signed by: lx
GPG key ID: 0E496D15096376BE

View file

@ -195,6 +195,10 @@ TO UNDERSTAND IN ORDER TO USE IT CORRECTLY.**
## API Endpoints ## API Endpoints
**Remark.** Example queries and responses here are given in JSON5 format
for clarity. However the actual K2V API uses basic JSON so all examples
and responses need to be translated.
### Operations on single items ### Operations on single items
**ReadItem: `GET /<bucket>/<partition key>?sort_key=<sort key>`** **ReadItem: `GET /<bucket>/<partition key>?sort_key=<sort key>`**
@ -370,8 +374,11 @@ HTTP/1.1 204 NO CONTENT
**ReadIndex: `GET /<bucket>?start=<start>&end=<end>&limit=<limit>`** **ReadIndex: `GET /<bucket>?start=<start>&end=<end>&limit=<limit>`**
Lists all partition keys in the bucket for which some triplets exist, and gives Lists all partition keys in the bucket for which some triplets exist, and gives
for each the number of triplets (or an approximation thereof, this value is for each the number of triplets, total number of values (which might be bigger
asynchronously updated, and thus eventually consistent). than the number of triplets in case of conflicts), total number of bytes of
these values, and number of triplets that are in a state of conflict.
The values returned are an approximation of the true counts in the bucket,
as these values are asynchronously updated, and thus eventually consistent.
Query parameters: Query parameters:
@ -426,11 +433,41 @@ HTTP/1.1 200 OK
limit: null, limit: null,
reverse: false, reverse: false,
partitionKeys: [ partitionKeys: [
{ pk: "keys", n: 3043 }, {
{ pk: "mailbox:INBOX", n: 42 }, pk: "keys",
{ pk: "mailbox:Junk", n: 2991 }, entries: 3043,
{ pk: "mailbox:Trash", n: 10 }, conflicts: 0,
{ pk: "mailboxes", n: 3 }, values: 3043,
bytes: 121720,
},
{
pk: "mailbox:INBOX",
entries: 42,
conflicts: 1,
values: 43,
bytes: 142029,
},
{
pk: "mailbox:Junk",
entries: 2991
conflicts: 0,
values: 2991,
bytes: 12019322,
},
{
pk: "mailbox:Trash",
entries: 10,
conflicts: 0,
values: 10,
bytes: 32401,
},
{
pk: "mailboxes",
entries: 3,
conflicts: 0,
values: 3,
bytes: 3019,
},
], ],
more: false, more: false,
nextStart: null, nextStart: null,