From a6e350257aeafe2310035901d49ff95e23db92ce Mon Sep 17 00:00:00 2001 From: Tokesh Date: Thu, 1 Aug 2024 22:52:54 +0500 Subject: [PATCH] adding version plain version of request body Signed-off-by: Tokesh --- spec/namespaces/sql.yaml | 4 +++- spec/schemas/sql._common.yaml | 23 +++++++++++++++++++++-- tests/sql/settings.yaml | 14 ++++++++++++++ 3 files changed, 38 insertions(+), 3 deletions(-) diff --git a/spec/namespaces/sql.yaml b/spec/namespaces/sql.yaml index 3ab67069f..721ae9d39 100644 --- a/spec/namespaces/sql.yaml +++ b/spec/namespaces/sql.yaml @@ -185,7 +185,9 @@ components: content: application/json: schema: - $ref: '../schemas/sql._common.yaml#/components/schemas/SqlSettings' + anyOf: + - $ref: '../schemas/sql._common.yaml#/components/schemas/SqlSettingsPlain' + - $ref: '../schemas/sql._common.yaml#/components/schemas/SqlSettings' required: true sql.query: content: diff --git a/spec/schemas/sql._common.yaml b/spec/schemas/sql._common.yaml index 957120953..96c60c92d 100644 --- a/spec/schemas/sql._common.yaml +++ b/spec/schemas/sql._common.yaml @@ -91,6 +91,11 @@ components: properties: transient: $ref: '#/components/schemas/Transient' + SqlSettingsPlain: + type: object + properties: + transient: + $ref: '#/components/schemas/TransientPlain' SqlSettingsResponse: type: object properties: @@ -126,7 +131,6 @@ components: type: string size_limit: type: string - Sql: type: object properties: @@ -140,4 +144,19 @@ components: type: object properties: keep_alive: - type: string \ No newline at end of file + type: string + TransientPlain: + type: object + properties: + plugins.sql.enabled: + type: boolean + plugins.ppl.enabled: + type: boolean + plugins.sql.slowlog: + type: integer + plugins.sql.cursor.keep_alive: + type: string + plugins.query.memory_limit: + type: string + plugins.query.size_limit: + type: integer \ No newline at end of file diff --git a/tests/sql/settings.yaml b/tests/sql/settings.yaml index 894b51af6..15d48f0da 100644 --- a/tests/sql/settings.yaml +++ b/tests/sql/settings.yaml @@ -20,5 +20,19 @@ chapters: query: memory_limit: '80%' size_limit: '200' + response: + status: 200 + - synopsis: Update SQL settings with plain request body. + path: /_plugins/_query/settings + method: PUT + request_body: + payload: + transient: + "plugins.sql.enabled" : true + "plugins.ppl.enabled" : true + "plugins.sql.slowlog" : 2 + "plugins.sql.cursor.keep_alive" : "1m" + "plugins.query.memory_limit" : "80%" + "plugins.query.size_limit": 200 response: status: 200 \ No newline at end of file