diff --git a/doc/Makefile b/doc/Makefile index ce7ea26c8583..1b2589f01065 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -32,6 +32,7 @@ MANPAGES := doc/lightning-cli.1 \ doc/lightning-createinvoice.7 \ doc/lightning-createrune.7 \ doc/lightning-datastore.7 \ + doc/lightning-datastoreusage.7 \ doc/lightning-decodepay.7 \ doc/lightning-decode.7 \ doc/lightning-deldatastore.7 \ diff --git a/doc/index.rst b/doc/index.rst index 9adb7b0636ac..b2f87e9be511 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -55,6 +55,7 @@ Core Lightning Documentation lightning-createonion lightning-createrune lightning-datastore + lightning-datastoreusage lightning-decode lightning-decodepay lightning-deldatastore diff --git a/doc/lightning-datastore.7.md b/doc/lightning-datastore.7.md index 9f22e75675c5..6d5cfc230191 100644 --- a/doc/lightning-datastore.7.md +++ b/doc/lightning-datastore.7.md @@ -59,7 +59,7 @@ Rusty Russell <> is mainly responsible. SEE ALSO -------- -lightning-listdatastore(7), lightning-deldatastore(7) +lightning-listdatastore(7), lightning-deldatastore(7), lightning-datastoreusage(7) RESOURCES --------- diff --git a/doc/lightning-datastoreusage.7.md b/doc/lightning-datastoreusage.7.md new file mode 100644 index 000000000000..30b7d2a84a4b --- /dev/null +++ b/doc/lightning-datastoreusage.7.md @@ -0,0 +1,43 @@ +lightning-datastoreusage -- Command for listing datastore usage info +============================================================ + +SYNOPSIS +-------- + +**datastoreusage** + +DESCRIPTION +----------- + +The **datastoreusage** RPC command allows the caller to fetch the +total bytes that are stored under a certain *key* (or from the root), +including the size of the *key*. + +All descendants of the *key* (or root) are taken into account. +RETURN VALUE +------------ + +[comment]: # (GENERATE-FROM-SCHEMA-START) +On success, an object containing **datastoreusage** is returned. It is an object containing: + +- **key** (string): The key from which the database was traversed. +- **total\_bytes** (u64): The total bytes that are stored under the *key*, including the all descendants data and the size of the keys themselves. + +[comment]: # (GENERATE-FROM-SCHEMA-END) + +AUTHOR +------ + +Peter Neuroth <> is mainly responsible. + +SEE ALSO +-------- + +lightning-datastore(7), lightning-deldatastore(7), lightning-listdatastore(7) + +RESOURCES +--------- + +Main web site: + +[comment]: # ( SHA256STAMP:ff955e44cf4587893c4deda96a5487ba37cd464aaf257989af1944835ca8bfc0) diff --git a/doc/lightning-deldatastore.7.md b/doc/lightning-deldatastore.7.md index e4bf20bd8dad..29753015efb2 100644 --- a/doc/lightning-deldatastore.7.md +++ b/doc/lightning-deldatastore.7.md @@ -42,7 +42,7 @@ Rusty Russell <> is mainly responsible. SEE ALSO -------- -lightning-listdatastore(7), lightning-datastore(7) +lightning-listdatastore(7), lightning-datastore(7), lightning-datastoreusage(7) RESOURCES --------- diff --git a/doc/lightning-listdatastore.7.md b/doc/lightning-listdatastore.7.md index 4d0cebb0468f..635dedc8a835 100644 --- a/doc/lightning-listdatastore.7.md +++ b/doc/lightning-listdatastore.7.md @@ -40,7 +40,7 @@ Rusty Russell <> is mainly responsible. SEE ALSO -------- -lightning-datastore(7), lightning-deldatastore(7) +lightning-datastore(7), lightning-deldatastore(7), lightning-datastoreusage(7) RESOURCES --------- diff --git a/doc/schemas/datastoreusage.request.json b/doc/schemas/datastoreusage.request.json new file mode 100644 index 000000000000..f0b40bea67f1 --- /dev/null +++ b/doc/schemas/datastoreusage.request.json @@ -0,0 +1,23 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [], + "added": "v23.08", + "properties": { + "key": { + "oneOf": [ + { + "type": "array", + "description": "key is an array of values (though a single value is treated as a one-element array). Used as the staring point to traverse the datastore.", + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ] + } + } +} diff --git a/doc/schemas/datastoreusage.schema.json b/doc/schemas/datastoreusage.schema.json new file mode 100644 index 000000000000..6d115824c9de --- /dev/null +++ b/doc/schemas/datastoreusage.schema.json @@ -0,0 +1,26 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": ["datastoreusage"], + "properties": { + "datastoreusage": { + "type": "object", + "additionalProperties": false, + "required": [ + "key", + "total_bytes" + ], + "properties": { + "key": { + "type": "string", + "description": "The key from which the database was traversed." + }, + "total_bytes": { + "type": "u64", + "description": "The total bytes that are stored under the *key*, including the all descendants data and the size of the keys themselves." + } + } + } + } +}