MXS-1220: Add JSON return value to diagnostics entry points

The modules that implement a diagnostics entry point now return a JSON
type object. This removes the need to format data inside the modules.

The module implementations of these are not yet complete which means that
MaxScale will fail to compile.
This commit is contained in:
Markus Mäkelä
2017-04-18 04:56:37 +03:00
committed by Markus Mäkelä
parent 94ebef0703
commit bbe0620944
8 changed files with 113 additions and 21 deletions

View File

@ -24,6 +24,7 @@
#include <maxscale/routing.h>
#include <maxscale/service.h>
#include <maxscale/session.h>
#include <maxscale/jansson.h>
MXS_BEGIN_DECLS
@ -144,14 +145,16 @@ typedef struct mxs_router_object
*/
int32_t (*routeQuery)(MXS_ROUTER *instance, MXS_ROUTER_SESSION *router_session, GWBUF *queue);
/**
* @brief Called for diagnostic output
*
* @param instance Router instance
* @param dcb DCB where the diagnostic information should be written
*
* @return Diagnostic information in JSON format
*
* @see jansson.h
*/
void (*diagnostics)(MXS_ROUTER *instance, DCB *dcb);
json_t* (*diagnostics)(MXS_ROUTER *instance);
/**
* @brief Called for each reply packet