mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 01:43:36 +01:00
b327bd30c3
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>
493 lines
13 KiB
JSON
493 lines
13 KiB
JSON
{
|
|
"$schema": "../rpc-schema-draft.json",
|
|
"type": "object",
|
|
"rpc": "autoclean-status",
|
|
"title": "Examine auto-delete of old invoices/payments/forwards",
|
|
"description": [
|
|
"The **autoclean-status** RPC command tells you about the status of the autoclean plugin, optionally for only one subsystem."
|
|
],
|
|
"request": {
|
|
"required": [],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"subsystem": {
|
|
"type": "string",
|
|
"enum": [
|
|
"succeededforwards",
|
|
"failedforwards",
|
|
"succeededpays",
|
|
"failedpays",
|
|
"paidinvoices",
|
|
"expiredinvoices"
|
|
],
|
|
"description": [
|
|
"What subsystem to ask about. 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)."
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"response": {
|
|
"required": [
|
|
"autoclean"
|
|
],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"autoclean": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"succeededforwards": {
|
|
"type": "object",
|
|
"additionalProperties": true,
|
|
"required": [
|
|
"enabled",
|
|
"cleaned"
|
|
],
|
|
"properties": {
|
|
"enabled": {
|
|
"type": "boolean",
|
|
"description": [
|
|
"Whether autocleaning is enabled for successful listforwards."
|
|
]
|
|
},
|
|
"cleaned": {
|
|
"type": "u64",
|
|
"description": [
|
|
"Total number of deletions done (ever)."
|
|
]
|
|
}
|
|
},
|
|
"if": {
|
|
"additionalProperties": true,
|
|
"properties": {
|
|
"enabled": {
|
|
"type": "boolean",
|
|
"enum": [
|
|
true
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"then": {
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"enabled",
|
|
"age",
|
|
"cleaned"
|
|
],
|
|
"properties": {
|
|
"enabled": {},
|
|
"cleaned": {},
|
|
"age": {
|
|
"type": "u64",
|
|
"description": [
|
|
"Age (in seconds) to delete successful listforwards."
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"else": {
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"enabled",
|
|
"cleaned"
|
|
],
|
|
"properties": {
|
|
"enabled": {},
|
|
"cleaned": {}
|
|
}
|
|
}
|
|
},
|
|
"failedforwards": {
|
|
"type": "object",
|
|
"additionalProperties": true,
|
|
"required": [
|
|
"enabled",
|
|
"cleaned"
|
|
],
|
|
"properties": {
|
|
"enabled": {
|
|
"type": "boolean",
|
|
"description": [
|
|
"Whether autocleaning is enabled for failed listforwards."
|
|
]
|
|
},
|
|
"cleaned": {
|
|
"type": "u64",
|
|
"description": [
|
|
"Total number of deletions done (ever)."
|
|
]
|
|
}
|
|
},
|
|
"if": {
|
|
"additionalProperties": true,
|
|
"properties": {
|
|
"enabled": {
|
|
"type": "boolean",
|
|
"enum": [
|
|
true
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"then": {
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"enabled",
|
|
"age",
|
|
"cleaned"
|
|
],
|
|
"properties": {
|
|
"enabled": {},
|
|
"cleaned": {},
|
|
"age": {
|
|
"type": "u64",
|
|
"description": [
|
|
"Age (in seconds) to delete failed listforwards."
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"else": {
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"enabled",
|
|
"cleaned"
|
|
],
|
|
"properties": {
|
|
"enabled": {},
|
|
"cleaned": {}
|
|
}
|
|
}
|
|
},
|
|
"succeededpays": {
|
|
"type": "object",
|
|
"additionalProperties": true,
|
|
"required": [
|
|
"enabled",
|
|
"cleaned"
|
|
],
|
|
"properties": {
|
|
"enabled": {
|
|
"type": "boolean",
|
|
"description": [
|
|
"Whether autocleaning is enabled for successful listpays/listsendpays."
|
|
]
|
|
},
|
|
"cleaned": {
|
|
"type": "u64",
|
|
"description": [
|
|
"Total number of deletions done (ever)."
|
|
]
|
|
}
|
|
},
|
|
"if": {
|
|
"additionalProperties": true,
|
|
"properties": {
|
|
"enabled": {
|
|
"type": "boolean",
|
|
"enum": [
|
|
true
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"then": {
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"enabled",
|
|
"age",
|
|
"cleaned"
|
|
],
|
|
"properties": {
|
|
"enabled": {},
|
|
"cleaned": {},
|
|
"age": {
|
|
"type": "u64",
|
|
"description": [
|
|
"Age (in seconds) to delete successful listpays/listsendpays."
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"else": {
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"enabled",
|
|
"cleaned"
|
|
],
|
|
"properties": {
|
|
"enabled": {},
|
|
"cleaned": {}
|
|
}
|
|
}
|
|
},
|
|
"failedpays": {
|
|
"type": "object",
|
|
"additionalProperties": true,
|
|
"required": [
|
|
"enabled",
|
|
"cleaned"
|
|
],
|
|
"properties": {
|
|
"enabled": {
|
|
"type": "boolean",
|
|
"description": [
|
|
"Whether autocleaning is enabled for failed listpays/listsendpays."
|
|
]
|
|
},
|
|
"cleaned": {
|
|
"type": "u64",
|
|
"description": [
|
|
"Total number of deletions done (ever)."
|
|
]
|
|
}
|
|
},
|
|
"if": {
|
|
"additionalProperties": true,
|
|
"properties": {
|
|
"enabled": {
|
|
"type": "boolean",
|
|
"enum": [
|
|
true
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"then": {
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"enabled",
|
|
"age",
|
|
"cleaned"
|
|
],
|
|
"properties": {
|
|
"enabled": {},
|
|
"cleaned": {},
|
|
"age": {
|
|
"type": "u64",
|
|
"description": [
|
|
"Age (in seconds) to delete failed listpays/listsendpays."
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"else": {
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"enabled",
|
|
"cleaned"
|
|
],
|
|
"properties": {
|
|
"enabled": {},
|
|
"cleaned": {}
|
|
}
|
|
}
|
|
},
|
|
"paidinvoices": {
|
|
"type": "object",
|
|
"additionalProperties": true,
|
|
"required": [
|
|
"enabled",
|
|
"cleaned"
|
|
],
|
|
"properties": {
|
|
"enabled": {
|
|
"type": "boolean",
|
|
"description": [
|
|
"Whether autocleaning is enabled for paid listinvoices."
|
|
]
|
|
},
|
|
"cleaned": {
|
|
"type": "u64",
|
|
"description": [
|
|
"Total number of deletions done (ever)."
|
|
]
|
|
}
|
|
},
|
|
"if": {
|
|
"additionalProperties": true,
|
|
"properties": {
|
|
"enabled": {
|
|
"type": "boolean",
|
|
"enum": [
|
|
true
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"then": {
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"enabled",
|
|
"age",
|
|
"cleaned"
|
|
],
|
|
"properties": {
|
|
"enabled": {},
|
|
"cleaned": {},
|
|
"age": {
|
|
"type": "u64",
|
|
"description": [
|
|
"Age (in seconds) to paid listinvoices."
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"else": {
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"enabled",
|
|
"cleaned"
|
|
],
|
|
"properties": {
|
|
"enabled": {},
|
|
"cleaned": {}
|
|
}
|
|
}
|
|
},
|
|
"expiredinvoices": {
|
|
"type": "object",
|
|
"additionalProperties": true,
|
|
"required": [
|
|
"enabled",
|
|
"cleaned"
|
|
],
|
|
"properties": {
|
|
"enabled": {
|
|
"type": "boolean",
|
|
"description": [
|
|
"Whether autocleaning is enabled for expired (unpaid) listinvoices."
|
|
]
|
|
},
|
|
"cleaned": {
|
|
"type": "u64",
|
|
"description": [
|
|
"Total number of deletions done (ever)."
|
|
]
|
|
}
|
|
},
|
|
"if": {
|
|
"additionalProperties": true,
|
|
"properties": {
|
|
"enabled": {
|
|
"type": "boolean",
|
|
"enum": [
|
|
true
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"then": {
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"enabled",
|
|
"age",
|
|
"cleaned"
|
|
],
|
|
"properties": {
|
|
"enabled": {},
|
|
"cleaned": {},
|
|
"age": {
|
|
"type": "u64",
|
|
"description": [
|
|
"Age (in seconds) to expired listinvoices."
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"else": {
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"enabled",
|
|
"cleaned"
|
|
],
|
|
"properties": {
|
|
"enabled": {},
|
|
"cleaned": {}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"pre_return_value_notes": [
|
|
"Note that the ages parameters are set by various `autoclean-...-age` parameters in your configuration: see lightningd-config(5)."
|
|
]
|
|
},
|
|
"author": [
|
|
"Rusty Russell <<rusty@rustcorp.com.au>> is mainly responsible."
|
|
],
|
|
"see_also": [
|
|
"lightningd-config(5)",
|
|
"lightning-listinvoices(7)",
|
|
"lightning-listpays(7)",
|
|
"lightning-listforwards(7)"
|
|
],
|
|
"resources": [
|
|
"Main web site: <https://github.com/ElementsProject/lightning>"
|
|
],
|
|
"examples": [
|
|
{
|
|
"request": {
|
|
"id": "example:autoclean-status#1",
|
|
"method": "autoclean-status",
|
|
"params": {
|
|
"subsystem": "expiredinvoices"
|
|
}
|
|
},
|
|
"response": {
|
|
"autoclean": {
|
|
"expiredinvoices": {
|
|
"enabled": true,
|
|
"age": 300,
|
|
"cleaned": 0
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"request": {
|
|
"id": "example:autoclean-status#2",
|
|
"method": "autoclean-status",
|
|
"params": {}
|
|
},
|
|
"response": {
|
|
"autoclean": {
|
|
"succeededforwards": {
|
|
"enabled": false,
|
|
"cleaned": 0
|
|
},
|
|
"failedforwards": {
|
|
"enabled": false,
|
|
"cleaned": 0
|
|
},
|
|
"succeededpays": {
|
|
"enabled": false,
|
|
"cleaned": 7
|
|
},
|
|
"failedpays": {
|
|
"enabled": false,
|
|
"cleaned": 0
|
|
},
|
|
"paidinvoices": {
|
|
"enabled": false,
|
|
"cleaned": 0
|
|
},
|
|
"expiredinvoices": {
|
|
"enabled": true,
|
|
"age": 300,
|
|
"cleaned": 0
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|