Skip to content

Commit 975727e

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 fce5721 commit 975727e

File tree

5 files changed

+119
-25
lines changed

5 files changed

+119
-25
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
129129
- Added API spec for `adjust_pure_negative` for bool queries ([#641](https://github.com/opensearch-project/opensearch-api-specification/pull/641))
130130
- Added a spec style checker [#620](https://github.com/opensearch-project/opensearch-api-specification/pull/620).
131131
- Added `remote_store` to node `Stats` ([#643](https://github.com/opensearch-project/opensearch-api-specification/pull/643))
132+
- Added spec for _cluster/stats metric and index_metric filter paths([#639](https://github.com/opensearch-project/opensearch-api-specification/pull/639))
133+
132134

133135
### Changed
134136

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

+29-25
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ components:
2727
required:
2828
- cluster_name
2929
- cluster_uuid
30-
- indices
31-
- nodes
3230
- status
3331
- timestamp
3432
ClusterIndices:
@@ -60,17 +58,7 @@ components:
6058
type: array
6159
items:
6260
$ref: '#/components/schemas/IndicesVersions'
63-
required:
64-
- analysis
65-
- completion
66-
- count
67-
- docs
68-
- fielddata
69-
- mappings
70-
- query_cache
71-
- segments
72-
- shards
73-
- store
61+
required: []
7462
CharFilterTypes:
7563
type: object
7664
properties:
@@ -271,18 +259,7 @@ components:
271259
type: array
272260
items:
273261
$ref: '_common.yaml#/components/schemas/VersionString'
274-
required:
275-
- count
276-
- discovery_types
277-
- fs
278-
- ingest
279-
- jvm
280-
- network_types
281-
- os
282-
- packaging_types
283-
- plugins
284-
- process
285-
- versions
262+
required: []
286263
ClusterNodeCount:
287264
type: object
288265
properties:
@@ -689,3 +666,30 @@ components:
689666
- avg
690667
- max
691668
- min
669+
Metric:
670+
type: string
671+
enum:
672+
- _all
673+
- discovery_type
674+
- fs
675+
- indices
676+
- ingest
677+
- jvm
678+
- network_types
679+
- os
680+
- packaging_types
681+
- plugins
682+
- process
683+
IndexMetric:
684+
type: string
685+
enum:
686+
- _all
687+
- analysis
688+
- completion
689+
- docs
690+
- fielddata
691+
- mappings
692+
- query_cache
693+
- segments
694+
- shards
695+
- store
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
$schema: ../../../../json_schemas/test_story.schema.yaml
2+
3+
description: Test cluster manager stats.
4+
# TODO: Re-enable in 3.0, see https://github.com/opensearch-project/opensearch-api-specification/pull/613
5+
version: '>= 2.18 < 3'
6+
chapters:
7+
- synopsis: Get mapping and analysis indices stats.
8+
path: /_cluster/stats/{metric}/{index_metric}/nodes/{node_id}
9+
method: GET
10+
parameters:
11+
node_id: _all
12+
metric:
13+
- indices
14+
index_metric:
15+
- analysis
16+
- mappings
17+
response:
18+
status: 200
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
$schema: ../../../../json_schemas/test_story.schema.yaml
2+
3+
description: Test cluster manager stats.
4+
# TODO: Re-enable in 3.0, see https://github.com/opensearch-project/opensearch-api-specification/pull/613
5+
version: '>= 2.18 < 3'
6+
chapters:
7+
- synopsis: Get nodes fs and jvm stats.
8+
path: /_cluster/stats/{metric}/nodes/{node_id}
9+
method: GET
10+
parameters:
11+
node_id: _all
12+
metric:
13+
- fs
14+
- jvm
15+
response:
16+
status: 200

0 commit comments

Comments
 (0)