core-lightning/doc/schemas/lightning-reckless.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

192 lines
7.6 KiB
JSON

{
"$schema": "../rpc-schema-draft.json",
"type": "object",
"rpc": "reckless",
"title": "Issue a command to the reckless plugin manager utility",
"description": [
"The **reckless** RPC starts a reckless process with the *command* and *target* provided. Node configuration, network, and lightning direrctory are automatically passed to the reckless utility."
],
"request": {
"required": [
"command"
],
"additionalProperties": false,
"properties": {
"command": {
"type": "string",
"enum": [
"install",
"uninstall",
"search",
"enable",
"disable",
"source",
"--version"
],
"description": [
"Determines which command to pass to reckless",
" - *command* **install** takes a *plugin_name* to search for and install a named plugin.",
" - *command* **uninstall** takes a *plugin_name* and attempts to uninstall a plugin of the same name.",
" - *command* **search** takes a *plugin_name* to search for a named plugin.",
"..."
]
},
"target/subcommand": {
"oneOf": [
{
"type": "string"
},
{
"type": "array"
}
],
"description": [
"Target of a reckless command or a subcommand."
]
},
"target": {
"oneOf": [
{
"type": "string"
},
{
"type": "array"
}
],
"description": [
"*name* of a plugin to install/uninstall/search/enable/disable or source to add/remove."
]
}
}
},
"response": {
"required": [
"log",
"result"
],
"additionalProperties": false,
"properties": {
"result": {
"type": "array",
"items": {
"type": "string"
},
"description": [
"Output of the requested reckless command."
]
},
"log": {
"type": "array",
"items": {
"type": "string"
},
"description": [
"Verbose log entries of the requested reckless command."
]
}
}
},
"author": [
"Alex Myers <<alex@endothermic.dev>> is mainly responsible."
],
"see_also": [
"reckless(7)"
],
"resources": [
"Main web site: <https://github.com/ElementsProject/lightning>"
],
"examples": [
{
"request": {
"id": "example:reckless#1",
"method": "reckless",
"params": {
"command": "search",
"target/subcommand": "backup"
}
},
"response": {
"result": [
"https://github.com/lightningd/plugins"
],
"log": [
"DEBUG: Warning: Reckless requires write access",
"DEBUG: fetching from gh API: https://api.github.com/repos/lightningd/plugins/contents/",
"DEBUG: fetching from gh API: https://api.github.com/repos/lightningd/plugins/git/trees/294f93d7060799439c994daa84f534c4d1458325",
"INFO: found backup in source: https://github.com/lightningd/plugins",
"DEBUG: entry: None",
"DEBUG: sub-directory: backup"
]
}
},
{
"request": {
"id": "example:reckless#2",
"method": "reckless",
"params": {
"command": "install",
"target/subcommand": [
"summars",
"currecyrate"
]
}
},
"response": {
"result": [
"/tmp/l1/reckless/summars",
"/tmp/l1/reckless/currencyrate"
],
"log": [
"DEBUG: Searching for summars",
"DEBUG: fetching from gh API: https://api.github.com/repos/lightningd/plugins/contents/",
"DEBUG: fetching from gh API: https://api.github.com/repos/lightningd/plugins/git/trees/294f93d7060799439c994daa84f534c4d1458325",
"INFO: found summars in source: https://github.com/lightningd/plugins",
"DEBUG: entry: None",
"DEBUG: sub-directory: summars",
"DEBUG: Retrieving summars from https://github.com/lightningd/plugins",
"DEBUG: Install requested from InstInfo(summars, https://github.com/lightningd/plugins, None, None, None, summars).",
"INFO: cloning Source.GITHUB_REPO InstInfo(summars, https://github.com/lightningd/plugins, None, None, None, summars)",
"DEBUG: cloned_src: InstInfo(summars, /tmp/reckless-726255950dyifh_fh/clone, None, Cargo.toml, Cargo.toml, summars/summars)",
"DEBUG: using latest commit of default branch",
"DEBUG: checked out HEAD: 5e449468bd57db7d0f33178fe0dc867e0da94133",
"DEBUG: using installer rust",
"DEBUG: creating /tmp/l1/reckless/summars",
"DEBUG: creating /tmp/l1/reckless/summars/source",
"DEBUG: copying /tmp/reckless-726255950dyifh_fh/clone/summars/summars tree to /tmp/l1/reckless/summars/source/summars",
"DEBUG: linking source /tmp/l1/reckless/summars/source/summars/Cargo.toml to /tmp/l1/reckless/summars/Cargo.toml",
"DEBUG: InstInfo(summars, /tmp/l1/reckless/summars, None, Cargo.toml, Cargo.toml, source/summars)",
"DEBUG: cargo installing from /tmp/l1/reckless/summars/source/summars",
"DEBUG: rust project compiled successfully",
"INFO: plugin installed: /tmp/l1/reckless/summars",
"DEBUG: activating summars",
"INFO: summars enabled",
"DEBUG: Searching for currencyrate",
"DEBUG: fetching from gh API: https://api.github.com/repos/lightningd/plugins/contents/",
"DEBUG: fetching from gh API: https://api.github.com/repos/lightningd/plugins/git/trees/294f93d7060799439c994daa84f534c4d1458325",
"INFO: found currencyrate in source: https://github.com/lightningd/plugins",
"DEBUG: entry: None",
"DEBUG: sub-directory: currencyrate",
"DEBUG: Retrieving currencyrate from https://github.com/lightningd/plugins",
"DEBUG: Install requested from InstInfo(currencyrate, https://github.com/lightningd/plugins, None, None, None, currencyrate).",
"INFO: cloning Source.GITHUB_REPO InstInfo(currencyrate, https://github.com/lightningd/plugins, None, None, None, currencyrate)",
"DEBUG: cloned_src: InstInfo(currencyrate, /tmp/reckless-192564272t478naxn/clone, None, currencyrate.py, requirements.txt, currencyrate/currencyrate)",
"DEBUG: using latest commit of default branch",
"DEBUG: checked out HEAD: 5e449468bd57db7d0f33178fe0dc867e0da94133",
"DEBUG: using installer python3venv",
"DEBUG: creating /tmp/l1/reckless/currencyrate",
"DEBUG: creating /tmp/l1/reckless/currencyrate/source",
"DEBUG: copying /tmp/reckless-192564272t478naxn/clone/currencyrate/currencyrate tree to /tmp/l1/reckless/currencyrate/source/currencyrate",
"DEBUG: linking source /tmp/l1/reckless/currencyrate/source/currencyrate/currencyrate.py to /tmp/l1/reckless/currencyrate/currencyrate.py",
"DEBUG: InstInfo(currencyrate, /tmp/l1/reckless/currencyrate, None, currencyrate.py, requirements.txt, source/currencyrate)",
"DEBUG: configuring a python virtual environment (pip) in /tmp/l1/reckless/currencyrate/.venv",
"DEBUG: virtual environment created in /tmp/l1/reckless/currencyrate/.venv.",
"INFO: dependencies installed successfully",
"DEBUG: virtual environment for cloned plugin: .venv",
"INFO: plugin installed: /tmp/l1/reckless/currencyrate",
"DEBUG: activating currencyrate",
"INFO: currencyrate enabled"
]
}
}
]
}