Skip to content

Commit cb350b5

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

File tree

6 files changed

+137
-1
lines changed

6 files changed

+137
-1
lines changed

.cspell

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ determinized
3434
distilbert
3535
DNFOF
3636
docvalue
37+
Dopensearch
3738
Downsample
3839
downsampling
3940
Downsampling

.github/workflows/test-spec.yml

+4
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ jobs:
3131
- version: 2.16.0
3232
hub: opensearchstaging
3333
ref: '@sha256:bcd7f5d5d30231f24f266064248cc8d3306574948190f7bf93016dff29acf17e'
34+
- version: 2.17.0
35+
hub: opensearchstaging
36+
ref: '@sha256:950075aa5a1fc9b46dcb84fee2ba12258a7f9d01b88d565b9b2634a84f03a212'
37+
opts: -Dopensearch.experimental.feature.tiered_remote_index.enabled=true
3438
- version: 3.0.0
3539
hub: opensearchstaging
3640
ref: '@sha256:db1918b2b8f7ef6c22dd6ff54a0640877c3d395a392a53864745024933981e3b'

CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
6565
- Added metadata additionalProperties to `ErrorCause` ([#462](https://github.com/opensearch-project/opensearch-api-specification/pull/462))
6666
- Added `creation_date` field to `DanglingIndex` ([#462](https://github.com/opensearch-project/opensearch-api-specification/pull/462))
6767
- Added doc on `cluster create-index blocked` workaround ([#465](https://github.com/opensearch-project/opensearch-api-specification/pull/465))
68-
68+
- Added `/{index}/_tier` api spec for tiering of indices ([#368](https://github.com/opensearch-project/opensearch-api-specification/pull/368))
69+
6970
### Changed
7071

7172
- Replaced Smithy with a native OpenAPI spec ([#189](https://github.com/opensearch-project/opensearch-api-specification/issues/189))

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
@@ -2697,6 +2713,24 @@ components:
26972713
required:
26982714
- _all
26992715
- _shards
2716+
indices.tier_warm@200:
2717+
description: tiering response for indices target to warm tier
2718+
content:
2719+
application/json:
2720+
schema:
2721+
type: object
2722+
properties:
2723+
acknowledged:
2724+
description: Whether the request has been acknowledged
2725+
type: boolean
2726+
failed_indices:
2727+
description: List of failed indices
2728+
type: array
2729+
items:
2730+
$ref: '../schemas/tier.warm.yaml#/components/schemas/FailedIndex'
2731+
required:
2732+
- acknowledged
2733+
- failed_indices
27002734
indices.update_aliases@200:
27012735
content:
27022736
application/json:
@@ -5077,6 +5111,59 @@ components:
50775111
schema:
50785112
$ref: '../schemas/_common.yaml#/components/schemas/Level'
50795113
style: form
5114+
indices.tier_warm::path.index:
5115+
in: path
5116+
name: index
5117+
description: |-
5118+
Comma-separated list of data streams, indices, and aliases to tier.
5119+
Supports wildcards (`*`).
5120+
To search all data streams or indices, omit this parameter or use `*` or `_all`.
5121+
required: true
5122+
schema:
5123+
$ref: '../schemas/_common.yaml#/components/schemas/Indices'
5124+
style: simple
5125+
indices.tier_warm::query.allow_no_indices:
5126+
in: query
5127+
name: allow_no_indices
5128+
description: |-
5129+
If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.
5130+
This behavior applies even if the request targets other open indices.
5131+
schema:
5132+
type: boolean
5133+
default: false
5134+
style: form
5135+
indices.tier_warm::query.cluster_manager_timeout:
5136+
name: cluster_manager_timeout
5137+
in: query
5138+
description: Operation timeout for connection to cluster-manager node.
5139+
schema:
5140+
$ref: '../schemas/_common.yaml#/components/schemas/Duration'
5141+
x-version-added: 2.0.0
5142+
indices.tier_warm::query.ignore_unavailable:
5143+
in: query
5144+
name: ignore_unavailable
5145+
description: If `false`, the request returns an error if it targets a missing or closed index.
5146+
schema:
5147+
type: boolean
5148+
default: false
5149+
style: form
5150+
indices.tier_warm::query.timeout:
5151+
in: query
5152+
name: timeout
5153+
description: |-
5154+
Period to wait for a response.
5155+
If no response is received before the timeout expires, the request fails and returns an error.
5156+
schema:
5157+
$ref: '../schemas/_common.yaml#/components/schemas/Duration'
5158+
style: form
5159+
indices.tier_warm::query.wait_for_completion:
5160+
name: wait_for_completion
5161+
in: query
5162+
description: Wait until the operation has completed before returning.
5163+
schema:
5164+
type: boolean
5165+
default: true
5166+
description: Wait until the operation has completed before returning.
50805167
indices.update_aliases::query.cluster_manager_timeout:
50815168
name: cluster_manager_timeout
50825169
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)