elastomer-client 3.0.1 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/CHANGELOG.md +4 -0
  4. data/lib/elastomer/client/bulk.rb +1 -1
  5. data/lib/elastomer/client/cluster.rb +10 -22
  6. data/lib/elastomer/client/docs.rb +46 -55
  7. data/lib/elastomer/client/index.rb +33 -33
  8. data/lib/elastomer/client/multi_percolate.rb +9 -9
  9. data/lib/elastomer/client/multi_search.rb +5 -5
  10. data/lib/elastomer/client/native_delete_by_query.rb +2 -22
  11. data/lib/elastomer/client/nodes.rb +8 -22
  12. data/lib/elastomer/client/percolator.rb +5 -5
  13. data/lib/elastomer/client/repository.rb +7 -7
  14. data/lib/elastomer/client/rest_api_spec/api_spec.rb +119 -0
  15. data/lib/elastomer/client/rest_api_spec/api_spec_v2_3.rb +2232 -0
  16. data/lib/elastomer/client/rest_api_spec/api_spec_v2_4.rb +2250 -0
  17. data/lib/elastomer/client/rest_api_spec/api_spec_v5_6.rb +2491 -0
  18. data/lib/elastomer/client/rest_api_spec/rest_api.rb +59 -0
  19. data/lib/elastomer/client/rest_api_spec.rb +44 -0
  20. data/lib/elastomer/client/scroller.rb +10 -10
  21. data/lib/elastomer/client/snapshot.rb +7 -7
  22. data/lib/elastomer/client/tasks.rb +45 -51
  23. data/lib/elastomer/client/template.rb +8 -8
  24. data/lib/elastomer/client/warmer.rb +11 -4
  25. data/lib/elastomer/client.rb +31 -7
  26. data/lib/elastomer/version.rb +1 -1
  27. data/lib/elastomer/version_support.rb +35 -46
  28. data/script/generate-rest-api-spec +152 -0
  29. data/test/client/rest_api_spec/api_spec_test.rb +55 -0
  30. data/test/client/rest_api_spec/rest_api_test.rb +96 -0
  31. data/test/client/stubbed_client_test.rb +1 -19
  32. data/test/middleware/opaque_id_test.rb +1 -3
  33. data/test/notifications_test.rb +0 -5
  34. data/test/test_helper.rb +5 -4
  35. data/test/version_support_test.rb +3 -21
  36. metadata +13 -2
@@ -0,0 +1,2491 @@
1
+ # Generated REST API spec file - DO NOT EDIT!
2
+ # Date: 2018-01-10
3
+ # ES version: 5.6
4
+
5
+ module Elastomer::Client::RestApiSpec
6
+ class ApiSpecV5_6 < ApiSpec
7
+ def initialize
8
+ @rest_apis = {
9
+ "bulk" => RestApi.new(
10
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/docs-bulk.html",
11
+ methods: ["POST", "PUT"],
12
+ body: {"description"=>"The operation definition and data (action-data pairs), separated by newlines", "required"=>true, "serialize"=>"bulk"},
13
+ url: {
14
+ path: "/_bulk",
15
+ paths: ["/_bulk", "/{index}/_bulk", "/{index}/{type}/_bulk"],
16
+ parts: {
17
+ "index" => {"type"=>"string", "description"=>"Default index for items which don't provide one"},
18
+ "type" => {"type"=>"string", "description"=>"Default document type for items which don't provide one"},
19
+ },
20
+ params: {
21
+ "wait_for_active_shards" => {"type"=>"string", "description"=>"Sets the number of shard copies that must be active before proceeding with the bulk operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)"},
22
+ "refresh" => {"type"=>"enum", "options"=>["true", "false", "wait_for"], "description"=>"If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes."},
23
+ "routing" => {"type"=>"string", "description"=>"Specific routing value"},
24
+ "timeout" => {"type"=>"time", "description"=>"Explicit operation timeout"},
25
+ "type" => {"type"=>"string", "description"=>"Default document type for items which don't provide one"},
26
+ "fields" => {"type"=>"list", "description"=>"Default comma-separated list of fields to return in the response for updates, can be overridden on each sub-request"},
27
+ "_source" => {"type"=>"list", "description"=>"True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request"},
28
+ "_source_exclude" => {"type"=>"list", "description"=>"Default list of fields to exclude from the returned _source field, can be overridden on each sub-request"},
29
+ "_source_include" => {"type"=>"list", "description"=>"Default list of fields to extract and return from the _source field, can be overridden on each sub-request"},
30
+ "pipeline" => {"type"=>"string", "description"=>"The pipeline id to preprocess incoming documents with"},
31
+ }
32
+ }
33
+ ),
34
+ "cat.aliases" => RestApi.new(
35
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat-alias.html",
36
+ methods: ["GET"],
37
+ body: nil,
38
+ url: {
39
+ path: "/_cat/aliases",
40
+ paths: ["/_cat/aliases", "/_cat/aliases/{name}"],
41
+ parts: {
42
+ "name" => {"type"=>"list", "description"=>"A comma-separated list of alias names to return"},
43
+ },
44
+ params: {
45
+ "format" => {"type"=>"string", "description"=>"a short version of the Accept header, e.g. json, yaml"},
46
+ "local" => {"type"=>"boolean", "description"=>"Return local information, do not retrieve the state from master node (default: false)"},
47
+ "master_timeout" => {"type"=>"time", "description"=>"Explicit operation timeout for connection to master node"},
48
+ "h" => {"type"=>"list", "description"=>"Comma-separated list of column names to display"},
49
+ "help" => {"type"=>"boolean", "description"=>"Return help information", "default"=>false},
50
+ "s" => {"type"=>"list", "description"=>"Comma-separated list of column names or column aliases to sort by"},
51
+ "v" => {"type"=>"boolean", "description"=>"Verbose mode. Display column headers", "default"=>false},
52
+ }
53
+ }
54
+ ),
55
+ "cat.allocation" => RestApi.new(
56
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat-allocation.html",
57
+ methods: ["GET"],
58
+ body: nil,
59
+ url: {
60
+ path: "/_cat/allocation",
61
+ paths: ["/_cat/allocation", "/_cat/allocation/{node_id}"],
62
+ parts: {
63
+ "node_id" => {"type"=>"list", "description"=>"A comma-separated list of node IDs or names to limit the returned information"},
64
+ },
65
+ params: {
66
+ "format" => {"type"=>"string", "description"=>"a short version of the Accept header, e.g. json, yaml"},
67
+ "bytes" => {"type"=>"enum", "description"=>"The unit in which to display byte values", "options"=>["b", "k", "kb", "m", "mb", "g", "gb", "t", "tb", "p", "pb"]},
68
+ "local" => {"type"=>"boolean", "description"=>"Return local information, do not retrieve the state from master node (default: false)"},
69
+ "master_timeout" => {"type"=>"time", "description"=>"Explicit operation timeout for connection to master node"},
70
+ "h" => {"type"=>"list", "description"=>"Comma-separated list of column names to display"},
71
+ "help" => {"type"=>"boolean", "description"=>"Return help information", "default"=>false},
72
+ "s" => {"type"=>"list", "description"=>"Comma-separated list of column names or column aliases to sort by"},
73
+ "v" => {"type"=>"boolean", "description"=>"Verbose mode. Display column headers", "default"=>false},
74
+ }
75
+ }
76
+ ),
77
+ "cat.count" => RestApi.new(
78
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat-count.html",
79
+ methods: ["GET"],
80
+ body: nil,
81
+ url: {
82
+ path: "/_cat/count",
83
+ paths: ["/_cat/count", "/_cat/count/{index}"],
84
+ parts: {
85
+ "index" => {"type"=>"list", "description"=>"A comma-separated list of index names to limit the returned information"},
86
+ },
87
+ params: {
88
+ "format" => {"type"=>"string", "description"=>"a short version of the Accept header, e.g. json, yaml"},
89
+ "local" => {"type"=>"boolean", "description"=>"Return local information, do not retrieve the state from master node (default: false)"},
90
+ "master_timeout" => {"type"=>"time", "description"=>"Explicit operation timeout for connection to master node"},
91
+ "h" => {"type"=>"list", "description"=>"Comma-separated list of column names to display"},
92
+ "help" => {"type"=>"boolean", "description"=>"Return help information", "default"=>false},
93
+ "s" => {"type"=>"list", "description"=>"Comma-separated list of column names or column aliases to sort by"},
94
+ "v" => {"type"=>"boolean", "description"=>"Verbose mode. Display column headers", "default"=>false},
95
+ }
96
+ }
97
+ ),
98
+ "cat.fielddata" => RestApi.new(
99
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat-fielddata.html",
100
+ methods: ["GET"],
101
+ body: nil,
102
+ url: {
103
+ path: "/_cat/fielddata",
104
+ paths: ["/_cat/fielddata", "/_cat/fielddata/{fields}"],
105
+ parts: {
106
+ "fields" => {"type"=>"list", "description"=>"A comma-separated list of fields to return the fielddata size"},
107
+ },
108
+ params: {
109
+ "format" => {"type"=>"string", "description"=>"a short version of the Accept header, e.g. json, yaml"},
110
+ "bytes" => {"type"=>"enum", "description"=>"The unit in which to display byte values", "options"=>["b", "k", "kb", "m", "mb", "g", "gb", "t", "tb", "p", "pb"]},
111
+ "local" => {"type"=>"boolean", "description"=>"Return local information, do not retrieve the state from master node (default: false)"},
112
+ "master_timeout" => {"type"=>"time", "description"=>"Explicit operation timeout for connection to master node"},
113
+ "h" => {"type"=>"list", "description"=>"Comma-separated list of column names to display"},
114
+ "help" => {"type"=>"boolean", "description"=>"Return help information", "default"=>false},
115
+ "s" => {"type"=>"list", "description"=>"Comma-separated list of column names or column aliases to sort by"},
116
+ "v" => {"type"=>"boolean", "description"=>"Verbose mode. Display column headers", "default"=>false},
117
+ "fields" => {"type"=>"list", "description"=>"A comma-separated list of fields to return in the output"},
118
+ }
119
+ }
120
+ ),
121
+ "cat.health" => RestApi.new(
122
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat-health.html",
123
+ methods: ["GET"],
124
+ body: nil,
125
+ url: {
126
+ path: "/_cat/health",
127
+ paths: ["/_cat/health"],
128
+ params: {
129
+ "format" => {"type"=>"string", "description"=>"a short version of the Accept header, e.g. json, yaml"},
130
+ "local" => {"type"=>"boolean", "description"=>"Return local information, do not retrieve the state from master node (default: false)"},
131
+ "master_timeout" => {"type"=>"time", "description"=>"Explicit operation timeout for connection to master node"},
132
+ "h" => {"type"=>"list", "description"=>"Comma-separated list of column names to display"},
133
+ "help" => {"type"=>"boolean", "description"=>"Return help information", "default"=>false},
134
+ "s" => {"type"=>"list", "description"=>"Comma-separated list of column names or column aliases to sort by"},
135
+ "ts" => {"type"=>"boolean", "description"=>"Set to false to disable timestamping", "default"=>true},
136
+ "v" => {"type"=>"boolean", "description"=>"Verbose mode. Display column headers", "default"=>false},
137
+ }
138
+ }
139
+ ),
140
+ "cat.help" => RestApi.new(
141
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat.html",
142
+ methods: ["GET"],
143
+ body: nil,
144
+ url: {
145
+ path: "/_cat",
146
+ paths: ["/_cat"],
147
+ params: {
148
+ "help" => {"type"=>"boolean", "description"=>"Return help information", "default"=>false},
149
+ "s" => {"type"=>"list", "description"=>"Comma-separated list of column names or column aliases to sort by"},
150
+ }
151
+ }
152
+ ),
153
+ "cat.indices" => RestApi.new(
154
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat-indices.html",
155
+ methods: ["GET"],
156
+ body: nil,
157
+ url: {
158
+ path: "/_cat/indices",
159
+ paths: ["/_cat/indices", "/_cat/indices/{index}"],
160
+ parts: {
161
+ "index" => {"type"=>"list", "description"=>"A comma-separated list of index names to limit the returned information"},
162
+ },
163
+ params: {
164
+ "format" => {"type"=>"string", "description"=>"a short version of the Accept header, e.g. json, yaml"},
165
+ "bytes" => {"type"=>"enum", "description"=>"The unit in which to display byte values", "options"=>["b", "k", "m", "g"]},
166
+ "local" => {"type"=>"boolean", "description"=>"Return local information, do not retrieve the state from master node (default: false)"},
167
+ "master_timeout" => {"type"=>"time", "description"=>"Explicit operation timeout for connection to master node"},
168
+ "h" => {"type"=>"list", "description"=>"Comma-separated list of column names to display"},
169
+ "health" => {"type"=>"enum", "options"=>["green", "yellow", "red"], "default"=>nil, "description"=>"A health status (\"green\", \"yellow\", or \"red\" to filter only indices matching the specified health status"},
170
+ "help" => {"type"=>"boolean", "description"=>"Return help information", "default"=>false},
171
+ "pri" => {"type"=>"boolean", "description"=>"Set to true to return stats only for primary shards", "default"=>false},
172
+ "s" => {"type"=>"list", "description"=>"Comma-separated list of column names or column aliases to sort by"},
173
+ "v" => {"type"=>"boolean", "description"=>"Verbose mode. Display column headers", "default"=>false},
174
+ }
175
+ }
176
+ ),
177
+ "cat.master" => RestApi.new(
178
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat-master.html",
179
+ methods: ["GET"],
180
+ body: nil,
181
+ url: {
182
+ path: "/_cat/master",
183
+ paths: ["/_cat/master"],
184
+ params: {
185
+ "format" => {"type"=>"string", "description"=>"a short version of the Accept header, e.g. json, yaml"},
186
+ "local" => {"type"=>"boolean", "description"=>"Return local information, do not retrieve the state from master node (default: false)"},
187
+ "master_timeout" => {"type"=>"time", "description"=>"Explicit operation timeout for connection to master node"},
188
+ "h" => {"type"=>"list", "description"=>"Comma-separated list of column names to display"},
189
+ "help" => {"type"=>"boolean", "description"=>"Return help information", "default"=>false},
190
+ "s" => {"type"=>"list", "description"=>"Comma-separated list of column names or column aliases to sort by"},
191
+ "v" => {"type"=>"boolean", "description"=>"Verbose mode. Display column headers", "default"=>false},
192
+ }
193
+ }
194
+ ),
195
+ "cat.nodeattrs" => RestApi.new(
196
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat-nodeattrs.html",
197
+ methods: ["GET"],
198
+ body: nil,
199
+ url: {
200
+ path: "/_cat/nodeattrs",
201
+ paths: ["/_cat/nodeattrs"],
202
+ params: {
203
+ "format" => {"type"=>"string", "description"=>"a short version of the Accept header, e.g. json, yaml"},
204
+ "local" => {"type"=>"boolean", "description"=>"Return local information, do not retrieve the state from master node (default: false)"},
205
+ "master_timeout" => {"type"=>"time", "description"=>"Explicit operation timeout for connection to master node"},
206
+ "h" => {"type"=>"list", "description"=>"Comma-separated list of column names to display"},
207
+ "help" => {"type"=>"boolean", "description"=>"Return help information", "default"=>false},
208
+ "s" => {"type"=>"list", "description"=>"Comma-separated list of column names or column aliases to sort by"},
209
+ "v" => {"type"=>"boolean", "description"=>"Verbose mode. Display column headers", "default"=>false},
210
+ }
211
+ }
212
+ ),
213
+ "cat.nodes" => RestApi.new(
214
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat-nodes.html",
215
+ methods: ["GET"],
216
+ body: nil,
217
+ url: {
218
+ path: "/_cat/nodes",
219
+ paths: ["/_cat/nodes"],
220
+ params: {
221
+ "format" => {"type"=>"string", "description"=>"a short version of the Accept header, e.g. json, yaml"},
222
+ "full_id" => {"type"=>"boolean", "description"=>"Return the full node ID instead of the shortened version (default: false)"},
223
+ "local" => {"type"=>"boolean", "description"=>"Return local information, do not retrieve the state from master node (default: false)"},
224
+ "master_timeout" => {"type"=>"time", "description"=>"Explicit operation timeout for connection to master node"},
225
+ "h" => {"type"=>"list", "description"=>"Comma-separated list of column names to display"},
226
+ "help" => {"type"=>"boolean", "description"=>"Return help information", "default"=>false},
227
+ "s" => {"type"=>"list", "description"=>"Comma-separated list of column names or column aliases to sort by"},
228
+ "v" => {"type"=>"boolean", "description"=>"Verbose mode. Display column headers", "default"=>false},
229
+ }
230
+ }
231
+ ),
232
+ "cat.pending_tasks" => RestApi.new(
233
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat-pending-tasks.html",
234
+ methods: ["GET"],
235
+ body: nil,
236
+ url: {
237
+ path: "/_cat/pending_tasks",
238
+ paths: ["/_cat/pending_tasks"],
239
+ params: {
240
+ "format" => {"type"=>"string", "description"=>"a short version of the Accept header, e.g. json, yaml"},
241
+ "local" => {"type"=>"boolean", "description"=>"Return local information, do not retrieve the state from master node (default: false)"},
242
+ "master_timeout" => {"type"=>"time", "description"=>"Explicit operation timeout for connection to master node"},
243
+ "h" => {"type"=>"list", "description"=>"Comma-separated list of column names to display"},
244
+ "help" => {"type"=>"boolean", "description"=>"Return help information", "default"=>false},
245
+ "s" => {"type"=>"list", "description"=>"Comma-separated list of column names or column aliases to sort by"},
246
+ "v" => {"type"=>"boolean", "description"=>"Verbose mode. Display column headers", "default"=>false},
247
+ }
248
+ }
249
+ ),
250
+ "cat.plugins" => RestApi.new(
251
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat-plugins.html",
252
+ methods: ["GET"],
253
+ body: nil,
254
+ url: {
255
+ path: "/_cat/plugins",
256
+ paths: ["/_cat/plugins"],
257
+ params: {
258
+ "format" => {"type"=>"string", "description"=>"a short version of the Accept header, e.g. json, yaml"},
259
+ "local" => {"type"=>"boolean", "description"=>"Return local information, do not retrieve the state from master node (default: false)"},
260
+ "master_timeout" => {"type"=>"time", "description"=>"Explicit operation timeout for connection to master node"},
261
+ "h" => {"type"=>"list", "description"=>"Comma-separated list of column names to display"},
262
+ "help" => {"type"=>"boolean", "description"=>"Return help information", "default"=>false},
263
+ "s" => {"type"=>"list", "description"=>"Comma-separated list of column names or column aliases to sort by"},
264
+ "v" => {"type"=>"boolean", "description"=>"Verbose mode. Display column headers", "default"=>false},
265
+ }
266
+ }
267
+ ),
268
+ "cat.recovery" => RestApi.new(
269
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat-recovery.html",
270
+ methods: ["GET"],
271
+ body: nil,
272
+ url: {
273
+ path: "/_cat/recovery",
274
+ paths: ["/_cat/recovery", "/_cat/recovery/{index}"],
275
+ parts: {
276
+ "index" => {"type"=>"list", "description"=>"A comma-separated list of index names to limit the returned information"},
277
+ },
278
+ params: {
279
+ "format" => {"type"=>"string", "description"=>"a short version of the Accept header, e.g. json, yaml"},
280
+ "bytes" => {"type"=>"enum", "description"=>"The unit in which to display byte values", "options"=>["b", "k", "kb", "m", "mb", "g", "gb", "t", "tb", "p", "pb"]},
281
+ "master_timeout" => {"type"=>"time", "description"=>"Explicit operation timeout for connection to master node"},
282
+ "h" => {"type"=>"list", "description"=>"Comma-separated list of column names to display"},
283
+ "help" => {"type"=>"boolean", "description"=>"Return help information", "default"=>false},
284
+ "s" => {"type"=>"list", "description"=>"Comma-separated list of column names or column aliases to sort by"},
285
+ "v" => {"type"=>"boolean", "description"=>"Verbose mode. Display column headers", "default"=>false},
286
+ }
287
+ }
288
+ ),
289
+ "cat.repositories" => RestApi.new(
290
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat-repositories.html",
291
+ methods: ["GET"],
292
+ body: nil,
293
+ url: {
294
+ path: "/_cat/repositories",
295
+ paths: ["/_cat/repositories"],
296
+ params: {
297
+ "format" => {"type"=>"string", "description"=>"a short version of the Accept header, e.g. json, yaml"},
298
+ "local" => {"type"=>"boolean", "description"=>"Return local information, do not retrieve the state from master node", "default"=>false},
299
+ "master_timeout" => {"type"=>"time", "description"=>"Explicit operation timeout for connection to master node"},
300
+ "h" => {"type"=>"list", "description"=>"Comma-separated list of column names to display"},
301
+ "help" => {"type"=>"boolean", "description"=>"Return help information", "default"=>false},
302
+ "s" => {"type"=>"list", "description"=>"Comma-separated list of column names or column aliases to sort by"},
303
+ "v" => {"type"=>"boolean", "description"=>"Verbose mode. Display column headers", "default"=>false},
304
+ }
305
+ }
306
+ ),
307
+ "cat.segments" => RestApi.new(
308
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat-segments.html",
309
+ methods: ["GET"],
310
+ body: nil,
311
+ url: {
312
+ path: "/_cat/segments",
313
+ paths: ["/_cat/segments", "/_cat/segments/{index}"],
314
+ parts: {
315
+ "index" => {"type"=>"list", "description"=>"A comma-separated list of index names to limit the returned information"},
316
+ },
317
+ params: {
318
+ "format" => {"type"=>"string", "description"=>"a short version of the Accept header, e.g. json, yaml"},
319
+ "bytes" => {"type"=>"enum", "description"=>"The unit in which to display byte values", "options"=>["b", "k", "kb", "m", "mb", "g", "gb", "t", "tb", "p", "pb"]},
320
+ "h" => {"type"=>"list", "description"=>"Comma-separated list of column names to display"},
321
+ "help" => {"type"=>"boolean", "description"=>"Return help information", "default"=>false},
322
+ "s" => {"type"=>"list", "description"=>"Comma-separated list of column names or column aliases to sort by"},
323
+ "v" => {"type"=>"boolean", "description"=>"Verbose mode. Display column headers", "default"=>false},
324
+ }
325
+ }
326
+ ),
327
+ "cat.shards" => RestApi.new(
328
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat-shards.html",
329
+ methods: ["GET"],
330
+ body: nil,
331
+ url: {
332
+ path: "/_cat/shards",
333
+ paths: ["/_cat/shards", "/_cat/shards/{index}"],
334
+ parts: {
335
+ "index" => {"type"=>"list", "description"=>"A comma-separated list of index names to limit the returned information"},
336
+ },
337
+ params: {
338
+ "format" => {"type"=>"string", "description"=>"a short version of the Accept header, e.g. json, yaml"},
339
+ "bytes" => {"type"=>"enum", "description"=>"The unit in which to display byte values", "options"=>["b", "k", "kb", "m", "mb", "g", "gb", "t", "tb", "p", "pb"]},
340
+ "local" => {"type"=>"boolean", "description"=>"Return local information, do not retrieve the state from master node (default: false)"},
341
+ "master_timeout" => {"type"=>"time", "description"=>"Explicit operation timeout for connection to master node"},
342
+ "h" => {"type"=>"list", "description"=>"Comma-separated list of column names to display"},
343
+ "help" => {"type"=>"boolean", "description"=>"Return help information", "default"=>false},
344
+ "s" => {"type"=>"list", "description"=>"Comma-separated list of column names or column aliases to sort by"},
345
+ "v" => {"type"=>"boolean", "description"=>"Verbose mode. Display column headers", "default"=>false},
346
+ }
347
+ }
348
+ ),
349
+ "cat.snapshots" => RestApi.new(
350
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat-snapshots.html",
351
+ methods: ["GET"],
352
+ body: nil,
353
+ url: {
354
+ path: "/_cat/snapshots",
355
+ paths: ["/_cat/snapshots", "/_cat/snapshots/{repository}"],
356
+ parts: {
357
+ "repository" => {"type"=>"list", "required"=>true, "description"=>"Name of repository from which to fetch the snapshot information"},
358
+ },
359
+ params: {
360
+ "format" => {"type"=>"string", "description"=>"a short version of the Accept header, e.g. json, yaml"},
361
+ "ignore_unavailable" => {"type"=>"boolean", "description"=>"Set to true to ignore unavailable snapshots", "default"=>false},
362
+ "master_timeout" => {"type"=>"time", "description"=>"Explicit operation timeout for connection to master node"},
363
+ "h" => {"type"=>"list", "description"=>"Comma-separated list of column names to display"},
364
+ "help" => {"type"=>"boolean", "description"=>"Return help information", "default"=>false},
365
+ "s" => {"type"=>"list", "description"=>"Comma-separated list of column names or column aliases to sort by"},
366
+ "v" => {"type"=>"boolean", "description"=>"Verbose mode. Display column headers", "default"=>false},
367
+ }
368
+ }
369
+ ),
370
+ "cat.tasks" => RestApi.new(
371
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/tasks.html",
372
+ methods: ["GET"],
373
+ body: nil,
374
+ url: {
375
+ path: "/_cat/tasks",
376
+ paths: ["/_cat/tasks"],
377
+ params: {
378
+ "format" => {"type"=>"string", "description"=>"a short version of the Accept header, e.g. json, yaml"},
379
+ "node_id" => {"type"=>"list", "description"=>"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes"},
380
+ "actions" => {"type"=>"list", "description"=>"A comma-separated list of actions that should be returned. Leave empty to return all."},
381
+ "detailed" => {"type"=>"boolean", "description"=>"Return detailed task information (default: false)"},
382
+ "parent_node" => {"type"=>"string", "description"=>"Return tasks with specified parent node."},
383
+ "parent_task" => {"type"=>"number", "description"=>"Return tasks with specified parent task id. Set to -1 to return all."},
384
+ "h" => {"type"=>"list", "description"=>"Comma-separated list of column names to display"},
385
+ "help" => {"type"=>"boolean", "description"=>"Return help information", "default"=>false},
386
+ "s" => {"type"=>"list", "description"=>"Comma-separated list of column names or column aliases to sort by"},
387
+ "v" => {"type"=>"boolean", "description"=>"Verbose mode. Display column headers", "default"=>false},
388
+ }
389
+ }
390
+ ),
391
+ "cat.templates" => RestApi.new(
392
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat-templates.html",
393
+ methods: ["GET"],
394
+ body: nil,
395
+ url: {
396
+ path: "/_cat/templates",
397
+ paths: ["/_cat/templates", "/_cat/templates/{name}"],
398
+ parts: {
399
+ "name" => {"type"=>"string", "description"=>"A pattern that returned template names must match"},
400
+ },
401
+ params: {
402
+ "format" => {"type"=>"string", "description"=>"a short version of the Accept header, e.g. json, yaml"},
403
+ "local" => {"type"=>"boolean", "description"=>"Return local information, do not retrieve the state from master node (default: false)"},
404
+ "master_timeout" => {"type"=>"time", "description"=>"Explicit operation timeout for connection to master node"},
405
+ "h" => {"type"=>"list", "description"=>"Comma-separated list of column names to display"},
406
+ "help" => {"type"=>"boolean", "description"=>"Return help information", "default"=>false},
407
+ "s" => {"type"=>"list", "description"=>"Comma-separated list of column names or column aliases to sort by"},
408
+ "v" => {"type"=>"boolean", "description"=>"Verbose mode. Display column headers", "default"=>false},
409
+ }
410
+ }
411
+ ),
412
+ "cat.thread_pool" => RestApi.new(
413
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cat-thread-pool.html",
414
+ methods: ["GET"],
415
+ body: nil,
416
+ url: {
417
+ path: "/_cat/thread_pool",
418
+ paths: ["/_cat/thread_pool", "/_cat/thread_pool/{thread_pool_patterns}"],
419
+ parts: {
420
+ "thread_pool_patterns" => {"type"=>"list", "description"=>"A comma-separated list of regular-expressions to filter the thread pools in the output"},
421
+ },
422
+ params: {
423
+ "format" => {"type"=>"string", "description"=>"a short version of the Accept header, e.g. json, yaml"},
424
+ "size" => {"type"=>"enum", "description"=>"The multiplier in which to display values", "options"=>["", "k", "m", "g", "t", "p"]},
425
+ "local" => {"type"=>"boolean", "description"=>"Return local information, do not retrieve the state from master node (default: false)"},
426
+ "master_timeout" => {"type"=>"time", "description"=>"Explicit operation timeout for connection to master node"},
427
+ "h" => {"type"=>"list", "description"=>"Comma-separated list of column names to display"},
428
+ "help" => {"type"=>"boolean", "description"=>"Return help information", "default"=>false},
429
+ "s" => {"type"=>"list", "description"=>"Comma-separated list of column names or column aliases to sort by"},
430
+ "v" => {"type"=>"boolean", "description"=>"Verbose mode. Display column headers", "default"=>false},
431
+ }
432
+ }
433
+ ),
434
+ "clear_scroll" => RestApi.new(
435
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/search-request-scroll.html",
436
+ methods: ["DELETE"],
437
+ body: {"description"=>"A comma-separated list of scroll IDs to clear if none was specified via the scroll_id parameter"},
438
+ url: {
439
+ path: "/_search/scroll/{scroll_id}",
440
+ paths: ["/_search/scroll/{scroll_id}", "/_search/scroll"],
441
+ parts: {
442
+ "scroll_id" => {"type"=>"list", "description"=>"A comma-separated list of scroll IDs to clear"},
443
+ },
444
+ }
445
+ ),
446
+ "cluster.allocation_explain" => RestApi.new(
447
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cluster-allocation-explain.html",
448
+ methods: ["GET", "POST"],
449
+ body: {"description"=>"The index, shard, and primary flag to explain. Empty means 'explain the first unassigned shard'"},
450
+ url: {
451
+ path: "/_cluster/allocation/explain",
452
+ paths: ["/_cluster/allocation/explain"],
453
+ params: {
454
+ "include_yes_decisions" => {"type"=>"boolean", "description"=>"Return 'YES' decisions in explanation (default: false)"},
455
+ "include_disk_info" => {"type"=>"boolean", "description"=>"Return information about disk usage and shard sizes (default: false)"},
456
+ }
457
+ }
458
+ ),
459
+ "cluster.get_settings" => RestApi.new(
460
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cluster-update-settings.html",
461
+ methods: ["GET"],
462
+ body: nil,
463
+ url: {
464
+ path: "/_cluster/settings",
465
+ paths: ["/_cluster/settings"],
466
+ params: {
467
+ "flat_settings" => {"type"=>"boolean", "description"=>"Return settings in flat format (default: false)"},
468
+ "master_timeout" => {"type"=>"time", "description"=>"Explicit operation timeout for connection to master node"},
469
+ "timeout" => {"type"=>"time", "description"=>"Explicit operation timeout"},
470
+ "include_defaults" => {"type"=>"boolean", "description"=>"Whether to return all default clusters setting.", "default"=>false},
471
+ }
472
+ }
473
+ ),
474
+ "cluster.health" => RestApi.new(
475
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cluster-health.html",
476
+ methods: ["GET"],
477
+ body: nil,
478
+ url: {
479
+ path: "/_cluster/health",
480
+ paths: ["/_cluster/health", "/_cluster/health/{index}"],
481
+ parts: {
482
+ "index" => {"type"=>"list", "description"=>"Limit the information returned to a specific index"},
483
+ },
484
+ params: {
485
+ "level" => {"type"=>"enum", "options"=>["cluster", "indices", "shards"], "default"=>"cluster", "description"=>"Specify the level of detail for returned information"},
486
+ "local" => {"type"=>"boolean", "description"=>"Return local information, do not retrieve the state from master node (default: false)"},
487
+ "master_timeout" => {"type"=>"time", "description"=>"Explicit operation timeout for connection to master node"},
488
+ "timeout" => {"type"=>"time", "description"=>"Explicit operation timeout"},
489
+ "wait_for_active_shards" => {"type"=>"string", "description"=>"Wait until the specified number of shards is active"},
490
+ "wait_for_nodes" => {"type"=>"string", "description"=>"Wait until the specified number of nodes is available"},
491
+ "wait_for_events" => {"type"=>"enum", "options"=>["immediate", "urgent", "high", "normal", "low", "languid"], "description"=>"Wait until all currently queued events with the given priority are processed"},
492
+ "wait_for_no_relocating_shards" => {"type"=>"boolean", "description"=>"Whether to wait until there are no relocating shards in the cluster"},
493
+ "wait_for_status" => {"type"=>"enum", "options"=>["green", "yellow", "red"], "default"=>nil, "description"=>"Wait until cluster is in a specific state"},
494
+ }
495
+ }
496
+ ),
497
+ "cluster.pending_tasks" => RestApi.new(
498
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cluster-pending.html",
499
+ methods: ["GET"],
500
+ body: nil,
501
+ url: {
502
+ path: "/_cluster/pending_tasks",
503
+ paths: ["/_cluster/pending_tasks"],
504
+ params: {
505
+ "local" => {"type"=>"boolean", "description"=>"Return local information, do not retrieve the state from master node (default: false)"},
506
+ "master_timeout" => {"type"=>"time", "description"=>"Specify timeout for connection to master"},
507
+ }
508
+ }
509
+ ),
510
+ "cluster.put_settings" => RestApi.new(
511
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cluster-update-settings.html",
512
+ methods: ["PUT"],
513
+ body: {"description"=>"The settings to be updated. Can be either `transient` or `persistent` (survives cluster restart)."},
514
+ url: {
515
+ path: "/_cluster/settings",
516
+ paths: ["/_cluster/settings"],
517
+ params: {
518
+ "flat_settings" => {"type"=>"boolean", "description"=>"Return settings in flat format (default: false)"},
519
+ "master_timeout" => {"type"=>"time", "description"=>"Explicit operation timeout for connection to master node"},
520
+ "timeout" => {"type"=>"time", "description"=>"Explicit operation timeout"},
521
+ }
522
+ }
523
+ ),
524
+ "cluster.remote_info" => RestApi.new(
525
+ documentation: "http://www.elastic.co/guide/en/elasticsearch/reference/5.x/cluster-remote-info.html",
526
+ methods: ["GET"],
527
+ body: nil,
528
+ url: {
529
+ path: "/_remote/info",
530
+ paths: ["/_remote/info"],
531
+ }
532
+ ),
533
+ "cluster.reroute" => RestApi.new(
534
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cluster-reroute.html",
535
+ methods: ["POST"],
536
+ body: {"description"=>"The definition of `commands` to perform (`move`, `cancel`, `allocate`)"},
537
+ url: {
538
+ path: "/_cluster/reroute",
539
+ paths: ["/_cluster/reroute"],
540
+ params: {
541
+ "dry_run" => {"type"=>"boolean", "description"=>"Simulate the operation only and return the resulting state"},
542
+ "explain" => {"type"=>"boolean", "description"=>"Return an explanation of why the commands can or cannot be executed"},
543
+ "retry_failed" => {"type"=>"boolean", "description"=>"Retries allocation of shards that are blocked due to too many subsequent allocation failures"},
544
+ "metric" => {"type"=>"list", "options"=>["_all", "blocks", "metadata", "nodes", "routing_table", "master_node", "version"], "description"=>"Limit the information returned to the specified metrics. Defaults to all but metadata"},
545
+ "master_timeout" => {"type"=>"time", "description"=>"Explicit operation timeout for connection to master node"},
546
+ "timeout" => {"type"=>"time", "description"=>"Explicit operation timeout"},
547
+ }
548
+ }
549
+ ),
550
+ "cluster.state" => RestApi.new(
551
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cluster-state.html",
552
+ methods: ["GET"],
553
+ body: nil,
554
+ url: {
555
+ path: "/_cluster/state",
556
+ paths: ["/_cluster/state", "/_cluster/state/{metric}", "/_cluster/state/{metric}/{index}"],
557
+ parts: {
558
+ "index" => {"type"=>"list", "description"=>"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices"},
559
+ "metric" => {"type"=>"list", "options"=>["_all", "blocks", "metadata", "nodes", "routing_table", "routing_nodes", "master_node", "version"], "description"=>"Limit the information returned to the specified metrics"},
560
+ },
561
+ params: {
562
+ "local" => {"type"=>"boolean", "description"=>"Return local information, do not retrieve the state from master node (default: false)"},
563
+ "master_timeout" => {"type"=>"time", "description"=>"Specify timeout for connection to master"},
564
+ "flat_settings" => {"type"=>"boolean", "description"=>"Return settings in flat format (default: false)"},
565
+ "ignore_unavailable" => {"type"=>"boolean", "description"=>"Whether specified concrete indices should be ignored when unavailable (missing or closed)"},
566
+ "allow_no_indices" => {"type"=>"boolean", "description"=>"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)"},
567
+ "expand_wildcards" => {"type"=>"enum", "options"=>["open", "closed", "none", "all"], "default"=>"open", "description"=>"Whether to expand wildcard expression to concrete indices that are open, closed or both."},
568
+ }
569
+ }
570
+ ),
571
+ "cluster.stats" => RestApi.new(
572
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cluster-stats.html",
573
+ methods: ["GET"],
574
+ body: nil,
575
+ url: {
576
+ path: "/_cluster/stats",
577
+ paths: ["/_cluster/stats", "/_cluster/stats/nodes/{node_id}"],
578
+ parts: {
579
+ "node_id" => {"type"=>"list", "description"=>"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes"},
580
+ },
581
+ params: {
582
+ "flat_settings" => {"type"=>"boolean", "description"=>"Return settings in flat format (default: false)"},
583
+ "timeout" => {"type"=>"time", "description"=>"Explicit operation timeout"},
584
+ }
585
+ }
586
+ ),
587
+ "count" => RestApi.new(
588
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/search-count.html",
589
+ methods: ["POST", "GET"],
590
+ body: {"description"=>"A query to restrict the results specified with the Query DSL (optional)"},
591
+ url: {
592
+ path: "/_count",
593
+ paths: ["/_count", "/{index}/_count", "/{index}/{type}/_count"],
594
+ parts: {
595
+ "index" => {"type"=>"list", "description"=>"A comma-separated list of indices to restrict the results"},
596
+ "type" => {"type"=>"list", "description"=>"A comma-separated list of types to restrict the results"},
597
+ },
598
+ params: {
599
+ "ignore_unavailable" => {"type"=>"boolean", "description"=>"Whether specified concrete indices should be ignored when unavailable (missing or closed)"},
600
+ "allow_no_indices" => {"type"=>"boolean", "description"=>"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)"},
601
+ "expand_wildcards" => {"type"=>"enum", "options"=>["open", "closed", "none", "all"], "default"=>"open", "description"=>"Whether to expand wildcard expression to concrete indices that are open, closed or both."},
602
+ "min_score" => {"type"=>"number", "description"=>"Include only documents with a specific `_score` value in the result"},
603
+ "preference" => {"type"=>"string", "description"=>"Specify the node or shard the operation should be performed on (default: random)"},
604
+ "routing" => {"type"=>"list", "description"=>"A comma-separated list of specific routing values"},
605
+ "q" => {"type"=>"string", "description"=>"Query in the Lucene query string syntax"},
606
+ "analyzer" => {"type"=>"string", "description"=>"The analyzer to use for the query string"},
607
+ "analyze_wildcard" => {"type"=>"boolean", "description"=>"Specify whether wildcard and prefix queries should be analyzed (default: false)"},
608
+ "default_operator" => {"type"=>"enum", "options"=>["AND", "OR"], "default"=>"OR", "description"=>"The default operator for query string query (AND or OR)"},
609
+ "df" => {"type"=>"string", "description"=>"The field to use as default where no field prefix is given in the query string"},
610
+ "lenient" => {"type"=>"boolean", "description"=>"Specify whether format-based query failures (such as providing text to a numeric field) should be ignored"},
611
+ "terminate_after" => {"type"=>"number", "description"=>"The maximum count for each shard, upon reaching which the query execution will terminate early"},
612
+ }
613
+ }
614
+ ),
615
+ "count_percolate" => RestApi.new(
616
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/search-percolate.html",
617
+ methods: ["GET", "POST"],
618
+ body: {"description"=>"The count percolator request definition using the percolate DSL", "required"=>false},
619
+ url: {
620
+ path: "/{index}/{type}/_percolate/count",
621
+ paths: ["/{index}/{type}/_percolate/count", "/{index}/{type}/{id}/_percolate/count"],
622
+ parts: {
623
+ "index" => {"type"=>"string", "required"=>true, "description"=>"The index of the document being count percolated."},
624
+ "type" => {"type"=>"string", "required"=>true, "description"=>"The type of the document being count percolated."},
625
+ "id" => {"type"=>"string", "required"=>false, "description"=>"Substitute the document in the request body with a document that is known by the specified id. On top of the id, the index and type parameter will be used to retrieve the document from within the cluster."},
626
+ },
627
+ params: {
628
+ "routing" => {"type"=>"list", "description"=>"A comma-separated list of specific routing values"},
629
+ "preference" => {"type"=>"string", "description"=>"Specify the node or shard the operation should be performed on (default: random)"},
630
+ "ignore_unavailable" => {"type"=>"boolean", "description"=>"Whether specified concrete indices should be ignored when unavailable (missing or closed)"},
631
+ "allow_no_indices" => {"type"=>"boolean", "description"=>"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)"},
632
+ "expand_wildcards" => {"type"=>"enum", "options"=>["open", "closed", "none", "all"], "default"=>"open", "description"=>"Whether to expand wildcard expression to concrete indices that are open, closed or both."},
633
+ "percolate_index" => {"type"=>"string", "description"=>"The index to count percolate the document into. Defaults to index."},
634
+ "percolate_type" => {"type"=>"string", "description"=>"The type to count percolate document into. Defaults to type."},
635
+ "version" => {"type"=>"number", "description"=>"Explicit version number for concurrency control"},
636
+ "version_type" => {"type"=>"enum", "options"=>["internal", "external", "external_gte", "force"], "description"=>"Specific version type"},
637
+ }
638
+ }
639
+ ),
640
+ "create" => RestApi.new(
641
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/docs-index_.html",
642
+ methods: ["PUT", "POST"],
643
+ body: {"description"=>"The document", "required"=>true},
644
+ url: {
645
+ path: "/{index}/{type}/{id}/_create",
646
+ paths: ["/{index}/{type}/{id}/_create"],
647
+ parts: {
648
+ "id" => {"type"=>"string", "required"=>true, "description"=>"Document ID"},
649
+ "index" => {"type"=>"string", "required"=>true, "description"=>"The name of the index"},
650
+ "type" => {"type"=>"string", "required"=>true, "description"=>"The type of the document"},
651
+ },
652
+ params: {
653
+ "wait_for_active_shards" => {"type"=>"string", "description"=>"Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)"},
654
+ "parent" => {"type"=>"string", "description"=>"ID of the parent document"},
655
+ "refresh" => {"type"=>"enum", "options"=>["true", "false", "wait_for"], "description"=>"If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes."},
656
+ "routing" => {"type"=>"string", "description"=>"Specific routing value"},
657
+ "timeout" => {"type"=>"time", "description"=>"Explicit operation timeout"},
658
+ "timestamp" => {"type"=>"time", "description"=>"Explicit timestamp for the document"},
659
+ "ttl" => {"type"=>"time", "description"=>"Expiration time for the document"},
660
+ "version" => {"type"=>"number", "description"=>"Explicit version number for concurrency control"},
661
+ "version_type" => {"type"=>"enum", "options"=>["internal", "external", "external_gte", "force"], "description"=>"Specific version type"},
662
+ "pipeline" => {"type"=>"string", "description"=>"The pipeline id to preprocess incoming documents with"},
663
+ }
664
+ }
665
+ ),
666
+ "delete" => RestApi.new(
667
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/docs-delete.html",
668
+ methods: ["DELETE"],
669
+ body: nil,
670
+ url: {
671
+ path: "/{index}/{type}/{id}",
672
+ paths: ["/{index}/{type}/{id}"],
673
+ parts: {
674
+ "id" => {"type"=>"string", "required"=>true, "description"=>"The document ID"},
675
+ "index" => {"type"=>"string", "required"=>true, "description"=>"The name of the index"},
676
+ "type" => {"type"=>"string", "required"=>true, "description"=>"The type of the document"},
677
+ },
678
+ params: {
679
+ "wait_for_active_shards" => {"type"=>"string", "description"=>"Sets the number of shard copies that must be active before proceeding with the delete operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)"},
680
+ "parent" => {"type"=>"string", "description"=>"ID of parent document"},
681
+ "refresh" => {"type"=>"enum", "options"=>["true", "false", "wait_for"], "description"=>"If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes."},
682
+ "routing" => {"type"=>"string", "description"=>"Specific routing value"},
683
+ "timeout" => {"type"=>"time", "description"=>"Explicit operation timeout"},
684
+ "version" => {"type"=>"number", "description"=>"Explicit version number for concurrency control"},
685
+ "version_type" => {"type"=>"enum", "options"=>["internal", "external", "external_gte", "force"], "description"=>"Specific version type"},
686
+ }
687
+ }
688
+ ),
689
+ "delete_by_query" => RestApi.new(
690
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/docs-delete-by-query.html",
691
+ methods: ["POST"],
692
+ body: {"description"=>"The search definition using the Query DSL", "required"=>true},
693
+ url: {
694
+ path: "/{index}/_delete_by_query",
695
+ paths: ["/{index}/_delete_by_query", "/{index}/{type}/_delete_by_query"],
696
+ parts: {
697
+ "index" => {"required"=>true, "type"=>"list", "description"=>"A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices"},
698
+ "type" => {"type"=>"list", "description"=>"A comma-separated list of document types to search; leave empty to perform the operation on all types"},
699
+ },
700
+ params: {
701
+ "analyzer" => {"type"=>"string", "description"=>"The analyzer to use for the query string"},
702
+ "analyze_wildcard" => {"type"=>"boolean", "description"=>"Specify whether wildcard and prefix queries should be analyzed (default: false)"},
703
+ "default_operator" => {"type"=>"enum", "options"=>["AND", "OR"], "default"=>"OR", "description"=>"The default operator for query string query (AND or OR)"},
704
+ "df" => {"type"=>"string", "description"=>"The field to use as default where no field prefix is given in the query string"},
705
+ "from" => {"type"=>"number", "description"=>"Starting offset (default: 0)"},
706
+ "ignore_unavailable" => {"type"=>"boolean", "description"=>"Whether specified concrete indices should be ignored when unavailable (missing or closed)"},
707
+ "allow_no_indices" => {"type"=>"boolean", "description"=>"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)"},
708
+ "conflicts" => {"note"=>"This is not copied from search", "type"=>"enum", "options"=>["abort", "proceed"], "default"=>"abort", "description"=>"What to do when the delete-by-query hits version conflicts?"},
709
+ "expand_wildcards" => {"type"=>"enum", "options"=>["open", "closed", "none", "all"], "default"=>"open", "description"=>"Whether to expand wildcard expression to concrete indices that are open, closed or both."},
710
+ "lenient" => {"type"=>"boolean", "description"=>"Specify whether format-based query failures (such as providing text to a numeric field) should be ignored"},
711
+ "preference" => {"type"=>"string", "description"=>"Specify the node or shard the operation should be performed on (default: random)"},
712
+ "q" => {"type"=>"string", "description"=>"Query in the Lucene query string syntax"},
713
+ "routing" => {"type"=>"list", "description"=>"A comma-separated list of specific routing values"},
714
+ "scroll" => {"type"=>"time", "description"=>"Specify how long a consistent view of the index should be maintained for scrolled search"},
715
+ "search_type" => {"type"=>"enum", "options"=>["query_then_fetch", "dfs_query_then_fetch"], "description"=>"Search operation type"},
716
+ "search_timeout" => {"type"=>"time", "description"=>"Explicit timeout for each search request. Defaults to no timeout."},
717
+ "size" => {"type"=>"number", "description"=>"Number of hits to return (default: 10)"},
718
+ "sort" => {"type"=>"list", "description"=>"A comma-separated list of <field>:<direction> pairs"},
719
+ "_source" => {"type"=>"list", "description"=>"True or false to return the _source field or not, or a list of fields to return"},
720
+ "_source_exclude" => {"type"=>"list", "description"=>"A list of fields to exclude from the returned _source field"},
721
+ "_source_include" => {"type"=>"list", "description"=>"A list of fields to extract and return from the _source field"},
722
+ "terminate_after" => {"type"=>"number", "description"=>"The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early."},
723
+ "stats" => {"type"=>"list", "description"=>"Specific 'tag' of the request for logging and statistical purposes"},
724
+ "version" => {"type"=>"boolean", "description"=>"Specify whether to return document version as part of a hit"},
725
+ "request_cache" => {"type"=>"boolean", "description"=>"Specify if request cache should be used for this request or not, defaults to index level setting"},
726
+ "refresh" => {"type"=>"boolean", "description"=>"Should the effected indexes be refreshed?"},
727
+ "timeout" => {"type"=>"time", "default"=>"1m", "description"=>"Time each individual bulk request should wait for shards that are unavailable."},
728
+ "wait_for_active_shards" => {"type"=>"string", "description"=>"Sets the number of shard copies that must be active before proceeding with the delete by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)"},
729
+ "scroll_size" => {"type"=>"number", "defaut_value"=>100, "description"=>"Size on the scroll request powering the update_by_query"},
730
+ "wait_for_completion" => {"type"=>"boolean", "default"=>true, "description"=>"Should the request should block until the delete-by-query is complete."},
731
+ "requests_per_second" => {"type"=>"number", "default"=>0, "description"=>"The throttle for this request in sub-requests per second. -1 means no throttle."},
732
+ "slices" => {"type"=>"number", "default"=>1, "description"=>"The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks."},
733
+ }
734
+ }
735
+ ),
736
+ "delete_script" => RestApi.new(
737
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/modules-scripting.html",
738
+ methods: ["DELETE"],
739
+ body: nil,
740
+ url: {
741
+ path: "/_scripts/{lang}",
742
+ paths: ["/_scripts/{lang}", "/_scripts/{lang}/{id}"],
743
+ parts: {
744
+ "id" => {"type"=>"string", "description"=>"Script ID", "required"=>true},
745
+ "lang" => {"type"=>"string", "description"=>"Script language", "required"=>true},
746
+ },
747
+ params: {
748
+ "timeout" => {"type"=>"time", "description"=>"Explicit operation timeout"},
749
+ "master_timeout" => {"type"=>"time", "description"=>"Specify timeout for connection to master"},
750
+ }
751
+ }
752
+ ),
753
+ "delete_template" => RestApi.new(
754
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/search-template.html",
755
+ methods: ["DELETE"],
756
+ body: nil,
757
+ url: {
758
+ path: "/_search/template/{id}",
759
+ paths: ["/_search/template/{id}"],
760
+ parts: {
761
+ "id" => {"type"=>"string", "description"=>"Template ID", "required"=>true},
762
+ },
763
+ }
764
+ ),
765
+ "exists" => RestApi.new(
766
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/docs-get.html",
767
+ methods: ["HEAD"],
768
+ body: nil,
769
+ url: {
770
+ path: "/{index}/{type}/{id}",
771
+ paths: ["/{index}/{type}/{id}"],
772
+ parts: {
773
+ "id" => {"type"=>"string", "required"=>true, "description"=>"The document ID"},
774
+ "index" => {"type"=>"string", "required"=>true, "description"=>"The name of the index"},
775
+ "type" => {"type"=>"string", "required"=>true, "description"=>"The type of the document (use `_all` to fetch the first document matching the ID across all types)"},
776
+ },
777
+ params: {
778
+ "stored_fields" => {"type"=>"list", "description"=>"A comma-separated list of stored fields to return in the response"},
779
+ "parent" => {"type"=>"string", "description"=>"The ID of the parent document"},
780
+ "preference" => {"type"=>"string", "description"=>"Specify the node or shard the operation should be performed on (default: random)"},
781
+ "realtime" => {"type"=>"boolean", "description"=>"Specify whether to perform the operation in realtime or search mode"},
782
+ "refresh" => {"type"=>"boolean", "description"=>"Refresh the shard containing the document before performing the operation"},
783
+ "routing" => {"type"=>"string", "description"=>"Specific routing value"},
784
+ "_source" => {"type"=>"list", "description"=>"True or false to return the _source field or not, or a list of fields to return"},
785
+ "_source_exclude" => {"type"=>"list", "description"=>"A list of fields to exclude from the returned _source field"},
786
+ "_source_include" => {"type"=>"list", "description"=>"A list of fields to extract and return from the _source field"},
787
+ "version" => {"type"=>"number", "description"=>"Explicit version number for concurrency control"},
788
+ "version_type" => {"type"=>"enum", "options"=>["internal", "external", "external_gte", "force"], "description"=>"Specific version type"},
789
+ }
790
+ }
791
+ ),
792
+ "exists_source" => RestApi.new(
793
+ documentation: "http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html",
794
+ methods: ["HEAD"],
795
+ body: nil,
796
+ url: {
797
+ path: "/{index}/{type}/{id}/_source",
798
+ paths: ["/{index}/{type}/{id}/_source"],
799
+ parts: {
800
+ "id" => {"type"=>"string", "required"=>true, "description"=>"The document ID"},
801
+ "index" => {"type"=>"string", "required"=>true, "description"=>"The name of the index"},
802
+ "type" => {"type"=>"string", "required"=>true, "description"=>"The type of the document; use `_all` to fetch the first document matching the ID across all types"},
803
+ },
804
+ params: {
805
+ "parent" => {"type"=>"string", "description"=>"The ID of the parent document"},
806
+ "preference" => {"type"=>"string", "description"=>"Specify the node or shard the operation should be performed on (default: random)"},
807
+ "realtime" => {"type"=>"boolean", "description"=>"Specify whether to perform the operation in realtime or search mode"},
808
+ "refresh" => {"type"=>"boolean", "description"=>"Refresh the shard containing the document before performing the operation"},
809
+ "routing" => {"type"=>"string", "description"=>"Specific routing value"},
810
+ "_source" => {"type"=>"list", "description"=>"True or false to return the _source field or not, or a list of fields to return"},
811
+ "_source_exclude" => {"type"=>"list", "description"=>"A list of fields to exclude from the returned _source field"},
812
+ "_source_include" => {"type"=>"list", "description"=>"A list of fields to extract and return from the _source field"},
813
+ "version" => {"type"=>"number", "description"=>"Explicit version number for concurrency control"},
814
+ "version_type" => {"type"=>"enum", "options"=>["internal", "external", "external_gte", "force"], "description"=>"Specific version type"},
815
+ }
816
+ }
817
+ ),
818
+ "explain" => RestApi.new(
819
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/search-explain.html",
820
+ methods: ["GET", "POST"],
821
+ body: {"description"=>"The query definition using the Query DSL"},
822
+ url: {
823
+ path: "/{index}/{type}/{id}/_explain",
824
+ paths: ["/{index}/{type}/{id}/_explain"],
825
+ parts: {
826
+ "id" => {"type"=>"string", "required"=>true, "description"=>"The document ID"},
827
+ "index" => {"type"=>"string", "required"=>true, "description"=>"The name of the index"},
828
+ "type" => {"type"=>"string", "required"=>true, "description"=>"The type of the document"},
829
+ },
830
+ params: {
831
+ "analyze_wildcard" => {"type"=>"boolean", "description"=>"Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false)"},
832
+ "analyzer" => {"type"=>"string", "description"=>"The analyzer for the query string query"},
833
+ "default_operator" => {"type"=>"enum", "options"=>["AND", "OR"], "default"=>"OR", "description"=>"The default operator for query string query (AND or OR)"},
834
+ "df" => {"type"=>"string", "description"=>"The default field for query string query (default: _all)"},
835
+ "stored_fields" => {"type"=>"list", "description"=>"A comma-separated list of stored fields to return in the response"},
836
+ "lenient" => {"type"=>"boolean", "description"=>"Specify whether format-based query failures (such as providing text to a numeric field) should be ignored"},
837
+ "parent" => {"type"=>"string", "description"=>"The ID of the parent document"},
838
+ "preference" => {"type"=>"string", "description"=>"Specify the node or shard the operation should be performed on (default: random)"},
839
+ "q" => {"type"=>"string", "description"=>"Query in the Lucene query string syntax"},
840
+ "routing" => {"type"=>"string", "description"=>"Specific routing value"},
841
+ "_source" => {"type"=>"list", "description"=>"True or false to return the _source field or not, or a list of fields to return"},
842
+ "_source_exclude" => {"type"=>"list", "description"=>"A list of fields to exclude from the returned _source field"},
843
+ "_source_include" => {"type"=>"list", "description"=>"A list of fields to extract and return from the _source field"},
844
+ }
845
+ }
846
+ ),
847
+ "field_caps" => RestApi.new(
848
+ documentation: "http://www.elastic.co/guide/en/elasticsearch/reference/5.x/search-field-caps.html",
849
+ methods: ["GET", "POST"],
850
+ body: {"description"=>"Field json objects containing an array of field names", "required"=>false},
851
+ url: {
852
+ path: "/_field_caps",
853
+ paths: ["/_field_caps", "/{index}/_field_caps"],
854
+ parts: {
855
+ "index" => {"type"=>"list", "description"=>"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices"},
856
+ },
857
+ params: {
858
+ "fields" => {"type"=>"list", "description"=>"A comma-separated list of field names"},
859
+ "ignore_unavailable" => {"type"=>"boolean", "description"=>"Whether specified concrete indices should be ignored when unavailable (missing or closed)"},
860
+ "allow_no_indices" => {"type"=>"boolean", "description"=>"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)"},
861
+ "expand_wildcards" => {"type"=>"enum", "options"=>["open", "closed", "none", "all"], "default"=>"open", "description"=>"Whether to expand wildcard expression to concrete indices that are open, closed or both."},
862
+ }
863
+ }
864
+ ),
865
+ "field_stats" => RestApi.new(
866
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/search-field-stats.html",
867
+ methods: ["GET", "POST"],
868
+ body: {"description"=>"Field json objects containing the name and optionally a range to filter out indices result, that have results outside the defined bounds", "required"=>false},
869
+ url: {
870
+ path: "/_field_stats",
871
+ paths: ["/_field_stats", "/{index}/_field_stats"],
872
+ parts: {
873
+ "index" => {"type"=>"list", "description"=>"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices"},
874
+ },
875
+ params: {
876
+ "fields" => {"type"=>"list", "description"=>"A comma-separated list of fields for to get field statistics for (min value, max value, and more)"},
877
+ "level" => {"type"=>"enum", "options"=>["indices", "cluster"], "default"=>"cluster", "description"=>"Defines if field stats should be returned on a per index level or on a cluster wide level"},
878
+ "ignore_unavailable" => {"type"=>"boolean", "description"=>"Whether specified concrete indices should be ignored when unavailable (missing or closed)"},
879
+ "allow_no_indices" => {"type"=>"boolean", "description"=>"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)"},
880
+ "expand_wildcards" => {"type"=>"enum", "options"=>["open", "closed", "none", "all"], "default"=>"open", "description"=>"Whether to expand wildcard expression to concrete indices that are open, closed or both."},
881
+ }
882
+ }
883
+ ),
884
+ "get" => RestApi.new(
885
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/docs-get.html",
886
+ methods: ["GET"],
887
+ body: nil,
888
+ url: {
889
+ path: "/{index}/{type}/{id}",
890
+ paths: ["/{index}/{type}/{id}"],
891
+ parts: {
892
+ "id" => {"type"=>"string", "required"=>true, "description"=>"The document ID"},
893
+ "index" => {"type"=>"string", "required"=>true, "description"=>"The name of the index"},
894
+ "type" => {"type"=>"string", "required"=>true, "description"=>"The type of the document (use `_all` to fetch the first document matching the ID across all types)"},
895
+ },
896
+ params: {
897
+ "stored_fields" => {"type"=>"list", "description"=>"A comma-separated list of stored fields to return in the response"},
898
+ "parent" => {"type"=>"string", "description"=>"The ID of the parent document"},
899
+ "preference" => {"type"=>"string", "description"=>"Specify the node or shard the operation should be performed on (default: random)"},
900
+ "realtime" => {"type"=>"boolean", "description"=>"Specify whether to perform the operation in realtime or search mode"},
901
+ "refresh" => {"type"=>"boolean", "description"=>"Refresh the shard containing the document before performing the operation"},
902
+ "routing" => {"type"=>"string", "description"=>"Specific routing value"},
903
+ "_source" => {"type"=>"list", "description"=>"True or false to return the _source field or not, or a list of fields to return"},
904
+ "_source_exclude" => {"type"=>"list", "description"=>"A list of fields to exclude from the returned _source field"},
905
+ "_source_include" => {"type"=>"list", "description"=>"A list of fields to extract and return from the _source field"},
906
+ "version" => {"type"=>"number", "description"=>"Explicit version number for concurrency control"},
907
+ "version_type" => {"type"=>"enum", "options"=>["internal", "external", "external_gte", "force"], "description"=>"Specific version type"},
908
+ }
909
+ }
910
+ ),
911
+ "get_script" => RestApi.new(
912
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/modules-scripting.html",
913
+ methods: ["GET"],
914
+ body: nil,
915
+ url: {
916
+ path: "/_scripts/{lang}",
917
+ paths: ["/_scripts/{lang}", "/_scripts/{lang}/{id}"],
918
+ parts: {
919
+ "id" => {"type"=>"string", "description"=>"Script ID", "required"=>true},
920
+ "lang" => {"type"=>"string", "description"=>"Script language", "required"=>true},
921
+ },
922
+ }
923
+ ),
924
+ "get_source" => RestApi.new(
925
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/docs-get.html",
926
+ methods: ["GET"],
927
+ body: nil,
928
+ url: {
929
+ path: "/{index}/{type}/{id}/_source",
930
+ paths: ["/{index}/{type}/{id}/_source"],
931
+ parts: {
932
+ "id" => {"type"=>"string", "required"=>true, "description"=>"The document ID"},
933
+ "index" => {"type"=>"string", "required"=>true, "description"=>"The name of the index"},
934
+ "type" => {"type"=>"string", "required"=>true, "description"=>"The type of the document; use `_all` to fetch the first document matching the ID across all types"},
935
+ },
936
+ params: {
937
+ "parent" => {"type"=>"string", "description"=>"The ID of the parent document"},
938
+ "preference" => {"type"=>"string", "description"=>"Specify the node or shard the operation should be performed on (default: random)"},
939
+ "realtime" => {"type"=>"boolean", "description"=>"Specify whether to perform the operation in realtime or search mode"},
940
+ "refresh" => {"type"=>"boolean", "description"=>"Refresh the shard containing the document before performing the operation"},
941
+ "routing" => {"type"=>"string", "description"=>"Specific routing value"},
942
+ "_source" => {"type"=>"list", "description"=>"True or false to return the _source field or not, or a list of fields to return"},
943
+ "_source_exclude" => {"type"=>"list", "description"=>"A list of fields to exclude from the returned _source field"},
944
+ "_source_include" => {"type"=>"list", "description"=>"A list of fields to extract and return from the _source field"},
945
+ "version" => {"type"=>"number", "description"=>"Explicit version number for concurrency control"},
946
+ "version_type" => {"type"=>"enum", "options"=>["internal", "external", "external_gte", "force"], "description"=>"Specific version type"},
947
+ }
948
+ }
949
+ ),
950
+ "get_template" => RestApi.new(
951
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/search-template.html",
952
+ methods: ["GET"],
953
+ body: nil,
954
+ url: {
955
+ path: "/_search/template/{id}",
956
+ paths: ["/_search/template/{id}"],
957
+ parts: {
958
+ "id" => {"type"=>"string", "description"=>"Template ID", "required"=>true},
959
+ },
960
+ }
961
+ ),
962
+ "index" => RestApi.new(
963
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/docs-index_.html",
964
+ methods: ["POST", "PUT"],
965
+ body: {"description"=>"The document", "required"=>true},
966
+ url: {
967
+ path: "/{index}/{type}",
968
+ paths: ["/{index}/{type}", "/{index}/{type}/{id}"],
969
+ parts: {
970
+ "id" => {"type"=>"string", "description"=>"Document ID"},
971
+ "index" => {"type"=>"string", "required"=>true, "description"=>"The name of the index"},
972
+ "type" => {"type"=>"string", "required"=>true, "description"=>"The type of the document"},
973
+ },
974
+ params: {
975
+ "wait_for_active_shards" => {"type"=>"string", "description"=>"Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)"},
976
+ "op_type" => {"type"=>"enum", "options"=>["index", "create"], "default"=>"index", "description"=>"Explicit operation type"},
977
+ "parent" => {"type"=>"string", "description"=>"ID of the parent document"},
978
+ "refresh" => {"type"=>"enum", "options"=>["true", "false", "wait_for"], "description"=>"If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes."},
979
+ "routing" => {"type"=>"string", "description"=>"Specific routing value"},
980
+ "timeout" => {"type"=>"time", "description"=>"Explicit operation timeout"},
981
+ "timestamp" => {"type"=>"time", "description"=>"Explicit timestamp for the document"},
982
+ "ttl" => {"type"=>"time", "description"=>"Expiration time for the document"},
983
+ "version" => {"type"=>"number", "description"=>"Explicit version number for concurrency control"},
984
+ "version_type" => {"type"=>"enum", "options"=>["internal", "external", "external_gte", "force"], "description"=>"Specific version type"},
985
+ "pipeline" => {"type"=>"string", "description"=>"The pipeline id to preprocess incoming documents with"},
986
+ }
987
+ }
988
+ ),
989
+ "indices.analyze" => RestApi.new(
990
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-analyze.html",
991
+ methods: ["GET", "POST"],
992
+ body: {"description"=>"The text on which the analysis should be performed"},
993
+ url: {
994
+ path: "/_analyze",
995
+ paths: ["/_analyze", "/{index}/_analyze"],
996
+ parts: {
997
+ "index" => {"type"=>"string", "description"=>"The name of the index to scope the operation"},
998
+ },
999
+ params: {
1000
+ "analyzer" => {"type"=>"string", "description"=>"The name of the analyzer to use"},
1001
+ "char_filter" => {"type"=>"list", "description"=>"A comma-separated list of character filters to use for the analysis"},
1002
+ "field" => {"type"=>"string", "description"=>"Use the analyzer configured for this field (instead of passing the analyzer name)"},
1003
+ "filter" => {"type"=>"list", "description"=>"A comma-separated list of filters to use for the analysis"},
1004
+ "index" => {"type"=>"string", "description"=>"The name of the index to scope the operation"},
1005
+ "prefer_local" => {"type"=>"boolean", "description"=>"With `true`, specify that a local shard should be used if available, with `false`, use a random shard (default: true)"},
1006
+ "text" => {"type"=>"list", "description"=>"The text on which the analysis should be performed (when request body is not used)"},
1007
+ "tokenizer" => {"type"=>"string", "description"=>"The name of the tokenizer to use for the analysis"},
1008
+ "explain" => {"type"=>"boolean", "description"=>"With `true`, outputs more advanced details. (default: false)"},
1009
+ "attributes" => {"type"=>"list", "description"=>"A comma-separated list of token attributes to output, this parameter works only with `explain=true`"},
1010
+ "format" => {"type"=>"enum", "options"=>["detailed", "text"], "default"=>"detailed", "description"=>"Format of the output"},
1011
+ }
1012
+ }
1013
+ ),
1014
+ "indices.clear_cache" => RestApi.new(
1015
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-clearcache.html",
1016
+ methods: ["POST", "GET"],
1017
+ body: nil,
1018
+ url: {
1019
+ path: "/_cache/clear",
1020
+ paths: ["/_cache/clear", "/{index}/_cache/clear"],
1021
+ parts: {
1022
+ "index" => {"type"=>"list", "description"=>"A comma-separated list of index name to limit the operation"},
1023
+ },
1024
+ params: {
1025
+ "field_data" => {"type"=>"boolean", "description"=>"Clear field data"},
1026
+ "fielddata" => {"type"=>"boolean", "description"=>"Clear field data"},
1027
+ "fields" => {"type"=>"list", "description"=>"A comma-separated list of fields to clear when using the `field_data` parameter (default: all)"},
1028
+ "query" => {"type"=>"boolean", "description"=>"Clear query caches"},
1029
+ "ignore_unavailable" => {"type"=>"boolean", "description"=>"Whether specified concrete indices should be ignored when unavailable (missing or closed)"},
1030
+ "allow_no_indices" => {"type"=>"boolean", "description"=>"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)"},
1031
+ "expand_wildcards" => {"type"=>"enum", "options"=>["open", "closed", "none", "all"], "default"=>"open", "description"=>"Whether to expand wildcard expression to concrete indices that are open, closed or both."},
1032
+ "index" => {"type"=>"list", "description"=>"A comma-separated list of index name to limit the operation"},
1033
+ "recycler" => {"type"=>"boolean", "description"=>"Clear the recycler cache"},
1034
+ "request_cache" => {"type"=>"boolean", "description"=>"Clear request cache"},
1035
+ "request" => {"type"=>"boolean", "description"=>"Clear request cache"},
1036
+ }
1037
+ }
1038
+ ),
1039
+ "indices.close" => RestApi.new(
1040
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-open-close.html",
1041
+ methods: ["POST"],
1042
+ body: nil,
1043
+ url: {
1044
+ path: "/{index}/_close",
1045
+ paths: ["/{index}/_close"],
1046
+ parts: {
1047
+ "index" => {"type"=>"list", "required"=>true, "description"=>"A comma separated list of indices to close"},
1048
+ },
1049
+ params: {
1050
+ "timeout" => {"type"=>"time", "description"=>"Explicit operation timeout"},
1051
+ "master_timeout" => {"type"=>"time", "description"=>"Specify timeout for connection to master"},
1052
+ "ignore_unavailable" => {"type"=>"boolean", "description"=>"Whether specified concrete indices should be ignored when unavailable (missing or closed)"},
1053
+ "allow_no_indices" => {"type"=>"boolean", "description"=>"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)"},
1054
+ "expand_wildcards" => {"type"=>"enum", "options"=>["open", "closed", "none", "all"], "default"=>"open", "description"=>"Whether to expand wildcard expression to concrete indices that are open, closed or both."},
1055
+ }
1056
+ }
1057
+ ),
1058
+ "indices.create" => RestApi.new(
1059
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-create-index.html",
1060
+ methods: ["PUT"],
1061
+ body: {"description"=>"The configuration for the index (`settings` and `mappings`)"},
1062
+ url: {
1063
+ path: "/{index}",
1064
+ paths: ["/{index}"],
1065
+ parts: {
1066
+ "index" => {"type"=>"string", "required"=>true, "description"=>"The name of the index"},
1067
+ },
1068
+ params: {
1069
+ "wait_for_active_shards" => {"type"=>"string", "description"=>"Set the number of active shards to wait for before the operation returns."},
1070
+ "timeout" => {"type"=>"time", "description"=>"Explicit operation timeout"},
1071
+ "master_timeout" => {"type"=>"time", "description"=>"Specify timeout for connection to master"},
1072
+ "update_all_types" => {"type"=>"boolean", "description"=>"Whether to update the mapping for all fields with the same name across all types or not"},
1073
+ }
1074
+ }
1075
+ ),
1076
+ "indices.delete" => RestApi.new(
1077
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-delete-index.html",
1078
+ methods: ["DELETE"],
1079
+ body: nil,
1080
+ url: {
1081
+ path: "/{index}",
1082
+ paths: ["/{index}"],
1083
+ parts: {
1084
+ "index" => {"type"=>"list", "required"=>true, "description"=>"A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices"},
1085
+ },
1086
+ params: {
1087
+ "timeout" => {"type"=>"time", "description"=>"Explicit operation timeout"},
1088
+ "master_timeout" => {"type"=>"time", "description"=>"Specify timeout for connection to master"},
1089
+ }
1090
+ }
1091
+ ),
1092
+ "indices.delete_alias" => RestApi.new(
1093
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-aliases.html",
1094
+ methods: ["DELETE"],
1095
+ body: nil,
1096
+ url: {
1097
+ path: "/{index}/_alias/{name}",
1098
+ paths: ["/{index}/_alias/{name}", "/{index}/_aliases/{name}"],
1099
+ parts: {
1100
+ "index" => {"type"=>"list", "required"=>true, "description"=>"A comma-separated list of index names (supports wildcards); use `_all` for all indices"},
1101
+ "name" => {"type"=>"list", "required"=>true, "description"=>"A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices."},
1102
+ },
1103
+ params: {
1104
+ "timeout" => {"type"=>"time", "description"=>"Explicit timestamp for the document"},
1105
+ "master_timeout" => {"type"=>"time", "description"=>"Specify timeout for connection to master"},
1106
+ }
1107
+ }
1108
+ ),
1109
+ "indices.delete_template" => RestApi.new(
1110
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-templates.html",
1111
+ methods: ["DELETE"],
1112
+ body: nil,
1113
+ url: {
1114
+ path: "/_template/{name}",
1115
+ paths: ["/_template/{name}"],
1116
+ parts: {
1117
+ "name" => {"type"=>"string", "required"=>true, "description"=>"The name of the template"},
1118
+ },
1119
+ params: {
1120
+ "timeout" => {"type"=>"time", "description"=>"Explicit operation timeout"},
1121
+ "master_timeout" => {"type"=>"time", "description"=>"Specify timeout for connection to master"},
1122
+ }
1123
+ }
1124
+ ),
1125
+ "indices.exists" => RestApi.new(
1126
+ documentation: "http://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-exists.html",
1127
+ methods: ["HEAD"],
1128
+ body: nil,
1129
+ url: {
1130
+ path: "/{index}",
1131
+ paths: ["/{index}"],
1132
+ parts: {
1133
+ "index" => {"type"=>"list", "required"=>true, "description"=>"A comma-separated list of index names"},
1134
+ },
1135
+ params: {
1136
+ "local" => {"type"=>"boolean", "description"=>"Return local information, do not retrieve the state from master node (default: false)"},
1137
+ "ignore_unavailable" => {"type"=>"boolean", "description"=>"Ignore unavailable indexes (default: false)"},
1138
+ "allow_no_indices" => {"type"=>"boolean", "description"=>"Ignore if a wildcard expression resolves to no concrete indices (default: false)"},
1139
+ "expand_wildcards" => {"type"=>"enum", "options"=>["open", "closed", "none", "all"], "default"=>"open", "description"=>"Whether wildcard expressions should get expanded to open or closed indices (default: open)"},
1140
+ "flat_settings" => {"type"=>"boolean", "description"=>"Return settings in flat format (default: false)"},
1141
+ "include_defaults" => {"type"=>"boolean", "description"=>"Whether to return all default setting for each of the indices.", "default"=>false},
1142
+ }
1143
+ }
1144
+ ),
1145
+ "indices.exists_alias" => RestApi.new(
1146
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-aliases.html",
1147
+ methods: ["HEAD"],
1148
+ body: nil,
1149
+ url: {
1150
+ path: "/_alias/{name}",
1151
+ paths: ["/_alias/{name}", "/{index}/_alias/{name}"],
1152
+ parts: {
1153
+ "index" => {"type"=>"list", "description"=>"A comma-separated list of index names to filter aliases"},
1154
+ "name" => {"type"=>"list", "description"=>"A comma-separated list of alias names to return"},
1155
+ },
1156
+ params: {
1157
+ "ignore_unavailable" => {"type"=>"boolean", "description"=>"Whether specified concrete indices should be ignored when unavailable (missing or closed)"},
1158
+ "allow_no_indices" => {"type"=>"boolean", "description"=>"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)"},
1159
+ "expand_wildcards" => {"type"=>"enum", "options"=>["open", "closed", "none", "all"], "default"=>"all", "description"=>"Whether to expand wildcard expression to concrete indices that are open, closed or both."},
1160
+ "local" => {"type"=>"boolean", "description"=>"Return local information, do not retrieve the state from master node (default: false)"},
1161
+ }
1162
+ }
1163
+ ),
1164
+ "indices.exists_template" => RestApi.new(
1165
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-templates.html",
1166
+ methods: ["HEAD"],
1167
+ body: nil,
1168
+ url: {
1169
+ path: "/_template/{name}",
1170
+ paths: ["/_template/{name}"],
1171
+ parts: {
1172
+ "name" => {"type"=>"list", "required"=>true, "description"=>"The comma separated names of the index templates"},
1173
+ },
1174
+ params: {
1175
+ "flat_settings" => {"type"=>"boolean", "description"=>"Return settings in flat format (default: false)"},
1176
+ "master_timeout" => {"type"=>"time", "description"=>"Explicit operation timeout for connection to master node"},
1177
+ "local" => {"type"=>"boolean", "description"=>"Return local information, do not retrieve the state from master node (default: false)"},
1178
+ }
1179
+ }
1180
+ ),
1181
+ "indices.exists_type" => RestApi.new(
1182
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-types-exists.html",
1183
+ methods: ["HEAD"],
1184
+ body: nil,
1185
+ url: {
1186
+ path: "/{index}/_mapping/{type}",
1187
+ paths: ["/{index}/_mapping/{type}"],
1188
+ parts: {
1189
+ "index" => {"type"=>"list", "required"=>true, "description"=>"A comma-separated list of index names; use `_all` to check the types across all indices"},
1190
+ "type" => {"type"=>"list", "required"=>true, "description"=>"A comma-separated list of document types to check"},
1191
+ },
1192
+ params: {
1193
+ "ignore_unavailable" => {"type"=>"boolean", "description"=>"Whether specified concrete indices should be ignored when unavailable (missing or closed)"},
1194
+ "allow_no_indices" => {"type"=>"boolean", "description"=>"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)"},
1195
+ "expand_wildcards" => {"type"=>"enum", "options"=>["open", "closed", "none", "all"], "default"=>"open", "description"=>"Whether to expand wildcard expression to concrete indices that are open, closed or both."},
1196
+ "local" => {"type"=>"boolean", "description"=>"Return local information, do not retrieve the state from master node (default: false)"},
1197
+ }
1198
+ }
1199
+ ),
1200
+ "indices.flush" => RestApi.new(
1201
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-flush.html",
1202
+ methods: ["POST", "GET"],
1203
+ body: nil,
1204
+ url: {
1205
+ path: "/_flush",
1206
+ paths: ["/_flush", "/{index}/_flush"],
1207
+ parts: {
1208
+ "index" => {"type"=>"list", "description"=>"A comma-separated list of index names; use `_all` or empty string for all indices"},
1209
+ },
1210
+ params: {
1211
+ "force" => {"type"=>"boolean", "description"=>"Whether a flush should be forced even if it is not necessarily needed ie. if no changes will be committed to the index. This is useful if transaction log IDs should be incremented even if no uncommitted changes are present. (This setting can be considered as internal)"},
1212
+ "wait_if_ongoing" => {"type"=>"boolean", "description"=>"If set to true the flush operation will block until the flush can be executed if another flush operation is already executing. The default is true. If set to false the flush will be skipped iff if another flush operation is already running."},
1213
+ "ignore_unavailable" => {"type"=>"boolean", "description"=>"Whether specified concrete indices should be ignored when unavailable (missing or closed)"},
1214
+ "allow_no_indices" => {"type"=>"boolean", "description"=>"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)"},
1215
+ "expand_wildcards" => {"type"=>"enum", "options"=>["open", "closed", "none", "all"], "default"=>"open", "description"=>"Whether to expand wildcard expression to concrete indices that are open, closed or both."},
1216
+ }
1217
+ }
1218
+ ),
1219
+ "indices.flush_synced" => RestApi.new(
1220
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-synced-flush.html",
1221
+ methods: ["POST", "GET"],
1222
+ body: nil,
1223
+ url: {
1224
+ path: "/_flush/synced",
1225
+ paths: ["/_flush/synced", "/{index}/_flush/synced"],
1226
+ parts: {
1227
+ "index" => {"type"=>"list", "description"=>"A comma-separated list of index names; use `_all` or empty string for all indices"},
1228
+ },
1229
+ params: {
1230
+ "ignore_unavailable" => {"type"=>"boolean", "description"=>"Whether specified concrete indices should be ignored when unavailable (missing or closed)"},
1231
+ "allow_no_indices" => {"type"=>"boolean", "description"=>"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)"},
1232
+ "expand_wildcards" => {"type"=>"enum", "options"=>["open", "closed", "none", "all"], "default"=>"open", "description"=>"Whether to expand wildcard expression to concrete indices that are open, closed or both."},
1233
+ }
1234
+ }
1235
+ ),
1236
+ "indices.forcemerge" => RestApi.new(
1237
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-forcemerge.html",
1238
+ methods: ["POST"],
1239
+ body: nil,
1240
+ url: {
1241
+ path: "/_forcemerge",
1242
+ paths: ["/_forcemerge", "/{index}/_forcemerge"],
1243
+ parts: {
1244
+ "index" => {"type"=>"list", "description"=>"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices"},
1245
+ },
1246
+ params: {
1247
+ "flush" => {"type"=>"boolean", "description"=>"Specify whether the index should be flushed after performing the operation (default: true)"},
1248
+ "ignore_unavailable" => {"type"=>"boolean", "description"=>"Whether specified concrete indices should be ignored when unavailable (missing or closed)"},
1249
+ "allow_no_indices" => {"type"=>"boolean", "description"=>"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)"},
1250
+ "expand_wildcards" => {"type"=>"enum", "options"=>["open", "closed", "none", "all"], "default"=>"open", "description"=>"Whether to expand wildcard expression to concrete indices that are open, closed or both."},
1251
+ "max_num_segments" => {"type"=>"number", "description"=>"The number of segments the index should be merged into (default: dynamic)"},
1252
+ "only_expunge_deletes" => {"type"=>"boolean", "description"=>"Specify whether the operation should only expunge deleted documents"},
1253
+ "operation_threading" => {"description"=>"TODO: ?"},
1254
+ "wait_for_merge" => {"type"=>"boolean", "description"=>"Specify whether the request should block until the merge process is finished (default: true)"},
1255
+ }
1256
+ }
1257
+ ),
1258
+ "indices.get" => RestApi.new(
1259
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-get-index.html",
1260
+ methods: ["GET"],
1261
+ body: nil,
1262
+ url: {
1263
+ path: "/{index}",
1264
+ paths: ["/{index}", "/{index}/{feature}"],
1265
+ parts: {
1266
+ "index" => {"type"=>"list", "required"=>true, "description"=>"A comma-separated list of index names"},
1267
+ "feature" => {"type"=>"list", "description"=>"A comma-separated list of features", "options"=>["_settings", "_mappings", "_aliases"]},
1268
+ },
1269
+ params: {
1270
+ "local" => {"type"=>"boolean", "description"=>"Return local information, do not retrieve the state from master node (default: false)"},
1271
+ "ignore_unavailable" => {"type"=>"boolean", "description"=>"Ignore unavailable indexes (default: false)"},
1272
+ "allow_no_indices" => {"type"=>"boolean", "description"=>"Ignore if a wildcard expression resolves to no concrete indices (default: false)"},
1273
+ "expand_wildcards" => {"type"=>"enum", "options"=>["open", "closed", "none", "all"], "default"=>"open", "description"=>"Whether wildcard expressions should get expanded to open or closed indices (default: open)"},
1274
+ "flat_settings" => {"type"=>"boolean", "description"=>"Return settings in flat format (default: false)"},
1275
+ "include_defaults" => {"type"=>"boolean", "description"=>"Whether to return all default setting for each of the indices.", "default"=>false},
1276
+ }
1277
+ }
1278
+ ),
1279
+ "indices.get_alias" => RestApi.new(
1280
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-aliases.html",
1281
+ methods: ["GET"],
1282
+ body: nil,
1283
+ url: {
1284
+ path: "/_alias/",
1285
+ paths: ["/_alias", "/_alias/{name}", "/{index}/_alias/{name}", "/{index}/_alias"],
1286
+ parts: {
1287
+ "index" => {"type"=>"list", "description"=>"A comma-separated list of index names to filter aliases"},
1288
+ "name" => {"type"=>"list", "description"=>"A comma-separated list of alias names to return"},
1289
+ },
1290
+ params: {
1291
+ "ignore_unavailable" => {"type"=>"boolean", "description"=>"Whether specified concrete indices should be ignored when unavailable (missing or closed)"},
1292
+ "allow_no_indices" => {"type"=>"boolean", "description"=>"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)"},
1293
+ "expand_wildcards" => {"type"=>"enum", "options"=>["open", "closed", "none", "all"], "default"=>"all", "description"=>"Whether to expand wildcard expression to concrete indices that are open, closed or both."},
1294
+ "local" => {"type"=>"boolean", "description"=>"Return local information, do not retrieve the state from master node (default: false)"},
1295
+ }
1296
+ }
1297
+ ),
1298
+ "indices.get_field_mapping" => RestApi.new(
1299
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-get-field-mapping.html",
1300
+ methods: ["GET"],
1301
+ body: nil,
1302
+ url: {
1303
+ path: "/_mapping/field/{fields}",
1304
+ paths: ["/_mapping/field/{fields}", "/{index}/_mapping/field/{fields}", "/_mapping/{type}/field/{fields}", "/{index}/_mapping/{type}/field/{fields}"],
1305
+ parts: {
1306
+ "index" => {"type"=>"list", "description"=>"A comma-separated list of index names"},
1307
+ "type" => {"type"=>"list", "description"=>"A comma-separated list of document types"},
1308
+ "fields" => {"type"=>"list", "description"=>"A comma-separated list of fields", "required"=>true},
1309
+ },
1310
+ params: {
1311
+ "include_defaults" => {"type"=>"boolean", "description"=>"Whether the default mapping values should be returned as well"},
1312
+ "ignore_unavailable" => {"type"=>"boolean", "description"=>"Whether specified concrete indices should be ignored when unavailable (missing or closed)"},
1313
+ "allow_no_indices" => {"type"=>"boolean", "description"=>"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)"},
1314
+ "expand_wildcards" => {"type"=>"enum", "options"=>["open", "closed", "none", "all"], "default"=>"open", "description"=>"Whether to expand wildcard expression to concrete indices that are open, closed or both."},
1315
+ "local" => {"type"=>"boolean", "description"=>"Return local information, do not retrieve the state from master node (default: false)"},
1316
+ }
1317
+ }
1318
+ ),
1319
+ "indices.get_mapping" => RestApi.new(
1320
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-get-mapping.html",
1321
+ methods: ["GET"],
1322
+ body: nil,
1323
+ url: {
1324
+ path: "/_mapping",
1325
+ paths: ["/_mapping", "/{index}/_mapping", "/_mapping/{type}", "/{index}/_mapping/{type}"],
1326
+ parts: {
1327
+ "index" => {"type"=>"list", "description"=>"A comma-separated list of index names"},
1328
+ "type" => {"type"=>"list", "description"=>"A comma-separated list of document types"},
1329
+ },
1330
+ params: {
1331
+ "ignore_unavailable" => {"type"=>"boolean", "description"=>"Whether specified concrete indices should be ignored when unavailable (missing or closed)"},
1332
+ "allow_no_indices" => {"type"=>"boolean", "description"=>"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)"},
1333
+ "expand_wildcards" => {"type"=>"enum", "options"=>["open", "closed", "none", "all"], "default"=>"open", "description"=>"Whether to expand wildcard expression to concrete indices that are open, closed or both."},
1334
+ "local" => {"type"=>"boolean", "description"=>"Return local information, do not retrieve the state from master node (default: false)"},
1335
+ }
1336
+ }
1337
+ ),
1338
+ "indices.get_settings" => RestApi.new(
1339
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-get-settings.html",
1340
+ methods: ["GET"],
1341
+ body: nil,
1342
+ url: {
1343
+ path: "/_settings",
1344
+ paths: ["/_settings", "/{index}/_settings", "/{index}/_settings/{name}", "/_settings/{name}"],
1345
+ parts: {
1346
+ "index" => {"type"=>"list", "description"=>"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices"},
1347
+ "name" => {"type"=>"list", "description"=>"The name of the settings that should be included"},
1348
+ },
1349
+ params: {
1350
+ "ignore_unavailable" => {"type"=>"boolean", "description"=>"Whether specified concrete indices should be ignored when unavailable (missing or closed)"},
1351
+ "allow_no_indices" => {"type"=>"boolean", "description"=>"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)"},
1352
+ "expand_wildcards" => {"type"=>"enum", "options"=>["open", "closed", "none", "all"], "default"=>["open", "closed"], "description"=>"Whether to expand wildcard expression to concrete indices that are open, closed or both."},
1353
+ "flat_settings" => {"type"=>"boolean", "description"=>"Return settings in flat format (default: false)"},
1354
+ "local" => {"type"=>"boolean", "description"=>"Return local information, do not retrieve the state from master node (default: false)"},
1355
+ "include_defaults" => {"type"=>"boolean", "description"=>"Whether to return all default setting for each of the indices.", "default"=>false},
1356
+ }
1357
+ }
1358
+ ),
1359
+ "indices.get_template" => RestApi.new(
1360
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-templates.html",
1361
+ methods: ["GET"],
1362
+ body: nil,
1363
+ url: {
1364
+ path: "/_template/{name}",
1365
+ paths: ["/_template", "/_template/{name}"],
1366
+ parts: {
1367
+ "name" => {"type"=>"list", "required"=>false, "description"=>"The comma separated names of the index templates"},
1368
+ },
1369
+ params: {
1370
+ "flat_settings" => {"type"=>"boolean", "description"=>"Return settings in flat format (default: false)"},
1371
+ "master_timeout" => {"type"=>"time", "description"=>"Explicit operation timeout for connection to master node"},
1372
+ "local" => {"type"=>"boolean", "description"=>"Return local information, do not retrieve the state from master node (default: false)"},
1373
+ }
1374
+ }
1375
+ ),
1376
+ "indices.get_upgrade" => RestApi.new(
1377
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-upgrade.html",
1378
+ methods: ["GET"],
1379
+ body: nil,
1380
+ url: {
1381
+ path: "/_upgrade",
1382
+ paths: ["/_upgrade", "/{index}/_upgrade"],
1383
+ parts: {
1384
+ "index" => {"type"=>"list", "description"=>"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices"},
1385
+ },
1386
+ params: {
1387
+ "ignore_unavailable" => {"type"=>"boolean", "description"=>"Whether specified concrete indices should be ignored when unavailable (missing or closed)"},
1388
+ "allow_no_indices" => {"type"=>"boolean", "description"=>"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)"},
1389
+ "expand_wildcards" => {"type"=>"enum", "options"=>["open", "closed", "none", "all"], "default"=>"open", "description"=>"Whether to expand wildcard expression to concrete indices that are open, closed or both."},
1390
+ }
1391
+ }
1392
+ ),
1393
+ "indices.open" => RestApi.new(
1394
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-open-close.html",
1395
+ methods: ["POST"],
1396
+ body: nil,
1397
+ url: {
1398
+ path: "/{index}/_open",
1399
+ paths: ["/{index}/_open"],
1400
+ parts: {
1401
+ "index" => {"type"=>"list", "required"=>true, "description"=>"A comma separated list of indices to open"},
1402
+ },
1403
+ params: {
1404
+ "timeout" => {"type"=>"time", "description"=>"Explicit operation timeout"},
1405
+ "master_timeout" => {"type"=>"time", "description"=>"Specify timeout for connection to master"},
1406
+ "ignore_unavailable" => {"type"=>"boolean", "description"=>"Whether specified concrete indices should be ignored when unavailable (missing or closed)"},
1407
+ "allow_no_indices" => {"type"=>"boolean", "description"=>"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)"},
1408
+ "expand_wildcards" => {"type"=>"enum", "options"=>["open", "closed", "none", "all"], "default"=>"closed", "description"=>"Whether to expand wildcard expression to concrete indices that are open, closed or both."},
1409
+ }
1410
+ }
1411
+ ),
1412
+ "indices.put_alias" => RestApi.new(
1413
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-aliases.html",
1414
+ methods: ["PUT", "POST"],
1415
+ body: {"description"=>"The settings for the alias, such as `routing` or `filter`", "required"=>false},
1416
+ url: {
1417
+ path: "/{index}/_alias/{name}",
1418
+ paths: ["/{index}/_alias/{name}", "/{index}/_aliases/{name}"],
1419
+ parts: {
1420
+ "index" => {"type"=>"list", "required"=>true, "description"=>"A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices."},
1421
+ "name" => {"type"=>"string", "required"=>true, "description"=>"The name of the alias to be created or updated"},
1422
+ },
1423
+ params: {
1424
+ "timeout" => {"type"=>"time", "description"=>"Explicit timestamp for the document"},
1425
+ "master_timeout" => {"type"=>"time", "description"=>"Specify timeout for connection to master"},
1426
+ }
1427
+ }
1428
+ ),
1429
+ "indices.put_mapping" => RestApi.new(
1430
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-put-mapping.html",
1431
+ methods: ["PUT", "POST"],
1432
+ body: {"description"=>"The mapping definition", "required"=>true},
1433
+ url: {
1434
+ path: "/{index}/{type}/_mapping",
1435
+ paths: ["/{index}/{type}/_mapping", "/{index}/_mapping/{type}", "/_mapping/{type}", "/{index}/{type}/_mappings", "/{index}/_mappings/{type}", "/_mappings/{type}"],
1436
+ parts: {
1437
+ "index" => {"type"=>"list", "description"=>"A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices."},
1438
+ "type" => {"type"=>"string", "required"=>true, "description"=>"The name of the document type"},
1439
+ },
1440
+ params: {
1441
+ "timeout" => {"type"=>"time", "description"=>"Explicit operation timeout"},
1442
+ "master_timeout" => {"type"=>"time", "description"=>"Specify timeout for connection to master"},
1443
+ "ignore_unavailable" => {"type"=>"boolean", "description"=>"Whether specified concrete indices should be ignored when unavailable (missing or closed)"},
1444
+ "allow_no_indices" => {"type"=>"boolean", "description"=>"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)"},
1445
+ "expand_wildcards" => {"type"=>"enum", "options"=>["open", "closed", "none", "all"], "default"=>"open", "description"=>"Whether to expand wildcard expression to concrete indices that are open, closed or both."},
1446
+ "update_all_types" => {"type"=>"boolean", "description"=>"Whether to update the mapping for all fields with the same name across all types or not"},
1447
+ }
1448
+ }
1449
+ ),
1450
+ "indices.put_settings" => RestApi.new(
1451
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-update-settings.html",
1452
+ methods: ["PUT"],
1453
+ body: {"description"=>"The index settings to be updated", "required"=>true},
1454
+ url: {
1455
+ path: "/_settings",
1456
+ paths: ["/_settings", "/{index}/_settings"],
1457
+ parts: {
1458
+ "index" => {"type"=>"list", "description"=>"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices"},
1459
+ },
1460
+ params: {
1461
+ "master_timeout" => {"type"=>"time", "description"=>"Specify timeout for connection to master"},
1462
+ "preserve_existing" => {"type"=>"boolean", "description"=>"Whether to update existing settings. If set to `true` existing settings on an index remain unchanged, the default is `false`"},
1463
+ "ignore_unavailable" => {"type"=>"boolean", "description"=>"Whether specified concrete indices should be ignored when unavailable (missing or closed)"},
1464
+ "allow_no_indices" => {"type"=>"boolean", "description"=>"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)"},
1465
+ "expand_wildcards" => {"type"=>"enum", "options"=>["open", "closed", "none", "all"], "default"=>"open", "description"=>"Whether to expand wildcard expression to concrete indices that are open, closed or both."},
1466
+ "flat_settings" => {"type"=>"boolean", "description"=>"Return settings in flat format (default: false)"},
1467
+ }
1468
+ }
1469
+ ),
1470
+ "indices.put_template" => RestApi.new(
1471
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-templates.html",
1472
+ methods: ["PUT", "POST"],
1473
+ body: {"description"=>"The template definition", "required"=>true},
1474
+ url: {
1475
+ path: "/_template/{name}",
1476
+ paths: ["/_template/{name}"],
1477
+ parts: {
1478
+ "name" => {"type"=>"string", "required"=>true, "description"=>"The name of the template"},
1479
+ },
1480
+ params: {
1481
+ "order" => {"type"=>"number", "description"=>"The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers)"},
1482
+ "create" => {"type"=>"boolean", "description"=>"Whether the index template should only be added if new or can also replace an existing one", "default"=>false},
1483
+ "timeout" => {"type"=>"time", "description"=>"Explicit operation timeout"},
1484
+ "master_timeout" => {"type"=>"time", "description"=>"Specify timeout for connection to master"},
1485
+ "flat_settings" => {"type"=>"boolean", "description"=>"Return settings in flat format (default: false)"},
1486
+ }
1487
+ }
1488
+ ),
1489
+ "indices.recovery" => RestApi.new(
1490
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-recovery.html",
1491
+ methods: ["GET"],
1492
+ body: nil,
1493
+ url: {
1494
+ path: "/_recovery",
1495
+ paths: ["/_recovery", "/{index}/_recovery"],
1496
+ parts: {
1497
+ "index" => {"type"=>"list", "description"=>"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices"},
1498
+ },
1499
+ params: {
1500
+ "detailed" => {"type"=>"boolean", "description"=>"Whether to display detailed information about shard recovery", "default"=>false},
1501
+ "active_only" => {"type"=>"boolean", "description"=>"Display only those recoveries that are currently on-going", "default"=>false},
1502
+ }
1503
+ }
1504
+ ),
1505
+ "indices.refresh" => RestApi.new(
1506
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-refresh.html",
1507
+ methods: ["POST", "GET"],
1508
+ body: nil,
1509
+ url: {
1510
+ path: "/_refresh",
1511
+ paths: ["/_refresh", "/{index}/_refresh"],
1512
+ parts: {
1513
+ "index" => {"type"=>"list", "description"=>"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices"},
1514
+ },
1515
+ params: {
1516
+ "ignore_unavailable" => {"type"=>"boolean", "description"=>"Whether specified concrete indices should be ignored when unavailable (missing or closed)"},
1517
+ "allow_no_indices" => {"type"=>"boolean", "description"=>"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)"},
1518
+ "expand_wildcards" => {"type"=>"enum", "options"=>["open", "closed", "none", "all"], "default"=>"open", "description"=>"Whether to expand wildcard expression to concrete indices that are open, closed or both."},
1519
+ }
1520
+ }
1521
+ ),
1522
+ "indices.rollover" => RestApi.new(
1523
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-rollover-index.html",
1524
+ methods: ["POST"],
1525
+ body: {"description"=>"The conditions that needs to be met for executing rollover"},
1526
+ url: {
1527
+ path: "/{alias}/_rollover",
1528
+ paths: ["/{alias}/_rollover", "/{alias}/_rollover/{new_index}"],
1529
+ parts: {
1530
+ "alias" => {"type"=>"string", "required"=>true, "description"=>"The name of the alias to rollover"},
1531
+ "new_index" => {"type"=>"string", "required"=>false, "description"=>"The name of the rollover index"},
1532
+ },
1533
+ params: {
1534
+ "timeout" => {"type"=>"time", "description"=>"Explicit operation timeout"},
1535
+ "dry_run" => {"type"=>"boolean", "description"=>"If set to true the rollover action will only be validated but not actually performed even if a condition matches. The default is false"},
1536
+ "master_timeout" => {"type"=>"time", "description"=>"Specify timeout for connection to master"},
1537
+ "wait_for_active_shards" => {"type"=>"string", "description"=>"Set the number of active shards to wait for on the newly created rollover index before the operation returns."},
1538
+ }
1539
+ }
1540
+ ),
1541
+ "indices.segments" => RestApi.new(
1542
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-segments.html",
1543
+ methods: ["GET"],
1544
+ body: nil,
1545
+ url: {
1546
+ path: "/_segments",
1547
+ paths: ["/_segments", "/{index}/_segments"],
1548
+ parts: {
1549
+ "index" => {"type"=>"list", "description"=>"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices"},
1550
+ },
1551
+ params: {
1552
+ "ignore_unavailable" => {"type"=>"boolean", "description"=>"Whether specified concrete indices should be ignored when unavailable (missing or closed)"},
1553
+ "allow_no_indices" => {"type"=>"boolean", "description"=>"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)"},
1554
+ "expand_wildcards" => {"type"=>"enum", "options"=>["open", "closed", "none", "all"], "default"=>"open", "description"=>"Whether to expand wildcard expression to concrete indices that are open, closed or both."},
1555
+ "operation_threading" => {"description"=>"TODO: ?"},
1556
+ "verbose" => {"type"=>"boolean", "description"=>"Includes detailed memory usage by Lucene.", "default"=>false},
1557
+ }
1558
+ }
1559
+ ),
1560
+ "indices.shard_stores" => RestApi.new(
1561
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-shards-stores.html",
1562
+ methods: ["GET"],
1563
+ body: nil,
1564
+ url: {
1565
+ path: "/_shard_stores",
1566
+ paths: ["/_shard_stores", "/{index}/_shard_stores"],
1567
+ parts: {
1568
+ "index" => {"type"=>"list", "description"=>"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices"},
1569
+ },
1570
+ params: {
1571
+ "status" => {"type"=>"list", "options"=>["green", "yellow", "red", "all"], "description"=>"A comma-separated list of statuses used to filter on shards to get store information for"},
1572
+ "ignore_unavailable" => {"type"=>"boolean", "description"=>"Whether specified concrete indices should be ignored when unavailable (missing or closed)"},
1573
+ "allow_no_indices" => {"type"=>"boolean", "description"=>"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)"},
1574
+ "expand_wildcards" => {"type"=>"enum", "options"=>["open", "closed", "none", "all"], "default"=>"open", "description"=>"Whether to expand wildcard expression to concrete indices that are open, closed or both."},
1575
+ "operation_threading" => {"description"=>"TODO: ?"},
1576
+ }
1577
+ }
1578
+ ),
1579
+ "indices.shrink" => RestApi.new(
1580
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-shrink-index.html",
1581
+ methods: ["PUT", "POST"],
1582
+ body: {"description"=>"The configuration for the target index (`settings` and `aliases`)"},
1583
+ url: {
1584
+ path: "/{index}/_shrink/{target}",
1585
+ paths: ["/{index}/_shrink/{target}"],
1586
+ parts: {
1587
+ "index" => {"type"=>"string", "required"=>true, "description"=>"The name of the source index to shrink"},
1588
+ "target" => {"type"=>"string", "required"=>true, "description"=>"The name of the target index to shrink into"},
1589
+ },
1590
+ params: {
1591
+ "timeout" => {"type"=>"time", "description"=>"Explicit operation timeout"},
1592
+ "master_timeout" => {"type"=>"time", "description"=>"Specify timeout for connection to master"},
1593
+ "wait_for_active_shards" => {"type"=>"string", "description"=>"Set the number of active shards to wait for on the shrunken index before the operation returns."},
1594
+ }
1595
+ }
1596
+ ),
1597
+ "indices.stats" => RestApi.new(
1598
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-stats.html",
1599
+ methods: ["GET"],
1600
+ body: nil,
1601
+ url: {
1602
+ path: "/_stats",
1603
+ paths: ["/_stats", "/_stats/{metric}", "/{index}/_stats", "/{index}/_stats/{metric}"],
1604
+ parts: {
1605
+ "index" => {"type"=>"list", "description"=>"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices"},
1606
+ "metric" => {"type"=>"list", "options"=>["_all", "completion", "docs", "fielddata", "query_cache", "flush", "get", "indexing", "merge", "percolate", "request_cache", "refresh", "search", "segments", "store", "warmer", "suggest"], "description"=>"Limit the information returned the specific metrics."},
1607
+ },
1608
+ params: {
1609
+ "completion_fields" => {"type"=>"list", "description"=>"A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards)"},
1610
+ "fielddata_fields" => {"type"=>"list", "description"=>"A comma-separated list of fields for `fielddata` index metric (supports wildcards)"},
1611
+ "fields" => {"type"=>"list", "description"=>"A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards)"},
1612
+ "groups" => {"type"=>"list", "description"=>"A comma-separated list of search groups for `search` index metric"},
1613
+ "level" => {"type"=>"enum", "description"=>"Return stats aggregated at cluster, index or shard level", "options"=>["cluster", "indices", "shards"], "default"=>"indices"},
1614
+ "types" => {"type"=>"list", "description"=>"A comma-separated list of document types for the `indexing` index metric"},
1615
+ "include_segment_file_sizes" => {"type"=>"boolean", "description"=>"Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested)", "default"=>false},
1616
+ }
1617
+ }
1618
+ ),
1619
+ "indices.update_aliases" => RestApi.new(
1620
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-aliases.html",
1621
+ methods: ["POST"],
1622
+ body: {"description"=>"The definition of `actions` to perform", "required"=>true},
1623
+ url: {
1624
+ path: "/_aliases",
1625
+ paths: ["/_aliases"],
1626
+ params: {
1627
+ "timeout" => {"type"=>"time", "description"=>"Request timeout"},
1628
+ "master_timeout" => {"type"=>"time", "description"=>"Specify timeout for connection to master"},
1629
+ }
1630
+ }
1631
+ ),
1632
+ "indices.upgrade" => RestApi.new(
1633
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/indices-upgrade.html",
1634
+ methods: ["POST"],
1635
+ body: nil,
1636
+ url: {
1637
+ path: "/_upgrade",
1638
+ paths: ["/_upgrade", "/{index}/_upgrade"],
1639
+ parts: {
1640
+ "index" => {"type"=>"list", "description"=>"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices"},
1641
+ },
1642
+ params: {
1643
+ "allow_no_indices" => {"type"=>"boolean", "description"=>"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)"},
1644
+ "expand_wildcards" => {"type"=>"enum", "options"=>["open", "closed", "none", "all"], "default"=>"open", "description"=>"Whether to expand wildcard expression to concrete indices that are open, closed or both."},
1645
+ "ignore_unavailable" => {"type"=>"boolean", "description"=>"Whether specified concrete indices should be ignored when unavailable (missing or closed)"},
1646
+ "wait_for_completion" => {"type"=>"boolean", "description"=>"Specify whether the request should block until the all segments are upgraded (default: false)"},
1647
+ "only_ancient_segments" => {"type"=>"boolean", "description"=>"If true, only ancient (an older Lucene major release) segments will be upgraded"},
1648
+ }
1649
+ }
1650
+ ),
1651
+ "indices.validate_query" => RestApi.new(
1652
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/search-validate.html",
1653
+ methods: ["GET", "POST"],
1654
+ body: {"description"=>"The query definition specified with the Query DSL"},
1655
+ url: {
1656
+ path: "/_validate/query",
1657
+ paths: ["/_validate/query", "/{index}/_validate/query", "/{index}/{type}/_validate/query"],
1658
+ parts: {
1659
+ "index" => {"type"=>"list", "description"=>"A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices"},
1660
+ "type" => {"type"=>"list", "description"=>"A comma-separated list of document types to restrict the operation; leave empty to perform the operation on all types"},
1661
+ },
1662
+ params: {
1663
+ "explain" => {"type"=>"boolean", "description"=>"Return detailed information about the error"},
1664
+ "ignore_unavailable" => {"type"=>"boolean", "description"=>"Whether specified concrete indices should be ignored when unavailable (missing or closed)"},
1665
+ "allow_no_indices" => {"type"=>"boolean", "description"=>"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)"},
1666
+ "expand_wildcards" => {"type"=>"enum", "options"=>["open", "closed", "none", "all"], "default"=>"open", "description"=>"Whether to expand wildcard expression to concrete indices that are open, closed or both."},
1667
+ "operation_threading" => {"description"=>"TODO: ?"},
1668
+ "q" => {"type"=>"string", "description"=>"Query in the Lucene query string syntax"},
1669
+ "analyzer" => {"type"=>"string", "description"=>"The analyzer to use for the query string"},
1670
+ "analyze_wildcard" => {"type"=>"boolean", "description"=>"Specify whether wildcard and prefix queries should be analyzed (default: false)"},
1671
+ "default_operator" => {"type"=>"enum", "options"=>["AND", "OR"], "default"=>"OR", "description"=>"The default operator for query string query (AND or OR)"},
1672
+ "df" => {"type"=>"string", "description"=>"The field to use as default where no field prefix is given in the query string"},
1673
+ "lenient" => {"type"=>"boolean", "description"=>"Specify whether format-based query failures (such as providing text to a numeric field) should be ignored"},
1674
+ "rewrite" => {"type"=>"boolean", "description"=>"Provide a more detailed explanation showing the actual Lucene query that will be executed."},
1675
+ "all_shards" => {"type"=>"boolean", "description"=>"Execute validation on all shards instead of one random shard per index"},
1676
+ }
1677
+ }
1678
+ ),
1679
+ "info" => RestApi.new(
1680
+ documentation: "https://www.elastic.co/guide/",
1681
+ methods: ["GET"],
1682
+ body: nil,
1683
+ url: {
1684
+ path: "/",
1685
+ paths: ["/"],
1686
+ }
1687
+ ),
1688
+ "ingest.delete_pipeline" => RestApi.new(
1689
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/plugins/5.x/ingest.html",
1690
+ methods: ["DELETE"],
1691
+ body: nil,
1692
+ url: {
1693
+ path: "/_ingest/pipeline/{id}",
1694
+ paths: ["/_ingest/pipeline/{id}"],
1695
+ parts: {
1696
+ "id" => {"type"=>"string", "description"=>"Pipeline ID", "required"=>true},
1697
+ },
1698
+ params: {
1699
+ "master_timeout" => {"type"=>"time", "description"=>"Explicit operation timeout for connection to master node"},
1700
+ "timeout" => {"type"=>"time", "description"=>"Explicit operation timeout"},
1701
+ }
1702
+ }
1703
+ ),
1704
+ "ingest.get_pipeline" => RestApi.new(
1705
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/plugins/5.x/ingest.html",
1706
+ methods: ["GET"],
1707
+ body: nil,
1708
+ url: {
1709
+ path: "/_ingest/pipeline/{id}",
1710
+ paths: ["/_ingest/pipeline", "/_ingest/pipeline/{id}"],
1711
+ parts: {
1712
+ "id" => {"type"=>"string", "description"=>"Comma separated list of pipeline ids. Wildcards supported"},
1713
+ },
1714
+ params: {
1715
+ "master_timeout" => {"type"=>"time", "description"=>"Explicit operation timeout for connection to master node"},
1716
+ }
1717
+ }
1718
+ ),
1719
+ "ingest.processor_grok" => RestApi.new(
1720
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/plugins/master/ingest.html",
1721
+ methods: ["GET"],
1722
+ body: nil,
1723
+ url: {
1724
+ path: "/_ingest/processor/grok",
1725
+ paths: ["/_ingest/processor/grok"],
1726
+ }
1727
+ ),
1728
+ "ingest.put_pipeline" => RestApi.new(
1729
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/plugins/5.x/ingest.html",
1730
+ methods: ["PUT"],
1731
+ body: {"description"=>"The ingest definition", "required"=>true},
1732
+ url: {
1733
+ path: "/_ingest/pipeline/{id}",
1734
+ paths: ["/_ingest/pipeline/{id}"],
1735
+ parts: {
1736
+ "id" => {"type"=>"string", "description"=>"Pipeline ID", "required"=>true},
1737
+ },
1738
+ params: {
1739
+ "master_timeout" => {"type"=>"time", "description"=>"Explicit operation timeout for connection to master node"},
1740
+ "timeout" => {"type"=>"time", "description"=>"Explicit operation timeout"},
1741
+ }
1742
+ }
1743
+ ),
1744
+ "ingest.simulate" => RestApi.new(
1745
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/plugins/5.x/ingest.html",
1746
+ methods: ["GET", "POST"],
1747
+ body: {"description"=>"The simulate definition", "required"=>true},
1748
+ url: {
1749
+ path: "/_ingest/pipeline/_simulate",
1750
+ paths: ["/_ingest/pipeline/_simulate", "/_ingest/pipeline/{id}/_simulate"],
1751
+ parts: {
1752
+ "id" => {"type"=>"string", "description"=>"Pipeline ID", "required"=>false},
1753
+ },
1754
+ params: {
1755
+ "verbose" => {"type"=>"boolean", "description"=>"Verbose mode. Display data output for each processor in executed pipeline", "default"=>false},
1756
+ }
1757
+ }
1758
+ ),
1759
+ "mget" => RestApi.new(
1760
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/docs-multi-get.html",
1761
+ methods: ["GET", "POST"],
1762
+ body: {"description"=>"Document identifiers; can be either `docs` (containing full document information) or `ids` (when index and type is provided in the URL.", "required"=>true},
1763
+ url: {
1764
+ path: "/_mget",
1765
+ paths: ["/_mget", "/{index}/_mget", "/{index}/{type}/_mget"],
1766
+ parts: {
1767
+ "index" => {"type"=>"string", "description"=>"The name of the index"},
1768
+ "type" => {"type"=>"string", "description"=>"The type of the document"},
1769
+ },
1770
+ params: {
1771
+ "stored_fields" => {"type"=>"list", "description"=>"A comma-separated list of stored fields to return in the response"},
1772
+ "preference" => {"type"=>"string", "description"=>"Specify the node or shard the operation should be performed on (default: random)"},
1773
+ "realtime" => {"type"=>"boolean", "description"=>"Specify whether to perform the operation in realtime or search mode"},
1774
+ "refresh" => {"type"=>"boolean", "description"=>"Refresh the shard containing the document before performing the operation"},
1775
+ "routing" => {"type"=>"string", "description"=>"Specific routing value"},
1776
+ "_source" => {"type"=>"list", "description"=>"True or false to return the _source field or not, or a list of fields to return"},
1777
+ "_source_exclude" => {"type"=>"list", "description"=>"A list of fields to exclude from the returned _source field"},
1778
+ "_source_include" => {"type"=>"list", "description"=>"A list of fields to extract and return from the _source field"},
1779
+ }
1780
+ }
1781
+ ),
1782
+ "mpercolate" => RestApi.new(
1783
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/search-percolate.html",
1784
+ methods: ["GET", "POST"],
1785
+ body: {"description"=>"The percolate request definitions (header & body pair), separated by newlines", "required"=>true, "serialize"=>"bulk"},
1786
+ url: {
1787
+ path: "/_mpercolate",
1788
+ paths: ["/_mpercolate", "/{index}/_mpercolate", "/{index}/{type}/_mpercolate"],
1789
+ parts: {
1790
+ "index" => {"type"=>"string", "description"=>"The index of the document being count percolated to use as default"},
1791
+ "type" => {"type"=>"string", "description"=>"The type of the document being percolated to use as default."},
1792
+ },
1793
+ params: {
1794
+ "ignore_unavailable" => {"type"=>"boolean", "description"=>"Whether specified concrete indices should be ignored when unavailable (missing or closed)"},
1795
+ "allow_no_indices" => {"type"=>"boolean", "description"=>"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)"},
1796
+ "expand_wildcards" => {"type"=>"enum", "options"=>["open", "closed", "none", "all"], "default"=>"open", "description"=>"Whether to expand wildcard expression to concrete indices that are open, closed or both."},
1797
+ }
1798
+ }
1799
+ ),
1800
+ "msearch" => RestApi.new(
1801
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/search-multi-search.html",
1802
+ methods: ["GET", "POST"],
1803
+ body: {"description"=>"The request definitions (metadata-search request definition pairs), separated by newlines", "required"=>true, "serialize"=>"bulk"},
1804
+ url: {
1805
+ path: "/_msearch",
1806
+ paths: ["/_msearch", "/{index}/_msearch", "/{index}/{type}/_msearch"],
1807
+ parts: {
1808
+ "index" => {"type"=>"list", "description"=>"A comma-separated list of index names to use as default"},
1809
+ "type" => {"type"=>"list", "description"=>"A comma-separated list of document types to use as default"},
1810
+ },
1811
+ params: {
1812
+ "search_type" => {"type"=>"enum", "options"=>["query_then_fetch", "query_and_fetch", "dfs_query_then_fetch", "dfs_query_and_fetch"], "description"=>"Search operation type"},
1813
+ "max_concurrent_searches" => {"type"=>"number", "description"=>"Controls the maximum number of concurrent searches the multi search api will execute"},
1814
+ "typed_keys" => {"type"=>"boolean", "description"=>"Specify whether aggregation and suggester names should be prefixed by their respective types in the response"},
1815
+ "pre_filter_shard_size" => {"type"=>"number", "description"=>"A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on it's rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint.", "default"=>128},
1816
+ }
1817
+ }
1818
+ ),
1819
+ "msearch_template" => RestApi.new(
1820
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html",
1821
+ methods: ["GET", "POST"],
1822
+ body: {"description"=>"The request definitions (metadata-search request definition pairs), separated by newlines", "required"=>true, "serialize"=>"bulk"},
1823
+ url: {
1824
+ path: "/_msearch/template",
1825
+ paths: ["/_msearch/template", "/{index}/_msearch/template", "/{index}/{type}/_msearch/template"],
1826
+ parts: {
1827
+ "index" => {"type"=>"list", "description"=>"A comma-separated list of index names to use as default"},
1828
+ "type" => {"type"=>"list", "description"=>"A comma-separated list of document types to use as default"},
1829
+ },
1830
+ params: {
1831
+ "search_type" => {"type"=>"enum", "options"=>["query_then_fetch", "query_and_fetch", "dfs_query_then_fetch", "dfs_query_and_fetch"], "description"=>"Search operation type"},
1832
+ "typed_keys" => {"type"=>"boolean", "description"=>"Specify whether aggregation and suggester names should be prefixed by their respective types in the response"},
1833
+ "max_concurrent_searches" => {"type"=>"number", "description"=>"Controls the maximum number of concurrent searches the multi search api will execute"},
1834
+ }
1835
+ }
1836
+ ),
1837
+ "mtermvectors" => RestApi.new(
1838
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/docs-multi-termvectors.html",
1839
+ methods: ["GET", "POST"],
1840
+ body: {"description"=>"Define ids, documents, parameters or a list of parameters per document here. You must at least provide a list of document ids. See documentation.", "required"=>false},
1841
+ url: {
1842
+ path: "/_mtermvectors",
1843
+ paths: ["/_mtermvectors", "/{index}/_mtermvectors", "/{index}/{type}/_mtermvectors"],
1844
+ parts: {
1845
+ "index" => {"type"=>"string", "description"=>"The index in which the document resides."},
1846
+ "type" => {"type"=>"string", "description"=>"The type of the document."},
1847
+ },
1848
+ params: {
1849
+ "ids" => {"type"=>"list", "description"=>"A comma-separated list of documents ids. You must define ids as parameter or set \"ids\" or \"docs\" in the request body", "required"=>false},
1850
+ "term_statistics" => {"type"=>"boolean", "description"=>"Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\".", "default"=>false, "required"=>false},
1851
+ "field_statistics" => {"type"=>"boolean", "description"=>"Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\".", "default"=>true, "required"=>false},
1852
+ "fields" => {"type"=>"list", "description"=>"A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\".", "required"=>false},
1853
+ "offsets" => {"type"=>"boolean", "description"=>"Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\".", "default"=>true, "required"=>false},
1854
+ "positions" => {"type"=>"boolean", "description"=>"Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\".", "default"=>true, "required"=>false},
1855
+ "payloads" => {"type"=>"boolean", "description"=>"Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\".", "default"=>true, "required"=>false},
1856
+ "preference" => {"type"=>"string", "description"=>"Specify the node or shard the operation should be performed on (default: random) .Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\".", "required"=>false},
1857
+ "routing" => {"type"=>"string", "description"=>"Specific routing value. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\".", "required"=>false},
1858
+ "parent" => {"type"=>"string", "description"=>"Parent id of documents. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\".", "required"=>false},
1859
+ "realtime" => {"type"=>"boolean", "description"=>"Specifies if requests are real-time as opposed to near-real-time (default: true).", "required"=>false},
1860
+ "version" => {"type"=>"number", "description"=>"Explicit version number for concurrency control"},
1861
+ "version_type" => {"type"=>"enum", "options"=>["internal", "external", "external_gte", "force"], "description"=>"Specific version type"},
1862
+ }
1863
+ }
1864
+ ),
1865
+ "nodes.hot_threads" => RestApi.new(
1866
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cluster-nodes-hot-threads.html",
1867
+ methods: ["GET"],
1868
+ body: nil,
1869
+ url: {
1870
+ path: "/_nodes/hot_threads",
1871
+ paths: ["/_cluster/nodes/hotthreads", "/_cluster/nodes/hot_threads", "/_cluster/nodes/{node_id}/hotthreads", "/_cluster/nodes/{node_id}/hot_threads", "/_nodes/hotthreads", "/_nodes/hot_threads", "/_nodes/{node_id}/hotthreads", "/_nodes/{node_id}/hot_threads"],
1872
+ parts: {
1873
+ "node_id" => {"type"=>"list", "description"=>"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes"},
1874
+ },
1875
+ params: {
1876
+ "interval" => {"type"=>"time", "description"=>"The interval for the second sampling of threads"},
1877
+ "snapshots" => {"type"=>"number", "description"=>"Number of samples of thread stacktrace (default: 10)"},
1878
+ "threads" => {"type"=>"number", "description"=>"Specify the number of threads to provide information for (default: 3)"},
1879
+ "ignore_idle_threads" => {"type"=>"boolean", "description"=>"Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue (default: true)"},
1880
+ "type" => {"type"=>"enum", "options"=>["cpu", "wait", "block"], "description"=>"The type to sample (default: cpu)"},
1881
+ "timeout" => {"type"=>"time", "description"=>"Explicit operation timeout"},
1882
+ }
1883
+ }
1884
+ ),
1885
+ "nodes.info" => RestApi.new(
1886
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cluster-nodes-info.html",
1887
+ methods: ["GET"],
1888
+ body: nil,
1889
+ url: {
1890
+ path: "/_nodes",
1891
+ paths: ["/_nodes", "/_nodes/{node_id}", "/_nodes/{metric}", "/_nodes/{node_id}/{metric}"],
1892
+ parts: {
1893
+ "node_id" => {"type"=>"list", "description"=>"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes"},
1894
+ "metric" => {"type"=>"list", "options"=>["settings", "os", "process", "jvm", "thread_pool", "transport", "http", "plugins", "ingest"], "description"=>"A comma-separated list of metrics you wish returned. Leave empty to return all."},
1895
+ },
1896
+ params: {
1897
+ "flat_settings" => {"type"=>"boolean", "description"=>"Return settings in flat format (default: false)"},
1898
+ "timeout" => {"type"=>"time", "description"=>"Explicit operation timeout"},
1899
+ }
1900
+ }
1901
+ ),
1902
+ "nodes.stats" => RestApi.new(
1903
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/cluster-nodes-stats.html",
1904
+ methods: ["GET"],
1905
+ body: nil,
1906
+ url: {
1907
+ path: "/_nodes/stats",
1908
+ paths: ["/_nodes/stats", "/_nodes/{node_id}/stats", "/_nodes/stats/{metric}", "/_nodes/{node_id}/stats/{metric}", "/_nodes/stats/{metric}/{index_metric}", "/_nodes/{node_id}/stats/{metric}/{index_metric}"],
1909
+ parts: {
1910
+ "metric" => {"type"=>"list", "options"=>["_all", "breaker", "fs", "http", "indices", "jvm", "os", "process", "thread_pool", "transport", "discovery"], "description"=>"Limit the information returned to the specified metrics"},
1911
+ "index_metric" => {"type"=>"list", "options"=>["_all", "completion", "docs", "fielddata", "query_cache", "flush", "get", "indexing", "merge", "percolate", "request_cache", "refresh", "search", "segments", "store", "warmer", "suggest"], "description"=>"Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified."},
1912
+ "node_id" => {"type"=>"list", "description"=>"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes"},
1913
+ },
1914
+ params: {
1915
+ "completion_fields" => {"type"=>"list", "description"=>"A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards)"},
1916
+ "fielddata_fields" => {"type"=>"list", "description"=>"A comma-separated list of fields for `fielddata` index metric (supports wildcards)"},
1917
+ "fields" => {"type"=>"list", "description"=>"A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards)"},
1918
+ "groups" => {"type"=>"boolean", "description"=>"A comma-separated list of search groups for `search` index metric"},
1919
+ "level" => {"type"=>"enum", "description"=>"Return indices stats aggregated at index, node or shard level", "options"=>["indices", "node", "shards"], "default"=>"node"},
1920
+ "types" => {"type"=>"list", "description"=>"A comma-separated list of document types for the `indexing` index metric"},
1921
+ "timeout" => {"type"=>"time", "description"=>"Explicit operation timeout"},
1922
+ "include_segment_file_sizes" => {"type"=>"boolean", "description"=>"Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested)", "default"=>false},
1923
+ }
1924
+ }
1925
+ ),
1926
+ "percolate" => RestApi.new(
1927
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/search-percolate.html",
1928
+ methods: ["GET", "POST"],
1929
+ body: {"description"=>"The percolator request definition using the percolate DSL", "required"=>false},
1930
+ url: {
1931
+ path: "/{index}/{type}/_percolate",
1932
+ paths: ["/{index}/{type}/_percolate", "/{index}/{type}/{id}/_percolate"],
1933
+ parts: {
1934
+ "index" => {"type"=>"string", "required"=>true, "description"=>"The index of the document being percolated."},
1935
+ "type" => {"type"=>"string", "required"=>true, "description"=>"The type of the document being percolated."},
1936
+ "id" => {"type"=>"string", "required"=>false, "description"=>"Substitute the document in the request body with a document that is known by the specified id. On top of the id, the index and type parameter will be used to retrieve the document from within the cluster."},
1937
+ },
1938
+ params: {
1939
+ "routing" => {"type"=>"list", "description"=>"A comma-separated list of specific routing values"},
1940
+ "preference" => {"type"=>"string", "description"=>"Specify the node or shard the operation should be performed on (default: random)"},
1941
+ "ignore_unavailable" => {"type"=>"boolean", "description"=>"Whether specified concrete indices should be ignored when unavailable (missing or closed)"},
1942
+ "allow_no_indices" => {"type"=>"boolean", "description"=>"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)"},
1943
+ "expand_wildcards" => {"type"=>"enum", "options"=>["open", "closed", "none", "all"], "default"=>"open", "description"=>"Whether to expand wildcard expression to concrete indices that are open, closed or both."},
1944
+ "percolate_index" => {"type"=>"string", "description"=>"The index to percolate the document into. Defaults to index."},
1945
+ "percolate_type" => {"type"=>"string", "description"=>"The type to percolate document into. Defaults to type."},
1946
+ "percolate_routing" => {"type"=>"string", "description"=>"The routing value to use when percolating the existing document."},
1947
+ "percolate_preference" => {"type"=>"string", "description"=>"Which shard to prefer when executing the percolate request."},
1948
+ "percolate_format" => {"type"=>"enum", "options"=>["ids"], "description"=>"Return an array of matching query IDs instead of objects"},
1949
+ "version" => {"type"=>"number", "description"=>"Explicit version number for concurrency control"},
1950
+ "version_type" => {"type"=>"enum", "options"=>["internal", "external", "external_gte", "force"], "description"=>"Specific version type"},
1951
+ }
1952
+ }
1953
+ ),
1954
+ "ping" => RestApi.new(
1955
+ documentation: "https://www.elastic.co/guide/",
1956
+ methods: ["HEAD"],
1957
+ body: nil,
1958
+ url: {
1959
+ path: "/",
1960
+ paths: ["/"],
1961
+ }
1962
+ ),
1963
+ "put_script" => RestApi.new(
1964
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/modules-scripting.html",
1965
+ methods: ["PUT", "POST"],
1966
+ body: {"description"=>"The document", "required"=>true},
1967
+ url: {
1968
+ path: "/_scripts/{lang}",
1969
+ paths: ["/_scripts/{lang}", "/_scripts/{lang}/{id}"],
1970
+ parts: {
1971
+ "id" => {"type"=>"string", "description"=>"Script ID", "required"=>true},
1972
+ "lang" => {"type"=>"string", "description"=>"Script language", "required"=>true},
1973
+ },
1974
+ params: {
1975
+ "timeout" => {"type"=>"time", "description"=>"Explicit operation timeout"},
1976
+ "master_timeout" => {"type"=>"time", "description"=>"Specify timeout for connection to master"},
1977
+ }
1978
+ }
1979
+ ),
1980
+ "put_template" => RestApi.new(
1981
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/search-template.html",
1982
+ methods: ["PUT", "POST"],
1983
+ body: {"description"=>"The document", "required"=>true},
1984
+ url: {
1985
+ path: "/_search/template/{id}",
1986
+ paths: ["/_search/template/{id}"],
1987
+ parts: {
1988
+ "id" => {"type"=>"string", "description"=>"Template ID", "required"=>true},
1989
+ },
1990
+ }
1991
+ ),
1992
+ "reindex" => RestApi.new(
1993
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/docs-reindex.html",
1994
+ methods: ["POST"],
1995
+ body: {"description"=>"The search definition using the Query DSL and the prototype for the index request.", "required"=>true},
1996
+ url: {
1997
+ path: "/_reindex",
1998
+ paths: ["/_reindex"],
1999
+ params: {
2000
+ "refresh" => {"type"=>"boolean", "description"=>"Should the effected indexes be refreshed?"},
2001
+ "timeout" => {"type"=>"time", "default"=>"1m", "description"=>"Time each individual bulk request should wait for shards that are unavailable."},
2002
+ "wait_for_active_shards" => {"type"=>"string", "description"=>"Sets the number of shard copies that must be active before proceeding with the reindex operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)"},
2003
+ "wait_for_completion" => {"type"=>"boolean", "default"=>true, "description"=>"Should the request should block until the reindex is complete."},
2004
+ "requests_per_second" => {"type"=>"number", "default"=>0, "description"=>"The throttle to set on this request in sub-requests per second. -1 means no throttle."},
2005
+ "slices" => {"type"=>"number", "default"=>1, "description"=>"The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks."},
2006
+ }
2007
+ }
2008
+ ),
2009
+ "reindex_rethrottle" => RestApi.new(
2010
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/docs-reindex.html",
2011
+ methods: ["POST"],
2012
+ body: nil,
2013
+ url: {
2014
+ path: "/_reindex/{task_id}/_rethrottle",
2015
+ paths: ["/_reindex/{task_id}/_rethrottle", "/_update_by_query/{task_id}/_rethrottle", "/_delete_by_query/{task_id}/_rethrottle"],
2016
+ parts: {
2017
+ "task_id" => {"type"=>"string", "description"=>"The task id to rethrottle"},
2018
+ },
2019
+ params: {
2020
+ "requests_per_second" => {"type"=>"number", "required"=>true, "description"=>"The throttle to set on this request in floating sub-requests per second. -1 means set no throttle."},
2021
+ }
2022
+ }
2023
+ ),
2024
+ "render_search_template" => RestApi.new(
2025
+ documentation: "http://www.elasticsearch.org/guide/en/elasticsearch/reference/5.x/search-template.html",
2026
+ methods: ["GET", "POST"],
2027
+ body: {"description"=>"The search definition template and its params"},
2028
+ url: {
2029
+ path: "/_render/template",
2030
+ paths: ["/_render/template", "/_render/template/{id}"],
2031
+ parts: {
2032
+ "id" => {"type"=>"string", "description"=>"The id of the stored search template"},
2033
+ },
2034
+ }
2035
+ ),
2036
+ "scroll" => RestApi.new(
2037
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/search-request-scroll.html",
2038
+ methods: ["GET", "POST"],
2039
+ body: {"description"=>"The scroll ID if not passed by URL or query parameter."},
2040
+ url: {
2041
+ path: "/_search/scroll",
2042
+ paths: ["/_search/scroll", "/_search/scroll/{scroll_id}"],
2043
+ parts: {
2044
+ "scroll_id" => {"type"=>"string", "description"=>"The scroll ID"},
2045
+ },
2046
+ params: {
2047
+ "scroll" => {"type"=>"time", "description"=>"Specify how long a consistent view of the index should be maintained for scrolled search"},
2048
+ "scroll_id" => {"type"=>"string", "description"=>"The scroll ID for scrolled search"},
2049
+ }
2050
+ }
2051
+ ),
2052
+ "search" => RestApi.new(
2053
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/search-search.html",
2054
+ methods: ["GET", "POST"],
2055
+ body: {"description"=>"The search definition using the Query DSL"},
2056
+ url: {
2057
+ path: "/_search",
2058
+ paths: ["/_search", "/{index}/_search", "/{index}/{type}/_search"],
2059
+ parts: {
2060
+ "index" => {"type"=>"list", "description"=>"A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices"},
2061
+ "type" => {"type"=>"list", "description"=>"A comma-separated list of document types to search; leave empty to perform the operation on all types"},
2062
+ },
2063
+ params: {
2064
+ "analyzer" => {"type"=>"string", "description"=>"The analyzer to use for the query string"},
2065
+ "analyze_wildcard" => {"type"=>"boolean", "description"=>"Specify whether wildcard and prefix queries should be analyzed (default: false)"},
2066
+ "default_operator" => {"type"=>"enum", "options"=>["AND", "OR"], "default"=>"OR", "description"=>"The default operator for query string query (AND or OR)"},
2067
+ "df" => {"type"=>"string", "description"=>"The field to use as default where no field prefix is given in the query string"},
2068
+ "explain" => {"type"=>"boolean", "description"=>"Specify whether to return detailed information about score computation as part of a hit"},
2069
+ "stored_fields" => {"type"=>"list", "description"=>"A comma-separated list of stored fields to return as part of a hit"},
2070
+ "docvalue_fields" => {"type"=>"list", "description"=>"A comma-separated list of fields to return as the docvalue representation of a field for each hit"},
2071
+ "fielddata_fields" => {"type"=>"list", "description"=>"A comma-separated list of fields to return as the docvalue representation of a field for each hit"},
2072
+ "from" => {"type"=>"number", "description"=>"Starting offset (default: 0)"},
2073
+ "ignore_unavailable" => {"type"=>"boolean", "description"=>"Whether specified concrete indices should be ignored when unavailable (missing or closed)"},
2074
+ "allow_no_indices" => {"type"=>"boolean", "description"=>"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)"},
2075
+ "expand_wildcards" => {"type"=>"enum", "options"=>["open", "closed", "none", "all"], "default"=>"open", "description"=>"Whether to expand wildcard expression to concrete indices that are open, closed or both."},
2076
+ "lenient" => {"type"=>"boolean", "description"=>"Specify whether format-based query failures (such as providing text to a numeric field) should be ignored"},
2077
+ "preference" => {"type"=>"string", "description"=>"Specify the node or shard the operation should be performed on (default: random)"},
2078
+ "q" => {"type"=>"string", "description"=>"Query in the Lucene query string syntax"},
2079
+ "routing" => {"type"=>"list", "description"=>"A comma-separated list of specific routing values"},
2080
+ "scroll" => {"type"=>"time", "description"=>"Specify how long a consistent view of the index should be maintained for scrolled search"},
2081
+ "search_type" => {"type"=>"enum", "options"=>["query_then_fetch", "dfs_query_then_fetch"], "description"=>"Search operation type"},
2082
+ "size" => {"type"=>"number", "description"=>"Number of hits to return (default: 10)"},
2083
+ "sort" => {"type"=>"list", "description"=>"A comma-separated list of <field>:<direction> pairs"},
2084
+ "_source" => {"type"=>"list", "description"=>"True or false to return the _source field or not, or a list of fields to return"},
2085
+ "_source_exclude" => {"type"=>"list", "description"=>"A list of fields to exclude from the returned _source field"},
2086
+ "_source_include" => {"type"=>"list", "description"=>"A list of fields to extract and return from the _source field"},
2087
+ "terminate_after" => {"type"=>"number", "description"=>"The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early."},
2088
+ "stats" => {"type"=>"list", "description"=>"Specific 'tag' of the request for logging and statistical purposes"},
2089
+ "suggest_field" => {"type"=>"string", "description"=>"Specify which field to use for suggestions"},
2090
+ "suggest_mode" => {"type"=>"enum", "options"=>["missing", "popular", "always"], "default"=>"missing", "description"=>"Specify suggest mode"},
2091
+ "suggest_size" => {"type"=>"number", "description"=>"How many suggestions to return in response"},
2092
+ "suggest_text" => {"type"=>"string", "description"=>"The source text for which the suggestions should be returned"},
2093
+ "timeout" => {"type"=>"time", "description"=>"Explicit operation timeout"},
2094
+ "track_scores" => {"type"=>"boolean", "description"=>"Whether to calculate and return scores even if they are not used for sorting"},
2095
+ "typed_keys" => {"type"=>"boolean", "description"=>"Specify whether aggregation and suggester names should be prefixed by their respective types in the response"},
2096
+ "version" => {"type"=>"boolean", "description"=>"Specify whether to return document version as part of a hit"},
2097
+ "request_cache" => {"type"=>"boolean", "description"=>"Specify if request cache should be used for this request or not, defaults to index level setting"},
2098
+ "batched_reduce_size" => {"type"=>"number", "description"=>"The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large.", "default"=>512},
2099
+ "max_concurrent_shard_requests" => {"type"=>"number", "description"=>"The number of concurrent shard requests this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests", "default"=>"The default grows with the number of nodes in the cluster but is at most 256."},
2100
+ "pre_filter_shard_size" => {"type"=>"number", "description"=>"A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on it's rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint.", "default"=>128},
2101
+ }
2102
+ }
2103
+ ),
2104
+ "search_shards" => RestApi.new(
2105
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/search-shards.html",
2106
+ methods: ["GET", "POST"],
2107
+ body: nil,
2108
+ url: {
2109
+ path: "/{index}/{type}/_search_shards",
2110
+ paths: ["/_search_shards", "/{index}/_search_shards", "/{index}/{type}/_search_shards"],
2111
+ parts: {
2112
+ "index" => {"type"=>"list", "description"=>"A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices"},
2113
+ "type" => {"type"=>"list", "description"=>"A comma-separated list of document types to search; leave empty to perform the operation on all types"},
2114
+ },
2115
+ params: {
2116
+ "preference" => {"type"=>"string", "description"=>"Specify the node or shard the operation should be performed on (default: random)"},
2117
+ "routing" => {"type"=>"string", "description"=>"Specific routing value"},
2118
+ "local" => {"type"=>"boolean", "description"=>"Return local information, do not retrieve the state from master node (default: false)"},
2119
+ "ignore_unavailable" => {"type"=>"boolean", "description"=>"Whether specified concrete indices should be ignored when unavailable (missing or closed)"},
2120
+ "allow_no_indices" => {"type"=>"boolean", "description"=>"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)"},
2121
+ "expand_wildcards" => {"type"=>"enum", "options"=>["open", "closed", "none", "all"], "default"=>"open", "description"=>"Whether to expand wildcard expression to concrete indices that are open, closed or both."},
2122
+ }
2123
+ }
2124
+ ),
2125
+ "search_template" => RestApi.new(
2126
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html",
2127
+ methods: ["GET", "POST"],
2128
+ body: {"description"=>"The search definition template and its params"},
2129
+ url: {
2130
+ path: "/_search/template",
2131
+ paths: ["/_search/template", "/{index}/_search/template", "/{index}/{type}/_search/template"],
2132
+ parts: {
2133
+ "index" => {"type"=>"list", "description"=>"A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices"},
2134
+ "type" => {"type"=>"list", "description"=>"A comma-separated list of document types to search; leave empty to perform the operation on all types"},
2135
+ },
2136
+ params: {
2137
+ "ignore_unavailable" => {"type"=>"boolean", "description"=>"Whether specified concrete indices should be ignored when unavailable (missing or closed)"},
2138
+ "allow_no_indices" => {"type"=>"boolean", "description"=>"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)"},
2139
+ "expand_wildcards" => {"type"=>"enum", "options"=>["open", "closed", "none", "all"], "default"=>"open", "description"=>"Whether to expand wildcard expression to concrete indices that are open, closed or both."},
2140
+ "preference" => {"type"=>"string", "description"=>"Specify the node or shard the operation should be performed on (default: random)"},
2141
+ "routing" => {"type"=>"list", "description"=>"A comma-separated list of specific routing values"},
2142
+ "scroll" => {"type"=>"time", "description"=>"Specify how long a consistent view of the index should be maintained for scrolled search"},
2143
+ "search_type" => {"type"=>"enum", "options"=>["query_then_fetch", "query_and_fetch", "dfs_query_then_fetch", "dfs_query_and_fetch"], "description"=>"Search operation type"},
2144
+ "explain" => {"type"=>"boolean", "description"=>"Specify whether to return detailed information about score computation as part of a hit"},
2145
+ "profile" => {"type"=>"boolean", "description"=>"Specify whether to profile the query execution"},
2146
+ "typed_keys" => {"type"=>"boolean", "description"=>"Specify whether aggregation and suggester names should be prefixed by their respective types in the response"},
2147
+ }
2148
+ }
2149
+ ),
2150
+ "snapshot.create" => RestApi.new(
2151
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/modules-snapshots.html",
2152
+ methods: ["PUT", "POST"],
2153
+ body: {"description"=>"The snapshot definition", "required"=>false},
2154
+ url: {
2155
+ path: "/_snapshot/{repository}/{snapshot}",
2156
+ paths: ["/_snapshot/{repository}/{snapshot}"],
2157
+ parts: {
2158
+ "repository" => {"type"=>"string", "required"=>true, "description"=>"A repository name"},
2159
+ "snapshot" => {"type"=>"string", "required"=>true, "description"=>"A snapshot name"},
2160
+ },
2161
+ params: {
2162
+ "master_timeout" => {"type"=>"time", "description"=>"Explicit operation timeout for connection to master node"},
2163
+ "wait_for_completion" => {"type"=>"boolean", "description"=>"Should this request wait until the operation has completed before returning", "default"=>false},
2164
+ }
2165
+ }
2166
+ ),
2167
+ "snapshot.create_repository" => RestApi.new(
2168
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/modules-snapshots.html",
2169
+ methods: ["PUT", "POST"],
2170
+ body: {"description"=>"The repository definition", "required"=>true},
2171
+ url: {
2172
+ path: "/_snapshot/{repository}",
2173
+ paths: ["/_snapshot/{repository}"],
2174
+ parts: {
2175
+ "repository" => {"type"=>"string", "required"=>true, "description"=>"A repository name"},
2176
+ },
2177
+ params: {
2178
+ "master_timeout" => {"type"=>"time", "description"=>"Explicit operation timeout for connection to master node"},
2179
+ "timeout" => {"type"=>"time", "description"=>"Explicit operation timeout"},
2180
+ "verify" => {"type"=>"boolean", "description"=>"Whether to verify the repository after creation"},
2181
+ }
2182
+ }
2183
+ ),
2184
+ "snapshot.delete" => RestApi.new(
2185
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/modules-snapshots.html",
2186
+ methods: ["DELETE"],
2187
+ body: nil,
2188
+ url: {
2189
+ path: "/_snapshot/{repository}/{snapshot}",
2190
+ paths: ["/_snapshot/{repository}/{snapshot}"],
2191
+ parts: {
2192
+ "repository" => {"type"=>"string", "required"=>true, "description"=>"A repository name"},
2193
+ "snapshot" => {"type"=>"string", "required"=>true, "description"=>"A snapshot name"},
2194
+ },
2195
+ params: {
2196
+ "master_timeout" => {"type"=>"time", "description"=>"Explicit operation timeout for connection to master node"},
2197
+ }
2198
+ }
2199
+ ),
2200
+ "snapshot.delete_repository" => RestApi.new(
2201
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/modules-snapshots.html",
2202
+ methods: ["DELETE"],
2203
+ body: nil,
2204
+ url: {
2205
+ path: "/_snapshot/{repository}",
2206
+ paths: ["/_snapshot/{repository}"],
2207
+ parts: {
2208
+ "repository" => {"type"=>"list", "required"=>true, "description"=>"A comma-separated list of repository names"},
2209
+ },
2210
+ params: {
2211
+ "master_timeout" => {"type"=>"time", "description"=>"Explicit operation timeout for connection to master node"},
2212
+ "timeout" => {"type"=>"time", "description"=>"Explicit operation timeout"},
2213
+ }
2214
+ }
2215
+ ),
2216
+ "snapshot.get" => RestApi.new(
2217
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/modules-snapshots.html",
2218
+ methods: ["GET"],
2219
+ body: nil,
2220
+ url: {
2221
+ path: "/_snapshot/{repository}/{snapshot}",
2222
+ paths: ["/_snapshot/{repository}/{snapshot}"],
2223
+ parts: {
2224
+ "repository" => {"type"=>"string", "required"=>true, "description"=>"A repository name"},
2225
+ "snapshot" => {"type"=>"list", "required"=>true, "description"=>"A comma-separated list of snapshot names"},
2226
+ },
2227
+ params: {
2228
+ "master_timeout" => {"type"=>"time", "description"=>"Explicit operation timeout for connection to master node"},
2229
+ "ignore_unavailable" => {"type"=>"boolean", "description"=>"Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown"},
2230
+ "verbose" => {"type"=>"boolean", "description"=>"Whether to show verbose snapshot info or only show the basic info found in the repository index blob"},
2231
+ }
2232
+ }
2233
+ ),
2234
+ "snapshot.get_repository" => RestApi.new(
2235
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/modules-snapshots.html",
2236
+ methods: ["GET"],
2237
+ body: nil,
2238
+ url: {
2239
+ path: "/_snapshot",
2240
+ paths: ["/_snapshot", "/_snapshot/{repository}"],
2241
+ parts: {
2242
+ "repository" => {"type"=>"list", "description"=>"A comma-separated list of repository names"},
2243
+ },
2244
+ params: {
2245
+ "master_timeout" => {"type"=>"time", "description"=>"Explicit operation timeout for connection to master node"},
2246
+ "local" => {"type"=>"boolean", "description"=>"Return local information, do not retrieve the state from master node (default: false)"},
2247
+ }
2248
+ }
2249
+ ),
2250
+ "snapshot.restore" => RestApi.new(
2251
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/modules-snapshots.html",
2252
+ methods: ["POST"],
2253
+ body: {"description"=>"Details of what to restore", "required"=>false},
2254
+ url: {
2255
+ path: "/_snapshot/{repository}/{snapshot}/_restore",
2256
+ paths: ["/_snapshot/{repository}/{snapshot}/_restore"],
2257
+ parts: {
2258
+ "repository" => {"type"=>"string", "required"=>true, "description"=>"A repository name"},
2259
+ "snapshot" => {"type"=>"string", "required"=>true, "description"=>"A snapshot name"},
2260
+ },
2261
+ params: {
2262
+ "master_timeout" => {"type"=>"time", "description"=>"Explicit operation timeout for connection to master node"},
2263
+ "wait_for_completion" => {"type"=>"boolean", "description"=>"Should this request wait until the operation has completed before returning", "default"=>false},
2264
+ }
2265
+ }
2266
+ ),
2267
+ "snapshot.status" => RestApi.new(
2268
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/modules-snapshots.html",
2269
+ methods: ["GET"],
2270
+ body: nil,
2271
+ url: {
2272
+ path: "/_snapshot/_status",
2273
+ paths: ["/_snapshot/_status", "/_snapshot/{repository}/_status", "/_snapshot/{repository}/{snapshot}/_status"],
2274
+ parts: {
2275
+ "repository" => {"type"=>"string", "description"=>"A repository name"},
2276
+ "snapshot" => {"type"=>"list", "description"=>"A comma-separated list of snapshot names"},
2277
+ },
2278
+ params: {
2279
+ "master_timeout" => {"type"=>"time", "description"=>"Explicit operation timeout for connection to master node"},
2280
+ "ignore_unavailable" => {"type"=>"boolean", "description"=>"Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown"},
2281
+ }
2282
+ }
2283
+ ),
2284
+ "snapshot.verify_repository" => RestApi.new(
2285
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/modules-snapshots.html",
2286
+ methods: ["POST"],
2287
+ body: nil,
2288
+ url: {
2289
+ path: "/_snapshot/{repository}/_verify",
2290
+ paths: ["/_snapshot/{repository}/_verify"],
2291
+ parts: {
2292
+ "repository" => {"type"=>"string", "required"=>true, "description"=>"A repository name"},
2293
+ },
2294
+ params: {
2295
+ "master_timeout" => {"type"=>"time", "description"=>"Explicit operation timeout for connection to master node"},
2296
+ "timeout" => {"type"=>"time", "description"=>"Explicit operation timeout"},
2297
+ }
2298
+ }
2299
+ ),
2300
+ "suggest" => RestApi.new(
2301
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/search-suggesters.html",
2302
+ methods: ["POST"],
2303
+ body: {"description"=>"The request definition", "required"=>true},
2304
+ url: {
2305
+ path: "/_suggest",
2306
+ paths: ["/_suggest", "/{index}/_suggest"],
2307
+ parts: {
2308
+ "index" => {"type"=>"list", "description"=>"A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices"},
2309
+ },
2310
+ params: {
2311
+ "ignore_unavailable" => {"type"=>"boolean", "description"=>"Whether specified concrete indices should be ignored when unavailable (missing or closed)"},
2312
+ "allow_no_indices" => {"type"=>"boolean", "description"=>"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)"},
2313
+ "expand_wildcards" => {"type"=>"enum", "options"=>["open", "closed", "none", "all"], "default"=>"open", "description"=>"Whether to expand wildcard expression to concrete indices that are open, closed or both."},
2314
+ "preference" => {"type"=>"string", "description"=>"Specify the node or shard the operation should be performed on (default: random)"},
2315
+ "routing" => {"type"=>"string", "description"=>"Specific routing value"},
2316
+ }
2317
+ }
2318
+ ),
2319
+ "tasks.cancel" => RestApi.new(
2320
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/tasks.html",
2321
+ methods: ["POST"],
2322
+ body: nil,
2323
+ url: {
2324
+ path: "/_tasks",
2325
+ paths: ["/_tasks/_cancel", "/_tasks/{task_id}/_cancel"],
2326
+ parts: {
2327
+ "task_id" => {"type"=>"string", "description"=>"Cancel the task with specified task id (node_id:task_number)"},
2328
+ },
2329
+ params: {
2330
+ "nodes" => {"type"=>"list", "description"=>"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes"},
2331
+ "actions" => {"type"=>"list", "description"=>"A comma-separated list of actions that should be cancelled. Leave empty to cancel all."},
2332
+ "parent_node" => {"type"=>"string", "description"=>"Cancel tasks with specified parent node."},
2333
+ "parent_task_id" => {"type"=>"string", "description"=>"Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all."},
2334
+ }
2335
+ }
2336
+ ),
2337
+ "tasks.get" => RestApi.new(
2338
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/tasks.html",
2339
+ methods: ["GET"],
2340
+ body: nil,
2341
+ url: {
2342
+ path: "/_tasks/{task_id}",
2343
+ paths: ["/_tasks/{task_id}"],
2344
+ parts: {
2345
+ "task_id" => {"type"=>"string", "description"=>"Return the task with specified id (node_id:task_number)"},
2346
+ },
2347
+ params: {
2348
+ "wait_for_completion" => {"type"=>"boolean", "description"=>"Wait for the matching tasks to complete (default: false)"},
2349
+ "timeout" => {"type"=>"time", "description"=>"Explicit operation timeout"},
2350
+ }
2351
+ }
2352
+ ),
2353
+ "tasks.list" => RestApi.new(
2354
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/tasks.html",
2355
+ methods: ["GET"],
2356
+ body: nil,
2357
+ url: {
2358
+ path: "/_tasks",
2359
+ paths: ["/_tasks"],
2360
+ params: {
2361
+ "nodes" => {"type"=>"list", "description"=>"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes"},
2362
+ "actions" => {"type"=>"list", "description"=>"A comma-separated list of actions that should be returned. Leave empty to return all."},
2363
+ "detailed" => {"type"=>"boolean", "description"=>"Return detailed task information (default: false)"},
2364
+ "parent_node" => {"type"=>"string", "description"=>"Return tasks with specified parent node."},
2365
+ "parent_task_id" => {"type"=>"string", "description"=>"Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all."},
2366
+ "wait_for_completion" => {"type"=>"boolean", "description"=>"Wait for the matching tasks to complete (default: false)"},
2367
+ "group_by" => {"type"=>"enum", "description"=>"Group tasks by nodes or parent/child relationships", "options"=>["nodes", "parents"], "default"=>"nodes"},
2368
+ "timeout" => {"type"=>"time", "description"=>"Explicit operation timeout"},
2369
+ }
2370
+ }
2371
+ ),
2372
+ "termvectors" => RestApi.new(
2373
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/docs-termvectors.html",
2374
+ methods: ["GET", "POST"],
2375
+ body: {"description"=>"Define parameters and or supply a document to get termvectors for. See documentation.", "required"=>false},
2376
+ url: {
2377
+ path: "/{index}/{type}/_termvectors",
2378
+ paths: ["/{index}/{type}/_termvectors", "/{index}/{type}/{id}/_termvectors"],
2379
+ parts: {
2380
+ "index" => {"type"=>"string", "description"=>"The index in which the document resides.", "required"=>true},
2381
+ "type" => {"type"=>"string", "description"=>"The type of the document.", "required"=>true},
2382
+ "id" => {"type"=>"string", "description"=>"The id of the document, when not specified a doc param should be supplied."},
2383
+ },
2384
+ params: {
2385
+ "term_statistics" => {"type"=>"boolean", "description"=>"Specifies if total term frequency and document frequency should be returned.", "default"=>false, "required"=>false},
2386
+ "field_statistics" => {"type"=>"boolean", "description"=>"Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned.", "default"=>true, "required"=>false},
2387
+ "fields" => {"type"=>"list", "description"=>"A comma-separated list of fields to return.", "required"=>false},
2388
+ "offsets" => {"type"=>"boolean", "description"=>"Specifies if term offsets should be returned.", "default"=>true, "required"=>false},
2389
+ "positions" => {"type"=>"boolean", "description"=>"Specifies if term positions should be returned.", "default"=>true, "required"=>false},
2390
+ "payloads" => {"type"=>"boolean", "description"=>"Specifies if term payloads should be returned.", "default"=>true, "required"=>false},
2391
+ "preference" => {"type"=>"string", "description"=>"Specify the node or shard the operation should be performed on (default: random).", "required"=>false},
2392
+ "routing" => {"type"=>"string", "description"=>"Specific routing value.", "required"=>false},
2393
+ "parent" => {"type"=>"string", "description"=>"Parent id of documents.", "required"=>false},
2394
+ "realtime" => {"type"=>"boolean", "description"=>"Specifies if request is real-time as opposed to near-real-time (default: true).", "required"=>false},
2395
+ "version" => {"type"=>"number", "description"=>"Explicit version number for concurrency control"},
2396
+ "version_type" => {"type"=>"enum", "options"=>["internal", "external", "external_gte", "force"], "description"=>"Specific version type"},
2397
+ }
2398
+ }
2399
+ ),
2400
+ "update" => RestApi.new(
2401
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/docs-update.html",
2402
+ methods: ["POST"],
2403
+ body: {"description"=>"The request definition using either `script` or partial `doc`"},
2404
+ url: {
2405
+ path: "/{index}/{type}/{id}/_update",
2406
+ paths: ["/{index}/{type}/{id}/_update"],
2407
+ parts: {
2408
+ "id" => {"type"=>"string", "required"=>true, "description"=>"Document ID"},
2409
+ "index" => {"type"=>"string", "required"=>true, "description"=>"The name of the index"},
2410
+ "type" => {"type"=>"string", "required"=>true, "description"=>"The type of the document"},
2411
+ },
2412
+ params: {
2413
+ "wait_for_active_shards" => {"type"=>"string", "description"=>"Sets the number of shard copies that must be active before proceeding with the update operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)"},
2414
+ "fields" => {"type"=>"list", "description"=>"A comma-separated list of fields to return in the response"},
2415
+ "_source" => {"type"=>"list", "description"=>"True or false to return the _source field or not, or a list of fields to return"},
2416
+ "_source_exclude" => {"type"=>"list", "description"=>"A list of fields to exclude from the returned _source field"},
2417
+ "_source_include" => {"type"=>"list", "description"=>"A list of fields to extract and return from the _source field"},
2418
+ "lang" => {"type"=>"string", "description"=>"The script language (default: painless)"},
2419
+ "parent" => {"type"=>"string", "description"=>"ID of the parent document. Is is only used for routing and when for the upsert request"},
2420
+ "refresh" => {"type"=>"enum", "options"=>["true", "false", "wait_for"], "description"=>"If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes."},
2421
+ "retry_on_conflict" => {"type"=>"number", "description"=>"Specify how many times should the operation be retried when a conflict occurs (default: 0)"},
2422
+ "routing" => {"type"=>"string", "description"=>"Specific routing value"},
2423
+ "timeout" => {"type"=>"time", "description"=>"Explicit operation timeout"},
2424
+ "timestamp" => {"type"=>"time", "description"=>"Explicit timestamp for the document"},
2425
+ "ttl" => {"type"=>"time", "description"=>"Expiration time for the document"},
2426
+ "version" => {"type"=>"number", "description"=>"Explicit version number for concurrency control"},
2427
+ "version_type" => {"type"=>"enum", "options"=>["internal", "force"], "description"=>"Specific version type"},
2428
+ }
2429
+ }
2430
+ ),
2431
+ "update_by_query" => RestApi.new(
2432
+ documentation: "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/docs-update-by-query.html",
2433
+ methods: ["POST"],
2434
+ body: {"description"=>"The search definition using the Query DSL"},
2435
+ url: {
2436
+ path: "/{index}/_update_by_query",
2437
+ paths: ["/{index}/_update_by_query", "/{index}/{type}/_update_by_query"],
2438
+ parts: {
2439
+ "index" => {"required"=>true, "type"=>"list", "description"=>"A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices"},
2440
+ "type" => {"type"=>"list", "description"=>"A comma-separated list of document types to search; leave empty to perform the operation on all types"},
2441
+ },
2442
+ params: {
2443
+ "analyzer" => {"type"=>"string", "description"=>"The analyzer to use for the query string"},
2444
+ "analyze_wildcard" => {"type"=>"boolean", "description"=>"Specify whether wildcard and prefix queries should be analyzed (default: false)"},
2445
+ "default_operator" => {"type"=>"enum", "options"=>["AND", "OR"], "default"=>"OR", "description"=>"The default operator for query string query (AND or OR)"},
2446
+ "df" => {"type"=>"string", "description"=>"The field to use as default where no field prefix is given in the query string"},
2447
+ "from" => {"type"=>"number", "description"=>"Starting offset (default: 0)"},
2448
+ "ignore_unavailable" => {"type"=>"boolean", "description"=>"Whether specified concrete indices should be ignored when unavailable (missing or closed)"},
2449
+ "allow_no_indices" => {"type"=>"boolean", "description"=>"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)"},
2450
+ "conflicts" => {"note"=>"This is not copied from search", "type"=>"enum", "options"=>["abort", "proceed"], "default"=>"abort", "description"=>"What to do when the update by query hits version conflicts?"},
2451
+ "expand_wildcards" => {"type"=>"enum", "options"=>["open", "closed", "none", "all"], "default"=>"open", "description"=>"Whether to expand wildcard expression to concrete indices that are open, closed or both."},
2452
+ "lenient" => {"type"=>"boolean", "description"=>"Specify whether format-based query failures (such as providing text to a numeric field) should be ignored"},
2453
+ "pipeline" => {"type"=>"string", "description"=>"Ingest pipeline to set on index requests made by this action. (default: none)"},
2454
+ "preference" => {"type"=>"string", "description"=>"Specify the node or shard the operation should be performed on (default: random)"},
2455
+ "q" => {"type"=>"string", "description"=>"Query in the Lucene query string syntax"},
2456
+ "routing" => {"type"=>"list", "description"=>"A comma-separated list of specific routing values"},
2457
+ "scroll" => {"type"=>"time", "description"=>"Specify how long a consistent view of the index should be maintained for scrolled search"},
2458
+ "search_type" => {"type"=>"enum", "options"=>["query_then_fetch", "dfs_query_then_fetch"], "description"=>"Search operation type"},
2459
+ "search_timeout" => {"type"=>"time", "description"=>"Explicit timeout for each search request. Defaults to no timeout."},
2460
+ "size" => {"type"=>"number", "description"=>"Number of hits to return (default: 10)"},
2461
+ "sort" => {"type"=>"list", "description"=>"A comma-separated list of <field>:<direction> pairs"},
2462
+ "_source" => {"type"=>"list", "description"=>"True or false to return the _source field or not, or a list of fields to return"},
2463
+ "_source_exclude" => {"type"=>"list", "description"=>"A list of fields to exclude from the returned _source field"},
2464
+ "_source_include" => {"type"=>"list", "description"=>"A list of fields to extract and return from the _source field"},
2465
+ "terminate_after" => {"type"=>"number", "description"=>"The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early."},
2466
+ "stats" => {"type"=>"list", "description"=>"Specific 'tag' of the request for logging and statistical purposes"},
2467
+ "version" => {"type"=>"boolean", "description"=>"Specify whether to return document version as part of a hit"},
2468
+ "version_type" => {"type"=>"boolean", "description"=>"Should the document increment the version number (internal) on hit or not (reindex)"},
2469
+ "request_cache" => {"type"=>"boolean", "description"=>"Specify if request cache should be used for this request or not, defaults to index level setting"},
2470
+ "refresh" => {"type"=>"boolean", "description"=>"Should the effected indexes be refreshed?"},
2471
+ "timeout" => {"type"=>"time", "default"=>"1m", "description"=>"Time each individual bulk request should wait for shards that are unavailable."},
2472
+ "wait_for_active_shards" => {"type"=>"string", "description"=>"Sets the number of shard copies that must be active before proceeding with the update by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)"},
2473
+ "scroll_size" => {"type"=>"number", "defaut_value"=>100, "description"=>"Size on the scroll request powering the update_by_query"},
2474
+ "wait_for_completion" => {"type"=>"boolean", "default"=>true, "description"=>"Should the request should block until the update by query operation is complete."},
2475
+ "requests_per_second" => {"type"=>"number", "default"=>0, "description"=>"The throttle to set on this request in sub-requests per second. -1 means no throttle."},
2476
+ "slices" => {"type"=>"number", "default"=>1, "description"=>"The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks."},
2477
+ }
2478
+ }
2479
+ ),
2480
+ }
2481
+ @common_params = {
2482
+ "pretty" => {"type"=>"boolean", "description"=>"Pretty format the returned JSON response.", "default"=>false},
2483
+ "human" => {"type"=>"boolean", "description"=>"Return human readable values for statistics.", "default"=>true},
2484
+ "error_trace" => {"type"=>"boolean", "description"=>"Include the stack trace of returned errors.", "default"=>false},
2485
+ "source" => {"type"=>"string", "description"=>"The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."},
2486
+ "filter_path" => {"type"=>"list", "description"=>"A comma-separated list of filters used to reduce the respone."},
2487
+ }
2488
+ super
2489
+ end
2490
+ end
2491
+ end