-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathelastic.atd
More file actions
280 lines (229 loc) · 5.34 KB
/
elastic.atd
File metadata and controls
280 lines (229 loc) · 5.34 KB
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
type json <ocaml module="Yojson.Safe" t="t"> = abstract
type main = {
version : main_version;
}
type main_version = {
number : string;
}
type doc_id = {
?index <json name="_index"> : string option;
?doc_type <json name="_type"> : string option;
id <json name="_id"> : string;
}
type multiget_doc = {
inherit doc_id;
?routing <json name="_routing"> : string option;
?source <json name="_source"> : json option;
?stored_fields : string list option;
}
type multiget = {
~docs: multiget_doc list;
~ids: string list;
}
type id_hit = {
index <json name="_index"> : string;
?doc_type <json name="_type"> : string option;
id <json name="_id"> : string;
}
type unit_hit = {
inherit id_hit;
?routing <json name="_routing"> : string nullable;
?found: bool option;
?score <json name="_score"> : float option;
?version <json name="_version"> : int option;
?fields : (string * json list) list <json repr="object"> option;
?shard <json name="_shard"> : string option;
?node <json name="_node"> : string option;
?sort : json list option;
}
type 'source option_hit = {
inherit unit_hit;
?source <json name="_source"> : 'source option;
}
type 'source hit = {
inherit unit_hit;
source <json name="_source"> : 'source;
}
type 'hit docs = {
docs : 'hit list;
}
type ('hits, 'total) hits' = {
?total : 'total option;
~max_score : float;
hits : 'hits;
}
type ('hit, 'total) hits = ('hit list, 'total) hits'
type total = {
value : int;
relation : total_relation;
}
type total_relation = [
| Eq <json name="eq">
| Gte <json name="gte">
]
type es6_total = int wrap <ocaml
t="total"
wrap="fun value -> { value; relation = `Eq; }"
unwrap="fun { value; _ } -> value"
>
type response'' = {
?error : error option;
}
type ('hit, 'total) response' = {
inherit response'';
took: int;
timed_out: bool;
shards <json name="_shards"> : shards;
?scroll_id <json name="_scroll_id"> : string option;
?hits: ('hit, 'total) hits option;
}
type ('hit, 'total) opt_response = ('hit option_hit, 'total) response'
type ('hit, 'total) response = ('hit hit, 'total) response'
type shards = {
total : int;
successful : int;
skipped : int;
failed : int;
}
type error = {
error <json name="type"> : string;
?reason : string nullable;
}
type scroll = {
scroll : string;
scroll_id : string;
}
type clear_scroll = {
scroll_id : string list;
}
type aliases = {
actions : alias_action list;
}
type alias_action_name = [
| Add <json name="add">
| Remove <json name="remove">
]
type alias_action_name' = string wrap <ocaml
t="[ `Add | `Remove ]"
wrap="function \"add\" -> `Add | \"remove\" -> `Remove | x -> Devkit.Exn.fail \"unknown action %s\" x"
unwrap="function `Add -> \"add\" | `Remove -> \"remove\""
>
type alias_action = (alias_action_name' * index_alias) list <json repr="object">
type index_alias = {
index : string;
alias : string;
}
type count = {
count : int;
shards <json name="_shards"> : shards;
}
type settings = (string * json) list <json repr="object">
type cluster_flat_settings = {
?transient : settings option;
?persistent : settings option;
?defaults : settings option;
}
type cluster_tree_settings = {
?transient : json option;
?persistent : json option;
?defaults : json option;
}
type indices_shards = (string * index_shards) list <json repr="object">
type index_shards = {
shards : index_shard list;
}
type index_shard = {
id : int;
kind <json name="type"> : string;
stage : string;
primary : bool;
source : shard_host;
target : shard_host;
index : shard_index;
translog : shard_translog;
verify_index : shard_verify_index;
}
type shard_host = {
?id : string option;
?host : string option;
?transport_address : string option;
?ip : string option;
?name : string option;
}
type shard_index = {
size : shard_index_size;
files : shard_index_files;
total_time_in_millis : int;
source_throttle_time_in_millis : int;
target_throttle_time_in_millis : int;
}
type shard_index_size = {
total_in_bytes : int;
reused_in_bytes : int;
recovered_in_bytes : int;
percent : string;
}
type shard_index_files = {
total : int;
reused : int;
recovered : int;
percent : string;
}
type shard_translog = {
recovered : int;
total : int;
percent : string;
total_on_start : int;
total_time_in_millis : int;
}
type shard_verify_index = {
check_index_time_in_millis : int;
total_time_in_millis : int;
}
type bulk = {
?index : bulk_action option;
?create : bulk_action option;
?update : bulk_action option;
?delete : bulk_action option;
}
type bulk_action = {
inherit doc_id;
?routing : string option;
}
type reroute_command = {
?allocate_replica : allocate_replica option;
?allocate_empty_primary : allocate_empty_primary option;
?move : move_shard option;
?cancel : cancel_shard option;
}
type allocate_replica = {
index : string;
shard : int;
node : string;
}
type allocate_empty_primary = {
index : string;
shard : int;
node : string;
accept_data_loss : bool;
}
type move_shard = {
index : string;
shard : int;
from_node : string;
to_node : string;
}
type cancel_shard = {
index : string;
shard : int;
node : string;
}
type reroute_request = {
commands : reroute_command list;
?dry_run : bool option;
?explain : bool option;
?retry_failed : bool option;
}
type reroute_response = {
acknowledged : bool;
}