@opensearch-project/opensearch 2.11.0 → 3.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (768) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/api/_core/bulk.js +58 -0
  3. package/api/_core/clear_scroll.js +48 -0
  4. package/api/_core/count.js +62 -0
  5. package/api/_core/create.js +61 -0
  6. package/api/_core/create_pit.js +53 -0
  7. package/api/_core/delete.js +59 -0
  8. package/api/_core/delete_all_pits.js +44 -0
  9. package/api/_core/delete_by_query.js +82 -0
  10. package/api/_core/delete_by_query_rethrottle.js +49 -0
  11. package/api/_core/delete_pit.js +46 -0
  12. package/api/_core/delete_script.js +51 -0
  13. package/api/_core/exists.js +61 -0
  14. package/api/_core/exists_source.js +60 -0
  15. package/api/_core/explain.js +64 -0
  16. package/api/_core/field_caps.js +53 -0
  17. package/api/_core/get.js +61 -0
  18. package/api/_core/get_all_pits.js +44 -0
  19. package/api/_core/get_script.js +50 -0
  20. package/api/_core/get_script_context.js +44 -0
  21. package/api/_core/get_script_languages.js +44 -0
  22. package/api/_core/get_source.js +60 -0
  23. package/api/_core/index.js +62 -0
  24. package/api/_core/info.js +44 -0
  25. package/api/_core/mget.js +56 -0
  26. package/api/_core/msearch.js +55 -0
  27. package/api/_core/msearch_template.js +53 -0
  28. package/api/_core/mtermvectors.js +60 -0
  29. package/api/_core/ping.js +44 -0
  30. package/api/_core/put_script.js +54 -0
  31. package/api/_core/rank_eval.js +52 -0
  32. package/api/_core/reindex.js +56 -0
  33. package/api/_core/reindex_rethrottle.js +49 -0
  34. package/api/_core/render_search_template.js +48 -0
  35. package/api/_core/scripts_painless_execute.js +46 -0
  36. package/api/_core/scroll.js +50 -0
  37. package/api/_core/search.js +94 -0
  38. package/api/_core/search_shards.js +53 -0
  39. package/api/_core/search_template.js +61 -0
  40. package/api/_core/termvectors.js +62 -0
  41. package/api/_core/update.js +64 -0
  42. package/api/_core/update_by_query.js +84 -0
  43. package/api/_core/update_by_query_rethrottle.js +49 -0
  44. package/api/cat/_api.js +50 -0
  45. package/api/cat/aliases.js +54 -0
  46. package/api/cat/all_pit_segments.js +51 -0
  47. package/api/cat/allocation.js +56 -0
  48. package/api/cat/cluster_manager.js +53 -0
  49. package/api/cat/count.js +52 -0
  50. package/api/cat/fielddata.js +53 -0
  51. package/api/cat/health.js +52 -0
  52. package/api/cat/help.js +44 -0
  53. package/api/cat/indices.js +61 -0
  54. package/api/cat/master.js +53 -0
  55. package/api/cat/nodeattrs.js +53 -0
  56. package/api/cat/nodes.js +56 -0
  57. package/api/cat/pending_tasks.js +54 -0
  58. package/api/cat/pit_segments.js +52 -0
  59. package/api/cat/plugins.js +53 -0
  60. package/api/cat/recovery.js +56 -0
  61. package/api/cat/repositories.js +53 -0
  62. package/api/cat/segment_replication.js +63 -0
  63. package/api/cat/segments.js +55 -0
  64. package/api/cat/shards.js +57 -0
  65. package/api/cat/snapshots.js +56 -0
  66. package/api/cat/tasks.js +55 -0
  67. package/api/cat/templates.js +55 -0
  68. package/api/cat/thread_pool.js +57 -0
  69. package/api/cluster/_api.js +47 -0
  70. package/api/cluster/allocation_explain.js +48 -0
  71. package/api/cluster/delete_component_template.js +51 -0
  72. package/api/cluster/delete_decommission_awareness.js +44 -0
  73. package/api/cluster/delete_voting_config_exclusions.js +46 -0
  74. package/api/cluster/delete_weighted_routing.js +44 -0
  75. package/api/cluster/exists_component_template.js +51 -0
  76. package/api/cluster/get_component_template.js +50 -0
  77. package/api/cluster/get_decommission_awareness.js +48 -0
  78. package/api/cluster/get_settings.js +50 -0
  79. package/api/cluster/get_weighted_routing.js +48 -0
  80. package/api/cluster/health.js +60 -0
  81. package/api/cluster/pending_tasks.js +49 -0
  82. package/api/cluster/post_voting_config_exclusions.js +48 -0
  83. package/api/cluster/put_component_template.js +53 -0
  84. package/api/cluster/put_decommission_awareness.js +51 -0
  85. package/api/cluster/put_settings.js +50 -0
  86. package/api/cluster/put_weighted_routing.js +48 -0
  87. package/api/cluster/remote_info.js +44 -0
  88. package/api/cluster/reroute.js +53 -0
  89. package/api/cluster/state.js +58 -0
  90. package/api/cluster/stats.js +49 -0
  91. package/api/dangling_indices/_api.js +29 -0
  92. package/api/dangling_indices/delete_dangling_index.js +53 -0
  93. package/api/dangling_indices/import_dangling_index.js +53 -0
  94. package/api/dangling_indices/list_dangling_indices.js +44 -0
  95. package/api/http/_api.js +35 -0
  96. package/api/http/connect.js +48 -0
  97. package/api/http/delete.js +48 -0
  98. package/api/http/get.js +48 -0
  99. package/api/http/head.js +48 -0
  100. package/api/http/options.js +48 -0
  101. package/api/http/patch.js +48 -0
  102. package/api/http/post.js +48 -0
  103. package/api/http/put.js +48 -0
  104. package/api/http/trace.js +48 -0
  105. package/api/index.js +83 -393
  106. package/api/indices/_api.js +74 -0
  107. package/api/indices/add_block.js +57 -0
  108. package/api/indices/analyze.js +48 -0
  109. package/api/indices/clear_cache.js +55 -0
  110. package/api/indices/clone.js +58 -0
  111. package/api/indices/close.js +55 -0
  112. package/api/indices/create.js +53 -0
  113. package/api/indices/create_data_stream.js +49 -0
  114. package/api/indices/data_streams_stats.js +47 -0
  115. package/api/indices/delete.js +54 -0
  116. package/api/indices/delete_alias.js +54 -0
  117. package/api/indices/delete_data_stream.js +48 -0
  118. package/api/indices/delete_index_template.js +51 -0
  119. package/api/indices/delete_template.js +51 -0
  120. package/api/indices/exists.js +55 -0
  121. package/api/indices/exists_alias.js +54 -0
  122. package/api/indices/exists_index_template.js +52 -0
  123. package/api/indices/exists_template.js +52 -0
  124. package/api/indices/flush.js +52 -0
  125. package/api/indices/forcemerge.js +55 -0
  126. package/api/indices/get.js +56 -0
  127. package/api/indices/get_alias.js +53 -0
  128. package/api/indices/get_data_stream.js +47 -0
  129. package/api/indices/get_field_mapping.js +55 -0
  130. package/api/indices/get_index_template.js +51 -0
  131. package/api/indices/get_mapping.js +53 -0
  132. package/api/indices/get_settings.js +57 -0
  133. package/api/indices/get_template.js +51 -0
  134. package/api/indices/get_upgrade.js +50 -0
  135. package/api/indices/open.js +57 -0
  136. package/api/indices/put_alias.js +53 -0
  137. package/api/indices/put_index_template.js +53 -0
  138. package/api/indices/put_mapping.js +56 -0
  139. package/api/indices/put_settings.js +56 -0
  140. package/api/indices/put_template.js +53 -0
  141. package/api/indices/recovery.js +49 -0
  142. package/api/indices/refresh.js +50 -0
  143. package/api/indices/resolve_index.js +49 -0
  144. package/api/indices/rollover.js +57 -0
  145. package/api/indices/segments.js +51 -0
  146. package/api/indices/shard_stores.js +51 -0
  147. package/api/indices/shrink.js +59 -0
  148. package/api/indices/simulate_index_template.js +53 -0
  149. package/api/indices/simulate_template.js +52 -0
  150. package/api/indices/split.js +59 -0
  151. package/api/indices/stats.js +58 -0
  152. package/api/indices/update_aliases.js +49 -0
  153. package/api/indices/upgrade.js +52 -0
  154. package/api/indices/validate_query.js +60 -0
  155. package/api/ingest/_api.js +31 -0
  156. package/api/ingest/delete_pipeline.js +51 -0
  157. package/api/ingest/get_pipeline.js +49 -0
  158. package/api/ingest/processor_grok.js +44 -0
  159. package/api/ingest/put_pipeline.js +52 -0
  160. package/api/ingest/simulate.js +49 -0
  161. package/api/knn/_api.js +32 -0
  162. package/api/knn/delete_model.js +48 -0
  163. package/api/knn/get_model.js +48 -0
  164. package/api/knn/search_models.js +88 -0
  165. package/api/knn/stats.js +50 -0
  166. package/api/knn/train_model.js +49 -0
  167. package/api/knn/warmup.js +48 -0
  168. package/api/ml/_api.js +33 -0
  169. package/api/ml/delete_model.js +48 -0
  170. package/api/ml/delete_model_group.js +48 -0
  171. package/api/ml/get_model_group.js +48 -0
  172. package/api/ml/get_task.js +48 -0
  173. package/api/ml/register_model.js +46 -0
  174. package/api/ml/register_model_group.js +46 -0
  175. package/api/ml/search_models.js +46 -0
  176. package/api/nodes/_api.js +31 -0
  177. package/api/nodes/hot_threads.js +53 -0
  178. package/api/nodes/info.js +51 -0
  179. package/api/nodes/reload_secure_settings.js +49 -0
  180. package/api/nodes/stats.js +59 -0
  181. package/api/nodes/usage.js +50 -0
  182. package/api/notifications/_api.js +35 -0
  183. package/api/notifications/create_config.js +46 -0
  184. package/api/notifications/delete_config.js +48 -0
  185. package/api/notifications/delete_configs.js +48 -0
  186. package/api/notifications/get_config.js +48 -0
  187. package/api/notifications/get_configs.js +84 -0
  188. package/api/notifications/list_channels.js +44 -0
  189. package/api/notifications/list_features.js +44 -0
  190. package/api/notifications/send_test.js +48 -0
  191. package/api/notifications/update_config.js +49 -0
  192. package/api/ppl/_api.js +30 -0
  193. package/api/ppl/explain.js +48 -0
  194. package/api/ppl/get_stats.js +47 -0
  195. package/api/ppl/post_stats.js +48 -0
  196. package/api/ppl/query.js +48 -0
  197. package/api/remote_store/_api.js +27 -0
  198. package/api/remote_store/restore.js +48 -0
  199. package/api/rollups/_api.js +32 -0
  200. package/api/rollups/delete.js +48 -0
  201. package/api/rollups/explain.js +48 -0
  202. package/api/rollups/get.js +48 -0
  203. package/api/rollups/put.js +51 -0
  204. package/api/rollups/start.js +48 -0
  205. package/api/rollups/stop.js +48 -0
  206. package/api/search_pipeline/_api.js +29 -0
  207. package/api/search_pipeline/delete.js +50 -0
  208. package/api/search_pipeline/get.js +48 -0
  209. package/api/search_pipeline/put.js +51 -0
  210. package/api/security/_api.js +100 -0
  211. package/api/security/authinfo.js +47 -0
  212. package/api/security/authtoken.js +44 -0
  213. package/api/security/change_password.js +46 -0
  214. package/api/security/config_upgrade_check.js +44 -0
  215. package/api/security/config_upgrade_perform.js +46 -0
  216. package/api/security/create_action_group.js +49 -0
  217. package/api/security/create_allowlist.js +46 -0
  218. package/api/security/create_role.js +49 -0
  219. package/api/security/create_role_mapping.js +49 -0
  220. package/api/security/create_tenant.js +49 -0
  221. package/api/security/create_update_tenancy_config.js +46 -0
  222. package/api/security/create_user.js +49 -0
  223. package/api/security/create_user_legacy.js +49 -0
  224. package/api/security/delete_action_group.js +48 -0
  225. package/api/security/delete_distinguished_name.js +48 -0
  226. package/api/security/delete_role.js +48 -0
  227. package/api/security/delete_role_mapping.js +48 -0
  228. package/api/security/delete_tenant.js +48 -0
  229. package/api/security/delete_user.js +48 -0
  230. package/api/security/delete_user_legacy.js +48 -0
  231. package/api/security/flush_cache.js +44 -0
  232. package/api/security/generate_obo_token.js +46 -0
  233. package/api/security/generate_user_token.js +48 -0
  234. package/api/security/generate_user_token_legacy.js +48 -0
  235. package/api/security/get_account_details.js +44 -0
  236. package/api/security/get_action_group.js +48 -0
  237. package/api/security/get_action_groups.js +44 -0
  238. package/api/security/get_allowlist.js +44 -0
  239. package/api/security/get_audit_configuration.js +44 -0
  240. package/api/security/get_certificates.js +44 -0
  241. package/api/security/get_configuration.js +44 -0
  242. package/api/security/get_dashboards_info.js +44 -0
  243. package/api/security/get_distinguished_name.js +49 -0
  244. package/api/security/get_distinguished_names.js +46 -0
  245. package/api/security/get_permissions_info.js +44 -0
  246. package/api/security/get_role.js +48 -0
  247. package/api/security/get_role_mapping.js +48 -0
  248. package/api/security/get_role_mappings.js +44 -0
  249. package/api/security/get_roles.js +44 -0
  250. package/api/security/get_sslinfo.js +46 -0
  251. package/api/security/get_tenancy_config.js +44 -0
  252. package/api/security/get_tenant.js +48 -0
  253. package/api/security/get_tenants.js +44 -0
  254. package/api/security/get_user.js +48 -0
  255. package/api/security/get_user_legacy.js +48 -0
  256. package/api/security/get_users.js +44 -0
  257. package/api/security/get_users_legacy.js +44 -0
  258. package/api/security/health.js +46 -0
  259. package/api/security/migrate.js +44 -0
  260. package/api/security/patch_action_group.js +49 -0
  261. package/api/security/patch_action_groups.js +46 -0
  262. package/api/security/patch_allowlist.js +46 -0
  263. package/api/security/patch_audit_configuration.js +46 -0
  264. package/api/security/patch_configuration.js +46 -0
  265. package/api/security/patch_distinguished_name.js +49 -0
  266. package/api/security/patch_distinguished_names.js +46 -0
  267. package/api/security/patch_role.js +49 -0
  268. package/api/security/patch_role_mapping.js +49 -0
  269. package/api/security/patch_role_mappings.js +46 -0
  270. package/api/security/patch_roles.js +46 -0
  271. package/api/security/patch_tenant.js +49 -0
  272. package/api/security/patch_tenants.js +46 -0
  273. package/api/security/patch_user.js +49 -0
  274. package/api/security/patch_users.js +46 -0
  275. package/api/security/post_dashboards_info.js +46 -0
  276. package/api/security/reload_http_certificates.js +44 -0
  277. package/api/security/reload_transport_certificates.js +44 -0
  278. package/api/security/tenant_info.js +44 -0
  279. package/api/security/update_audit_configuration.js +46 -0
  280. package/api/security/update_configuration.js +46 -0
  281. package/api/security/update_distinguished_name.js +49 -0
  282. package/api/security/validate.js +46 -0
  283. package/api/security/who_am_i.js +44 -0
  284. package/api/security/who_am_i_protected.js +44 -0
  285. package/api/snapshot/_api.js +37 -0
  286. package/api/snapshot/cleanup_repository.js +51 -0
  287. package/api/snapshot/clone.js +57 -0
  288. package/api/snapshot/create.js +55 -0
  289. package/api/snapshot/create_repository.js +53 -0
  290. package/api/snapshot/delete.js +53 -0
  291. package/api/snapshot/delete_repository.js +51 -0
  292. package/api/snapshot/get.js +55 -0
  293. package/api/snapshot/get_repository.js +50 -0
  294. package/api/snapshot/restore.js +55 -0
  295. package/api/snapshot/status.js +52 -0
  296. package/api/snapshot/verify_repository.js +51 -0
  297. package/api/sql/_api.js +32 -0
  298. package/api/sql/close.js +48 -0
  299. package/api/sql/explain.js +48 -0
  300. package/api/sql/get_stats.js +47 -0
  301. package/api/sql/post_stats.js +48 -0
  302. package/api/sql/query.js +48 -0
  303. package/api/sql/settings.js +47 -0
  304. package/api/tasks/_api.js +29 -0
  305. package/api/tasks/cancel.js +51 -0
  306. package/api/tasks/get.js +50 -0
  307. package/api/tasks/list.js +52 -0
  308. package/api/transforms/_api.js +34 -0
  309. package/api/transforms/delete.js +48 -0
  310. package/api/transforms/explain.js +48 -0
  311. package/api/transforms/get.js +48 -0
  312. package/api/transforms/preview.js +44 -0
  313. package/api/transforms/put.js +51 -0
  314. package/api/transforms/search.js +50 -0
  315. package/api/transforms/start.js +48 -0
  316. package/api/transforms/stop.js +48 -0
  317. package/api/utils.js +31 -24
  318. package/index.d.ts +3 -5789
  319. package/lib/Helpers.d.ts +23 -25
  320. package/lib/Transport.d.ts +4 -11
  321. package/lib/errors.d.ts +13 -31
  322. package/package.json +3 -9
  323. package/types/Client.d.ts +1717 -0
  324. package/types/client_options.d.ts +102 -0
  325. package/types/components/_common.aggregations.d.ts +1456 -0
  326. package/types/components/_common.analysis.d.ts +643 -0
  327. package/types/components/_common.d.ts +871 -0
  328. package/types/components/_common.mapping.d.ts +519 -0
  329. package/types/components/_common.query_dsl.d.ts +727 -0
  330. package/types/components/_core._common.d.ts +39 -0
  331. package/types/components/_core.bulk.d.ts +77 -0
  332. package/types/components/_core.explain.d.ts +28 -0
  333. package/types/components/_core.field_caps.d.ts +33 -0
  334. package/types/components/_core.get.d.ts +30 -0
  335. package/types/components/_core.get_script_context.d.ts +33 -0
  336. package/types/components/_core.get_script_languages.d.ts +22 -0
  337. package/types/components/_core.mget.d.ts +37 -0
  338. package/types/components/_core.msearch.d.ts +82 -0
  339. package/types/components/_core.msearch_template.d.ts +28 -0
  340. package/types/components/_core.mtermvectors.d.ts +44 -0
  341. package/types/components/_core.rank_eval.d.ts +92 -0
  342. package/types/components/_core.reindex.d.ts +47 -0
  343. package/types/components/_core.reindex_rethrottle.d.ts +50 -0
  344. package/types/components/_core.scripts_painless_execute.d.ts +24 -0
  345. package/types/components/_core.search.d.ts +382 -0
  346. package/types/components/_core.search_shards.d.ts +23 -0
  347. package/types/components/_core.termvectors.d.ts +52 -0
  348. package/types/components/_core.update.d.ts +21 -0
  349. package/types/components/_core.update_by_query_rethrottle.d.ts +22 -0
  350. package/types/components/_global.d.ts +24 -0
  351. package/types/components/cat._common.d.ts +61 -0
  352. package/types/components/cat.aliases.d.ts +26 -0
  353. package/types/components/cat.allocation.d.ts +29 -0
  354. package/types/components/cat.cluster_manager.d.ts +23 -0
  355. package/types/components/cat.count.d.ts +23 -0
  356. package/types/components/cat.fielddata.d.ts +25 -0
  357. package/types/components/cat.health.d.ts +36 -0
  358. package/types/components/cat.indices.d.ts +160 -0
  359. package/types/components/cat.master.d.ts +23 -0
  360. package/types/components/cat.nodeattrs.d.ts +27 -0
  361. package/types/components/cat.nodes.d.ts +118 -0
  362. package/types/components/cat.pending_tasks.d.ts +23 -0
  363. package/types/components/cat.plugins.d.ts +26 -0
  364. package/types/components/cat.recovery.d.ts +46 -0
  365. package/types/components/cat.repositories.d.ts +21 -0
  366. package/types/components/cat.segments.d.ts +35 -0
  367. package/types/components/cat.shards.d.ts +95 -0
  368. package/types/components/cat.snapshots.d.ts +33 -0
  369. package/types/components/cat.tasks.d.ts +36 -0
  370. package/types/components/cat.templates.d.ts +25 -0
  371. package/types/components/cat.thread_pool.d.ts +40 -0
  372. package/types/components/cluster._common.d.ts +39 -0
  373. package/types/components/cluster.allocation_explain.d.ts +97 -0
  374. package/types/components/cluster.health.d.ts +60 -0
  375. package/types/components/cluster.pending_tasks.d.ts +26 -0
  376. package/types/components/cluster.remote_info.d.ts +40 -0
  377. package/types/components/cluster.reroute.d.ts +73 -0
  378. package/types/components/cluster.state.d.ts +18 -0
  379. package/types/components/cluster.stats.d.ts +267 -0
  380. package/types/components/dangling_indices.list_dangling_indices.d.ts +25 -0
  381. package/types/components/indices._common.d.ts +499 -0
  382. package/types/components/indices.add_block.d.ts +24 -0
  383. package/types/components/indices.analyze.d.ts +62 -0
  384. package/types/components/indices.close.d.ts +26 -0
  385. package/types/components/indices.data_streams_stats.d.ts +25 -0
  386. package/types/components/indices.get_alias.d.ts +21 -0
  387. package/types/components/indices.get_field_mapping.d.ts +21 -0
  388. package/types/components/indices.get_index_template.d.ts +23 -0
  389. package/types/components/indices.get_mapping.d.ts +22 -0
  390. package/types/components/indices.put_index_template.d.ts +25 -0
  391. package/types/components/indices.recovery.d.ts +116 -0
  392. package/types/components/indices.resolve_index.d.ts +35 -0
  393. package/types/components/indices.rollover.d.ts +35 -0
  394. package/types/components/indices.segments.d.ts +46 -0
  395. package/types/components/indices.shard_stores.d.ts +40 -0
  396. package/types/components/indices.simulate_template.d.ts +30 -0
  397. package/types/components/indices.stats.d.ts +149 -0
  398. package/types/components/indices.update_aliases.d.ts +52 -0
  399. package/types/components/indices.validate_query.d.ts +24 -0
  400. package/types/components/ingest._common.d.ts +338 -0
  401. package/types/components/ingest.simulate.d.ts +46 -0
  402. package/types/components/knn._common.d.ts +22 -0
  403. package/types/components/ml._common.d.ts +67 -0
  404. package/types/components/nodes._common.d.ts +611 -0
  405. package/types/components/nodes.info.d.ts +338 -0
  406. package/types/components/nodes.reload_secure_settings.d.ts +23 -0
  407. package/types/components/nodes.stats.d.ts +27 -0
  408. package/types/components/nodes.usage.d.ts +32 -0
  409. package/types/components/notifications._common.d.ts +156 -0
  410. package/types/components/remote_store._common.d.ts +28 -0
  411. package/types/components/rollups._common.d.ts +124 -0
  412. package/types/components/search_pipeline._common.d.ts +151 -0
  413. package/types/components/security._common.d.ts +334 -0
  414. package/types/components/snapshot._common.d.ts +134 -0
  415. package/types/components/snapshot.cleanup_repository.d.ts +21 -0
  416. package/types/components/snapshot.get.d.ts +24 -0
  417. package/types/components/snapshot.restore.d.ts +23 -0
  418. package/types/components/snapshot.verify_repository.d.ts +21 -0
  419. package/types/components/sql._common.d.ts +117 -0
  420. package/types/components/tasks._common.d.ts +58 -0
  421. package/types/components/transforms._common.d.ts +130 -0
  422. package/types/functions/bulk.d.ts +48 -0
  423. package/types/functions/cat.aliases.d.ts +36 -0
  424. package/types/functions/cat.all_pit_segments.d.ts +34 -0
  425. package/types/functions/cat.allocation.d.ts +38 -0
  426. package/types/functions/cat.cluster_manager.d.ts +36 -0
  427. package/types/functions/cat.count.d.ts +34 -0
  428. package/types/functions/cat.fielddata.d.ts +35 -0
  429. package/types/functions/cat.health.d.ts +35 -0
  430. package/types/functions/cat.help.d.ts +25 -0
  431. package/types/functions/cat.indices.d.ts +43 -0
  432. package/types/functions/cat.master.d.ts +36 -0
  433. package/types/functions/cat.nodeattrs.d.ts +36 -0
  434. package/types/functions/cat.nodes.d.ts +39 -0
  435. package/types/functions/cat.pending_tasks.d.ts +37 -0
  436. package/types/functions/cat.pit_segments.d.ts +39 -0
  437. package/types/functions/cat.plugins.d.ts +36 -0
  438. package/types/functions/cat.recovery.d.ts +38 -0
  439. package/types/functions/cat.repositories.d.ts +36 -0
  440. package/types/functions/cat.segment_replication.d.ts +45 -0
  441. package/types/functions/cat.segments.d.ts +37 -0
  442. package/types/functions/cat.shards.d.ts +39 -0
  443. package/types/functions/cat.snapshots.d.ts +38 -0
  444. package/types/functions/cat.tasks.d.ts +38 -0
  445. package/types/functions/cat.templates.d.ts +37 -0
  446. package/types/functions/cat.thread_pool.d.ts +38 -0
  447. package/types/functions/clear_scroll.d.ts +36 -0
  448. package/types/functions/cluster.allocation_explain.d.ts +64 -0
  449. package/types/functions/cluster.delete_component_template.d.ts +31 -0
  450. package/types/functions/cluster.delete_decommission_awareness.d.ts +25 -0
  451. package/types/functions/cluster.delete_voting_config_exclusions.d.ts +27 -0
  452. package/types/functions/cluster.delete_weighted_routing.d.ts +25 -0
  453. package/types/functions/cluster.exists_component_template.d.ts +31 -0
  454. package/types/functions/cluster.get_component_template.d.ts +34 -0
  455. package/types/functions/cluster.get_decommission_awareness.d.ts +27 -0
  456. package/types/functions/cluster.get_settings.d.ts +36 -0
  457. package/types/functions/cluster.get_weighted_routing.d.ts +27 -0
  458. package/types/functions/cluster.health.d.ts +42 -0
  459. package/types/functions/cluster.pending_tasks.d.ts +33 -0
  460. package/types/functions/cluster.post_voting_config_exclusions.d.ts +30 -0
  461. package/types/functions/cluster.put_component_template.d.ts +41 -0
  462. package/types/functions/cluster.put_decommission_awareness.d.ts +28 -0
  463. package/types/functions/cluster.put_settings.d.ts +45 -0
  464. package/types/functions/cluster.put_weighted_routing.d.ts +27 -0
  465. package/types/functions/cluster.remote_info.d.ts +26 -0
  466. package/types/functions/cluster.reroute.d.ts +44 -0
  467. package/types/functions/cluster.state.d.ts +39 -0
  468. package/types/functions/cluster.stats.d.ts +31 -0
  469. package/types/functions/count.d.ts +51 -0
  470. package/types/functions/create.d.ts +39 -0
  471. package/types/functions/create_pit.d.ts +38 -0
  472. package/types/functions/dangling_indices.delete_dangling_index.d.ts +32 -0
  473. package/types/functions/dangling_indices.import_dangling_index.d.ts +32 -0
  474. package/types/functions/dangling_indices.list_dangling_indices.d.ts +31 -0
  475. package/types/functions/delete.d.ts +37 -0
  476. package/types/functions/delete_all_pits.d.ts +28 -0
  477. package/types/functions/delete_by_query.d.ts +86 -0
  478. package/types/functions/delete_by_query_rethrottle.d.ts +30 -0
  479. package/types/functions/delete_pit.d.ts +34 -0
  480. package/types/functions/delete_script.d.ts +31 -0
  481. package/types/functions/exists.d.ts +40 -0
  482. package/types/functions/exists_source.d.ts +39 -0
  483. package/types/functions/explain.d.ts +55 -0
  484. package/types/functions/field_caps.d.ts +46 -0
  485. package/types/functions/get.d.ts +41 -0
  486. package/types/functions/get_all_pits.d.ts +28 -0
  487. package/types/functions/get_script.d.ts +34 -0
  488. package/types/functions/get_script_context.d.ts +28 -0
  489. package/types/functions/get_script_languages.d.ts +29 -0
  490. package/types/functions/get_source.d.ts +39 -0
  491. package/types/functions/index.d.ts +43 -0
  492. package/types/functions/indices.add_block.d.ts +40 -0
  493. package/types/functions/indices.analyze.d.ts +46 -0
  494. package/types/functions/indices.clear_cache.d.ts +36 -0
  495. package/types/functions/indices.clone.d.ts +46 -0
  496. package/types/functions/indices.close.d.ts +40 -0
  497. package/types/functions/indices.create.d.ts +45 -0
  498. package/types/functions/indices.create_data_stream.d.ts +31 -0
  499. package/types/functions/indices.data_streams_stats.d.ts +36 -0
  500. package/types/functions/indices.delete.d.ts +34 -0
  501. package/types/functions/indices.delete_alias.d.ts +32 -0
  502. package/types/functions/indices.delete_data_stream.d.ts +28 -0
  503. package/types/functions/indices.delete_index_template.d.ts +31 -0
  504. package/types/functions/indices.delete_template.d.ts +31 -0
  505. package/types/functions/indices.exists.d.ts +35 -0
  506. package/types/functions/indices.exists_alias.d.ts +33 -0
  507. package/types/functions/indices.exists_index_template.d.ts +32 -0
  508. package/types/functions/indices.exists_template.d.ts +32 -0
  509. package/types/functions/indices.flush.d.ts +33 -0
  510. package/types/functions/indices.forcemerge.d.ts +38 -0
  511. package/types/functions/indices.get.d.ts +37 -0
  512. package/types/functions/indices.get_alias.d.ts +34 -0
  513. package/types/functions/indices.get_data_stream.d.ts +31 -0
  514. package/types/functions/indices.get_field_mapping.d.ts +35 -0
  515. package/types/functions/indices.get_index_template.d.ts +35 -0
  516. package/types/functions/indices.get_mapping.d.ts +35 -0
  517. package/types/functions/indices.get_settings.d.ts +38 -0
  518. package/types/functions/indices.get_template.d.ts +33 -0
  519. package/types/functions/indices.get_upgrade.d.ts +31 -0
  520. package/types/functions/indices.open.d.ts +42 -0
  521. package/types/functions/indices.put_alias.d.ts +45 -0
  522. package/types/functions/indices.put_index_template.d.ts +45 -0
  523. package/types/functions/indices.put_mapping.d.ts +51 -0
  524. package/types/functions/indices.put_settings.d.ts +38 -0
  525. package/types/functions/indices.put_template.d.ts +44 -0
  526. package/types/functions/indices.recovery.d.ts +31 -0
  527. package/types/functions/indices.refresh.d.ts +31 -0
  528. package/types/functions/indices.resolve_index.d.ts +34 -0
  529. package/types/functions/indices.rollover.d.ts +53 -0
  530. package/types/functions/indices.segments.d.ts +36 -0
  531. package/types/functions/indices.shard_stores.d.ts +35 -0
  532. package/types/functions/indices.shrink.d.ts +47 -0
  533. package/types/functions/indices.simulate_index_template.d.ts +46 -0
  534. package/types/functions/indices.simulate_template.d.ts +38 -0
  535. package/types/functions/indices.split.d.ts +48 -0
  536. package/types/functions/indices.stats.d.ts +43 -0
  537. package/types/functions/indices.update_aliases.d.ts +36 -0
  538. package/types/functions/indices.upgrade.d.ts +33 -0
  539. package/types/functions/indices.validate_query.d.ts +52 -0
  540. package/types/functions/info.d.ts +32 -0
  541. package/types/functions/ingest.delete_pipeline.d.ts +31 -0
  542. package/types/functions/ingest.get_pipeline.d.ts +31 -0
  543. package/types/functions/ingest.processor_grok.d.ts +27 -0
  544. package/types/functions/ingest.put_pipeline.d.ts +41 -0
  545. package/types/functions/ingest.simulate.d.ts +39 -0
  546. package/types/functions/knn.delete_model.d.ts +27 -0
  547. package/types/functions/knn.get_model.d.ts +27 -0
  548. package/types/functions/knn.search_models.d.ts +73 -0
  549. package/types/functions/knn.stats.d.ts +30 -0
  550. package/types/functions/knn.train_model.d.ts +39 -0
  551. package/types/functions/knn.warmup.d.ts +27 -0
  552. package/types/functions/mget.d.ts +46 -0
  553. package/types/functions/ml.delete_model.d.ts +28 -0
  554. package/types/functions/ml.delete_model_group.d.ts +28 -0
  555. package/types/functions/ml.get_model_group.d.ts +28 -0
  556. package/types/functions/ml.get_task.d.ts +28 -0
  557. package/types/functions/ml.register_model.d.ts +36 -0
  558. package/types/functions/ml.register_model_group.d.ts +36 -0
  559. package/types/functions/ml.search_models.d.ts +28 -0
  560. package/types/functions/msearch.d.ts +39 -0
  561. package/types/functions/msearch_template.d.ts +38 -0
  562. package/types/functions/mtermvectors.d.ts +49 -0
  563. package/types/functions/nodes.hot_threads.d.ts +35 -0
  564. package/types/functions/nodes.info.d.ts +32 -0
  565. package/types/functions/nodes.reload_secure_settings.d.ts +35 -0
  566. package/types/functions/nodes.stats.d.ts +39 -0
  567. package/types/functions/nodes.usage.d.ts +31 -0
  568. package/types/functions/notifications.create_config.d.ts +30 -0
  569. package/types/functions/notifications.delete_config.d.ts +28 -0
  570. package/types/functions/notifications.delete_configs.d.ts +29 -0
  571. package/types/functions/notifications.get_config.d.ts +28 -0
  572. package/types/functions/notifications.get_configs.d.ts +74 -0
  573. package/types/functions/notifications.list_channels.d.ts +31 -0
  574. package/types/functions/notifications.list_features.d.ts +29 -0
  575. package/types/functions/notifications.send_test.d.ts +31 -0
  576. package/types/functions/notifications.update_config.d.ts +31 -0
  577. package/types/functions/ping.d.ts +25 -0
  578. package/types/functions/ppl.explain.d.ts +30 -0
  579. package/types/functions/ppl.get_stats.d.ts +28 -0
  580. package/types/functions/ppl.post_stats.d.ts +30 -0
  581. package/types/functions/ppl.query.d.ts +30 -0
  582. package/types/functions/put_script.d.ts +37 -0
  583. package/types/functions/rank_eval.d.ts +43 -0
  584. package/types/functions/reindex.d.ts +63 -0
  585. package/types/functions/reindex_rethrottle.d.ts +32 -0
  586. package/types/functions/remote_store.restore.d.ts +38 -0
  587. package/types/functions/render_search_template.d.ts +37 -0
  588. package/types/functions/rollups.delete.d.ts +28 -0
  589. package/types/functions/rollups.explain.d.ts +29 -0
  590. package/types/functions/rollups.get.d.ts +29 -0
  591. package/types/functions/rollups.put.d.ts +32 -0
  592. package/types/functions/rollups.start.d.ts +28 -0
  593. package/types/functions/rollups.stop.d.ts +28 -0
  594. package/types/functions/scripts_painless_execute.d.ts +37 -0
  595. package/types/functions/scroll.d.ts +37 -0
  596. package/types/functions/search.d.ts +115 -0
  597. package/types/functions/search_pipeline.delete.d.ts +32 -0
  598. package/types/functions/search_pipeline.get.d.ts +30 -0
  599. package/types/functions/search_pipeline.put.d.ts +34 -0
  600. package/types/functions/search_shards.d.ts +39 -0
  601. package/types/functions/search_template.d.ts +67 -0
  602. package/types/functions/security.authinfo.d.ts +29 -0
  603. package/types/functions/security.authtoken.d.ts +26 -0
  604. package/types/functions/security.change_password.d.ts +28 -0
  605. package/types/functions/security.config_upgrade_check.d.ts +26 -0
  606. package/types/functions/security.config_upgrade_perform.d.ts +28 -0
  607. package/types/functions/security.create_action_group.d.ts +29 -0
  608. package/types/functions/security.create_allowlist.d.ts +28 -0
  609. package/types/functions/security.create_role.d.ts +29 -0
  610. package/types/functions/security.create_role_mapping.d.ts +29 -0
  611. package/types/functions/security.create_tenant.d.ts +29 -0
  612. package/types/functions/security.create_update_tenancy_config.d.ts +30 -0
  613. package/types/functions/security.create_user.d.ts +29 -0
  614. package/types/functions/security.create_user_legacy.d.ts +29 -0
  615. package/types/functions/security.delete_action_group.d.ts +28 -0
  616. package/types/functions/security.delete_distinguished_name.d.ts +28 -0
  617. package/types/functions/security.delete_role.d.ts +28 -0
  618. package/types/functions/security.delete_role_mapping.d.ts +28 -0
  619. package/types/functions/security.delete_tenant.d.ts +28 -0
  620. package/types/functions/security.delete_user.d.ts +28 -0
  621. package/types/functions/security.delete_user_legacy.d.ts +28 -0
  622. package/types/functions/security.flush_cache.d.ts +26 -0
  623. package/types/functions/security.generate_obo_token.d.ts +28 -0
  624. package/types/functions/security.generate_user_token.d.ts +28 -0
  625. package/types/functions/security.generate_user_token_legacy.d.ts +28 -0
  626. package/types/functions/security.get_account_details.d.ts +26 -0
  627. package/types/functions/security.get_action_group.d.ts +28 -0
  628. package/types/functions/security.get_action_groups.d.ts +26 -0
  629. package/types/functions/security.get_allowlist.d.ts +26 -0
  630. package/types/functions/security.get_audit_configuration.d.ts +26 -0
  631. package/types/functions/security.get_certificates.d.ts +26 -0
  632. package/types/functions/security.get_configuration.d.ts +26 -0
  633. package/types/functions/security.get_dashboards_info.d.ts +26 -0
  634. package/types/functions/security.get_distinguished_name.d.ts +29 -0
  635. package/types/functions/security.get_distinguished_names.d.ts +28 -0
  636. package/types/functions/security.get_permissions_info.d.ts +26 -0
  637. package/types/functions/security.get_role.d.ts +28 -0
  638. package/types/functions/security.get_role_mapping.d.ts +28 -0
  639. package/types/functions/security.get_role_mappings.d.ts +26 -0
  640. package/types/functions/security.get_roles.d.ts +26 -0
  641. package/types/functions/security.get_sslinfo.d.ts +28 -0
  642. package/types/functions/security.get_tenancy_config.d.ts +26 -0
  643. package/types/functions/security.get_tenant.d.ts +28 -0
  644. package/types/functions/security.get_tenants.d.ts +26 -0
  645. package/types/functions/security.get_user.d.ts +28 -0
  646. package/types/functions/security.get_user_legacy.d.ts +28 -0
  647. package/types/functions/security.get_users.d.ts +26 -0
  648. package/types/functions/security.get_users_legacy.d.ts +26 -0
  649. package/types/functions/security.health.d.ts +28 -0
  650. package/types/functions/security.migrate.d.ts +26 -0
  651. package/types/functions/security.patch_action_group.d.ts +31 -0
  652. package/types/functions/security.patch_action_groups.d.ts +30 -0
  653. package/types/functions/security.patch_allowlist.d.ts +30 -0
  654. package/types/functions/security.patch_audit_configuration.d.ts +30 -0
  655. package/types/functions/security.patch_configuration.d.ts +30 -0
  656. package/types/functions/security.patch_distinguished_name.d.ts +29 -0
  657. package/types/functions/security.patch_distinguished_names.d.ts +30 -0
  658. package/types/functions/security.patch_role.d.ts +31 -0
  659. package/types/functions/security.patch_role_mapping.d.ts +31 -0
  660. package/types/functions/security.patch_role_mappings.d.ts +30 -0
  661. package/types/functions/security.patch_roles.d.ts +30 -0
  662. package/types/functions/security.patch_tenant.d.ts +31 -0
  663. package/types/functions/security.patch_tenants.d.ts +30 -0
  664. package/types/functions/security.patch_user.d.ts +31 -0
  665. package/types/functions/security.patch_users.d.ts +30 -0
  666. package/types/functions/security.post_dashboards_info.d.ts +28 -0
  667. package/types/functions/security.reload_http_certificates.d.ts +26 -0
  668. package/types/functions/security.reload_transport_certificates.d.ts +26 -0
  669. package/types/functions/security.tenant_info.d.ts +26 -0
  670. package/types/functions/security.update_audit_configuration.d.ts +28 -0
  671. package/types/functions/security.update_configuration.d.ts +28 -0
  672. package/types/functions/security.update_distinguished_name.d.ts +29 -0
  673. package/types/functions/security.validate.d.ts +28 -0
  674. package/types/functions/security.who_am_i.d.ts +26 -0
  675. package/types/functions/security.who_am_i_protected.d.ts +26 -0
  676. package/types/functions/snapshot.cleanup_repository.d.ts +34 -0
  677. package/types/functions/snapshot.clone.d.ts +37 -0
  678. package/types/functions/snapshot.create.d.ts +46 -0
  679. package/types/functions/snapshot.create_repository.d.ts +40 -0
  680. package/types/functions/snapshot.delete.d.ts +31 -0
  681. package/types/functions/snapshot.delete_repository.d.ts +31 -0
  682. package/types/functions/snapshot.get.d.ts +40 -0
  683. package/types/functions/snapshot.get_repository.d.ts +32 -0
  684. package/types/functions/snapshot.restore.d.ts +50 -0
  685. package/types/functions/snapshot.status.d.ts +35 -0
  686. package/types/functions/snapshot.verify_repository.d.ts +34 -0
  687. package/types/functions/sql.close.d.ts +30 -0
  688. package/types/functions/sql.explain.d.ts +30 -0
  689. package/types/functions/sql.get_stats.d.ts +28 -0
  690. package/types/functions/sql.post_stats.d.ts +30 -0
  691. package/types/functions/sql.query.d.ts +30 -0
  692. package/types/functions/sql.settings.d.ts +31 -0
  693. package/types/functions/tasks.cancel.d.ts +33 -0
  694. package/types/functions/tasks.get.d.ts +36 -0
  695. package/types/functions/tasks.list.d.ts +35 -0
  696. package/types/functions/termvectors.d.ts +55 -0
  697. package/types/functions/transforms.delete.d.ts +28 -0
  698. package/types/functions/transforms.explain.d.ts +29 -0
  699. package/types/functions/transforms.get.d.ts +29 -0
  700. package/types/functions/transforms.preview.d.ts +26 -0
  701. package/types/functions/transforms.put.d.ts +32 -0
  702. package/types/functions/transforms.search.d.ts +32 -0
  703. package/types/functions/transforms.start.d.ts +28 -0
  704. package/types/functions/transforms.stop.d.ts +28 -0
  705. package/types/functions/update.d.ts +54 -0
  706. package/types/functions/update_by_query.d.ts +89 -0
  707. package/types/functions/update_by_query_rethrottle.d.ts +32 -0
  708. package/api/api/bulk.js +0 -130
  709. package/api/api/cat.js +0 -933
  710. package/api/api/clear_scroll.js +0 -79
  711. package/api/api/cluster.js +0 -814
  712. package/api/api/count.js +0 -133
  713. package/api/api/create.js +0 -131
  714. package/api/api/create_pit.js +0 -88
  715. package/api/api/dangling_indices.js +0 -214
  716. package/api/api/delete.js +0 -125
  717. package/api/api/delete_all_pits.js +0 -53
  718. package/api/api/delete_by_query.js +0 -192
  719. package/api/api/delete_by_query_rethrottle.js +0 -98
  720. package/api/api/delete_pit.js +0 -61
  721. package/api/api/delete_script.js +0 -94
  722. package/api/api/exists.js +0 -133
  723. package/api/api/exists_source.js +0 -142
  724. package/api/api/explain.js +0 -140
  725. package/api/api/features.js +0 -136
  726. package/api/api/field_caps.js +0 -102
  727. package/api/api/get.js +0 -133
  728. package/api/api/get_all_pits.js +0 -53
  729. package/api/api/get_script.js +0 -95
  730. package/api/api/get_script_context.js +0 -71
  731. package/api/api/get_script_languages.js +0 -71
  732. package/api/api/get_source.js +0 -133
  733. package/api/api/http.js +0 -213
  734. package/api/api/index.js +0 -142
  735. package/api/api/indices.js +0 -2541
  736. package/api/api/info.js +0 -71
  737. package/api/api/ingest.js +0 -335
  738. package/api/api/mget.js +0 -128
  739. package/api/api/msearch.js +0 -125
  740. package/api/api/msearch_template.js +0 -126
  741. package/api/api/mtermvectors.js +0 -98
  742. package/api/api/nodes.js +0 -496
  743. package/api/api/ping.js +0 -71
  744. package/api/api/put_script.js +0 -113
  745. package/api/api/rank_eval.js +0 -107
  746. package/api/api/reindex.js +0 -109
  747. package/api/api/reindex_rethrottle.js +0 -97
  748. package/api/api/render_search_template.js +0 -79
  749. package/api/api/rollups.js +0 -249
  750. package/api/api/scripts_painless_execute.js +0 -73
  751. package/api/api/scroll.js +0 -96
  752. package/api/api/search.js +0 -221
  753. package/api/api/search_shards.js +0 -102
  754. package/api/api/search_template.js +0 -145
  755. package/api/api/security.js +0 -1954
  756. package/api/api/shutdown.js +0 -149
  757. package/api/api/snapshot.js +0 -782
  758. package/api/api/tasks.js +0 -193
  759. package/api/api/terms_enum.js +0 -67
  760. package/api/api/termvectors.js +0 -134
  761. package/api/api/transforms.js +0 -304
  762. package/api/api/update.js +0 -147
  763. package/api/api/update_by_query.js +0 -193
  764. package/api/api/update_by_query_rethrottle.js +0 -98
  765. package/api/new.d.ts +0 -3194
  766. package/api/opensearch_dashboards.d.ts +0 -278
  767. package/api/requestParams.d.ts +0 -1838
  768. package/api/types.d.ts +0 -10014
@@ -1,2541 +0,0 @@
1
- /*
2
- * Copyright OpenSearch Contributors
3
- * SPDX-License-Identifier: Apache-2.0
4
- *
5
- * The OpenSearch Contributors require contributions made to
6
- * this file be licensed under the Apache-2.0 license or a
7
- * compatible open source license.
8
- *
9
- */
10
-
11
- /*
12
- * Licensed to Elasticsearch B.V. under one or more contributor
13
- * license agreements. See the NOTICE file distributed with
14
- * this work for additional information regarding copyright
15
- * ownership. Elasticsearch B.V. licenses this file to you under
16
- * the Apache License, Version 2.0 (the "License"); you may
17
- * not use this file except in compliance with the License.
18
- * You may obtain a copy of the License at
19
- *
20
- * http://www.apache.org/licenses/LICENSE-2.0
21
- *
22
- * Unless required by applicable law or agreed to in writing,
23
- * software distributed under the License is distributed on an
24
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
25
- * KIND, either express or implied. See the License for the
26
- * specific language governing permissions and limitations
27
- * under the License.
28
- */
29
-
30
- 'use strict';
31
-
32
- /** @namespace API-Index */
33
-
34
- /* eslint camelcase: 0 */
35
- /* eslint no-unused-vars: 0 */
36
-
37
- const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
38
- const acceptedQuerystring = [
39
- 'cluster_manager_timeout',
40
- 'timeout',
41
- 'master_timeout',
42
- 'ignore_unavailable',
43
- 'allow_no_indices',
44
- 'expand_wildcards',
45
- 'pretty',
46
- 'human',
47
- 'error_trace',
48
- 'source',
49
- 'filter_path',
50
- 'index',
51
- 'fielddata',
52
- 'fields',
53
- 'query',
54
- 'request',
55
- 'wait_for_active_shards',
56
- 'run_expensive_tasks',
57
- 'flush',
58
- 'local',
59
- 'flat_settings',
60
- 'include_defaults',
61
- 'force',
62
- 'wait_if_ongoing',
63
- 'max_num_segments',
64
- 'only_expunge_deletes',
65
- 'create',
66
- 'cause',
67
- 'write_index_only',
68
- 'preserve_existing',
69
- 'order',
70
- 'detailed',
71
- 'active_only',
72
- 'dry_run',
73
- 'verbose',
74
- 'status',
75
- 'copy_settings',
76
- 'completion_fields',
77
- 'fielddata_fields',
78
- 'groups',
79
- 'level',
80
- 'types',
81
- 'include_segment_file_sizes',
82
- 'include_unloaded_segments',
83
- 'forbid_closed_indices',
84
- 'wait_for_completion',
85
- 'only_ancient_segments',
86
- 'explain',
87
- 'q',
88
- 'analyzer',
89
- 'analyze_wildcard',
90
- 'default_operator',
91
- 'df',
92
- 'lenient',
93
- 'rewrite',
94
- 'all_shards',
95
- ];
96
- const snakeCase = {
97
- clusterManagerTimeout: 'cluster_manager_timeout',
98
- masterTimeout: 'master_timeout',
99
- ignoreUnavailable: 'ignore_unavailable',
100
- allowNoIndices: 'allow_no_indices',
101
- expandWildcards: 'expand_wildcards',
102
- errorTrace: 'error_trace',
103
- filterPath: 'filter_path',
104
- waitForActiveShards: 'wait_for_active_shards',
105
- runExpensiveTasks: 'run_expensive_tasks',
106
- flatSettings: 'flat_settings',
107
- includeDefaults: 'include_defaults',
108
- waitIfOngoing: 'wait_if_ongoing',
109
- maxNumSegments: 'max_num_segments',
110
- onlyExpungeDeletes: 'only_expunge_deletes',
111
- writeIndexOnly: 'write_index_only',
112
- preserveExisting: 'preserve_existing',
113
- activeOnly: 'active_only',
114
- dryRun: 'dry_run',
115
- copySettings: 'copy_settings',
116
- completionFields: 'completion_fields',
117
- fielddataFields: 'fielddata_fields',
118
- includeSegmentFileSizes: 'include_segment_file_sizes',
119
- includeUnloadedSegments: 'include_unloaded_segments',
120
- forbidClosedIndices: 'forbid_closed_indices',
121
- waitForCompletion: 'wait_for_completion',
122
- onlyAncientSegments: 'only_ancient_segments',
123
- analyzeWildcard: 'analyze_wildcard',
124
- defaultOperator: 'default_operator',
125
- allShards: 'all_shards',
126
- };
127
-
128
- function IndicesApi(transport, ConfigurationError) {
129
- this.transport = transport;
130
- this[kConfigurationError] = ConfigurationError;
131
- }
132
-
133
- /**
134
- * Adds a block to an index.
135
- *
136
- * @memberOf API-Index
137
- *
138
- * @param {Object} params
139
- * @param {string} params.index - A comma separated list of indices to add a block to
140
- * @param {string} params.block - The block to add (one of read, write, read_only or metadata)
141
- * @param {string} [params.timeout] - Explicit operation timeout
142
- * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
143
- * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
144
- * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
145
- * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
146
- *
147
- * @param {Object} options - Options for {@link Transport#request}
148
- * @param {function} callback - Callback that handles errors and response
149
- *
150
- * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
151
- */
152
- IndicesApi.prototype.addBlock = function indicesAddBlockApi(params, options, callback) {
153
- [params, options, callback] = normalizeArguments(params, options, callback);
154
-
155
- // check required parameters
156
- if (params.index == null) {
157
- const err = new this[kConfigurationError]('Missing required parameter: index');
158
- return handleError(err, callback);
159
- }
160
- if (params.block == null) {
161
- const err = new this[kConfigurationError]('Missing required parameter: block');
162
- return handleError(err, callback);
163
- }
164
-
165
- // check required url components
166
- if (params.block != null && params.index == null) {
167
- const err = new this[kConfigurationError]('Missing required parameter of the url: index');
168
- return handleError(err, callback);
169
- }
170
-
171
- let { method, body, index, block, ...querystring } = params;
172
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
173
-
174
- let path = '';
175
- if (method == null) method = 'PUT';
176
- path = '/' + encodeURIComponent(index) + '/' + '_block' + '/' + encodeURIComponent(block);
177
-
178
- // build request object
179
- const request = {
180
- method,
181
- path,
182
- body: body || '',
183
- querystring,
184
- };
185
-
186
- return this.transport.request(request, options, callback);
187
- };
188
-
189
- /**
190
- * Performs the analysis process on a text and return the tokens breakdown of the text.
191
- * <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/analyze-apis/perform-text-analysis/ OpenSearch - Perform text analysis}
192
- *
193
- * @memberOf API-Index
194
- *
195
- * @param {Object} params
196
- * @param {string} [params.index] - The name of the index to scope the operation
197
- * @param {Object} [params.body] - Define analyzer/tokenizer parameters and the text on which the analysis should be performed
198
- *
199
- * @param {Object} options - Options for {@link Transport#request}
200
- * @param {function} callback - Callback that handles errors and response
201
- *
202
- * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
203
- */
204
- IndicesApi.prototype.analyze = function indicesAnalyzeApi(params, options, callback) {
205
- [params, options, callback] = normalizeArguments(params, options, callback);
206
-
207
- let { method, body, index, ...querystring } = params;
208
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
209
-
210
- let path = '';
211
- if (index != null) {
212
- if (method == null) method = body == null ? 'GET' : 'POST';
213
- path = '/' + encodeURIComponent(index) + '/' + '_analyze';
214
- } else {
215
- if (method == null) method = body == null ? 'GET' : 'POST';
216
- path = '/' + '_analyze';
217
- }
218
-
219
- // build request object
220
- const request = {
221
- method,
222
- path,
223
- body: body || '',
224
- querystring,
225
- };
226
-
227
- return this.transport.request(request, options, callback);
228
- };
229
-
230
- /**
231
- * Clears all or specific caches for one or more indices.
232
- * <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/index-apis/clear-index-cache/ OpenSearch - Clear index or data stream cache}
233
- *
234
- * @memberOf API-Index
235
- *
236
- * @param {Object} params
237
- * @param {string} [params.index] - A comma-separated list of index name to limit the operation
238
- * @param {boolean} [params.fielddata] - Clear field data
239
- * @param {string} [params.fields] - A comma-separated list of fields to clear when using the `fielddata` parameter (default: all)
240
- * @param {boolean} [params.query] - Clear query caches
241
- * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
242
- * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
243
- * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
244
- * @param {boolean} [params.request] - Clear request cache
245
- *
246
- * @param {Object} options - Options for {@link Transport#request}
247
- * @param {function} callback - Callback that handles errors and response
248
- *
249
- * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
250
- */
251
- IndicesApi.prototype.clearCache = function indicesClearCacheApi(params, options, callback) {
252
- [params, options, callback] = normalizeArguments(params, options, callback);
253
-
254
- let { method, body, index, ...querystring } = params;
255
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
256
-
257
- let path = '';
258
- if (index != null) {
259
- if (method == null) method = 'POST';
260
- path = '/' + encodeURIComponent(index) + '/' + '_cache' + '/' + 'clear';
261
- } else {
262
- if (method == null) method = 'POST';
263
- path = '/' + '_cache' + '/' + 'clear';
264
- }
265
-
266
- // build request object
267
- const request = {
268
- method,
269
- path,
270
- body: body || '',
271
- querystring,
272
- };
273
-
274
- return this.transport.request(request, options, callback);
275
- };
276
-
277
- /**
278
- * Clones an index
279
- * <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/index-apis/clone/ OpenSearch - Clone Index}
280
- *
281
- * @memberOf API-Index
282
- *
283
- * @param {Object} params
284
- * @param {string} params.index - The name of the source index to clone
285
- * @param {string} params.target - The name of the target index to clone into
286
- * @param {string} [params.timeout] - Explicit operation timeout
287
- * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
288
- * @param {string} [params.wait_for_active_shards] - Set the number of active shards to wait for on the cloned index before the operation returns.
289
- * @param {Object} [params.body] - The configuration for the target index (`settings` and `aliases`)
290
- *
291
- * @param {Object} options - Options for {@link Transport#request}
292
- * @param {function} callback - Callback that handles errors and response
293
- *
294
- * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
295
- */
296
- IndicesApi.prototype.clone = function indicesCloneApi(params, options, callback) {
297
- [params, options, callback] = normalizeArguments(params, options, callback);
298
-
299
- // check required parameters
300
- if (params.index == null) {
301
- const err = new this[kConfigurationError]('Missing required parameter: index');
302
- return handleError(err, callback);
303
- }
304
- if (params.target == null) {
305
- const err = new this[kConfigurationError]('Missing required parameter: target');
306
- return handleError(err, callback);
307
- }
308
-
309
- // check required url components
310
- if (params.target != null && params.index == null) {
311
- const err = new this[kConfigurationError]('Missing required parameter of the url: index');
312
- return handleError(err, callback);
313
- }
314
-
315
- let { method, body, index, target, ...querystring } = params;
316
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
317
-
318
- let path = '';
319
- if (method == null) method = 'PUT';
320
- path = '/' + encodeURIComponent(index) + '/' + '_clone' + '/' + encodeURIComponent(target);
321
-
322
- // build request object
323
- const request = {
324
- method,
325
- path,
326
- body: body || '',
327
- querystring,
328
- };
329
-
330
- return this.transport.request(request, options, callback);
331
- };
332
-
333
- /**
334
- * Closes an index.
335
- * <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/index-apis/close-index/ OpenSearch - Close Index}
336
- *
337
- * @memberOf API-Index
338
- *
339
- * @param {Object} params
340
- * @param {string} params.index - A comma separated list of indices to close
341
- * @param {string} [params.timeout] - Explicit operation timeout
342
- * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
343
- * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
344
- * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
345
- * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
346
- * @param {string} [params.wait_for_active_shards] - Sets the number of active shards to wait for before the operation returns. Set to `index-setting` to wait according to the index setting `index.write.wait_for_active_shards`, or `all` to wait for all shards, or an integer. Defaults to `0`.
347
- *
348
- * @param {Object} options - Options for {@link Transport#request}
349
- * @param {function} callback - Callback that handles errors and response
350
- *
351
- * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
352
- */
353
- IndicesApi.prototype.close = function indicesCloseApi(params, options, callback) {
354
- [params, options, callback] = normalizeArguments(params, options, callback);
355
-
356
- // check required parameters
357
- if (params.index == null) {
358
- const err = new this[kConfigurationError]('Missing required parameter: index');
359
- return handleError(err, callback);
360
- }
361
-
362
- let { method, body, index, ...querystring } = params;
363
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
364
-
365
- let path = '';
366
- if (method == null) method = 'POST';
367
- path = '/' + encodeURIComponent(index) + '/' + '_close';
368
-
369
- // build request object
370
- const request = {
371
- method,
372
- path,
373
- body: body || '',
374
- querystring,
375
- };
376
-
377
- return this.transport.request(request, options, callback);
378
- };
379
-
380
- /**
381
- * Creates an index
382
- * <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/index-apis/create-index/ OpenSearch - Create Index}
383
- *
384
- * @memberOf API-Index
385
- *
386
- * @param {Object} params
387
- * @param {string} params.index - Name of the index.
388
- * @param {Object} [params.body] - The configuration for the index (`settings` and `mappings`)
389
- * @param {string} [params.wait_for_active_shards] - Set the number of active shards to wait for before the operation returns.
390
- * @param {string} [params.timeout] - Explicit operation timeout
391
- * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
392
- *
393
- * @param {Object} options - Options for {@link Transport#request}
394
- * @param {function} callback - Callback that handles errors and response
395
- *
396
- * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
397
- */
398
- IndicesApi.prototype.create = function indicesCreateApi(params, options, callback) {
399
- [params, options, callback] = normalizeArguments(params, options, callback);
400
-
401
- // check required parameters
402
- if (params.index == null) {
403
- const err = new this[kConfigurationError]('Missing required parameter: index');
404
- return handleError(err, callback);
405
- }
406
-
407
- let { method, body, index, ...querystring } = params;
408
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
409
-
410
- let path = '';
411
- if (method == null) method = 'PUT';
412
- path = '/' + encodeURIComponent(index);
413
-
414
- // build request object
415
- const request = {
416
- method,
417
- path,
418
- body: body || '',
419
- querystring,
420
- };
421
-
422
- return this.transport.request(request, options, callback);
423
- };
424
-
425
- /**
426
- * Deletes an index.
427
- * <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/index-apis/delete-index/ OpenSearch - Delete Index}
428
- *
429
- * @memberOf API-Index
430
- *
431
- * @param {Object} params
432
- * @param {string} params.index - A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices
433
- * @param {string} [params.timeout] - Explicit operation timeout
434
- * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
435
- * @param {boolean} [params.ignore_unavailable=false] - Ignore unavailable indexes
436
- * @param {boolean} [params.allow_no_indices=false] - Ignore if a wildcard expression resolves to no concrete indices
437
- * @param {string} [params.expand_wildcards=open] - Whether wildcard expressions should get expanded to open or closed indices (options: open, closed, hidden, none, all)
438
- *
439
- * @param {Object} options - Options for {@link Transport#request}
440
- * @param {function} callback - Callback that handles errors and response
441
- *
442
- * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
443
- */
444
- IndicesApi.prototype.delete = function indicesDeleteApi(params, options, callback) {
445
- [params, options, callback] = normalizeArguments(params, options, callback);
446
-
447
- // check required parameters
448
- if (params.index == null) {
449
- const err = new this[kConfigurationError]('Missing required parameter: index');
450
- return handleError(err, callback);
451
- }
452
-
453
- let { method, body, index, ...querystring } = params;
454
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
455
-
456
- let path = '';
457
- if (method == null) method = 'DELETE';
458
- path = '/' + encodeURIComponent(index);
459
-
460
- // build request object
461
- const request = {
462
- method,
463
- path,
464
- body: body || '',
465
- querystring,
466
- };
467
-
468
- return this.transport.request(request, options, callback);
469
- };
470
-
471
- /**
472
- * Deletes an alias.
473
- * <br/> See Also: {@link https://opensearch.org/docs/latest/opensearch/index-alias/ OpenSearch - Index Aliases}
474
- *
475
- * @memberOf API-Index
476
- *
477
- * @param {Object} params
478
- * @param {string} params.index - A comma-separated list of index names (supports wildcards); use `_all` for all indices
479
- * @param {string} params.name - A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices.
480
- * @param {string} [params.timeout] - Explicit timestamp for the document
481
- * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
482
- *
483
- * @param {Object} options - Options for {@link Transport#request}
484
- * @param {function} callback - Callback that handles errors and response
485
- *
486
- * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
487
- */
488
- IndicesApi.prototype.deleteAlias = function indicesDeleteAliasApi(params, options, callback) {
489
- [params, options, callback] = normalizeArguments(params, options, callback);
490
-
491
- // check required parameters
492
- if (params.index == null) {
493
- const err = new this[kConfigurationError]('Missing required parameter: index');
494
- return handleError(err, callback);
495
- }
496
- if (params.name == null) {
497
- const err = new this[kConfigurationError]('Missing required parameter: name');
498
- return handleError(err, callback);
499
- }
500
-
501
- // check required url components
502
- if (params.name != null && params.index == null) {
503
- const err = new this[kConfigurationError]('Missing required parameter of the url: index');
504
- return handleError(err, callback);
505
- }
506
-
507
- let { method, body, index, name, ...querystring } = params;
508
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
509
-
510
- let path = '';
511
- if (index != null && name != null) {
512
- if (method == null) method = 'DELETE';
513
- path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name);
514
- } else {
515
- if (method == null) method = 'DELETE';
516
- path = '/' + encodeURIComponent(index) + '/' + '_aliases' + '/' + encodeURIComponent(name);
517
- }
518
-
519
- // build request object
520
- const request = {
521
- method,
522
- path,
523
- body: body || '',
524
- querystring,
525
- };
526
-
527
- return this.transport.request(request, options, callback);
528
- };
529
-
530
- /**
531
- * Deletes an index template.
532
- * <br/> See Also: {@link https://opensearch.org/docs/latest/opensearch/index-templates/ OpenSearch - Index Templates}
533
- *
534
- * @memberOf API-Index
535
- *
536
- * @param {Object} params
537
- * @param {string} params.name - The name of the template
538
- * @param {string} [params.timeout] - Explicit operation timeout
539
- * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
540
- *
541
- * @param {Object} options - Options for {@link Transport#request}
542
- * @param {function} callback - Callback that handles errors and response
543
- *
544
- * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
545
- */
546
- IndicesApi.prototype.deleteIndexTemplate = function indicesDeleteIndexTemplateApi(
547
- params,
548
- options,
549
- callback
550
- ) {
551
- [params, options, callback] = normalizeArguments(params, options, callback);
552
-
553
- // check required parameters
554
- if (params.name == null) {
555
- const err = new this[kConfigurationError]('Missing required parameter: name');
556
- return handleError(err, callback);
557
- }
558
-
559
- let { method, body, name, ...querystring } = params;
560
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
561
-
562
- let path = '';
563
- if (method == null) method = 'DELETE';
564
- path = '/' + '_index_template' + '/' + encodeURIComponent(name);
565
-
566
- // build request object
567
- const request = {
568
- method,
569
- path,
570
- body: body || '',
571
- querystring,
572
- };
573
-
574
- return this.transport.request(request, options, callback);
575
- };
576
-
577
- /**
578
- * Deletes an index template (Deprecated. Use IndicesApi#deleteIndexTemplate instead)
579
- *
580
- * @memberOf API-Index
581
- *
582
- * @param {Object} params
583
- * @param {string} params.name - The name of the template
584
- * @param {string} [params.timeout] - Explicit operation timeout
585
- * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
586
- *
587
- * @param {Object} options - Options for {@link Transport#request}
588
- * @param {function} callback - Callback that handles errors and response
589
- *
590
- * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
591
- */
592
- IndicesApi.prototype.deleteTemplate = function indicesDeleteTemplateApi(params, options, callback) {
593
- [params, options, callback] = normalizeArguments(params, options, callback);
594
-
595
- // check required parameters
596
- if (params.name == null) {
597
- const err = new this[kConfigurationError]('Missing required parameter: name');
598
- return handleError(err, callback);
599
- }
600
-
601
- let { method, body, name, ...querystring } = params;
602
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
603
-
604
- let path = '';
605
- if (method == null) method = 'DELETE';
606
- path = '/' + '_template' + '/' + encodeURIComponent(name);
607
-
608
- // build request object
609
- const request = {
610
- method,
611
- path,
612
- body: body || '',
613
- querystring,
614
- };
615
-
616
- return this.transport.request(request, options, callback);
617
- };
618
-
619
- // TODO: Remove. Experimental feature added in ES 7.15
620
- IndicesApi.prototype.diskUsage = function indicesDiskUsageApi(params, options, callback) {
621
- [params, options, callback] = normalizeArguments(params, options, callback);
622
-
623
- // check required parameters
624
- if (params.index == null) {
625
- const err = new this[kConfigurationError]('Missing required parameter: index');
626
- return handleError(err, callback);
627
- }
628
-
629
- let { method, body, index, ...querystring } = params;
630
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
631
-
632
- let path = '';
633
- if (method == null) method = 'POST';
634
- path = '/' + encodeURIComponent(index) + '/' + '_disk_usage';
635
-
636
- // build request object
637
- const request = {
638
- method,
639
- path,
640
- body: body || '',
641
- querystring,
642
- };
643
-
644
- return this.transport.request(request, options, callback);
645
- };
646
-
647
- /**
648
- * Returns information about whether a particular index exists.
649
- * <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/index-apis/exists/ OpenSearch - Index Exists}
650
- *
651
- * @memberOf API-Index
652
- *
653
- * @param {Object} params
654
- * @param {string} params.index - A comma-separated list of index names
655
- * @param {boolean} [params.local=false] - Return local information, do not retrieve the state from cluster_manager node
656
- * @param {boolean} [params.ignore_unavailable=false] - Ignore unavailable indexes
657
- * @param {boolean} [params.allow_no_indices=false] - Ignore if a wildcard expression resolves to no concrete indices
658
- * @param {string} [params.expand_wildcards=open] - Whether wildcard expressions should get expanded to open or closed indices (options: open, closed, hidden, none, all)
659
- * @param {boolean} [params.flat_settings=false] - Return settings in flat format
660
- * @param {boolean} [params.include_defaults] - Whether to return all default setting for each of the indices.
661
- *
662
- * @param {Object} options - Options for {@link Transport#request}
663
- * @param {function} callback - Callback that handles errors and response
664
- *
665
- * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
666
- */
667
- IndicesApi.prototype.exists = function indicesExistsApi(params, options, callback) {
668
- [params, options, callback] = normalizeArguments(params, options, callback);
669
-
670
- // check required parameters
671
- if (params.index == null) {
672
- const err = new this[kConfigurationError]('Missing required parameter: index');
673
- return handleError(err, callback);
674
- }
675
-
676
- let { method, body, index, ...querystring } = params;
677
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
678
-
679
- let path = '';
680
- if (method == null) method = 'HEAD';
681
- path = '/' + encodeURIComponent(index);
682
-
683
- // build request object
684
- const request = {
685
- method,
686
- path,
687
- body: null,
688
- querystring,
689
- };
690
-
691
- return this.transport.request(request, options, callback);
692
- };
693
-
694
- /**
695
- * Returns information about whether a particular alias exists.
696
- * <br/> See Also: {@link https://opensearch.org/docs/latest/opensearch/index-alias/ OpenSearch - Index Aliases}
697
- *
698
- * @memberOf API-Index
699
- *
700
- * @param {Object} params
701
- * @param {string} params.name - A comma-separated list of alias names to return
702
- * @param {string} [params.index] - A comma-separated list of index names to filter aliases
703
- * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
704
- * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
705
- * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
706
- * @param {boolean} [params.local=false] - Return local information, do not retrieve the state from cluster_manager node
707
- *
708
- * @param {Object} options - Options for {@link Transport#request}
709
- * @param {function} callback - Callback that handles errors and response
710
- *
711
- * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
712
- */
713
- IndicesApi.prototype.existsAlias = function indicesExistsAliasApi(params, options, callback) {
714
- [params, options, callback] = normalizeArguments(params, options, callback);
715
-
716
- // check required parameters
717
- if (params.name == null) {
718
- const err = new this[kConfigurationError]('Missing required parameter: name');
719
- return handleError(err, callback);
720
- }
721
-
722
- let { method, body, name, index, ...querystring } = params;
723
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
724
-
725
- let path = '';
726
- if (index != null && name != null) {
727
- if (method == null) method = 'HEAD';
728
- path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name);
729
- } else {
730
- if (method == null) method = 'HEAD';
731
- path = '/' + '_alias' + '/' + encodeURIComponent(name);
732
- }
733
-
734
- // build request object
735
- const request = {
736
- method,
737
- path,
738
- body: null,
739
- querystring,
740
- };
741
-
742
- return this.transport.request(request, options, callback);
743
- };
744
-
745
- /**
746
- * Returns information about whether a particular index template exists.
747
- * <br/> See Also: {@link https://opensearch.org/docs/latest/opensearch/index-templates/ OpenSearch - Index Templates}
748
- *
749
- * @memberOf API-Index
750
- *
751
- * @param {Object} params
752
- * @param {string} params.name - The name of the template
753
- * @param {boolean} [params.flat_settings=false] - Return settings in flat format
754
- * @param {string} [params.cluster_manager_timeout] - Explicit operation timeout for connection to cluster_manager node
755
- * @param {boolean} [params.local=false] - Return local information, do not retrieve the state from cluster_manager node
756
- *
757
- * @param {Object} options - Options for {@link Transport#request}
758
- * @param {function} callback - Callback that handles errors and response
759
- *
760
- * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
761
- */
762
- IndicesApi.prototype.existsIndexTemplate = function indicesExistsIndexTemplateApi(
763
- params,
764
- options,
765
- callback
766
- ) {
767
- [params, options, callback] = normalizeArguments(params, options, callback);
768
-
769
- // check required parameters
770
- if (params.name == null) {
771
- const err = new this[kConfigurationError]('Missing required parameter: name');
772
- return handleError(err, callback);
773
- }
774
-
775
- let { method, body, name, ...querystring } = params;
776
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
777
-
778
- let path = '';
779
- if (method == null) method = 'HEAD';
780
- path = '/' + '_index_template' + '/' + encodeURIComponent(name);
781
-
782
- // build request object
783
- const request = {
784
- method,
785
- path,
786
- body: null,
787
- querystring,
788
- };
789
-
790
- return this.transport.request(request, options, callback);
791
- };
792
-
793
- /**
794
- * Returns information about whether a particular index template exists. (Deprecated. Use IndicesApi#existsIndexTemplate instead)
795
- *
796
- * @memberOf API-Index
797
- *
798
- * @param {Object} params
799
- * @param {string} params.name - The comma separated names of the index templates
800
- * @param {boolean} [params.flat_settings=false] - Return settings in flat format
801
- * @param {string} [params.cluster_manager_timeout] - Explicit operation timeout for connection to cluster_manager node
802
- * @param {boolean} [params.local=false] - Return local information, do not retrieve the state from cluster_manager node
803
- *
804
- * @param {Object} options - Options for {@link Transport#request}
805
- * @param {function} callback - Callback that handles errors and response
806
- *
807
- * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
808
- */
809
- IndicesApi.prototype.existsTemplate = function indicesExistsTemplateApi(params, options, callback) {
810
- [params, options, callback] = normalizeArguments(params, options, callback);
811
-
812
- // check required parameters
813
- if (params.name == null) {
814
- const err = new this[kConfigurationError]('Missing required parameter: name');
815
- return handleError(err, callback);
816
- }
817
-
818
- let { method, body, name, ...querystring } = params;
819
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
820
-
821
- let path = '';
822
- if (method == null) method = 'HEAD';
823
- path = '/' + '_template' + '/' + encodeURIComponent(name);
824
-
825
- // build request object
826
- const request = {
827
- method,
828
- path,
829
- body: null,
830
- querystring,
831
- };
832
-
833
- return this.transport.request(request, options, callback);
834
- };
835
-
836
- // TODO: Remove. Experimental feature added in ES 7.15
837
- IndicesApi.prototype.fieldUsageStats = function indicesFieldUsageStatsApi(
838
- params,
839
- options,
840
- callback
841
- ) {
842
- [params, options, callback] = normalizeArguments(params, options, callback);
843
-
844
- // check required parameters
845
- if (params.index == null) {
846
- const err = new this[kConfigurationError]('Missing required parameter: index');
847
- return handleError(err, callback);
848
- }
849
-
850
- let { method, body, index, ...querystring } = params;
851
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
852
-
853
- let path = '';
854
- if (method == null) method = 'GET';
855
- path = '/' + encodeURIComponent(index) + '/' + '_field_usage_stats';
856
-
857
- // build request object
858
- const request = {
859
- method,
860
- path,
861
- body: null,
862
- querystring,
863
- };
864
-
865
- return this.transport.request(request, options, callback);
866
- };
867
-
868
- /**
869
- * Performs the flush operation on one or more indices.
870
- *
871
- * @memberOf API-Index
872
- *
873
- * @param {Object} params
874
- * @param {string} [params.index] - A comma-separated list of index names; use `_all` or empty string for all indices
875
- * @param {boolean} [params.force] - 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)
876
- * @param {boolean} [params.wait_if_ongoing=true] - If set to true the flush operation will block until the flush can be executed if another flush operation is already executing. If set to false the flush will be skipped iff if another flush operation is already running.
877
- * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
878
- * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
879
- * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
880
- *
881
- * @param {Object} options - Options for {@link Transport#request}
882
- * @param {function} callback - Callback that handles errors and response
883
- *
884
- * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
885
- */
886
- IndicesApi.prototype.flush = function indicesFlushApi(params, options, callback) {
887
- [params, options, callback] = normalizeArguments(params, options, callback);
888
-
889
- let { method, body, index, ...querystring } = params;
890
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
891
-
892
- let path = '';
893
- if (index != null) {
894
- if (method == null) method = body == null ? 'GET' : 'POST';
895
- path = '/' + encodeURIComponent(index) + '/' + '_flush';
896
- } else {
897
- if (method == null) method = body == null ? 'GET' : 'POST';
898
- path = '/' + '_flush';
899
- }
900
-
901
- // build request object
902
- const request = {
903
- method,
904
- path,
905
- body: body || '',
906
- querystring,
907
- };
908
-
909
- return this.transport.request(request, options, callback);
910
- };
911
-
912
- /**
913
- * Performs the force merge operation on one or more indices.
914
- *
915
- * @memberOf API-Index
916
- *
917
- * @param {Object} params
918
- * @param {string} [params.index] - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
919
- * @param {boolean} [params.flush=true] - Specify whether the index should be flushed after performing the operation
920
- * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
921
- * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
922
- * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
923
- * @param {number} [params.max_num_segments] - The number of segments the index should be merged into (default: dynamic)
924
- * @param {boolean} [params.only_expunge_deletes] - Specify whether the operation should only expunge deleted documents
925
- *
926
- * @param {Object} options - Options for {@link Transport#request}
927
- * @param {function} callback - Callback that handles errors and response
928
- *
929
- * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
930
- */
931
- IndicesApi.prototype.forcemerge = function indicesForcemergeApi(params, options, callback) {
932
- [params, options, callback] = normalizeArguments(params, options, callback);
933
-
934
- let { method, body, index, ...querystring } = params;
935
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
936
-
937
- let path = '';
938
- if (index != null) {
939
- if (method == null) method = 'POST';
940
- path = '/' + encodeURIComponent(index) + '/' + '_forcemerge';
941
- } else {
942
- if (method == null) method = 'POST';
943
- path = '/' + '_forcemerge';
944
- }
945
-
946
- // build request object
947
- const request = {
948
- method,
949
- path,
950
- body: body || '',
951
- querystring,
952
- };
953
-
954
- return this.transport.request(request, options, callback);
955
- };
956
-
957
- /**
958
- * Returns information about one or more indices.
959
- * <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/index-apis/get-index/ OpenSearch - Get Index}
960
- *
961
- * @memberOf API-Index
962
- *
963
- * @param {Object} params
964
- * @param {string} params.index - A comma-separated list of index names
965
- * @param {boolean} [params.local=false] - Return local information, do not retrieve the state from cluster_manager node
966
- * @param {boolean} [params.ignore_unavailable=false] - Ignore unavailable indexes
967
- * @param {boolean} [params.allow_no_indices=false] - Ignore if a wildcard expression resolves to no concrete indices
968
- * @param {string} [params.expand_wildcards=open] - Whether wildcard expressions should get expanded to open or closed indices (options: open, closed, hidden, none, all)
969
- * @param {boolean} [params.flat_settings=false] - Return settings in flat format
970
- * @param {boolean} [params.include_defaults] - Whether to return all default setting for each of the indices.
971
- * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
972
- *
973
- * @param {Object} options - Options for {@link Transport#request}
974
- * @param {function} callback - Callback that handles errors and response
975
- *
976
- * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
977
- */
978
- IndicesApi.prototype.get = function indicesGetApi(params, options, callback) {
979
- [params, options, callback] = normalizeArguments(params, options, callback);
980
-
981
- // check required parameters
982
- if (params.index == null) {
983
- const err = new this[kConfigurationError]('Missing required parameter: index');
984
- return handleError(err, callback);
985
- }
986
-
987
- let { method, body, index, ...querystring } = params;
988
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
989
-
990
- let path = '';
991
- if (method == null) method = 'GET';
992
- path = '/' + encodeURIComponent(index);
993
-
994
- // build request object
995
- const request = {
996
- method,
997
- path,
998
- body: null,
999
- querystring,
1000
- };
1001
-
1002
- return this.transport.request(request, options, callback);
1003
- };
1004
-
1005
- /**
1006
- * Returns an alias.
1007
- * <br/> See Also: {@link https://opensearch.org/docs/latest/opensearch/index-alias/ OpenSearch - Index Aliases}
1008
- *
1009
- * @memberOf API-Index
1010
- *
1011
- * @param {Object} params
1012
- * @param {string} [params.name] - A comma-separated list of alias names to return
1013
- * @param {string} [params.index] - A comma-separated list of index names to filter aliases
1014
- * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
1015
- * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
1016
- * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
1017
- * @param {boolean} [params.local=false] - Return local information, do not retrieve the state from cluster_manager node
1018
- *
1019
- * @param {Object} options - Options for {@link Transport#request}
1020
- * @param {function} callback - Callback that handles errors and response
1021
- *
1022
- * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
1023
- */
1024
- IndicesApi.prototype.getAlias = function indicesGetAliasApi(params, options, callback) {
1025
- [params, options, callback] = normalizeArguments(params, options, callback);
1026
-
1027
- let { method, body, name, index, ...querystring } = params;
1028
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
1029
-
1030
- let path = '';
1031
- if (index != null && name != null) {
1032
- if (method == null) method = 'GET';
1033
- path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name);
1034
- } else if (name != null) {
1035
- if (method == null) method = 'GET';
1036
- path = '/' + '_alias' + '/' + encodeURIComponent(name);
1037
- } else if (index != null) {
1038
- if (method == null) method = 'GET';
1039
- path = '/' + encodeURIComponent(index) + '/' + '_alias';
1040
- } else {
1041
- if (method == null) method = 'GET';
1042
- path = '/' + '_alias';
1043
- }
1044
-
1045
- // build request object
1046
- const request = {
1047
- method,
1048
- path,
1049
- body: null,
1050
- querystring,
1051
- };
1052
-
1053
- return this.transport.request(request, options, callback);
1054
- };
1055
-
1056
- /**
1057
- * Returns mapping for one or more fields.
1058
- * <br/> See Also: {@link https://opensearch.org/docs/latest/opensearch/mappings/ OpenSearch - Mapping}
1059
- *
1060
- * @memberOf API-Index
1061
- *
1062
- * @param {Object} params
1063
- * @param {string} params.fields - A comma-separated list of fields
1064
- * @param {string} [params.index] - A comma-separated list of index names
1065
- * @param {boolean} [params.include_defaults] - Whether the default mapping values should be returned as well
1066
- * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
1067
- * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
1068
- * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
1069
- * @param {boolean} [params.local=false] - Return local information, do not retrieve the state from cluster_manager node
1070
- *
1071
- * @param {Object} options - Options for {@link Transport#request}
1072
- * @param {function} callback - Callback that handles errors and response
1073
- *
1074
- * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
1075
- */
1076
- IndicesApi.prototype.getFieldMapping = function indicesGetFieldMappingApi(
1077
- params,
1078
- options,
1079
- callback
1080
- ) {
1081
- [params, options, callback] = normalizeArguments(params, options, callback);
1082
-
1083
- // check required parameters
1084
- if (params.fields == null) {
1085
- const err = new this[kConfigurationError]('Missing required parameter: fields');
1086
- return handleError(err, callback);
1087
- }
1088
-
1089
- let { method, body, fields, index, type, ...querystring } = params;
1090
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
1091
-
1092
- let path = '';
1093
- if (index != null && type != null && fields != null) {
1094
- if (method == null) method = 'GET';
1095
- path =
1096
- '/' +
1097
- encodeURIComponent(index) +
1098
- '/' +
1099
- '_mapping' +
1100
- '/' +
1101
- encodeURIComponent(type) +
1102
- '/' +
1103
- 'field' +
1104
- '/' +
1105
- encodeURIComponent(fields);
1106
- } else if (index != null && fields != null) {
1107
- if (method == null) method = 'GET';
1108
- path =
1109
- '/' +
1110
- encodeURIComponent(index) +
1111
- '/' +
1112
- '_mapping' +
1113
- '/' +
1114
- 'field' +
1115
- '/' +
1116
- encodeURIComponent(fields);
1117
- } else if (type != null && fields != null) {
1118
- if (method == null) method = 'GET';
1119
- path =
1120
- '/' +
1121
- '_mapping' +
1122
- '/' +
1123
- encodeURIComponent(type) +
1124
- '/' +
1125
- 'field' +
1126
- '/' +
1127
- encodeURIComponent(fields);
1128
- } else {
1129
- if (method == null) method = 'GET';
1130
- path = '/' + '_mapping' + '/' + 'field' + '/' + encodeURIComponent(fields);
1131
- }
1132
-
1133
- // build request object
1134
- const request = {
1135
- method,
1136
- path,
1137
- body: null,
1138
- querystring,
1139
- };
1140
-
1141
- return this.transport.request(request, options, callback);
1142
- };
1143
-
1144
- /**
1145
- * Returns an index template.
1146
- * <br/> See Also: {@link https://opensearch.org/docs/latest/opensearch/index-templates/ OpenSearch - Index Templates}
1147
- *
1148
- * @memberOf API-Index
1149
- *
1150
- * @param {Object} params
1151
- * @param {string} [params.name] - The comma separated names of the index templates
1152
- * @param {boolean} [params.flat_setting=false] - Return settings in flat format
1153
- * @param {string} [params.cluster_manager_timeout] - Explicit operation timeout for connection to cluster_manager node
1154
- * @param {boolean} [params.local=false] - Return local information, do not retrieve the state from cluster_manager node
1155
- *
1156
- * @param {Object} options - Options for {@link Transport#request}
1157
- * @param {function} callback - Callback that handles errors and response
1158
- *
1159
- * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
1160
- */
1161
- IndicesApi.prototype.getIndexTemplate = function indicesGetIndexTemplateApi(
1162
- params,
1163
- options,
1164
- callback
1165
- ) {
1166
- [params, options, callback] = normalizeArguments(params, options, callback);
1167
-
1168
- let { method, body, name, ...querystring } = params;
1169
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
1170
-
1171
- let path = '';
1172
- if (name != null) {
1173
- if (method == null) method = 'GET';
1174
- path = '/' + '_index_template' + '/' + encodeURIComponent(name);
1175
- } else {
1176
- if (method == null) method = 'GET';
1177
- path = '/' + '_index_template';
1178
- }
1179
-
1180
- // build request object
1181
- const request = {
1182
- method,
1183
- path,
1184
- body: null,
1185
- querystring,
1186
- };
1187
-
1188
- return this.transport.request(request, options, callback);
1189
- };
1190
-
1191
- /**
1192
- * Returns mappings for one or more indices.
1193
- * <br/> See Also: {@link https://opensearch.org/docs/latest/opensearch/mappings/ OpenSearch - Mapping}
1194
- *
1195
- * @memberOf API-Index
1196
- *
1197
- * @param {Object} params
1198
- * @param {string} [params.index] - A comma-separated list of index names
1199
- * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
1200
- * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
1201
- * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
1202
- * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
1203
- * @param {boolean} [params.local=false] - Return local information, do not retrieve the state from cluster_manager node (Deprecated)
1204
- *
1205
- * @param {Object} options - Options for {@link Transport#request}
1206
- * @param {function} callback - Callback that handles errors and response
1207
- *
1208
- * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
1209
- */
1210
- IndicesApi.prototype.getMapping = function indicesGetMappingApi(params, options, callback) {
1211
- [params, options, callback] = normalizeArguments(params, options, callback);
1212
-
1213
- let { method, body, index, type, ...querystring } = params;
1214
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
1215
-
1216
- let path = '';
1217
- if (index != null && type != null) {
1218
- if (method == null) method = 'GET';
1219
- path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + encodeURIComponent(type);
1220
- } else if (index != null) {
1221
- if (method == null) method = 'GET';
1222
- path = '/' + encodeURIComponent(index) + '/' + '_mapping';
1223
- } else if (type != null) {
1224
- if (method == null) method = 'GET';
1225
- path = '/' + '_mapping' + '/' + encodeURIComponent(type);
1226
- } else {
1227
- if (method == null) method = 'GET';
1228
- path = '/' + '_mapping';
1229
- }
1230
-
1231
- // build request object
1232
- const request = {
1233
- method,
1234
- path,
1235
- body: null,
1236
- querystring,
1237
- };
1238
-
1239
- return this.transport.request(request, options, callback);
1240
- };
1241
-
1242
- /**
1243
- * Returns settings for one or more indices.
1244
- * <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/index-apis/get-settings/ OpenSearch - Get Settings}
1245
- *
1246
- * @memberOf API-Index
1247
- *
1248
- * @param {Object} params
1249
- * @param {string} [params.index] - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
1250
- * @param {string} [params.name] - The name of the settings that should be included
1251
- * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
1252
- * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
1253
- * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
1254
- * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
1255
- * @param {boolean} [params.flat_settings=false] - Return settings in flat format
1256
- * @param {boolean} [params.local=false] - Return local information, do not retrieve the state from cluster_manager node
1257
- * @param {boolean} [params.include_defaults] - Whether to return all default setting for each of the indices.
1258
- *
1259
- * @param {Object} options - Options for {@link Transport#request}
1260
- * @param {function} callback - Callback that handles errors and response
1261
- *
1262
- * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
1263
- */
1264
- IndicesApi.prototype.getSettings = function indicesGetSettingsApi(params, options, callback) {
1265
- [params, options, callback] = normalizeArguments(params, options, callback);
1266
-
1267
- let { method, body, index, name, ...querystring } = params;
1268
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
1269
-
1270
- let path = '';
1271
- if (index != null && name != null) {
1272
- if (method == null) method = 'GET';
1273
- path = '/' + encodeURIComponent(index) + '/' + '_settings' + '/' + encodeURIComponent(name);
1274
- } else if (index != null) {
1275
- if (method == null) method = 'GET';
1276
- path = '/' + encodeURIComponent(index) + '/' + '_settings';
1277
- } else if (name != null) {
1278
- if (method == null) method = 'GET';
1279
- path = '/' + '_settings' + '/' + encodeURIComponent(name);
1280
- } else {
1281
- if (method == null) method = 'GET';
1282
- path = '/' + '_settings';
1283
- }
1284
-
1285
- // build request object
1286
- const request = {
1287
- method,
1288
- path,
1289
- body: null,
1290
- querystring,
1291
- };
1292
-
1293
- return this.transport.request(request, options, callback);
1294
- };
1295
-
1296
- /**
1297
- * Returns an index template. (Deprecated. Use IndicesApi#getIndexTemplate instead)
1298
- *
1299
- * @memberOf API-Index
1300
- *
1301
- * @param {Object} params
1302
- * @param {string} [params.name] - The comma separated names of the index templates
1303
- * @param {boolean} [params.flat_settings=false] - Return settings in flat format
1304
- * @param {string} [params.cluster_manager_timeout] - Explicit operation timeout for connection to cluster_manager node
1305
- * @param {boolean} [params.local=false] - Return local information, do not retrieve the state from cluster_manager node
1306
- *
1307
- * @param {Object} options - Options for {@link Transport#request}
1308
- * @param {function} callback - Callback that handles errors and response
1309
- *
1310
- * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
1311
- */
1312
- IndicesApi.prototype.getTemplate = function indicesGetTemplateApi(params, options, callback) {
1313
- [params, options, callback] = normalizeArguments(params, options, callback);
1314
-
1315
- let { method, body, name, ...querystring } = params;
1316
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
1317
-
1318
- let path = '';
1319
- if (name != null) {
1320
- if (method == null) method = 'GET';
1321
- path = '/' + '_template' + '/' + encodeURIComponent(name);
1322
- } else {
1323
- if (method == null) method = 'GET';
1324
- path = '/' + '_template';
1325
- }
1326
-
1327
- // build request object
1328
- const request = {
1329
- method,
1330
- path,
1331
- body: null,
1332
- querystring,
1333
- };
1334
-
1335
- return this.transport.request(request, options, callback);
1336
- };
1337
-
1338
- /**
1339
- * Returns a progress status of current upgrade.
1340
- *
1341
- * @memberOf API-Index
1342
- *
1343
- * @param {Object} params
1344
- * @param {string} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
1345
- * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
1346
- * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
1347
- * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
1348
- *
1349
- * @param {Object} options - Options for {@link Transport#request}
1350
- * @param {function} callback - Callback that handles errors and response
1351
- *
1352
- * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
1353
- */
1354
- IndicesApi.prototype.getUpgrade = function indicesGetUpgradeApi(params, options, callback) {
1355
- [params, options, callback] = normalizeArguments(params, options, callback);
1356
-
1357
- let { method, body, index, ...querystring } = params;
1358
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
1359
-
1360
- let path = '';
1361
- if (method == null) method = 'GET';
1362
- path = '/' + encodeURIComponent(index) + '/' + '_upgrade';
1363
-
1364
- // build request object
1365
- const request = {
1366
- method,
1367
- path,
1368
- body: null,
1369
- querystring,
1370
- };
1371
-
1372
- return this.transport.request(request, options, callback);
1373
- };
1374
-
1375
- /**
1376
- * ROpens an index.
1377
- * <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/index-apis/open-index/ OpenSearch - Open Index}
1378
- *
1379
- * @memberOf API-Index
1380
- *
1381
- * @param {Object} params
1382
- * @param {string} params.index - A comma separated list of indices to open
1383
- * @param {string} [params.timeout] - Explicit operation timeout
1384
- * @param {string} [params.cluster_manager_timeout] - Explicit operation timeout for connection to cluster_manager node
1385
- * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
1386
- * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
1387
- * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
1388
- * @param {string} [params.wait_for_active_shards] - Sets the number of active shards to wait for before the operation returns.
1389
- *
1390
- * @param {Object} options - Options for {@link Transport#request}
1391
- * @param {function} callback - Callback that handles errors and response
1392
- *
1393
- * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
1394
- */
1395
- IndicesApi.prototype.open = function indicesOpenApi(params, options, callback) {
1396
- [params, options, callback] = normalizeArguments(params, options, callback);
1397
-
1398
- // check required parameters
1399
- if (params.index == null) {
1400
- const err = new this[kConfigurationError]('Missing required parameter: index');
1401
- return handleError(err, callback);
1402
- }
1403
-
1404
- let { method, body, index, ...querystring } = params;
1405
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
1406
-
1407
- let path = '';
1408
- if (method == null) method = 'POST';
1409
- path = '/' + encodeURIComponent(index) + '/' + '_open';
1410
-
1411
- // build request object
1412
- const request = {
1413
- method,
1414
- path,
1415
- body: body || '',
1416
- querystring,
1417
- };
1418
-
1419
- return this.transport.request(request, options, callback);
1420
- };
1421
-
1422
- /**
1423
- * Creates or updates an alias.
1424
- * <br/> See Also: {@link https://opensearch.org/docs/latest/opensearch/index-alias/ OpenSearch - Index Aliases}
1425
- *
1426
- * @memberOf API-Index
1427
- *
1428
- * @param {Object} params
1429
- * @param {string} params.index - A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices.
1430
- * @param {string} params.name - The name of the alias to be created or updated
1431
- * @param {string} [params.timeout] - Explicit timestamp for the document
1432
- * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
1433
- * @param {Object} [params.body] - The settings for the alias, such as `routing` or `filter`
1434
- *
1435
- * @param {Object} options - Options for {@link Transport#request}
1436
- * @param {function} callback - Callback that handles errors and response
1437
- *
1438
- * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
1439
- */
1440
- IndicesApi.prototype.putAlias = function indicesPutAliasApi(params, options, callback) {
1441
- [params, options, callback] = normalizeArguments(params, options, callback);
1442
-
1443
- // check required parameters
1444
- if (params.index == null) {
1445
- const err = new this[kConfigurationError]('Missing required parameter: index');
1446
- return handleError(err, callback);
1447
- }
1448
- if (params.name == null) {
1449
- const err = new this[kConfigurationError]('Missing required parameter: name');
1450
- return handleError(err, callback);
1451
- }
1452
-
1453
- // check required url components
1454
- if (params.name != null && params.index == null) {
1455
- const err = new this[kConfigurationError]('Missing required parameter of the url: index');
1456
- return handleError(err, callback);
1457
- }
1458
-
1459
- let { method, body, index, name, ...querystring } = params;
1460
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
1461
-
1462
- let path = '';
1463
- if (index != null && name != null) {
1464
- if (method == null) method = 'PUT';
1465
- path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name);
1466
- } else {
1467
- if (method == null) method = 'PUT';
1468
- path = '/' + encodeURIComponent(index) + '/' + '_aliases' + '/' + encodeURIComponent(name);
1469
- }
1470
-
1471
- // build request object
1472
- const request = {
1473
- method,
1474
- path,
1475
- body: body || '',
1476
- querystring,
1477
- };
1478
-
1479
- return this.transport.request(request, options, callback);
1480
- };
1481
-
1482
- /**
1483
- * Creates or updates an index template.
1484
- * <br/> See Also: {@link https://opensearch.org/docs/latest/opensearch/index-templates/ OpenSearch - Index Templates}
1485
- *
1486
- * @memberOf API-Index
1487
- *
1488
- * @param {Object} params
1489
- * @param {string} params.name - The name of the template
1490
- * @param {Object} params.body - The template definition
1491
- * @param {boolean} [params.create] - Whether the index template should only be added if new or can also replace an existing one
1492
- * @param {string} [params.cause] - User defined reason for creating/updating the index template
1493
- * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
1494
- *
1495
- * @param {Object} options - Options for {@link Transport#request}
1496
- * @param {function} callback - Callback that handles errors and response
1497
- *
1498
- * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
1499
- */
1500
- IndicesApi.prototype.putIndexTemplate = function indicesPutIndexTemplateApi(
1501
- params,
1502
- options,
1503
- callback
1504
- ) {
1505
- [params, options, callback] = normalizeArguments(params, options, callback);
1506
-
1507
- // check required parameters
1508
- if (params.name == null) {
1509
- const err = new this[kConfigurationError]('Missing required parameter: name');
1510
- return handleError(err, callback);
1511
- }
1512
- if (params.body == null) {
1513
- const err = new this[kConfigurationError]('Missing required parameter: body');
1514
- return handleError(err, callback);
1515
- }
1516
-
1517
- let { method, body, name, ...querystring } = params;
1518
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
1519
-
1520
- let path = '';
1521
- if (method == null) method = 'PUT';
1522
- path = '/' + '_index_template' + '/' + encodeURIComponent(name);
1523
-
1524
- // build request object
1525
- const request = {
1526
- method,
1527
- path,
1528
- body: body || '',
1529
- querystring,
1530
- };
1531
-
1532
- return this.transport.request(request, options, callback);
1533
- };
1534
-
1535
- /**
1536
- * Updates index mappings.
1537
- * <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/index-apis/put-mapping/ OpenSearch - Create or Update Mapping}
1538
- *
1539
- * @memberOf API-Index
1540
- *
1541
- * @param {Object} params
1542
- * @param {string} params.index - 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.
1543
- * @param {Object} params.body - The mapping definition
1544
- * @param {string} [params.timeout] - Explicit operation timeout
1545
- * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
1546
- * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
1547
- * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
1548
- * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
1549
- * @param {boolean} [params.write_index_only] - When true, applies mappings only to the write index of an alias or data stream
1550
- *
1551
- * @param {Object} options - Options for {@link Transport#request}
1552
- * @param {function} callback - Callback that handles errors and response
1553
- *
1554
- * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
1555
- */
1556
- IndicesApi.prototype.putMapping = function indicesPutMappingApi(params, options, callback) {
1557
- [params, options, callback] = normalizeArguments(params, options, callback);
1558
-
1559
- // check required parameters
1560
- if (params.body == null) {
1561
- const err = new this[kConfigurationError]('Missing required parameter: body');
1562
- return handleError(err, callback);
1563
- }
1564
-
1565
- let { method, body, index, type, ...querystring } = params;
1566
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
1567
-
1568
- let path = '';
1569
- if (index != null && type != null) {
1570
- if (method == null) method = 'PUT';
1571
- path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mapping';
1572
- } else if (index != null && type != null) {
1573
- if (method == null) method = 'PUT';
1574
- path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + encodeURIComponent(type);
1575
- } else if (index != null && type != null) {
1576
- if (method == null) method = 'PUT';
1577
- path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mappings';
1578
- } else if (index != null && type != null) {
1579
- if (method == null) method = 'PUT';
1580
- path = '/' + encodeURIComponent(index) + '/' + '_mappings' + '/' + encodeURIComponent(type);
1581
- } else if (index != null) {
1582
- if (method == null) method = 'PUT';
1583
- path = '/' + encodeURIComponent(index) + '/' + '_mapping';
1584
- } else if (type != null) {
1585
- if (method == null) method = 'PUT';
1586
- path = '/' + '_mappings' + '/' + encodeURIComponent(type);
1587
- } else if (index != null) {
1588
- if (method == null) method = 'PUT';
1589
- path = '/' + encodeURIComponent(index) + '/' + '_mappings';
1590
- } else {
1591
- if (method == null) method = 'PUT';
1592
- path = '/' + '_mapping' + '/' + encodeURIComponent(type);
1593
- }
1594
-
1595
- // build request object
1596
- const request = {
1597
- method,
1598
- path,
1599
- body: body || '',
1600
- querystring,
1601
- };
1602
-
1603
- return this.transport.request(request, options, callback);
1604
- };
1605
-
1606
- /**
1607
- * Updates the index settings.
1608
- * <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/index-apis/update-settings/ OpenSearch - Update Settings}
1609
- *
1610
- * @memberOf API-Index
1611
- *
1612
- * @param {Object} params
1613
- * @param {Object} params.body - The index settings to be updated
1614
- * @param {string} [params.index] - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
1615
- * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
1616
- * @param {string} [params.timeout] - Explicit operation timeout
1617
- * @param {boolean} [params.preserve_existing=false] - Whether to update existing settings. If set to `true` existing settings on an index remain unchanged
1618
- * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
1619
- * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
1620
- * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
1621
- * @param {boolean} [params.flat_settings=false] - Return settings in flat format
1622
- *
1623
- * @param {Object} options - Options for {@link Transport#request}
1624
- * @param {function} callback - Callback that handles errors and response
1625
- *
1626
- * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
1627
- */
1628
- IndicesApi.prototype.putSettings = function indicesPutSettingsApi(params, options, callback) {
1629
- [params, options, callback] = normalizeArguments(params, options, callback);
1630
-
1631
- // check required parameters
1632
- if (params.body == null) {
1633
- const err = new this[kConfigurationError]('Missing required parameter: body');
1634
- return handleError(err, callback);
1635
- }
1636
-
1637
- let { method, body, index, ...querystring } = params;
1638
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
1639
-
1640
- let path = '';
1641
- if (index != null) {
1642
- if (method == null) method = 'PUT';
1643
- path = '/' + encodeURIComponent(index) + '/' + '_settings';
1644
- } else {
1645
- if (method == null) method = 'PUT';
1646
- path = '/' + '_settings';
1647
- }
1648
-
1649
- // build request object
1650
- const request = {
1651
- method,
1652
- path,
1653
- body: body || '',
1654
- querystring,
1655
- };
1656
-
1657
- return this.transport.request(request, options, callback);
1658
- };
1659
-
1660
- /**
1661
- * Creates or updates an index template. (Deprecated. Use IndicesApi#putIndexTemplate instead)
1662
- *
1663
- * @memberOf API-Index
1664
- *
1665
- * @param {Object} params
1666
- * @param {string} params.name - The name of the template
1667
- * @param {Object} params.body - The template definition
1668
- * @param {number} [params.order] - The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers)
1669
- * @param {boolean} [params.create] - Whether the index template should only be added if new or can also replace an existing one
1670
- * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
1671
- *
1672
- * @param {Object} options - Options for {@link Transport#request}
1673
- * @param {function} callback - Callback that handles errors and response
1674
- *
1675
- * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
1676
- */
1677
- IndicesApi.prototype.putTemplate = function indicesPutTemplateApi(params, options, callback) {
1678
- [params, options, callback] = normalizeArguments(params, options, callback);
1679
-
1680
- // check required parameters
1681
- if (params.name == null) {
1682
- const err = new this[kConfigurationError]('Missing required parameter: name');
1683
- return handleError(err, callback);
1684
- }
1685
- if (params.body == null) {
1686
- const err = new this[kConfigurationError]('Missing required parameter: body');
1687
- return handleError(err, callback);
1688
- }
1689
-
1690
- let { method, body, name, ...querystring } = params;
1691
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
1692
-
1693
- let path = '';
1694
- if (method == null) method = 'PUT';
1695
- path = '/' + '_template' + '/' + encodeURIComponent(name);
1696
-
1697
- // build request object
1698
- const request = {
1699
- method,
1700
- path,
1701
- body: body || '',
1702
- querystring,
1703
- };
1704
-
1705
- return this.transport.request(request, options, callback);
1706
- };
1707
-
1708
- /**
1709
- * Returns information about ongoing index shard recoveries.
1710
- *
1711
- * @memberOf API-Index
1712
- *
1713
- * @param {Object} params
1714
- * @param {string} [params.index] - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
1715
- * @param {boolean} [params.detailed] - Whether to display detailed information about shard recovery
1716
- * @param {boolean} [params.active_only] - Display only those recoveries that are currently on-going
1717
- *
1718
- * @param {Object} options - Options for {@link Transport#request}
1719
- * @param {function} callback - Callback that handles errors and response
1720
- *
1721
- * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
1722
- */
1723
- IndicesApi.prototype.recovery = function indicesRecoveryApi(params, options, callback) {
1724
- [params, options, callback] = normalizeArguments(params, options, callback);
1725
-
1726
- let { method, body, index, ...querystring } = params;
1727
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
1728
-
1729
- let path = '';
1730
- if (index != null) {
1731
- if (method == null) method = 'GET';
1732
- path = '/' + encodeURIComponent(index) + '/' + '_recovery';
1733
- } else {
1734
- if (method == null) method = 'GET';
1735
- path = '/' + '_recovery';
1736
- }
1737
-
1738
- // build request object
1739
- const request = {
1740
- method,
1741
- path,
1742
- body: null,
1743
- querystring,
1744
- };
1745
-
1746
- return this.transport.request(request, options, callback);
1747
- };
1748
-
1749
- /**
1750
- * Performs the refresh operation in one or more indices.
1751
- *
1752
- * @memberOf API-Index
1753
- *
1754
- * @param {Object} params
1755
- * @param {string} [params.index] - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
1756
- * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
1757
- * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
1758
- * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
1759
- *
1760
- * @param {Object} options - Options for {@link Transport#request}
1761
- * @param {function} callback - Callback that handles errors and response
1762
- *
1763
- * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
1764
- */
1765
- IndicesApi.prototype.refresh = function indicesRefreshApi(params, options, callback) {
1766
- [params, options, callback] = normalizeArguments(params, options, callback);
1767
-
1768
- let { method, body, index, ...querystring } = params;
1769
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
1770
-
1771
- let path = '';
1772
- if (index != null) {
1773
- if (method == null) method = body == null ? 'GET' : 'POST';
1774
- path = '/' + encodeURIComponent(index) + '/' + '_refresh';
1775
- } else {
1776
- if (method == null) method = body == null ? 'GET' : 'POST';
1777
- path = '/' + '_refresh';
1778
- }
1779
-
1780
- // build request object
1781
- const request = {
1782
- method,
1783
- path,
1784
- body: body || '',
1785
- querystring,
1786
- };
1787
-
1788
- return this.transport.request(request, options, callback);
1789
- };
1790
-
1791
- /**
1792
- * Returns information about any matching indices, aliases, and data streams
1793
- *
1794
- * @memberOf API-Index
1795
- *
1796
- * @param {Object} params
1797
- * @param {string} [params.name] - A comma-separated list of names or wildcard expressions
1798
- * @param {string} [params.expand_wildcards=open] - Whether wildcard expressions should get expanded to open or closed indices (options: open, closed, hidden, none, all)
1799
- *
1800
- * @param {Object} options - Options for {@link Transport#request}
1801
- * @param {function} callback - Callback that handles errors and response
1802
- *
1803
- * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
1804
- */
1805
- IndicesApi.prototype.resolveIndex = function indicesResolveIndexApi(params, options, callback) {
1806
- [params, options, callback] = normalizeArguments(params, options, callback);
1807
-
1808
- // check required parameters
1809
- if (params.name == null) {
1810
- const err = new this[kConfigurationError]('Missing required parameter: name');
1811
- return handleError(err, callback);
1812
- }
1813
-
1814
- let { method, body, name, ...querystring } = params;
1815
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
1816
-
1817
- let path = '';
1818
- if (method == null) method = 'GET';
1819
- path = '/' + '_resolve' + '/' + 'index' + '/' + encodeURIComponent(name);
1820
-
1821
- // build request object
1822
- const request = {
1823
- method,
1824
- path,
1825
- body: null,
1826
- querystring,
1827
- };
1828
-
1829
- return this.transport.request(request, options, callback);
1830
- };
1831
-
1832
- /**
1833
- * Updates an alias to point to a new index when the existing index is considered to be too large or too old.
1834
- * <br/> See Also: {@link https://opensearch.org/docs/latest/opensearch/data-streams/#step-5-rollover-a-data-stream OpenSearch - Rollover a data stream}
1835
- *
1836
- * @memberOf API-Index
1837
- *
1838
- * @param {Object} params
1839
- * @param {string} params.alias - The name of the alias to rollover
1840
- * @param {string} [params.new_index] - The name of the rollover index
1841
- * @param {string} [params.timeout] - Explicit operation timeout
1842
- * @param {boolean} [params.dry_run=false] - If set to true the rollover action will only be validated but not actually performed even if a condition matches.
1843
- * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
1844
- * @param {string} [params.wait_for_active_shards] - Set the number of active shards to wait for on the newly created rollover index before the operation returns.
1845
- * @param {Object} [params.body] - The conditions that needs to be met for executing rollover
1846
- *
1847
- * @param {Object} options - Options for {@link Transport#request}
1848
- * @param {function} callback - Callback that handles errors and response
1849
- *
1850
- * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
1851
- */
1852
- IndicesApi.prototype.rollover = function indicesRolloverApi(params, options, callback) {
1853
- [params, options, callback] = normalizeArguments(params, options, callback);
1854
-
1855
- // check required parameters
1856
- if (params.alias == null) {
1857
- const err = new this[kConfigurationError]('Missing required parameter: alias');
1858
- return handleError(err, callback);
1859
- }
1860
-
1861
- // check required url components
1862
- if ((params.new_index != null || params.newIndex != null) && params.alias == null) {
1863
- const err = new this[kConfigurationError]('Missing required parameter of the url: alias');
1864
- return handleError(err, callback);
1865
- }
1866
-
1867
- let { method, body, alias, newIndex, new_index, ...querystring } = params;
1868
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
1869
-
1870
- let path = '';
1871
- if (alias != null && (new_index || newIndex) != null) {
1872
- if (method == null) method = 'POST';
1873
- path =
1874
- '/' +
1875
- encodeURIComponent(alias) +
1876
- '/' +
1877
- '_rollover' +
1878
- '/' +
1879
- encodeURIComponent(new_index || newIndex);
1880
- } else {
1881
- if (method == null) method = 'POST';
1882
- path = '/' + encodeURIComponent(alias) + '/' + '_rollover';
1883
- }
1884
-
1885
- // build request object
1886
- const request = {
1887
- method,
1888
- path,
1889
- body: body || '',
1890
- querystring,
1891
- };
1892
-
1893
- return this.transport.request(request, options, callback);
1894
- };
1895
-
1896
- /**
1897
- * Provides low-level information about segments in a Lucene index.
1898
- *
1899
- * @memberOf API-Index
1900
- *
1901
- * @param {Object} params
1902
- * @param {string} [params.index] - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
1903
- * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
1904
- * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
1905
- * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
1906
- * @param {boolean} [params.verbose] - Includes detailed memory usage by Lucene.
1907
- *
1908
- * @param {Object} options - Options for {@link Transport#request}
1909
- * @param {function} callback - Callback that handles errors and response
1910
- *
1911
- * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
1912
- */
1913
- IndicesApi.prototype.segments = function indicesSegmentsApi(params, options, callback) {
1914
- [params, options, callback] = normalizeArguments(params, options, callback);
1915
-
1916
- let { method, body, index, ...querystring } = params;
1917
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
1918
-
1919
- let path = '';
1920
- if (index != null) {
1921
- if (method == null) method = 'GET';
1922
- path = '/' + encodeURIComponent(index) + '/' + '_segments';
1923
- } else {
1924
- if (method == null) method = 'GET';
1925
- path = '/' + '_segments';
1926
- }
1927
-
1928
- // build request object
1929
- const request = {
1930
- method,
1931
- path,
1932
- body: null,
1933
- querystring,
1934
- };
1935
-
1936
- return this.transport.request(request, options, callback);
1937
- };
1938
-
1939
- /**
1940
- * Provides store information for shard copies of indices.
1941
- *
1942
- * @memberOf API-Index
1943
- *
1944
- * @param {Object} params
1945
- * @param {string} [params.index] - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
1946
- * @param {string} [params.status] - A comma-separated list of statuses used to filter on shards to get store information for (options: green, yellow, red, all)
1947
- * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
1948
- * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
1949
- * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
1950
- *
1951
- * @param {Object} options - Options for {@link Transport#request}
1952
- * @param {function} callback - Callback that handles errors and response
1953
- *
1954
- * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
1955
- */
1956
- IndicesApi.prototype.shardStores = function indicesShardStoresApi(params, options, callback) {
1957
- [params, options, callback] = normalizeArguments(params, options, callback);
1958
-
1959
- let { method, body, index, ...querystring } = params;
1960
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
1961
-
1962
- let path = '';
1963
- if (index != null) {
1964
- if (method == null) method = 'GET';
1965
- path = '/' + encodeURIComponent(index) + '/' + '_shard_stores';
1966
- } else {
1967
- if (method == null) method = 'GET';
1968
- path = '/' + '_shard_stores';
1969
- }
1970
-
1971
- // build request object
1972
- const request = {
1973
- method,
1974
- path,
1975
- body: null,
1976
- querystring,
1977
- };
1978
-
1979
- return this.transport.request(request, options, callback);
1980
- };
1981
-
1982
- /**
1983
- * Allow to shrink an existing index into a new index with fewer primary shards.
1984
- * <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/index-apis/shrink-index/ OpenSearch - Shrink Index}
1985
- *
1986
- * @memberOf API-Index
1987
- *
1988
- * @param {Object} params
1989
- * @param {string} params.index - The name of the source index to shrink
1990
- * @param {string} params.target - The name of the target index to shrink into
1991
- * @param {boolean} [params.copy_settings] - whether or not to copy settings from the source index (defaults to false)
1992
- * @param {string} [params.timeout] - Explicit operation timeout
1993
- * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
1994
- * @param {string} [params.wait_for_active_shards] - Set the number of active shards to wait for on the shrunken index before the operation returns.
1995
- * @param {Object} [params.body] - The configuration for the target index (`settings` and `aliases`)
1996
- *
1997
- * @param {Object} options - Options for {@link Transport#request}
1998
- * @param {function} callback - Callback that handles errors and response
1999
- *
2000
- * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
2001
- */
2002
- IndicesApi.prototype.shrink = function indicesShrinkApi(params, options, callback) {
2003
- [params, options, callback] = normalizeArguments(params, options, callback);
2004
-
2005
- // check required parameters
2006
- if (params.index == null) {
2007
- const err = new this[kConfigurationError]('Missing required parameter: index');
2008
- return handleError(err, callback);
2009
- }
2010
- if (params.target == null) {
2011
- const err = new this[kConfigurationError]('Missing required parameter: target');
2012
- return handleError(err, callback);
2013
- }
2014
-
2015
- // check required url components
2016
- if (params.target != null && params.index == null) {
2017
- const err = new this[kConfigurationError]('Missing required parameter of the url: index');
2018
- return handleError(err, callback);
2019
- }
2020
-
2021
- let { method, body, index, target, ...querystring } = params;
2022
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
2023
-
2024
- let path = '';
2025
- if (method == null) method = 'PUT';
2026
- path = '/' + encodeURIComponent(index) + '/' + '_shrink' + '/' + encodeURIComponent(target);
2027
-
2028
- // build request object
2029
- const request = {
2030
- method,
2031
- path,
2032
- body: body || '',
2033
- querystring,
2034
- };
2035
-
2036
- return this.transport.request(request, options, callback);
2037
- };
2038
-
2039
- /**
2040
- * Simulate matching the given index name against the index templates in the system
2041
- *
2042
- * @memberOf API-Index
2043
- *
2044
- * @param {Object} params
2045
- * @param {string} params.name - The name of the index (it must be a concrete index name)
2046
- * @param {Object} [params.body] - New index template definition, which will be included in the simulation, as if it already exists in the system
2047
- * @param {boolean} [params.create] - Whether the index template we optionally defined in the body should only be dry-run added if new or can also replace an existing one
2048
- * @param {string} [params.cause] - User defined reason for dry-run creating the new template for simulation purposes
2049
- * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
2050
- *
2051
- * @param {Object} options - Options for {@link Transport#request}
2052
- * @param {function} callback - Callback that handles errors and response
2053
- *
2054
- * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
2055
- */
2056
- IndicesApi.prototype.simulateIndexTemplate = function indicesSimulateIndexTemplateApi(
2057
- params,
2058
- options,
2059
- callback
2060
- ) {
2061
- [params, options, callback] = normalizeArguments(params, options, callback);
2062
-
2063
- // check required parameters
2064
- if (params.name == null) {
2065
- const err = new this[kConfigurationError]('Missing required parameter: name');
2066
- return handleError(err, callback);
2067
- }
2068
-
2069
- let { method, body, name, ...querystring } = params;
2070
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
2071
-
2072
- let path = '';
2073
- if (method == null) method = 'POST';
2074
- path = '/' + '_index_template' + '/' + '_simulate_index' + '/' + encodeURIComponent(name);
2075
-
2076
- // build request object
2077
- const request = {
2078
- method,
2079
- path,
2080
- body: body || '',
2081
- querystring,
2082
- };
2083
-
2084
- return this.transport.request(request, options, callback);
2085
- };
2086
-
2087
- /**
2088
- * Simulate resolving the given template name or body (Deprecated. Use IndicesApi#simulateIndexTemplate instead)
2089
- *
2090
- * @memberOf API-Index
2091
- *
2092
- * @param {Object} params
2093
- * @param {string} [params.name] - The name of the index template
2094
- * @param {boolean} [params.create] - Whether the index template we optionally defined in the body should only be dry-run added if new or can also replace an existing one
2095
- * @param {string} [params.cause] - User defined reason for dry-run creating the new template for simulation purposes
2096
- * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
2097
- * @param {Object} [params.body] - New index template definition to be simulated, if no index template name is specified
2098
- *
2099
- * @param {Object} options - Options for {@link Transport#request}
2100
- * @param {function} callback - Callback that handles errors and response
2101
- *
2102
- * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
2103
- */
2104
- IndicesApi.prototype.simulateTemplate = function indicesSimulateTemplateApi(
2105
- params,
2106
- options,
2107
- callback
2108
- ) {
2109
- [params, options, callback] = normalizeArguments(params, options, callback);
2110
-
2111
- let { method, body, name, ...querystring } = params;
2112
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
2113
-
2114
- let path = '';
2115
- if (name != null) {
2116
- if (method == null) method = 'POST';
2117
- path = '/' + '_index_template' + '/' + '_simulate' + '/' + encodeURIComponent(name);
2118
- } else {
2119
- if (method == null) method = 'POST';
2120
- path = '/' + '_index_template' + '/' + '_simulate';
2121
- }
2122
-
2123
- // build request object
2124
- const request = {
2125
- method,
2126
- path,
2127
- body: body || '',
2128
- querystring,
2129
- };
2130
-
2131
- return this.transport.request(request, options, callback);
2132
- };
2133
-
2134
- /**
2135
- * Allows you to split an existing index into a new index with more primary shards.
2136
- * <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/index-apis/split/ OpenSearch - Split Index}
2137
- *
2138
- * @memberOf API-Index
2139
- *
2140
- * @param {Object} params
2141
- * @param {string} params.index - The name of the source index to split
2142
- * @param {string} params.target - The name of the target index to split into
2143
- * @param {boolean} [params.copy_settings] - whether or not to copy settings from the source index (defaults to false)
2144
- * @param {string} [params.timeout] - Explicit operation timeout
2145
- * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
2146
- * @param {string} [params.wait_for_active_shards] - Set the number of active shards to wait for on the shrunken index before the operation returns.
2147
- * @param {Object} [params.body] - The configuration for the target index (`settings` and `aliases`)
2148
- *
2149
- * @param {Object} options - Options for {@link Transport#request}
2150
- * @param {function} callback - Callback that handles errors and response
2151
- *
2152
- * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
2153
- */
2154
- IndicesApi.prototype.split = function indicesSplitApi(params, options, callback) {
2155
- [params, options, callback] = normalizeArguments(params, options, callback);
2156
-
2157
- // check required parameters
2158
- if (params.index == null) {
2159
- const err = new this[kConfigurationError]('Missing required parameter: index');
2160
- return handleError(err, callback);
2161
- }
2162
- if (params.target == null) {
2163
- const err = new this[kConfigurationError]('Missing required parameter: target');
2164
- return handleError(err, callback);
2165
- }
2166
-
2167
- // check required url components
2168
- if (params.target != null && params.index == null) {
2169
- const err = new this[kConfigurationError]('Missing required parameter of the url: index');
2170
- return handleError(err, callback);
2171
- }
2172
-
2173
- let { method, body, index, target, ...querystring } = params;
2174
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
2175
-
2176
- let path = '';
2177
- if (method == null) method = 'PUT';
2178
- path = '/' + encodeURIComponent(index) + '/' + '_split' + '/' + encodeURIComponent(target);
2179
-
2180
- // build request object
2181
- const request = {
2182
- method,
2183
- path,
2184
- body: body || '',
2185
- querystring,
2186
- };
2187
-
2188
- return this.transport.request(request, options, callback);
2189
- };
2190
-
2191
- /**
2192
- * Provides statistics on operations happening in an index.
2193
- *
2194
- * @memberOf API-Index
2195
- *
2196
- * @param {Object} params
2197
- * @param {string} [params.metric] - Limit the information returned the specific metrics. (options: _all, completion, docs, fielddata, query_cache, flush, get, indexing, merge, request_cache, refresh, search, segments, store, warmer, suggest)
2198
- * @param {string} [params.index] - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
2199
- * @param {string} [params.completion_fields] - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards)
2200
- * @param {string} [params.fielddata_fields] - A comma-separated list of fields for `fielddata` index metric (supports wildcards)
2201
- * @param {string} [params.fields] - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards)
2202
- * @param {string} [params.groups] - A comma-separated list of search groups for `search` index metric
2203
- * @param {string} [params.level] - Return stats aggregated at cluster, index or shard level (options: cluster, indices, shards)
2204
- * @param {string} [params.types] - A comma-separated list of document types for the `indexing` index metric
2205
- * @param {boolean} [params.include_segment_file_sizes] - Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested)
2206
- * @param {boolean} [params.include_unloaded_segments] - If set to true segment stats will include stats for segments that are not currently loaded into memory
2207
- * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
2208
- * @param {boolean} [params.forbid_closed_indices] - If set to false stats will also collected from closed indices if explicitly specified or if expand_wildcards expands to closed indices
2209
- *
2210
- * @param {Object} options - Options for {@link Transport#request}
2211
- * @param {function} callback - Callback that handles errors and response
2212
- *
2213
- * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
2214
- */
2215
- IndicesApi.prototype.stats = function indicesStatsApi(params, options, callback) {
2216
- [params, options, callback] = normalizeArguments(params, options, callback);
2217
-
2218
- let { method, body, metric, index, ...querystring } = params;
2219
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
2220
-
2221
- let path = '';
2222
- if (index != null && metric != null) {
2223
- if (method == null) method = 'GET';
2224
- path = '/' + encodeURIComponent(index) + '/' + '_stats' + '/' + encodeURIComponent(metric);
2225
- } else if (metric != null) {
2226
- if (method == null) method = 'GET';
2227
- path = '/' + '_stats' + '/' + encodeURIComponent(metric);
2228
- } else if (index != null) {
2229
- if (method == null) method = 'GET';
2230
- path = '/' + encodeURIComponent(index) + '/' + '_stats';
2231
- } else {
2232
- if (method == null) method = 'GET';
2233
- path = '/' + '_stats';
2234
- }
2235
-
2236
- // build request object
2237
- const request = {
2238
- method,
2239
- path,
2240
- body: null,
2241
- querystring,
2242
- };
2243
-
2244
- return this.transport.request(request, options, callback);
2245
- };
2246
-
2247
- /**
2248
- * Update an alias.
2249
- * <br/> See Also: {@link https://opensearch.org/docs/latest/opensearch/index-alias/ OpenSearch - Index Aliases}
2250
- *
2251
- * @memberOf API-Index
2252
- *
2253
- * @param {Object} params
2254
- * @param {Object} params.body - The definition of `actions` to perform
2255
- * @param {string} [params.timeout] - Request timeout
2256
- * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
2257
- *
2258
- * @param {Object} options - Options for {@link Transport#request}
2259
- * @param {function} callback - Callback that handles errors and response
2260
- *
2261
- * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
2262
- */
2263
- IndicesApi.prototype.updateAliases = function indicesUpdateAliasesApi(params, options, callback) {
2264
- [params, options, callback] = normalizeArguments(params, options, callback);
2265
-
2266
- // check required parameters
2267
- if (params.body == null) {
2268
- const err = new this[kConfigurationError]('Missing required parameter: body');
2269
- return handleError(err, callback);
2270
- }
2271
-
2272
- let { method, body, ...querystring } = params;
2273
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
2274
-
2275
- let path = '';
2276
- if (method == null) method = 'POST';
2277
- path = '/' + '_aliases';
2278
-
2279
- // build request object
2280
- const request = {
2281
- method,
2282
- path,
2283
- body: body || '',
2284
- querystring,
2285
- };
2286
-
2287
- return this.transport.request(request, options, callback);
2288
- };
2289
-
2290
- /**
2291
- * Upgrades to the current version of Lucene.
2292
- *
2293
- * @memberOf API-Index
2294
- *
2295
- * @param {Object} params
2296
- * @param {string} [params.index] - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
2297
- * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
2298
- * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
2299
- * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
2300
- * @param {boolean} [params.wait_for_completion=false] - Specify whether the request should block until the all segments are upgraded
2301
- * @param {boolean} [params.only_ancient_segments] - If true, only ancient (an older Lucene major release) segments will be upgraded
2302
- *
2303
- * @param {Object} options - Options for {@link Transport#request}
2304
- * @param {function} callback - Callback that handles errors and response
2305
- *
2306
- * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
2307
- */
2308
- IndicesApi.prototype.upgrade = function indicesUpgradeApi(params, options, callback) {
2309
- [params, options, callback] = normalizeArguments(params, options, callback);
2310
-
2311
- let { method, body, index, ...querystring } = params;
2312
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
2313
-
2314
- let path = '';
2315
- if (method == null) method = 'POST';
2316
- path = '/' + encodeURIComponent(index) + '/' + '_upgrade';
2317
-
2318
- // build request object
2319
- const request = {
2320
- method,
2321
- path,
2322
- body: body || '',
2323
- querystring,
2324
- };
2325
-
2326
- return this.transport.request(request, options, callback);
2327
- };
2328
-
2329
- /**
2330
- * Allows a user to validate a potentially expensive query without executing it.
2331
- *
2332
- * @memberOf API-Index
2333
- *
2334
- * @param {Object} params
2335
- * @param {string} params.index - A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices
2336
- * @param {boolean} [params.explain] - Return detailed information about the error
2337
- * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
2338
- * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
2339
- * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
2340
- * @param {string} [params.q] - Query in the Lucene query string syntax
2341
- * @param {string} [params.analyzer] - The analyzer to use for the query string
2342
- * @param {boolean} [params.analyze_wildcard=false] - Specify whether wildcard and prefix queries should be analyzed
2343
- * @param {string} [params.default_operator=OR] - The default operator for query string query (options: AND, OR)
2344
- * @param {string} [params.df] - The field to use as default where no field prefix is given in the query string
2345
- * @param {boolean} [params.lenient] - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
2346
- * @param {boolean} [params.rewrite] - Provide a more detailed explanation showing the actual Lucene query that will be executed.
2347
- * @param {boolean} [params.all_shards] - Execute validation on all shards instead of one random shard per index
2348
- * @param {Object} [params.body] - The query definition specified with the Query DSL
2349
- *
2350
- * @param {Object} options - Options for {@link Transport#request}
2351
- * @param {function} callback - Callback that handles errors and response
2352
- *
2353
- * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
2354
- */
2355
- IndicesApi.prototype.validateQuery = function indicesValidateQueryApi(params, options, callback) {
2356
- [params, options, callback] = normalizeArguments(params, options, callback);
2357
-
2358
- // check required url components
2359
- if (params.type != null && params.index == null) {
2360
- const err = new this[kConfigurationError]('Missing required parameter of the url: index');
2361
- return handleError(err, callback);
2362
- }
2363
-
2364
- let { method, body, index, type, ...querystring } = params;
2365
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
2366
-
2367
- let path = '';
2368
- if (index != null && type != null) {
2369
- if (method == null) method = body == null ? 'GET' : 'POST';
2370
- path =
2371
- '/' +
2372
- encodeURIComponent(index) +
2373
- '/' +
2374
- encodeURIComponent(type) +
2375
- '/' +
2376
- '_validate' +
2377
- '/' +
2378
- 'query';
2379
- } else if (index != null) {
2380
- if (method == null) method = body == null ? 'GET' : 'POST';
2381
- path = '/' + encodeURIComponent(index) + '/' + '_validate' + '/' + 'query';
2382
- } else {
2383
- if (method == null) method = body == null ? 'GET' : 'POST';
2384
- path = '/' + '_validate' + '/' + 'query';
2385
- }
2386
-
2387
- // build request object
2388
- const request = {
2389
- method,
2390
- path,
2391
- body: body || '',
2392
- querystring,
2393
- };
2394
-
2395
- return this.transport.request(request, options, callback);
2396
- };
2397
-
2398
- Object.defineProperties(IndicesApi.prototype, {
2399
- add_block: {
2400
- get() {
2401
- return this.addBlock;
2402
- },
2403
- },
2404
- clear_cache: {
2405
- get() {
2406
- return this.clearCache;
2407
- },
2408
- },
2409
- delete_alias: {
2410
- get() {
2411
- return this.deleteAlias;
2412
- },
2413
- },
2414
- delete_index_template: {
2415
- get() {
2416
- return this.deleteIndexTemplate;
2417
- },
2418
- },
2419
- delete_template: {
2420
- get() {
2421
- return this.deleteTemplate;
2422
- },
2423
- },
2424
- disk_usage: {
2425
- get() {
2426
- return this.diskUsage;
2427
- },
2428
- },
2429
- exists_alias: {
2430
- get() {
2431
- return this.existsAlias;
2432
- },
2433
- },
2434
- exists_index_template: {
2435
- get() {
2436
- return this.existsIndexTemplate;
2437
- },
2438
- },
2439
- exists_template: {
2440
- get() {
2441
- return this.existsTemplate;
2442
- },
2443
- },
2444
- field_usage_stats: {
2445
- get() {
2446
- return this.fieldUsageStats;
2447
- },
2448
- },
2449
- get_alias: {
2450
- get() {
2451
- return this.getAlias;
2452
- },
2453
- },
2454
- get_field_mapping: {
2455
- get() {
2456
- return this.getFieldMapping;
2457
- },
2458
- },
2459
- get_index_template: {
2460
- get() {
2461
- return this.getIndexTemplate;
2462
- },
2463
- },
2464
- get_mapping: {
2465
- get() {
2466
- return this.getMapping;
2467
- },
2468
- },
2469
- get_settings: {
2470
- get() {
2471
- return this.getSettings;
2472
- },
2473
- },
2474
- get_template: {
2475
- get() {
2476
- return this.getTemplate;
2477
- },
2478
- },
2479
- get_upgrade: {
2480
- get() {
2481
- return this.getUpgrade;
2482
- },
2483
- },
2484
- put_alias: {
2485
- get() {
2486
- return this.putAlias;
2487
- },
2488
- },
2489
- put_index_template: {
2490
- get() {
2491
- return this.putIndexTemplate;
2492
- },
2493
- },
2494
- put_mapping: {
2495
- get() {
2496
- return this.putMapping;
2497
- },
2498
- },
2499
- put_settings: {
2500
- get() {
2501
- return this.putSettings;
2502
- },
2503
- },
2504
- put_template: {
2505
- get() {
2506
- return this.putTemplate;
2507
- },
2508
- },
2509
- resolve_index: {
2510
- get() {
2511
- return this.resolveIndex;
2512
- },
2513
- },
2514
- shard_stores: {
2515
- get() {
2516
- return this.shardStores;
2517
- },
2518
- },
2519
- simulate_index_template: {
2520
- get() {
2521
- return this.simulateIndexTemplate;
2522
- },
2523
- },
2524
- simulate_template: {
2525
- get() {
2526
- return this.simulateTemplate;
2527
- },
2528
- },
2529
- update_aliases: {
2530
- get() {
2531
- return this.updateAliases;
2532
- },
2533
- },
2534
- validate_query: {
2535
- get() {
2536
- return this.validateQuery;
2537
- },
2538
- },
2539
- });
2540
-
2541
- module.exports = IndicesApi;