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 11, 2024
1 parent 01f222e commit 4285a6a
Show file tree
Hide file tree
Showing 6 changed files with 171 additions and 4 deletions.
6 changes: 6 additions & 0 deletions spec/schemas/snapshot._common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ components:
SnapshotShardsStatus:
type: object
properties:
node:
$ref: '_common.yaml#/components/schemas/NodeId'
stage:
$ref: '#/components/schemas/ShardsStatsStage'
stats:
Expand All @@ -180,6 +182,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 @@ -236,6 +240,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
46 changes: 46 additions & 0 deletions tests/snapshot/snapshot/status.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
$schema: ../../../json_schemas/test_story.schema.yaml

description: Test snapshot status.
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: false
request:
payload:
indices: '*'
partial: true
epilogues:
- path: /_snapshot/my-fs-repository/my-test-snapshot
method: DELETE
status: [200, 404]
- path: /_snapshot/my-fs-repository
method: DELETE
status: [200, 404]
chapters:
- synopsis: Get all running snapshots.
path: /_snapshot/_status
method: GET
- synopsis: Get all running snapshots.
path: /_snapshot/{repository}/_status
method: GET
parameters:
repository: my-fs-repository
- synopsis: Get all snapshot status.
path: /_snapshot/{repository}/{snapshot}/_status
method: GET
parameters:
repository: my-fs-repository
snapshot: my-test-snapshot
response:
status: 200
payload:
snapshots:
- snapshot: my-test-snapshot
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 4285a6a

Please sign in to comment.