Skip to content

Commit c6ea1ea

Browse files
Add api spec for tiering of indices from hot to warm
Signed-off-by: Neetika Singhal <[email protected]>
1 parent 83343b2 commit c6ea1ea

File tree

4 files changed

+131
-0
lines changed

4 files changed

+131
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
5656
- Added test coverage ([#443](https://github.com/opensearch-project/opensearch-api-specification/pull/443))
5757
- Added `--opensearch-version` to `merger` that excludes schema elements per semver ([#428](https://github.com/opensearch-project/opensearch-api-specification/pull/428))
5858
- Added `retry` to `tester` to support asynchronous tasks ([453](https://github.com/opensearch-project/opensearch-api-specification/pull/453))
59+
- Added `/{index}/_tier` api spec for tiering of indices ([#368](https://github.com/opensearch-project/opensearch-api-specification/pull/368))
5960

6061
### Changed
6162

spec/namespaces/indices.yaml

+87
Original file line numberDiff line numberDiff line change
@@ -1793,6 +1793,22 @@ paths:
17931793
responses:
17941794
'200':
17951795
$ref: '#/components/responses/indices.stats@200'
1796+
/{index}/_tier/warm:
1797+
post:
1798+
operationId: indices.tier_warm.0
1799+
x-operation-group: indices.tier_warm
1800+
x-version-added: 2.16.0
1801+
description: Tier the index to warm in the cluster.
1802+
parameters:
1803+
- $ref: '#/components/parameters/indices.tier_warm::path.index'
1804+
- $ref: '#/components/parameters/indices.tier_warm::query.allow_no_indices'
1805+
- $ref: '#/components/parameters/indices.tier_warm::query.cluster_manager_timeout'
1806+
- $ref: '#/components/parameters/indices.tier_warm::query.ignore_unavailable'
1807+
- $ref: '#/components/parameters/indices.tier_warm::query.timeout'
1808+
- $ref: '#/components/parameters/indices.tier_warm::query.wait_for_completion'
1809+
responses:
1810+
'200':
1811+
$ref: '#/components/responses/indices.tier_warm@200'
17961812
/{index}/_upgrade:
17971813
get:
17981814
operationId: indices.get_upgrade.1
@@ -2743,6 +2759,24 @@ components:
27432759
required:
27442760
- _all
27452761
- _shards
2762+
indices.tier_warm@200:
2763+
description: tiering response for indices target to warm tier
2764+
content:
2765+
application/json:
2766+
schema:
2767+
type: object
2768+
properties:
2769+
acknowledged:
2770+
description: Whether the request has been acknowledged
2771+
type: boolean
2772+
failed_indices:
2773+
description: List of failed indices
2774+
type: array
2775+
items:
2776+
$ref: '../schemas/tier.warm.yaml#/components/schemas/FailedIndex'
2777+
required:
2778+
- acknowledged
2779+
- failed_indices
27462780
indices.update_aliases@200:
27472781
description: ''
27482782
content:
@@ -5126,6 +5160,59 @@ components:
51265160
schema:
51275161
$ref: '../schemas/_common.yaml#/components/schemas/Level'
51285162
style: form
5163+
indices.tier_warm::path.index:
5164+
in: path
5165+
name: index
5166+
description: |-
5167+
Comma-separated list of data streams, indices, and aliases to tier.
5168+
Supports wildcards (`*`).
5169+
To search all data streams or indices, omit this parameter or use `*` or `_all`.
5170+
required: true
5171+
schema:
5172+
$ref: '../schemas/_common.yaml#/components/schemas/Indices'
5173+
style: simple
5174+
indices.tier_warm::query.allow_no_indices:
5175+
in: query
5176+
name: allow_no_indices
5177+
description: |-
5178+
If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.
5179+
This behavior applies even if the request targets other open indices.
5180+
schema:
5181+
type: boolean
5182+
default: false
5183+
style: form
5184+
indices.tier_warm::query.cluster_manager_timeout:
5185+
name: cluster_manager_timeout
5186+
in: query
5187+
description: Operation timeout for connection to cluster-manager node.
5188+
schema:
5189+
$ref: '../schemas/_common.yaml#/components/schemas/Duration'
5190+
x-version-added: 2.0.0
5191+
indices.tier_warm::query.ignore_unavailable:
5192+
in: query
5193+
name: ignore_unavailable
5194+
description: If `false`, the request returns an error if it targets a missing or closed index.
5195+
schema:
5196+
type: boolean
5197+
default: false
5198+
style: form
5199+
indices.tier_warm::query.timeout:
5200+
in: query
5201+
name: timeout
5202+
description: |-
5203+
Period to wait for a response.
5204+
If no response is received before the timeout expires, the request fails and returns an error.
5205+
schema:
5206+
$ref: '../schemas/_common.yaml#/components/schemas/Duration'
5207+
style: form
5208+
indices.tier_warm::query.wait_for_completion:
5209+
name: wait_for_completion
5210+
in: query
5211+
description: Wait until the operation has completed before returning.
5212+
schema:
5213+
type: boolean
5214+
default: true
5215+
description: Wait until the operation has completed before returning.
51295216
indices.update_aliases::query.cluster_manager_timeout:
51305217
name: cluster_manager_timeout
51315218
in: query

spec/schemas/tier.warm.yaml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
openapi: 3.1.0
2+
info:
3+
title: Schemas of tier_warm category
4+
description: Schemas of tier_warm category
5+
version: 1.0.0
6+
paths: {}
7+
components:
8+
schemas:
9+
FailedIndex:
10+
type: object
11+
properties:
12+
index:
13+
description: Index name.
14+
$ref: '_common.yaml#/components/schemas/IndexName'
15+
error:
16+
description: Error message.
17+
type: string

tests/indices/tier/warm.yaml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
$schema: ../../../json_schemas/test_story.schema.yaml
2+
3+
version: '>= 2.16'
4+
description: Test endpoints relevant to tiering of index to warm.
5+
prologues:
6+
- path: /{index}
7+
method: PUT
8+
parameters:
9+
index: books
10+
- path: /{index}
11+
method: PUT
12+
parameters:
13+
index: games
14+
epilogues:
15+
- path: /books,movies
16+
method: DELETE
17+
status: [200, 404]
18+
chapters:
19+
- synopsis: Tier the `books` and `games` indices from hot to warm.
20+
path: /{index}/_tier/warm
21+
method: POST
22+
parameters:
23+
index: books,games
24+
response:
25+
status: 200
26+

0 commit comments

Comments
 (0)