From 27f895cf46278eb8b60432ac3b5e44ca73efe1f2 Mon Sep 17 00:00:00 2001
From: Simon Zolin <s.zolin@adguard.com>
Date: Mon, 29 Jul 2019 18:51:55 +0300
Subject: [PATCH] + openapi: /querylog_info, /querylog_config, /querylog_clear

---
 openapi/openapi.yaml | 48 +++++++++++++++++++++++++++++++++++++-------
 1 file changed, 41 insertions(+), 7 deletions(-)

diff --git a/openapi/openapi.yaml b/openapi/openapi.yaml
index f7f56379..6542ee02 100644
--- a/openapi/openapi.yaml
+++ b/openapi/openapi.yaml
@@ -191,21 +191,42 @@ paths:
                     description: OK
                     schema:
                         $ref: '#/definitions/QueryLog'
-    /querylog_enable:
-        post:
+
+    /querylog_info:
+        get:
             tags:
                 - log
-            operationId: querylogEnable
-            summary: 'Enable querylog'
+            operationId: queryLogInfo
+            summary: 'Get query log parameters'
             responses:
                 200:
                     description: OK
-    /querylog_disable:
+                    schema:
+                        $ref: "#/definitions/QueryLogConfig"
+
+    /querylog_config:
         post:
             tags:
                 - log
-            operationId: querylogDisable
-            summary: 'Disable filtering'
+            operationId: queryLogConfig
+            summary: "Set query log parameters"
+            consumes:
+                - application/json
+            parameters:
+                - in: "body"
+                  name: "body"
+                  schema:
+                      $ref: "#/definitions/QueryLogConfig"
+            responses:
+                200:
+                    description: OK
+
+    /querylog_clear:
+        post:
+            tags:
+                - log
+            operationId: querylogClear
+            summary: 'Clear query log'
             responses:
                 200:
                     description: OK
@@ -244,6 +265,7 @@ paths:
             summary: 'Get statistics parameters'
             responses:
                 200:
+                    description: OK
                     schema:
                         $ref: "#/definitions/StatsConfig"
                     description: OK
@@ -1360,6 +1382,18 @@ definitions:
         description: "Query log"
         items:
             $ref: "#/definitions/QueryLogItem"
+
+    QueryLogConfig:
+        type: "object"
+        description: "Query log configuration"
+        properties:
+            enabled:
+                type: "boolean"
+                description: "Is query log enabled"
+            interval:
+                type: "integer"
+                description: "Time period to keep data (1 | 7 | 30 | 90)"
+
     TlsConfig:
         type: "object"
         description: "TLS configuration settings and status"