From 71cd07ea616192a580941cf4615b9aea58769e89 Mon Sep 17 00:00:00 2001 From: Simon Vrouwe Date: Mon, 4 Jul 2022 11:23:06 +0300 Subject: [PATCH] json: add "dynamic" field to plugin list CHANGELOG: add "dynamic" field to plugin list --- doc/lightning-plugin.7.md | 3 ++- doc/schemas/plugin.schema.json | 7 ++++++- lightningd/plugin_control.c | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/doc/lightning-plugin.7.md b/doc/lightning-plugin.7.md index f1557b01614a..a79cb4d7b92b 100644 --- a/doc/lightning-plugin.7.md +++ b/doc/lightning-plugin.7.md @@ -56,6 +56,7 @@ If **command** is "start", "startdir", "rescan" or "list": - **plugins** (array of objects): - **name** (string): full pathname of the plugin - **active** (boolean): status; plugin completed init and is operational, plugins are configured asynchronously. + - **dynamic** (boolean): plugin can be stopped or started without restarting lightningd If **command** is "stop": - **result** (string): A message saying it successfully stopped @@ -80,4 +81,4 @@ RESOURCES Main web site: [writing plugins]: PLUGINS.md -[comment]: # ( SHA256STAMP:ee9c974be30d7870cb6a7785956548700b95d2d6b3fe4f18f7757afdfa015553) +[comment]: # ( SHA256STAMP:5c3b25ecb137bfe7a81f80f0b4183a9e1282530ebfac3b1bc05fc5406f59cfc7) diff --git a/doc/schemas/plugin.schema.json b/doc/schemas/plugin.schema.json index 2d70c846a1db..345d285e6fa3 100644 --- a/doc/schemas/plugin.schema.json +++ b/doc/schemas/plugin.schema.json @@ -48,7 +48,8 @@ "additionalProperties": false, "required": [ "name", - "active" + "active", + "dynamic" ], "properties": { "name": { @@ -58,6 +59,10 @@ "active": { "type": "boolean", "description": "status; plugin completed init and is operational, plugins are configured asynchronously." + }, + "dynamic": { + "type": "boolean", + "description": "plugin can be stopped or started without restarting lightningd" } } } diff --git a/lightningd/plugin_control.c b/lightningd/plugin_control.c index 6fbaf2a4e873..d60b397c8208 100644 --- a/lightningd/plugin_control.c +++ b/lightningd/plugin_control.c @@ -34,6 +34,7 @@ static struct command_result *plugin_dynamic_list_plugins(struct plugin_command json_add_string(response, "name", p->cmd); json_add_bool(response, "active", p->plugin_state == INIT_COMPLETE); + json_add_bool(response, "dynamic", p->dynamic); json_object_end(response); } json_array_end(response);