Skip to content

Commit

Permalink
Add spec for new rename_alias_pattern and rename_alias_replacement pa…
Browse files Browse the repository at this point in the history
…rameters to snapshot restore

Signed-off-by: Spencer G. Jones <[email protected]>
  • Loading branch information
mispencer committed Oct 16, 2024
1 parent 99bc701 commit 1472de6
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 1 deletion.
4 changes: 4 additions & 0 deletions spec/namespaces/snapshot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,10 @@ components:
type: string
rename_replacement:
type: string
rename_alias_pattern:
type: string
rename_alias_replacement:
type: string
description: Details of what to restore
responses:
snapshot.cleanup_repository@200:
Expand Down
57 changes: 56 additions & 1 deletion tests/snapshot/snapshot/restore.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ epilogues:
- path: /books
method: DELETE
status: [200, 404]
- path: /stories
method: DELETE
status: [200, 404]
- path: /new_stories
method: DELETE
status: [200, 404]
prologues:
- path: /_snapshot/{repository}
method: PUT
Expand All @@ -33,6 +39,16 @@ prologues:
method: PUT
- path: /books
method: PUT
- path: /stories
method: PUT
- path: /_aliases
method: POST
request:
payload:
actions:
- add:

Check failure on line 49 in tests/snapshot/snapshot/restore.yaml

View workflow job for this annotation

GitHub Actions / lint

Expected indentation of 10 spaces but found 8 spaces
index: "stories"

Check failure on line 50 in tests/snapshot/snapshot/restore.yaml

View workflow job for this annotation

GitHub Actions / lint

Expected indentation of 14 spaces but found 12 spaces

Check failure on line 50 in tests/snapshot/snapshot/restore.yaml

View workflow job for this annotation

GitHub Actions / lint

Must use plain style scalar

Check failure on line 50 in tests/snapshot/snapshot/restore.yaml

View workflow job for this annotation

GitHub Actions / lint

Strings must use singlequote
alias: "stories_alias"

Check failure on line 51 in tests/snapshot/snapshot/restore.yaml

View workflow job for this annotation

GitHub Actions / lint

Expected indentation of 14 spaces but found 12 spaces

Check failure on line 51 in tests/snapshot/snapshot/restore.yaml

View workflow job for this annotation

GitHub Actions / lint

Must use plain style scalar

Check failure on line 51 in tests/snapshot/snapshot/restore.yaml

View workflow job for this annotation

GitHub Actions / lint

Strings must use singlequote
- path: /_snapshot/{repository}/{snapshot}
method: PUT
parameters:
Expand All @@ -44,6 +60,7 @@ prologues:
indices:
- books
- movies
- stories
ignore_unavailable: true
include_global_state: false
partial: true
Expand All @@ -53,6 +70,9 @@ prologues:
- path: /books
method: DELETE
status: [200, 404]
- path: /stories
method: DELETE
status: [200, 404]
chapters:
- synopsis: Restore snapshot with wait_for_completion true.
path: /_snapshot/{repository}/{snapshot}/_restore
Expand Down Expand Up @@ -98,4 +118,39 @@ chapters:
- stage: DONE
type: SNAPSHOT
retry:
count: 3
count: 3
- synopsis: Restore snapshot with rename_pattern and rename_replacement.
path: /_snapshot/{repository}/{snapshot}/_restore
method: POST
parameters:
repository: my-fs-repository
snapshot: my-test-snapshot
wait_for_completion: true
request:
payload:
indices: stories
rename_pattern: stories
rename_replacement: new_stories
response:
status: 200
payload:
snapshot:
snapshot: my-test-snapshot
- synopsis: Restore snapshot with rename_alias_pattern and rename_alias_replacement.
path: /_snapshot/{repository}/{snapshot}/_restore
method: POST
parameters:
repository: my-fs-repository
snapshot: my-test-snapshot
wait_for_completion: true
request:
payload:
indices: stories
include_aliases: true
rename_alias_pattern: stories
rename_alias_replacement: new_stories
response:
status: 200
payload:
snapshot:
snapshot: my-test-snapshot

0 comments on commit 1472de6

Please sign in to comment.