diff --git a/CHANGELOG.md b/CHANGELOG.md index e81b172ef..e170d4005 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Added support for skipping tests using semver range ([#410](https://github.com/opensearch-project/opensearch-api-specification/pull/410)) - Added `cluster_manager_timeout` to `HEAD /{index}` ([#421](https://github.com/opensearch-project/opensearch-api-specification/pull/421)) - Added missing fields to `/_nodes/stats` ([#415](https://github.com/opensearch-project/opensearch-api-specification/pull/415)) +- Added missing metrics options to `/_nodes/stats` ([#422](https://github.com/opensearch-project/opensearch-api-specification/pull/422)) ### Changed diff --git a/spec/schemas/nodes.stats.yaml b/spec/schemas/nodes.stats.yaml index 63d877d34..52dd278d0 100644 --- a/spec/schemas/nodes.stats.yaml +++ b/spec/schemas/nodes.stats.yaml @@ -10,18 +10,33 @@ components: type: string enum: - _all + - adaptive_selection + - admission_control - breaker + - caches + - cluster_manager_throttling - discovery + - file_cache - fs - http - indexing_pressure - indices + - ingest - jvm - os - process + - repositories + - resource_usage_stats + - script + - script_cache + - search_backpressure - search_pipeline + - segment_replication_backpressure + - shard_indexing_pressure + - task_cancellation - thread_pool - transport + - weighted_routing IndexMetric: type: string enum: diff --git a/tests/nodes/info.yaml b/tests/nodes/info.yaml index 608232cb3..362a04803 100644 --- a/tests/nodes/info.yaml +++ b/tests/nodes/info.yaml @@ -2,8 +2,15 @@ $schema: ../../json_schemas/test_story.schema.yaml description: Test nodes endpoints. chapters: - - synopsis: Nodes with a json response. + - synopsis: Get all nodes. path: /_nodes method: GET response: status: 200 + - synopsis: Get nodes. + path: /_nodes/{node_id_or_metric} + method: GET + parameters: + node_id_or_metric: indices + response: + status: 200 diff --git a/tests/nodes/stats.yaml b/tests/nodes/stats.yaml index aab5dfdc0..212a58c22 100644 --- a/tests/nodes/stats.yaml +++ b/tests/nodes/stats.yaml @@ -2,8 +2,155 @@ $schema: ../../json_schemas/test_story.schema.yaml description: Test nodes stats. chapters: - - synopsis: Get all nodes stats. + - synopsis: Get stats for all nodes. path: /_nodes/stats method: GET response: status: 200 + - synopsis: Get stats for all nodes with parameters. + path: /_nodes/stats + method: GET + parameters: + completion_fields: '*' + fielddata_fields: '*' + fields: '*' + groups: + - '*' + timeout: 10s + include_segment_file_sizes: true + response: + status: 200 + - synopsis: Get _all node stats (node_id). + path: /_nodes/{node_id}/stats + method: GET + parameters: + node_id: _all + response: + status: 200 + - synopsis: Get fs metic node stats (metric). + path: /_nodes/stats/{metric} + method: GET + parameters: + metric: + - fs + response: + status: 200 + - synopsis: Get fs metric node stats (node_id_or_metric). + path: /_nodes/{node_id_or_metric} + method: GET + parameters: + node_id_or_metric: fs + response: + status: 200 + - synopsis: Get jvm and fs metric node stats from data nodes. + path: /_nodes/{node_id}/stats/{metric} + method: GET + parameters: + node_id: data:true + metric: + - fs + - jvm + response: + status: 200 + - synopsis: Get statistics for the request_cache. + path: /_nodes/stats/{metric}/{index_metric} + method: GET + parameters: + metric: + - adaptive_selection + - breaker + - discovery + - fs + - http + - indexing_pressure + - indices + - ingest + - jvm + - os + - process + - script + - script_cache + - shard_indexing_pressure + - thread_pool + - transport + index_metric: + - request_cache + response: + status: 200 + - synopsis: Get statistics for the request_cache (2.4). + path: /_nodes/stats/{metric}/{index_metric} + method: GET + version: '>= 2.4' + parameters: + metric: + - indices + - search_backpressure + index_metric: + - request_cache + response: + status: 200 + - synopsis: Get statistics for the request_cache (2.6). + path: /_nodes/stats/{metric}/{index_metric} + method: GET + version: '>= 2.6' + parameters: + metric: + - cluster_manager_throttling + - indices + - weighted_routing + index_metric: + - request_cache + response: + status: 200 + - synopsis: Get statistics for the request_cache (2.7). + path: /_nodes/stats/{metric}/{index_metric} + method: GET + version: '>= 2.7' + parameters: + metric: + - file_cache + - indices + index_metric: + - request_cache + response: + status: 200 + - synopsis: Get statistics for the request_cache (2.9). + path: /_nodes/stats/{metric}/{index_metric} + method: GET + version: '>= 2.9' + parameters: + metric: + - indices + - search_pipeline + - task_cancellation + index_metric: + - request_cache + response: + status: 200 + - synopsis: Get statistics for the request_cache (2.12). + path: /_nodes/stats/{metric}/{index_metric} + method: GET + version: '>= 2.12' + parameters: + metric: + - admission_control + - indices + - repositories + - resource_usage_stats + - segment_replication_backpressure + index_metric: + - request_cache + response: + status: 200 + - synopsis: Get statistics for the request_cache (2.14). + path: /_nodes/stats/{metric}/{index_metric} + method: GET + version: '>= 2.14' + parameters: + metric: + - caches + - indices + index_metric: + - request_cache + response: + status: 200 \ No newline at end of file