MXS-1779 Add initial support for classification URL

This commit introduces the plumbing support for obtaining
classification information of a statement using the REST-API.
It introduces a URL like

    /v1/maxscale/query_classifier/classify?sql=SELECT+1

that in the response will return a JSON object with the
information. Subsequent commits will provide the actual
information.
This commit is contained in:
Johan Wikman
2018-10-17 13:45:02 +03:00
parent 460d134e73
commit 3631388f75
6 changed files with 53 additions and 13 deletions

View File

@ -110,6 +110,7 @@ extern const char CN_AUTH_READ_TIMEOUT[];
extern const char CN_AUTH_WRITE_TIMEOUT[];
extern const char CN_AUTO[];
extern const char CN_CACHE_SIZE[];
extern const char CN_CLASSIFY[];
extern const char CN_CONNECTION_TIMEOUT[];
extern const char CN_DUMP_LAST_STATEMENTS[];
extern const char CN_DATA[];

View File

@ -24,19 +24,20 @@
MXS_BEGIN_DECLS
/** Resource endpoints */
#define MXS_JSON_API_SERVERS "/servers/"
#define MXS_JSON_API_SERVICES "/services/"
#define MXS_JSON_API_FILTERS "/filters/"
#define MXS_JSON_API_MONITORS "/monitors/"
#define MXS_JSON_API_SESSIONS "/sessions/"
#define MXS_JSON_API_MAXSCALE "/maxscale/"
#define MXS_JSON_API_THREADS "/maxscale/threads/"
#define MXS_JSON_API_LOGS "/maxscale/logs/"
#define MXS_JSON_API_TASKS "/maxscale/tasks/"
#define MXS_JSON_API_MODULES "/maxscale/modules/"
#define MXS_JSON_API_QC_STATS "/maxscale/qc_stats/"
#define MXS_JSON_API_QC "/maxscale/query_classifier/"
#define MXS_JSON_API_USERS "/users/"
#define MXS_JSON_API_SERVERS "/servers/"
#define MXS_JSON_API_SERVICES "/services/"
#define MXS_JSON_API_FILTERS "/filters/"
#define MXS_JSON_API_MONITORS "/monitors/"
#define MXS_JSON_API_SESSIONS "/sessions/"
#define MXS_JSON_API_MAXSCALE "/maxscale/"
#define MXS_JSON_API_THREADS "/maxscale/threads/"
#define MXS_JSON_API_LOGS "/maxscale/logs/"
#define MXS_JSON_API_TASKS "/maxscale/tasks/"
#define MXS_JSON_API_MODULES "/maxscale/modules/"
#define MXS_JSON_API_QC_STATS "/maxscale/qc_stats/"
#define MXS_JSON_API_QC "/maxscale/query_classifier/"
#define MXS_JSON_API_QC_CLASSIFY "/maxscale/query_classifier/classify"
#define MXS_JSON_API_USERS "/users/"
/**
* @brief Create a JSON object