@elastic/elasticsearch 7.8.0 → 7.9.1
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.
- package/README.md +10 -2
- package/api/api/async_search.js +114 -0
- package/api/api/autoscaling.js +147 -0
- package/api/api/bulk.js +55 -98
- package/api/api/cat.js +648 -0
- package/api/api/ccr.js +403 -0
- package/api/api/clear_scroll.js +42 -69
- package/api/api/cluster.js +420 -0
- package/api/api/count.js +49 -98
- package/api/api/create.js +54 -92
- package/api/api/dangling_indices.js +115 -0
- package/api/api/delete.js +50 -89
- package/api/api/delete_by_query.js +55 -135
- package/api/api/delete_by_query_rethrottle.js +45 -74
- package/api/api/delete_script.js +41 -71
- package/api/api/enrich.js +173 -0
- package/api/api/eql.js +119 -0
- package/api/api/exists.js +50 -95
- package/api/api/exists_source.js +58 -101
- package/api/api/explain.js +50 -98
- package/api/api/field_caps.js +42 -78
- package/api/api/get.js +50 -95
- package/api/api/get_script.js +41 -70
- package/api/api/get_script_context.js +37 -64
- package/api/api/get_script_languages.js +37 -64
- package/api/api/get_source.js +50 -93
- package/api/api/graph.js +72 -0
- package/api/api/ilm.js +295 -0
- package/api/api/index.js +56 -98
- package/api/api/indices.js +1656 -0
- package/api/api/info.js +37 -64
- package/api/api/ingest.js +178 -0
- package/api/api/license.js +188 -0
- package/api/api/mget.js +55 -97
- package/api/api/migration.js +60 -0
- package/api/api/ml.js +1842 -0
- package/api/api/monitoring.js +66 -0
- package/api/api/msearch.js +55 -96
- package/api/api/msearch_template.js +55 -92
- package/api/api/mtermvectors.js +49 -91
- package/api/api/nodes.js +202 -0
- package/api/api/ping.js +37 -64
- package/api/api/put_script.js +55 -86
- package/api/api/rank_eval.js +46 -81
- package/api/api/reindex.js +41 -82
- package/api/api/reindex_rethrottle.js +45 -74
- package/api/api/render_search_template.js +42 -69
- package/api/api/rollup.js +278 -0
- package/api/api/scripts_painless_execute.js +37 -64
- package/api/api/scroll.js +42 -74
- package/api/api/search.js +49 -149
- package/api/api/search_shards.js +42 -78
- package/api/api/search_template.js +55 -103
- package/api/api/searchable_snapshots.js +159 -0
- package/api/api/security.js +805 -0
- package/api/api/slm.js +256 -0
- package/api/api/snapshot.js +363 -0
- package/api/api/sql.js +119 -0
- package/api/api/ssl.js +55 -0
- package/api/api/tasks.js +108 -0
- package/api/api/termvectors.js +52 -93
- package/api/api/transform.js +268 -0
- package/api/api/update.js +54 -102
- package/api/api/update_by_query.js +51 -135
- package/api/api/update_by_query_rethrottle.js +45 -74
- package/api/api/watcher.js +311 -0
- package/api/api/xpack.js +76 -0
- package/api/index.js +408 -655
- package/api/kibana.d.ts +459 -0
- package/api/requestParams.d.ts +875 -802
- package/api/utils.js +58 -0
- package/index.d.ts +2349 -2258
- package/index.js +97 -76
- package/index.mjs +10 -0
- package/lib/Connection.d.ts +1 -1
- package/lib/Connection.js +9 -4
- package/lib/Helpers.d.ts +5 -5
- package/lib/Helpers.js +4 -3
- package/lib/Transport.d.ts +8 -6
- package/lib/Transport.js +41 -26
- package/lib/errors.d.ts +7 -7
- package/package.json +12 -4
- package/api/api/async_search.delete.js +0 -78
- package/api/api/async_search.get.js +0 -82
- package/api/api/async_search.submit.js +0 -147
- package/api/api/autoscaling.delete_autoscaling_policy.js +0 -78
- package/api/api/autoscaling.get_autoscaling_decision.js +0 -72
- package/api/api/autoscaling.get_autoscaling_policy.js +0 -78
- package/api/api/autoscaling.put_autoscaling_policy.js +0 -82
- package/api/api/cat.aliases.js +0 -90
- package/api/api/cat.allocation.js +0 -91
- package/api/api/cat.count.js +0 -87
- package/api/api/cat.fielddata.js +0 -89
- package/api/api/cat.health.js +0 -84
- package/api/api/cat.help.js +0 -79
- package/api/api/cat.indices.js +0 -98
- package/api/api/cat.master.js +0 -85
- package/api/api/cat.ml_data_frame_analytics.js +0 -85
- package/api/api/cat.ml_datafeeds.js +0 -84
- package/api/api/cat.ml_jobs.js +0 -85
- package/api/api/cat.ml_trained_models.js +0 -87
- package/api/api/cat.nodeattrs.js +0 -85
- package/api/api/cat.nodes.js +0 -89
- package/api/api/cat.pending_tasks.js +0 -86
- package/api/api/cat.plugins.js +0 -85
- package/api/api/cat.recovery.js +0 -93
- package/api/api/cat.repositories.js +0 -85
- package/api/api/cat.segments.js +0 -88
- package/api/api/cat.shards.js +0 -92
- package/api/api/cat.snapshots.js +0 -92
- package/api/api/cat.tasks.js +0 -89
- package/api/api/cat.templates.js +0 -90
- package/api/api/cat.thread_pool.js +0 -92
- package/api/api/cat.transforms.js +0 -86
- package/api/api/ccr.delete_auto_follow_pattern.js +0 -78
- package/api/api/ccr.follow.js +0 -82
- package/api/api/ccr.follow_info.js +0 -78
- package/api/api/ccr.follow_stats.js +0 -78
- package/api/api/ccr.forget_follower.js +0 -82
- package/api/api/ccr.get_auto_follow_pattern.js +0 -77
- package/api/api/ccr.pause_auto_follow_pattern.js +0 -78
- package/api/api/ccr.pause_follow.js +0 -78
- package/api/api/ccr.put_auto_follow_pattern.js +0 -82
- package/api/api/ccr.resume_auto_follow_pattern.js +0 -78
- package/api/api/ccr.resume_follow.js +0 -78
- package/api/api/ccr.stats.js +0 -72
- package/api/api/ccr.unfollow.js +0 -78
- package/api/api/cluster.allocation_explain.js +0 -81
- package/api/api/cluster.delete_component_template.js +0 -86
- package/api/api/cluster.delete_voting_config_exclusions.js +0 -79
- package/api/api/cluster.exists_component_template.js +0 -86
- package/api/api/cluster.get_component_template.js +0 -85
- package/api/api/cluster.get_settings.js +0 -84
- package/api/api/cluster.health.js +0 -101
- package/api/api/cluster.pending_tasks.js +0 -81
- package/api/api/cluster.post_voting_config_exclusions.js +0 -82
- package/api/api/cluster.put_component_template.js +0 -91
- package/api/api/cluster.put_settings.js +0 -88
- package/api/api/cluster.remote_info.js +0 -77
- package/api/api/cluster.reroute.js +0 -86
- package/api/api/cluster.state.js +0 -106
- package/api/api/cluster.stats.js +0 -85
- package/api/api/enrich.delete_policy.js +0 -78
- package/api/api/enrich.execute_policy.js +0 -78
- package/api/api/enrich.get_policy.js +0 -77
- package/api/api/enrich.put_policy.js +0 -82
- package/api/api/enrich.stats.js +0 -72
- package/api/api/eql.search.js +0 -82
- package/api/api/graph.explore.js +0 -90
- package/api/api/ilm.delete_lifecycle.js +0 -78
- package/api/api/ilm.explain_lifecycle.js +0 -80
- package/api/api/ilm.get_lifecycle.js +0 -77
- package/api/api/ilm.get_status.js +0 -72
- package/api/api/ilm.move_to_step.js +0 -78
- package/api/api/ilm.put_lifecycle.js +0 -78
- package/api/api/ilm.remove_policy.js +0 -78
- package/api/api/ilm.retry.js +0 -78
- package/api/api/ilm.start.js +0 -72
- package/api/api/ilm.stop.js +0 -72
- package/api/api/indices.analyze.js +0 -83
- package/api/api/indices.clear_cache.js +0 -93
- package/api/api/indices.clone.js +0 -98
- package/api/api/indices.close.js +0 -94
- package/api/api/indices.create.js +0 -90
- package/api/api/indices.create_data_stream.js +0 -87
- package/api/api/indices.delete.js +0 -92
- package/api/api/indices.delete_alias.js +0 -101
- package/api/api/indices.delete_data_stream.js +0 -83
- package/api/api/indices.delete_index_template.js +0 -86
- package/api/api/indices.delete_template.js +0 -86
- package/api/api/indices.exists.js +0 -94
- package/api/api/indices.exists_alias.js +0 -95
- package/api/api/indices.exists_index_template.js +0 -88
- package/api/api/indices.exists_template.js +0 -88
- package/api/api/indices.exists_type.js +0 -100
- package/api/api/indices.flush.js +0 -91
- package/api/api/indices.flush_synced.js +0 -88
- package/api/api/indices.forcemerge.js +0 -93
- package/api/api/indices.freeze.js +0 -87
- package/api/api/indices.get.js +0 -98
- package/api/api/indices.get_alias.js +0 -95
- package/api/api/indices.get_data_streams.js +0 -82
- package/api/api/indices.get_field_mapping.js +0 -105
- package/api/api/indices.get_index_template.js +0 -87
- package/api/api/indices.get_mapping.js +0 -99
- package/api/api/indices.get_settings.js +0 -101
- package/api/api/indices.get_template.js +0 -89
- package/api/api/indices.get_upgrade.js +0 -88
- package/api/api/indices.open.js +0 -94
- package/api/api/indices.put_alias.js +0 -101
- package/api/api/indices.put_index_template.js +0 -91
- package/api/api/indices.put_mapping.js +0 -117
- package/api/api/indices.put_settings.js +0 -101
- package/api/api/indices.put_template.js +0 -93
- package/api/api/indices.recovery.js +0 -85
- package/api/api/indices.refresh.js +0 -88
- package/api/api/indices.reload_search_analyzers.js +0 -82
- package/api/api/indices.rollover.js +0 -104
- package/api/api/indices.segments.js +0 -89
- package/api/api/indices.shard_stores.js +0 -89
- package/api/api/indices.shrink.js +0 -100
- package/api/api/indices.simulate_index_template.js +0 -87
- package/api/api/indices.split.js +0 -100
- package/api/api/indices.stats.js +0 -104
- package/api/api/indices.unfreeze.js +0 -87
- package/api/api/indices.update_aliases.js +0 -86
- package/api/api/indices.upgrade.js +0 -92
- package/api/api/indices.validate_query.js +0 -109
- package/api/api/ingest.delete_pipeline.js +0 -86
- package/api/api/ingest.get_pipeline.js +0 -84
- package/api/api/ingest.processor_grok.js +0 -77
- package/api/api/ingest.put_pipeline.js +0 -90
- package/api/api/ingest.simulate.js +0 -89
- package/api/api/license.delete.js +0 -72
- package/api/api/license.get.js +0 -73
- package/api/api/license.get_basic_status.js +0 -72
- package/api/api/license.get_trial_status.js +0 -72
- package/api/api/license.post.js +0 -72
- package/api/api/license.post_start_basic.js +0 -72
- package/api/api/license.post_start_trial.js +0 -73
- package/api/api/migration.deprecations.js +0 -77
- package/api/api/ml.close_job.js +0 -81
- package/api/api/ml.delete_calendar.js +0 -78
- package/api/api/ml.delete_calendar_event.js +0 -88
- package/api/api/ml.delete_calendar_job.js +0 -88
- package/api/api/ml.delete_data_frame_analytics.js +0 -79
- package/api/api/ml.delete_datafeed.js +0 -78
- package/api/api/ml.delete_expired_data.js +0 -72
- package/api/api/ml.delete_filter.js +0 -78
- package/api/api/ml.delete_forecast.js +0 -91
- package/api/api/ml.delete_job.js +0 -79
- package/api/api/ml.delete_model_snapshot.js +0 -88
- package/api/api/ml.delete_trained_model.js +0 -78
- package/api/api/ml.estimate_model_memory.js +0 -78
- package/api/api/ml.evaluate_data_frame.js +0 -78
- package/api/api/ml.explain_data_frame_analytics.js +0 -77
- package/api/api/ml.find_file_structure.js +0 -99
- package/api/api/ml.flush_job.js +0 -84
- package/api/api/ml.forecast.js +0 -79
- package/api/api/ml.get_buckets.js +0 -99
- package/api/api/ml.get_calendar_events.js +0 -83
- package/api/api/ml.get_calendars.js +0 -78
- package/api/api/ml.get_categories.js +0 -90
- package/api/api/ml.get_data_frame_analytics.js +0 -80
- package/api/api/ml.get_data_frame_analytics_stats.js +0 -80
- package/api/api/ml.get_datafeed_stats.js +0 -77
- package/api/api/ml.get_datafeeds.js +0 -77
- package/api/api/ml.get_filters.js +0 -78
- package/api/api/ml.get_influencers.js +0 -87
- package/api/api/ml.get_job_stats.js +0 -77
- package/api/api/ml.get_jobs.js +0 -77
- package/api/api/ml.get_model_snapshots.js +0 -94
- package/api/api/ml.get_overall_buckets.js +0 -88
- package/api/api/ml.get_records.js +0 -87
- package/api/api/ml.get_trained_models.js +0 -85
- package/api/api/ml.get_trained_models_stats.js +0 -80
- package/api/api/ml.info.js +0 -72
- package/api/api/ml.open_job.js +0 -78
- package/api/api/ml.post_calendar_events.js +0 -82
- package/api/api/ml.post_data.js +0 -84
- package/api/api/ml.preview_datafeed.js +0 -78
- package/api/api/ml.put_calendar.js +0 -78
- package/api/api/ml.put_calendar_job.js +0 -88
- package/api/api/ml.put_data_frame_analytics.js +0 -82
- package/api/api/ml.put_datafeed.js +0 -88
- package/api/api/ml.put_filter.js +0 -82
- package/api/api/ml.put_job.js +0 -82
- package/api/api/ml.put_trained_model.js +0 -82
- package/api/api/ml.revert_model_snapshot.js +0 -88
- package/api/api/ml.set_upgrade_mode.js +0 -73
- package/api/api/ml.start_data_frame_analytics.js +0 -78
- package/api/api/ml.start_datafeed.js +0 -80
- package/api/api/ml.stop_data_frame_analytics.js +0 -81
- package/api/api/ml.stop_datafeed.js +0 -81
- package/api/api/ml.update_datafeed.js +0 -88
- package/api/api/ml.update_filter.js +0 -82
- package/api/api/ml.update_job.js +0 -82
- package/api/api/ml.update_model_snapshot.js +0 -92
- package/api/api/ml.validate.js +0 -78
- package/api/api/ml.validate_detector.js +0 -78
- package/api/api/monitoring.bulk.js +0 -87
- package/api/api/nodes.hot_threads.js +0 -98
- package/api/api/nodes.info.js +0 -91
- package/api/api/nodes.reload_secure_settings.js +0 -83
- package/api/api/nodes.stats.js +0 -105
- package/api/api/nodes.usage.js +0 -89
- package/api/api/rollup.delete_job.js +0 -78
- package/api/api/rollup.get_jobs.js +0 -77
- package/api/api/rollup.get_rollup_caps.js +0 -77
- package/api/api/rollup.get_rollup_index_caps.js +0 -78
- package/api/api/rollup.put_job.js +0 -82
- package/api/api/rollup.rollup_search.js +0 -95
- package/api/api/rollup.start_job.js +0 -78
- package/api/api/rollup.stop_job.js +0 -80
- package/api/api/searchable_snapshots.clear_cache.js +0 -83
- package/api/api/searchable_snapshots.mount.js +0 -94
- package/api/api/searchable_snapshots.repository_stats.js +0 -78
- package/api/api/searchable_snapshots.stats.js +0 -77
- package/api/api/security.authenticate.js +0 -72
- package/api/api/security.change_password.js +0 -83
- package/api/api/security.clear_cached_realms.js +0 -78
- package/api/api/security.clear_cached_roles.js +0 -78
- package/api/api/security.create_api_key.js +0 -78
- package/api/api/security.delete_privileges.js +0 -88
- package/api/api/security.delete_role.js +0 -78
- package/api/api/security.delete_role_mapping.js +0 -78
- package/api/api/security.delete_user.js +0 -78
- package/api/api/security.disable_user.js +0 -78
- package/api/api/security.enable_user.js +0 -78
- package/api/api/security.get_api_key.js +0 -77
- package/api/api/security.get_builtin_privileges.js +0 -72
- package/api/api/security.get_privileges.js +0 -86
- package/api/api/security.get_role.js +0 -77
- package/api/api/security.get_role_mapping.js +0 -77
- package/api/api/security.get_token.js +0 -78
- package/api/api/security.get_user.js +0 -77
- package/api/api/security.get_user_privileges.js +0 -72
- package/api/api/security.has_privileges.js +0 -83
- package/api/api/security.invalidate_api_key.js +0 -78
- package/api/api/security.invalidate_token.js +0 -78
- package/api/api/security.put_privileges.js +0 -78
- package/api/api/security.put_role.js +0 -82
- package/api/api/security.put_role_mapping.js +0 -82
- package/api/api/security.put_user.js +0 -82
- package/api/api/slm.delete_lifecycle.js +0 -78
- package/api/api/slm.execute_lifecycle.js +0 -78
- package/api/api/slm.execute_retention.js +0 -72
- package/api/api/slm.get_lifecycle.js +0 -77
- package/api/api/slm.get_stats.js +0 -72
- package/api/api/slm.get_status.js +0 -72
- package/api/api/slm.put_lifecycle.js +0 -78
- package/api/api/slm.start.js +0 -72
- package/api/api/slm.stop.js +0 -72
- package/api/api/snapshot.cleanup_repository.js +0 -86
- package/api/api/snapshot.create.js +0 -97
- package/api/api/snapshot.create_repository.js +0 -91
- package/api/api/snapshot.delete.js +0 -95
- package/api/api/snapshot.delete_repository.js +0 -86
- package/api/api/snapshot.get.js +0 -98
- package/api/api/snapshot.get_repository.js +0 -85
- package/api/api/snapshot.restore.js +0 -97
- package/api/api/snapshot.status.js +0 -95
- package/api/api/snapshot.verify_repository.js +0 -86
- package/api/api/sql.clear_cursor.js +0 -78
- package/api/api/sql.query.js +0 -78
- package/api/api/sql.translate.js +0 -78
- package/api/api/ssl.certificates.js +0 -72
- package/api/api/tasks.cancel.js +0 -88
- package/api/api/tasks.get.js +0 -86
- package/api/api/tasks.list.js +0 -87
- package/api/api/transform.delete_transform.js +0 -78
- package/api/api/transform.get_transform.js +0 -79
- package/api/api/transform.get_transform_stats.js +0 -80
- package/api/api/transform.preview_transform.js +0 -78
- package/api/api/transform.put_transform.js +0 -82
- package/api/api/transform.start_transform.js +0 -78
- package/api/api/transform.stop_transform.js +0 -84
- package/api/api/transform.update_transform.js +0 -82
- package/api/api/watcher.ack_watch.js +0 -89
- package/api/api/watcher.activate_watch.js +0 -78
- package/api/api/watcher.deactivate_watch.js +0 -78
- package/api/api/watcher.delete_watch.js +0 -78
- package/api/api/watcher.execute_watch.js +0 -77
- package/api/api/watcher.get_watch.js +0 -78
- package/api/api/watcher.put_watch.js +0 -82
- package/api/api/watcher.start.js +0 -72
- package/api/api/watcher.stats.js +0 -78
- package/api/api/watcher.stop.js +0 -72
- package/api/api/xpack.info.js +0 -72
- package/api/api/xpack.usage.js +0 -72
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Licensed to Elasticsearch B.V. under one or more contributor
|
|
3
|
+
* license agreements. See the NOTICE file distributed with
|
|
4
|
+
* this work for additional information regarding copyright
|
|
5
|
+
* ownership. Elasticsearch B.V. licenses this file to you under
|
|
6
|
+
* the Apache License, Version 2.0 (the "License"); you may
|
|
7
|
+
* not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing,
|
|
13
|
+
* software distributed under the License is distributed on an
|
|
14
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
* KIND, either express or implied. See the License for the
|
|
16
|
+
* specific language governing permissions and limitations
|
|
17
|
+
* under the License.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
'use strict'
|
|
21
|
+
|
|
22
|
+
/* eslint camelcase: 0 */
|
|
23
|
+
/* eslint no-unused-vars: 0 */
|
|
24
|
+
|
|
25
|
+
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
|
|
26
|
+
const acceptedQuerystring = ['force', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'from', 'size', 'allow_no_match', 'defer_validation', 'timeout', 'wait_for_completion', 'wait_for_checkpoint']
|
|
27
|
+
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path', allowNoMatch: 'allow_no_match', deferValidation: 'defer_validation', waitForCompletion: 'wait_for_completion', waitForCheckpoint: 'wait_for_checkpoint' }
|
|
28
|
+
|
|
29
|
+
function TransformApi (transport, ConfigurationError) {
|
|
30
|
+
this.transport = transport
|
|
31
|
+
this[kConfigurationError] = ConfigurationError
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
TransformApi.prototype.deleteTransform = function transformDeleteTransformApi (params, options, callback) {
|
|
35
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
36
|
+
|
|
37
|
+
// check required parameters
|
|
38
|
+
if (params['transform_id'] == null && params['transformId'] == null) {
|
|
39
|
+
const err = new this[kConfigurationError]('Missing required parameter: transform_id or transformId')
|
|
40
|
+
return handleError(err, callback)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
var { method, body, transformId, transform_id, ...querystring } = params
|
|
44
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
45
|
+
|
|
46
|
+
var path = ''
|
|
47
|
+
if (method == null) method = 'DELETE'
|
|
48
|
+
path = '/' + '_transform' + '/' + encodeURIComponent(transform_id || transformId)
|
|
49
|
+
|
|
50
|
+
// build request object
|
|
51
|
+
const request = {
|
|
52
|
+
method,
|
|
53
|
+
path,
|
|
54
|
+
body: body || '',
|
|
55
|
+
querystring
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return this.transport.request(request, options, callback)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
TransformApi.prototype.getTransform = function transformGetTransformApi (params, options, callback) {
|
|
62
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
63
|
+
|
|
64
|
+
var { method, body, transformId, transform_id, ...querystring } = params
|
|
65
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
66
|
+
|
|
67
|
+
var path = ''
|
|
68
|
+
if ((transform_id || transformId) != null) {
|
|
69
|
+
if (method == null) method = 'GET'
|
|
70
|
+
path = '/' + '_transform' + '/' + encodeURIComponent(transform_id || transformId)
|
|
71
|
+
} else {
|
|
72
|
+
if (method == null) method = 'GET'
|
|
73
|
+
path = '/' + '_transform'
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// build request object
|
|
77
|
+
const request = {
|
|
78
|
+
method,
|
|
79
|
+
path,
|
|
80
|
+
body: null,
|
|
81
|
+
querystring
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return this.transport.request(request, options, callback)
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
TransformApi.prototype.getTransformStats = function transformGetTransformStatsApi (params, options, callback) {
|
|
88
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
89
|
+
|
|
90
|
+
// check required parameters
|
|
91
|
+
if (params['transform_id'] == null && params['transformId'] == null) {
|
|
92
|
+
const err = new this[kConfigurationError]('Missing required parameter: transform_id or transformId')
|
|
93
|
+
return handleError(err, callback)
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
var { method, body, transformId, transform_id, ...querystring } = params
|
|
97
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
98
|
+
|
|
99
|
+
var path = ''
|
|
100
|
+
if (method == null) method = 'GET'
|
|
101
|
+
path = '/' + '_transform' + '/' + encodeURIComponent(transform_id || transformId) + '/' + '_stats'
|
|
102
|
+
|
|
103
|
+
// build request object
|
|
104
|
+
const request = {
|
|
105
|
+
method,
|
|
106
|
+
path,
|
|
107
|
+
body: null,
|
|
108
|
+
querystring
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return this.transport.request(request, options, callback)
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
TransformApi.prototype.previewTransform = function transformPreviewTransformApi (params, options, callback) {
|
|
115
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
116
|
+
|
|
117
|
+
// check required parameters
|
|
118
|
+
if (params['body'] == null) {
|
|
119
|
+
const err = new this[kConfigurationError]('Missing required parameter: body')
|
|
120
|
+
return handleError(err, callback)
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
var { method, body, ...querystring } = params
|
|
124
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
125
|
+
|
|
126
|
+
var path = ''
|
|
127
|
+
if (method == null) method = 'POST'
|
|
128
|
+
path = '/' + '_transform' + '/' + '_preview'
|
|
129
|
+
|
|
130
|
+
// build request object
|
|
131
|
+
const request = {
|
|
132
|
+
method,
|
|
133
|
+
path,
|
|
134
|
+
body: body || '',
|
|
135
|
+
querystring
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
return this.transport.request(request, options, callback)
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
TransformApi.prototype.putTransform = function transformPutTransformApi (params, options, callback) {
|
|
142
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
143
|
+
|
|
144
|
+
// check required parameters
|
|
145
|
+
if (params['transform_id'] == null && params['transformId'] == null) {
|
|
146
|
+
const err = new this[kConfigurationError]('Missing required parameter: transform_id or transformId')
|
|
147
|
+
return handleError(err, callback)
|
|
148
|
+
}
|
|
149
|
+
if (params['body'] == null) {
|
|
150
|
+
const err = new this[kConfigurationError]('Missing required parameter: body')
|
|
151
|
+
return handleError(err, callback)
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
var { method, body, transformId, transform_id, ...querystring } = params
|
|
155
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
156
|
+
|
|
157
|
+
var path = ''
|
|
158
|
+
if (method == null) method = 'PUT'
|
|
159
|
+
path = '/' + '_transform' + '/' + encodeURIComponent(transform_id || transformId)
|
|
160
|
+
|
|
161
|
+
// build request object
|
|
162
|
+
const request = {
|
|
163
|
+
method,
|
|
164
|
+
path,
|
|
165
|
+
body: body || '',
|
|
166
|
+
querystring
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
return this.transport.request(request, options, callback)
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
TransformApi.prototype.startTransform = function transformStartTransformApi (params, options, callback) {
|
|
173
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
174
|
+
|
|
175
|
+
// check required parameters
|
|
176
|
+
if (params['transform_id'] == null && params['transformId'] == null) {
|
|
177
|
+
const err = new this[kConfigurationError]('Missing required parameter: transform_id or transformId')
|
|
178
|
+
return handleError(err, callback)
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
var { method, body, transformId, transform_id, ...querystring } = params
|
|
182
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
183
|
+
|
|
184
|
+
var path = ''
|
|
185
|
+
if (method == null) method = 'POST'
|
|
186
|
+
path = '/' + '_transform' + '/' + encodeURIComponent(transform_id || transformId) + '/' + '_start'
|
|
187
|
+
|
|
188
|
+
// build request object
|
|
189
|
+
const request = {
|
|
190
|
+
method,
|
|
191
|
+
path,
|
|
192
|
+
body: body || '',
|
|
193
|
+
querystring
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
return this.transport.request(request, options, callback)
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
TransformApi.prototype.stopTransform = function transformStopTransformApi (params, options, callback) {
|
|
200
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
201
|
+
|
|
202
|
+
// check required parameters
|
|
203
|
+
if (params['transform_id'] == null && params['transformId'] == null) {
|
|
204
|
+
const err = new this[kConfigurationError]('Missing required parameter: transform_id or transformId')
|
|
205
|
+
return handleError(err, callback)
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
var { method, body, transformId, transform_id, ...querystring } = params
|
|
209
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
210
|
+
|
|
211
|
+
var path = ''
|
|
212
|
+
if (method == null) method = 'POST'
|
|
213
|
+
path = '/' + '_transform' + '/' + encodeURIComponent(transform_id || transformId) + '/' + '_stop'
|
|
214
|
+
|
|
215
|
+
// build request object
|
|
216
|
+
const request = {
|
|
217
|
+
method,
|
|
218
|
+
path,
|
|
219
|
+
body: body || '',
|
|
220
|
+
querystring
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
return this.transport.request(request, options, callback)
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
TransformApi.prototype.updateTransform = function transformUpdateTransformApi (params, options, callback) {
|
|
227
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
228
|
+
|
|
229
|
+
// check required parameters
|
|
230
|
+
if (params['transform_id'] == null && params['transformId'] == null) {
|
|
231
|
+
const err = new this[kConfigurationError]('Missing required parameter: transform_id or transformId')
|
|
232
|
+
return handleError(err, callback)
|
|
233
|
+
}
|
|
234
|
+
if (params['body'] == null) {
|
|
235
|
+
const err = new this[kConfigurationError]('Missing required parameter: body')
|
|
236
|
+
return handleError(err, callback)
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
var { method, body, transformId, transform_id, ...querystring } = params
|
|
240
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
241
|
+
|
|
242
|
+
var path = ''
|
|
243
|
+
if (method == null) method = 'POST'
|
|
244
|
+
path = '/' + '_transform' + '/' + encodeURIComponent(transform_id || transformId) + '/' + '_update'
|
|
245
|
+
|
|
246
|
+
// build request object
|
|
247
|
+
const request = {
|
|
248
|
+
method,
|
|
249
|
+
path,
|
|
250
|
+
body: body || '',
|
|
251
|
+
querystring
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
return this.transport.request(request, options, callback)
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
Object.defineProperties(TransformApi.prototype, {
|
|
258
|
+
delete_transform: { get () { return this.deleteTransform } },
|
|
259
|
+
get_transform: { get () { return this.getTransform } },
|
|
260
|
+
get_transform_stats: { get () { return this.getTransformStats } },
|
|
261
|
+
preview_transform: { get () { return this.previewTransform } },
|
|
262
|
+
put_transform: { get () { return this.putTransform } },
|
|
263
|
+
start_transform: { get () { return this.startTransform } },
|
|
264
|
+
stop_transform: { get () { return this.stopTransform } },
|
|
265
|
+
update_transform: { get () { return this.updateTransform } }
|
|
266
|
+
})
|
|
267
|
+
|
|
268
|
+
module.exports = TransformApi
|
package/api/api/update.js
CHANGED
|
@@ -1,117 +1,69 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Licensed to Elasticsearch B.V. under one or more contributor
|
|
3
|
+
* license agreements. See the NOTICE file distributed with
|
|
4
|
+
* this work for additional information regarding copyright
|
|
5
|
+
* ownership. Elasticsearch B.V. licenses this file to you under
|
|
6
|
+
* the Apache License, Version 2.0 (the "License"); you may
|
|
7
|
+
* not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing,
|
|
13
|
+
* software distributed under the License is distributed on an
|
|
14
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
* KIND, either express or implied. See the License for the
|
|
16
|
+
* specific language governing permissions and limitations
|
|
17
|
+
* under the License.
|
|
18
|
+
*/
|
|
4
19
|
|
|
5
20
|
'use strict'
|
|
6
21
|
|
|
7
22
|
/* eslint camelcase: 0 */
|
|
8
23
|
/* eslint no-unused-vars: 0 */
|
|
9
24
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
25
|
+
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
|
|
26
|
+
const acceptedQuerystring = ['wait_for_active_shards', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'lang', 'refresh', 'retry_on_conflict', 'routing', 'timeout', 'if_seq_no', 'if_primary_term', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
|
|
27
|
+
const snakeCase = { waitForActiveShards: 'wait_for_active_shards', _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', retryOnConflict: 'retry_on_conflict', ifSeqNo: 'if_seq_no', ifPrimaryTerm: 'if_primary_term', errorTrace: 'error_trace', filterPath: 'filter_path' }
|
|
13
28
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
'_source',
|
|
17
|
-
'_source_excludes',
|
|
18
|
-
'_source_exclude',
|
|
19
|
-
'_source_includes',
|
|
20
|
-
'_source_include',
|
|
21
|
-
'lang',
|
|
22
|
-
'refresh',
|
|
23
|
-
'retry_on_conflict',
|
|
24
|
-
'routing',
|
|
25
|
-
'timeout',
|
|
26
|
-
'if_seq_no',
|
|
27
|
-
'if_primary_term',
|
|
28
|
-
'pretty',
|
|
29
|
-
'human',
|
|
30
|
-
'error_trace',
|
|
31
|
-
'source',
|
|
32
|
-
'filter_path'
|
|
33
|
-
]
|
|
29
|
+
function updateApi (params, options, callback) {
|
|
30
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
34
31
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
32
|
+
// check required parameters
|
|
33
|
+
if (params['id'] == null) {
|
|
34
|
+
const err = new this[kConfigurationError]('Missing required parameter: id')
|
|
35
|
+
return handleError(err, callback)
|
|
36
|
+
}
|
|
37
|
+
if (params['index'] == null) {
|
|
38
|
+
const err = new this[kConfigurationError]('Missing required parameter: index')
|
|
39
|
+
return handleError(err, callback)
|
|
40
|
+
}
|
|
41
|
+
if (params['body'] == null) {
|
|
42
|
+
const err = new this[kConfigurationError]('Missing required parameter: body')
|
|
43
|
+
return handleError(err, callback)
|
|
46
44
|
}
|
|
47
45
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
* Updates a document with a script or partial document.
|
|
51
|
-
* https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update.html
|
|
52
|
-
*/
|
|
53
|
-
return function update (params, options, callback) {
|
|
54
|
-
options = options || {}
|
|
55
|
-
if (typeof options === 'function') {
|
|
56
|
-
callback = options
|
|
57
|
-
options = {}
|
|
58
|
-
}
|
|
59
|
-
if (typeof params === 'function' || params == null) {
|
|
60
|
-
callback = params
|
|
61
|
-
params = {}
|
|
62
|
-
options = {}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// check required parameters
|
|
66
|
-
if (params['id'] == null) {
|
|
67
|
-
const err = new ConfigurationError('Missing required parameter: id')
|
|
68
|
-
return handleError(err, callback)
|
|
69
|
-
}
|
|
70
|
-
if (params['index'] == null) {
|
|
71
|
-
const err = new ConfigurationError('Missing required parameter: index')
|
|
72
|
-
return handleError(err, callback)
|
|
73
|
-
}
|
|
74
|
-
if (params['body'] == null) {
|
|
75
|
-
const err = new ConfigurationError('Missing required parameter: body')
|
|
76
|
-
return handleError(err, callback)
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// validate headers object
|
|
80
|
-
if (options.headers != null && typeof options.headers !== 'object') {
|
|
81
|
-
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
|
82
|
-
return handleError(err, callback)
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
var warnings = []
|
|
86
|
-
var { method, body, id, index, type, ...querystring } = params
|
|
87
|
-
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
|
88
|
-
|
|
89
|
-
var ignore = options.ignore
|
|
90
|
-
if (typeof ignore === 'number') {
|
|
91
|
-
options.ignore = [ignore]
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
var path = ''
|
|
95
|
-
|
|
96
|
-
if ((index) != null && (type) != null && (id) != null) {
|
|
97
|
-
if (method == null) method = 'POST'
|
|
98
|
-
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_update'
|
|
99
|
-
} else {
|
|
100
|
-
if (method == null) method = 'POST'
|
|
101
|
-
path = '/' + encodeURIComponent(index) + '/' + '_update' + '/' + encodeURIComponent(id)
|
|
102
|
-
}
|
|
46
|
+
var { method, body, id, index, type, ...querystring } = params
|
|
47
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
103
48
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
49
|
+
var path = ''
|
|
50
|
+
if ((index) != null && (type) != null && (id) != null) {
|
|
51
|
+
if (method == null) method = 'POST'
|
|
52
|
+
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_update'
|
|
53
|
+
} else {
|
|
54
|
+
if (method == null) method = 'POST'
|
|
55
|
+
path = '/' + encodeURIComponent(index) + '/' + '_update' + '/' + encodeURIComponent(id)
|
|
56
|
+
}
|
|
111
57
|
|
|
112
|
-
|
|
113
|
-
|
|
58
|
+
// build request object
|
|
59
|
+
const request = {
|
|
60
|
+
method,
|
|
61
|
+
path,
|
|
62
|
+
body: body || '',
|
|
63
|
+
querystring
|
|
114
64
|
}
|
|
65
|
+
|
|
66
|
+
return this.transport.request(request, options, callback)
|
|
115
67
|
}
|
|
116
68
|
|
|
117
|
-
module.exports =
|
|
69
|
+
module.exports = updateApi
|
|
@@ -1,151 +1,67 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Licensed to Elasticsearch B.V. under one or more contributor
|
|
3
|
+
* license agreements. See the NOTICE file distributed with
|
|
4
|
+
* this work for additional information regarding copyright
|
|
5
|
+
* ownership. Elasticsearch B.V. licenses this file to you under
|
|
6
|
+
* the Apache License, Version 2.0 (the "License"); you may
|
|
7
|
+
* not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing,
|
|
13
|
+
* software distributed under the License is distributed on an
|
|
14
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
* KIND, either express or implied. See the License for the
|
|
16
|
+
* specific language governing permissions and limitations
|
|
17
|
+
* under the License.
|
|
18
|
+
*/
|
|
4
19
|
|
|
5
20
|
'use strict'
|
|
6
21
|
|
|
7
22
|
/* eslint camelcase: 0 */
|
|
8
23
|
/* eslint no-unused-vars: 0 */
|
|
9
24
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
25
|
+
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
|
|
26
|
+
const acceptedQuerystring = ['analyzer', 'analyze_wildcard', 'default_operator', 'df', 'from', 'ignore_unavailable', 'allow_no_indices', 'conflicts', 'expand_wildcards', 'lenient', 'pipeline', 'preference', 'q', 'routing', 'scroll', 'search_type', 'search_timeout', 'size', 'max_docs', 'sort', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'terminate_after', 'stats', 'version', 'version_type', 'request_cache', 'refresh', 'timeout', 'wait_for_active_shards', 'scroll_size', 'wait_for_completion', 'requests_per_second', 'slices', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
|
|
27
|
+
const snakeCase = { analyzeWildcard: 'analyze_wildcard', defaultOperator: 'default_operator', ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices', expandWildcards: 'expand_wildcards', searchType: 'search_type', searchTimeout: 'search_timeout', maxDocs: 'max_docs', _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', terminateAfter: 'terminate_after', versionType: 'version_type', requestCache: 'request_cache', waitForActiveShards: 'wait_for_active_shards', scrollSize: 'scroll_size', waitForCompletion: 'wait_for_completion', requestsPerSecond: 'requests_per_second', errorTrace: 'error_trace', filterPath: 'filter_path' }
|
|
13
28
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
'analyze_wildcard',
|
|
17
|
-
'default_operator',
|
|
18
|
-
'df',
|
|
19
|
-
'from',
|
|
20
|
-
'ignore_unavailable',
|
|
21
|
-
'allow_no_indices',
|
|
22
|
-
'conflicts',
|
|
23
|
-
'expand_wildcards',
|
|
24
|
-
'lenient',
|
|
25
|
-
'pipeline',
|
|
26
|
-
'preference',
|
|
27
|
-
'q',
|
|
28
|
-
'routing',
|
|
29
|
-
'scroll',
|
|
30
|
-
'search_type',
|
|
31
|
-
'search_timeout',
|
|
32
|
-
'size',
|
|
33
|
-
'max_docs',
|
|
34
|
-
'sort',
|
|
35
|
-
'_source',
|
|
36
|
-
'_source_excludes',
|
|
37
|
-
'_source_exclude',
|
|
38
|
-
'_source_includes',
|
|
39
|
-
'_source_include',
|
|
40
|
-
'terminate_after',
|
|
41
|
-
'stats',
|
|
42
|
-
'version',
|
|
43
|
-
'version_type',
|
|
44
|
-
'request_cache',
|
|
45
|
-
'refresh',
|
|
46
|
-
'timeout',
|
|
47
|
-
'wait_for_active_shards',
|
|
48
|
-
'scroll_size',
|
|
49
|
-
'wait_for_completion',
|
|
50
|
-
'requests_per_second',
|
|
51
|
-
'slices',
|
|
52
|
-
'pretty',
|
|
53
|
-
'human',
|
|
54
|
-
'error_trace',
|
|
55
|
-
'source',
|
|
56
|
-
'filter_path'
|
|
57
|
-
]
|
|
29
|
+
function updateByQueryApi (params, options, callback) {
|
|
30
|
+
;[params, options, callback] = normalizeArguments(params, options, callback)
|
|
58
31
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
allowNoIndices: 'allow_no_indices',
|
|
64
|
-
expandWildcards: 'expand_wildcards',
|
|
65
|
-
searchType: 'search_type',
|
|
66
|
-
searchTimeout: 'search_timeout',
|
|
67
|
-
maxDocs: 'max_docs',
|
|
68
|
-
_sourceExcludes: '_source_excludes',
|
|
69
|
-
_sourceExclude: '_source_exclude',
|
|
70
|
-
_sourceIncludes: '_source_includes',
|
|
71
|
-
_sourceInclude: '_source_include',
|
|
72
|
-
terminateAfter: 'terminate_after',
|
|
73
|
-
versionType: 'version_type',
|
|
74
|
-
requestCache: 'request_cache',
|
|
75
|
-
waitForActiveShards: 'wait_for_active_shards',
|
|
76
|
-
scrollSize: 'scroll_size',
|
|
77
|
-
waitForCompletion: 'wait_for_completion',
|
|
78
|
-
requestsPerSecond: 'requests_per_second',
|
|
79
|
-
errorTrace: 'error_trace',
|
|
80
|
-
filterPath: 'filter_path'
|
|
32
|
+
// check required parameters
|
|
33
|
+
if (params['index'] == null) {
|
|
34
|
+
const err = new this[kConfigurationError]('Missing required parameter: index')
|
|
35
|
+
return handleError(err, callback)
|
|
81
36
|
}
|
|
82
37
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
*/
|
|
89
|
-
return function updateByQuery (params, options, callback) {
|
|
90
|
-
options = options || {}
|
|
91
|
-
if (typeof options === 'function') {
|
|
92
|
-
callback = options
|
|
93
|
-
options = {}
|
|
94
|
-
}
|
|
95
|
-
if (typeof params === 'function' || params == null) {
|
|
96
|
-
callback = params
|
|
97
|
-
params = {}
|
|
98
|
-
options = {}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
// check required parameters
|
|
102
|
-
if (params['index'] == null) {
|
|
103
|
-
const err = new ConfigurationError('Missing required parameter: index')
|
|
104
|
-
return handleError(err, callback)
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// check required url components
|
|
108
|
-
if (params['type'] != null && (params['index'] == null)) {
|
|
109
|
-
const err = new ConfigurationError('Missing required parameter of the url: index')
|
|
110
|
-
return handleError(err, callback)
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
// validate headers object
|
|
114
|
-
if (options.headers != null && typeof options.headers !== 'object') {
|
|
115
|
-
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
|
116
|
-
return handleError(err, callback)
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
var warnings = []
|
|
120
|
-
var { method, body, index, type, ...querystring } = params
|
|
121
|
-
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
|
122
|
-
|
|
123
|
-
var ignore = options.ignore
|
|
124
|
-
if (typeof ignore === 'number') {
|
|
125
|
-
options.ignore = [ignore]
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
var path = ''
|
|
38
|
+
// check required url components
|
|
39
|
+
if (params['type'] != null && (params['index'] == null)) {
|
|
40
|
+
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
|
|
41
|
+
return handleError(err, callback)
|
|
42
|
+
}
|
|
129
43
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_update_by_query'
|
|
133
|
-
} else {
|
|
134
|
-
if (method == null) method = 'POST'
|
|
135
|
-
path = '/' + encodeURIComponent(index) + '/' + '_update_by_query'
|
|
136
|
-
}
|
|
44
|
+
var { method, body, index, type, ...querystring } = params
|
|
45
|
+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
|
137
46
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
47
|
+
var path = ''
|
|
48
|
+
if ((index) != null && (type) != null) {
|
|
49
|
+
if (method == null) method = 'POST'
|
|
50
|
+
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_update_by_query'
|
|
51
|
+
} else {
|
|
52
|
+
if (method == null) method = 'POST'
|
|
53
|
+
path = '/' + encodeURIComponent(index) + '/' + '_update_by_query'
|
|
54
|
+
}
|
|
145
55
|
|
|
146
|
-
|
|
147
|
-
|
|
56
|
+
// build request object
|
|
57
|
+
const request = {
|
|
58
|
+
method,
|
|
59
|
+
path,
|
|
60
|
+
body: body || '',
|
|
61
|
+
querystring
|
|
148
62
|
}
|
|
63
|
+
|
|
64
|
+
return this.transport.request(request, options, callback)
|
|
149
65
|
}
|
|
150
66
|
|
|
151
|
-
module.exports =
|
|
67
|
+
module.exports = updateByQueryApi
|