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

@ -23,6 +23,7 @@
#include <maxscale/dcb.h>
#include <maxscale/routing.h>
#include <maxscale/session.h>
#include <maxscale/jansson.h>
MXS_BEGIN_DECLS
@ -174,9 +175,12 @@ typedef struct mxs_filter_object
*
* @param instance Filter instance
* @param fsession Filter session, NULL if general information about the filter is queried
* @param dcb DCB where the diagnostic information should be written
*
* @return JSON formatted information about the filter
*
* @see jansson.h
*/
void (*diagnostics)(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DCB *dcb);
json_t* (*diagnostics)(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession);
/**
* @brief Called to obtain the capabilities of the filter