From 5e799c76eb861d3bd572e583c3a74e29063d17e0 Mon Sep 17 00:00:00 2001 From: dblock Date: Mon, 25 Nov 2024 11:27:14 -0500 Subject: [PATCH] Fixed nodes usage responses. Signed-off-by: dblock --- spec/schemas/nodes.usage.yaml | 3 +- tests/default/nodes/stats.yaml | 11 +++++++ tests/default/nodes/usage.yaml | 60 ++++++++++++++++++++++++++++++++++ 3 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 tests/default/nodes/usage.yaml diff --git a/spec/schemas/nodes.usage.yaml b/spec/schemas/nodes.usage.yaml index 2ce22876e..19deeb842 100644 --- a/spec/schemas/nodes.usage.yaml +++ b/spec/schemas/nodes.usage.yaml @@ -10,6 +10,7 @@ components: type: string enum: - _all + - aggregations - rest_actions ResponseBase: allOf: @@ -41,7 +42,5 @@ components: additionalProperties: type: object required: - - aggregations - - rest_actions - since - timestamp diff --git a/tests/default/nodes/stats.yaml b/tests/default/nodes/stats.yaml index a54f284ae..8886d05e6 100644 --- a/tests/default/nodes/stats.yaml +++ b/tests/default/nodes/stats.yaml @@ -179,3 +179,14 @@ chapters: - search response: status: 200 + - synopsis: Get statistics for search (`node_id`). + path: /_nodes/{node_id}/stats/{metric}/{index_metric} + method: GET + parameters: + node_id: _all + metric: + - indices + index_metric: + - search + response: + status: 200 diff --git a/tests/default/nodes/usage.yaml b/tests/default/nodes/usage.yaml new file mode 100644 index 000000000..083bfcbd1 --- /dev/null +++ b/tests/default/nodes/usage.yaml @@ -0,0 +1,60 @@ +$schema: ../../../json_schemas/test_story.schema.yaml + +description: Test nodes usage. +chapters: + - synopsis: Get usage for all nodes. + path: /_nodes/usage + method: GET + response: + status: 200 + - synopsis: Get usage for all nodes for all metrics. + path: /_nodes/usage/{metric} + method: GET + parameters: + metric: + - _all + response: + status: 200 + - synopsis: Get usage for all nodes for the `rest_actions` metric. + path: /_nodes/usage/{metric} + method: GET + parameters: + metric: + - rest_actions + response: + status: 200 + - synopsis: Get usage for all nodes for the `aggregations` metric. + path: /_nodes/usage/{metric} + method: GET + parameters: + metric: + - aggregations + response: + status: 200 + - synopsis: Get usage for all nodes (`node_id`). + path: /_nodes/{node_id}/usage + method: GET + parameters: + node_id: _all + response: + status: 200 + - synopsis: Get usage for all nodes for all metrics (`node_id`). + path: /_nodes/{node_id}/usage/{metric} + method: GET + parameters: + node_id: _all + metric: + - _all + response: + status: 200 + - synopsis: Get usage for all nodes and all metrics. + warnings: + multiple-paths-detected: false + path: /_nodes/{node_id}/{metric} + method: GET + parameters: + node_id: _all + metric: + - _all + response: + status: 200