core-lightning/doc/schemas/lightning-autoclean-once.json
Rusty Russell b327bd30c3 doc: fix all JSON schemas to enforce no additional properties.
Without this, we have hardly any enforcement.  This is why the schema
mistake fixed in the previous patches weren't spotted immediately.

The hard work was done by:

```
$ for f in lightning-*.json; do grep -v '^  "additionalProperties": false,' $f | bagto $f; done
$ for f in lightning-*.json; do sed 's/"properties": {/"additionalProperties": false, "properties": {/' $f | bagto $f; done
$ make fmt-schemas
```

Then checking where 'additionalProperties: true' had been turned to
false (we deliberately use it in some places where there are if
statements in the schema, or occasionally where there can be arbitrary
fields).

[Including doc/rpc-schema-draft.json update by Shahana]
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-10-30 15:39:12 +10:30

239 lines
6.7 KiB
JSON

{
"$schema": "../rpc-schema-draft.json",
"type": "object",
"rpc": "autoclean-once",
"title": "A single deletion of old invoices/payments/forwards",
"description": [
"The **autoclean-once** RPC command tell the `autoclean` plugin to do a single sweep to delete old entries. This is a manual alternative (or addition) to the various `autoclean-...-age` parameters which cause autoclean to run once per hour: see lightningd-config(5)."
],
"request": {
"required": [
"subsystem",
"age"
],
"additionalProperties": false,
"properties": {
"subsystem": {
"type": "string",
"enum": [
"succeededforwards",
"failedforwards",
"succeededpays",
"failedpays",
"paidinvoices",
"expiredinvoices"
],
"description": [
"What subsystem to clean. Currently supported subsystems are:",
" * `failedforwards`: routed payments which did not succeed (`failed` or `local_failed` in listforwards `status`).",
" * `succeededforwards`: routed payments which succeeded (`settled` in listforwards `status`).",
" * `failedpays`: payment attempts which did not succeed (`failed` in listpays `status`).",
" * `succeededpays`: payment attempts which succeeded (`complete` in listpays `status`).",
" * `expiredinvoices`: invoices which were not paid (and cannot be) (`expired` in listinvoices `status`).",
" * `paidinvoices`: invoices which were paid (`paid` in listinvoices `status)."
]
},
"age": {
"type": "u64",
"description": [
"Non-zero number in seconds. How many seconds old an entry must be to delete it."
]
}
}
},
"response": {
"required": [
"autoclean"
],
"additionalProperties": false,
"properties": {
"autoclean": {
"type": "object",
"additionalProperties": false,
"properties": {
"succeededforwards": {
"type": "object",
"additionalProperties": false,
"required": [
"cleaned",
"uncleaned"
],
"properties": {
"cleaned": {
"type": "u64",
"description": [
"Total number of deletions done this run."
]
},
"uncleaned": {
"type": "u64",
"description": [
"The total number of entries *not* deleted this run."
]
}
}
},
"failedforwards": {
"type": "object",
"additionalProperties": false,
"required": [
"cleaned",
"uncleaned"
],
"properties": {
"cleaned": {
"type": "u64",
"description": [
"Total number of deletions done this run."
]
},
"uncleaned": {
"type": "u64",
"description": [
"The total number of entries *not* deleted this run."
]
}
}
},
"succeededpays": {
"type": "object",
"additionalProperties": false,
"required": [
"cleaned",
"uncleaned"
],
"properties": {
"cleaned": {
"type": "u64",
"description": [
"Total number of deletions done this run."
]
},
"uncleaned": {
"type": "u64",
"description": [
"The total number of entries *not* deleted this run."
]
}
}
},
"failedpays": {
"type": "object",
"additionalProperties": false,
"required": [
"cleaned",
"uncleaned"
],
"properties": {
"cleaned": {
"type": "u64",
"description": [
"Total number of deletions done this run."
]
},
"uncleaned": {
"type": "u64",
"description": [
"The total number of entries *not* deleted this run."
]
}
}
},
"paidinvoices": {
"type": "object",
"additionalProperties": false,
"required": [
"cleaned",
"uncleaned"
],
"properties": {
"cleaned": {
"type": "u64",
"description": [
"Total number of deletions done this run."
]
},
"uncleaned": {
"type": "u64",
"description": [
"The total number of entries *not* deleted this run."
]
}
}
},
"expiredinvoices": {
"type": "object",
"additionalProperties": false,
"required": [
"cleaned",
"uncleaned"
],
"properties": {
"cleaned": {
"type": "u64",
"description": [
"Total number of deletions done this run."
]
},
"uncleaned": {
"type": "u64",
"description": [
"The total number of entries *not* deleted this run."
]
}
}
}
}
}
}
},
"author": [
"Rusty Russell <<rusty@rustcorp.com.au>> is mainly responsible."
],
"see_also": [
"lightningd-config(5)",
"lightning-autoclean-status(7)"
],
"resources": [
"Main web site: <https://github.com/ElementsProject/lightning>"
],
"examples": [
{
"request": {
"id": "example:autoclean-once#1",
"method": "autoclean-once",
"params": [
"failedpays",
1
]
},
"response": {
"autoclean": {
"failedpays": {
"cleaned": 0,
"uncleaned": 7
}
}
}
},
{
"request": {
"id": "example:autoclean-once#2",
"method": "autoclean-once",
"params": [
"succeededpays",
1
]
},
"response": {
"autoclean": {
"succeededpays": {
"cleaned": 7,
"uncleaned": 0
}
}
}
}
]
}