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:
@ -677,6 +677,13 @@ HttpResponse cb_qc(const HttpRequest& request)
|
||||
return HttpResponse(MHD_HTTP_OK, qc_as_json(request.host()).release());
|
||||
}
|
||||
|
||||
HttpResponse cb_qc_classify(const HttpRequest& request)
|
||||
{
|
||||
string sql = request.get_option("sql");
|
||||
|
||||
return HttpResponse(MHD_HTTP_OK, qc_classify_as_json(request.host(), sql).release());
|
||||
}
|
||||
|
||||
HttpResponse cb_thread(const HttpRequest& request)
|
||||
{
|
||||
int id = atoi(request.last_uri_part().c_str());
|
||||
@ -950,6 +957,8 @@ public:
|
||||
|
||||
m_get.push_back(SResource(new Resource(cb_maxscale, 1, "maxscale")));
|
||||
m_get.push_back(SResource(new Resource(cb_qc, 2, "maxscale", "query_classifier")));
|
||||
m_get.push_back(SResource(new Resource(cb_qc_classify, 3,
|
||||
"maxscale", "query_classifier", "classify")));
|
||||
m_get.push_back(SResource(new Resource(cb_all_threads, 2, "maxscale", "threads")));
|
||||
m_get.push_back(SResource(new Resource(cb_thread, 3, "maxscale", "threads", ":thread")));
|
||||
m_get.push_back(SResource(new Resource(cb_logs, 2, "maxscale", "logs")));
|
||||
|
Reference in New Issue
Block a user