aboutsummaryrefslogtreecommitdiffstats
path: root/src/afb-supervision.c
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2018-02-13 11:51:14 +0100
committerJosé Bollo <jose.bollo@iot.bzh>2018-02-13 11:51:14 +0100
commit775144f839df8e3d37ec1cf52d0f7d3849ac7d46 (patch)
treea315600063bc147918bcc1518a81b79280423fa9 /src/afb-supervision.c
parente88c6e83a85c5bcdce7bc02081bf62d117bb2e28 (diff)
supervision: Add retrieval of config
Change-Id: Id7bb91c267037cbd36c6cafef62d3c39a67e77db Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/afb-supervision.c')
-rw-r--r--src/afb-supervision.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/afb-supervision.c b/src/afb-supervision.c
index a7099a4a..6812e00a 100644
--- a/src/afb-supervision.c
+++ b/src/afb-supervision.c
@@ -38,6 +38,7 @@
#include "afb-xreq.h"
#include "afb-trace.h"
#include "afb-session.h"
+#include "afb-config.h"
#include "afb-supervision.h"
#include "afs-supervision.h"
#include "afb-stub-ws.h"
@@ -45,6 +46,8 @@
#include "verbose.h"
#include "wrap-json.h"
+extern struct afb_config *main_config;
+
/* api and apiset name */
static const char supervision_apiname[] = AFS_SURPERVISION_APINAME;
@@ -265,8 +268,8 @@ static void slist(void *closure, struct afb_session *session)
******************************************************************************/
static const char *verbs[] = {
- "break", "do", "exit", "sclose", "slist", "trace", "wait" };
-enum { Break , Do , Exit , Sclose , Slist , Trace , Wait };
+ "break", "config", "do", "exit", "sclose", "slist", "trace", "wait" };
+enum { Break , Config , Do , Exit , Sclose , Slist , Trace , Wait };
static void on_supervision_call(void *closure, struct afb_xreq *xreq)
@@ -319,6 +322,9 @@ static void on_supervision_call(void *closure, struct afb_xreq *xreq)
afb_session_foreach(slist, list);
afb_xreq_success(xreq, list, NULL);
break;
+ case Config:
+ afb_xreq_success(xreq, afb_config_json(main_config), NULL);
+ break;
case Trace:
if (!trace)
trace = afb_trace_create(supervision_apiname, NULL /* not bound to any session */);