Skip to content

Commit 4c500a7

Browse files
author
Swetha Guptha
committed
Add spec for cluster stats metric and index_metric filter paths.
Signed-off-by: Swetha Guptha <gupthasg@amazon.com>
1 parent 352e620 commit 4c500a7

File tree

4 files changed

+113
-0
lines changed

4 files changed

+113
-0
lines changed

spec/namespaces/cluster.yaml

+54
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,39 @@ paths:
331331
responses:
332332
'200':
333333
$ref: '#/components/responses/cluster.stats@200'
334+
/_cluster/stats/{metric}/nodes/{node_id}:
335+
get:
336+
operationId: cluster.stats.2
337+
x-operation-group: cluster.stats
338+
x-version-added: '2.18'
339+
description: Returns high-level overview of cluster statistics.
340+
externalDocs:
341+
url: https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-stats/
342+
parameters:
343+
- $ref: '#/components/parameters/cluster.stats::path.metric'
344+
- $ref: '#/components/parameters/cluster.stats::path.node_id'
345+
- $ref: '#/components/parameters/cluster.stats::query.flat_settings'
346+
- $ref: '#/components/parameters/cluster.stats::query.timeout'
347+
responses:
348+
'200':
349+
$ref: '#/components/responses/cluster.stats@200'
350+
/_cluster/stats/{metric}/{index_metric}/nodes/{node_id}:
351+
get:
352+
operationId: cluster.stats.3
353+
x-operation-group: cluster.stats
354+
x-version-added: '2.18'
355+
description: Returns high-level overview of cluster statistics.
356+
externalDocs:
357+
url: https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-stats/
358+
parameters:
359+
- $ref: '#/components/parameters/cluster.stats::path.index_metric'
360+
- $ref: '#/components/parameters/cluster.stats::path.metric'
361+
- $ref: '#/components/parameters/cluster.stats::path.node_id'
362+
- $ref: '#/components/parameters/cluster.stats::query.flat_settings'
363+
- $ref: '#/components/parameters/cluster.stats::query.timeout'
364+
responses:
365+
'200':
366+
$ref: '#/components/responses/cluster.stats@200'
334367
/_cluster/voting_config_exclusions:
335368
post:
336369
operationId: cluster.post_voting_config_exclusions.0
@@ -1380,6 +1413,27 @@ components:
13801413
schema:
13811414
$ref: '../schemas/_common.yaml#/components/schemas/Duration'
13821415
style: form
1416+
cluster.stats::path.index_metric:
1417+
in: path
1418+
name: index_metric
1419+
description: Limit the information returned for indices metric to the specific index metrics. It can be used only if indices (or all) metric is specified.
1420+
required: true
1421+
schema:
1422+
type: array
1423+
items:
1424+
$ref: '../schemas/cluster.stats.yaml#/components/schemas/IndexMetric'
1425+
style: simple
1426+
cluster.stats::path.metric:
1427+
in: path
1428+
name: metric
1429+
description: Limit the information returned to the specified metrics
1430+
required: true
1431+
schema:
1432+
type: array
1433+
items:
1434+
$ref: '../schemas/cluster.stats.yaml#/components/schemas/Metric'
1435+
style:
1436+
simple
13831437
cluster.stats::path.node_id:
13841438
in: path
13851439
name: node_id

spec/schemas/cluster.stats.yaml

+27
Original file line numberDiff line numberDiff line change
@@ -689,3 +689,30 @@ components:
689689
- avg
690690
- max
691691
- min
692+
Metric:
693+
type: string
694+
enum:
695+
- _all
696+
- discovery_type
697+
- fs
698+
- indices
699+
- ingest
700+
- jvm
701+
- network_types
702+
- os
703+
- packaging_types
704+
- plugins
705+
- process
706+
IndexMetric:
707+
type: string
708+
enum:
709+
- _all
710+
- analysis
711+
- completion
712+
- docs
713+
- fielddata
714+
- mappings
715+
- query_cache
716+
- segments
717+
- shards
718+
- store
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
$schema: ../../../../json_schemas/test_story.schema.yaml
2+
3+
description: Test cluster manager stats.
4+
version: '>= 2.18'
5+
chapters:
6+
- synopsis: Get mapping and analysis indices stats.
7+
path: /_cluster/stats/{metric}/{index_metric}/nodes/{node_id}
8+
method: GET
9+
parameters:
10+
node_id: _all
11+
metric:
12+
- indices
13+
index_metric:
14+
- mappings
15+
- analysis
16+
response:
17+
status: 200
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
$schema: ../../../../json_schemas/test_story.schema.yaml
2+
3+
description: Test cluster manager stats.
4+
version: '>= 2.18'
5+
chapters:
6+
- synopsis: Get nodes fs and jvm stats.
7+
path: /_cluster/stats/{metric}/nodes/{node_id}
8+
method: GET
9+
parameters:
10+
node_id: _all
11+
metric:
12+
- fs
13+
- jvm
14+
response:
15+
status: 200

0 commit comments

Comments
 (0)