-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathclone.yml
80 lines (80 loc) · 1.74 KB
/
clone.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
---
requires:
stack: true
serverless: false
---
setup:
- do:
indices.create:
index: clone_source
wait_for_active_shards: 1
body:
settings:
index.number_of_shards: 2
index.number_of_replicas: 0
- do:
index:
index: clone_source
id: "1"
body: { "foo": "hello world" }
- do:
index:
index: clone_source
id: "2"
body: { "foo": "hello world 2" }
- do:
index:
index: clone_source
id: "3"
body: { "foo": "hello world 3" }
---
teardown:
- do:
indices.delete:
index: clone_source
- do:
indices.delete:
index: clone_target
---
"Clone index via API":
# make it read-only
- do:
indices.put_settings:
index: clone_source
body:
index.blocks.write: true
index.number_of_replicas: 0
- do:
cluster.health:
wait_for_status: green
index: clone_source
# now we do the actual clone
- do:
indices.clone:
index: "clone_source"
target: "clone_target"
master_timeout: 10s
body:
settings:
index.number_of_shards: 2
- do:
get:
index: clone_target
id: "1"
- match: { _index: clone_target }
- match: { _id: "1" }
- match: { _source: { foo: "hello world" } }
- do:
get:
index: clone_target
id: "2"
- match: { _index: target }
- match: { _id: "2" }
- match: { _source: { foo: "hello world 2" } }
- do:
get:
index: clone_target
id: "3"
- match: { _index: clone_target }
- match: { _id: "3" }
- match: { _source: { foo: "hello world 3" } }