Skip to content

Commit

Permalink
divide one file to few smaller
Browse files Browse the repository at this point in the history
Signed-off-by: Tokesh <[email protected]>
  • Loading branch information
Tokesh committed Nov 17, 2024
1 parent a2bc5f7 commit 9ced3ef
Show file tree
Hide file tree
Showing 3 changed files with 180 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,7 @@ prologues:
remote:
leader-cluster:
seeds: ['172.22.0.3:9300']
epilogues:
- path: /_plugins/_replication/{index}/_stop
method: POST
parameters:
index: books-names
request:
payload: {}
- path: /books-names
method: DELETE
status: [200, 404]
- path: /books
method: DELETE
status: [200, 404]
chapters:
- synopsis: Start replication.
path: /_plugins/_replication/{index}/_start
- path: /_plugins/_replication/{index}/_start
version: '>= 1.1'
method: PUT
parameters:
Expand All @@ -59,45 +44,20 @@ chapters:
follower_cluster_role: all_access
response:
status: 200
- synopsis: Get replication stats.
path: /_plugins/_replication/{index}/_status
version: '>= 1.1'
method: GET
parameters:
index: books-names
response:
status: 200
- synopsis: Get leader stats.
path: /_plugins/_replication/leader_stats
version: '>= 1.1'
method: GET
response:
status: 200
- synopsis: Get follower stats.
path: /_plugins/_replication/follower_stats
version: '>= 1.1'
method: GET
response:
status: 200
- synopsis: Get auto-follow stats.
path: /_plugins/_replication/autofollow_stats
version: '>= 1.1'
method: GET
response:
status: 200
- synopsis: Update settings.
path: /_plugins/_replication/{index}/_update
version: '>= 1.1'
method: PUT
parameters:
epilogues:
- path: /_plugins/_replication/{index}/_stop
method: POST
parameters:
index: books-names
request:
payload:
settings:
index.number_of_shards: 4
index.number_of_replicas: 2
response:
status: 200
payload: {}
- path: /books-names
method: DELETE
status: [200, 404]
- path: /books
method: DELETE
status: [200, 404]
chapters:
- synopsis: Create replication rule.
path: /_plugins/_replication/_autofollow
version: '>= 1.1'
Expand All @@ -112,6 +72,12 @@ chapters:
follower_cluster_role: admin
response:
status: 200
- synopsis: Get auto-follow stats.
path: /_plugins/_replication/autofollow_stats
version: '>= 1.1'
method: GET
response:
status: 200
- synopsis: Delete replication rule.
path: /_plugins/_replication/_autofollow
version: '>= 1.1'
Expand All @@ -121,4 +87,4 @@ chapters:
leader_alias: leader-cluster
name: books
response:
status: 200
status: 200
74 changes: 74 additions & 0 deletions tests/plugins/replication/index.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
$schema: ../../../json_schemas/test_story.schema.yaml

description: Test replication APIs specs.
prologues:
- path: /{index}
method: PUT
parameters:
index: books
request:
payload: {}
- path: /_bulk
method: POST
request:
content_type: application/x-ndjson
payload:
- {create: {_index: books, _id: book_1392214}}
- {author: Harper Lee, title: To Kill a Mockingbird, year: 1960}
- {create: {_index: books, _id: book_1392215}}
- {author: Elizabeth Rudnick, title: Beauty and the Beast, year: 1991}
- path: /{index}/_refresh
method: POST
parameters:
index: books
- path: /_cluster/settings
method: PUT
request:
payload:
persistent:
cluster:
remote:
leader-cluster:
seeds: ['172.22.0.3:9300']
epilogues:
- path: /_plugins/_replication/{index}/_stop
method: POST
parameters:
index: books-names
request:
payload: {}
- path: /books-names
method: DELETE
status: [200, 404]
- path: /books
method: DELETE
status: [200, 404]
chapters:
- synopsis: Start replication.
path: /_plugins/_replication/{index}/_start
version: '>= 1.1'
method: PUT
parameters:
index: books-names
request:
payload:
leader_alias: leader-cluster
leader_index: books
use_roles:
leader_cluster_role: all_access
follower_cluster_role: all_access
response:
status: 200
- synopsis: Update settings.
path: /_plugins/_replication/{index}/_update
version: '>= 1.1'
method: PUT
parameters:
index: books-names
request:
payload:
settings:
index.number_of_shards: 4
index.number_of_replicas: 2
response:
status: 200
86 changes: 86 additions & 0 deletions tests/plugins/replication/stats.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
$schema: ../../../json_schemas/test_story.schema.yaml

description: Test replication APIs specs.
prologues:
- path: /{index}
method: PUT
parameters:
index: books
request:
payload: {}
- path: /_bulk
method: POST
request:
content_type: application/x-ndjson
payload:
- {create: {_index: books, _id: book_1392214}}
- {author: Harper Lee, title: To Kill a Mockingbird, year: 1960}
- {create: {_index: books, _id: book_1392215}}
- {author: Elizabeth Rudnick, title: Beauty and the Beast, year: 1991}
- path: /{index}/_refresh
method: POST
parameters:
index: books
- path: /_cluster/settings
method: PUT
request:
payload:
persistent:
cluster:
remote:
leader-cluster:
seeds: ['172.22.0.3:9300']
- path: /_plugins/_replication/{index}/_start
version: '>= 1.1'
method: PUT
parameters:
index: books-names
request:
payload:
leader_alias: leader-cluster
leader_index: books
use_roles:
leader_cluster_role: all_access
follower_cluster_role: all_access
response:
status: 200
epilogues:
- path: /_plugins/_replication/{index}/_stop
method: POST
parameters:
index: books-names
request:
payload: {}
- path: /books-names
method: DELETE
status: [200, 404]
- path: /books
method: DELETE
status: [200, 404]
chapters:
- synopsis: Get replication stats.
path: /_plugins/_replication/{index}/_status
version: '>= 1.1'
method: GET
parameters:
index: books-names
response:
status: 200
- synopsis: Get leader stats.
path: /_plugins/_replication/leader_stats
version: '>= 1.1'
method: GET
response:
status: 200
- synopsis: Get follower stats.
path: /_plugins/_replication/follower_stats
version: '>= 1.1'
method: GET
response:
status: 200
- synopsis: Get auto-follow stats.
path: /_plugins/_replication/autofollow_stats
version: '>= 1.1'
method: GET
response:
status: 200

0 comments on commit 9ced3ef

Please sign in to comment.