Skip to content

Commit

Permalink
doc: Add datastoreusage command to the docs
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Neuroth <[email protected]>
  • Loading branch information
nepet committed Aug 1, 2023
1 parent 18f7659 commit 5984290
Show file tree
Hide file tree
Showing 8 changed files with 99 additions and 3 deletions.
1 change: 1 addition & 0 deletions doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
1 change: 1 addition & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Core Lightning Documentation
lightning-createonion <lightning-createonion.7.md>
lightning-createrune <lightning-createrune.7.md>
lightning-datastore <lightning-datastore.7.md>
lightning-datastoreusage <lightning-datastoreusage.7.md>
lightning-decode <lightning-decode.7.md>
lightning-decodepay <lightning-decodepay.7.md>
lightning-deldatastore <lightning-deldatastore.7.md>
Expand Down
2 changes: 1 addition & 1 deletion doc/lightning-datastore.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Rusty Russell <<[email protected]>> is mainly responsible.
SEE ALSO
--------

lightning-listdatastore(7), lightning-deldatastore(7)
lightning-listdatastore(7), lightning-deldatastore(7), lightning-datastoreusage(7)

RESOURCES
---------
Expand Down
43 changes: 43 additions & 0 deletions doc/lightning-datastoreusage.7.md
Original file line number Diff line number Diff line change
@@ -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 <<[email protected]>> is mainly responsible.

SEE ALSO
--------

lightning-datastore(7), lightning-deldatastore(7), lightning-listdatastore(7)

RESOURCES
---------

Main web site: <https://github.com/ElementsProject/lightning>

[comment]: # ( SHA256STAMP:743b3308974872f191362fcd0b1af647ea1efd28ae30ea04f6deb22418871a17)
2 changes: 1 addition & 1 deletion doc/lightning-deldatastore.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Rusty Russell <<[email protected]>> is mainly responsible.
SEE ALSO
--------

lightning-listdatastore(7), lightning-datastore(7)
lightning-listdatastore(7), lightning-datastore(7), lightning-datastoreusage(7)

RESOURCES
---------
Expand Down
2 changes: 1 addition & 1 deletion doc/lightning-listdatastore.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Rusty Russell <<[email protected]>> is mainly responsible.
SEE ALSO
--------

lightning-datastore(7), lightning-deldatastore(7)
lightning-datastore(7), lightning-deldatastore(7), lightning-datastoreusage(7)

RESOURCES
---------
Expand Down
23 changes: 23 additions & 0 deletions doc/schemas/datastoreusage.request.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
}
}
28 changes: 28 additions & 0 deletions doc/schemas/datastoreusage.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"$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."
}
}
}
}
}

0 comments on commit 5984290

Please sign in to comment.