Skip to content

Commit

Permalink
Merge pull request #43 from MITLibraries/timx-80-add-demote-command
Browse files Browse the repository at this point in the history
Add demote command
  • Loading branch information
hakbailey committed Sep 19, 2022
2 parents 41fe7ed + 28b1006 commit 51c570a
Show file tree
Hide file tree
Showing 16 changed files with 643 additions and 43 deletions.
67 changes: 37 additions & 30 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
interactions:
- request:
body: null
headers:
content-type:
- application/json
user-agent:
- opensearch-py/2.0.0 (Python 3.10.6)
method: GET
uri: http://localhost:9200/test-index/_alias
response:
body:
string: '{"test-index":{"aliases":{"all-current":{}}}}'
headers:
content-length:
- '45'
content-type:
- application/json; charset=UTF-8
status:
code: 200
message: OK
- request:
body: null
headers:
Content-Length:
- '0'
content-type:
- application/json
user-agent:
- opensearch-py/2.0.0 (Python 3.10.6)
method: DELETE
uri: http://localhost:9200/test-index/_alias/all-current
response:
body:
string: '{"acknowledged":true}'
headers:
content-length:
- '21'
content-type:
- application/json; charset=UTF-8
status:
code: 200
message: OK
- request:
body: null
headers:
content-type:
- application/json
user-agent:
- opensearch-py/2.0.0 (Python 3.10.6)
method: GET
uri: http://localhost:9200/_cat/aliases?format=json
response:
body:
string: '[]'
headers:
content-length:
- '2'
content-type:
- application/json; charset=UTF-8
status:
code: 200
message: OK
version: 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
interactions:
- request:
body: null
headers:
content-type:
- application/json
user-agent:
- opensearch-py/2.0.0 (Python 3.10.6)
method: GET
uri: http://localhost:9200/test-index/_alias
response:
body:
string: '{"test-index":{"aliases":{"all-current":{}}}}'
headers:
content-length:
- '45'
content-type:
- application/json; charset=UTF-8
status:
code: 200
message: OK
version: 1
22 changes: 22 additions & 0 deletions tests/fixtures/cassettes/demote_no_aliases_for_index.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
interactions:
- request:
body: null
headers:
content-type:
- application/json
user-agent:
- opensearch-py/2.0.0 (Python 3.10.6)
method: GET
uri: http://localhost:9200/test-index/_alias
response:
body:
string: '{"test-index":{"aliases":{}}}'
headers:
content-length:
- '29'
content-type:
- application/json; charset=UTF-8
status:
code: 200
message: OK
version: 1
64 changes: 64 additions & 0 deletions tests/fixtures/cassettes/demote_no_primary_alias.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
interactions:
- request:
body: null
headers:
content-type:
- application/json
user-agent:
- opensearch-py/2.0.0 (Python 3.10.6)
method: GET
uri: http://localhost:9200/test-index/_alias
response:
body:
string: '{"test-index":{"aliases":{"not-primary":{}}}}'
headers:
content-length:
- '45'
content-type:
- application/json; charset=UTF-8
status:
code: 200
message: OK
- request:
body: null
headers:
Content-Length:
- '0'
content-type:
- application/json
user-agent:
- opensearch-py/2.0.0 (Python 3.10.6)
method: DELETE
uri: http://localhost:9200/test-index/_alias/not-primary
response:
body:
string: '{"acknowledged":true}'
headers:
content-length:
- '21'
content-type:
- application/json; charset=UTF-8
status:
code: 200
message: OK
- request:
body: null
headers:
content-type:
- application/json
user-agent:
- opensearch-py/2.0.0 (Python 3.10.6)
method: GET
uri: http://localhost:9200/_cat/aliases?format=json
response:
body:
string: '[]'
headers:
content-length:
- '2'
content-type:
- application/json; charset=UTF-8
status:
code: 200
message: OK
version: 1
Loading

0 comments on commit 51c570a

Please sign in to comment.