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