From 2c69b50d77a227b58383c5926ccde39d771ce650 Mon Sep 17 00:00:00 2001 From: Ruirui Zhang Date: Fri, 21 Jun 2024 12:34:46 -0700 Subject: [PATCH] add query_group API documentation Signed-off-by: Ruirui Zhang --- spec/namespaces/query_group.yaml | 135 ++++++++++++++++++++++++++ spec/schemas/query_group._common.yaml | 68 +++++++++++++ 2 files changed, 203 insertions(+) create mode 100644 spec/namespaces/query_group.yaml create mode 100644 spec/schemas/query_group._common.yaml diff --git a/spec/namespaces/query_group.yaml b/spec/namespaces/query_group.yaml new file mode 100644 index 000000000..74fb7c1d1 --- /dev/null +++ b/spec/namespaces/query_group.yaml @@ -0,0 +1,135 @@ +openapi: 3.1.0 +info: + title: OpenSearch QueryGroup API + description: OpenSearch QueryGroup API + version: 1.0.0 +paths: + /_query_group: + get: + operationId: query_group.get.0 + x-operation-group: query_group.get + x-version-added: '2.16' + description: Gets the specified QueryGroup or get all if no name is provided. + responses: + '200': + $ref: '#/components/responses/query_group.get@200' + put: + operationId: query_group.put.0 + x-operation-group: query_group.put + x-version-added: '2.16' + description: Creates or updates a specified query group. + requestBody: + $ref: '#/components/requestBodies/query_group.put.0' + responses: + '200': + $ref: '#/components/responses/query_group.put@200' + delete: + operationId: query_group.delete.0 + x-operation-group: query_group.delete + x-version-added: '2.16' + description: Deletes the specified QueryGroups or delete all if no name is provided. + responses: + '200': + $ref: '#/components/responses/query_group.delete@200' + /_query_group/{name}: + get: + operationId: query_group.get.1 + x-operation-group: query_group.get + x-version-added: '2.16' + description: Gets the specified QueryGroup or get all if no name is provided. + parameters: + - $ref: '#/components/parameters/query_group.get::path.name' + responses: + '200': + $ref: '#/components/responses/query_group.get@200' + put: + operationId: query_group.put.1 + x-operation-group: query_group.put + x-version-added: '2.16' + description: Creates or updates a specified query group. + parameters: + - $ref: '#/components/parameters/query_group.put::path.name' + requestBody: + $ref: '#/components/requestBodies/query_group.put.1' + responses: + '200': + $ref: '#/components/responses/query_group.put@200' + delete: + operationId: query_group.delete.1 + x-operation-group: query_group.delete + x-version-added: '2.16' + description: Deletes the specified QueryGroups or delete all if no name is provided. + parameters: + - $ref: '#/components/parameters/query_group.delete::path.name' + responses: + '200': + $ref: '#/components/responses/query_group.delete@200' +components: + requestBodies: + query_group.put.0: + content: + application/json: + schema: + type: object + properties: + $ref: '../schemas/query_group._common.yaml#/components/schemas/QueryGroupCreateStructure' + required: true + query_group.put.1: + content: + application/json: + schema: + type: object + properties: + $ref: '../schemas/query_group._common.yaml#/components/schemas/QueryGroupUpdateStructure' + required: true + responses: + query_group.put@200: + description: '' + content: + application/json: + schema: + $ref: '../schemas/query_group._common.yaml#/components/schemas/QueryGroupResponseStructure' + query_group.delete@200: + description: '' + content: + application/json: + schema: + type: object + properties: + deleted: + type: array + items: + $ref: '../schemas/query_group._common.yaml#/components/schemas/QueryGroupResponseStructure' + query_group.get@200: + description: '' + content: + application/json: + schema: + type: object + properties: + query_groups: + type: array + items: + $ref: '../schemas/query_group._common.yaml#/components/schemas/QueryGroupResponseStructure' + parameters: + query_group.put::path.name: + name: name + in: path + description: QueryGroup name. + schema: + type: string + required: true + query_group.delete::path.name: + name: name + in: path + description: QueryGroup name. + schema: + type: string + required: true + query_group.get::path.name: + name: name + in: path + description: QueryGroup name. + schema: + type: string + required: true diff --git a/spec/schemas/query_group._common.yaml b/spec/schemas/query_group._common.yaml new file mode 100644 index 000000000..ee6d4052d --- /dev/null +++ b/spec/schemas/query_group._common.yaml @@ -0,0 +1,68 @@ +openapi: 3.1.0 +info: + title: Schemas of query_group._common category + description: Schemas of query_group._common category + version: 1.0.0 +paths: {} +components: + schemas: + QueryGroupResponseStructure: + type: object + properties: + name: + type: string + resiliency_mode: + type: string + enum: [ "soft", "enforced", "monitor" ] + jvm: + type: number + format: double + cpu: + type: number + format: double + updatedAt: + type: integer + format: int64 + anyOf: + - required: + - jvm + - required: + - cpu + required: + - name + - resiliency_mode + - updatedAt + QueryGroupCreateStructure: + type: object + properties: + name: + type: string + resiliency_mode: + type: string + enum: [ "soft", "enforced", "monitor" ] + jvm: + type: number + format: double + cpu: + type: number + format: double + anyOf: + - required: + - jvm + - required: + - cpu + required: + - name + - resiliency_mode + QueryGroupUpdateStructure: + type: object + properties: + resiliency_mode: + type: string + enum: [ "soft", "enforced", "monitor" ] + jvm: + type: number + format: double + cpu: + type: number + format: double