From 868c6c4e4bc5f433d856858b1d42fa139360ea25 Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Tue, 30 Oct 2018 12:06:55 +0200 Subject: [PATCH] MXS-1779 Add REST-API documentation --- Documentation/REST-API/Resources-MaxScale.md | 38 ++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/Documentation/REST-API/Resources-MaxScale.md b/Documentation/REST-API/Resources-MaxScale.md index b159ff668..1c1b1fe66 100644 --- a/Documentation/REST-API/Resources-MaxScale.md +++ b/Documentation/REST-API/Resources-MaxScale.md @@ -575,3 +575,41 @@ contain any valid JSON value. Command with no output: `Status: 204 No Content` + +## Classify a statement + +``` +GET /v1/maxscale/query_classifier/classify?sql= +``` + +Classify provided statement and return the result. + +#### Response + +`Status: 200 OK` + +``` +GET /v1/maxscale/query_classifier/classify?sql=SELECT+1 +``` + +```javascript +{ + "links": { + "self": "http://localhost:8989/v1/maxscale/query_classifier/classify" + }, + "data": { + "id": "classify", + "type": "classify", + "attributes": { + "parameters": { + "parse_result": "QC_QUERY_PARSED", + "type_mask": "QUERY_TYPE_READ", + "operation": "QUERY_OP_SELECT", + "has_where_clause": false, + "fields": [], + "functions": [] + } + } + } +} +```