Skip to content

Commit

Permalink
Added missing SnapshotShardsStatus fields.
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <[email protected]>
  • Loading branch information
dblock committed Dec 12, 2024
1 parent e955278 commit a9a9eae
Show file tree
Hide file tree
Showing 6 changed files with 124 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Added response schema for `PUT` and `DELETE /_plugins/_transform/{id}` ([#722](https://github.com/opensearch-project/opensearch-api-specification/pull/716))
- Added response schema for `GET /_plugins/_knn/warmup/{index}` ([#717](https://github.com/opensearch-project/opensearch-api-specification/pull/717))
- Added support for multiple test verbs ([#724](https://github.com/opensearch-project/opensearch-api-specification/pull/724))
- Added missing fields to `SnapshotShardsStatus` and `SnapshotStats` ([#728](https://github.com/opensearch-project/opensearch-api-specification/pull/728))

### Removed
- Removed unsupported `_common.mapping:SourceField`'s `mode` field and associated `_common.mapping:SourceFieldMode` enum ([#652](https://github.com/opensearch-project/opensearch-api-specification/pull/652))
Expand Down
4 changes: 4 additions & 0 deletions spec/schemas/snapshot._common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ components:
$ref: '#/components/schemas/ShardsStatsSummaryItem'
total:
$ref: '#/components/schemas/ShardsStatsSummaryItem'
processed:
$ref: '#/components/schemas/FileCountSnapshotStats'
start_time_in_millis:
$ref: '_common.yaml#/components/schemas/EpochTimeUnitMillis'
time:
Expand Down Expand Up @@ -253,6 +255,8 @@ components:
$ref: '_common.yaml#/components/schemas/DurationValueUnitMillis'
total:
$ref: '#/components/schemas/FileCountSnapshotStats'
processed:
$ref: '#/components/schemas/FileCountSnapshotStats'
required:
- incremental
- start_time_in_millis
Expand Down
27 changes: 27 additions & 0 deletions tests/snapshot/snapshot/cleanup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
$schema: ../../../json_schemas/test_story.schema.yaml

description: Test cleaning up a snapshot repository.
prologues:
- path: /_snapshot/my-fs-repository
method: POST
request:
payload:
type: fs
settings:
location: /tmp/opensearch/repo
epilogues:
- path: /_snapshot/my-fs-repository
method: DELETE
status: [200, 404]
chapters:
- synopsis: Verify snapshot repository.
path: /_snapshot/{repository}/_cleanup
method: POST
parameters:
repository: my-fs-repository
response:
status: 200
payload:
results:
deleted_bytes: 0
deleted_blobs: 0
40 changes: 40 additions & 0 deletions tests/snapshot/snapshot/clone.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
$schema: ../../../json_schemas/test_story.schema.yaml

description: Test cloning a snapshot.
prologues:
- path: /_snapshot/my-fs-repository
method: POST
request:
payload:
type: fs
settings:
location: /tmp/opensearch/repo
- path: /_snapshot/my-fs-repository/my-test-snapshot
method: PUT
parameters:
wait_for_completion: true
request:
payload:
indices: '*'
partial: true
epilogues:
- path: /_snapshot/my-fs-repository/my-test-snapshot
method: DELETE
status: [200, 404]
- path: /_snapshot/my-fs-repository/my-cloned-snapshot
method: DELETE
status: [200, 404]
- path: /_snapshot/my-fs-repository
method: DELETE
status: [200, 404]
chapters:
- synopsis: Clone a snapshot.
path: /_snapshot/{repository}/{snapshot}/_clone/{target_snapshot}
method: PUT
parameters:
repository: my-fs-repository
snapshot: my-test-snapshot
target_snapshot: my-cloned-snapshot
request:
payload:
indices: '*'
31 changes: 27 additions & 4 deletions tests/snapshot/snapshot/snapshot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,29 @@ epilogues:
status: [200, 404]
parameters:
repository: my-fs-repository
prologues:
- path: /_snapshot/{repository}
method: PUT
chapters:
- synopsis: Create and update a snapshot repository.
path: /_snapshot/{repository}
method:
- POST
- PUT
parameters:
repository: my-fs-repository
request:
payload:
type: fs
settings:
location: /tmp/opensearch/repo
chapters:
- synopsis: Get all snapshot repositories.
path: /_snapshot
method: GET
response:
status: 200
payload:
my-fs-repository:
type: fs
settings:
location: /tmp/opensearch/repo
- synopsis: Get information about a repository.
path: /_snapshot/{repository}
method: GET
Expand Down Expand Up @@ -77,3 +89,14 @@ chapters:
payload:
snapshots:
- snapshot: my-test-snapshot
- synopsis: Delete a snapshot.
path: /_snapshot/{repository}/{snapshot}
method: DELETE
parameters:
repository: my-fs-repository
snapshot: my-test-snapshot
- synopsis: Delete a snapshot repository.
path: /_snapshot/{repository}
method: DELETE
parameters:
repository: my-fs-repository
25 changes: 25 additions & 0 deletions tests/snapshot/snapshot/verify.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
$schema: ../../../json_schemas/test_story.schema.yaml

description: Test verifying a snapshot repository.
prologues:
- path: /_snapshot/my-fs-repository
method: POST
request:
payload:
type: fs
settings:
location: /tmp/opensearch/repo
epilogues:
- path: /_snapshot/my-fs-repository
method: DELETE
status: [200, 404]
chapters:
- synopsis: Verify snapshot repository.
path: /_snapshot/{repository}/_verify
method: POST
parameters:
repository: my-fs-repository
response:
status: 200
payload:
nodes: {}

0 comments on commit a9a9eae

Please sign in to comment.