From 1de9c4fdad75d960c3c84cfe9ee1be6a7132fc5d Mon Sep 17 00:00:00 2001 From: Bzil Date: Thu, 4 Jul 2024 14:19:41 +0200 Subject: [PATCH 1/3] Add tests for nodes Signed-off-by: Bzil --- spec/schemas/nodes.info.yaml | 1 + tests/_core/nodes.yaml | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/spec/schemas/nodes.info.yaml b/spec/schemas/nodes.info.yaml index f687b4523..790842f6f 100644 --- a/spec/schemas/nodes.info.yaml +++ b/spec/schemas/nodes.info.yaml @@ -21,6 +21,7 @@ components: - aggregations - indices - search_pipelines + - _all ResponseBase: allOf: - type: object diff --git a/tests/_core/nodes.yaml b/tests/_core/nodes.yaml index 608232cb3..c03735f19 100644 --- a/tests/_core/nodes.yaml +++ b/tests/_core/nodes.yaml @@ -7,3 +7,36 @@ chapters: method: GET response: status: 200 + - synopsis: Nodes thread_pool metric with a json response. + path: /_nodes/{metric} + method: GET + parameters: + metric: + - thread_pool + response: + status: 200 + - synopsis: Nodes jvm and thread_pool metric with a json response. + path: /_nodes/{metric} + method: GET + parameters: + metric: + - jvm + - thread_pool + response: + status: 200 + - synopsis: Nodes _all metric with a json response. + path: /_nodes/{metric} + method: GET + parameters: + metric: + - _all + response: + status: 200 + - synopsis: Nodes data:true metric with a json response. + path: /_nodes/{metric} + method: GET + parameters: + metric: + - master:true + response: + status: 200 \ No newline at end of file From 03249cea55c49a38ec91a225b654873d091172c4 Mon Sep 17 00:00:00 2001 From: Bzil Date: Thu, 4 Jul 2024 17:43:07 +0200 Subject: [PATCH 2/3] Add tests for nodes Signed-off-by: Bzil --- spec/namespaces/nodes.yaml | 15 +++++++++++++++ spec/schemas/nodes.info.yaml | 10 ++++++---- tests/_core/nodes.yaml | 6 +++--- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/spec/namespaces/nodes.yaml b/spec/namespaces/nodes.yaml index 4db9ebfee..75a293596 100644 --- a/spec/namespaces/nodes.yaml +++ b/spec/namespaces/nodes.yaml @@ -268,6 +268,21 @@ paths: responses: '200': $ref: '#/components/responses/nodes.info@200' + /_nodes/{metric}/stats: + get: + operationId: nodes.info.1 + x-operation-group: nodes.info + x-version-added: '1.0' + description: Returns information about nodes in the cluster. + externalDocs: + url: https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-info/ + parameters: + - $ref: '#/components/parameters/nodes.info::path.metric' + - $ref: '#/components/parameters/nodes.info::query.flat_settings' + - $ref: '#/components/parameters/nodes.info::query.timeout' + responses: + '200': + $ref: '#/components/responses/nodes.info@200' /_nodes/{node_id}: get: operationId: nodes.info.2 diff --git a/spec/schemas/nodes.info.yaml b/spec/schemas/nodes.info.yaml index 790842f6f..65b456281 100644 --- a/spec/schemas/nodes.info.yaml +++ b/spec/schemas/nodes.info.yaml @@ -22,6 +22,7 @@ components: - indices - search_pipelines - _all + - _cluster_manager ResponseBase: allOf: - type: object @@ -29,14 +30,15 @@ components: cluster_name: $ref: '_common.yaml#/components/schemas/Name' nodes: - type: object - additionalProperties: - $ref: '#/components/schemas/NodeInfo' + oneOf: + - type: object + $ref: '#/components/schemas/NodeInfo' + - type: object + additionalProperties: {} _nodes: $ref: 'nodes._common.yaml#/components/schemas/NodesResponseBase' required: - cluster_name - - nodes - _nodes NodeInfo: type: object diff --git a/tests/_core/nodes.yaml b/tests/_core/nodes.yaml index c03735f19..6c2f6ef51 100644 --- a/tests/_core/nodes.yaml +++ b/tests/_core/nodes.yaml @@ -32,11 +32,11 @@ chapters: - _all response: status: 200 - - synopsis: Nodes data:true metric with a json response. - path: /_nodes/{metric} + - synopsis: Nodes _cluster_manager metric with a json response. + path: /_nodes/{metric}/stats method: GET parameters: metric: - - master:true + - _cluster_manager response: status: 200 \ No newline at end of file From a37033ca82e724a16a59570053d852b2337ed73f Mon Sep 17 00:00:00 2001 From: Bzil Date: Fri, 5 Jul 2024 14:06:32 +0200 Subject: [PATCH 3/3] Add tests for ex on index page Signed-off-by: Bzil --- tests/_core/nodes.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/_core/nodes.yaml b/tests/_core/nodes.yaml index 6c2f6ef51..dd25eb3a9 100644 --- a/tests/_core/nodes.yaml +++ b/tests/_core/nodes.yaml @@ -38,5 +38,22 @@ chapters: parameters: metric: - _cluster_manager + response: + status: 200 + - synopsis: Nodes _cluster_manager metric with a json response. + path: /_nodes/{metric}/stats + method: GET + parameters: + metric: + - data:true + response: + status: 200 + - synopsis: Nodes _cluster_manager metric with a json response. + path: /_nodes/{metric}/stats + method: GET + parameters: + metric: + - _all + - cluster_manager:false response: status: 200 \ No newline at end of file