doc/schemas: add schema for autoclean.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2021-05-26 15:21:01 +09:30
parent 3bc5d47aa2
commit 0b48dd79ac
3 changed files with 67 additions and 3 deletions

View File

@ -25,8 +25,23 @@ On startup of the daemon, no autoclean is set up\.
.SH RETURN VALUE
On success, an empty object is returned\.
On success, an object is returned, containing:
.RS
.IP \[bu]
\fBenabled\fR (boolean): whether invoice autocleaning is active
.RE
If \fBenabled\fR is \fItrue\fR:
.RS
.IP \[bu]
\fBexpired_by\fR (u64): how long an invoice must be expired (seconds) before we delete it
.IP \[bu]
\fBcycle_seconds\fR (u64): how long an invoice must be expired (seconds) before we delete it
.RE
.SH AUTHOR
ZmnSCPxj \fI<ZmnSCPxj@protonmail.com\fR> is mainly responsible\.
@ -39,4 +54,4 @@ ZmnSCPxj \fI<ZmnSCPxj@protonmail.com\fR> is mainly responsible\.
Main web site: \fIhttps://github.com/ElementsProject/lightning\fR
\" SHA256STAMP:df05ece680710d67202b28af635a274d7adc38d9f334c79d88ee28b80a2cae60
\" SHA256STAMP:dd3f512e81f45ab6084b608bc05fba5679b1d20d493aad98d422bdf593182604

View File

@ -25,7 +25,14 @@ On startup of the daemon, no autoclean is set up.
RETURN VALUE
------------
On success, an empty object is returned.
[comment]: # (GENERATE-FROM-SCHEMA-START)
On success, an object is returned, containing:
- **enabled** (boolean): whether invoice autocleaning is active
If **enabled** is *true*:
- **expired_by** (u64): how long an invoice must be expired (seconds) before we delete it
- **cycle_seconds** (u64): how long an invoice must be expired (seconds) before we delete it
[comment]: # (GENERATE-FROM-SCHEMA-END)
AUTHOR
------
@ -42,3 +49,4 @@ RESOURCES
Main web site: <https://github.com/ElementsProject/lightning>
[comment]: # ( SHA256STAMP:2accf7788133af97ae097f7e4e8a80b35bbb431eb7e787e5ae12dd5c7d2c296d)

View File

@ -0,0 +1,41 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"additionalProperties": true,
"required": [ "enabled" ],
"properties": {
"enabled": {
"type": "boolean",
"description": "whether invoice autocleaning is active"
}
},
"if": {
"properties": {
"enabled": {
"type": "boolean",
"enum": [ true ]
}
}
},
"then": {
"additionalProperties": false,
"required": [ "expired_by", "cycle_seconds" ],
"properties": {
"enabled": { },
"expired_by": {
"type": "u64",
"description": "how long an invoice must be expired (seconds) before we delete it"
},
"cycle_seconds": {
"type": "u64",
"description": "how long an invoice must be expired (seconds) before we delete it"
}
}
},
"else": {
"additionalProperties": false,
"properties": {
"enabled": { }
}
}
}