From 5b399e3187d27f6959c769fc4d15a6a6e3921465 Mon Sep 17 00:00:00 2001 From: dblock Date: Mon, 15 Jul 2024 15:00:50 -0400 Subject: [PATCH] Allow either node ID or metric in /_nodes. Signed-off-by: dblock --- spec/namespaces/nodes.yaml | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/spec/namespaces/nodes.yaml b/spec/namespaces/nodes.yaml index 4e12beb5..c4283dba 100644 --- a/spec/namespaces/nodes.yaml +++ b/spec/namespaces/nodes.yaml @@ -253,7 +253,7 @@ paths: responses: '200': $ref: '#/components/responses/nodes.usage@200' - /_nodes/{node_id}: + /_nodes/{node_id_or_metric}: get: operationId: nodes.info.1 x-operation-group: nodes.info @@ -262,7 +262,7 @@ paths: externalDocs: url: https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-info/ parameters: - - $ref: '#/components/parameters/nodes.info::path.node_id' + - $ref: '#/components/parameters/nodes.info::path.node_id_or_metric' - $ref: '#/components/parameters/nodes.info::query.flat_settings' - $ref: '#/components/parameters/nodes.info::query.timeout' responses: @@ -530,15 +530,19 @@ components: description: The type to sample. schema: $ref: '../schemas/nodes._common.yaml#/components/schemas/SampleType' - nodes.info::path.metric: + nodes.info::path.node_id_or_metric: in: path - name: metric - description: Limits the information returned to the specific metrics. Supports a comma-separated list, such as http,ingest. + name: node_id_or_metric + description: | + Limits the information returned to a list of node IDs or specific metrics. + Supports a comma-separated list, such as node1,node2 or http,ingest. required: true schema: type: array items: - $ref: '../schemas/nodes.info.yaml#/components/schemas/Metric' + anyOf: + - $ref: '../schemas/_common.yaml#/components/schemas/NodeIds' + - $ref: '../schemas/nodes.info.yaml#/components/schemas/Metric' style: simple nodes.info::path.node_id: in: path @@ -548,6 +552,16 @@ components: schema: $ref: '../schemas/_common.yaml#/components/schemas/NodeIds' style: simple + nodes.info::path.metric: + in: path + name: metric + description: Limits the information returned to the specific metrics. Supports a comma-separated list, such as http,ingest. + required: true + schema: + type: array + items: + $ref: '../schemas/nodes.info.yaml#/components/schemas/Metric' + style: simple nodes.info::query.flat_settings: in: query name: flat_settings