From d24fff058e606b3b8180de9e216f30b7dda7dc5c Mon Sep 17 00:00:00 2001 From: delvedor Date: Wed, 23 Sep 2020 11:45:00 +0200 Subject: [PATCH] API generation --- api/api/async_search.delete.js | 78 - api/api/async_search.get.js | 82 - api/api/async_search.submit.js | 147 -- .../autoscaling.delete_autoscaling_policy.js | 78 - .../autoscaling.get_autoscaling_decision.js | 72 - api/api/autoscaling.get_autoscaling_policy.js | 78 - api/api/autoscaling.put_autoscaling_policy.js | 82 - api/api/bulk.js | 55 +- api/api/cat.aliases.js | 90 - api/api/cat.allocation.js | 91 - api/api/cat.count.js | 87 - api/api/cat.fielddata.js | 89 - api/api/cat.health.js | 84 - api/api/cat.help.js | 79 - api/api/cat.indices.js | 98 - api/api/cat.js | 2 +- api/api/cat.master.js | 85 - api/api/cat.ml_data_frame_analytics.js | 85 - api/api/cat.ml_datafeeds.js | 84 - api/api/cat.ml_jobs.js | 85 - api/api/cat.ml_trained_models.js | 87 - api/api/cat.nodeattrs.js | 85 - api/api/cat.nodes.js | 89 - api/api/cat.pending_tasks.js | 86 - api/api/cat.plugins.js | 85 - api/api/cat.recovery.js | 93 - api/api/cat.repositories.js | 85 - api/api/cat.segments.js | 88 - api/api/cat.shards.js | 92 - api/api/cat.snapshots.js | 92 - api/api/cat.tasks.js | 89 - api/api/cat.templates.js | 90 - api/api/cat.thread_pool.js | 92 - api/api/cat.transforms.js | 86 - api/api/ccr.delete_auto_follow_pattern.js | 78 - api/api/ccr.follow.js | 82 - api/api/ccr.follow_info.js | 78 - api/api/ccr.follow_stats.js | 78 - api/api/ccr.forget_follower.js | 82 - api/api/ccr.get_auto_follow_pattern.js | 77 - api/api/ccr.pause_auto_follow_pattern.js | 78 - api/api/ccr.pause_follow.js | 78 - api/api/ccr.put_auto_follow_pattern.js | 82 - api/api/ccr.resume_auto_follow_pattern.js | 78 - api/api/ccr.resume_follow.js | 78 - api/api/ccr.stats.js | 72 - api/api/ccr.unfollow.js | 78 - api/api/clear_scroll.js | 21 +- api/api/close_point_in_time.js | 101 - api/api/cluster.allocation_explain.js | 81 - api/api/cluster.delete_component_template.js | 86 - ...cluster.delete_voting_config_exclusions.js | 79 - api/api/cluster.exists_component_template.js | 86 - api/api/cluster.get_component_template.js | 85 - api/api/cluster.get_settings.js | 84 - api/api/cluster.health.js | 101 - api/api/cluster.pending_tasks.js | 81 - .../cluster.post_voting_config_exclusions.js | 82 - api/api/cluster.put_component_template.js | 91 - api/api/cluster.put_settings.js | 88 - api/api/cluster.remote_info.js | 77 - api/api/cluster.reroute.js | 86 - api/api/cluster.state.js | 106 - api/api/cluster.stats.js | 85 - api/api/count.js | 98 +- api/api/create.js | 21 +- .../dangling_indices.delete_dangling_index.js | 88 - .../dangling_indices.import_dangling_index.js | 88 - .../dangling_indices.list_dangling_indices.js | 77 - api/api/delete.js | 21 +- api/api/delete_by_query.js | 166 +- api/api/delete_by_query_rethrottle.js | 21 +- api/api/delete_script.js | 21 +- api/api/enrich.delete_policy.js | 78 - api/api/enrich.execute_policy.js | 78 - api/api/enrich.get_policy.js | 77 - api/api/enrich.put_policy.js | 82 - api/api/enrich.stats.js | 72 - api/api/eql.delete.js | 78 - api/api/eql.get.js | 80 - api/api/eql.search.js | 86 - api/api/exists.js | 117 +- api/api/exists_source.js | 51 +- api/api/explain.js | 120 +- api/api/field_caps.js | 21 +- api/api/get.js | 117 +- api/api/get_script.js | 21 +- api/api/get_script_context.js | 21 +- api/api/get_script_languages.js | 21 +- api/api/get_source.js | 115 +- api/api/graph.explore.js | 90 - api/api/graph.js | 17 +- api/api/ilm.delete_lifecycle.js | 78 - api/api/ilm.explain_lifecycle.js | 80 - api/api/ilm.get_lifecycle.js | 77 - api/api/ilm.get_status.js | 72 - api/api/ilm.move_to_step.js | 78 - api/api/ilm.put_lifecycle.js | 78 - api/api/ilm.remove_policy.js | 78 - api/api/ilm.retry.js | 78 - api/api/ilm.start.js | 72 - api/api/ilm.stop.js | 72 - api/api/index.js | 128 +- api/api/indices.add_block.js | 102 - api/api/indices.analyze.js | 83 - api/api/indices.clear_cache.js | 93 - api/api/indices.clone.js | 98 - api/api/indices.close.js | 94 - api/api/indices.create.js | 90 - api/api/indices.create_data_stream.js | 78 - api/api/indices.data_streams_stats.js | 77 - api/api/indices.delete.js | 92 - api/api/indices.delete_alias.js | 101 - api/api/indices.delete_data_stream.js | 78 - api/api/indices.delete_index_template.js | 86 - api/api/indices.delete_template.js | 86 - api/api/indices.exists.js | 94 - api/api/indices.exists_alias.js | 95 - api/api/indices.exists_index_template.js | 88 - api/api/indices.exists_template.js | 88 - api/api/indices.exists_type.js | 100 - api/api/indices.flush.js | 91 - api/api/indices.flush_synced.js | 88 - api/api/indices.forcemerge.js | 93 - api/api/indices.freeze.js | 87 - api/api/indices.get.js | 98 - api/api/indices.get_alias.js | 95 - api/api/indices.get_data_stream.js | 77 - api/api/indices.get_field_mapping.js | 105 - api/api/indices.get_index_template.js | 87 - api/api/indices.get_mapping.js | 99 - api/api/indices.get_settings.js | 101 - api/api/indices.get_template.js | 89 - api/api/indices.get_upgrade.js | 88 - api/api/indices.js | 102 +- api/api/indices.open.js | 94 - api/api/indices.put_alias.js | 101 - api/api/indices.put_index_template.js | 91 - api/api/indices.put_mapping.js | 119 - api/api/indices.put_settings.js | 101 - api/api/indices.put_template.js | 93 - api/api/indices.recovery.js | 85 - api/api/indices.refresh.js | 88 - api/api/indices.reload_search_analyzers.js | 82 - api/api/indices.resolve_index.js | 85 - api/api/indices.rollover.js | 104 - api/api/indices.segments.js | 89 - api/api/indices.shard_stores.js | 89 - api/api/indices.shrink.js | 100 - api/api/indices.simulate_index_template.js | 87 - api/api/indices.simulate_template.js | 86 - api/api/indices.split.js | 100 - api/api/indices.stats.js | 104 - api/api/indices.unfreeze.js | 87 - api/api/indices.update_aliases.js | 86 - api/api/indices.upgrade.js | 92 - api/api/indices.validate_query.js | 109 - api/api/info.js | 21 +- api/api/ingest.delete_pipeline.js | 86 - api/api/ingest.get_pipeline.js | 84 - api/api/ingest.processor_grok.js | 77 - api/api/ingest.put_pipeline.js | 90 - api/api/ingest.simulate.js | 89 - api/api/license.delete.js | 72 - api/api/license.get.js | 73 - api/api/license.get_basic_status.js | 72 - api/api/license.get_trial_status.js | 72 - api/api/license.post.js | 72 - api/api/license.post_start_basic.js | 72 - api/api/license.post_start_trial.js | 73 - api/api/mget.js | 113 +- api/api/migration.deprecations.js | 77 - api/api/ml.close_job.js | 81 - api/api/ml.delete_calendar.js | 78 - api/api/ml.delete_calendar_event.js | 88 - api/api/ml.delete_calendar_job.js | 88 - api/api/ml.delete_data_frame_analytics.js | 79 - api/api/ml.delete_datafeed.js | 78 - api/api/ml.delete_expired_data.js | 79 - api/api/ml.delete_filter.js | 78 - api/api/ml.delete_forecast.js | 91 - api/api/ml.delete_job.js | 79 - api/api/ml.delete_model_snapshot.js | 88 - api/api/ml.delete_trained_model.js | 78 - api/api/ml.estimate_model_memory.js | 78 - api/api/ml.evaluate_data_frame.js | 78 - api/api/ml.explain_data_frame_analytics.js | 77 - api/api/ml.find_file_structure.js | 99 - api/api/ml.flush_job.js | 84 - api/api/ml.forecast.js | 81 - api/api/ml.get_buckets.js | 99 - api/api/ml.get_calendar_events.js | 83 - api/api/ml.get_calendars.js | 78 - api/api/ml.get_categories.js | 91 - api/api/ml.get_data_frame_analytics.js | 80 - api/api/ml.get_data_frame_analytics_stats.js | 80 - api/api/ml.get_datafeed_stats.js | 77 - api/api/ml.get_datafeeds.js | 77 - api/api/ml.get_filters.js | 78 - api/api/ml.get_influencers.js | 87 - api/api/ml.get_job_stats.js | 77 - api/api/ml.get_jobs.js | 77 - api/api/ml.get_model_snapshots.js | 94 - api/api/ml.get_overall_buckets.js | 88 - api/api/ml.get_records.js | 87 - api/api/ml.get_trained_models.js | 86 - api/api/ml.get_trained_models_stats.js | 80 - api/api/ml.info.js | 72 - api/api/ml.js | 4 +- api/api/ml.open_job.js | 78 - api/api/ml.post_calendar_events.js | 82 - api/api/ml.post_data.js | 84 - api/api/ml.preview_datafeed.js | 78 - api/api/ml.put_calendar.js | 78 - api/api/ml.put_calendar_job.js | 88 - api/api/ml.put_data_frame_analytics.js | 82 - api/api/ml.put_datafeed.js | 88 - api/api/ml.put_filter.js | 82 - api/api/ml.put_job.js | 82 - api/api/ml.put_trained_model.js | 82 - api/api/ml.revert_model_snapshot.js | 88 - api/api/ml.set_upgrade_mode.js | 73 - api/api/ml.start_data_frame_analytics.js | 78 - api/api/ml.start_datafeed.js | 80 - api/api/ml.stop_data_frame_analytics.js | 81 - api/api/ml.stop_datafeed.js | 81 - api/api/ml.update_data_frame_analytics.js | 82 - api/api/ml.update_datafeed.js | 88 - api/api/ml.update_filter.js | 82 - api/api/ml.update_job.js | 82 - api/api/ml.update_model_snapshot.js | 92 - api/api/ml.validate.js | 78 - api/api/ml.validate_detector.js | 78 - api/api/monitoring.bulk.js | 87 - api/api/msearch.js | 84 +- api/api/msearch_template.js | 84 +- api/api/mtermvectors.js | 98 +- api/api/nodes.hot_threads.js | 98 - api/api/nodes.info.js | 91 - api/api/nodes.js | 9 + api/api/nodes.reload_secure_settings.js | 83 - api/api/nodes.stats.js | 105 - api/api/nodes.usage.js | 89 - api/api/open_point_in_time.js | 110 - api/api/ping.js | 21 +- api/api/put_script.js | 21 +- api/api/rank_eval.js | 21 +- api/api/reindex.js | 21 +- api/api/reindex_rethrottle.js | 21 +- api/api/render_search_template.js | 21 +- api/api/rollup.delete_job.js | 78 - api/api/rollup.get_jobs.js | 77 - api/api/rollup.get_rollup_caps.js | 77 - api/api/rollup.get_rollup_index_caps.js | 78 - api/api/rollup.put_job.js | 82 - api/api/rollup.rollup_search.js | 95 - api/api/rollup.start_job.js | 78 - api/api/rollup.stop_job.js | 80 - api/api/scripts_painless_execute.js | 21 +- api/api/scroll.js | 21 +- api/api/search.js | 188 +- api/api/search_shards.js | 21 +- api/api/search_template.js | 84 +- api/api/searchable_snapshots.clear_cache.js | 83 - api/api/searchable_snapshots.mount.js | 94 - .../searchable_snapshots.repository_stats.js | 78 - api/api/searchable_snapshots.stats.js | 77 - api/api/security.authenticate.js | 72 - api/api/security.change_password.js | 83 - api/api/security.clear_cached_privileges.js | 78 - api/api/security.clear_cached_realms.js | 78 - api/api/security.clear_cached_roles.js | 78 - api/api/security.create_api_key.js | 78 - api/api/security.delete_privileges.js | 88 - api/api/security.delete_role.js | 78 - api/api/security.delete_role_mapping.js | 78 - api/api/security.delete_user.js | 78 - api/api/security.disable_user.js | 78 - api/api/security.enable_user.js | 78 - api/api/security.get_api_key.js | 77 - api/api/security.get_builtin_privileges.js | 72 - api/api/security.get_privileges.js | 86 - api/api/security.get_role.js | 77 - api/api/security.get_role_mapping.js | 77 - api/api/security.get_token.js | 78 - api/api/security.get_user.js | 77 - api/api/security.get_user_privileges.js | 72 - api/api/security.has_privileges.js | 83 - api/api/security.invalidate_api_key.js | 78 - api/api/security.invalidate_token.js | 78 - api/api/security.put_privileges.js | 78 - api/api/security.put_role.js | 82 - api/api/security.put_role_mapping.js | 82 - api/api/security.put_user.js | 82 - api/api/slm.delete_lifecycle.js | 78 - api/api/slm.execute_lifecycle.js | 78 - api/api/slm.execute_retention.js | 72 - api/api/slm.get_lifecycle.js | 77 - api/api/slm.get_stats.js | 72 - api/api/slm.get_status.js | 72 - api/api/slm.put_lifecycle.js | 78 - api/api/slm.start.js | 72 - api/api/slm.stop.js | 72 - api/api/snapshot.cleanup_repository.js | 86 - api/api/snapshot.create.js | 97 - api/api/snapshot.create_repository.js | 91 - api/api/snapshot.delete.js | 95 - api/api/snapshot.delete_repository.js | 86 - api/api/snapshot.get.js | 98 - api/api/snapshot.get_repository.js | 85 - api/api/snapshot.restore.js | 97 - api/api/snapshot.status.js | 95 - api/api/snapshot.verify_repository.js | 86 - api/api/sql.clear_cursor.js | 78 - api/api/sql.query.js | 78 - api/api/sql.translate.js | 78 - api/api/ssl.certificates.js | 72 - api/api/tasks.cancel.js | 88 - api/api/tasks.get.js | 86 - api/api/tasks.list.js | 87 - api/api/termvectors.js | 78 +- api/api/transform.delete_transform.js | 78 - api/api/transform.get_transform.js | 79 - api/api/transform.get_transform_stats.js | 80 - api/api/transform.preview_transform.js | 78 - api/api/transform.put_transform.js | 82 - api/api/transform.start_transform.js | 78 - api/api/transform.stop_transform.js | 84 - api/api/transform.update_transform.js | 82 - api/api/update.js | 60 +- api/api/update_by_query.js | 154 +- api/api/update_by_query_rethrottle.js | 21 +- api/api/watcher.ack_watch.js | 89 - api/api/watcher.activate_watch.js | 78 - api/api/watcher.deactivate_watch.js | 78 - api/api/watcher.delete_watch.js | 78 - api/api/watcher.execute_watch.js | 77 - api/api/watcher.get_watch.js | 78 - api/api/watcher.put_watch.js | 82 - api/api/watcher.start.js | 72 - api/api/watcher.stats.js | 78 - api/api/watcher.stop.js | 72 - api/api/xpack.info.js | 73 - api/api/xpack.usage.js | 72 - api/index.js | 652 ----- api/requestParams.d.ts | 836 +----- docs/reference.asciidoc | 2339 ++--------------- 347 files changed, 1196 insertions(+), 30391 deletions(-) delete mode 100644 api/api/async_search.delete.js delete mode 100644 api/api/async_search.get.js delete mode 100644 api/api/async_search.submit.js delete mode 100644 api/api/autoscaling.delete_autoscaling_policy.js delete mode 100644 api/api/autoscaling.get_autoscaling_decision.js delete mode 100644 api/api/autoscaling.get_autoscaling_policy.js delete mode 100644 api/api/autoscaling.put_autoscaling_policy.js delete mode 100644 api/api/cat.aliases.js delete mode 100644 api/api/cat.allocation.js delete mode 100644 api/api/cat.count.js delete mode 100644 api/api/cat.fielddata.js delete mode 100644 api/api/cat.health.js delete mode 100644 api/api/cat.help.js delete mode 100644 api/api/cat.indices.js delete mode 100644 api/api/cat.master.js delete mode 100644 api/api/cat.ml_data_frame_analytics.js delete mode 100644 api/api/cat.ml_datafeeds.js delete mode 100644 api/api/cat.ml_jobs.js delete mode 100644 api/api/cat.ml_trained_models.js delete mode 100644 api/api/cat.nodeattrs.js delete mode 100644 api/api/cat.nodes.js delete mode 100644 api/api/cat.pending_tasks.js delete mode 100644 api/api/cat.plugins.js delete mode 100644 api/api/cat.recovery.js delete mode 100644 api/api/cat.repositories.js delete mode 100644 api/api/cat.segments.js delete mode 100644 api/api/cat.shards.js delete mode 100644 api/api/cat.snapshots.js delete mode 100644 api/api/cat.tasks.js delete mode 100644 api/api/cat.templates.js delete mode 100644 api/api/cat.thread_pool.js delete mode 100644 api/api/cat.transforms.js delete mode 100644 api/api/ccr.delete_auto_follow_pattern.js delete mode 100644 api/api/ccr.follow.js delete mode 100644 api/api/ccr.follow_info.js delete mode 100644 api/api/ccr.follow_stats.js delete mode 100644 api/api/ccr.forget_follower.js delete mode 100644 api/api/ccr.get_auto_follow_pattern.js delete mode 100644 api/api/ccr.pause_auto_follow_pattern.js delete mode 100644 api/api/ccr.pause_follow.js delete mode 100644 api/api/ccr.put_auto_follow_pattern.js delete mode 100644 api/api/ccr.resume_auto_follow_pattern.js delete mode 100644 api/api/ccr.resume_follow.js delete mode 100644 api/api/ccr.stats.js delete mode 100644 api/api/ccr.unfollow.js delete mode 100644 api/api/close_point_in_time.js delete mode 100644 api/api/cluster.allocation_explain.js delete mode 100644 api/api/cluster.delete_component_template.js delete mode 100644 api/api/cluster.delete_voting_config_exclusions.js delete mode 100644 api/api/cluster.exists_component_template.js delete mode 100644 api/api/cluster.get_component_template.js delete mode 100644 api/api/cluster.get_settings.js delete mode 100644 api/api/cluster.health.js delete mode 100644 api/api/cluster.pending_tasks.js delete mode 100644 api/api/cluster.post_voting_config_exclusions.js delete mode 100644 api/api/cluster.put_component_template.js delete mode 100644 api/api/cluster.put_settings.js delete mode 100644 api/api/cluster.remote_info.js delete mode 100644 api/api/cluster.reroute.js delete mode 100644 api/api/cluster.state.js delete mode 100644 api/api/cluster.stats.js delete mode 100644 api/api/dangling_indices.delete_dangling_index.js delete mode 100644 api/api/dangling_indices.import_dangling_index.js delete mode 100644 api/api/dangling_indices.list_dangling_indices.js delete mode 100644 api/api/enrich.delete_policy.js delete mode 100644 api/api/enrich.execute_policy.js delete mode 100644 api/api/enrich.get_policy.js delete mode 100644 api/api/enrich.put_policy.js delete mode 100644 api/api/enrich.stats.js delete mode 100644 api/api/eql.delete.js delete mode 100644 api/api/eql.get.js delete mode 100644 api/api/eql.search.js delete mode 100644 api/api/graph.explore.js delete mode 100644 api/api/ilm.delete_lifecycle.js delete mode 100644 api/api/ilm.explain_lifecycle.js delete mode 100644 api/api/ilm.get_lifecycle.js delete mode 100644 api/api/ilm.get_status.js delete mode 100644 api/api/ilm.move_to_step.js delete mode 100644 api/api/ilm.put_lifecycle.js delete mode 100644 api/api/ilm.remove_policy.js delete mode 100644 api/api/ilm.retry.js delete mode 100644 api/api/ilm.start.js delete mode 100644 api/api/ilm.stop.js delete mode 100644 api/api/indices.add_block.js delete mode 100644 api/api/indices.analyze.js delete mode 100644 api/api/indices.clear_cache.js delete mode 100644 api/api/indices.clone.js delete mode 100644 api/api/indices.close.js delete mode 100644 api/api/indices.create.js delete mode 100644 api/api/indices.create_data_stream.js delete mode 100644 api/api/indices.data_streams_stats.js delete mode 100644 api/api/indices.delete.js delete mode 100644 api/api/indices.delete_alias.js delete mode 100644 api/api/indices.delete_data_stream.js delete mode 100644 api/api/indices.delete_index_template.js delete mode 100644 api/api/indices.delete_template.js delete mode 100644 api/api/indices.exists.js delete mode 100644 api/api/indices.exists_alias.js delete mode 100644 api/api/indices.exists_index_template.js delete mode 100644 api/api/indices.exists_template.js delete mode 100644 api/api/indices.exists_type.js delete mode 100644 api/api/indices.flush.js delete mode 100644 api/api/indices.flush_synced.js delete mode 100644 api/api/indices.forcemerge.js delete mode 100644 api/api/indices.freeze.js delete mode 100644 api/api/indices.get.js delete mode 100644 api/api/indices.get_alias.js delete mode 100644 api/api/indices.get_data_stream.js delete mode 100644 api/api/indices.get_field_mapping.js delete mode 100644 api/api/indices.get_index_template.js delete mode 100644 api/api/indices.get_mapping.js delete mode 100644 api/api/indices.get_settings.js delete mode 100644 api/api/indices.get_template.js delete mode 100644 api/api/indices.get_upgrade.js delete mode 100644 api/api/indices.open.js delete mode 100644 api/api/indices.put_alias.js delete mode 100644 api/api/indices.put_index_template.js delete mode 100644 api/api/indices.put_mapping.js delete mode 100644 api/api/indices.put_settings.js delete mode 100644 api/api/indices.put_template.js delete mode 100644 api/api/indices.recovery.js delete mode 100644 api/api/indices.refresh.js delete mode 100644 api/api/indices.reload_search_analyzers.js delete mode 100644 api/api/indices.resolve_index.js delete mode 100644 api/api/indices.rollover.js delete mode 100644 api/api/indices.segments.js delete mode 100644 api/api/indices.shard_stores.js delete mode 100644 api/api/indices.shrink.js delete mode 100644 api/api/indices.simulate_index_template.js delete mode 100644 api/api/indices.simulate_template.js delete mode 100644 api/api/indices.split.js delete mode 100644 api/api/indices.stats.js delete mode 100644 api/api/indices.unfreeze.js delete mode 100644 api/api/indices.update_aliases.js delete mode 100644 api/api/indices.upgrade.js delete mode 100644 api/api/indices.validate_query.js delete mode 100644 api/api/ingest.delete_pipeline.js delete mode 100644 api/api/ingest.get_pipeline.js delete mode 100644 api/api/ingest.processor_grok.js delete mode 100644 api/api/ingest.put_pipeline.js delete mode 100644 api/api/ingest.simulate.js delete mode 100644 api/api/license.delete.js delete mode 100644 api/api/license.get.js delete mode 100644 api/api/license.get_basic_status.js delete mode 100644 api/api/license.get_trial_status.js delete mode 100644 api/api/license.post.js delete mode 100644 api/api/license.post_start_basic.js delete mode 100644 api/api/license.post_start_trial.js delete mode 100644 api/api/migration.deprecations.js delete mode 100644 api/api/ml.close_job.js delete mode 100644 api/api/ml.delete_calendar.js delete mode 100644 api/api/ml.delete_calendar_event.js delete mode 100644 api/api/ml.delete_calendar_job.js delete mode 100644 api/api/ml.delete_data_frame_analytics.js delete mode 100644 api/api/ml.delete_datafeed.js delete mode 100644 api/api/ml.delete_expired_data.js delete mode 100644 api/api/ml.delete_filter.js delete mode 100644 api/api/ml.delete_forecast.js delete mode 100644 api/api/ml.delete_job.js delete mode 100644 api/api/ml.delete_model_snapshot.js delete mode 100644 api/api/ml.delete_trained_model.js delete mode 100644 api/api/ml.estimate_model_memory.js delete mode 100644 api/api/ml.evaluate_data_frame.js delete mode 100644 api/api/ml.explain_data_frame_analytics.js delete mode 100644 api/api/ml.find_file_structure.js delete mode 100644 api/api/ml.flush_job.js delete mode 100644 api/api/ml.forecast.js delete mode 100644 api/api/ml.get_buckets.js delete mode 100644 api/api/ml.get_calendar_events.js delete mode 100644 api/api/ml.get_calendars.js delete mode 100644 api/api/ml.get_categories.js delete mode 100644 api/api/ml.get_data_frame_analytics.js delete mode 100644 api/api/ml.get_data_frame_analytics_stats.js delete mode 100644 api/api/ml.get_datafeed_stats.js delete mode 100644 api/api/ml.get_datafeeds.js delete mode 100644 api/api/ml.get_filters.js delete mode 100644 api/api/ml.get_influencers.js delete mode 100644 api/api/ml.get_job_stats.js delete mode 100644 api/api/ml.get_jobs.js delete mode 100644 api/api/ml.get_model_snapshots.js delete mode 100644 api/api/ml.get_overall_buckets.js delete mode 100644 api/api/ml.get_records.js delete mode 100644 api/api/ml.get_trained_models.js delete mode 100644 api/api/ml.get_trained_models_stats.js delete mode 100644 api/api/ml.info.js delete mode 100644 api/api/ml.open_job.js delete mode 100644 api/api/ml.post_calendar_events.js delete mode 100644 api/api/ml.post_data.js delete mode 100644 api/api/ml.preview_datafeed.js delete mode 100644 api/api/ml.put_calendar.js delete mode 100644 api/api/ml.put_calendar_job.js delete mode 100644 api/api/ml.put_data_frame_analytics.js delete mode 100644 api/api/ml.put_datafeed.js delete mode 100644 api/api/ml.put_filter.js delete mode 100644 api/api/ml.put_job.js delete mode 100644 api/api/ml.put_trained_model.js delete mode 100644 api/api/ml.revert_model_snapshot.js delete mode 100644 api/api/ml.set_upgrade_mode.js delete mode 100644 api/api/ml.start_data_frame_analytics.js delete mode 100644 api/api/ml.start_datafeed.js delete mode 100644 api/api/ml.stop_data_frame_analytics.js delete mode 100644 api/api/ml.stop_datafeed.js delete mode 100644 api/api/ml.update_data_frame_analytics.js delete mode 100644 api/api/ml.update_datafeed.js delete mode 100644 api/api/ml.update_filter.js delete mode 100644 api/api/ml.update_job.js delete mode 100644 api/api/ml.update_model_snapshot.js delete mode 100644 api/api/ml.validate.js delete mode 100644 api/api/ml.validate_detector.js delete mode 100644 api/api/monitoring.bulk.js delete mode 100644 api/api/nodes.hot_threads.js delete mode 100644 api/api/nodes.info.js delete mode 100644 api/api/nodes.reload_secure_settings.js delete mode 100644 api/api/nodes.stats.js delete mode 100644 api/api/nodes.usage.js delete mode 100644 api/api/open_point_in_time.js delete mode 100644 api/api/rollup.delete_job.js delete mode 100644 api/api/rollup.get_jobs.js delete mode 100644 api/api/rollup.get_rollup_caps.js delete mode 100644 api/api/rollup.get_rollup_index_caps.js delete mode 100644 api/api/rollup.put_job.js delete mode 100644 api/api/rollup.rollup_search.js delete mode 100644 api/api/rollup.start_job.js delete mode 100644 api/api/rollup.stop_job.js delete mode 100644 api/api/searchable_snapshots.clear_cache.js delete mode 100644 api/api/searchable_snapshots.mount.js delete mode 100644 api/api/searchable_snapshots.repository_stats.js delete mode 100644 api/api/searchable_snapshots.stats.js delete mode 100644 api/api/security.authenticate.js delete mode 100644 api/api/security.change_password.js delete mode 100644 api/api/security.clear_cached_privileges.js delete mode 100644 api/api/security.clear_cached_realms.js delete mode 100644 api/api/security.clear_cached_roles.js delete mode 100644 api/api/security.create_api_key.js delete mode 100644 api/api/security.delete_privileges.js delete mode 100644 api/api/security.delete_role.js delete mode 100644 api/api/security.delete_role_mapping.js delete mode 100644 api/api/security.delete_user.js delete mode 100644 api/api/security.disable_user.js delete mode 100644 api/api/security.enable_user.js delete mode 100644 api/api/security.get_api_key.js delete mode 100644 api/api/security.get_builtin_privileges.js delete mode 100644 api/api/security.get_privileges.js delete mode 100644 api/api/security.get_role.js delete mode 100644 api/api/security.get_role_mapping.js delete mode 100644 api/api/security.get_token.js delete mode 100644 api/api/security.get_user.js delete mode 100644 api/api/security.get_user_privileges.js delete mode 100644 api/api/security.has_privileges.js delete mode 100644 api/api/security.invalidate_api_key.js delete mode 100644 api/api/security.invalidate_token.js delete mode 100644 api/api/security.put_privileges.js delete mode 100644 api/api/security.put_role.js delete mode 100644 api/api/security.put_role_mapping.js delete mode 100644 api/api/security.put_user.js delete mode 100644 api/api/slm.delete_lifecycle.js delete mode 100644 api/api/slm.execute_lifecycle.js delete mode 100644 api/api/slm.execute_retention.js delete mode 100644 api/api/slm.get_lifecycle.js delete mode 100644 api/api/slm.get_stats.js delete mode 100644 api/api/slm.get_status.js delete mode 100644 api/api/slm.put_lifecycle.js delete mode 100644 api/api/slm.start.js delete mode 100644 api/api/slm.stop.js delete mode 100644 api/api/snapshot.cleanup_repository.js delete mode 100644 api/api/snapshot.create.js delete mode 100644 api/api/snapshot.create_repository.js delete mode 100644 api/api/snapshot.delete.js delete mode 100644 api/api/snapshot.delete_repository.js delete mode 100644 api/api/snapshot.get.js delete mode 100644 api/api/snapshot.get_repository.js delete mode 100644 api/api/snapshot.restore.js delete mode 100644 api/api/snapshot.status.js delete mode 100644 api/api/snapshot.verify_repository.js delete mode 100644 api/api/sql.clear_cursor.js delete mode 100644 api/api/sql.query.js delete mode 100644 api/api/sql.translate.js delete mode 100644 api/api/ssl.certificates.js delete mode 100644 api/api/tasks.cancel.js delete mode 100644 api/api/tasks.get.js delete mode 100644 api/api/tasks.list.js delete mode 100644 api/api/transform.delete_transform.js delete mode 100644 api/api/transform.get_transform.js delete mode 100644 api/api/transform.get_transform_stats.js delete mode 100644 api/api/transform.preview_transform.js delete mode 100644 api/api/transform.put_transform.js delete mode 100644 api/api/transform.start_transform.js delete mode 100644 api/api/transform.stop_transform.js delete mode 100644 api/api/transform.update_transform.js delete mode 100644 api/api/watcher.ack_watch.js delete mode 100644 api/api/watcher.activate_watch.js delete mode 100644 api/api/watcher.deactivate_watch.js delete mode 100644 api/api/watcher.delete_watch.js delete mode 100644 api/api/watcher.execute_watch.js delete mode 100644 api/api/watcher.get_watch.js delete mode 100644 api/api/watcher.put_watch.js delete mode 100644 api/api/watcher.start.js delete mode 100644 api/api/watcher.stats.js delete mode 100644 api/api/watcher.stop.js delete mode 100644 api/api/xpack.info.js delete mode 100644 api/api/xpack.usage.js diff --git a/api/api/async_search.delete.js b/api/api/async_search.delete.js deleted file mode 100644 index 909f3a230..000000000 --- a/api/api/async_search.delete.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildAsyncSearchDelete (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a async_search.delete request - * Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html - */ - return function asyncSearchDelete (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['id'] == null) { - const err = new ConfigurationError('Missing required parameter: id') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'DELETE' - path = '/' + '_async_search' + '/' + encodeURIComponent(id) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildAsyncSearchDelete diff --git a/api/api/async_search.get.js b/api/api/async_search.get.js deleted file mode 100644 index e512e5ce3..000000000 --- a/api/api/async_search.get.js +++ /dev/null @@ -1,82 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildAsyncSearchGet (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'wait_for_completion_timeout', - 'keep_alive', - 'typed_keys' - ] - - const snakeCase = { - waitForCompletionTimeout: 'wait_for_completion_timeout', - keepAlive: 'keep_alive', - typedKeys: 'typed_keys' - } - - /** - * Perform a async_search.get request - * Retrieves the results of a previously submitted async search request given its ID. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html - */ - return function asyncSearchGet (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['id'] == null) { - const err = new ConfigurationError('Missing required parameter: id') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + '_async_search' + '/' + encodeURIComponent(id) - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildAsyncSearchGet diff --git a/api/api/async_search.submit.js b/api/api/async_search.submit.js deleted file mode 100644 index e46a1785f..000000000 --- a/api/api/async_search.submit.js +++ /dev/null @@ -1,147 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildAsyncSearchSubmit (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'wait_for_completion_timeout', - 'keep_on_completion', - 'keep_alive', - 'batched_reduce_size', - 'request_cache', - 'analyzer', - 'analyze_wildcard', - 'default_operator', - 'df', - 'explain', - 'stored_fields', - 'docvalue_fields', - 'from', - 'ignore_unavailable', - 'ignore_throttled', - 'allow_no_indices', - 'expand_wildcards', - 'lenient', - 'preference', - 'q', - 'routing', - 'search_type', - 'size', - 'sort', - '_source', - '_source_excludes', - '_source_exclude', - '_source_includes', - '_source_include', - 'terminate_after', - 'stats', - 'suggest_field', - 'suggest_mode', - 'suggest_size', - 'suggest_text', - 'timeout', - 'track_scores', - 'track_total_hits', - 'allow_partial_search_results', - 'typed_keys', - 'version', - 'seq_no_primary_term', - 'max_concurrent_shard_requests' - ] - - const snakeCase = { - waitForCompletionTimeout: 'wait_for_completion_timeout', - keepOnCompletion: 'keep_on_completion', - keepAlive: 'keep_alive', - batchedReduceSize: 'batched_reduce_size', - requestCache: 'request_cache', - analyzeWildcard: 'analyze_wildcard', - defaultOperator: 'default_operator', - storedFields: 'stored_fields', - docvalueFields: 'docvalue_fields', - ignoreUnavailable: 'ignore_unavailable', - ignoreThrottled: 'ignore_throttled', - allowNoIndices: 'allow_no_indices', - expandWildcards: 'expand_wildcards', - searchType: 'search_type', - _sourceExcludes: '_source_excludes', - _sourceExclude: '_source_exclude', - _sourceIncludes: '_source_includes', - _sourceInclude: '_source_include', - terminateAfter: 'terminate_after', - suggestField: 'suggest_field', - suggestMode: 'suggest_mode', - suggestSize: 'suggest_size', - suggestText: 'suggest_text', - trackScores: 'track_scores', - trackTotalHits: 'track_total_hits', - allowPartialSearchResults: 'allow_partial_search_results', - typedKeys: 'typed_keys', - seqNoPrimaryTerm: 'seq_no_primary_term', - maxConcurrentShardRequests: 'max_concurrent_shard_requests' - } - - /** - * Perform a async_search.submit request - * Executes a search request asynchronously. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html - */ - return function asyncSearchSubmit (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null) { - if (method == null) method = 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_async_search' - } else { - if (method == null) method = 'POST' - path = '/' + '_async_search' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildAsyncSearchSubmit diff --git a/api/api/autoscaling.delete_autoscaling_policy.js b/api/api/autoscaling.delete_autoscaling_policy.js deleted file mode 100644 index 76d09d1d5..000000000 --- a/api/api/autoscaling.delete_autoscaling_policy.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildAutoscalingDeleteAutoscalingPolicy (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a autoscaling.delete_autoscaling_policy request - * Deletes an autoscaling policy. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-delete-autoscaling-policy.html - */ - return function autoscalingDeleteAutoscalingPolicy (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['name'] == null) { - const err = new ConfigurationError('Missing required parameter: name') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'DELETE' - path = '/' + '_autoscaling' + '/' + 'policy' + '/' + encodeURIComponent(name) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildAutoscalingDeleteAutoscalingPolicy diff --git a/api/api/autoscaling.get_autoscaling_decision.js b/api/api/autoscaling.get_autoscaling_decision.js deleted file mode 100644 index 9bd7388a7..000000000 --- a/api/api/autoscaling.get_autoscaling_decision.js +++ /dev/null @@ -1,72 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildAutoscalingGetAutoscalingDecision (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a autoscaling.get_autoscaling_decision request - * Gets the current autoscaling decision based on the configured autoscaling policy, indicating whether or not autoscaling is needed. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-get-autoscaling-decision.html - */ - return function autoscalingGetAutoscalingDecision (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + '_autoscaling' + '/' + 'decision' - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildAutoscalingGetAutoscalingDecision diff --git a/api/api/autoscaling.get_autoscaling_policy.js b/api/api/autoscaling.get_autoscaling_policy.js deleted file mode 100644 index 0a85e303b..000000000 --- a/api/api/autoscaling.get_autoscaling_policy.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildAutoscalingGetAutoscalingPolicy (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a autoscaling.get_autoscaling_policy request - * Retrieves an autoscaling policy. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-get-autoscaling-policy.html - */ - return function autoscalingGetAutoscalingPolicy (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['name'] == null) { - const err = new ConfigurationError('Missing required parameter: name') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + '_autoscaling' + '/' + 'policy' + '/' + encodeURIComponent(name) - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildAutoscalingGetAutoscalingPolicy diff --git a/api/api/autoscaling.put_autoscaling_policy.js b/api/api/autoscaling.put_autoscaling_policy.js deleted file mode 100644 index 6a45c7648..000000000 --- a/api/api/autoscaling.put_autoscaling_policy.js +++ /dev/null @@ -1,82 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildAutoscalingPutAutoscalingPolicy (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a autoscaling.put_autoscaling_policy request - * Creates a new autoscaling policy. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-put-autoscaling-policy.html - */ - return function autoscalingPutAutoscalingPolicy (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['name'] == null) { - const err = new ConfigurationError('Missing required parameter: name') - return handleError(err, callback) - } - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'PUT' - path = '/' + '_autoscaling' + '/' + 'policy' + '/' + encodeURIComponent(name) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildAutoscalingPutAutoscalingPolicy diff --git a/api/api/bulk.js b/api/api/bulk.js index 8a3f3edb0..ae649a0f8 100644 --- a/api/api/bulk.js +++ b/api/api/bulk.js @@ -1,6 +1,21 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ 'use strict' @@ -8,38 +23,9 @@ /* eslint no-unused-vars: 0 */ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') -const acceptedQuerystring = ['wait_for_active_shards', 'refresh', 'routing', 'timeout', 'type', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'pipeline', 'require_alias', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] -const snakeCase = { waitForActiveShards: 'wait_for_active_shards', _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', requireAlias: 'require_alias', errorTrace: 'error_trace', filterPath: 'filter_path' } +const acceptedQuerystring = ['wait_for_active_shards', 'refresh', 'routing', 'timeout', 'type', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'pipeline', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] +const snakeCase = { waitForActiveShards: 'wait_for_active_shards', _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', errorTrace: 'error_trace', filterPath: 'filter_path' } -<<<<<<< HEAD - const acceptedQuerystring = [ - 'wait_for_active_shards', - 'refresh', - 'routing', - 'timeout', - 'type', - '_source', - '_source_excludes', - '_source_exclude', - '_source_includes', - '_source_include', - 'pipeline', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - waitForActiveShards: 'wait_for_active_shards', - _sourceExcludes: '_source_excludes', - _sourceExclude: '_source_exclude', - _sourceIncludes: '_source_includes', - _sourceInclude: '_source_include', - errorTrace: 'error_trace', - filterPath: 'filter_path' -======= function bulkApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) @@ -47,7 +33,6 @@ function bulkApi (params, options, callback) { if (params['body'] == null) { const err = new this[kConfigurationError]('Missing required parameter: body') return handleError(err, callback) ->>>>>>> a064f0f3... Improve child performances (#1314) } // check required url components diff --git a/api/api/cat.aliases.js b/api/api/cat.aliases.js deleted file mode 100644 index fe0675fbb..000000000 --- a/api/api/cat.aliases.js +++ /dev/null @@ -1,90 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildCatAliases (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'format', - 'local', - 'h', - 'help', - 's', - 'v', - 'expand_wildcards', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - expandWildcards: 'expand_wildcards', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a cat.aliases request - * Shows information about currently configured aliases to indices including filter and routing infos. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-alias.html - */ - return function catAliases (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((name) != null) { - if (method == null) method = 'GET' - path = '/' + '_cat' + '/' + 'aliases' + '/' + encodeURIComponent(name) - } else { - if (method == null) method = 'GET' - path = '/' + '_cat' + '/' + 'aliases' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildCatAliases diff --git a/api/api/cat.allocation.js b/api/api/cat.allocation.js deleted file mode 100644 index 9bed54887..000000000 --- a/api/api/cat.allocation.js +++ /dev/null @@ -1,91 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildCatAllocation (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'format', - 'bytes', - 'local', - 'master_timeout', - 'h', - 'help', - 's', - 'v', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a cat.allocation request - * Provides a snapshot of how many shards are allocated to each data node and how much disk space they are using. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-allocation.html - */ - return function catAllocation (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, nodeId, node_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((node_id || nodeId) != null) { - if (method == null) method = 'GET' - path = '/' + '_cat' + '/' + 'allocation' + '/' + encodeURIComponent(node_id || nodeId) - } else { - if (method == null) method = 'GET' - path = '/' + '_cat' + '/' + 'allocation' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildCatAllocation diff --git a/api/api/cat.count.js b/api/api/cat.count.js deleted file mode 100644 index 10cf6fd2c..000000000 --- a/api/api/cat.count.js +++ /dev/null @@ -1,87 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildCatCount (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'format', - 'h', - 'help', - 's', - 'v', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a cat.count request - * Provides quick access to the document count of the entire cluster, or individual indices. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-count.html - */ - return function catCount (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null) { - if (method == null) method = 'GET' - path = '/' + '_cat' + '/' + 'count' + '/' + encodeURIComponent(index) - } else { - if (method == null) method = 'GET' - path = '/' + '_cat' + '/' + 'count' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildCatCount diff --git a/api/api/cat.fielddata.js b/api/api/cat.fielddata.js deleted file mode 100644 index e8767eb00..000000000 --- a/api/api/cat.fielddata.js +++ /dev/null @@ -1,89 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildCatFielddata (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'format', - 'bytes', - 'h', - 'help', - 's', - 'v', - 'fields', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a cat.fielddata request - * Shows how much heap memory is currently being used by fielddata on every data node in the cluster. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-fielddata.html - */ - return function catFielddata (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, fields, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((fields) != null) { - if (method == null) method = 'GET' - path = '/' + '_cat' + '/' + 'fielddata' + '/' + encodeURIComponent(fields) - } else { - if (method == null) method = 'GET' - path = '/' + '_cat' + '/' + 'fielddata' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildCatFielddata diff --git a/api/api/cat.health.js b/api/api/cat.health.js deleted file mode 100644 index c655333e7..000000000 --- a/api/api/cat.health.js +++ /dev/null @@ -1,84 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildCatHealth (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'format', - 'h', - 'help', - 's', - 'time', - 'ts', - 'v', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a cat.health request - * Returns a concise representation of the cluster health. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-health.html - */ - return function catHealth (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + '_cat' + '/' + 'health' - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildCatHealth diff --git a/api/api/cat.help.js b/api/api/cat.help.js deleted file mode 100644 index d16f5ca1f..000000000 --- a/api/api/cat.help.js +++ /dev/null @@ -1,79 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildCatHelp (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'help', - 's', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a cat.help request - * Returns help for the Cat APIs. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/cat.html - */ - return function catHelp (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + '_cat' - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildCatHelp diff --git a/api/api/cat.indices.js b/api/api/cat.indices.js deleted file mode 100644 index 53cabe4a3..000000000 --- a/api/api/cat.indices.js +++ /dev/null @@ -1,98 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildCatIndices (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'format', - 'bytes', - 'local', - 'master_timeout', - 'h', - 'health', - 'help', - 'pri', - 's', - 'time', - 'v', - 'include_unloaded_segments', - 'expand_wildcards', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - includeUnloadedSegments: 'include_unloaded_segments', - expandWildcards: 'expand_wildcards', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a cat.indices request - * Returns information about indices: number of primaries and replicas, document counts, disk size, ... - * https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-indices.html - */ - return function catIndices (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null) { - if (method == null) method = 'GET' - path = '/' + '_cat' + '/' + 'indices' + '/' + encodeURIComponent(index) - } else { - if (method == null) method = 'GET' - path = '/' + '_cat' + '/' + 'indices' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildCatIndices diff --git a/api/api/cat.js b/api/api/cat.js index 5958aa02b..71ff1d922 100644 --- a/api/api/cat.js +++ b/api/api/cat.js @@ -23,7 +23,7 @@ /* eslint no-unused-vars: 0 */ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') -const acceptedQuerystring = ['format', 'local', 'h', 'help', 's', 'v', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'bytes', 'master_timeout', 'fields', 'time', 'ts', 'health', 'pri', 'include_unloaded_segments', 'full_id', 'active_only', 'detailed', 'index', 'ignore_unavailable', 'node_id', 'actions', 'parent_task', 'allow_no_match', 'allow_no_datafeeds', 'allow_no_jobs', 'from', 'size'] +const acceptedQuerystring = ['format', 'local', 'h', 'help', 's', 'v', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'bytes', 'master_timeout', 'fields', 'time', 'ts', 'health', 'pri', 'include_unloaded_segments', 'full_id', 'active_only', 'detailed', 'index', 'ignore_unavailable', 'node_id', 'actions', 'parent_task', 'size', 'allow_no_match', 'allow_no_datafeeds', 'allow_no_jobs', 'from'] const snakeCase = { expandWildcards: 'expand_wildcards', errorTrace: 'error_trace', filterPath: 'filter_path', masterTimeout: 'master_timeout', includeUnloadedSegments: 'include_unloaded_segments', fullId: 'full_id', activeOnly: 'active_only', ignoreUnavailable: 'ignore_unavailable', nodeId: 'node_id', parentTask: 'parent_task', allowNoMatch: 'allow_no_match', allowNoDatafeeds: 'allow_no_datafeeds', allowNoJobs: 'allow_no_jobs' } function CatApi (transport, ConfigurationError) { diff --git a/api/api/cat.master.js b/api/api/cat.master.js deleted file mode 100644 index 296a82aa5..000000000 --- a/api/api/cat.master.js +++ /dev/null @@ -1,85 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildCatMaster (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'format', - 'local', - 'master_timeout', - 'h', - 'help', - 's', - 'v', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a cat.master request - * Returns information about the master node. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-master.html - */ - return function catMaster (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + '_cat' + '/' + 'master' - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildCatMaster diff --git a/api/api/cat.ml_data_frame_analytics.js b/api/api/cat.ml_data_frame_analytics.js deleted file mode 100644 index 18b071636..000000000 --- a/api/api/cat.ml_data_frame_analytics.js +++ /dev/null @@ -1,85 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildCatMlDataFrameAnalytics (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'allow_no_match', - 'bytes', - 'format', - 'h', - 'help', - 's', - 'time', - 'v' - ] - - const snakeCase = { - allowNoMatch: 'allow_no_match' - - } - - /** - * Perform a cat.ml_data_frame_analytics request - * Gets configuration and usage information about data frame analytics jobs. - * http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-dfanalytics.html - */ - return function catMlDataFrameAnalytics (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((id) != null) { - if (method == null) method = 'GET' - path = '/' + '_cat' + '/' + 'ml' + '/' + 'data_frame' + '/' + 'analytics' + '/' + encodeURIComponent(id) - } else { - if (method == null) method = 'GET' - path = '/' + '_cat' + '/' + 'ml' + '/' + 'data_frame' + '/' + 'analytics' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildCatMlDataFrameAnalytics diff --git a/api/api/cat.ml_datafeeds.js b/api/api/cat.ml_datafeeds.js deleted file mode 100644 index 988d0b094..000000000 --- a/api/api/cat.ml_datafeeds.js +++ /dev/null @@ -1,84 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildCatMlDatafeeds (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'allow_no_datafeeds', - 'format', - 'h', - 'help', - 's', - 'time', - 'v' - ] - - const snakeCase = { - allowNoDatafeeds: 'allow_no_datafeeds' - - } - - /** - * Perform a cat.ml_datafeeds request - * Gets configuration and usage information about datafeeds. - * http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-datafeeds.html - */ - return function catMlDatafeeds (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, datafeedId, datafeed_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((datafeed_id || datafeedId) != null) { - if (method == null) method = 'GET' - path = '/' + '_cat' + '/' + 'ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId) - } else { - if (method == null) method = 'GET' - path = '/' + '_cat' + '/' + 'ml' + '/' + 'datafeeds' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildCatMlDatafeeds diff --git a/api/api/cat.ml_jobs.js b/api/api/cat.ml_jobs.js deleted file mode 100644 index 2311c796b..000000000 --- a/api/api/cat.ml_jobs.js +++ /dev/null @@ -1,85 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildCatMlJobs (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'allow_no_jobs', - 'bytes', - 'format', - 'h', - 'help', - 's', - 'time', - 'v' - ] - - const snakeCase = { - allowNoJobs: 'allow_no_jobs' - - } - - /** - * Perform a cat.ml_jobs request - * Gets configuration and usage information about anomaly detection jobs. - * http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-anomaly-detectors.html - */ - return function catMlJobs (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, jobId, job_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((job_id || jobId) != null) { - if (method == null) method = 'GET' - path = '/' + '_cat' + '/' + 'ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) - } else { - if (method == null) method = 'GET' - path = '/' + '_cat' + '/' + 'ml' + '/' + 'anomaly_detectors' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildCatMlJobs diff --git a/api/api/cat.ml_trained_models.js b/api/api/cat.ml_trained_models.js deleted file mode 100644 index 4249d5f19..000000000 --- a/api/api/cat.ml_trained_models.js +++ /dev/null @@ -1,87 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildCatMlTrainedModels (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'allow_no_match', - 'from', - 'size', - 'bytes', - 'format', - 'h', - 'help', - 's', - 'time', - 'v' - ] - - const snakeCase = { - allowNoMatch: 'allow_no_match' - - } - - /** - * Perform a cat.ml_trained_models request - * Gets configuration and usage information about inference trained models. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-trained-model.html - */ - return function catMlTrainedModels (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, modelId, model_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((model_id || modelId) != null) { - if (method == null) method = 'GET' - path = '/' + '_cat' + '/' + 'ml' + '/' + 'trained_models' + '/' + encodeURIComponent(model_id || modelId) - } else { - if (method == null) method = 'GET' - path = '/' + '_cat' + '/' + 'ml' + '/' + 'trained_models' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildCatMlTrainedModels diff --git a/api/api/cat.nodeattrs.js b/api/api/cat.nodeattrs.js deleted file mode 100644 index c59442ea5..000000000 --- a/api/api/cat.nodeattrs.js +++ /dev/null @@ -1,85 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildCatNodeattrs (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'format', - 'local', - 'master_timeout', - 'h', - 'help', - 's', - 'v', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a cat.nodeattrs request - * Returns information about custom node attributes. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodeattrs.html - */ - return function catNodeattrs (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + '_cat' + '/' + 'nodeattrs' - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildCatNodeattrs diff --git a/api/api/cat.nodes.js b/api/api/cat.nodes.js deleted file mode 100644 index 01923de06..000000000 --- a/api/api/cat.nodes.js +++ /dev/null @@ -1,89 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildCatNodes (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'bytes', - 'format', - 'full_id', - 'local', - 'master_timeout', - 'h', - 'help', - 's', - 'time', - 'v', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - fullId: 'full_id', - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a cat.nodes request - * Returns basic statistics about performance of cluster nodes. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodes.html - */ - return function catNodes (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + '_cat' + '/' + 'nodes' - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildCatNodes diff --git a/api/api/cat.pending_tasks.js b/api/api/cat.pending_tasks.js deleted file mode 100644 index 10f6b5ab0..000000000 --- a/api/api/cat.pending_tasks.js +++ /dev/null @@ -1,86 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildCatPendingTasks (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'format', - 'local', - 'master_timeout', - 'h', - 'help', - 's', - 'time', - 'v', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a cat.pending_tasks request - * Returns a concise representation of the cluster pending tasks. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-pending-tasks.html - */ - return function catPendingTasks (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + '_cat' + '/' + 'pending_tasks' - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildCatPendingTasks diff --git a/api/api/cat.plugins.js b/api/api/cat.plugins.js deleted file mode 100644 index 709bc13cf..000000000 --- a/api/api/cat.plugins.js +++ /dev/null @@ -1,85 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildCatPlugins (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'format', - 'local', - 'master_timeout', - 'h', - 'help', - 's', - 'v', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a cat.plugins request - * Returns information about installed plugins across nodes node. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-plugins.html - */ - return function catPlugins (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + '_cat' + '/' + 'plugins' - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildCatPlugins diff --git a/api/api/cat.recovery.js b/api/api/cat.recovery.js deleted file mode 100644 index 7a75f6433..000000000 --- a/api/api/cat.recovery.js +++ /dev/null @@ -1,93 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildCatRecovery (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'format', - 'active_only', - 'bytes', - 'detailed', - 'h', - 'help', - 'index', - 's', - 'time', - 'v', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - activeOnly: 'active_only', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a cat.recovery request - * Returns information about index shard recoveries, both on-going completed. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-recovery.html - */ - return function catRecovery (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null) { - if (method == null) method = 'GET' - path = '/' + '_cat' + '/' + 'recovery' + '/' + encodeURIComponent(index) - } else { - if (method == null) method = 'GET' - path = '/' + '_cat' + '/' + 'recovery' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildCatRecovery diff --git a/api/api/cat.repositories.js b/api/api/cat.repositories.js deleted file mode 100644 index f00592fcf..000000000 --- a/api/api/cat.repositories.js +++ /dev/null @@ -1,85 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildCatRepositories (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'format', - 'local', - 'master_timeout', - 'h', - 'help', - 's', - 'v', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a cat.repositories request - * Returns information about snapshot repositories registered in the cluster. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-repositories.html - */ - return function catRepositories (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + '_cat' + '/' + 'repositories' - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildCatRepositories diff --git a/api/api/cat.segments.js b/api/api/cat.segments.js deleted file mode 100644 index 89d2b5672..000000000 --- a/api/api/cat.segments.js +++ /dev/null @@ -1,88 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildCatSegments (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'format', - 'bytes', - 'h', - 'help', - 's', - 'v', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a cat.segments request - * Provides low-level information about the segments in the shards of an index. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-segments.html - */ - return function catSegments (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null) { - if (method == null) method = 'GET' - path = '/' + '_cat' + '/' + 'segments' + '/' + encodeURIComponent(index) - } else { - if (method == null) method = 'GET' - path = '/' + '_cat' + '/' + 'segments' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildCatSegments diff --git a/api/api/cat.shards.js b/api/api/cat.shards.js deleted file mode 100644 index 634d78cd0..000000000 --- a/api/api/cat.shards.js +++ /dev/null @@ -1,92 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildCatShards (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'format', - 'bytes', - 'local', - 'master_timeout', - 'h', - 'help', - 's', - 'time', - 'v', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a cat.shards request - * Provides a detailed view of shard allocation on nodes. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-shards.html - */ - return function catShards (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null) { - if (method == null) method = 'GET' - path = '/' + '_cat' + '/' + 'shards' + '/' + encodeURIComponent(index) - } else { - if (method == null) method = 'GET' - path = '/' + '_cat' + '/' + 'shards' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildCatShards diff --git a/api/api/cat.snapshots.js b/api/api/cat.snapshots.js deleted file mode 100644 index 78d8921b9..000000000 --- a/api/api/cat.snapshots.js +++ /dev/null @@ -1,92 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildCatSnapshots (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'format', - 'ignore_unavailable', - 'master_timeout', - 'h', - 'help', - 's', - 'time', - 'v', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - ignoreUnavailable: 'ignore_unavailable', - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a cat.snapshots request - * Returns all snapshots in a specific repository. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-snapshots.html - */ - return function catSnapshots (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, repository, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((repository) != null) { - if (method == null) method = 'GET' - path = '/' + '_cat' + '/' + 'snapshots' + '/' + encodeURIComponent(repository) - } else { - if (method == null) method = 'GET' - path = '/' + '_cat' + '/' + 'snapshots' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildCatSnapshots diff --git a/api/api/cat.tasks.js b/api/api/cat.tasks.js deleted file mode 100644 index 1e0eda879..000000000 --- a/api/api/cat.tasks.js +++ /dev/null @@ -1,89 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildCatTasks (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'format', - 'node_id', - 'actions', - 'detailed', - 'parent_task', - 'h', - 'help', - 's', - 'time', - 'v', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - nodeId: 'node_id', - parentTask: 'parent_task', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a cat.tasks request - * Returns information about the tasks currently executing on one or more nodes in the cluster. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html - */ - return function catTasks (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + '_cat' + '/' + 'tasks' - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildCatTasks diff --git a/api/api/cat.templates.js b/api/api/cat.templates.js deleted file mode 100644 index adfc17124..000000000 --- a/api/api/cat.templates.js +++ /dev/null @@ -1,90 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildCatTemplates (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'format', - 'local', - 'master_timeout', - 'h', - 'help', - 's', - 'v', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a cat.templates request - * Returns information about existing templates. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-templates.html - */ - return function catTemplates (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((name) != null) { - if (method == null) method = 'GET' - path = '/' + '_cat' + '/' + 'templates' + '/' + encodeURIComponent(name) - } else { - if (method == null) method = 'GET' - path = '/' + '_cat' + '/' + 'templates' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildCatTemplates diff --git a/api/api/cat.thread_pool.js b/api/api/cat.thread_pool.js deleted file mode 100644 index 63140220b..000000000 --- a/api/api/cat.thread_pool.js +++ /dev/null @@ -1,92 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildCatThreadPool (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'format', - 'size', - 'local', - 'master_timeout', - 'h', - 'help', - 's', - 'v', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a cat.thread_pool request - * Returns cluster-wide thread pool statistics per node. -By default the active, queue and rejected statistics are returned for all thread pools. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-thread-pool.html - */ - return function catThreadPool (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, threadPoolPatterns, thread_pool_patterns, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((thread_pool_patterns || threadPoolPatterns) != null) { - if (method == null) method = 'GET' - path = '/' + '_cat' + '/' + 'thread_pool' + '/' + encodeURIComponent(thread_pool_patterns || threadPoolPatterns) - } else { - if (method == null) method = 'GET' - path = '/' + '_cat' + '/' + 'thread_pool' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildCatThreadPool diff --git a/api/api/cat.transforms.js b/api/api/cat.transforms.js deleted file mode 100644 index 446b4c953..000000000 --- a/api/api/cat.transforms.js +++ /dev/null @@ -1,86 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildCatTransforms (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'from', - 'size', - 'allow_no_match', - 'format', - 'h', - 'help', - 's', - 'time', - 'v' - ] - - const snakeCase = { - allowNoMatch: 'allow_no_match' - - } - - /** - * Perform a cat.transforms request - * Gets configuration and usage information about transforms. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-transforms.html - */ - return function catTransforms (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, transformId, transform_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((transform_id || transformId) != null) { - if (method == null) method = 'GET' - path = '/' + '_cat' + '/' + 'transforms' + '/' + encodeURIComponent(transform_id || transformId) - } else { - if (method == null) method = 'GET' - path = '/' + '_cat' + '/' + 'transforms' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildCatTransforms diff --git a/api/api/ccr.delete_auto_follow_pattern.js b/api/api/ccr.delete_auto_follow_pattern.js deleted file mode 100644 index df97e2bbb..000000000 --- a/api/api/ccr.delete_auto_follow_pattern.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildCcrDeleteAutoFollowPattern (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a ccr.delete_auto_follow_pattern request - * Deletes auto-follow patterns. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-delete-auto-follow-pattern.html - */ - return function ccrDeleteAutoFollowPattern (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['name'] == null) { - const err = new ConfigurationError('Missing required parameter: name') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'DELETE' - path = '/' + '_ccr' + '/' + 'auto_follow' + '/' + encodeURIComponent(name) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildCcrDeleteAutoFollowPattern diff --git a/api/api/ccr.follow.js b/api/api/ccr.follow.js deleted file mode 100644 index a193fe80c..000000000 --- a/api/api/ccr.follow.js +++ /dev/null @@ -1,82 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildCcrFollow (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'wait_for_active_shards' - ] - - const snakeCase = { - waitForActiveShards: 'wait_for_active_shards' - } - - /** - * Perform a ccr.follow request - * Creates a new follower index configured to follow the referenced leader index. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-follow.html - */ - return function ccrFollow (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'PUT' - path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'follow' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildCcrFollow diff --git a/api/api/ccr.follow_info.js b/api/api/ccr.follow_info.js deleted file mode 100644 index d0c0c329a..000000000 --- a/api/api/ccr.follow_info.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildCcrFollowInfo (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a ccr.follow_info request - * Retrieves information about all follower indices, including parameters and status for each follower index - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-info.html - */ - return function ccrFollowInfo (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'info' - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildCcrFollowInfo diff --git a/api/api/ccr.follow_stats.js b/api/api/ccr.follow_stats.js deleted file mode 100644 index 1a66b8645..000000000 --- a/api/api/ccr.follow_stats.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildCcrFollowStats (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a ccr.follow_stats request - * Retrieves follower stats. return shard-level stats about the following tasks associated with each shard for the specified indices. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-stats.html - */ - return function ccrFollowStats (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'stats' - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildCcrFollowStats diff --git a/api/api/ccr.forget_follower.js b/api/api/ccr.forget_follower.js deleted file mode 100644 index b340ef9d2..000000000 --- a/api/api/ccr.forget_follower.js +++ /dev/null @@ -1,82 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildCcrForgetFollower (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a ccr.forget_follower request - * Removes the follower retention leases from the leader. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-forget-follower.html - */ - return function ccrForgetFollower (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'forget_follower' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildCcrForgetFollower diff --git a/api/api/ccr.get_auto_follow_pattern.js b/api/api/ccr.get_auto_follow_pattern.js deleted file mode 100644 index fbc05aaba..000000000 --- a/api/api/ccr.get_auto_follow_pattern.js +++ /dev/null @@ -1,77 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildCcrGetAutoFollowPattern (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a ccr.get_auto_follow_pattern request - * Gets configured auto-follow patterns. Returns the specified auto-follow pattern collection. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-auto-follow-pattern.html - */ - return function ccrGetAutoFollowPattern (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((name) != null) { - if (method == null) method = 'GET' - path = '/' + '_ccr' + '/' + 'auto_follow' + '/' + encodeURIComponent(name) - } else { - if (method == null) method = 'GET' - path = '/' + '_ccr' + '/' + 'auto_follow' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildCcrGetAutoFollowPattern diff --git a/api/api/ccr.pause_auto_follow_pattern.js b/api/api/ccr.pause_auto_follow_pattern.js deleted file mode 100644 index 1d3f2dbad..000000000 --- a/api/api/ccr.pause_auto_follow_pattern.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildCcrPauseAutoFollowPattern (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a ccr.pause_auto_follow_pattern request - * Pauses an auto-follow pattern - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-pause-auto-follow-pattern.html - */ - return function ccrPauseAutoFollowPattern (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['name'] == null) { - const err = new ConfigurationError('Missing required parameter: name') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_ccr' + '/' + 'auto_follow' + '/' + encodeURIComponent(name) + '/' + 'pause' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildCcrPauseAutoFollowPattern diff --git a/api/api/ccr.pause_follow.js b/api/api/ccr.pause_follow.js deleted file mode 100644 index 9756389e9..000000000 --- a/api/api/ccr.pause_follow.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildCcrPauseFollow (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a ccr.pause_follow request - * Pauses a follower index. The follower index will not fetch any additional operations from the leader index. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-pause-follow.html - */ - return function ccrPauseFollow (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'pause_follow' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildCcrPauseFollow diff --git a/api/api/ccr.put_auto_follow_pattern.js b/api/api/ccr.put_auto_follow_pattern.js deleted file mode 100644 index 55e2bde6e..000000000 --- a/api/api/ccr.put_auto_follow_pattern.js +++ /dev/null @@ -1,82 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildCcrPutAutoFollowPattern (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a ccr.put_auto_follow_pattern request - * Creates a new named collection of auto-follow patterns against a specified remote cluster. Newly created indices on the remote cluster matching any of the specified patterns will be automatically configured as follower indices. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-auto-follow-pattern.html - */ - return function ccrPutAutoFollowPattern (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['name'] == null) { - const err = new ConfigurationError('Missing required parameter: name') - return handleError(err, callback) - } - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'PUT' - path = '/' + '_ccr' + '/' + 'auto_follow' + '/' + encodeURIComponent(name) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildCcrPutAutoFollowPattern diff --git a/api/api/ccr.resume_auto_follow_pattern.js b/api/api/ccr.resume_auto_follow_pattern.js deleted file mode 100644 index d2139af1e..000000000 --- a/api/api/ccr.resume_auto_follow_pattern.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildCcrResumeAutoFollowPattern (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a ccr.resume_auto_follow_pattern request - * Resumes an auto-follow pattern that has been paused - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-resume-auto-follow-pattern.html - */ - return function ccrResumeAutoFollowPattern (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['name'] == null) { - const err = new ConfigurationError('Missing required parameter: name') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_ccr' + '/' + 'auto_follow' + '/' + encodeURIComponent(name) + '/' + 'resume' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildCcrResumeAutoFollowPattern diff --git a/api/api/ccr.resume_follow.js b/api/api/ccr.resume_follow.js deleted file mode 100644 index 164bdd453..000000000 --- a/api/api/ccr.resume_follow.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildCcrResumeFollow (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a ccr.resume_follow request - * Resumes a follower index that has been paused - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-resume-follow.html - */ - return function ccrResumeFollow (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'resume_follow' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildCcrResumeFollow diff --git a/api/api/ccr.stats.js b/api/api/ccr.stats.js deleted file mode 100644 index fc067a5cb..000000000 --- a/api/api/ccr.stats.js +++ /dev/null @@ -1,72 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildCcrStats (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a ccr.stats request - * Gets all stats related to cross-cluster replication. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-stats.html - */ - return function ccrStats (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + '_ccr' + '/' + 'stats' - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildCcrStats diff --git a/api/api/ccr.unfollow.js b/api/api/ccr.unfollow.js deleted file mode 100644 index 629d73352..000000000 --- a/api/api/ccr.unfollow.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildCcrUnfollow (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a ccr.unfollow request - * Stops the following task associated with a follower index and removes index metadata and settings associated with cross-cluster replication. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-unfollow.html - */ - return function ccrUnfollow (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'unfollow' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildCcrUnfollow diff --git a/api/api/clear_scroll.js b/api/api/clear_scroll.js index c91317c2e..9f8f40e8e 100644 --- a/api/api/clear_scroll.js +++ b/api/api/clear_scroll.js @@ -1,6 +1,21 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ 'use strict' diff --git a/api/api/close_point_in_time.js b/api/api/close_point_in_time.js deleted file mode 100644 index c66305b11..000000000 --- a/api/api/close_point_in_time.js +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') -const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path'] -const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' } - -function closePointInTimeApi (params, options, callback) { - ;[params, options, callback] = normalizeArguments(params, options, callback) - - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) - - var path = '' - if (method == null) method = 'DELETE' - path = '/' + '_pit' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - -<<<<<<< HEAD - /** - * Perform a close_point_in_time request - * Close a point in time - * https://www.elastic.co/guide/en/elasticsearch/reference/master/point-in-time.html - */ - return function closePointInTime (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'DELETE' - path = '/' + '_pit' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -======= - return this.transport.request(request, options, callback) ->>>>>>> a064f0f3... Improve child performances (#1314) -} - -module.exports = closePointInTimeApi diff --git a/api/api/cluster.allocation_explain.js b/api/api/cluster.allocation_explain.js deleted file mode 100644 index c17b40213..000000000 --- a/api/api/cluster.allocation_explain.js +++ /dev/null @@ -1,81 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildClusterAllocationExplain (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'include_yes_decisions', - 'include_disk_info', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - includeYesDecisions: 'include_yes_decisions', - includeDiskInfo: 'include_disk_info', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a cluster.allocation_explain request - * Provides explanations for shard allocations in the cluster. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-allocation-explain.html - */ - return function clusterAllocationExplain (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + '_cluster' + '/' + 'allocation' + '/' + 'explain' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildClusterAllocationExplain diff --git a/api/api/cluster.delete_component_template.js b/api/api/cluster.delete_component_template.js deleted file mode 100644 index d47afdd27..000000000 --- a/api/api/cluster.delete_component_template.js +++ /dev/null @@ -1,86 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildClusterDeleteComponentTemplate (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'timeout', - 'master_timeout', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a cluster.delete_component_template request - * Deletes a component template - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html - */ - return function clusterDeleteComponentTemplate (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['name'] == null) { - const err = new ConfigurationError('Missing required parameter: name') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'DELETE' - path = '/' + '_component_template' + '/' + encodeURIComponent(name) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildClusterDeleteComponentTemplate diff --git a/api/api/cluster.delete_voting_config_exclusions.js b/api/api/cluster.delete_voting_config_exclusions.js deleted file mode 100644 index fce5bfd28..000000000 --- a/api/api/cluster.delete_voting_config_exclusions.js +++ /dev/null @@ -1,79 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildClusterDeleteVotingConfigExclusions (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'wait_for_removal', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - waitForRemoval: 'wait_for_removal', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a cluster.delete_voting_config_exclusions request - * Clears cluster voting config exclusions. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/voting-config-exclusions.html - */ - return function clusterDeleteVotingConfigExclusions (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'DELETE' - path = '/' + '_cluster' + '/' + 'voting_config_exclusions' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildClusterDeleteVotingConfigExclusions diff --git a/api/api/cluster.exists_component_template.js b/api/api/cluster.exists_component_template.js deleted file mode 100644 index cfdb42494..000000000 --- a/api/api/cluster.exists_component_template.js +++ /dev/null @@ -1,86 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildClusterExistsComponentTemplate (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'master_timeout', - 'local', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a cluster.exists_component_template request - * Returns information about whether a particular component template exist - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html - */ - return function clusterExistsComponentTemplate (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['name'] == null) { - const err = new ConfigurationError('Missing required parameter: name') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'HEAD' - path = '/' + '_component_template' + '/' + encodeURIComponent(name) - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildClusterExistsComponentTemplate diff --git a/api/api/cluster.get_component_template.js b/api/api/cluster.get_component_template.js deleted file mode 100644 index 8a6d3030f..000000000 --- a/api/api/cluster.get_component_template.js +++ /dev/null @@ -1,85 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildClusterGetComponentTemplate (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'master_timeout', - 'local', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a cluster.get_component_template request - * Returns one or more component templates - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html - */ - return function clusterGetComponentTemplate (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((name) != null) { - if (method == null) method = 'GET' - path = '/' + '_component_template' + '/' + encodeURIComponent(name) - } else { - if (method == null) method = 'GET' - path = '/' + '_component_template' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildClusterGetComponentTemplate diff --git a/api/api/cluster.get_settings.js b/api/api/cluster.get_settings.js deleted file mode 100644 index 3ba0d4d9f..000000000 --- a/api/api/cluster.get_settings.js +++ /dev/null @@ -1,84 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildClusterGetSettings (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'flat_settings', - 'master_timeout', - 'timeout', - 'include_defaults', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - flatSettings: 'flat_settings', - masterTimeout: 'master_timeout', - includeDefaults: 'include_defaults', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a cluster.get_settings request - * Returns cluster settings. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html - */ - return function clusterGetSettings (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + '_cluster' + '/' + 'settings' - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildClusterGetSettings diff --git a/api/api/cluster.health.js b/api/api/cluster.health.js deleted file mode 100644 index 077dd1a89..000000000 --- a/api/api/cluster.health.js +++ /dev/null @@ -1,101 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildClusterHealth (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'expand_wildcards', - 'level', - 'local', - 'master_timeout', - 'timeout', - 'wait_for_active_shards', - 'wait_for_nodes', - 'wait_for_events', - 'wait_for_no_relocating_shards', - 'wait_for_no_initializing_shards', - 'wait_for_status', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - expandWildcards: 'expand_wildcards', - masterTimeout: 'master_timeout', - waitForActiveShards: 'wait_for_active_shards', - waitForNodes: 'wait_for_nodes', - waitForEvents: 'wait_for_events', - waitForNoRelocatingShards: 'wait_for_no_relocating_shards', - waitForNoInitializingShards: 'wait_for_no_initializing_shards', - waitForStatus: 'wait_for_status', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a cluster.health request - * Returns basic information about the health of the cluster. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-health.html - */ - return function clusterHealth (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null) { - if (method == null) method = 'GET' - path = '/' + '_cluster' + '/' + 'health' + '/' + encodeURIComponent(index) - } else { - if (method == null) method = 'GET' - path = '/' + '_cluster' + '/' + 'health' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildClusterHealth diff --git a/api/api/cluster.pending_tasks.js b/api/api/cluster.pending_tasks.js deleted file mode 100644 index bde8cd9d8..000000000 --- a/api/api/cluster.pending_tasks.js +++ /dev/null @@ -1,81 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildClusterPendingTasks (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'local', - 'master_timeout', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a cluster.pending_tasks request - * Returns a list of any cluster-level changes (e.g. create index, update mapping, -allocate or fail shard) which have not yet been executed. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-pending.html - */ - return function clusterPendingTasks (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + '_cluster' + '/' + 'pending_tasks' - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildClusterPendingTasks diff --git a/api/api/cluster.post_voting_config_exclusions.js b/api/api/cluster.post_voting_config_exclusions.js deleted file mode 100644 index 14cd90379..000000000 --- a/api/api/cluster.post_voting_config_exclusions.js +++ /dev/null @@ -1,82 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildClusterPostVotingConfigExclusions (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'node_ids', - 'node_names', - 'timeout', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - nodeIds: 'node_ids', - nodeNames: 'node_names', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a cluster.post_voting_config_exclusions request - * Updates the cluster voting config exclusions by node ids or node names. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/voting-config-exclusions.html - */ - return function clusterPostVotingConfigExclusions (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_cluster' + '/' + 'voting_config_exclusions' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildClusterPostVotingConfigExclusions diff --git a/api/api/cluster.put_component_template.js b/api/api/cluster.put_component_template.js deleted file mode 100644 index 6dbcacf9f..000000000 --- a/api/api/cluster.put_component_template.js +++ /dev/null @@ -1,91 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildClusterPutComponentTemplate (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'create', - 'timeout', - 'master_timeout', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a cluster.put_component_template request - * Creates or updates a component template - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html - */ - return function clusterPutComponentTemplate (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['name'] == null) { - const err = new ConfigurationError('Missing required parameter: name') - return handleError(err, callback) - } - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'PUT' - path = '/' + '_component_template' + '/' + encodeURIComponent(name) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildClusterPutComponentTemplate diff --git a/api/api/cluster.put_settings.js b/api/api/cluster.put_settings.js deleted file mode 100644 index d49a6261a..000000000 --- a/api/api/cluster.put_settings.js +++ /dev/null @@ -1,88 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildClusterPutSettings (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'flat_settings', - 'master_timeout', - 'timeout', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - flatSettings: 'flat_settings', - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a cluster.put_settings request - * Updates the cluster settings. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html - */ - return function clusterPutSettings (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'PUT' - path = '/' + '_cluster' + '/' + 'settings' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildClusterPutSettings diff --git a/api/api/cluster.remote_info.js b/api/api/cluster.remote_info.js deleted file mode 100644 index a18e6d6dc..000000000 --- a/api/api/cluster.remote_info.js +++ /dev/null @@ -1,77 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildClusterRemoteInfo (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a cluster.remote_info request - * Returns the information about configured remote clusters. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-remote-info.html - */ - return function clusterRemoteInfo (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + '_remote' + '/' + 'info' - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildClusterRemoteInfo diff --git a/api/api/cluster.reroute.js b/api/api/cluster.reroute.js deleted file mode 100644 index 6b00af451..000000000 --- a/api/api/cluster.reroute.js +++ /dev/null @@ -1,86 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildClusterReroute (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'dry_run', - 'explain', - 'retry_failed', - 'metric', - 'master_timeout', - 'timeout', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - dryRun: 'dry_run', - retryFailed: 'retry_failed', - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a cluster.reroute request - * Allows to manually change the allocation of individual shards in the cluster. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-reroute.html - */ - return function clusterReroute (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_cluster' + '/' + 'reroute' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildClusterReroute diff --git a/api/api/cluster.state.js b/api/api/cluster.state.js deleted file mode 100644 index bc54b2a0e..000000000 --- a/api/api/cluster.state.js +++ /dev/null @@ -1,106 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildClusterState (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'local', - 'master_timeout', - 'flat_settings', - 'wait_for_metadata_version', - 'wait_for_timeout', - 'ignore_unavailable', - 'allow_no_indices', - 'expand_wildcards', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - flatSettings: 'flat_settings', - waitForMetadataVersion: 'wait_for_metadata_version', - waitForTimeout: 'wait_for_timeout', - ignoreUnavailable: 'ignore_unavailable', - allowNoIndices: 'allow_no_indices', - expandWildcards: 'expand_wildcards', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a cluster.state request - * Returns a comprehensive information about the state of the cluster. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-state.html - */ - return function clusterState (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required url components - if (params['index'] != null && (params['metric'] == null)) { - const err = new ConfigurationError('Missing required parameter of the url: metric') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, metric, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((metric) != null && (index) != null) { - if (method == null) method = 'GET' - path = '/' + '_cluster' + '/' + 'state' + '/' + encodeURIComponent(metric) + '/' + encodeURIComponent(index) - } else if ((metric) != null) { - if (method == null) method = 'GET' - path = '/' + '_cluster' + '/' + 'state' + '/' + encodeURIComponent(metric) - } else { - if (method == null) method = 'GET' - path = '/' + '_cluster' + '/' + 'state' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildClusterState diff --git a/api/api/cluster.stats.js b/api/api/cluster.stats.js deleted file mode 100644 index be39dc291..000000000 --- a/api/api/cluster.stats.js +++ /dev/null @@ -1,85 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildClusterStats (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'flat_settings', - 'timeout', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - flatSettings: 'flat_settings', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a cluster.stats request - * Returns high-level overview of cluster statistics. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-stats.html - */ - return function clusterStats (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, nodeId, node_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((node_id || nodeId) != null) { - if (method == null) method = 'GET' - path = '/' + '_cluster' + '/' + 'stats' + '/' + 'nodes' + '/' + encodeURIComponent(node_id || nodeId) - } else { - if (method == null) method = 'GET' - path = '/' + '_cluster' + '/' + 'stats' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildClusterStats diff --git a/api/api/count.js b/api/api/count.js index dd270f36d..5d788bbd1 100644 --- a/api/api/count.js +++ b/api/api/count.js @@ -1,6 +1,21 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ 'use strict' @@ -14,11 +29,20 @@ const snakeCase = { ignoreUnavailable: 'ignore_unavailable', ignoreThrottled: 'i function countApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) - var { method, body, index, ...querystring } = params + // check required url components + if (params['type'] != null && (params['index'] == null)) { + const err = new this[kConfigurationError]('Missing required parameter of the url: index') + return handleError(err, callback) + } + + var { method, body, index, type, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) var path = '' - if ((index) != null) { + if ((index) != null && (type) != null) { + if (method == null) method = body == null ? 'GET' : 'POST' + path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_count' + } else if ((index) != null) { if (method == null) method = body == null ? 'GET' : 'POST' path = '/' + encodeURIComponent(index) + '/' + '_count' } else { @@ -26,76 +50,12 @@ function countApi (params, options, callback) { path = '/' + '_count' } -<<<<<<< HEAD - /** - * Perform a count request - * Returns number of documents matching a query. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/search-count.html - */ - return function count (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required url components - if (params['type'] != null && (params['index'] == null)) { - const err = new ConfigurationError('Missing required parameter of the url: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, type, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null && (type) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_count' - } else if ((index) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_count' - } else { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + '_count' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) -======= // build request object const request = { method, path, body: body || '', querystring ->>>>>>> a064f0f3... Improve child performances (#1314) } return this.transport.request(request, options, callback) diff --git a/api/api/create.js b/api/api/create.js index 2eed11754..5977dd0a4 100644 --- a/api/api/create.js +++ b/api/api/create.js @@ -1,6 +1,21 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ 'use strict' diff --git a/api/api/dangling_indices.delete_dangling_index.js b/api/api/dangling_indices.delete_dangling_index.js deleted file mode 100644 index 5b9b6dbc3..000000000 --- a/api/api/dangling_indices.delete_dangling_index.js +++ /dev/null @@ -1,88 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildDanglingIndicesDeleteDanglingIndex (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'accept_data_loss', - 'timeout', - 'master_timeout', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - acceptDataLoss: 'accept_data_loss', - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a dangling_indices.delete_dangling_index request - * Deletes the specified dangling index - * https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-gateway-dangling-indices.html - */ - return function danglingIndicesDeleteDanglingIndex (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['index_uuid'] == null && params['indexUuid'] == null) { - const err = new ConfigurationError('Missing required parameter: index_uuid or indexUuid') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, indexUuid, index_uuid, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'DELETE' - path = '/' + '_dangling' + '/' + encodeURIComponent(index_uuid || indexUuid) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildDanglingIndicesDeleteDanglingIndex diff --git a/api/api/dangling_indices.import_dangling_index.js b/api/api/dangling_indices.import_dangling_index.js deleted file mode 100644 index 69a6e4b46..000000000 --- a/api/api/dangling_indices.import_dangling_index.js +++ /dev/null @@ -1,88 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildDanglingIndicesImportDanglingIndex (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'accept_data_loss', - 'timeout', - 'master_timeout', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - acceptDataLoss: 'accept_data_loss', - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a dangling_indices.import_dangling_index request - * Imports the specified dangling index - * https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-gateway-dangling-indices.html - */ - return function danglingIndicesImportDanglingIndex (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['index_uuid'] == null && params['indexUuid'] == null) { - const err = new ConfigurationError('Missing required parameter: index_uuid or indexUuid') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, indexUuid, index_uuid, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_dangling' + '/' + encodeURIComponent(index_uuid || indexUuid) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildDanglingIndicesImportDanglingIndex diff --git a/api/api/dangling_indices.list_dangling_indices.js b/api/api/dangling_indices.list_dangling_indices.js deleted file mode 100644 index fdc3847af..000000000 --- a/api/api/dangling_indices.list_dangling_indices.js +++ /dev/null @@ -1,77 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildDanglingIndicesListDanglingIndices (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a dangling_indices.list_dangling_indices request - * Returns all dangling indices. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-gateway-dangling-indices.html - */ - return function danglingIndicesListDanglingIndices (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + '_dangling' - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildDanglingIndicesListDanglingIndices diff --git a/api/api/delete.js b/api/api/delete.js index 838c6207c..bcdb5fe5e 100644 --- a/api/api/delete.js +++ b/api/api/delete.js @@ -1,6 +1,21 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ 'use strict' diff --git a/api/api/delete_by_query.js b/api/api/delete_by_query.js index 9cab4cd5a..1c6c22d13 100644 --- a/api/api/delete_by_query.js +++ b/api/api/delete_by_query.js @@ -1,6 +1,21 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ 'use strict' @@ -8,134 +23,9 @@ /* eslint no-unused-vars: 0 */ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') -const acceptedQuerystring = ['analyzer', 'analyze_wildcard', 'default_operator', 'df', 'from', 'ignore_unavailable', 'allow_no_indices', 'conflicts', 'expand_wildcards', 'lenient', 'preference', 'q', 'routing', 'scroll', 'search_type', 'search_timeout', 'max_docs', 'sort', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'terminate_after', 'stats', 'version', 'request_cache', 'refresh', 'timeout', 'wait_for_active_shards', 'scroll_size', 'wait_for_completion', 'requests_per_second', 'slices', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] +const acceptedQuerystring = ['analyzer', 'analyze_wildcard', 'default_operator', 'df', 'from', 'ignore_unavailable', 'allow_no_indices', 'conflicts', 'expand_wildcards', 'lenient', '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', 'request_cache', 'refresh', 'timeout', 'wait_for_active_shards', 'scroll_size', 'wait_for_completion', 'requests_per_second', 'slices', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] 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', 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' } -<<<<<<< HEAD - const acceptedQuerystring = [ - 'analyzer', - 'analyze_wildcard', - 'default_operator', - 'df', - 'from', - 'ignore_unavailable', - 'allow_no_indices', - 'conflicts', - 'expand_wildcards', - 'lenient', - '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', - 'request_cache', - 'refresh', - 'timeout', - 'wait_for_active_shards', - 'scroll_size', - 'wait_for_completion', - 'requests_per_second', - 'slices', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - 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', - 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' - } - - /** - * Perform a delete_by_query request - * Deletes documents matching the provided query. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete-by-query.html - */ - return function deleteByQuery (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // check required url components - if (params['type'] != null && (params['index'] == null)) { - const err = new ConfigurationError('Missing required parameter of the url: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, type, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null && (type) != null) { - if (method == null) method = 'POST' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_delete_by_query' - } else { - if (method == null) method = 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_delete_by_query' - } -======= function deleteByQueryApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) @@ -149,13 +39,23 @@ function deleteByQueryApi (params, options, callback) { return handleError(err, callback) } - var { method, body, index, ...querystring } = params + // check required url components + if (params['type'] != null && (params['index'] == null)) { + const err = new this[kConfigurationError]('Missing required parameter of the url: index') + return handleError(err, callback) + } + + var { method, body, index, type, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) ->>>>>>> a064f0f3... Improve child performances (#1314) var path = '' - if (method == null) method = 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_delete_by_query' + if ((index) != null && (type) != null) { + if (method == null) method = 'POST' + path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_delete_by_query' + } else { + if (method == null) method = 'POST' + path = '/' + encodeURIComponent(index) + '/' + '_delete_by_query' + } // build request object const request = { diff --git a/api/api/delete_by_query_rethrottle.js b/api/api/delete_by_query_rethrottle.js index 6e2ade9a0..6221bbb01 100644 --- a/api/api/delete_by_query_rethrottle.js +++ b/api/api/delete_by_query_rethrottle.js @@ -1,6 +1,21 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ 'use strict' diff --git a/api/api/delete_script.js b/api/api/delete_script.js index e38f8d7fc..b583be6b8 100644 --- a/api/api/delete_script.js +++ b/api/api/delete_script.js @@ -1,6 +1,21 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ 'use strict' diff --git a/api/api/enrich.delete_policy.js b/api/api/enrich.delete_policy.js deleted file mode 100644 index 790e0aec4..000000000 --- a/api/api/enrich.delete_policy.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildEnrichDeletePolicy (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a enrich.delete_policy request - * Deletes an existing enrich policy and its enrich index. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-enrich-policy-api.html - */ - return function enrichDeletePolicy (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['name'] == null) { - const err = new ConfigurationError('Missing required parameter: name') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'DELETE' - path = '/' + '_enrich' + '/' + 'policy' + '/' + encodeURIComponent(name) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildEnrichDeletePolicy diff --git a/api/api/enrich.execute_policy.js b/api/api/enrich.execute_policy.js deleted file mode 100644 index 76dc6555b..000000000 --- a/api/api/enrich.execute_policy.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildEnrichExecutePolicy (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'wait_for_completion' - ] - - const snakeCase = { - waitForCompletion: 'wait_for_completion' - } - - /** - * Perform a enrich.execute_policy request - * Creates the enrich index for an existing enrich policy. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/execute-enrich-policy-api.html - */ - return function enrichExecutePolicy (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['name'] == null) { - const err = new ConfigurationError('Missing required parameter: name') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'PUT' - path = '/' + '_enrich' + '/' + 'policy' + '/' + encodeURIComponent(name) + '/' + '_execute' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildEnrichExecutePolicy diff --git a/api/api/enrich.get_policy.js b/api/api/enrich.get_policy.js deleted file mode 100644 index 66dc936c3..000000000 --- a/api/api/enrich.get_policy.js +++ /dev/null @@ -1,77 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildEnrichGetPolicy (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a enrich.get_policy request - * Gets information about an enrich policy. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/get-enrich-policy-api.html - */ - return function enrichGetPolicy (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((name) != null) { - if (method == null) method = 'GET' - path = '/' + '_enrich' + '/' + 'policy' + '/' + encodeURIComponent(name) - } else { - if (method == null) method = 'GET' - path = '/' + '_enrich' + '/' + 'policy' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildEnrichGetPolicy diff --git a/api/api/enrich.put_policy.js b/api/api/enrich.put_policy.js deleted file mode 100644 index 8e5ce4423..000000000 --- a/api/api/enrich.put_policy.js +++ /dev/null @@ -1,82 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildEnrichPutPolicy (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a enrich.put_policy request - * Creates a new enrich policy. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/put-enrich-policy-api.html - */ - return function enrichPutPolicy (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['name'] == null) { - const err = new ConfigurationError('Missing required parameter: name') - return handleError(err, callback) - } - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'PUT' - path = '/' + '_enrich' + '/' + 'policy' + '/' + encodeURIComponent(name) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildEnrichPutPolicy diff --git a/api/api/enrich.stats.js b/api/api/enrich.stats.js deleted file mode 100644 index eef1acb3a..000000000 --- a/api/api/enrich.stats.js +++ /dev/null @@ -1,72 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildEnrichStats (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a enrich.stats request - * Gets enrich coordinator statistics and information about enrich policies that are currently executing. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-stats-api.html - */ - return function enrichStats (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + '_enrich' + '/' + '_stats' - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildEnrichStats diff --git a/api/api/eql.delete.js b/api/api/eql.delete.js deleted file mode 100644 index 33efe0512..000000000 --- a/api/api/eql.delete.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildEqlDelete (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a eql.delete request - * Deletes an async EQL search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html - */ - return function eqlDelete (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['id'] == null) { - const err = new ConfigurationError('Missing required parameter: id') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'DELETE' - path = '/' + '_eql' + '/' + 'search' + '/' + encodeURIComponent(id) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildEqlDelete diff --git a/api/api/eql.get.js b/api/api/eql.get.js deleted file mode 100644 index 05fe84d1a..000000000 --- a/api/api/eql.get.js +++ /dev/null @@ -1,80 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildEqlGet (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'wait_for_completion_timeout', - 'keep_alive' - ] - - const snakeCase = { - waitForCompletionTimeout: 'wait_for_completion_timeout', - keepAlive: 'keep_alive' - } - - /** - * Perform a eql.get request - * Returns async results from previously executed Event Query Language (EQL) search - * https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html - */ - return function eqlGet (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['id'] == null) { - const err = new ConfigurationError('Missing required parameter: id') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + '_eql' + '/' + 'search' + '/' + encodeURIComponent(id) - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildEqlGet diff --git a/api/api/eql.search.js b/api/api/eql.search.js deleted file mode 100644 index eaa611d8a..000000000 --- a/api/api/eql.search.js +++ /dev/null @@ -1,86 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildEqlSearch (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'wait_for_completion_timeout', - 'keep_on_completion', - 'keep_alive' - ] - - const snakeCase = { - waitForCompletionTimeout: 'wait_for_completion_timeout', - keepOnCompletion: 'keep_on_completion', - keepAlive: 'keep_alive' - } - - /** - * Perform a eql.search request - * Returns results matching a query expressed in Event Query Language (EQL) - * https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html - */ - return function eqlSearch (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_eql' + '/' + 'search' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildEqlSearch diff --git a/api/api/exists.js b/api/api/exists.js index ec39d42d0..f719f930e 100644 --- a/api/api/exists.js +++ b/api/api/exists.js @@ -1,6 +1,21 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ 'use strict' @@ -11,90 +26,6 @@ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = const acceptedQuerystring = ['stored_fields', 'preference', 'realtime', 'refresh', 'routing', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'version', 'version_type', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] const snakeCase = { storedFields: 'stored_fields', _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', versionType: 'version_type', errorTrace: 'error_trace', filterPath: 'filter_path' } -<<<<<<< HEAD - const acceptedQuerystring = [ - 'stored_fields', - 'preference', - 'realtime', - 'refresh', - 'routing', - '_source', - '_source_excludes', - '_source_exclude', - '_source_includes', - '_source_include', - 'version', - 'version_type', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - storedFields: 'stored_fields', - _sourceExcludes: '_source_excludes', - _sourceExclude: '_source_exclude', - _sourceIncludes: '_source_includes', - _sourceInclude: '_source_include', - versionType: 'version_type', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a exists request - * Returns information about whether a document exists in an index. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html - */ - return function exists (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['id'] == null) { - const err = new ConfigurationError('Missing required parameter: id') - return handleError(err, callback) - } - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, id, index, type, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null && (type) != null && (id) != null) { - if (method == null) method = 'HEAD' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) - } else { - if (method == null) method = 'HEAD' - path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id) - } -======= function existsApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) @@ -108,13 +39,17 @@ function existsApi (params, options, callback) { return handleError(err, callback) } - var { method, body, id, index, ...querystring } = params + var { method, body, id, index, type, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) ->>>>>>> a064f0f3... Improve child performances (#1314) var path = '' - if (method == null) method = 'HEAD' - path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id) + if ((index) != null && (type) != null && (id) != null) { + if (method == null) method = 'HEAD' + path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + } else { + if (method == null) method = 'HEAD' + path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id) + } // build request object const request = { diff --git a/api/api/exists_source.js b/api/api/exists_source.js index 391c56353..f16c6abbd 100644 --- a/api/api/exists_source.js +++ b/api/api/exists_source.js @@ -1,6 +1,21 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ 'use strict' @@ -11,35 +26,6 @@ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = const acceptedQuerystring = ['preference', 'realtime', 'refresh', 'routing', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'version', 'version_type', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] const snakeCase = { _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', versionType: 'version_type', errorTrace: 'error_trace', filterPath: 'filter_path' } -<<<<<<< HEAD - const acceptedQuerystring = [ - 'preference', - 'realtime', - 'refresh', - 'routing', - '_source', - '_source_excludes', - '_source_exclude', - '_source_includes', - '_source_include', - 'version', - 'version_type', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - _sourceExcludes: '_source_excludes', - _sourceExclude: '_source_exclude', - _sourceIncludes: '_source_includes', - _sourceInclude: '_source_include', - versionType: 'version_type', - errorTrace: 'error_trace', - filterPath: 'filter_path' -======= function existsSourceApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) @@ -51,7 +37,6 @@ function existsSourceApi (params, options, callback) { if (params['index'] == null) { const err = new this[kConfigurationError]('Missing required parameter: index') return handleError(err, callback) ->>>>>>> a064f0f3... Improve child performances (#1314) } // check required url components diff --git a/api/api/explain.js b/api/api/explain.js index 831fce1ab..12bc10366 100644 --- a/api/api/explain.js +++ b/api/api/explain.js @@ -1,6 +1,21 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ 'use strict' @@ -11,93 +26,6 @@ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = const acceptedQuerystring = ['analyze_wildcard', 'analyzer', 'default_operator', 'df', 'stored_fields', 'lenient', 'preference', 'q', 'routing', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] const snakeCase = { analyzeWildcard: 'analyze_wildcard', defaultOperator: 'default_operator', storedFields: 'stored_fields', _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', errorTrace: 'error_trace', filterPath: 'filter_path' } -<<<<<<< HEAD - const acceptedQuerystring = [ - 'analyze_wildcard', - 'analyzer', - 'default_operator', - 'df', - 'stored_fields', - 'lenient', - 'preference', - 'q', - 'routing', - '_source', - '_source_excludes', - '_source_exclude', - '_source_includes', - '_source_include', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - analyzeWildcard: 'analyze_wildcard', - defaultOperator: 'default_operator', - storedFields: 'stored_fields', - _sourceExcludes: '_source_excludes', - _sourceExclude: '_source_exclude', - _sourceIncludes: '_source_includes', - _sourceInclude: '_source_include', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a explain request - * Returns information about why a specific matches (or doesn't match) a query. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/search-explain.html - */ - return function explain (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['id'] == null) { - const err = new ConfigurationError('Missing required parameter: id') - return handleError(err, callback) - } - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, id, index, type, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null && (type) != null && (id) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_explain' - } else { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_explain' + '/' + encodeURIComponent(id) - } -======= function explainApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) @@ -111,13 +39,17 @@ function explainApi (params, options, callback) { return handleError(err, callback) } - var { method, body, id, index, ...querystring } = params + var { method, body, id, index, type, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) ->>>>>>> a064f0f3... Improve child performances (#1314) var path = '' - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_explain' + '/' + encodeURIComponent(id) + if ((index) != null && (type) != null && (id) != null) { + if (method == null) method = body == null ? 'GET' : 'POST' + path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_explain' + } else { + if (method == null) method = body == null ? 'GET' : 'POST' + path = '/' + encodeURIComponent(index) + '/' + '_explain' + '/' + encodeURIComponent(id) + } // build request object const request = { diff --git a/api/api/field_caps.js b/api/api/field_caps.js index abaa79f3f..fdc2f316c 100644 --- a/api/api/field_caps.js +++ b/api/api/field_caps.js @@ -1,6 +1,21 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ 'use strict' diff --git a/api/api/get.js b/api/api/get.js index 9c9d5813d..bfa9cbc79 100644 --- a/api/api/get.js +++ b/api/api/get.js @@ -1,6 +1,21 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ 'use strict' @@ -11,90 +26,6 @@ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = const acceptedQuerystring = ['stored_fields', 'preference', 'realtime', 'refresh', 'routing', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'version', 'version_type', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] const snakeCase = { storedFields: 'stored_fields', _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', versionType: 'version_type', errorTrace: 'error_trace', filterPath: 'filter_path' } -<<<<<<< HEAD - const acceptedQuerystring = [ - 'stored_fields', - 'preference', - 'realtime', - 'refresh', - 'routing', - '_source', - '_source_excludes', - '_source_exclude', - '_source_includes', - '_source_include', - 'version', - 'version_type', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - storedFields: 'stored_fields', - _sourceExcludes: '_source_excludes', - _sourceExclude: '_source_exclude', - _sourceIncludes: '_source_includes', - _sourceInclude: '_source_include', - versionType: 'version_type', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a get request - * Returns a document. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html - */ - return function get (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['id'] == null) { - const err = new ConfigurationError('Missing required parameter: id') - return handleError(err, callback) - } - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, id, index, type, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null && (type) != null && (id) != null) { - if (method == null) method = 'GET' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) - } else { - if (method == null) method = 'GET' - path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id) - } -======= function getApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) @@ -108,13 +39,17 @@ function getApi (params, options, callback) { return handleError(err, callback) } - var { method, body, id, index, ...querystring } = params + var { method, body, id, index, type, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) ->>>>>>> a064f0f3... Improve child performances (#1314) var path = '' - if (method == null) method = 'GET' - path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id) + if ((index) != null && (type) != null && (id) != null) { + if (method == null) method = 'GET' + path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + } else { + if (method == null) method = 'GET' + path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id) + } // build request object const request = { diff --git a/api/api/get_script.js b/api/api/get_script.js index f8a9aacef..0409e82fe 100644 --- a/api/api/get_script.js +++ b/api/api/get_script.js @@ -1,6 +1,21 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ 'use strict' diff --git a/api/api/get_script_context.js b/api/api/get_script_context.js index 3b712bc18..7c770f2d1 100644 --- a/api/api/get_script_context.js +++ b/api/api/get_script_context.js @@ -1,6 +1,21 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ 'use strict' diff --git a/api/api/get_script_languages.js b/api/api/get_script_languages.js index 6b2611bf1..455a1ca45 100644 --- a/api/api/get_script_languages.js +++ b/api/api/get_script_languages.js @@ -1,6 +1,21 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ 'use strict' diff --git a/api/api/get_source.js b/api/api/get_source.js index 47f6ae210..23121d2dd 100644 --- a/api/api/get_source.js +++ b/api/api/get_source.js @@ -1,6 +1,21 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ 'use strict' @@ -11,88 +26,6 @@ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = const acceptedQuerystring = ['preference', 'realtime', 'refresh', 'routing', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'version', 'version_type', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] const snakeCase = { _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', versionType: 'version_type', errorTrace: 'error_trace', filterPath: 'filter_path' } -<<<<<<< HEAD - const acceptedQuerystring = [ - 'preference', - 'realtime', - 'refresh', - 'routing', - '_source', - '_source_excludes', - '_source_exclude', - '_source_includes', - '_source_include', - 'version', - 'version_type', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - _sourceExcludes: '_source_excludes', - _sourceExclude: '_source_exclude', - _sourceIncludes: '_source_includes', - _sourceInclude: '_source_include', - versionType: 'version_type', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a get_source request - * Returns the source of a document. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html - */ - return function getSource (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['id'] == null) { - const err = new ConfigurationError('Missing required parameter: id') - return handleError(err, callback) - } - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, id, index, type, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null && (type) != null && (id) != null) { - if (method == null) method = 'GET' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_source' - } else { - if (method == null) method = 'GET' - path = '/' + encodeURIComponent(index) + '/' + '_source' + '/' + encodeURIComponent(id) - } -======= function getSourceApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) @@ -106,13 +39,17 @@ function getSourceApi (params, options, callback) { return handleError(err, callback) } - var { method, body, id, index, ...querystring } = params + var { method, body, id, index, type, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) ->>>>>>> a064f0f3... Improve child performances (#1314) var path = '' - if (method == null) method = 'GET' - path = '/' + encodeURIComponent(index) + '/' + '_source' + '/' + encodeURIComponent(id) + if ((index) != null && (type) != null && (id) != null) { + if (method == null) method = 'GET' + path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_source' + } else { + if (method == null) method = 'GET' + path = '/' + encodeURIComponent(index) + '/' + '_source' + '/' + encodeURIComponent(id) + } // build request object const request = { diff --git a/api/api/graph.explore.js b/api/api/graph.explore.js deleted file mode 100644 index af164898e..000000000 --- a/api/api/graph.explore.js +++ /dev/null @@ -1,90 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildGraphExplore (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'routing', - 'timeout' - ] - - const snakeCase = { - - } - - /** - * Perform a graph.explore request - * Explore extracted and summarized information about the documents and terms in an index. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/graph-explore-api.html - */ - return function graphExplore (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - - // check required url components - if (params['type'] != null && (params['index'] == null)) { - const err = new ConfigurationError('Missing required parameter of the url: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, type, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null && (type) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_graph' + '/' + 'explore' - } else { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_graph' + '/' + 'explore' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildGraphExplore diff --git a/api/api/graph.js b/api/api/graph.js index bfbd967cc..5f6ac9420 100644 --- a/api/api/graph.js +++ b/api/api/graph.js @@ -40,12 +40,23 @@ GraphApi.prototype.explore = function graphExploreApi (params, options, callback return handleError(err, callback) } - var { method, body, index, ...querystring } = params + // check required url components + if (params['type'] != null && (params['index'] == null)) { + const err = new this[kConfigurationError]('Missing required parameter of the url: index') + return handleError(err, callback) + } + + var { method, body, index, type, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) var path = '' - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_graph' + '/' + 'explore' + if ((index) != null && (type) != null) { + if (method == null) method = body == null ? 'GET' : 'POST' + path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_graph' + '/' + 'explore' + } else { + if (method == null) method = body == null ? 'GET' : 'POST' + path = '/' + encodeURIComponent(index) + '/' + '_graph' + '/' + 'explore' + } // build request object const request = { diff --git a/api/api/ilm.delete_lifecycle.js b/api/api/ilm.delete_lifecycle.js deleted file mode 100644 index 798cf7871..000000000 --- a/api/api/ilm.delete_lifecycle.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIlmDeleteLifecycle (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a ilm.delete_lifecycle request - * Deletes the specified lifecycle policy definition. A currently used policy cannot be deleted. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-delete-lifecycle.html - */ - return function ilmDeleteLifecycle (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['policy'] == null) { - const err = new ConfigurationError('Missing required parameter: policy') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, policy, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'DELETE' - path = '/' + '_ilm' + '/' + 'policy' + '/' + encodeURIComponent(policy) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIlmDeleteLifecycle diff --git a/api/api/ilm.explain_lifecycle.js b/api/api/ilm.explain_lifecycle.js deleted file mode 100644 index d2e85be72..000000000 --- a/api/api/ilm.explain_lifecycle.js +++ /dev/null @@ -1,80 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIlmExplainLifecycle (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'only_managed', - 'only_errors' - ] - - const snakeCase = { - onlyManaged: 'only_managed', - onlyErrors: 'only_errors' - } - - /** - * Perform a ilm.explain_lifecycle request - * Retrieves information about the index's current lifecycle state, such as the currently executing phase, action, and step. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-explain-lifecycle.html - */ - return function ilmExplainLifecycle (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + encodeURIComponent(index) + '/' + '_ilm' + '/' + 'explain' - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIlmExplainLifecycle diff --git a/api/api/ilm.get_lifecycle.js b/api/api/ilm.get_lifecycle.js deleted file mode 100644 index bd82e7423..000000000 --- a/api/api/ilm.get_lifecycle.js +++ /dev/null @@ -1,77 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIlmGetLifecycle (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a ilm.get_lifecycle request - * Returns the specified policy definition. Includes the policy version and last modified date. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-lifecycle.html - */ - return function ilmGetLifecycle (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, policy, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((policy) != null) { - if (method == null) method = 'GET' - path = '/' + '_ilm' + '/' + 'policy' + '/' + encodeURIComponent(policy) - } else { - if (method == null) method = 'GET' - path = '/' + '_ilm' + '/' + 'policy' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIlmGetLifecycle diff --git a/api/api/ilm.get_status.js b/api/api/ilm.get_status.js deleted file mode 100644 index 13a26bfd8..000000000 --- a/api/api/ilm.get_status.js +++ /dev/null @@ -1,72 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIlmGetStatus (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a ilm.get_status request - * Retrieves the current index lifecycle management (ILM) status. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-status.html - */ - return function ilmGetStatus (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + '_ilm' + '/' + 'status' - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIlmGetStatus diff --git a/api/api/ilm.move_to_step.js b/api/api/ilm.move_to_step.js deleted file mode 100644 index 5ce32fcd9..000000000 --- a/api/api/ilm.move_to_step.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIlmMoveToStep (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a ilm.move_to_step request - * Manually moves an index into the specified step and executes that step. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-move-to-step.html - */ - return function ilmMoveToStep (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_ilm' + '/' + 'move' + '/' + encodeURIComponent(index) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIlmMoveToStep diff --git a/api/api/ilm.put_lifecycle.js b/api/api/ilm.put_lifecycle.js deleted file mode 100644 index 301484462..000000000 --- a/api/api/ilm.put_lifecycle.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIlmPutLifecycle (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a ilm.put_lifecycle request - * Creates a lifecycle policy - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-put-lifecycle.html - */ - return function ilmPutLifecycle (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['policy'] == null) { - const err = new ConfigurationError('Missing required parameter: policy') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, policy, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'PUT' - path = '/' + '_ilm' + '/' + 'policy' + '/' + encodeURIComponent(policy) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIlmPutLifecycle diff --git a/api/api/ilm.remove_policy.js b/api/api/ilm.remove_policy.js deleted file mode 100644 index cf3d650af..000000000 --- a/api/api/ilm.remove_policy.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIlmRemovePolicy (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a ilm.remove_policy request - * Removes the assigned lifecycle policy and stops managing the specified index - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-remove-policy.html - */ - return function ilmRemovePolicy (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_ilm' + '/' + 'remove' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIlmRemovePolicy diff --git a/api/api/ilm.retry.js b/api/api/ilm.retry.js deleted file mode 100644 index 92c2441ff..000000000 --- a/api/api/ilm.retry.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIlmRetry (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a ilm.retry request - * Retries executing the policy for an index that is in the ERROR step. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-retry-policy.html - */ - return function ilmRetry (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_ilm' + '/' + 'retry' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIlmRetry diff --git a/api/api/ilm.start.js b/api/api/ilm.start.js deleted file mode 100644 index 0cfa45824..000000000 --- a/api/api/ilm.start.js +++ /dev/null @@ -1,72 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIlmStart (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a ilm.start request - * Start the index lifecycle management (ILM) plugin. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-start.html - */ - return function ilmStart (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_ilm' + '/' + 'start' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIlmStart diff --git a/api/api/ilm.stop.js b/api/api/ilm.stop.js deleted file mode 100644 index 1d28947e7..000000000 --- a/api/api/ilm.stop.js +++ /dev/null @@ -1,72 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIlmStop (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a ilm.stop request - * Halts all lifecycle management operations and stops the index lifecycle management (ILM) plugin - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-stop.html - */ - return function ilmStop (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_ilm' + '/' + 'stop' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIlmStop diff --git a/api/api/index.js b/api/api/index.js index 060c2d5da..eccc1b281 100644 --- a/api/api/index.js +++ b/api/api/index.js @@ -1,47 +1,30 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ 'use strict' /* eslint camelcase: 0 */ /* eslint no-unused-vars: 0 */ -<<<<<<< HEAD -function buildIndex (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'wait_for_active_shards', - 'op_type', - 'refresh', - 'routing', - 'timeout', - 'version', - 'version_type', - 'if_seq_no', - 'if_primary_term', - 'pipeline', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - waitForActiveShards: 'wait_for_active_shards', - opType: 'op_type', - versionType: 'version_type', - ifSeqNo: 'if_seq_no', - ifPrimaryTerm: 'if_primary_term', - errorTrace: 'error_trace', - filterPath: 'filter_path' -======= const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') -const acceptedQuerystring = ['wait_for_active_shards', 'op_type', 'refresh', 'routing', 'timeout', 'version', 'version_type', 'if_seq_no', 'if_primary_term', 'pipeline', 'require_alias', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] -const snakeCase = { waitForActiveShards: 'wait_for_active_shards', opType: 'op_type', versionType: 'version_type', ifSeqNo: 'if_seq_no', ifPrimaryTerm: 'if_primary_term', requireAlias: 'require_alias', errorTrace: 'error_trace', filterPath: 'filter_path' } +const acceptedQuerystring = ['wait_for_active_shards', 'op_type', 'refresh', 'routing', 'timeout', 'version', 'version_type', 'if_seq_no', 'if_primary_term', 'pipeline', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] +const snakeCase = { waitForActiveShards: 'wait_for_active_shards', opType: 'op_type', versionType: 'version_type', ifSeqNo: 'if_seq_no', ifPrimaryTerm: 'if_primary_term', errorTrace: 'error_trace', filterPath: 'filter_path' } function indexApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) @@ -54,76 +37,21 @@ function indexApi (params, options, callback) { if (params['body'] == null) { const err = new this[kConfigurationError]('Missing required parameter: body') return handleError(err, callback) ->>>>>>> 3db1bed4... Improve child performances (#1314) } -<<<<<<< HEAD - /** - * Perform a index request - * Creates or updates a document in an index. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html - */ - return function _index (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, id, index, type, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null && (type) != null && (id) != null) { - if (method == null) method = 'PUT' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) - } else if ((index) != null && (id) != null) { - if (method == null) method = 'PUT' - path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id) - } else if ((index) != null && (type) != null) { - if (method == null) method = 'POST' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) - } else { - if (method == null) method = 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_doc' - } -======= - var { method, body, id, index, ...querystring } = params + var { method, body, id, index, type, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) ->>>>>>> a064f0f3... Improve child performances (#1314) var path = '' - if ((index) != null && (id) != null) { + if ((index) != null && (type) != null && (id) != null) { + if (method == null) method = 'PUT' + path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + } else if ((index) != null && (id) != null) { if (method == null) method = 'PUT' path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id) + } else if ((index) != null && (type) != null) { + if (method == null) method = 'POST' + path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) } else { if (method == null) method = 'POST' path = '/' + encodeURIComponent(index) + '/' + '_doc' diff --git a/api/api/indices.add_block.js b/api/api/indices.add_block.js deleted file mode 100644 index 4182141f9..000000000 --- a/api/api/indices.add_block.js +++ /dev/null @@ -1,102 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesAddBlock (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'timeout', - 'master_timeout', - 'ignore_unavailable', - 'allow_no_indices', - 'expand_wildcards', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - ignoreUnavailable: 'ignore_unavailable', - allowNoIndices: 'allow_no_indices', - expandWildcards: 'expand_wildcards', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.add_block request - * Adds a block to an index. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/index-modules-blocks.html - */ - return function indicesAddBlock (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - if (params['block'] == null) { - const err = new ConfigurationError('Missing required parameter: block') - return handleError(err, callback) - } - - // check required url components - if (params['block'] != null && (params['index'] == null)) { - const err = new ConfigurationError('Missing required parameter of the url: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, block, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'PUT' - path = '/' + encodeURIComponent(index) + '/' + '_block' + '/' + encodeURIComponent(block) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesAddBlock diff --git a/api/api/indices.analyze.js b/api/api/indices.analyze.js deleted file mode 100644 index 609c29b4c..000000000 --- a/api/api/indices.analyze.js +++ /dev/null @@ -1,83 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesAnalyze (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'index', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.analyze request - * Performs the analysis process on a text and return the tokens breakdown of the text. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-analyze.html - */ - return function indicesAnalyze (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_analyze' - } else { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + '_analyze' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesAnalyze diff --git a/api/api/indices.clear_cache.js b/api/api/indices.clear_cache.js deleted file mode 100644 index 634b51cd9..000000000 --- a/api/api/indices.clear_cache.js +++ /dev/null @@ -1,93 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesClearCache (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'fielddata', - 'fields', - 'query', - 'ignore_unavailable', - 'allow_no_indices', - 'expand_wildcards', - 'index', - 'request', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - ignoreUnavailable: 'ignore_unavailable', - allowNoIndices: 'allow_no_indices', - expandWildcards: 'expand_wildcards', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.clear_cache request - * Clears all or specific caches for one or more indices. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-clearcache.html - */ - return function indicesClearCache (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null) { - if (method == null) method = 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_cache' + '/' + 'clear' - } else { - if (method == null) method = 'POST' - path = '/' + '_cache' + '/' + 'clear' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesClearCache diff --git a/api/api/indices.clone.js b/api/api/indices.clone.js deleted file mode 100644 index e9539bc9d..000000000 --- a/api/api/indices.clone.js +++ /dev/null @@ -1,98 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesClone (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'timeout', - 'master_timeout', - 'wait_for_active_shards', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - waitForActiveShards: 'wait_for_active_shards', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.clone request - * Clones an index - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-clone-index.html - */ - return function indicesClone (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - if (params['target'] == null) { - const err = new ConfigurationError('Missing required parameter: target') - return handleError(err, callback) - } - - // check required url components - if (params['target'] != null && (params['index'] == null)) { - const err = new ConfigurationError('Missing required parameter of the url: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, target, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'PUT' - path = '/' + encodeURIComponent(index) + '/' + '_clone' + '/' + encodeURIComponent(target) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesClone diff --git a/api/api/indices.close.js b/api/api/indices.close.js deleted file mode 100644 index d44ed86b5..000000000 --- a/api/api/indices.close.js +++ /dev/null @@ -1,94 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesClose (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'timeout', - 'master_timeout', - 'ignore_unavailable', - 'allow_no_indices', - 'expand_wildcards', - 'wait_for_active_shards', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - ignoreUnavailable: 'ignore_unavailable', - allowNoIndices: 'allow_no_indices', - expandWildcards: 'expand_wildcards', - waitForActiveShards: 'wait_for_active_shards', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.close request - * Closes an index. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html - */ - return function indicesClose (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_close' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesClose diff --git a/api/api/indices.create.js b/api/api/indices.create.js deleted file mode 100644 index 67f9ba580..000000000 --- a/api/api/indices.create.js +++ /dev/null @@ -1,90 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesCreate (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'include_type_name', - 'wait_for_active_shards', - 'timeout', - 'master_timeout', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - includeTypeName: 'include_type_name', - waitForActiveShards: 'wait_for_active_shards', - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.create request - * Creates an index with optional settings and mappings. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-create-index.html - */ - return function indicesCreate (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'PUT' - path = '/' + encodeURIComponent(index) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesCreate diff --git a/api/api/indices.create_data_stream.js b/api/api/indices.create_data_stream.js deleted file mode 100644 index 60b676712..000000000 --- a/api/api/indices.create_data_stream.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesCreateDataStream (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a indices.create_data_stream request - * Creates a data stream - * https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html - */ - return function indicesCreateDataStream (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['name'] == null) { - const err = new ConfigurationError('Missing required parameter: name') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'PUT' - path = '/' + '_data_stream' + '/' + encodeURIComponent(name) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesCreateDataStream diff --git a/api/api/indices.data_streams_stats.js b/api/api/indices.data_streams_stats.js deleted file mode 100644 index 2f025a187..000000000 --- a/api/api/indices.data_streams_stats.js +++ /dev/null @@ -1,77 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesDataStreamsStats (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a indices.data_streams_stats request - * Provides statistics on operations happening in a data stream. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html - */ - return function indicesDataStreamsStats (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((name) != null) { - if (method == null) method = 'GET' - path = '/' + '_data_stream' + '/' + encodeURIComponent(name) + '/' + '_stats' - } else { - if (method == null) method = 'GET' - path = '/' + '_data_stream' + '/' + '_stats' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesDataStreamsStats diff --git a/api/api/indices.delete.js b/api/api/indices.delete.js deleted file mode 100644 index e10b4b41e..000000000 --- a/api/api/indices.delete.js +++ /dev/null @@ -1,92 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesDelete (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'timeout', - 'master_timeout', - 'ignore_unavailable', - 'allow_no_indices', - 'expand_wildcards', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - ignoreUnavailable: 'ignore_unavailable', - allowNoIndices: 'allow_no_indices', - expandWildcards: 'expand_wildcards', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.delete request - * Deletes an index. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-delete-index.html - */ - return function indicesDelete (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'DELETE' - path = '/' + encodeURIComponent(index) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesDelete diff --git a/api/api/indices.delete_alias.js b/api/api/indices.delete_alias.js deleted file mode 100644 index 7f5da226b..000000000 --- a/api/api/indices.delete_alias.js +++ /dev/null @@ -1,101 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesDeleteAlias (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'timeout', - 'master_timeout', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.delete_alias request - * Deletes an alias. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html - */ - return function indicesDeleteAlias (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - if (params['name'] == null) { - const err = new ConfigurationError('Missing required parameter: name') - return handleError(err, callback) - } - - // check required url components - if (params['name'] != null && (params['index'] == null)) { - const err = new ConfigurationError('Missing required parameter of the url: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null && (name) != null) { - if (method == null) method = 'DELETE' - path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name) - } else { - if (method == null) method = 'DELETE' - path = '/' + encodeURIComponent(index) + '/' + '_aliases' + '/' + encodeURIComponent(name) - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesDeleteAlias diff --git a/api/api/indices.delete_data_stream.js b/api/api/indices.delete_data_stream.js deleted file mode 100644 index 02be3d7bd..000000000 --- a/api/api/indices.delete_data_stream.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesDeleteDataStream (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a indices.delete_data_stream request - * Deletes a data stream. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html - */ - return function indicesDeleteDataStream (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['name'] == null) { - const err = new ConfigurationError('Missing required parameter: name') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'DELETE' - path = '/' + '_data_stream' + '/' + encodeURIComponent(name) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesDeleteDataStream diff --git a/api/api/indices.delete_index_template.js b/api/api/indices.delete_index_template.js deleted file mode 100644 index 94ca1beb0..000000000 --- a/api/api/indices.delete_index_template.js +++ /dev/null @@ -1,86 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesDeleteIndexTemplate (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'timeout', - 'master_timeout', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.delete_index_template request - * Deletes an index template. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html - */ - return function indicesDeleteIndexTemplate (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['name'] == null) { - const err = new ConfigurationError('Missing required parameter: name') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'DELETE' - path = '/' + '_index_template' + '/' + encodeURIComponent(name) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesDeleteIndexTemplate diff --git a/api/api/indices.delete_template.js b/api/api/indices.delete_template.js deleted file mode 100644 index d4900659a..000000000 --- a/api/api/indices.delete_template.js +++ /dev/null @@ -1,86 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesDeleteTemplate (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'timeout', - 'master_timeout', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.delete_template request - * Deletes an index template. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html - */ - return function indicesDeleteTemplate (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['name'] == null) { - const err = new ConfigurationError('Missing required parameter: name') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'DELETE' - path = '/' + '_template' + '/' + encodeURIComponent(name) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesDeleteTemplate diff --git a/api/api/indices.exists.js b/api/api/indices.exists.js deleted file mode 100644 index aadaca04c..000000000 --- a/api/api/indices.exists.js +++ /dev/null @@ -1,94 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesExists (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'local', - 'ignore_unavailable', - 'allow_no_indices', - 'expand_wildcards', - 'flat_settings', - 'include_defaults', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - ignoreUnavailable: 'ignore_unavailable', - allowNoIndices: 'allow_no_indices', - expandWildcards: 'expand_wildcards', - flatSettings: 'flat_settings', - includeDefaults: 'include_defaults', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.exists request - * Returns information about whether a particular index exists. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-exists.html - */ - return function indicesExists (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'HEAD' - path = '/' + encodeURIComponent(index) - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesExists diff --git a/api/api/indices.exists_alias.js b/api/api/indices.exists_alias.js deleted file mode 100644 index 06ad61598..000000000 --- a/api/api/indices.exists_alias.js +++ /dev/null @@ -1,95 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesExistsAlias (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'ignore_unavailable', - 'allow_no_indices', - 'expand_wildcards', - 'local', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - ignoreUnavailable: 'ignore_unavailable', - allowNoIndices: 'allow_no_indices', - expandWildcards: 'expand_wildcards', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.exists_alias request - * Returns information about whether a particular alias exists. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html - */ - return function indicesExistsAlias (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['name'] == null) { - const err = new ConfigurationError('Missing required parameter: name') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, name, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null && (name) != null) { - if (method == null) method = 'HEAD' - path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name) - } else { - if (method == null) method = 'HEAD' - path = '/' + '_alias' + '/' + encodeURIComponent(name) - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesExistsAlias diff --git a/api/api/indices.exists_index_template.js b/api/api/indices.exists_index_template.js deleted file mode 100644 index 5bb126810..000000000 --- a/api/api/indices.exists_index_template.js +++ /dev/null @@ -1,88 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesExistsIndexTemplate (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'flat_settings', - 'master_timeout', - 'local', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - flatSettings: 'flat_settings', - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.exists_index_template request - * Returns information about whether a particular index template exists. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html - */ - return function indicesExistsIndexTemplate (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['name'] == null) { - const err = new ConfigurationError('Missing required parameter: name') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'HEAD' - path = '/' + '_index_template' + '/' + encodeURIComponent(name) - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesExistsIndexTemplate diff --git a/api/api/indices.exists_template.js b/api/api/indices.exists_template.js deleted file mode 100644 index b1baa6ad1..000000000 --- a/api/api/indices.exists_template.js +++ /dev/null @@ -1,88 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesExistsTemplate (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'flat_settings', - 'master_timeout', - 'local', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - flatSettings: 'flat_settings', - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.exists_template request - * Returns information about whether a particular index template exists. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html - */ - return function indicesExistsTemplate (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['name'] == null) { - const err = new ConfigurationError('Missing required parameter: name') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'HEAD' - path = '/' + '_template' + '/' + encodeURIComponent(name) - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesExistsTemplate diff --git a/api/api/indices.exists_type.js b/api/api/indices.exists_type.js deleted file mode 100644 index d19c3d688..000000000 --- a/api/api/indices.exists_type.js +++ /dev/null @@ -1,100 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesExistsType (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'ignore_unavailable', - 'allow_no_indices', - 'expand_wildcards', - 'local', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - ignoreUnavailable: 'ignore_unavailable', - allowNoIndices: 'allow_no_indices', - expandWildcards: 'expand_wildcards', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.exists_type request - * Returns information about whether a particular document type exists. (DEPRECATED) - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-types-exists.html - */ - return function indicesExistsType (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - if (params['type'] == null) { - const err = new ConfigurationError('Missing required parameter: type') - return handleError(err, callback) - } - - // check required url components - if (params['type'] != null && (params['index'] == null)) { - const err = new ConfigurationError('Missing required parameter of the url: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, type, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'HEAD' - path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + encodeURIComponent(type) - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesExistsType diff --git a/api/api/indices.flush.js b/api/api/indices.flush.js deleted file mode 100644 index 4349c8e65..000000000 --- a/api/api/indices.flush.js +++ /dev/null @@ -1,91 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesFlush (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'force', - 'wait_if_ongoing', - 'ignore_unavailable', - 'allow_no_indices', - 'expand_wildcards', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - waitIfOngoing: 'wait_if_ongoing', - ignoreUnavailable: 'ignore_unavailable', - allowNoIndices: 'allow_no_indices', - expandWildcards: 'expand_wildcards', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.flush request - * Performs the flush operation on one or more indices. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-flush.html - */ - return function indicesFlush (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_flush' - } else { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + '_flush' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesFlush diff --git a/api/api/indices.flush_synced.js b/api/api/indices.flush_synced.js deleted file mode 100644 index d3527e8c5..000000000 --- a/api/api/indices.flush_synced.js +++ /dev/null @@ -1,88 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesFlushSynced (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'ignore_unavailable', - 'allow_no_indices', - 'expand_wildcards', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - ignoreUnavailable: 'ignore_unavailable', - allowNoIndices: 'allow_no_indices', - expandWildcards: 'expand_wildcards', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.flush_synced request - * Performs a synced flush operation on one or more indices. Synced flush is deprecated and will be removed in 8.0. Use flush instead - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-synced-flush-api.html - */ - return function indicesFlushSynced (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_flush' + '/' + 'synced' - } else { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + '_flush' + '/' + 'synced' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesFlushSynced diff --git a/api/api/indices.forcemerge.js b/api/api/indices.forcemerge.js deleted file mode 100644 index b3e2c3d1d..000000000 --- a/api/api/indices.forcemerge.js +++ /dev/null @@ -1,93 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesForcemerge (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'flush', - 'ignore_unavailable', - 'allow_no_indices', - 'expand_wildcards', - 'max_num_segments', - 'only_expunge_deletes', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - ignoreUnavailable: 'ignore_unavailable', - allowNoIndices: 'allow_no_indices', - expandWildcards: 'expand_wildcards', - maxNumSegments: 'max_num_segments', - onlyExpungeDeletes: 'only_expunge_deletes', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.forcemerge request - * Performs the force merge operation on one or more indices. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-forcemerge.html - */ - return function indicesForcemerge (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null) { - if (method == null) method = 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_forcemerge' - } else { - if (method == null) method = 'POST' - path = '/' + '_forcemerge' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesForcemerge diff --git a/api/api/indices.freeze.js b/api/api/indices.freeze.js deleted file mode 100644 index 033335bc3..000000000 --- a/api/api/indices.freeze.js +++ /dev/null @@ -1,87 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesFreeze (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'timeout', - 'master_timeout', - 'ignore_unavailable', - 'allow_no_indices', - 'expand_wildcards', - 'wait_for_active_shards' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - ignoreUnavailable: 'ignore_unavailable', - allowNoIndices: 'allow_no_indices', - expandWildcards: 'expand_wildcards', - waitForActiveShards: 'wait_for_active_shards' - } - - /** - * Perform a indices.freeze request - * Freezes an index. A frozen index has almost no overhead on the cluster (except for maintaining its metadata in memory) and is read-only. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/freeze-index-api.html - */ - return function indicesFreeze (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_freeze' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesFreeze diff --git a/api/api/indices.get.js b/api/api/indices.get.js deleted file mode 100644 index ce5c9d4e3..000000000 --- a/api/api/indices.get.js +++ /dev/null @@ -1,98 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesGet (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'include_type_name', - 'local', - 'ignore_unavailable', - 'allow_no_indices', - 'expand_wildcards', - 'flat_settings', - 'include_defaults', - 'master_timeout', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - includeTypeName: 'include_type_name', - ignoreUnavailable: 'ignore_unavailable', - allowNoIndices: 'allow_no_indices', - expandWildcards: 'expand_wildcards', - flatSettings: 'flat_settings', - includeDefaults: 'include_defaults', - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.get request - * Returns information about one or more indices. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-index.html - */ - return function indicesGet (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + encodeURIComponent(index) - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesGet diff --git a/api/api/indices.get_alias.js b/api/api/indices.get_alias.js deleted file mode 100644 index 4cbdb2fff..000000000 --- a/api/api/indices.get_alias.js +++ /dev/null @@ -1,95 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesGetAlias (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'ignore_unavailable', - 'allow_no_indices', - 'expand_wildcards', - 'local', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - ignoreUnavailable: 'ignore_unavailable', - allowNoIndices: 'allow_no_indices', - expandWildcards: 'expand_wildcards', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.get_alias request - * Returns an alias. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html - */ - return function indicesGetAlias (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, name, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null && (name) != null) { - if (method == null) method = 'GET' - path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name) - } else if ((name) != null) { - if (method == null) method = 'GET' - path = '/' + '_alias' + '/' + encodeURIComponent(name) - } else if ((index) != null) { - if (method == null) method = 'GET' - path = '/' + encodeURIComponent(index) + '/' + '_alias' - } else { - if (method == null) method = 'GET' - path = '/' + '_alias' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesGetAlias diff --git a/api/api/indices.get_data_stream.js b/api/api/indices.get_data_stream.js deleted file mode 100644 index 1457c5496..000000000 --- a/api/api/indices.get_data_stream.js +++ /dev/null @@ -1,77 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesGetDataStream (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a indices.get_data_stream request - * Returns data streams. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html - */ - return function indicesGetDataStream (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((name) != null) { - if (method == null) method = 'GET' - path = '/' + '_data_stream' + '/' + encodeURIComponent(name) - } else { - if (method == null) method = 'GET' - path = '/' + '_data_stream' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesGetDataStream diff --git a/api/api/indices.get_field_mapping.js b/api/api/indices.get_field_mapping.js deleted file mode 100644 index 0ebae652b..000000000 --- a/api/api/indices.get_field_mapping.js +++ /dev/null @@ -1,105 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesGetFieldMapping (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'include_type_name', - 'include_defaults', - 'ignore_unavailable', - 'allow_no_indices', - 'expand_wildcards', - 'local', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - includeTypeName: 'include_type_name', - includeDefaults: 'include_defaults', - ignoreUnavailable: 'ignore_unavailable', - allowNoIndices: 'allow_no_indices', - expandWildcards: 'expand_wildcards', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.get_field_mapping request - * Returns mapping for one or more fields. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-field-mapping.html - */ - return function indicesGetFieldMapping (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['fields'] == null) { - const err = new ConfigurationError('Missing required parameter: fields') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, fields, index, type, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null && (type) != null && (fields) != null) { - if (method == null) method = 'GET' - path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + encodeURIComponent(type) + '/' + 'field' + '/' + encodeURIComponent(fields) - } else if ((index) != null && (fields) != null) { - if (method == null) method = 'GET' - path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + 'field' + '/' + encodeURIComponent(fields) - } else if ((type) != null && (fields) != null) { - if (method == null) method = 'GET' - path = '/' + '_mapping' + '/' + encodeURIComponent(type) + '/' + 'field' + '/' + encodeURIComponent(fields) - } else { - if (method == null) method = 'GET' - path = '/' + '_mapping' + '/' + 'field' + '/' + encodeURIComponent(fields) - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesGetFieldMapping diff --git a/api/api/indices.get_index_template.js b/api/api/indices.get_index_template.js deleted file mode 100644 index 5464faef2..000000000 --- a/api/api/indices.get_index_template.js +++ /dev/null @@ -1,87 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesGetIndexTemplate (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'flat_settings', - 'master_timeout', - 'local', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - flatSettings: 'flat_settings', - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.get_index_template request - * Returns an index template. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html - */ - return function indicesGetIndexTemplate (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((name) != null) { - if (method == null) method = 'GET' - path = '/' + '_index_template' + '/' + encodeURIComponent(name) - } else { - if (method == null) method = 'GET' - path = '/' + '_index_template' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesGetIndexTemplate diff --git a/api/api/indices.get_mapping.js b/api/api/indices.get_mapping.js deleted file mode 100644 index 21e1125ce..000000000 --- a/api/api/indices.get_mapping.js +++ /dev/null @@ -1,99 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesGetMapping (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'include_type_name', - 'ignore_unavailable', - 'allow_no_indices', - 'expand_wildcards', - 'master_timeout', - 'local', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - includeTypeName: 'include_type_name', - ignoreUnavailable: 'ignore_unavailable', - allowNoIndices: 'allow_no_indices', - expandWildcards: 'expand_wildcards', - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.get_mapping request - * Returns mappings for one or more indices. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-mapping.html - */ - return function indicesGetMapping (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, type, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null && (type) != null) { - if (method == null) method = 'GET' - path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + encodeURIComponent(type) - } else if ((index) != null) { - if (method == null) method = 'GET' - path = '/' + encodeURIComponent(index) + '/' + '_mapping' - } else if ((type) != null) { - if (method == null) method = 'GET' - path = '/' + '_mapping' + '/' + encodeURIComponent(type) - } else { - if (method == null) method = 'GET' - path = '/' + '_mapping' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesGetMapping diff --git a/api/api/indices.get_settings.js b/api/api/indices.get_settings.js deleted file mode 100644 index c4e60fef4..000000000 --- a/api/api/indices.get_settings.js +++ /dev/null @@ -1,101 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesGetSettings (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'master_timeout', - 'ignore_unavailable', - 'allow_no_indices', - 'expand_wildcards', - 'flat_settings', - 'local', - 'include_defaults', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - ignoreUnavailable: 'ignore_unavailable', - allowNoIndices: 'allow_no_indices', - expandWildcards: 'expand_wildcards', - flatSettings: 'flat_settings', - includeDefaults: 'include_defaults', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.get_settings request - * Returns settings for one or more indices. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-settings.html - */ - return function indicesGetSettings (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null && (name) != null) { - if (method == null) method = 'GET' - path = '/' + encodeURIComponent(index) + '/' + '_settings' + '/' + encodeURIComponent(name) - } else if ((index) != null) { - if (method == null) method = 'GET' - path = '/' + encodeURIComponent(index) + '/' + '_settings' - } else if ((name) != null) { - if (method == null) method = 'GET' - path = '/' + '_settings' + '/' + encodeURIComponent(name) - } else { - if (method == null) method = 'GET' - path = '/' + '_settings' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesGetSettings diff --git a/api/api/indices.get_template.js b/api/api/indices.get_template.js deleted file mode 100644 index 1586f546e..000000000 --- a/api/api/indices.get_template.js +++ /dev/null @@ -1,89 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesGetTemplate (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'include_type_name', - 'flat_settings', - 'master_timeout', - 'local', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - includeTypeName: 'include_type_name', - flatSettings: 'flat_settings', - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.get_template request - * Returns an index template. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html - */ - return function indicesGetTemplate (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((name) != null) { - if (method == null) method = 'GET' - path = '/' + '_template' + '/' + encodeURIComponent(name) - } else { - if (method == null) method = 'GET' - path = '/' + '_template' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesGetTemplate diff --git a/api/api/indices.get_upgrade.js b/api/api/indices.get_upgrade.js deleted file mode 100644 index b4a028ceb..000000000 --- a/api/api/indices.get_upgrade.js +++ /dev/null @@ -1,88 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesGetUpgrade (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'ignore_unavailable', - 'allow_no_indices', - 'expand_wildcards', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - ignoreUnavailable: 'ignore_unavailable', - allowNoIndices: 'allow_no_indices', - expandWildcards: 'expand_wildcards', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.get_upgrade request - * The _upgrade API is no longer useful and will be removed. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-upgrade.html - */ - return function indicesGetUpgrade (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null) { - if (method == null) method = 'GET' - path = '/' + encodeURIComponent(index) + '/' + '_upgrade' - } else { - if (method == null) method = 'GET' - path = '/' + '_upgrade' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesGetUpgrade diff --git a/api/api/indices.js b/api/api/indices.js index 05ba8d352..54aea4b9b 100644 --- a/api/api/indices.js +++ b/api/api/indices.js @@ -23,8 +23,8 @@ /* eslint no-unused-vars: 0 */ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') -const acceptedQuerystring = ['timeout', 'master_timeout', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'index', 'fielddata', 'fields', 'query', 'request', 'wait_for_active_shards', 'local', 'flat_settings', 'include_defaults', 'force', 'wait_if_ongoing', 'flush', 'max_num_segments', 'only_expunge_deletes', 'create', 'cause', 'write_index_only', 'preserve_existing', 'order', 'detailed', 'active_only', 'dry_run', 'verbose', 'status', 'completion_fields', 'fielddata_fields', 'groups', 'level', 'types', 'include_segment_file_sizes', 'include_unloaded_segments', 'forbid_closed_indices', 'wait_for_completion', 'only_ancient_segments', 'explain', 'q', 'analyzer', 'analyze_wildcard', 'default_operator', 'df', 'lenient', 'rewrite', 'all_shards'] -const snakeCase = { masterTimeout: 'master_timeout', ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices', expandWildcards: 'expand_wildcards', errorTrace: 'error_trace', filterPath: 'filter_path', waitForActiveShards: 'wait_for_active_shards', flatSettings: 'flat_settings', includeDefaults: 'include_defaults', waitIfOngoing: 'wait_if_ongoing', maxNumSegments: 'max_num_segments', onlyExpungeDeletes: 'only_expunge_deletes', writeIndexOnly: 'write_index_only', preserveExisting: 'preserve_existing', activeOnly: 'active_only', dryRun: 'dry_run', completionFields: 'completion_fields', fielddataFields: 'fielddata_fields', includeSegmentFileSizes: 'include_segment_file_sizes', includeUnloadedSegments: 'include_unloaded_segments', forbidClosedIndices: 'forbid_closed_indices', waitForCompletion: 'wait_for_completion', onlyAncientSegments: 'only_ancient_segments', analyzeWildcard: 'analyze_wildcard', defaultOperator: 'default_operator', allShards: 'all_shards' } +const acceptedQuerystring = ['timeout', 'master_timeout', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'index', 'fielddata', 'fields', 'query', 'request', 'wait_for_active_shards', 'include_type_name', 'local', 'flat_settings', 'include_defaults', 'force', 'wait_if_ongoing', 'flush', 'max_num_segments', 'only_expunge_deletes', 'create', 'cause', 'write_index_only', 'preserve_existing', 'order', 'detailed', 'active_only', 'dry_run', 'verbose', 'status', 'copy_settings', 'completion_fields', 'fielddata_fields', 'groups', 'level', 'types', 'include_segment_file_sizes', 'include_unloaded_segments', 'forbid_closed_indices', 'wait_for_completion', 'only_ancient_segments', 'explain', 'q', 'analyzer', 'analyze_wildcard', 'default_operator', 'df', 'lenient', 'rewrite', 'all_shards'] +const snakeCase = { masterTimeout: 'master_timeout', ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices', expandWildcards: 'expand_wildcards', errorTrace: 'error_trace', filterPath: 'filter_path', waitForActiveShards: 'wait_for_active_shards', includeTypeName: 'include_type_name', flatSettings: 'flat_settings', includeDefaults: 'include_defaults', waitIfOngoing: 'wait_if_ongoing', maxNumSegments: 'max_num_segments', onlyExpungeDeletes: 'only_expunge_deletes', writeIndexOnly: 'write_index_only', preserveExisting: 'preserve_existing', activeOnly: 'active_only', dryRun: 'dry_run', copySettings: 'copy_settings', completionFields: 'completion_fields', fielddataFields: 'fielddata_fields', includeSegmentFileSizes: 'include_segment_file_sizes', includeUnloadedSegments: 'include_unloaded_segments', forbidClosedIndices: 'forbid_closed_indices', waitForCompletion: 'wait_for_completion', onlyAncientSegments: 'only_ancient_segments', analyzeWildcard: 'analyze_wildcard', defaultOperator: 'default_operator', allShards: 'all_shards' } function IndicesApi (transport, ConfigurationError) { this.transport = transport @@ -510,6 +510,32 @@ IndicesApi.prototype.flush = function indicesFlushApi (params, options, callback return this.transport.request(request, options, callback) } +IndicesApi.prototype.flushSynced = function indicesFlushSyncedApi (params, options, callback) { + ;[params, options, callback] = normalizeArguments(params, options, callback) + + var { method, body, index, ...querystring } = params + querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) + + var path = '' + if ((index) != null) { + if (method == null) method = body == null ? 'GET' : 'POST' + path = '/' + encodeURIComponent(index) + '/' + '_flush' + '/' + 'synced' + } else { + if (method == null) method = body == null ? 'GET' : 'POST' + path = '/' + '_flush' + '/' + 'synced' + } + + // build request object + const request = { + method, + path, + body: body || '', + querystring + } + + return this.transport.request(request, options, callback) +} + IndicesApi.prototype.forcemerge = function indicesForcemergeApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) @@ -604,13 +630,19 @@ IndicesApi.prototype.getFieldMapping = function indicesGetFieldMappingApi (param return handleError(err, callback) } - var { method, body, fields, index, ...querystring } = params + var { method, body, fields, index, type, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) var path = '' - if ((index) != null && (fields) != null) { + if ((index) != null && (type) != null && (fields) != null) { + if (method == null) method = 'GET' + path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + encodeURIComponent(type) + '/' + 'field' + '/' + encodeURIComponent(fields) + } else if ((index) != null && (fields) != null) { if (method == null) method = 'GET' path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + 'field' + '/' + encodeURIComponent(fields) + } else if ((type) != null && (fields) != null) { + if (method == null) method = 'GET' + path = '/' + '_mapping' + '/' + encodeURIComponent(type) + '/' + 'field' + '/' + encodeURIComponent(fields) } else { if (method == null) method = 'GET' path = '/' + '_mapping' + '/' + 'field' + '/' + encodeURIComponent(fields) @@ -656,13 +688,19 @@ IndicesApi.prototype.getIndexTemplate = function indicesGetIndexTemplateApi (par IndicesApi.prototype.getMapping = function indicesGetMappingApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) - var { method, body, index, ...querystring } = params + var { method, body, index, type, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) var path = '' - if ((index) != null) { + if ((index) != null && (type) != null) { + if (method == null) method = 'GET' + path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + encodeURIComponent(type) + } else if ((index) != null) { if (method == null) method = 'GET' path = '/' + encodeURIComponent(index) + '/' + '_mapping' + } else if ((type) != null) { + if (method == null) method = 'GET' + path = '/' + '_mapping' + '/' + encodeURIComponent(type) } else { if (method == null) method = 'GET' path = '/' + '_mapping' @@ -744,8 +782,13 @@ IndicesApi.prototype.getUpgrade = function indicesGetUpgradeApi (params, options querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) var path = '' - if (method == null) method = 'GET' - path = '/' + encodeURIComponent(index) + '/' + '_upgrade' + if ((index) != null) { + if (method == null) method = 'GET' + path = '/' + encodeURIComponent(index) + '/' + '_upgrade' + } else { + if (method == null) method = 'GET' + path = '/' + '_upgrade' + } // build request object const request = { @@ -862,21 +905,40 @@ IndicesApi.prototype.putMapping = function indicesPutMappingApi (params, options ;[params, options, callback] = normalizeArguments(params, options, callback) // check required parameters - if (params['index'] == null) { - const err = new this[kConfigurationError]('Missing required parameter: index') - return handleError(err, callback) - } if (params['body'] == null) { const err = new this[kConfigurationError]('Missing required parameter: body') return handleError(err, callback) } - var { method, body, index, ...querystring } = params + var { method, body, index, type, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) var path = '' - if (method == null) method = 'PUT' - path = '/' + encodeURIComponent(index) + '/' + '_mapping' + if ((index) != null && (type) != null) { + if (method == null) method = 'PUT' + path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mapping' + } else if ((index) != null && (type) != null) { + if (method == null) method = 'PUT' + path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + encodeURIComponent(type) + } else if ((index) != null && (type) != null) { + if (method == null) method = 'PUT' + path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mappings' + } else if ((index) != null && (type) != null) { + if (method == null) method = 'PUT' + path = '/' + encodeURIComponent(index) + '/' + '_mappings' + '/' + encodeURIComponent(type) + } else if ((index) != null) { + if (method == null) method = 'PUT' + path = '/' + encodeURIComponent(index) + '/' + '_mapping' + } else if ((type) != null) { + if (method == null) method = 'PUT' + path = '/' + '_mappings' + '/' + encodeURIComponent(type) + } else if ((index) != null) { + if (method == null) method = 'PUT' + path = '/' + encodeURIComponent(index) + '/' + '_mappings' + } else { + if (method == null) method = 'PUT' + path = '/' + '_mapping' + '/' + encodeURIComponent(type) + } // build request object const request = { @@ -1314,8 +1376,13 @@ IndicesApi.prototype.upgrade = function indicesUpgradeApi (params, options, call querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) var path = '' - if (method == null) method = 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_upgrade' + if ((index) != null) { + if (method == null) method = 'POST' + path = '/' + encodeURIComponent(index) + '/' + '_upgrade' + } else { + if (method == null) method = 'POST' + path = '/' + '_upgrade' + } // build request object const request = { @@ -1560,6 +1627,7 @@ Object.defineProperties(IndicesApi.prototype, { exists_index_template: { get () { return this.existsIndexTemplate } }, exists_template: { get () { return this.existsTemplate } }, exists_type: { get () { return this.existsType } }, + flush_synced: { get () { return this.flushSynced } }, get_alias: { get () { return this.getAlias } }, get_field_mapping: { get () { return this.getFieldMapping } }, get_index_template: { get () { return this.getIndexTemplate } }, diff --git a/api/api/indices.open.js b/api/api/indices.open.js deleted file mode 100644 index 1fa3455eb..000000000 --- a/api/api/indices.open.js +++ /dev/null @@ -1,94 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesOpen (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'timeout', - 'master_timeout', - 'ignore_unavailable', - 'allow_no_indices', - 'expand_wildcards', - 'wait_for_active_shards', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - ignoreUnavailable: 'ignore_unavailable', - allowNoIndices: 'allow_no_indices', - expandWildcards: 'expand_wildcards', - waitForActiveShards: 'wait_for_active_shards', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.open request - * Opens an index. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html - */ - return function indicesOpen (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_open' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesOpen diff --git a/api/api/indices.put_alias.js b/api/api/indices.put_alias.js deleted file mode 100644 index 4e72de0d6..000000000 --- a/api/api/indices.put_alias.js +++ /dev/null @@ -1,101 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesPutAlias (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'timeout', - 'master_timeout', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.put_alias request - * Creates or updates an alias. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html - */ - return function indicesPutAlias (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - if (params['name'] == null) { - const err = new ConfigurationError('Missing required parameter: name') - return handleError(err, callback) - } - - // check required url components - if (params['name'] != null && (params['index'] == null)) { - const err = new ConfigurationError('Missing required parameter of the url: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null && (name) != null) { - if (method == null) method = 'PUT' - path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name) - } else { - if (method == null) method = 'PUT' - path = '/' + encodeURIComponent(index) + '/' + '_aliases' + '/' + encodeURIComponent(name) - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesPutAlias diff --git a/api/api/indices.put_index_template.js b/api/api/indices.put_index_template.js deleted file mode 100644 index 3d088a83e..000000000 --- a/api/api/indices.put_index_template.js +++ /dev/null @@ -1,91 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesPutIndexTemplate (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'create', - 'cause', - 'master_timeout', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.put_index_template request - * Creates or updates an index template. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html - */ - return function indicesPutIndexTemplate (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['name'] == null) { - const err = new ConfigurationError('Missing required parameter: name') - return handleError(err, callback) - } - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'PUT' - path = '/' + '_index_template' + '/' + encodeURIComponent(name) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesPutIndexTemplate diff --git a/api/api/indices.put_mapping.js b/api/api/indices.put_mapping.js deleted file mode 100644 index 3fdef01e4..000000000 --- a/api/api/indices.put_mapping.js +++ /dev/null @@ -1,119 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesPutMapping (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'include_type_name', - 'timeout', - 'master_timeout', - 'ignore_unavailable', - 'allow_no_indices', - 'expand_wildcards', - 'write_index_only', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - includeTypeName: 'include_type_name', - masterTimeout: 'master_timeout', - ignoreUnavailable: 'ignore_unavailable', - allowNoIndices: 'allow_no_indices', - expandWildcards: 'expand_wildcards', - writeIndexOnly: 'write_index_only', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.put_mapping request - * Updates the index mappings. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-put-mapping.html - */ - return function indicesPutMapping (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, type, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null && (type) != null) { - if (method == null) method = 'PUT' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mapping' - } else if ((index) != null && (type) != null) { - if (method == null) method = 'PUT' - path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + encodeURIComponent(type) - } else if ((index) != null && (type) != null) { - if (method == null) method = 'PUT' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mappings' - } else if ((index) != null && (type) != null) { - if (method == null) method = 'PUT' - path = '/' + encodeURIComponent(index) + '/' + '_mappings' + '/' + encodeURIComponent(type) - } else if ((index) != null) { - if (method == null) method = 'PUT' - path = '/' + encodeURIComponent(index) + '/' + '_mapping' - } else if ((type) != null) { - if (method == null) method = 'PUT' - path = '/' + '_mappings' + '/' + encodeURIComponent(type) - } else if ((index) != null) { - if (method == null) method = 'PUT' - path = '/' + encodeURIComponent(index) + '/' + '_mappings' - } else { - if (method == null) method = 'PUT' - path = '/' + '_mapping' + '/' + encodeURIComponent(type) - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesPutMapping diff --git a/api/api/indices.put_settings.js b/api/api/indices.put_settings.js deleted file mode 100644 index f2f67e2a4..000000000 --- a/api/api/indices.put_settings.js +++ /dev/null @@ -1,101 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesPutSettings (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'master_timeout', - 'timeout', - 'preserve_existing', - 'ignore_unavailable', - 'allow_no_indices', - 'expand_wildcards', - 'flat_settings', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - preserveExisting: 'preserve_existing', - ignoreUnavailable: 'ignore_unavailable', - allowNoIndices: 'allow_no_indices', - expandWildcards: 'expand_wildcards', - flatSettings: 'flat_settings', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.put_settings request - * Updates the index settings. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-update-settings.html - */ - return function indicesPutSettings (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null) { - if (method == null) method = 'PUT' - path = '/' + encodeURIComponent(index) + '/' + '_settings' - } else { - if (method == null) method = 'PUT' - path = '/' + '_settings' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesPutSettings diff --git a/api/api/indices.put_template.js b/api/api/indices.put_template.js deleted file mode 100644 index 848d74056..000000000 --- a/api/api/indices.put_template.js +++ /dev/null @@ -1,93 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesPutTemplate (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'include_type_name', - 'order', - 'create', - 'master_timeout', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - includeTypeName: 'include_type_name', - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.put_template request - * Creates or updates an index template. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html - */ - return function indicesPutTemplate (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['name'] == null) { - const err = new ConfigurationError('Missing required parameter: name') - return handleError(err, callback) - } - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'PUT' - path = '/' + '_template' + '/' + encodeURIComponent(name) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesPutTemplate diff --git a/api/api/indices.recovery.js b/api/api/indices.recovery.js deleted file mode 100644 index e29dc818d..000000000 --- a/api/api/indices.recovery.js +++ /dev/null @@ -1,85 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesRecovery (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'detailed', - 'active_only', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - activeOnly: 'active_only', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.recovery request - * Returns information about ongoing index shard recoveries. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-recovery.html - */ - return function indicesRecovery (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null) { - if (method == null) method = 'GET' - path = '/' + encodeURIComponent(index) + '/' + '_recovery' - } else { - if (method == null) method = 'GET' - path = '/' + '_recovery' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesRecovery diff --git a/api/api/indices.refresh.js b/api/api/indices.refresh.js deleted file mode 100644 index 40a92c754..000000000 --- a/api/api/indices.refresh.js +++ /dev/null @@ -1,88 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesRefresh (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'ignore_unavailable', - 'allow_no_indices', - 'expand_wildcards', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - ignoreUnavailable: 'ignore_unavailable', - allowNoIndices: 'allow_no_indices', - expandWildcards: 'expand_wildcards', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.refresh request - * Performs the refresh operation in one or more indices. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-refresh.html - */ - return function indicesRefresh (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_refresh' - } else { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + '_refresh' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesRefresh diff --git a/api/api/indices.reload_search_analyzers.js b/api/api/indices.reload_search_analyzers.js deleted file mode 100644 index f0284d279..000000000 --- a/api/api/indices.reload_search_analyzers.js +++ /dev/null @@ -1,82 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesReloadSearchAnalyzers (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'ignore_unavailable', - 'allow_no_indices', - 'expand_wildcards' - ] - - const snakeCase = { - ignoreUnavailable: 'ignore_unavailable', - allowNoIndices: 'allow_no_indices', - expandWildcards: 'expand_wildcards' - } - - /** - * Perform a indices.reload_search_analyzers request - * Reloads an index's search analyzers and their resources. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-reload-analyzers.html - */ - return function indicesReloadSearchAnalyzers (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_reload_search_analyzers' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesReloadSearchAnalyzers diff --git a/api/api/indices.resolve_index.js b/api/api/indices.resolve_index.js deleted file mode 100644 index f5bb9f8f5..000000000 --- a/api/api/indices.resolve_index.js +++ /dev/null @@ -1,85 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesResolveIndex (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'expand_wildcards', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - expandWildcards: 'expand_wildcards', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.resolve_index request - * Returns information about any matching indices, aliases, and data streams - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-resolve-index-api.html - */ - return function indicesResolveIndex (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['name'] == null) { - const err = new ConfigurationError('Missing required parameter: name') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + '_resolve' + '/' + 'index' + '/' + encodeURIComponent(name) - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesResolveIndex diff --git a/api/api/indices.rollover.js b/api/api/indices.rollover.js deleted file mode 100644 index 58f26caec..000000000 --- a/api/api/indices.rollover.js +++ /dev/null @@ -1,104 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesRollover (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'include_type_name', - 'timeout', - 'dry_run', - 'master_timeout', - 'wait_for_active_shards', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - includeTypeName: 'include_type_name', - dryRun: 'dry_run', - masterTimeout: 'master_timeout', - waitForActiveShards: 'wait_for_active_shards', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.rollover request - * Updates an alias to point to a new index when the existing index -is considered to be too large or too old. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-rollover-index.html - */ - return function indicesRollover (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['alias'] == null) { - const err = new ConfigurationError('Missing required parameter: alias') - return handleError(err, callback) - } - - // check required url components - if ((params['new_index'] != null || params['newIndex'] != null) && (params['alias'] == null)) { - const err = new ConfigurationError('Missing required parameter of the url: alias') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, alias, newIndex, new_index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((alias) != null && (new_index || newIndex) != null) { - if (method == null) method = 'POST' - path = '/' + encodeURIComponent(alias) + '/' + '_rollover' + '/' + encodeURIComponent(new_index || newIndex) - } else { - if (method == null) method = 'POST' - path = '/' + encodeURIComponent(alias) + '/' + '_rollover' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesRollover diff --git a/api/api/indices.segments.js b/api/api/indices.segments.js deleted file mode 100644 index d02c4b593..000000000 --- a/api/api/indices.segments.js +++ /dev/null @@ -1,89 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesSegments (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'ignore_unavailable', - 'allow_no_indices', - 'expand_wildcards', - 'verbose', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - ignoreUnavailable: 'ignore_unavailable', - allowNoIndices: 'allow_no_indices', - expandWildcards: 'expand_wildcards', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.segments request - * Provides low-level information about segments in a Lucene index. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-segments.html - */ - return function indicesSegments (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null) { - if (method == null) method = 'GET' - path = '/' + encodeURIComponent(index) + '/' + '_segments' - } else { - if (method == null) method = 'GET' - path = '/' + '_segments' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesSegments diff --git a/api/api/indices.shard_stores.js b/api/api/indices.shard_stores.js deleted file mode 100644 index 62e4fc64b..000000000 --- a/api/api/indices.shard_stores.js +++ /dev/null @@ -1,89 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesShardStores (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'status', - 'ignore_unavailable', - 'allow_no_indices', - 'expand_wildcards', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - ignoreUnavailable: 'ignore_unavailable', - allowNoIndices: 'allow_no_indices', - expandWildcards: 'expand_wildcards', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.shard_stores request - * Provides store information for shard copies of indices. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shards-stores.html - */ - return function indicesShardStores (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null) { - if (method == null) method = 'GET' - path = '/' + encodeURIComponent(index) + '/' + '_shard_stores' - } else { - if (method == null) method = 'GET' - path = '/' + '_shard_stores' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesShardStores diff --git a/api/api/indices.shrink.js b/api/api/indices.shrink.js deleted file mode 100644 index 14bacab04..000000000 --- a/api/api/indices.shrink.js +++ /dev/null @@ -1,100 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesShrink (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'copy_settings', - 'timeout', - 'master_timeout', - 'wait_for_active_shards', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - copySettings: 'copy_settings', - masterTimeout: 'master_timeout', - waitForActiveShards: 'wait_for_active_shards', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.shrink request - * Allow to shrink an existing index into a new index with fewer primary shards. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shrink-index.html - */ - return function indicesShrink (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - if (params['target'] == null) { - const err = new ConfigurationError('Missing required parameter: target') - return handleError(err, callback) - } - - // check required url components - if (params['target'] != null && (params['index'] == null)) { - const err = new ConfigurationError('Missing required parameter of the url: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, target, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'PUT' - path = '/' + encodeURIComponent(index) + '/' + '_shrink' + '/' + encodeURIComponent(target) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesShrink diff --git a/api/api/indices.simulate_index_template.js b/api/api/indices.simulate_index_template.js deleted file mode 100644 index 791806076..000000000 --- a/api/api/indices.simulate_index_template.js +++ /dev/null @@ -1,87 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesSimulateIndexTemplate (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'create', - 'cause', - 'master_timeout', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.simulate_index_template request - * Simulate matching the given index name against the index templates in the system - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html - */ - return function indicesSimulateIndexTemplate (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['name'] == null) { - const err = new ConfigurationError('Missing required parameter: name') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_index_template' + '/' + '_simulate_index' + '/' + encodeURIComponent(name) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesSimulateIndexTemplate diff --git a/api/api/indices.simulate_template.js b/api/api/indices.simulate_template.js deleted file mode 100644 index 94c22fd2e..000000000 --- a/api/api/indices.simulate_template.js +++ /dev/null @@ -1,86 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesSimulateTemplate (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'create', - 'cause', - 'master_timeout', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.simulate_template request - * Simulate resolving the given template name or body - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html - */ - return function indicesSimulateTemplate (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((name) != null) { - if (method == null) method = 'POST' - path = '/' + '_index_template' + '/' + '_simulate' + '/' + encodeURIComponent(name) - } else { - if (method == null) method = 'POST' - path = '/' + '_index_template' + '/' + '_simulate' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesSimulateTemplate diff --git a/api/api/indices.split.js b/api/api/indices.split.js deleted file mode 100644 index 7da0053d0..000000000 --- a/api/api/indices.split.js +++ /dev/null @@ -1,100 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesSplit (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'copy_settings', - 'timeout', - 'master_timeout', - 'wait_for_active_shards', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - copySettings: 'copy_settings', - masterTimeout: 'master_timeout', - waitForActiveShards: 'wait_for_active_shards', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.split request - * Allows you to split an existing index into a new index with more primary shards. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-split-index.html - */ - return function indicesSplit (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - if (params['target'] == null) { - const err = new ConfigurationError('Missing required parameter: target') - return handleError(err, callback) - } - - // check required url components - if (params['target'] != null && (params['index'] == null)) { - const err = new ConfigurationError('Missing required parameter of the url: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, target, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'PUT' - path = '/' + encodeURIComponent(index) + '/' + '_split' + '/' + encodeURIComponent(target) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesSplit diff --git a/api/api/indices.stats.js b/api/api/indices.stats.js deleted file mode 100644 index 787ede172..000000000 --- a/api/api/indices.stats.js +++ /dev/null @@ -1,104 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesStats (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'completion_fields', - 'fielddata_fields', - 'fields', - 'groups', - 'level', - 'types', - 'include_segment_file_sizes', - 'include_unloaded_segments', - 'expand_wildcards', - 'forbid_closed_indices', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - completionFields: 'completion_fields', - fielddataFields: 'fielddata_fields', - includeSegmentFileSizes: 'include_segment_file_sizes', - includeUnloadedSegments: 'include_unloaded_segments', - expandWildcards: 'expand_wildcards', - forbidClosedIndices: 'forbid_closed_indices', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.stats request - * Provides statistics on operations happening in an index. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-stats.html - */ - return function indicesStats (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, metric, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null && (metric) != null) { - if (method == null) method = 'GET' - path = '/' + encodeURIComponent(index) + '/' + '_stats' + '/' + encodeURIComponent(metric) - } else if ((metric) != null) { - if (method == null) method = 'GET' - path = '/' + '_stats' + '/' + encodeURIComponent(metric) - } else if ((index) != null) { - if (method == null) method = 'GET' - path = '/' + encodeURIComponent(index) + '/' + '_stats' - } else { - if (method == null) method = 'GET' - path = '/' + '_stats' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesStats diff --git a/api/api/indices.unfreeze.js b/api/api/indices.unfreeze.js deleted file mode 100644 index 00a31a84d..000000000 --- a/api/api/indices.unfreeze.js +++ /dev/null @@ -1,87 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesUnfreeze (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'timeout', - 'master_timeout', - 'ignore_unavailable', - 'allow_no_indices', - 'expand_wildcards', - 'wait_for_active_shards' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - ignoreUnavailable: 'ignore_unavailable', - allowNoIndices: 'allow_no_indices', - expandWildcards: 'expand_wildcards', - waitForActiveShards: 'wait_for_active_shards' - } - - /** - * Perform a indices.unfreeze request - * Unfreezes an index. When a frozen index is unfrozen, the index goes through the normal recovery process and becomes writeable again. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/unfreeze-index-api.html - */ - return function indicesUnfreeze (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_unfreeze' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesUnfreeze diff --git a/api/api/indices.update_aliases.js b/api/api/indices.update_aliases.js deleted file mode 100644 index 4633aaa94..000000000 --- a/api/api/indices.update_aliases.js +++ /dev/null @@ -1,86 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesUpdateAliases (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'timeout', - 'master_timeout', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.update_aliases request - * Updates index aliases. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html - */ - return function indicesUpdateAliases (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_aliases' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesUpdateAliases diff --git a/api/api/indices.upgrade.js b/api/api/indices.upgrade.js deleted file mode 100644 index b11d060a8..000000000 --- a/api/api/indices.upgrade.js +++ /dev/null @@ -1,92 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesUpgrade (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'allow_no_indices', - 'expand_wildcards', - 'ignore_unavailable', - 'wait_for_completion', - 'only_ancient_segments', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - allowNoIndices: 'allow_no_indices', - expandWildcards: 'expand_wildcards', - ignoreUnavailable: 'ignore_unavailable', - waitForCompletion: 'wait_for_completion', - onlyAncientSegments: 'only_ancient_segments', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.upgrade request - * The _upgrade API is no longer useful and will be removed. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-upgrade.html - */ - return function indicesUpgrade (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null) { - if (method == null) method = 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_upgrade' - } else { - if (method == null) method = 'POST' - path = '/' + '_upgrade' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesUpgrade diff --git a/api/api/indices.validate_query.js b/api/api/indices.validate_query.js deleted file mode 100644 index 385685b95..000000000 --- a/api/api/indices.validate_query.js +++ /dev/null @@ -1,109 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIndicesValidateQuery (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'explain', - 'ignore_unavailable', - 'allow_no_indices', - 'expand_wildcards', - 'q', - 'analyzer', - 'analyze_wildcard', - 'default_operator', - 'df', - 'lenient', - 'rewrite', - 'all_shards', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - ignoreUnavailable: 'ignore_unavailable', - allowNoIndices: 'allow_no_indices', - expandWildcards: 'expand_wildcards', - analyzeWildcard: 'analyze_wildcard', - defaultOperator: 'default_operator', - allShards: 'all_shards', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a indices.validate_query request - * Allows a user to validate a potentially expensive query without executing it. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/search-validate.html - */ - return function indicesValidateQuery (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required url components - if (params['type'] != null && (params['index'] == null)) { - const err = new ConfigurationError('Missing required parameter of the url: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, type, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null && (type) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_validate' + '/' + 'query' - } else if ((index) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_validate' + '/' + 'query' - } else { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + '_validate' + '/' + 'query' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIndicesValidateQuery diff --git a/api/api/info.js b/api/api/info.js index bd763230c..518dfaaef 100644 --- a/api/api/info.js +++ b/api/api/info.js @@ -1,6 +1,21 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ 'use strict' diff --git a/api/api/ingest.delete_pipeline.js b/api/api/ingest.delete_pipeline.js deleted file mode 100644 index fffff5a5d..000000000 --- a/api/api/ingest.delete_pipeline.js +++ /dev/null @@ -1,86 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIngestDeletePipeline (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'master_timeout', - 'timeout', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a ingest.delete_pipeline request - * Deletes a pipeline. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-pipeline-api.html - */ - return function ingestDeletePipeline (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['id'] == null) { - const err = new ConfigurationError('Missing required parameter: id') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'DELETE' - path = '/' + '_ingest' + '/' + 'pipeline' + '/' + encodeURIComponent(id) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIngestDeletePipeline diff --git a/api/api/ingest.get_pipeline.js b/api/api/ingest.get_pipeline.js deleted file mode 100644 index 5008d0d9a..000000000 --- a/api/api/ingest.get_pipeline.js +++ /dev/null @@ -1,84 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIngestGetPipeline (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'master_timeout', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a ingest.get_pipeline request - * Returns a pipeline. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/get-pipeline-api.html - */ - return function ingestGetPipeline (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((id) != null) { - if (method == null) method = 'GET' - path = '/' + '_ingest' + '/' + 'pipeline' + '/' + encodeURIComponent(id) - } else { - if (method == null) method = 'GET' - path = '/' + '_ingest' + '/' + 'pipeline' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIngestGetPipeline diff --git a/api/api/ingest.processor_grok.js b/api/api/ingest.processor_grok.js deleted file mode 100644 index 8a1c2c883..000000000 --- a/api/api/ingest.processor_grok.js +++ /dev/null @@ -1,77 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIngestProcessorGrok (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a ingest.processor_grok request - * Returns a list of the built-in patterns. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/grok-processor.html#grok-processor-rest-get - */ - return function ingestProcessorGrok (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + '_ingest' + '/' + 'processor' + '/' + 'grok' - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIngestProcessorGrok diff --git a/api/api/ingest.put_pipeline.js b/api/api/ingest.put_pipeline.js deleted file mode 100644 index f57a932c9..000000000 --- a/api/api/ingest.put_pipeline.js +++ /dev/null @@ -1,90 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIngestPutPipeline (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'master_timeout', - 'timeout', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a ingest.put_pipeline request - * Creates or updates a pipeline. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/put-pipeline-api.html - */ - return function ingestPutPipeline (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['id'] == null) { - const err = new ConfigurationError('Missing required parameter: id') - return handleError(err, callback) - } - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'PUT' - path = '/' + '_ingest' + '/' + 'pipeline' + '/' + encodeURIComponent(id) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIngestPutPipeline diff --git a/api/api/ingest.simulate.js b/api/api/ingest.simulate.js deleted file mode 100644 index 30dac263c..000000000 --- a/api/api/ingest.simulate.js +++ /dev/null @@ -1,89 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildIngestSimulate (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'verbose', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a ingest.simulate request - * Allows to simulate a pipeline with example documents. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/simulate-pipeline-api.html - */ - return function ingestSimulate (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((id) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + '_ingest' + '/' + 'pipeline' + '/' + encodeURIComponent(id) + '/' + '_simulate' - } else { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + '_ingest' + '/' + 'pipeline' + '/' + '_simulate' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildIngestSimulate diff --git a/api/api/license.delete.js b/api/api/license.delete.js deleted file mode 100644 index c099da457..000000000 --- a/api/api/license.delete.js +++ /dev/null @@ -1,72 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildLicenseDelete (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a license.delete request - * Deletes licensing information for the cluster - * https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-license.html - */ - return function licenseDelete (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'DELETE' - path = '/' + '_license' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildLicenseDelete diff --git a/api/api/license.get.js b/api/api/license.get.js deleted file mode 100644 index 75ef90a54..000000000 --- a/api/api/license.get.js +++ /dev/null @@ -1,73 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildLicenseGet (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'local', - 'accept_enterprise' - ] - - const snakeCase = { - acceptEnterprise: 'accept_enterprise' - } - - /** - * Perform a license.get request - * Retrieves licensing information for the cluster - * https://www.elastic.co/guide/en/elasticsearch/reference/master/get-license.html - */ - return function licenseGet (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + '_license' - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildLicenseGet diff --git a/api/api/license.get_basic_status.js b/api/api/license.get_basic_status.js deleted file mode 100644 index 2d8fdde52..000000000 --- a/api/api/license.get_basic_status.js +++ /dev/null @@ -1,72 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildLicenseGetBasicStatus (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a license.get_basic_status request - * Retrieves information about the status of the basic license. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/get-basic-status.html - */ - return function licenseGetBasicStatus (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + '_license' + '/' + 'basic_status' - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildLicenseGetBasicStatus diff --git a/api/api/license.get_trial_status.js b/api/api/license.get_trial_status.js deleted file mode 100644 index e7b16218c..000000000 --- a/api/api/license.get_trial_status.js +++ /dev/null @@ -1,72 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildLicenseGetTrialStatus (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a license.get_trial_status request - * Retrieves information about the status of the trial license. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/get-trial-status.html - */ - return function licenseGetTrialStatus (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + '_license' + '/' + 'trial_status' - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildLicenseGetTrialStatus diff --git a/api/api/license.post.js b/api/api/license.post.js deleted file mode 100644 index d4463f5a8..000000000 --- a/api/api/license.post.js +++ /dev/null @@ -1,72 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildLicensePost (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'acknowledge' - ] - - const snakeCase = { - - } - - /** - * Perform a license.post request - * Updates the license for the cluster. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/update-license.html - */ - return function licensePost (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'PUT' - path = '/' + '_license' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildLicensePost diff --git a/api/api/license.post_start_basic.js b/api/api/license.post_start_basic.js deleted file mode 100644 index 7b9a1dec1..000000000 --- a/api/api/license.post_start_basic.js +++ /dev/null @@ -1,72 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildLicensePostStartBasic (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'acknowledge' - ] - - const snakeCase = { - - } - - /** - * Perform a license.post_start_basic request - * Starts an indefinite basic license. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/start-basic.html - */ - return function licensePostStartBasic (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_license' + '/' + 'start_basic' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildLicensePostStartBasic diff --git a/api/api/license.post_start_trial.js b/api/api/license.post_start_trial.js deleted file mode 100644 index 08e876df2..000000000 --- a/api/api/license.post_start_trial.js +++ /dev/null @@ -1,73 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildLicensePostStartTrial (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'type', - 'acknowledge' - ] - - const snakeCase = { - - } - - /** - * Perform a license.post_start_trial request - * starts a limited time trial license. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/start-trial.html - */ - return function licensePostStartTrial (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_license' + '/' + 'start_trial' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildLicensePostStartTrial diff --git a/api/api/mget.js b/api/api/mget.js index 05d7a9f5d..96846228a 100644 --- a/api/api/mget.js +++ b/api/api/mget.js @@ -1,6 +1,21 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ 'use strict' @@ -11,34 +26,6 @@ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = const acceptedQuerystring = ['stored_fields', 'preference', 'realtime', 'refresh', 'routing', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] const snakeCase = { storedFields: 'stored_fields', _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', errorTrace: 'error_trace', filterPath: 'filter_path' } -<<<<<<< HEAD - const acceptedQuerystring = [ - 'stored_fields', - 'preference', - 'realtime', - 'refresh', - 'routing', - '_source', - '_source_excludes', - '_source_exclude', - '_source_includes', - '_source_include', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - storedFields: 'stored_fields', - _sourceExcludes: '_source_excludes', - _sourceExclude: '_source_exclude', - _sourceIncludes: '_source_includes', - _sourceInclude: '_source_include', - errorTrace: 'error_trace', - filterPath: 'filter_path' -======= function mgetApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) @@ -46,70 +33,28 @@ function mgetApi (params, options, callback) { if (params['body'] == null) { const err = new this[kConfigurationError]('Missing required parameter: body') return handleError(err, callback) ->>>>>>> a064f0f3... Improve child performances (#1314) } - var { method, body, index, ...querystring } = params + // check required url components + if (params['type'] != null && (params['index'] == null)) { + const err = new this[kConfigurationError]('Missing required parameter of the url: index') + return handleError(err, callback) + } + + var { method, body, index, type, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) -<<<<<<< HEAD - // check required parameters - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // check required url components - if (params['type'] != null && (params['index'] == null)) { - const err = new ConfigurationError('Missing required parameter of the url: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, type, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null && (type) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mget' - } else if ((index) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_mget' - } else { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + '_mget' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } -======= var path = '' - if ((index) != null) { + if ((index) != null && (type) != null) { + if (method == null) method = body == null ? 'GET' : 'POST' + path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mget' + } else if ((index) != null) { if (method == null) method = body == null ? 'GET' : 'POST' path = '/' + encodeURIComponent(index) + '/' + '_mget' } else { if (method == null) method = body == null ? 'GET' : 'POST' path = '/' + '_mget' } ->>>>>>> a064f0f3... Improve child performances (#1314) // build request object const request = { diff --git a/api/api/migration.deprecations.js b/api/api/migration.deprecations.js deleted file mode 100644 index 1a0efca36..000000000 --- a/api/api/migration.deprecations.js +++ /dev/null @@ -1,77 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMigrationDeprecations (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a migration.deprecations request - * Retrieves information about different cluster, node, and index level settings that use deprecated features that will be removed or changed in the next major version. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-deprecation.html - */ - return function migrationDeprecations (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null) { - if (method == null) method = 'GET' - path = '/' + encodeURIComponent(index) + '/' + '_migration' + '/' + 'deprecations' - } else { - if (method == null) method = 'GET' - path = '/' + '_migration' + '/' + 'deprecations' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMigrationDeprecations diff --git a/api/api/ml.close_job.js b/api/api/ml.close_job.js deleted file mode 100644 index fb853a188..000000000 --- a/api/api/ml.close_job.js +++ /dev/null @@ -1,81 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlCloseJob (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'allow_no_jobs', - 'force', - 'timeout' - ] - - const snakeCase = { - allowNoJobs: 'allow_no_jobs' - - } - - /** - * Perform a ml.close_job request - * Closes one or more anomaly detection jobs. A job can be opened and closed multiple times throughout its lifecycle. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-close-job.html - */ - return function mlCloseJob (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['job_id'] == null && params['jobId'] == null) { - const err = new ConfigurationError('Missing required parameter: job_id or jobId') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, jobId, job_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_close' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlCloseJob diff --git a/api/api/ml.delete_calendar.js b/api/api/ml.delete_calendar.js deleted file mode 100644 index 7ce88dbac..000000000 --- a/api/api/ml.delete_calendar.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlDeleteCalendar (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a ml.delete_calendar request - * Deletes a calendar. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-calendar.html - */ - return function mlDeleteCalendar (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['calendar_id'] == null && params['calendarId'] == null) { - const err = new ConfigurationError('Missing required parameter: calendar_id or calendarId') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, calendarId, calendar_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'DELETE' - path = '/' + '_ml' + '/' + 'calendars' + '/' + encodeURIComponent(calendar_id || calendarId) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlDeleteCalendar diff --git a/api/api/ml.delete_calendar_event.js b/api/api/ml.delete_calendar_event.js deleted file mode 100644 index 027c8ebaf..000000000 --- a/api/api/ml.delete_calendar_event.js +++ /dev/null @@ -1,88 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlDeleteCalendarEvent (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a ml.delete_calendar_event request - * Deletes scheduled events from a calendar. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-calendar-event.html - */ - return function mlDeleteCalendarEvent (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['calendar_id'] == null && params['calendarId'] == null) { - const err = new ConfigurationError('Missing required parameter: calendar_id or calendarId') - return handleError(err, callback) - } - if (params['event_id'] == null && params['eventId'] == null) { - const err = new ConfigurationError('Missing required parameter: event_id or eventId') - return handleError(err, callback) - } - - // check required url components - if ((params['event_id'] != null || params['eventId'] != null) && ((params['calendar_id'] == null && params['calendarId'] == null))) { - const err = new ConfigurationError('Missing required parameter of the url: calendar_id') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, calendarId, calendar_id, eventId, event_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'DELETE' - path = '/' + '_ml' + '/' + 'calendars' + '/' + encodeURIComponent(calendar_id || calendarId) + '/' + 'events' + '/' + encodeURIComponent(event_id || eventId) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlDeleteCalendarEvent diff --git a/api/api/ml.delete_calendar_job.js b/api/api/ml.delete_calendar_job.js deleted file mode 100644 index cd9cee576..000000000 --- a/api/api/ml.delete_calendar_job.js +++ /dev/null @@ -1,88 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlDeleteCalendarJob (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a ml.delete_calendar_job request - * Deletes anomaly detection jobs from a calendar. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-calendar-job.html - */ - return function mlDeleteCalendarJob (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['calendar_id'] == null && params['calendarId'] == null) { - const err = new ConfigurationError('Missing required parameter: calendar_id or calendarId') - return handleError(err, callback) - } - if (params['job_id'] == null && params['jobId'] == null) { - const err = new ConfigurationError('Missing required parameter: job_id or jobId') - return handleError(err, callback) - } - - // check required url components - if ((params['job_id'] != null || params['jobId'] != null) && ((params['calendar_id'] == null && params['calendarId'] == null))) { - const err = new ConfigurationError('Missing required parameter of the url: calendar_id') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, calendarId, calendar_id, jobId, job_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'DELETE' - path = '/' + '_ml' + '/' + 'calendars' + '/' + encodeURIComponent(calendar_id || calendarId) + '/' + 'jobs' + '/' + encodeURIComponent(job_id || jobId) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlDeleteCalendarJob diff --git a/api/api/ml.delete_data_frame_analytics.js b/api/api/ml.delete_data_frame_analytics.js deleted file mode 100644 index 6b7143b59..000000000 --- a/api/api/ml.delete_data_frame_analytics.js +++ /dev/null @@ -1,79 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlDeleteDataFrameAnalytics (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'force', - 'timeout' - ] - - const snakeCase = { - - } - - /** - * Perform a ml.delete_data_frame_analytics request - * Deletes an existing data frame analytics job. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-dfanalytics.html - */ - return function mlDeleteDataFrameAnalytics (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['id'] == null) { - const err = new ConfigurationError('Missing required parameter: id') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'DELETE' - path = '/' + '_ml' + '/' + 'data_frame' + '/' + 'analytics' + '/' + encodeURIComponent(id) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlDeleteDataFrameAnalytics diff --git a/api/api/ml.delete_datafeed.js b/api/api/ml.delete_datafeed.js deleted file mode 100644 index ecf9a4f92..000000000 --- a/api/api/ml.delete_datafeed.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlDeleteDatafeed (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'force' - ] - - const snakeCase = { - - } - - /** - * Perform a ml.delete_datafeed request - * Deletes an existing datafeed. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-datafeed.html - */ - return function mlDeleteDatafeed (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['datafeed_id'] == null && params['datafeedId'] == null) { - const err = new ConfigurationError('Missing required parameter: datafeed_id or datafeedId') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, datafeedId, datafeed_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'DELETE' - path = '/' + '_ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlDeleteDatafeed diff --git a/api/api/ml.delete_expired_data.js b/api/api/ml.delete_expired_data.js deleted file mode 100644 index 7300fd58d..000000000 --- a/api/api/ml.delete_expired_data.js +++ /dev/null @@ -1,79 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlDeleteExpiredData (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'requests_per_second', - 'timeout' - ] - - const snakeCase = { - requestsPerSecond: 'requests_per_second' - - } - - /** - * Perform a ml.delete_expired_data request - * Deletes expired and unused machine learning data. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-expired-data.html - */ - return function mlDeleteExpiredData (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, jobId, job_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((job_id || jobId) != null) { - if (method == null) method = 'DELETE' - path = '/' + '_ml' + '/' + '_delete_expired_data' + '/' + encodeURIComponent(job_id || jobId) - } else { - if (method == null) method = 'DELETE' - path = '/' + '_ml' + '/' + '_delete_expired_data' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlDeleteExpiredData diff --git a/api/api/ml.delete_filter.js b/api/api/ml.delete_filter.js deleted file mode 100644 index 439346fcd..000000000 --- a/api/api/ml.delete_filter.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlDeleteFilter (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a ml.delete_filter request - * Deletes a filter. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-filter.html - */ - return function mlDeleteFilter (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['filter_id'] == null && params['filterId'] == null) { - const err = new ConfigurationError('Missing required parameter: filter_id or filterId') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, filterId, filter_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'DELETE' - path = '/' + '_ml' + '/' + 'filters' + '/' + encodeURIComponent(filter_id || filterId) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlDeleteFilter diff --git a/api/api/ml.delete_forecast.js b/api/api/ml.delete_forecast.js deleted file mode 100644 index 4f2e7f46f..000000000 --- a/api/api/ml.delete_forecast.js +++ /dev/null @@ -1,91 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlDeleteForecast (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'allow_no_forecasts', - 'timeout' - ] - - const snakeCase = { - allowNoForecasts: 'allow_no_forecasts' - - } - - /** - * Perform a ml.delete_forecast request - * Deletes forecasts from a machine learning job. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-forecast.html - */ - return function mlDeleteForecast (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['job_id'] == null && params['jobId'] == null) { - const err = new ConfigurationError('Missing required parameter: job_id or jobId') - return handleError(err, callback) - } - - // check required url components - if ((params['forecast_id'] != null || params['forecastId'] != null) && ((params['job_id'] == null && params['jobId'] == null))) { - const err = new ConfigurationError('Missing required parameter of the url: job_id') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, jobId, job_id, forecastId, forecast_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((job_id || jobId) != null && (forecast_id || forecastId) != null) { - if (method == null) method = 'DELETE' - path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_forecast' + '/' + encodeURIComponent(forecast_id || forecastId) - } else { - if (method == null) method = 'DELETE' - path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_forecast' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlDeleteForecast diff --git a/api/api/ml.delete_job.js b/api/api/ml.delete_job.js deleted file mode 100644 index 31122255c..000000000 --- a/api/api/ml.delete_job.js +++ /dev/null @@ -1,79 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlDeleteJob (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'force', - 'wait_for_completion' - ] - - const snakeCase = { - waitForCompletion: 'wait_for_completion' - } - - /** - * Perform a ml.delete_job request - * Deletes an existing anomaly detection job. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-job.html - */ - return function mlDeleteJob (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['job_id'] == null && params['jobId'] == null) { - const err = new ConfigurationError('Missing required parameter: job_id or jobId') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, jobId, job_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'DELETE' - path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlDeleteJob diff --git a/api/api/ml.delete_model_snapshot.js b/api/api/ml.delete_model_snapshot.js deleted file mode 100644 index 5768d1d6a..000000000 --- a/api/api/ml.delete_model_snapshot.js +++ /dev/null @@ -1,88 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlDeleteModelSnapshot (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a ml.delete_model_snapshot request - * Deletes an existing model snapshot. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-snapshot.html - */ - return function mlDeleteModelSnapshot (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['job_id'] == null && params['jobId'] == null) { - const err = new ConfigurationError('Missing required parameter: job_id or jobId') - return handleError(err, callback) - } - if (params['snapshot_id'] == null && params['snapshotId'] == null) { - const err = new ConfigurationError('Missing required parameter: snapshot_id or snapshotId') - return handleError(err, callback) - } - - // check required url components - if ((params['snapshot_id'] != null || params['snapshotId'] != null) && ((params['job_id'] == null && params['jobId'] == null))) { - const err = new ConfigurationError('Missing required parameter of the url: job_id') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, jobId, job_id, snapshotId, snapshot_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'DELETE' - path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'model_snapshots' + '/' + encodeURIComponent(snapshot_id || snapshotId) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlDeleteModelSnapshot diff --git a/api/api/ml.delete_trained_model.js b/api/api/ml.delete_trained_model.js deleted file mode 100644 index 0aacc49ba..000000000 --- a/api/api/ml.delete_trained_model.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlDeleteTrainedModel (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a ml.delete_trained_model request - * Deletes an existing trained inference model that is currently not referenced by an ingest pipeline. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-inference.html - */ - return function mlDeleteTrainedModel (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['model_id'] == null && params['modelId'] == null) { - const err = new ConfigurationError('Missing required parameter: model_id or modelId') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, modelId, model_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'DELETE' - path = '/' + '_ml' + '/' + 'inference' + '/' + encodeURIComponent(model_id || modelId) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlDeleteTrainedModel diff --git a/api/api/ml.estimate_model_memory.js b/api/api/ml.estimate_model_memory.js deleted file mode 100644 index 4287cfec6..000000000 --- a/api/api/ml.estimate_model_memory.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlEstimateModelMemory (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a ml.estimate_model_memory request - * Estimates the model memory - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-apis.html - */ - return function mlEstimateModelMemory (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + '_estimate_model_memory' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlEstimateModelMemory diff --git a/api/api/ml.evaluate_data_frame.js b/api/api/ml.evaluate_data_frame.js deleted file mode 100644 index 24ca8e3d2..000000000 --- a/api/api/ml.evaluate_data_frame.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlEvaluateDataFrame (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a ml.evaluate_data_frame request - * Evaluates the data frame analytics for an annotated index. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/evaluate-dfanalytics.html - */ - return function mlEvaluateDataFrame (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_ml' + '/' + 'data_frame' + '/' + '_evaluate' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlEvaluateDataFrame diff --git a/api/api/ml.explain_data_frame_analytics.js b/api/api/ml.explain_data_frame_analytics.js deleted file mode 100644 index dec8dcf79..000000000 --- a/api/api/ml.explain_data_frame_analytics.js +++ /dev/null @@ -1,77 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlExplainDataFrameAnalytics (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a ml.explain_data_frame_analytics request - * Explains a data frame analytics config. - * http://www.elastic.co/guide/en/elasticsearch/reference/current/explain-dfanalytics.html - */ - return function mlExplainDataFrameAnalytics (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((id) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + '_ml' + '/' + 'data_frame' + '/' + 'analytics' + '/' + encodeURIComponent(id) + '/' + '_explain' - } else { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + '_ml' + '/' + 'data_frame' + '/' + 'analytics' + '/' + '_explain' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlExplainDataFrameAnalytics diff --git a/api/api/ml.find_file_structure.js b/api/api/ml.find_file_structure.js deleted file mode 100644 index e8002c15d..000000000 --- a/api/api/ml.find_file_structure.js +++ /dev/null @@ -1,99 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlFindFileStructure (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'lines_to_sample', - 'line_merge_size_limit', - 'timeout', - 'charset', - 'format', - 'has_header_row', - 'column_names', - 'delimiter', - 'quote', - 'should_trim_fields', - 'grok_pattern', - 'timestamp_field', - 'timestamp_format', - 'explain' - ] - - const snakeCase = { - linesToSample: 'lines_to_sample', - lineMergeSizeLimit: 'line_merge_size_limit', - hasHeaderRow: 'has_header_row', - columnNames: 'column_names', - shouldTrimFields: 'should_trim_fields', - grokPattern: 'grok_pattern', - timestampField: 'timestamp_field', - timestampFormat: 'timestamp_format' - - } - - /** - * Perform a ml.find_file_structure request - * Finds the structure of a text file. The text file must contain data that is suitable to be ingested into Elasticsearch. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-find-file-structure.html - */ - return function mlFindFileStructure (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_ml' + '/' + 'find_file_structure' - - // build request object - const request = { - method, - path, - bulkBody: body, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlFindFileStructure diff --git a/api/api/ml.flush_job.js b/api/api/ml.flush_job.js deleted file mode 100644 index 4ca50f6bd..000000000 --- a/api/api/ml.flush_job.js +++ /dev/null @@ -1,84 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlFlushJob (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'calc_interim', - 'start', - 'end', - 'advance_time', - 'skip_time' - ] - - const snakeCase = { - calcInterim: 'calc_interim', - advanceTime: 'advance_time', - skipTime: 'skip_time' - } - - /** - * Perform a ml.flush_job request - * Forces any buffered data to be processed by the job. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-flush-job.html - */ - return function mlFlushJob (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['job_id'] == null && params['jobId'] == null) { - const err = new ConfigurationError('Missing required parameter: job_id or jobId') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, jobId, job_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_flush' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlFlushJob diff --git a/api/api/ml.forecast.js b/api/api/ml.forecast.js deleted file mode 100644 index b1af60455..000000000 --- a/api/api/ml.forecast.js +++ /dev/null @@ -1,81 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlForecast (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'duration', - 'expires_in', - 'max_model_memory' - ] - - const snakeCase = { - expiresIn: 'expires_in', - maxModelMemory: 'max_model_memory' - } - - /** - * Perform a ml.forecast request - * Predicts the future behavior of a time series by using its historical behavior. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-forecast.html - */ - return function mlForecast (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['job_id'] == null && params['jobId'] == null) { - const err = new ConfigurationError('Missing required parameter: job_id or jobId') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, jobId, job_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_forecast' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlForecast diff --git a/api/api/ml.get_buckets.js b/api/api/ml.get_buckets.js deleted file mode 100644 index 3e7585a5f..000000000 --- a/api/api/ml.get_buckets.js +++ /dev/null @@ -1,99 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlGetBuckets (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'expand', - 'exclude_interim', - 'from', - 'size', - 'start', - 'end', - 'anomaly_score', - 'sort', - 'desc' - ] - - const snakeCase = { - excludeInterim: 'exclude_interim', - anomalyScore: 'anomaly_score' - - } - - /** - * Perform a ml.get_buckets request - * Retrieves anomaly detection job results for one or more buckets. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-bucket.html - */ - return function mlGetBuckets (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['job_id'] == null && params['jobId'] == null) { - const err = new ConfigurationError('Missing required parameter: job_id or jobId') - return handleError(err, callback) - } - - // check required url components - if (params['timestamp'] != null && ((params['job_id'] == null && params['jobId'] == null))) { - const err = new ConfigurationError('Missing required parameter of the url: job_id') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, jobId, job_id, timestamp, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((job_id || jobId) != null && (timestamp) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'results' + '/' + 'buckets' + '/' + encodeURIComponent(timestamp) - } else { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'results' + '/' + 'buckets' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlGetBuckets diff --git a/api/api/ml.get_calendar_events.js b/api/api/ml.get_calendar_events.js deleted file mode 100644 index 6bb299b77..000000000 --- a/api/api/ml.get_calendar_events.js +++ /dev/null @@ -1,83 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlGetCalendarEvents (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'job_id', - 'start', - 'end', - 'from', - 'size' - ] - - const snakeCase = { - jobId: 'job_id' - - } - - /** - * Perform a ml.get_calendar_events request - * Retrieves information about the scheduled events in calendars. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-calendar-event.html - */ - return function mlGetCalendarEvents (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['calendar_id'] == null && params['calendarId'] == null) { - const err = new ConfigurationError('Missing required parameter: calendar_id or calendarId') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, calendarId, calendar_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + '_ml' + '/' + 'calendars' + '/' + encodeURIComponent(calendar_id || calendarId) + '/' + 'events' - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlGetCalendarEvents diff --git a/api/api/ml.get_calendars.js b/api/api/ml.get_calendars.js deleted file mode 100644 index 53440e052..000000000 --- a/api/api/ml.get_calendars.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlGetCalendars (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'from', - 'size' - ] - - const snakeCase = { - - } - - /** - * Perform a ml.get_calendars request - * Retrieves configuration information for calendars. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-calendar.html - */ - return function mlGetCalendars (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, calendarId, calendar_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((calendar_id || calendarId) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + '_ml' + '/' + 'calendars' + '/' + encodeURIComponent(calendar_id || calendarId) - } else { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + '_ml' + '/' + 'calendars' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlGetCalendars diff --git a/api/api/ml.get_categories.js b/api/api/ml.get_categories.js deleted file mode 100644 index 465629a73..000000000 --- a/api/api/ml.get_categories.js +++ /dev/null @@ -1,91 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlGetCategories (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'from', - 'size', - 'partition_field_value' - ] - - const snakeCase = { - partitionFieldValue: 'partition_field_value' - } - - /** - * Perform a ml.get_categories request - * Retrieves anomaly detection job results for one or more categories. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-category.html - */ - return function mlGetCategories (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['job_id'] == null && params['jobId'] == null) { - const err = new ConfigurationError('Missing required parameter: job_id or jobId') - return handleError(err, callback) - } - - // check required url components - if ((params['category_id'] != null || params['categoryId'] != null) && ((params['job_id'] == null && params['jobId'] == null))) { - const err = new ConfigurationError('Missing required parameter of the url: job_id') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, jobId, job_id, categoryId, category_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((job_id || jobId) != null && (category_id || categoryId) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'results' + '/' + 'categories' + '/' + encodeURIComponent(category_id || categoryId) - } else { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'results' + '/' + 'categories' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlGetCategories diff --git a/api/api/ml.get_data_frame_analytics.js b/api/api/ml.get_data_frame_analytics.js deleted file mode 100644 index 0d3d99008..000000000 --- a/api/api/ml.get_data_frame_analytics.js +++ /dev/null @@ -1,80 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlGetDataFrameAnalytics (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'allow_no_match', - 'from', - 'size' - ] - - const snakeCase = { - allowNoMatch: 'allow_no_match' - - } - - /** - * Perform a ml.get_data_frame_analytics request - * Retrieves configuration information for data frame analytics jobs. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/get-dfanalytics.html - */ - return function mlGetDataFrameAnalytics (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((id) != null) { - if (method == null) method = 'GET' - path = '/' + '_ml' + '/' + 'data_frame' + '/' + 'analytics' + '/' + encodeURIComponent(id) - } else { - if (method == null) method = 'GET' - path = '/' + '_ml' + '/' + 'data_frame' + '/' + 'analytics' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlGetDataFrameAnalytics diff --git a/api/api/ml.get_data_frame_analytics_stats.js b/api/api/ml.get_data_frame_analytics_stats.js deleted file mode 100644 index 82f4d71d5..000000000 --- a/api/api/ml.get_data_frame_analytics_stats.js +++ /dev/null @@ -1,80 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlGetDataFrameAnalyticsStats (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'allow_no_match', - 'from', - 'size' - ] - - const snakeCase = { - allowNoMatch: 'allow_no_match' - - } - - /** - * Perform a ml.get_data_frame_analytics_stats request - * Retrieves usage information for data frame analytics jobs. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/get-dfanalytics-stats.html - */ - return function mlGetDataFrameAnalyticsStats (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((id) != null) { - if (method == null) method = 'GET' - path = '/' + '_ml' + '/' + 'data_frame' + '/' + 'analytics' + '/' + encodeURIComponent(id) + '/' + '_stats' - } else { - if (method == null) method = 'GET' - path = '/' + '_ml' + '/' + 'data_frame' + '/' + 'analytics' + '/' + '_stats' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlGetDataFrameAnalyticsStats diff --git a/api/api/ml.get_datafeed_stats.js b/api/api/ml.get_datafeed_stats.js deleted file mode 100644 index 9935f16f4..000000000 --- a/api/api/ml.get_datafeed_stats.js +++ /dev/null @@ -1,77 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlGetDatafeedStats (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'allow_no_datafeeds' - ] - - const snakeCase = { - allowNoDatafeeds: 'allow_no_datafeeds' - } - - /** - * Perform a ml.get_datafeed_stats request - * Retrieves usage information for datafeeds. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed-stats.html - */ - return function mlGetDatafeedStats (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, datafeedId, datafeed_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((datafeed_id || datafeedId) != null) { - if (method == null) method = 'GET' - path = '/' + '_ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId) + '/' + '_stats' - } else { - if (method == null) method = 'GET' - path = '/' + '_ml' + '/' + 'datafeeds' + '/' + '_stats' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlGetDatafeedStats diff --git a/api/api/ml.get_datafeeds.js b/api/api/ml.get_datafeeds.js deleted file mode 100644 index 66b0cde5c..000000000 --- a/api/api/ml.get_datafeeds.js +++ /dev/null @@ -1,77 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlGetDatafeeds (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'allow_no_datafeeds' - ] - - const snakeCase = { - allowNoDatafeeds: 'allow_no_datafeeds' - } - - /** - * Perform a ml.get_datafeeds request - * Retrieves configuration information for datafeeds. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed.html - */ - return function mlGetDatafeeds (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, datafeedId, datafeed_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((datafeed_id || datafeedId) != null) { - if (method == null) method = 'GET' - path = '/' + '_ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId) - } else { - if (method == null) method = 'GET' - path = '/' + '_ml' + '/' + 'datafeeds' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlGetDatafeeds diff --git a/api/api/ml.get_filters.js b/api/api/ml.get_filters.js deleted file mode 100644 index 0d5c36973..000000000 --- a/api/api/ml.get_filters.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlGetFilters (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'from', - 'size' - ] - - const snakeCase = { - - } - - /** - * Perform a ml.get_filters request - * Retrieves filters. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-filter.html - */ - return function mlGetFilters (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, filterId, filter_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((filter_id || filterId) != null) { - if (method == null) method = 'GET' - path = '/' + '_ml' + '/' + 'filters' + '/' + encodeURIComponent(filter_id || filterId) - } else { - if (method == null) method = 'GET' - path = '/' + '_ml' + '/' + 'filters' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlGetFilters diff --git a/api/api/ml.get_influencers.js b/api/api/ml.get_influencers.js deleted file mode 100644 index 91d8269bd..000000000 --- a/api/api/ml.get_influencers.js +++ /dev/null @@ -1,87 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlGetInfluencers (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'exclude_interim', - 'from', - 'size', - 'start', - 'end', - 'influencer_score', - 'sort', - 'desc' - ] - - const snakeCase = { - excludeInterim: 'exclude_interim', - influencerScore: 'influencer_score' - - } - - /** - * Perform a ml.get_influencers request - * Retrieves anomaly detection job results for one or more influencers. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-influencer.html - */ - return function mlGetInfluencers (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['job_id'] == null && params['jobId'] == null) { - const err = new ConfigurationError('Missing required parameter: job_id or jobId') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, jobId, job_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'results' + '/' + 'influencers' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlGetInfluencers diff --git a/api/api/ml.get_job_stats.js b/api/api/ml.get_job_stats.js deleted file mode 100644 index 6827cff93..000000000 --- a/api/api/ml.get_job_stats.js +++ /dev/null @@ -1,77 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlGetJobStats (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'allow_no_jobs' - ] - - const snakeCase = { - allowNoJobs: 'allow_no_jobs' - } - - /** - * Perform a ml.get_job_stats request - * Retrieves usage information for anomaly detection jobs. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-stats.html - */ - return function mlGetJobStats (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, jobId, job_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((job_id || jobId) != null) { - if (method == null) method = 'GET' - path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_stats' - } else { - if (method == null) method = 'GET' - path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + '_stats' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlGetJobStats diff --git a/api/api/ml.get_jobs.js b/api/api/ml.get_jobs.js deleted file mode 100644 index 30c78f4e5..000000000 --- a/api/api/ml.get_jobs.js +++ /dev/null @@ -1,77 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlGetJobs (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'allow_no_jobs' - ] - - const snakeCase = { - allowNoJobs: 'allow_no_jobs' - } - - /** - * Perform a ml.get_jobs request - * Retrieves configuration information for anomaly detection jobs. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job.html - */ - return function mlGetJobs (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, jobId, job_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((job_id || jobId) != null) { - if (method == null) method = 'GET' - path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) - } else { - if (method == null) method = 'GET' - path = '/' + '_ml' + '/' + 'anomaly_detectors' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlGetJobs diff --git a/api/api/ml.get_model_snapshots.js b/api/api/ml.get_model_snapshots.js deleted file mode 100644 index 26e1e1574..000000000 --- a/api/api/ml.get_model_snapshots.js +++ /dev/null @@ -1,94 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlGetModelSnapshots (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'from', - 'size', - 'start', - 'end', - 'sort', - 'desc' - ] - - const snakeCase = { - - } - - /** - * Perform a ml.get_model_snapshots request - * Retrieves information about model snapshots. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-snapshot.html - */ - return function mlGetModelSnapshots (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['job_id'] == null && params['jobId'] == null) { - const err = new ConfigurationError('Missing required parameter: job_id or jobId') - return handleError(err, callback) - } - - // check required url components - if ((params['snapshot_id'] != null || params['snapshotId'] != null) && ((params['job_id'] == null && params['jobId'] == null))) { - const err = new ConfigurationError('Missing required parameter of the url: job_id') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, jobId, job_id, snapshotId, snapshot_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((job_id || jobId) != null && (snapshot_id || snapshotId) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'model_snapshots' + '/' + encodeURIComponent(snapshot_id || snapshotId) - } else { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'model_snapshots' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlGetModelSnapshots diff --git a/api/api/ml.get_overall_buckets.js b/api/api/ml.get_overall_buckets.js deleted file mode 100644 index a22f47ddf..000000000 --- a/api/api/ml.get_overall_buckets.js +++ /dev/null @@ -1,88 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlGetOverallBuckets (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'top_n', - 'bucket_span', - 'overall_score', - 'exclude_interim', - 'start', - 'end', - 'allow_no_jobs' - ] - - const snakeCase = { - topN: 'top_n', - bucketSpan: 'bucket_span', - overallScore: 'overall_score', - excludeInterim: 'exclude_interim', - allowNoJobs: 'allow_no_jobs' - } - - /** - * Perform a ml.get_overall_buckets request - * Retrieves overall bucket results that summarize the bucket results of multiple anomaly detection jobs. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-overall-buckets.html - */ - return function mlGetOverallBuckets (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['job_id'] == null && params['jobId'] == null) { - const err = new ConfigurationError('Missing required parameter: job_id or jobId') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, jobId, job_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'results' + '/' + 'overall_buckets' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlGetOverallBuckets diff --git a/api/api/ml.get_records.js b/api/api/ml.get_records.js deleted file mode 100644 index 6f160cb24..000000000 --- a/api/api/ml.get_records.js +++ /dev/null @@ -1,87 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlGetRecords (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'exclude_interim', - 'from', - 'size', - 'start', - 'end', - 'record_score', - 'sort', - 'desc' - ] - - const snakeCase = { - excludeInterim: 'exclude_interim', - recordScore: 'record_score' - - } - - /** - * Perform a ml.get_records request - * Retrieves anomaly records for an anomaly detection job. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-record.html - */ - return function mlGetRecords (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['job_id'] == null && params['jobId'] == null) { - const err = new ConfigurationError('Missing required parameter: job_id or jobId') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, jobId, job_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'results' + '/' + 'records' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlGetRecords diff --git a/api/api/ml.get_trained_models.js b/api/api/ml.get_trained_models.js deleted file mode 100644 index b447802ed..000000000 --- a/api/api/ml.get_trained_models.js +++ /dev/null @@ -1,86 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlGetTrainedModels (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'allow_no_match', - 'include_model_definition', - 'decompress_definition', - 'from', - 'size', - 'tags', - 'for_export' - ] - - const snakeCase = { - allowNoMatch: 'allow_no_match', - includeModelDefinition: 'include_model_definition', - decompressDefinition: 'decompress_definition', - forExport: 'for_export' - } - - /** - * Perform a ml.get_trained_models request - * Retrieves configuration information for a trained inference model. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/get-inference.html - */ - return function mlGetTrainedModels (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, modelId, model_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((model_id || modelId) != null) { - if (method == null) method = 'GET' - path = '/' + '_ml' + '/' + 'inference' + '/' + encodeURIComponent(model_id || modelId) - } else { - if (method == null) method = 'GET' - path = '/' + '_ml' + '/' + 'inference' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlGetTrainedModels diff --git a/api/api/ml.get_trained_models_stats.js b/api/api/ml.get_trained_models_stats.js deleted file mode 100644 index a06558cf9..000000000 --- a/api/api/ml.get_trained_models_stats.js +++ /dev/null @@ -1,80 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlGetTrainedModelsStats (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'allow_no_match', - 'from', - 'size' - ] - - const snakeCase = { - allowNoMatch: 'allow_no_match' - - } - - /** - * Perform a ml.get_trained_models_stats request - * Retrieves usage information for trained inference models. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/get-inference-stats.html - */ - return function mlGetTrainedModelsStats (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, modelId, model_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((model_id || modelId) != null) { - if (method == null) method = 'GET' - path = '/' + '_ml' + '/' + 'inference' + '/' + encodeURIComponent(model_id || modelId) + '/' + '_stats' - } else { - if (method == null) method = 'GET' - path = '/' + '_ml' + '/' + 'inference' + '/' + '_stats' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlGetTrainedModelsStats diff --git a/api/api/ml.info.js b/api/api/ml.info.js deleted file mode 100644 index 67f1c5254..000000000 --- a/api/api/ml.info.js +++ /dev/null @@ -1,72 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlInfo (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a ml.info request - * Returns defaults and limits used by machine learning. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/get-ml-info.html - */ - return function mlInfo (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + '_ml' + '/' + 'info' - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlInfo diff --git a/api/api/ml.js b/api/api/ml.js index 1943cb0a7..9005f24a3 100644 --- a/api/api/ml.js +++ b/api/api/ml.js @@ -23,8 +23,8 @@ /* eslint no-unused-vars: 0 */ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') -const acceptedQuerystring = ['allow_no_match', 'allow_no_jobs', 'force', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'requests_per_second', 'allow_no_forecasts', 'wait_for_completion', 'lines_to_sample', 'line_merge_size_limit', 'charset', 'format', 'has_header_row', 'column_names', 'delimiter', 'quote', 'should_trim_fields', 'grok_pattern', 'timestamp_field', 'timestamp_format', 'explain', 'calc_interim', 'start', 'end', 'advance_time', 'skip_time', 'duration', 'expires_in', 'max_model_memory', 'expand', 'exclude_interim', 'from', 'size', 'anomaly_score', 'sort', 'desc', 'job_id', 'partition_field_value', 'verbose', 'allow_no_datafeeds', 'influencer_score', 'top_n', 'bucket_span', 'overall_score', 'record_score', 'include', 'decompress_definition', 'tags', 'for_export', 'reset_start', 'reset_end', 'ignore_unavailable', 'allow_no_indices', 'ignore_throttled', 'expand_wildcards', 'delete_intervening_results', 'enabled'] -const snakeCase = { allowNoMatch: 'allow_no_match', allowNoJobs: 'allow_no_jobs', errorTrace: 'error_trace', filterPath: 'filter_path', requestsPerSecond: 'requests_per_second', allowNoForecasts: 'allow_no_forecasts', waitForCompletion: 'wait_for_completion', linesToSample: 'lines_to_sample', lineMergeSizeLimit: 'line_merge_size_limit', hasHeaderRow: 'has_header_row', columnNames: 'column_names', shouldTrimFields: 'should_trim_fields', grokPattern: 'grok_pattern', timestampField: 'timestamp_field', timestampFormat: 'timestamp_format', calcInterim: 'calc_interim', advanceTime: 'advance_time', skipTime: 'skip_time', expiresIn: 'expires_in', maxModelMemory: 'max_model_memory', excludeInterim: 'exclude_interim', anomalyScore: 'anomaly_score', jobId: 'job_id', partitionFieldValue: 'partition_field_value', allowNoDatafeeds: 'allow_no_datafeeds', influencerScore: 'influencer_score', topN: 'top_n', bucketSpan: 'bucket_span', overallScore: 'overall_score', recordScore: 'record_score', decompressDefinition: 'decompress_definition', forExport: 'for_export', resetStart: 'reset_start', resetEnd: 'reset_end', ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices', ignoreThrottled: 'ignore_throttled', expandWildcards: 'expand_wildcards', deleteInterveningResults: 'delete_intervening_results' } +const acceptedQuerystring = ['allow_no_jobs', 'force', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'requests_per_second', 'allow_no_forecasts', 'wait_for_completion', 'lines_to_sample', 'line_merge_size_limit', 'charset', 'format', 'has_header_row', 'column_names', 'delimiter', 'quote', 'should_trim_fields', 'grok_pattern', 'timestamp_field', 'timestamp_format', 'explain', 'calc_interim', 'start', 'end', 'advance_time', 'skip_time', 'duration', 'expires_in', 'max_model_memory', 'expand', 'exclude_interim', 'from', 'size', 'anomaly_score', 'sort', 'desc', 'job_id', 'partition_field_value', 'allow_no_match', 'allow_no_datafeeds', 'influencer_score', 'top_n', 'bucket_span', 'overall_score', 'record_score', 'include_model_definition', 'decompress_definition', 'tags', 'for_export', 'reset_start', 'reset_end', 'ignore_unavailable', 'allow_no_indices', 'ignore_throttled', 'expand_wildcards', 'delete_intervening_results', 'enabled'] +const snakeCase = { allowNoJobs: 'allow_no_jobs', errorTrace: 'error_trace', filterPath: 'filter_path', requestsPerSecond: 'requests_per_second', allowNoForecasts: 'allow_no_forecasts', waitForCompletion: 'wait_for_completion', linesToSample: 'lines_to_sample', lineMergeSizeLimit: 'line_merge_size_limit', hasHeaderRow: 'has_header_row', columnNames: 'column_names', shouldTrimFields: 'should_trim_fields', grokPattern: 'grok_pattern', timestampField: 'timestamp_field', timestampFormat: 'timestamp_format', calcInterim: 'calc_interim', advanceTime: 'advance_time', skipTime: 'skip_time', expiresIn: 'expires_in', maxModelMemory: 'max_model_memory', excludeInterim: 'exclude_interim', anomalyScore: 'anomaly_score', jobId: 'job_id', partitionFieldValue: 'partition_field_value', allowNoMatch: 'allow_no_match', allowNoDatafeeds: 'allow_no_datafeeds', influencerScore: 'influencer_score', topN: 'top_n', bucketSpan: 'bucket_span', overallScore: 'overall_score', recordScore: 'record_score', includeModelDefinition: 'include_model_definition', decompressDefinition: 'decompress_definition', forExport: 'for_export', resetStart: 'reset_start', resetEnd: 'reset_end', ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices', ignoreThrottled: 'ignore_throttled', expandWildcards: 'expand_wildcards', deleteInterveningResults: 'delete_intervening_results' } function MlApi (transport, ConfigurationError) { this.transport = transport diff --git a/api/api/ml.open_job.js b/api/api/ml.open_job.js deleted file mode 100644 index fd7199a7e..000000000 --- a/api/api/ml.open_job.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlOpenJob (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a ml.open_job request - * Opens one or more anomaly detection jobs. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-open-job.html - */ - return function mlOpenJob (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['job_id'] == null && params['jobId'] == null) { - const err = new ConfigurationError('Missing required parameter: job_id or jobId') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, jobId, job_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_open' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlOpenJob diff --git a/api/api/ml.post_calendar_events.js b/api/api/ml.post_calendar_events.js deleted file mode 100644 index 1586d6e88..000000000 --- a/api/api/ml.post_calendar_events.js +++ /dev/null @@ -1,82 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlPostCalendarEvents (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a ml.post_calendar_events request - * Posts scheduled events in a calendar. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-calendar-event.html - */ - return function mlPostCalendarEvents (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['calendar_id'] == null && params['calendarId'] == null) { - const err = new ConfigurationError('Missing required parameter: calendar_id or calendarId') - return handleError(err, callback) - } - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, calendarId, calendar_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_ml' + '/' + 'calendars' + '/' + encodeURIComponent(calendar_id || calendarId) + '/' + 'events' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlPostCalendarEvents diff --git a/api/api/ml.post_data.js b/api/api/ml.post_data.js deleted file mode 100644 index ee13a736f..000000000 --- a/api/api/ml.post_data.js +++ /dev/null @@ -1,84 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlPostData (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'reset_start', - 'reset_end' - ] - - const snakeCase = { - resetStart: 'reset_start', - resetEnd: 'reset_end' - } - - /** - * Perform a ml.post_data request - * Sends data to an anomaly detection job for analysis. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-data.html - */ - return function mlPostData (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['job_id'] == null && params['jobId'] == null) { - const err = new ConfigurationError('Missing required parameter: job_id or jobId') - return handleError(err, callback) - } - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, jobId, job_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_data' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlPostData diff --git a/api/api/ml.preview_datafeed.js b/api/api/ml.preview_datafeed.js deleted file mode 100644 index cd9807027..000000000 --- a/api/api/ml.preview_datafeed.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlPreviewDatafeed (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a ml.preview_datafeed request - * Previews a datafeed. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-preview-datafeed.html - */ - return function mlPreviewDatafeed (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['datafeed_id'] == null && params['datafeedId'] == null) { - const err = new ConfigurationError('Missing required parameter: datafeed_id or datafeedId') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, datafeedId, datafeed_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + '_ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId) + '/' + '_preview' - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlPreviewDatafeed diff --git a/api/api/ml.put_calendar.js b/api/api/ml.put_calendar.js deleted file mode 100644 index d81be26fe..000000000 --- a/api/api/ml.put_calendar.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlPutCalendar (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a ml.put_calendar request - * Instantiates a calendar. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-calendar.html - */ - return function mlPutCalendar (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['calendar_id'] == null && params['calendarId'] == null) { - const err = new ConfigurationError('Missing required parameter: calendar_id or calendarId') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, calendarId, calendar_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'PUT' - path = '/' + '_ml' + '/' + 'calendars' + '/' + encodeURIComponent(calendar_id || calendarId) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlPutCalendar diff --git a/api/api/ml.put_calendar_job.js b/api/api/ml.put_calendar_job.js deleted file mode 100644 index b6ff7a902..000000000 --- a/api/api/ml.put_calendar_job.js +++ /dev/null @@ -1,88 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlPutCalendarJob (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a ml.put_calendar_job request - * Adds an anomaly detection job to a calendar. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-calendar-job.html - */ - return function mlPutCalendarJob (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['calendar_id'] == null && params['calendarId'] == null) { - const err = new ConfigurationError('Missing required parameter: calendar_id or calendarId') - return handleError(err, callback) - } - if (params['job_id'] == null && params['jobId'] == null) { - const err = new ConfigurationError('Missing required parameter: job_id or jobId') - return handleError(err, callback) - } - - // check required url components - if ((params['job_id'] != null || params['jobId'] != null) && ((params['calendar_id'] == null && params['calendarId'] == null))) { - const err = new ConfigurationError('Missing required parameter of the url: calendar_id') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, calendarId, calendar_id, jobId, job_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'PUT' - path = '/' + '_ml' + '/' + 'calendars' + '/' + encodeURIComponent(calendar_id || calendarId) + '/' + 'jobs' + '/' + encodeURIComponent(job_id || jobId) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlPutCalendarJob diff --git a/api/api/ml.put_data_frame_analytics.js b/api/api/ml.put_data_frame_analytics.js deleted file mode 100644 index 4e01baa44..000000000 --- a/api/api/ml.put_data_frame_analytics.js +++ /dev/null @@ -1,82 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlPutDataFrameAnalytics (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a ml.put_data_frame_analytics request - * Instantiates a data frame analytics job. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/put-dfanalytics.html - */ - return function mlPutDataFrameAnalytics (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['id'] == null) { - const err = new ConfigurationError('Missing required parameter: id') - return handleError(err, callback) - } - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'PUT' - path = '/' + '_ml' + '/' + 'data_frame' + '/' + 'analytics' + '/' + encodeURIComponent(id) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlPutDataFrameAnalytics diff --git a/api/api/ml.put_datafeed.js b/api/api/ml.put_datafeed.js deleted file mode 100644 index 7f87ea306..000000000 --- a/api/api/ml.put_datafeed.js +++ /dev/null @@ -1,88 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlPutDatafeed (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'ignore_unavailable', - 'allow_no_indices', - 'ignore_throttled', - 'expand_wildcards' - ] - - const snakeCase = { - ignoreUnavailable: 'ignore_unavailable', - allowNoIndices: 'allow_no_indices', - ignoreThrottled: 'ignore_throttled', - expandWildcards: 'expand_wildcards' - } - - /** - * Perform a ml.put_datafeed request - * Instantiates a datafeed. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-datafeed.html - */ - return function mlPutDatafeed (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['datafeed_id'] == null && params['datafeedId'] == null) { - const err = new ConfigurationError('Missing required parameter: datafeed_id or datafeedId') - return handleError(err, callback) - } - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, datafeedId, datafeed_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'PUT' - path = '/' + '_ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlPutDatafeed diff --git a/api/api/ml.put_filter.js b/api/api/ml.put_filter.js deleted file mode 100644 index a82fffd70..000000000 --- a/api/api/ml.put_filter.js +++ /dev/null @@ -1,82 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlPutFilter (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a ml.put_filter request - * Instantiates a filter. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-filter.html - */ - return function mlPutFilter (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['filter_id'] == null && params['filterId'] == null) { - const err = new ConfigurationError('Missing required parameter: filter_id or filterId') - return handleError(err, callback) - } - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, filterId, filter_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'PUT' - path = '/' + '_ml' + '/' + 'filters' + '/' + encodeURIComponent(filter_id || filterId) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlPutFilter diff --git a/api/api/ml.put_job.js b/api/api/ml.put_job.js deleted file mode 100644 index 0ad56a8aa..000000000 --- a/api/api/ml.put_job.js +++ /dev/null @@ -1,82 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlPutJob (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a ml.put_job request - * Instantiates an anomaly detection job. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-job.html - */ - return function mlPutJob (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['job_id'] == null && params['jobId'] == null) { - const err = new ConfigurationError('Missing required parameter: job_id or jobId') - return handleError(err, callback) - } - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, jobId, job_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'PUT' - path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlPutJob diff --git a/api/api/ml.put_trained_model.js b/api/api/ml.put_trained_model.js deleted file mode 100644 index 1d460ae35..000000000 --- a/api/api/ml.put_trained_model.js +++ /dev/null @@ -1,82 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlPutTrainedModel (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a ml.put_trained_model request - * Creates an inference trained model. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/put-inference.html - */ - return function mlPutTrainedModel (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['model_id'] == null && params['modelId'] == null) { - const err = new ConfigurationError('Missing required parameter: model_id or modelId') - return handleError(err, callback) - } - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, modelId, model_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'PUT' - path = '/' + '_ml' + '/' + 'inference' + '/' + encodeURIComponent(model_id || modelId) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlPutTrainedModel diff --git a/api/api/ml.revert_model_snapshot.js b/api/api/ml.revert_model_snapshot.js deleted file mode 100644 index b5ac7a714..000000000 --- a/api/api/ml.revert_model_snapshot.js +++ /dev/null @@ -1,88 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlRevertModelSnapshot (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'delete_intervening_results' - ] - - const snakeCase = { - deleteInterveningResults: 'delete_intervening_results' - } - - /** - * Perform a ml.revert_model_snapshot request - * Reverts to a specific snapshot. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-revert-snapshot.html - */ - return function mlRevertModelSnapshot (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['job_id'] == null && params['jobId'] == null) { - const err = new ConfigurationError('Missing required parameter: job_id or jobId') - return handleError(err, callback) - } - if (params['snapshot_id'] == null && params['snapshotId'] == null) { - const err = new ConfigurationError('Missing required parameter: snapshot_id or snapshotId') - return handleError(err, callback) - } - - // check required url components - if ((params['snapshot_id'] != null || params['snapshotId'] != null) && ((params['job_id'] == null && params['jobId'] == null))) { - const err = new ConfigurationError('Missing required parameter of the url: job_id') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, jobId, job_id, snapshotId, snapshot_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'model_snapshots' + '/' + encodeURIComponent(snapshot_id || snapshotId) + '/' + '_revert' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlRevertModelSnapshot diff --git a/api/api/ml.set_upgrade_mode.js b/api/api/ml.set_upgrade_mode.js deleted file mode 100644 index 6d5a03f06..000000000 --- a/api/api/ml.set_upgrade_mode.js +++ /dev/null @@ -1,73 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlSetUpgradeMode (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'enabled', - 'timeout' - ] - - const snakeCase = { - - } - - /** - * Perform a ml.set_upgrade_mode request - * Sets a cluster wide upgrade_mode setting that prepares machine learning indices for an upgrade. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-set-upgrade-mode.html - */ - return function mlSetUpgradeMode (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_ml' + '/' + 'set_upgrade_mode' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlSetUpgradeMode diff --git a/api/api/ml.start_data_frame_analytics.js b/api/api/ml.start_data_frame_analytics.js deleted file mode 100644 index 7ba5210b3..000000000 --- a/api/api/ml.start_data_frame_analytics.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlStartDataFrameAnalytics (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'timeout' - ] - - const snakeCase = { - - } - - /** - * Perform a ml.start_data_frame_analytics request - * Starts a data frame analytics job. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/start-dfanalytics.html - */ - return function mlStartDataFrameAnalytics (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['id'] == null) { - const err = new ConfigurationError('Missing required parameter: id') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_ml' + '/' + 'data_frame' + '/' + 'analytics' + '/' + encodeURIComponent(id) + '/' + '_start' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlStartDataFrameAnalytics diff --git a/api/api/ml.start_datafeed.js b/api/api/ml.start_datafeed.js deleted file mode 100644 index 45725dfbf..000000000 --- a/api/api/ml.start_datafeed.js +++ /dev/null @@ -1,80 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlStartDatafeed (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'start', - 'end', - 'timeout' - ] - - const snakeCase = { - - } - - /** - * Perform a ml.start_datafeed request - * Starts one or more datafeeds. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-start-datafeed.html - */ - return function mlStartDatafeed (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['datafeed_id'] == null && params['datafeedId'] == null) { - const err = new ConfigurationError('Missing required parameter: datafeed_id or datafeedId') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, datafeedId, datafeed_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId) + '/' + '_start' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlStartDatafeed diff --git a/api/api/ml.stop_data_frame_analytics.js b/api/api/ml.stop_data_frame_analytics.js deleted file mode 100644 index f549389e2..000000000 --- a/api/api/ml.stop_data_frame_analytics.js +++ /dev/null @@ -1,81 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlStopDataFrameAnalytics (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'allow_no_match', - 'force', - 'timeout' - ] - - const snakeCase = { - allowNoMatch: 'allow_no_match' - - } - - /** - * Perform a ml.stop_data_frame_analytics request - * Stops one or more data frame analytics jobs. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-dfanalytics.html - */ - return function mlStopDataFrameAnalytics (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['id'] == null) { - const err = new ConfigurationError('Missing required parameter: id') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_ml' + '/' + 'data_frame' + '/' + 'analytics' + '/' + encodeURIComponent(id) + '/' + '_stop' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlStopDataFrameAnalytics diff --git a/api/api/ml.stop_datafeed.js b/api/api/ml.stop_datafeed.js deleted file mode 100644 index a10f9a926..000000000 --- a/api/api/ml.stop_datafeed.js +++ /dev/null @@ -1,81 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlStopDatafeed (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'allow_no_datafeeds', - 'force', - 'timeout' - ] - - const snakeCase = { - allowNoDatafeeds: 'allow_no_datafeeds' - - } - - /** - * Perform a ml.stop_datafeed request - * Stops one or more datafeeds. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-stop-datafeed.html - */ - return function mlStopDatafeed (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['datafeed_id'] == null && params['datafeedId'] == null) { - const err = new ConfigurationError('Missing required parameter: datafeed_id or datafeedId') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, datafeedId, datafeed_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId) + '/' + '_stop' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlStopDatafeed diff --git a/api/api/ml.update_data_frame_analytics.js b/api/api/ml.update_data_frame_analytics.js deleted file mode 100644 index 1e1d21a12..000000000 --- a/api/api/ml.update_data_frame_analytics.js +++ /dev/null @@ -1,82 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlUpdateDataFrameAnalytics (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a ml.update_data_frame_analytics request - * Updates certain properties of a data frame analytics job. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/update-dfanalytics.html - */ - return function mlUpdateDataFrameAnalytics (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['id'] == null) { - const err = new ConfigurationError('Missing required parameter: id') - return handleError(err, callback) - } - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_ml' + '/' + 'data_frame' + '/' + 'analytics' + '/' + encodeURIComponent(id) + '/' + '_update' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlUpdateDataFrameAnalytics diff --git a/api/api/ml.update_datafeed.js b/api/api/ml.update_datafeed.js deleted file mode 100644 index 253b89cc7..000000000 --- a/api/api/ml.update_datafeed.js +++ /dev/null @@ -1,88 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlUpdateDatafeed (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'ignore_unavailable', - 'allow_no_indices', - 'ignore_throttled', - 'expand_wildcards' - ] - - const snakeCase = { - ignoreUnavailable: 'ignore_unavailable', - allowNoIndices: 'allow_no_indices', - ignoreThrottled: 'ignore_throttled', - expandWildcards: 'expand_wildcards' - } - - /** - * Perform a ml.update_datafeed request - * Updates certain properties of a datafeed. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-datafeed.html - */ - return function mlUpdateDatafeed (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['datafeed_id'] == null && params['datafeedId'] == null) { - const err = new ConfigurationError('Missing required parameter: datafeed_id or datafeedId') - return handleError(err, callback) - } - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, datafeedId, datafeed_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId) + '/' + '_update' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlUpdateDatafeed diff --git a/api/api/ml.update_filter.js b/api/api/ml.update_filter.js deleted file mode 100644 index 38296576e..000000000 --- a/api/api/ml.update_filter.js +++ /dev/null @@ -1,82 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlUpdateFilter (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a ml.update_filter request - * Updates the description of a filter, adds items, or removes items. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-filter.html - */ - return function mlUpdateFilter (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['filter_id'] == null && params['filterId'] == null) { - const err = new ConfigurationError('Missing required parameter: filter_id or filterId') - return handleError(err, callback) - } - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, filterId, filter_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_ml' + '/' + 'filters' + '/' + encodeURIComponent(filter_id || filterId) + '/' + '_update' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlUpdateFilter diff --git a/api/api/ml.update_job.js b/api/api/ml.update_job.js deleted file mode 100644 index 3f2b52e88..000000000 --- a/api/api/ml.update_job.js +++ /dev/null @@ -1,82 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlUpdateJob (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a ml.update_job request - * Updates certain properties of an anomaly detection job. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-job.html - */ - return function mlUpdateJob (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['job_id'] == null && params['jobId'] == null) { - const err = new ConfigurationError('Missing required parameter: job_id or jobId') - return handleError(err, callback) - } - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, jobId, job_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_update' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlUpdateJob diff --git a/api/api/ml.update_model_snapshot.js b/api/api/ml.update_model_snapshot.js deleted file mode 100644 index 5890350a9..000000000 --- a/api/api/ml.update_model_snapshot.js +++ /dev/null @@ -1,92 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlUpdateModelSnapshot (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a ml.update_model_snapshot request - * Updates certain properties of a snapshot. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-snapshot.html - */ - return function mlUpdateModelSnapshot (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['job_id'] == null && params['jobId'] == null) { - const err = new ConfigurationError('Missing required parameter: job_id or jobId') - return handleError(err, callback) - } - if (params['snapshot_id'] == null && params['snapshotId'] == null) { - const err = new ConfigurationError('Missing required parameter: snapshot_id or snapshotId') - return handleError(err, callback) - } - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // check required url components - if ((params['snapshot_id'] != null || params['snapshotId'] != null) && ((params['job_id'] == null && params['jobId'] == null))) { - const err = new ConfigurationError('Missing required parameter of the url: job_id') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, jobId, job_id, snapshotId, snapshot_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'model_snapshots' + '/' + encodeURIComponent(snapshot_id || snapshotId) + '/' + '_update' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlUpdateModelSnapshot diff --git a/api/api/ml.validate.js b/api/api/ml.validate.js deleted file mode 100644 index 6a20fc89b..000000000 --- a/api/api/ml.validate.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlValidate (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a ml.validate request - * Validates an anomaly detection job. - * https://www.elastic.co/guide/en/machine-learning/current/ml-jobs.html - */ - return function mlValidate (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + '_validate' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlValidate diff --git a/api/api/ml.validate_detector.js b/api/api/ml.validate_detector.js deleted file mode 100644 index 38549430e..000000000 --- a/api/api/ml.validate_detector.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMlValidateDetector (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a ml.validate_detector request - * Validates an anomaly detection detector. - * https://www.elastic.co/guide/en/machine-learning/current/ml-jobs.html - */ - return function mlValidateDetector (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + '_validate' + '/' + 'detector' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMlValidateDetector diff --git a/api/api/monitoring.bulk.js b/api/api/monitoring.bulk.js deleted file mode 100644 index 366f72155..000000000 --- a/api/api/monitoring.bulk.js +++ /dev/null @@ -1,87 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildMonitoringBulk (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'system_id', - 'system_api_version', - 'interval' - ] - - const snakeCase = { - systemId: 'system_id', - systemApiVersion: 'system_api_version' - - } - - /** - * Perform a monitoring.bulk request - * Used by the monitoring features to send monitoring data. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/monitor-elasticsearch-cluster.html - */ - return function monitoringBulk (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, type, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((type) != null) { - if (method == null) method = 'POST' - path = '/' + '_monitoring' + '/' + encodeURIComponent(type) + '/' + 'bulk' - } else { - if (method == null) method = 'POST' - path = '/' + '_monitoring' + '/' + 'bulk' - } - - // build request object - const request = { - method, - path, - bulkBody: body, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildMonitoringBulk diff --git a/api/api/msearch.js b/api/api/msearch.js index 0edbdc645..23aeaa617 100644 --- a/api/api/msearch.js +++ b/api/api/msearch.js @@ -1,6 +1,21 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ 'use strict' @@ -20,67 +35,26 @@ function msearchApi (params, options, callback) { return handleError(err, callback) } - var { method, body, index, ...querystring } = params + // check required url components + if (params['type'] != null && (params['index'] == null)) { + const err = new this[kConfigurationError]('Missing required parameter of the url: index') + return handleError(err, callback) + } + + var { method, body, index, type, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) -<<<<<<< HEAD - // check required parameters - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // check required url components - if (params['type'] != null && (params['index'] == null)) { - const err = new ConfigurationError('Missing required parameter of the url: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, type, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null && (type) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_msearch' - } else if ((index) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_msearch' - } else { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + '_msearch' - } - - // build request object - const request = { - method, - path, - bulkBody: body, - querystring - } -======= var path = '' - if ((index) != null) { + if ((index) != null && (type) != null) { + if (method == null) method = body == null ? 'GET' : 'POST' + path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_msearch' + } else if ((index) != null) { if (method == null) method = body == null ? 'GET' : 'POST' path = '/' + encodeURIComponent(index) + '/' + '_msearch' } else { if (method == null) method = body == null ? 'GET' : 'POST' path = '/' + '_msearch' } ->>>>>>> a064f0f3... Improve child performances (#1314) // build request object const request = { diff --git a/api/api/msearch_template.js b/api/api/msearch_template.js index 478aa6d30..2fe9a63bc 100644 --- a/api/api/msearch_template.js +++ b/api/api/msearch_template.js @@ -1,6 +1,21 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ 'use strict' @@ -20,67 +35,26 @@ function msearchTemplateApi (params, options, callback) { return handleError(err, callback) } - var { method, body, index, ...querystring } = params + // check required url components + if (params['type'] != null && (params['index'] == null)) { + const err = new this[kConfigurationError]('Missing required parameter of the url: index') + return handleError(err, callback) + } + + var { method, body, index, type, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) -<<<<<<< HEAD - // check required parameters - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // check required url components - if (params['type'] != null && (params['index'] == null)) { - const err = new ConfigurationError('Missing required parameter of the url: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, type, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null && (type) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_msearch' + '/' + 'template' - } else if ((index) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_msearch' + '/' + 'template' - } else { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + '_msearch' + '/' + 'template' - } - - // build request object - const request = { - method, - path, - bulkBody: body, - querystring - } -======= var path = '' - if ((index) != null) { + if ((index) != null && (type) != null) { + if (method == null) method = body == null ? 'GET' : 'POST' + path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_msearch' + '/' + 'template' + } else if ((index) != null) { if (method == null) method = body == null ? 'GET' : 'POST' path = '/' + encodeURIComponent(index) + '/' + '_msearch' + '/' + 'template' } else { if (method == null) method = body == null ? 'GET' : 'POST' path = '/' + '_msearch' + '/' + 'template' } ->>>>>>> a064f0f3... Improve child performances (#1314) // build request object const request = { diff --git a/api/api/mtermvectors.js b/api/api/mtermvectors.js index e7cc1cbf5..aff633db5 100644 --- a/api/api/mtermvectors.js +++ b/api/api/mtermvectors.js @@ -1,6 +1,21 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ 'use strict' @@ -14,11 +29,20 @@ const snakeCase = { termStatistics: 'term_statistics', fieldStatistics: 'field_s function mtermvectorsApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) - var { method, body, index, ...querystring } = params + // check required url components + if (params['type'] != null && (params['index'] == null)) { + const err = new this[kConfigurationError]('Missing required parameter of the url: index') + return handleError(err, callback) + } + + var { method, body, index, type, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) var path = '' - if ((index) != null) { + if ((index) != null && (type) != null) { + if (method == null) method = body == null ? 'GET' : 'POST' + path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mtermvectors' + } else if ((index) != null) { if (method == null) method = body == null ? 'GET' : 'POST' path = '/' + encodeURIComponent(index) + '/' + '_mtermvectors' } else { @@ -26,76 +50,12 @@ function mtermvectorsApi (params, options, callback) { path = '/' + '_mtermvectors' } -<<<<<<< HEAD - /** - * Perform a mtermvectors request - * Returns multiple termvectors in one request. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-termvectors.html - */ - return function mtermvectors (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required url components - if (params['type'] != null && (params['index'] == null)) { - const err = new ConfigurationError('Missing required parameter of the url: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, type, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null && (type) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mtermvectors' - } else if ((index) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_mtermvectors' - } else { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + '_mtermvectors' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) -======= // build request object const request = { method, path, body: body || '', querystring ->>>>>>> a064f0f3... Improve child performances (#1314) } return this.transport.request(request, options, callback) diff --git a/api/api/nodes.hot_threads.js b/api/api/nodes.hot_threads.js deleted file mode 100644 index 6e2a44d4b..000000000 --- a/api/api/nodes.hot_threads.js +++ /dev/null @@ -1,98 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildNodesHotThreads (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'interval', - 'snapshots', - 'threads', - 'ignore_idle_threads', - 'type', - 'timeout', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - ignoreIdleThreads: 'ignore_idle_threads', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a nodes.hot_threads request - * Returns information about hot threads on each node in the cluster. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-hot-threads.html - */ - return function nodesHotThreads (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, nodeId, node_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((node_id || nodeId) != null) { - if (method == null) method = 'GET' - path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hot_threads' - } else if ((node_id || nodeId) != null) { - if (method == null) method = 'GET' - path = '/' + '_cluster' + '/' + 'nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hotthreads' - } else if ((node_id || nodeId) != null) { - if (method == null) method = 'GET' - path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hotthreads' - } else if ((node_id || nodeId) != null) { - if (method == null) method = 'GET' - path = '/' + '_cluster' + '/' + 'nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hot_threads' - } else { - if (method == null) method = 'GET' - path = '/' + '_nodes' + '/' + 'hot_threads' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildNodesHotThreads diff --git a/api/api/nodes.info.js b/api/api/nodes.info.js deleted file mode 100644 index 372e37c3b..000000000 --- a/api/api/nodes.info.js +++ /dev/null @@ -1,91 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildNodesInfo (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'flat_settings', - 'timeout', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - flatSettings: 'flat_settings', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a nodes.info request - * Returns information about nodes in the cluster. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-info.html - */ - return function nodesInfo (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, nodeId, node_id, metric, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((node_id || nodeId) != null && (metric) != null) { - if (method == null) method = 'GET' - path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + encodeURIComponent(metric) - } else if ((node_id || nodeId) != null) { - if (method == null) method = 'GET' - path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) - } else if ((metric) != null) { - if (method == null) method = 'GET' - path = '/' + '_nodes' + '/' + encodeURIComponent(metric) - } else { - if (method == null) method = 'GET' - path = '/' + '_nodes' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildNodesInfo diff --git a/api/api/nodes.js b/api/api/nodes.js index 4fb496114..aba848bed 100644 --- a/api/api/nodes.js +++ b/api/api/nodes.js @@ -41,6 +41,15 @@ NodesApi.prototype.hotThreads = function nodesHotThreadsApi (params, options, ca if ((node_id || nodeId) != null) { if (method == null) method = 'GET' path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hot_threads' + } else if ((node_id || nodeId) != null) { + if (method == null) method = 'GET' + path = '/' + '_cluster' + '/' + 'nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hotthreads' + } else if ((node_id || nodeId) != null) { + if (method == null) method = 'GET' + path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hotthreads' + } else if ((node_id || nodeId) != null) { + if (method == null) method = 'GET' + path = '/' + '_cluster' + '/' + 'nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hot_threads' } else { if (method == null) method = 'GET' path = '/' + '_nodes' + '/' + 'hot_threads' diff --git a/api/api/nodes.reload_secure_settings.js b/api/api/nodes.reload_secure_settings.js deleted file mode 100644 index dc82ea055..000000000 --- a/api/api/nodes.reload_secure_settings.js +++ /dev/null @@ -1,83 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildNodesReloadSecureSettings (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'timeout', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a nodes.reload_secure_settings request - * Reloads secure settings. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/secure-settings.html#reloadable-secure-settings - */ - return function nodesReloadSecureSettings (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, nodeId, node_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((node_id || nodeId) != null) { - if (method == null) method = 'POST' - path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'reload_secure_settings' - } else { - if (method == null) method = 'POST' - path = '/' + '_nodes' + '/' + 'reload_secure_settings' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildNodesReloadSecureSettings diff --git a/api/api/nodes.stats.js b/api/api/nodes.stats.js deleted file mode 100644 index 5a47a7e21..000000000 --- a/api/api/nodes.stats.js +++ /dev/null @@ -1,105 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildNodesStats (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'completion_fields', - 'fielddata_fields', - 'fields', - 'groups', - 'level', - 'types', - 'timeout', - 'include_segment_file_sizes', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - completionFields: 'completion_fields', - fielddataFields: 'fielddata_fields', - includeSegmentFileSizes: 'include_segment_file_sizes', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a nodes.stats request - * Returns statistical information about nodes in the cluster. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-stats.html - */ - return function nodesStats (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, nodeId, node_id, metric, indexMetric, index_metric, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((node_id || nodeId) != null && (metric) != null && (index_metric || indexMetric) != null) { - if (method == null) method = 'GET' - path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'stats' + '/' + encodeURIComponent(metric) + '/' + encodeURIComponent(index_metric || indexMetric) - } else if ((node_id || nodeId) != null && (metric) != null) { - if (method == null) method = 'GET' - path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'stats' + '/' + encodeURIComponent(metric) - } else if ((metric) != null && (index_metric || indexMetric) != null) { - if (method == null) method = 'GET' - path = '/' + '_nodes' + '/' + 'stats' + '/' + encodeURIComponent(metric) + '/' + encodeURIComponent(index_metric || indexMetric) - } else if ((node_id || nodeId) != null) { - if (method == null) method = 'GET' - path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'stats' - } else if ((metric) != null) { - if (method == null) method = 'GET' - path = '/' + '_nodes' + '/' + 'stats' + '/' + encodeURIComponent(metric) - } else { - if (method == null) method = 'GET' - path = '/' + '_nodes' + '/' + 'stats' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildNodesStats diff --git a/api/api/nodes.usage.js b/api/api/nodes.usage.js deleted file mode 100644 index 0b317b371..000000000 --- a/api/api/nodes.usage.js +++ /dev/null @@ -1,89 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildNodesUsage (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'timeout', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a nodes.usage request - * Returns low-level information about REST actions usage on nodes. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-usage.html - */ - return function nodesUsage (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, nodeId, node_id, metric, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((node_id || nodeId) != null && (metric) != null) { - if (method == null) method = 'GET' - path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'usage' + '/' + encodeURIComponent(metric) - } else if ((node_id || nodeId) != null) { - if (method == null) method = 'GET' - path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'usage' - } else if ((metric) != null) { - if (method == null) method = 'GET' - path = '/' + '_nodes' + '/' + 'usage' + '/' + encodeURIComponent(metric) - } else { - if (method == null) method = 'GET' - path = '/' + '_nodes' + '/' + 'usage' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildNodesUsage diff --git a/api/api/open_point_in_time.js b/api/api/open_point_in_time.js deleted file mode 100644 index b45581834..000000000 --- a/api/api/open_point_in_time.js +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') -const acceptedQuerystring = ['preference', 'routing', 'ignore_unavailable', 'expand_wildcards', 'keep_alive', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] -const snakeCase = { ignoreUnavailable: 'ignore_unavailable', expandWildcards: 'expand_wildcards', keepAlive: 'keep_alive', errorTrace: 'error_trace', filterPath: 'filter_path' } - -function openPointInTimeApi (params, options, callback) { - ;[params, options, callback] = normalizeArguments(params, options, callback) - - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) - - var path = '' - if ((index) != null) { - if (method == null) method = 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_pit' - } else { - if (method == null) method = 'POST' - path = '/' + '_pit' - } - -<<<<<<< HEAD - /** - * Perform a open_point_in_time request - * Open a point in time that can be used in subsequent searches - * https://www.elastic.co/guide/en/elasticsearch/reference/master/point-in-time.html - */ - return function openPointInTime (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null) { - if (method == null) method = 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_pit' - } else { - if (method == null) method = 'POST' - path = '/' + '_pit' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) -======= - // build request object - const request = { - method, - path, - body: body || '', - querystring ->>>>>>> a064f0f3... Improve child performances (#1314) - } - - return this.transport.request(request, options, callback) -} - -module.exports = openPointInTimeApi diff --git a/api/api/ping.js b/api/api/ping.js index a919cc39a..54906b201 100644 --- a/api/api/ping.js +++ b/api/api/ping.js @@ -1,6 +1,21 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ 'use strict' diff --git a/api/api/put_script.js b/api/api/put_script.js index e3d83d8a4..cf039eaae 100644 --- a/api/api/put_script.js +++ b/api/api/put_script.js @@ -1,6 +1,21 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ 'use strict' diff --git a/api/api/rank_eval.js b/api/api/rank_eval.js index bd38540c8..13dd35188 100644 --- a/api/api/rank_eval.js +++ b/api/api/rank_eval.js @@ -1,6 +1,21 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ 'use strict' diff --git a/api/api/reindex.js b/api/api/reindex.js index 66403b4f0..251bef8ad 100644 --- a/api/api/reindex.js +++ b/api/api/reindex.js @@ -1,6 +1,21 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ 'use strict' diff --git a/api/api/reindex_rethrottle.js b/api/api/reindex_rethrottle.js index 496602d17..afcf87295 100644 --- a/api/api/reindex_rethrottle.js +++ b/api/api/reindex_rethrottle.js @@ -1,6 +1,21 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ 'use strict' diff --git a/api/api/render_search_template.js b/api/api/render_search_template.js index f3ffce673..c5455701c 100644 --- a/api/api/render_search_template.js +++ b/api/api/render_search_template.js @@ -1,6 +1,21 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ 'use strict' diff --git a/api/api/rollup.delete_job.js b/api/api/rollup.delete_job.js deleted file mode 100644 index befeedff0..000000000 --- a/api/api/rollup.delete_job.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildRollupDeleteJob (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a rollup.delete_job request - * Deletes an existing rollup job. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-delete-job.html - */ - return function rollupDeleteJob (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['id'] == null) { - const err = new ConfigurationError('Missing required parameter: id') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'DELETE' - path = '/' + '_rollup' + '/' + 'job' + '/' + encodeURIComponent(id) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildRollupDeleteJob diff --git a/api/api/rollup.get_jobs.js b/api/api/rollup.get_jobs.js deleted file mode 100644 index 57414ab06..000000000 --- a/api/api/rollup.get_jobs.js +++ /dev/null @@ -1,77 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildRollupGetJobs (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a rollup.get_jobs request - * Retrieves the configuration, stats, and status of rollup jobs. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-get-job.html - */ - return function rollupGetJobs (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((id) != null) { - if (method == null) method = 'GET' - path = '/' + '_rollup' + '/' + 'job' + '/' + encodeURIComponent(id) - } else { - if (method == null) method = 'GET' - path = '/' + '_rollup' + '/' + 'job' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildRollupGetJobs diff --git a/api/api/rollup.get_rollup_caps.js b/api/api/rollup.get_rollup_caps.js deleted file mode 100644 index fd5a5fded..000000000 --- a/api/api/rollup.get_rollup_caps.js +++ /dev/null @@ -1,77 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildRollupGetRollupCaps (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a rollup.get_rollup_caps request - * Returns the capabilities of any rollup jobs that have been configured for a specific index or index pattern. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-get-rollup-caps.html - */ - return function rollupGetRollupCaps (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((id) != null) { - if (method == null) method = 'GET' - path = '/' + '_rollup' + '/' + 'data' + '/' + encodeURIComponent(id) - } else { - if (method == null) method = 'GET' - path = '/' + '_rollup' + '/' + 'data' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildRollupGetRollupCaps diff --git a/api/api/rollup.get_rollup_index_caps.js b/api/api/rollup.get_rollup_index_caps.js deleted file mode 100644 index 2f127cfc3..000000000 --- a/api/api/rollup.get_rollup_index_caps.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildRollupGetRollupIndexCaps (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a rollup.get_rollup_index_caps request - * Returns the rollup capabilities of all jobs inside of a rollup index (e.g. the index where rollup data is stored). - * https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-get-rollup-index-caps.html - */ - return function rollupGetRollupIndexCaps (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + encodeURIComponent(index) + '/' + '_rollup' + '/' + 'data' - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildRollupGetRollupIndexCaps diff --git a/api/api/rollup.put_job.js b/api/api/rollup.put_job.js deleted file mode 100644 index ef68909fb..000000000 --- a/api/api/rollup.put_job.js +++ /dev/null @@ -1,82 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildRollupPutJob (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a rollup.put_job request - * Creates a rollup job. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-put-job.html - */ - return function rollupPutJob (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['id'] == null) { - const err = new ConfigurationError('Missing required parameter: id') - return handleError(err, callback) - } - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'PUT' - path = '/' + '_rollup' + '/' + 'job' + '/' + encodeURIComponent(id) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildRollupPutJob diff --git a/api/api/rollup.rollup_search.js b/api/api/rollup.rollup_search.js deleted file mode 100644 index 4bd756434..000000000 --- a/api/api/rollup.rollup_search.js +++ /dev/null @@ -1,95 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildRollupRollupSearch (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'typed_keys', - 'rest_total_hits_as_int' - ] - - const snakeCase = { - typedKeys: 'typed_keys', - restTotalHitsAsInt: 'rest_total_hits_as_int' - } - - /** - * Perform a rollup.rollup_search request - * Enables searching rolled-up data using the standard query DSL. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-search.html - */ - return function rollupRollupSearch (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // check required url components - if (params['type'] != null && (params['index'] == null)) { - const err = new ConfigurationError('Missing required parameter of the url: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, type, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null && (type) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_rollup_search' - } else { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_rollup_search' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildRollupRollupSearch diff --git a/api/api/rollup.start_job.js b/api/api/rollup.start_job.js deleted file mode 100644 index 5fad665ba..000000000 --- a/api/api/rollup.start_job.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildRollupStartJob (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a rollup.start_job request - * Starts an existing, stopped rollup job. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-start-job.html - */ - return function rollupStartJob (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['id'] == null) { - const err = new ConfigurationError('Missing required parameter: id') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_rollup' + '/' + 'job' + '/' + encodeURIComponent(id) + '/' + '_start' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildRollupStartJob diff --git a/api/api/rollup.stop_job.js b/api/api/rollup.stop_job.js deleted file mode 100644 index 727058e2b..000000000 --- a/api/api/rollup.stop_job.js +++ /dev/null @@ -1,80 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildRollupStopJob (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'wait_for_completion', - 'timeout' - ] - - const snakeCase = { - waitForCompletion: 'wait_for_completion' - - } - - /** - * Perform a rollup.stop_job request - * Stops an existing, started rollup job. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/rollup-stop-job.html - */ - return function rollupStopJob (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['id'] == null) { - const err = new ConfigurationError('Missing required parameter: id') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_rollup' + '/' + 'job' + '/' + encodeURIComponent(id) + '/' + '_stop' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildRollupStopJob diff --git a/api/api/scripts_painless_execute.js b/api/api/scripts_painless_execute.js index 64fb67234..b08c6d14a 100644 --- a/api/api/scripts_painless_execute.js +++ b/api/api/scripts_painless_execute.js @@ -1,6 +1,21 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ 'use strict' diff --git a/api/api/scroll.js b/api/api/scroll.js index 148857e25..7ec1f059f 100644 --- a/api/api/scroll.js +++ b/api/api/scroll.js @@ -1,6 +1,21 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ 'use strict' diff --git a/api/api/search.js b/api/api/search.js index 75d8d1c30..0e5c6029f 100644 --- a/api/api/search.js +++ b/api/api/search.js @@ -1,165 +1,27 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ 'use strict' /* eslint camelcase: 0 */ /* eslint no-unused-vars: 0 */ -<<<<<<< HEAD -function buildSearch (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'analyzer', - 'analyze_wildcard', - 'ccs_minimize_roundtrips', - 'default_operator', - 'df', - 'explain', - 'stored_fields', - 'docvalue_fields', - 'from', - 'ignore_unavailable', - 'ignore_throttled', - 'allow_no_indices', - 'expand_wildcards', - 'lenient', - 'preference', - 'q', - 'routing', - 'scroll', - 'search_type', - 'size', - 'sort', - '_source', - '_source_excludes', - '_source_exclude', - '_source_includes', - '_source_include', - 'terminate_after', - 'stats', - 'suggest_field', - 'suggest_mode', - 'suggest_size', - 'suggest_text', - 'timeout', - 'track_scores', - 'track_total_hits', - 'allow_partial_search_results', - 'typed_keys', - 'version', - 'seq_no_primary_term', - 'request_cache', - 'batched_reduce_size', - 'max_concurrent_shard_requests', - 'pre_filter_shard_size', - 'rest_total_hits_as_int', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - analyzeWildcard: 'analyze_wildcard', - ccsMinimizeRoundtrips: 'ccs_minimize_roundtrips', - defaultOperator: 'default_operator', - storedFields: 'stored_fields', - docvalueFields: 'docvalue_fields', - ignoreUnavailable: 'ignore_unavailable', - ignoreThrottled: 'ignore_throttled', - allowNoIndices: 'allow_no_indices', - expandWildcards: 'expand_wildcards', - searchType: 'search_type', - _sourceExcludes: '_source_excludes', - _sourceExclude: '_source_exclude', - _sourceIncludes: '_source_includes', - _sourceInclude: '_source_include', - terminateAfter: 'terminate_after', - suggestField: 'suggest_field', - suggestMode: 'suggest_mode', - suggestSize: 'suggest_size', - suggestText: 'suggest_text', - trackScores: 'track_scores', - trackTotalHits: 'track_total_hits', - allowPartialSearchResults: 'allow_partial_search_results', - typedKeys: 'typed_keys', - seqNoPrimaryTerm: 'seq_no_primary_term', - requestCache: 'request_cache', - batchedReduceSize: 'batched_reduce_size', - maxConcurrentShardRequests: 'max_concurrent_shard_requests', - preFilterShardSize: 'pre_filter_shard_size', - restTotalHitsAsInt: 'rest_total_hits_as_int', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a search request - * Returns results matching a query. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/search-search.html - */ - return function search (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required url components - if (params['type'] != null && (params['index'] == null)) { - const err = new ConfigurationError('Missing required parameter of the url: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, type, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null && (type) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_search' - } else if ((index) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_search' - } else { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + '_search' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) -======= const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') const acceptedQuerystring = ['analyzer', 'analyze_wildcard', 'ccs_minimize_roundtrips', 'default_operator', 'df', 'explain', 'stored_fields', 'docvalue_fields', 'from', 'ignore_unavailable', 'ignore_throttled', 'allow_no_indices', 'expand_wildcards', 'lenient', 'preference', 'q', 'routing', 'scroll', 'search_type', 'size', 'sort', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'terminate_after', 'stats', 'suggest_field', 'suggest_mode', 'suggest_size', 'suggest_text', 'timeout', 'track_scores', 'track_total_hits', 'allow_partial_search_results', 'typed_keys', 'version', 'seq_no_primary_term', 'request_cache', 'batched_reduce_size', 'max_concurrent_shard_requests', 'pre_filter_shard_size', 'rest_total_hits_as_int', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] const snakeCase = { analyzeWildcard: 'analyze_wildcard', ccsMinimizeRoundtrips: 'ccs_minimize_roundtrips', defaultOperator: 'default_operator', storedFields: 'stored_fields', docvalueFields: 'docvalue_fields', ignoreUnavailable: 'ignore_unavailable', ignoreThrottled: 'ignore_throttled', allowNoIndices: 'allow_no_indices', expandWildcards: 'expand_wildcards', searchType: 'search_type', _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', terminateAfter: 'terminate_after', suggestField: 'suggest_field', suggestMode: 'suggest_mode', suggestSize: 'suggest_size', suggestText: 'suggest_text', trackScores: 'track_scores', trackTotalHits: 'track_total_hits', allowPartialSearchResults: 'allow_partial_search_results', typedKeys: 'typed_keys', seqNoPrimaryTerm: 'seq_no_primary_term', requestCache: 'request_cache', batchedReduceSize: 'batched_reduce_size', maxConcurrentShardRequests: 'max_concurrent_shard_requests', preFilterShardSize: 'pre_filter_shard_size', restTotalHitsAsInt: 'rest_total_hits_as_int', errorTrace: 'error_trace', filterPath: 'filter_path' } @@ -167,11 +29,20 @@ const snakeCase = { analyzeWildcard: 'analyze_wildcard', ccsMinimizeRoundtrips: function searchApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) - var { method, body, index, ...querystring } = params + // check required url components + if (params['type'] != null && (params['index'] == null)) { + const err = new this[kConfigurationError]('Missing required parameter of the url: index') + return handleError(err, callback) + } + + var { method, body, index, type, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) var path = '' - if ((index) != null) { + if ((index) != null && (type) != null) { + if (method == null) method = body == null ? 'GET' : 'POST' + path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_search' + } else if ((index) != null) { if (method == null) method = body == null ? 'GET' : 'POST' path = '/' + encodeURIComponent(index) + '/' + '_search' } else { @@ -185,7 +56,6 @@ function searchApi (params, options, callback) { path, body: body || '', querystring ->>>>>>> a064f0f3... Improve child performances (#1314) } return this.transport.request(request, options, callback) diff --git a/api/api/search_shards.js b/api/api/search_shards.js index 11f34be63..7059004db 100644 --- a/api/api/search_shards.js +++ b/api/api/search_shards.js @@ -1,6 +1,21 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ 'use strict' diff --git a/api/api/search_template.js b/api/api/search_template.js index 4fd14f8df..a875c2712 100644 --- a/api/api/search_template.js +++ b/api/api/search_template.js @@ -1,6 +1,21 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ 'use strict' @@ -20,67 +35,26 @@ function searchTemplateApi (params, options, callback) { return handleError(err, callback) } - var { method, body, index, ...querystring } = params + // check required url components + if (params['type'] != null && (params['index'] == null)) { + const err = new this[kConfigurationError]('Missing required parameter of the url: index') + return handleError(err, callback) + } + + var { method, body, index, type, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) -<<<<<<< HEAD - // check required parameters - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // check required url components - if (params['type'] != null && (params['index'] == null)) { - const err = new ConfigurationError('Missing required parameter of the url: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, type, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null && (type) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_search' + '/' + 'template' - } else if ((index) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_search' + '/' + 'template' - } else { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + '_search' + '/' + 'template' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } -======= var path = '' - if ((index) != null) { + if ((index) != null && (type) != null) { + if (method == null) method = body == null ? 'GET' : 'POST' + path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_search' + '/' + 'template' + } else if ((index) != null) { if (method == null) method = body == null ? 'GET' : 'POST' path = '/' + encodeURIComponent(index) + '/' + '_search' + '/' + 'template' } else { if (method == null) method = body == null ? 'GET' : 'POST' path = '/' + '_search' + '/' + 'template' } ->>>>>>> a064f0f3... Improve child performances (#1314) // build request object const request = { diff --git a/api/api/searchable_snapshots.clear_cache.js b/api/api/searchable_snapshots.clear_cache.js deleted file mode 100644 index a581278fe..000000000 --- a/api/api/searchable_snapshots.clear_cache.js +++ /dev/null @@ -1,83 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSearchableSnapshotsClearCache (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'ignore_unavailable', - 'allow_no_indices', - 'expand_wildcards', - 'index' - ] - - const snakeCase = { - ignoreUnavailable: 'ignore_unavailable', - allowNoIndices: 'allow_no_indices', - expandWildcards: 'expand_wildcards' - - } - - /** - * Perform a searchable_snapshots.clear_cache request - * Clear the cache of searchable snapshots. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/searchable-snapshots-api-clear-cache.html - */ - return function searchableSnapshotsClearCache (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null) { - if (method == null) method = 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_searchable_snapshots' + '/' + 'cache' + '/' + 'clear' - } else { - if (method == null) method = 'POST' - path = '/' + '_searchable_snapshots' + '/' + 'cache' + '/' + 'clear' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSearchableSnapshotsClearCache diff --git a/api/api/searchable_snapshots.mount.js b/api/api/searchable_snapshots.mount.js deleted file mode 100644 index 4724017aa..000000000 --- a/api/api/searchable_snapshots.mount.js +++ /dev/null @@ -1,94 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSearchableSnapshotsMount (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'master_timeout', - 'wait_for_completion' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - waitForCompletion: 'wait_for_completion' - } - - /** - * Perform a searchable_snapshots.mount request - * Mount a snapshot as a searchable index. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/searchable-snapshots-api-mount-snapshot.html - */ - return function searchableSnapshotsMount (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['repository'] == null) { - const err = new ConfigurationError('Missing required parameter: repository') - return handleError(err, callback) - } - if (params['snapshot'] == null) { - const err = new ConfigurationError('Missing required parameter: snapshot') - return handleError(err, callback) - } - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // check required url components - if (params['snapshot'] != null && (params['repository'] == null)) { - const err = new ConfigurationError('Missing required parameter of the url: repository') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, repository, snapshot, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + encodeURIComponent(snapshot) + '/' + '_mount' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSearchableSnapshotsMount diff --git a/api/api/searchable_snapshots.repository_stats.js b/api/api/searchable_snapshots.repository_stats.js deleted file mode 100644 index 3042a6e4c..000000000 --- a/api/api/searchable_snapshots.repository_stats.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSearchableSnapshotsRepositoryStats (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a searchable_snapshots.repository_stats request - * Retrieve usage statistics about a snapshot repository. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/searchable-snapshots-repository-stats.html - */ - return function searchableSnapshotsRepositoryStats (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['repository'] == null) { - const err = new ConfigurationError('Missing required parameter: repository') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, repository, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + '_stats' - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSearchableSnapshotsRepositoryStats diff --git a/api/api/searchable_snapshots.stats.js b/api/api/searchable_snapshots.stats.js deleted file mode 100644 index 341d315d3..000000000 --- a/api/api/searchable_snapshots.stats.js +++ /dev/null @@ -1,77 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSearchableSnapshotsStats (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a searchable_snapshots.stats request - * Retrieve various statistics about searchable snapshots. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/searchable-snapshots-api-stats.html - */ - return function searchableSnapshotsStats (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null) { - if (method == null) method = 'GET' - path = '/' + encodeURIComponent(index) + '/' + '_searchable_snapshots' + '/' + 'stats' - } else { - if (method == null) method = 'GET' - path = '/' + '_searchable_snapshots' + '/' + 'stats' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSearchableSnapshotsStats diff --git a/api/api/security.authenticate.js b/api/api/security.authenticate.js deleted file mode 100644 index bd156f41f..000000000 --- a/api/api/security.authenticate.js +++ /dev/null @@ -1,72 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSecurityAuthenticate (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a security.authenticate request - * Enables authentication as a user and retrieve information about the authenticated user. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-authenticate.html - */ - return function securityAuthenticate (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + '_security' + '/' + '_authenticate' - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSecurityAuthenticate diff --git a/api/api/security.change_password.js b/api/api/security.change_password.js deleted file mode 100644 index b71816c75..000000000 --- a/api/api/security.change_password.js +++ /dev/null @@ -1,83 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSecurityChangePassword (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'refresh' - ] - - const snakeCase = { - - } - - /** - * Perform a security.change_password request - * Changes the passwords of users in the native realm and built-in users. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-change-password.html - */ - return function securityChangePassword (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, username, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((username) != null) { - if (method == null) method = 'PUT' - path = '/' + '_security' + '/' + 'user' + '/' + encodeURIComponent(username) + '/' + '_password' - } else { - if (method == null) method = 'PUT' - path = '/' + '_security' + '/' + 'user' + '/' + '_password' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSecurityChangePassword diff --git a/api/api/security.clear_cached_privileges.js b/api/api/security.clear_cached_privileges.js deleted file mode 100644 index 35899d76b..000000000 --- a/api/api/security.clear_cached_privileges.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSecurityClearCachedPrivileges (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a security.clear_cached_privileges request - * Evicts application privileges from the native application privileges cache. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-privilege-cache.html - */ - return function securityClearCachedPrivileges (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['application'] == null) { - const err = new ConfigurationError('Missing required parameter: application') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, application, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_security' + '/' + 'privilege' + '/' + encodeURIComponent(application) + '/' + '_clear_cache' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSecurityClearCachedPrivileges diff --git a/api/api/security.clear_cached_realms.js b/api/api/security.clear_cached_realms.js deleted file mode 100644 index d06e2aa24..000000000 --- a/api/api/security.clear_cached_realms.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSecurityClearCachedRealms (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'usernames' - ] - - const snakeCase = { - - } - - /** - * Perform a security.clear_cached_realms request - * Evicts users from the user cache. Can completely clear the cache or evict specific users. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-cache.html - */ - return function securityClearCachedRealms (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['realms'] == null) { - const err = new ConfigurationError('Missing required parameter: realms') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, realms, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_security' + '/' + 'realm' + '/' + encodeURIComponent(realms) + '/' + '_clear_cache' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSecurityClearCachedRealms diff --git a/api/api/security.clear_cached_roles.js b/api/api/security.clear_cached_roles.js deleted file mode 100644 index fb6497298..000000000 --- a/api/api/security.clear_cached_roles.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSecurityClearCachedRoles (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a security.clear_cached_roles request - * Evicts roles from the native role cache. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-role-cache.html - */ - return function securityClearCachedRoles (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['name'] == null) { - const err = new ConfigurationError('Missing required parameter: name') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_security' + '/' + 'role' + '/' + encodeURIComponent(name) + '/' + '_clear_cache' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSecurityClearCachedRoles diff --git a/api/api/security.create_api_key.js b/api/api/security.create_api_key.js deleted file mode 100644 index d0ec816da..000000000 --- a/api/api/security.create_api_key.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSecurityCreateApiKey (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'refresh' - ] - - const snakeCase = { - - } - - /** - * Perform a security.create_api_key request - * Creates an API key for access without requiring basic authentication. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html - */ - return function securityCreateApiKey (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'PUT' - path = '/' + '_security' + '/' + 'api_key' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSecurityCreateApiKey diff --git a/api/api/security.delete_privileges.js b/api/api/security.delete_privileges.js deleted file mode 100644 index 89031c2b1..000000000 --- a/api/api/security.delete_privileges.js +++ /dev/null @@ -1,88 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSecurityDeletePrivileges (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'refresh' - ] - - const snakeCase = { - - } - - /** - * Perform a security.delete_privileges request - * Removes application privileges. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-privilege.html - */ - return function securityDeletePrivileges (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['application'] == null) { - const err = new ConfigurationError('Missing required parameter: application') - return handleError(err, callback) - } - if (params['name'] == null) { - const err = new ConfigurationError('Missing required parameter: name') - return handleError(err, callback) - } - - // check required url components - if (params['name'] != null && (params['application'] == null)) { - const err = new ConfigurationError('Missing required parameter of the url: application') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, application, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'DELETE' - path = '/' + '_security' + '/' + 'privilege' + '/' + encodeURIComponent(application) + '/' + encodeURIComponent(name) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSecurityDeletePrivileges diff --git a/api/api/security.delete_role.js b/api/api/security.delete_role.js deleted file mode 100644 index 4dd113a6a..000000000 --- a/api/api/security.delete_role.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSecurityDeleteRole (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'refresh' - ] - - const snakeCase = { - - } - - /** - * Perform a security.delete_role request - * Removes roles in the native realm. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role.html - */ - return function securityDeleteRole (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['name'] == null) { - const err = new ConfigurationError('Missing required parameter: name') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'DELETE' - path = '/' + '_security' + '/' + 'role' + '/' + encodeURIComponent(name) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSecurityDeleteRole diff --git a/api/api/security.delete_role_mapping.js b/api/api/security.delete_role_mapping.js deleted file mode 100644 index 5edde79d3..000000000 --- a/api/api/security.delete_role_mapping.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSecurityDeleteRoleMapping (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'refresh' - ] - - const snakeCase = { - - } - - /** - * Perform a security.delete_role_mapping request - * Removes role mappings. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role-mapping.html - */ - return function securityDeleteRoleMapping (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['name'] == null) { - const err = new ConfigurationError('Missing required parameter: name') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'DELETE' - path = '/' + '_security' + '/' + 'role_mapping' + '/' + encodeURIComponent(name) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSecurityDeleteRoleMapping diff --git a/api/api/security.delete_user.js b/api/api/security.delete_user.js deleted file mode 100644 index 007da3e8c..000000000 --- a/api/api/security.delete_user.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSecurityDeleteUser (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'refresh' - ] - - const snakeCase = { - - } - - /** - * Perform a security.delete_user request - * Deletes users from the native realm. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-user.html - */ - return function securityDeleteUser (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['username'] == null) { - const err = new ConfigurationError('Missing required parameter: username') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, username, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'DELETE' - path = '/' + '_security' + '/' + 'user' + '/' + encodeURIComponent(username) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSecurityDeleteUser diff --git a/api/api/security.disable_user.js b/api/api/security.disable_user.js deleted file mode 100644 index b89afc916..000000000 --- a/api/api/security.disable_user.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSecurityDisableUser (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'refresh' - ] - - const snakeCase = { - - } - - /** - * Perform a security.disable_user request - * Disables users in the native realm. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-disable-user.html - */ - return function securityDisableUser (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['username'] == null) { - const err = new ConfigurationError('Missing required parameter: username') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, username, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'PUT' - path = '/' + '_security' + '/' + 'user' + '/' + encodeURIComponent(username) + '/' + '_disable' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSecurityDisableUser diff --git a/api/api/security.enable_user.js b/api/api/security.enable_user.js deleted file mode 100644 index 367590123..000000000 --- a/api/api/security.enable_user.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSecurityEnableUser (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'refresh' - ] - - const snakeCase = { - - } - - /** - * Perform a security.enable_user request - * Enables users in the native realm. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-enable-user.html - */ - return function securityEnableUser (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['username'] == null) { - const err = new ConfigurationError('Missing required parameter: username') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, username, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'PUT' - path = '/' + '_security' + '/' + 'user' + '/' + encodeURIComponent(username) + '/' + '_enable' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSecurityEnableUser diff --git a/api/api/security.get_api_key.js b/api/api/security.get_api_key.js deleted file mode 100644 index 7492f84e5..000000000 --- a/api/api/security.get_api_key.js +++ /dev/null @@ -1,77 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSecurityGetApiKey (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'id', - 'name', - 'username', - 'realm_name', - 'owner' - ] - - const snakeCase = { - realmName: 'realm_name' - - } - - /** - * Perform a security.get_api_key request - * Retrieves information for one or more API keys. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-api-key.html - */ - return function securityGetApiKey (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + '_security' + '/' + 'api_key' - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSecurityGetApiKey diff --git a/api/api/security.get_builtin_privileges.js b/api/api/security.get_builtin_privileges.js deleted file mode 100644 index 15581bf4f..000000000 --- a/api/api/security.get_builtin_privileges.js +++ /dev/null @@ -1,72 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSecurityGetBuiltinPrivileges (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a security.get_builtin_privileges request - * Retrieves the list of cluster privileges and index privileges that are available in this version of Elasticsearch. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-builtin-privileges.html - */ - return function securityGetBuiltinPrivileges (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + '_security' + '/' + 'privilege' + '/' + '_builtin' - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSecurityGetBuiltinPrivileges diff --git a/api/api/security.get_privileges.js b/api/api/security.get_privileges.js deleted file mode 100644 index 15a5a3a72..000000000 --- a/api/api/security.get_privileges.js +++ /dev/null @@ -1,86 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSecurityGetPrivileges (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a security.get_privileges request - * Retrieves application privileges. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-privileges.html - */ - return function securityGetPrivileges (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required url components - if (params['name'] != null && (params['application'] == null)) { - const err = new ConfigurationError('Missing required parameter of the url: application') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, application, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((application) != null && (name) != null) { - if (method == null) method = 'GET' - path = '/' + '_security' + '/' + 'privilege' + '/' + encodeURIComponent(application) + '/' + encodeURIComponent(name) - } else if ((application) != null) { - if (method == null) method = 'GET' - path = '/' + '_security' + '/' + 'privilege' + '/' + encodeURIComponent(application) - } else { - if (method == null) method = 'GET' - path = '/' + '_security' + '/' + 'privilege' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSecurityGetPrivileges diff --git a/api/api/security.get_role.js b/api/api/security.get_role.js deleted file mode 100644 index e660c5b8a..000000000 --- a/api/api/security.get_role.js +++ /dev/null @@ -1,77 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSecurityGetRole (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a security.get_role request - * Retrieves roles in the native realm. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role.html - */ - return function securityGetRole (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((name) != null) { - if (method == null) method = 'GET' - path = '/' + '_security' + '/' + 'role' + '/' + encodeURIComponent(name) - } else { - if (method == null) method = 'GET' - path = '/' + '_security' + '/' + 'role' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSecurityGetRole diff --git a/api/api/security.get_role_mapping.js b/api/api/security.get_role_mapping.js deleted file mode 100644 index 0a1768512..000000000 --- a/api/api/security.get_role_mapping.js +++ /dev/null @@ -1,77 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSecurityGetRoleMapping (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a security.get_role_mapping request - * Retrieves role mappings. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role-mapping.html - */ - return function securityGetRoleMapping (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((name) != null) { - if (method == null) method = 'GET' - path = '/' + '_security' + '/' + 'role_mapping' + '/' + encodeURIComponent(name) - } else { - if (method == null) method = 'GET' - path = '/' + '_security' + '/' + 'role_mapping' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSecurityGetRoleMapping diff --git a/api/api/security.get_token.js b/api/api/security.get_token.js deleted file mode 100644 index 066c9e6d0..000000000 --- a/api/api/security.get_token.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSecurityGetToken (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a security.get_token request - * Creates a bearer token for access without requiring basic authentication. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-token.html - */ - return function securityGetToken (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_security' + '/' + 'oauth2' + '/' + 'token' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSecurityGetToken diff --git a/api/api/security.get_user.js b/api/api/security.get_user.js deleted file mode 100644 index 40383949b..000000000 --- a/api/api/security.get_user.js +++ /dev/null @@ -1,77 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSecurityGetUser (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a security.get_user request - * Retrieves information about users in the native realm and built-in users. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user.html - */ - return function securityGetUser (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, username, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((username) != null) { - if (method == null) method = 'GET' - path = '/' + '_security' + '/' + 'user' + '/' + encodeURIComponent(username) - } else { - if (method == null) method = 'GET' - path = '/' + '_security' + '/' + 'user' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSecurityGetUser diff --git a/api/api/security.get_user_privileges.js b/api/api/security.get_user_privileges.js deleted file mode 100644 index 3ef3a9dc3..000000000 --- a/api/api/security.get_user_privileges.js +++ /dev/null @@ -1,72 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSecurityGetUserPrivileges (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a security.get_user_privileges request - * Retrieves application privileges. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-privileges.html - */ - return function securityGetUserPrivileges (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + '_security' + '/' + 'user' + '/' + '_privileges' - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSecurityGetUserPrivileges diff --git a/api/api/security.has_privileges.js b/api/api/security.has_privileges.js deleted file mode 100644 index dc0f1d1d1..000000000 --- a/api/api/security.has_privileges.js +++ /dev/null @@ -1,83 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSecurityHasPrivileges (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a security.has_privileges request - * Determines whether the specified user has a specified list of privileges. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges.html - */ - return function securityHasPrivileges (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, user, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((user) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + '_security' + '/' + 'user' + '/' + encodeURIComponent(user) + '/' + '_has_privileges' - } else { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + '_security' + '/' + 'user' + '/' + '_has_privileges' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSecurityHasPrivileges diff --git a/api/api/security.invalidate_api_key.js b/api/api/security.invalidate_api_key.js deleted file mode 100644 index 470704850..000000000 --- a/api/api/security.invalidate_api_key.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSecurityInvalidateApiKey (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a security.invalidate_api_key request - * Invalidates one or more API keys. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-api-key.html - */ - return function securityInvalidateApiKey (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'DELETE' - path = '/' + '_security' + '/' + 'api_key' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSecurityInvalidateApiKey diff --git a/api/api/security.invalidate_token.js b/api/api/security.invalidate_token.js deleted file mode 100644 index dc1bcf6ba..000000000 --- a/api/api/security.invalidate_token.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSecurityInvalidateToken (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a security.invalidate_token request - * Invalidates one or more access tokens or refresh tokens. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-token.html - */ - return function securityInvalidateToken (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'DELETE' - path = '/' + '_security' + '/' + 'oauth2' + '/' + 'token' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSecurityInvalidateToken diff --git a/api/api/security.put_privileges.js b/api/api/security.put_privileges.js deleted file mode 100644 index 83df2139c..000000000 --- a/api/api/security.put_privileges.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSecurityPutPrivileges (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'refresh' - ] - - const snakeCase = { - - } - - /** - * Perform a security.put_privileges request - * Adds or updates application privileges. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-privileges.html - */ - return function securityPutPrivileges (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'PUT' - path = '/' + '_security' + '/' + 'privilege' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSecurityPutPrivileges diff --git a/api/api/security.put_role.js b/api/api/security.put_role.js deleted file mode 100644 index 3de853456..000000000 --- a/api/api/security.put_role.js +++ /dev/null @@ -1,82 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSecurityPutRole (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'refresh' - ] - - const snakeCase = { - - } - - /** - * Perform a security.put_role request - * Adds and updates roles in the native realm. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role.html - */ - return function securityPutRole (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['name'] == null) { - const err = new ConfigurationError('Missing required parameter: name') - return handleError(err, callback) - } - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'PUT' - path = '/' + '_security' + '/' + 'role' + '/' + encodeURIComponent(name) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSecurityPutRole diff --git a/api/api/security.put_role_mapping.js b/api/api/security.put_role_mapping.js deleted file mode 100644 index e35a70657..000000000 --- a/api/api/security.put_role_mapping.js +++ /dev/null @@ -1,82 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSecurityPutRoleMapping (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'refresh' - ] - - const snakeCase = { - - } - - /** - * Perform a security.put_role_mapping request - * Creates and updates role mappings. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role-mapping.html - */ - return function securityPutRoleMapping (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['name'] == null) { - const err = new ConfigurationError('Missing required parameter: name') - return handleError(err, callback) - } - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'PUT' - path = '/' + '_security' + '/' + 'role_mapping' + '/' + encodeURIComponent(name) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSecurityPutRoleMapping diff --git a/api/api/security.put_user.js b/api/api/security.put_user.js deleted file mode 100644 index 398816fa9..000000000 --- a/api/api/security.put_user.js +++ /dev/null @@ -1,82 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSecurityPutUser (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'refresh' - ] - - const snakeCase = { - - } - - /** - * Perform a security.put_user request - * Adds and updates users in the native realm. These users are commonly referred to as native users. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-user.html - */ - return function securityPutUser (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['username'] == null) { - const err = new ConfigurationError('Missing required parameter: username') - return handleError(err, callback) - } - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, username, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'PUT' - path = '/' + '_security' + '/' + 'user' + '/' + encodeURIComponent(username) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSecurityPutUser diff --git a/api/api/slm.delete_lifecycle.js b/api/api/slm.delete_lifecycle.js deleted file mode 100644 index 6730ea66e..000000000 --- a/api/api/slm.delete_lifecycle.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSlmDeleteLifecycle (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a slm.delete_lifecycle request - * Deletes an existing snapshot lifecycle policy. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-delete-policy.html - */ - return function slmDeleteLifecycle (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['policy_id'] == null && params['policyId'] == null) { - const err = new ConfigurationError('Missing required parameter: policy_id or policyId') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, policyId, policy_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'DELETE' - path = '/' + '_slm' + '/' + 'policy' + '/' + encodeURIComponent(policy_id || policyId) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSlmDeleteLifecycle diff --git a/api/api/slm.execute_lifecycle.js b/api/api/slm.execute_lifecycle.js deleted file mode 100644 index 669e9470e..000000000 --- a/api/api/slm.execute_lifecycle.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSlmExecuteLifecycle (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a slm.execute_lifecycle request - * Immediately creates a snapshot according to the lifecycle policy, without waiting for the scheduled time. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-execute-lifecycle.html - */ - return function slmExecuteLifecycle (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['policy_id'] == null && params['policyId'] == null) { - const err = new ConfigurationError('Missing required parameter: policy_id or policyId') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, policyId, policy_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'PUT' - path = '/' + '_slm' + '/' + 'policy' + '/' + encodeURIComponent(policy_id || policyId) + '/' + '_execute' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSlmExecuteLifecycle diff --git a/api/api/slm.execute_retention.js b/api/api/slm.execute_retention.js deleted file mode 100644 index c8d8db99e..000000000 --- a/api/api/slm.execute_retention.js +++ /dev/null @@ -1,72 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSlmExecuteRetention (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a slm.execute_retention request - * Deletes any snapshots that are expired according to the policy's retention rules. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-execute-retention.html - */ - return function slmExecuteRetention (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_slm' + '/' + '_execute_retention' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSlmExecuteRetention diff --git a/api/api/slm.get_lifecycle.js b/api/api/slm.get_lifecycle.js deleted file mode 100644 index 22be108f6..000000000 --- a/api/api/slm.get_lifecycle.js +++ /dev/null @@ -1,77 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSlmGetLifecycle (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a slm.get_lifecycle request - * Retrieves one or more snapshot lifecycle policy definitions and information about the latest snapshot attempts. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-get-policy.html - */ - return function slmGetLifecycle (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, policyId, policy_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((policy_id || policyId) != null) { - if (method == null) method = 'GET' - path = '/' + '_slm' + '/' + 'policy' + '/' + encodeURIComponent(policy_id || policyId) - } else { - if (method == null) method = 'GET' - path = '/' + '_slm' + '/' + 'policy' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSlmGetLifecycle diff --git a/api/api/slm.get_stats.js b/api/api/slm.get_stats.js deleted file mode 100644 index 9937bf94f..000000000 --- a/api/api/slm.get_stats.js +++ /dev/null @@ -1,72 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSlmGetStats (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a slm.get_stats request - * Returns global and policy-level statistics about actions taken by snapshot lifecycle management. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/slm-api-get-stats.html - */ - return function slmGetStats (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + '_slm' + '/' + 'stats' - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSlmGetStats diff --git a/api/api/slm.get_status.js b/api/api/slm.get_status.js deleted file mode 100644 index 64a66cb88..000000000 --- a/api/api/slm.get_status.js +++ /dev/null @@ -1,72 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSlmGetStatus (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a slm.get_status request - * Retrieves the status of snapshot lifecycle management (SLM). - * https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-get-status.html - */ - return function slmGetStatus (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + '_slm' + '/' + 'status' - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSlmGetStatus diff --git a/api/api/slm.put_lifecycle.js b/api/api/slm.put_lifecycle.js deleted file mode 100644 index 47d4e6de3..000000000 --- a/api/api/slm.put_lifecycle.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSlmPutLifecycle (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a slm.put_lifecycle request - * Creates or updates a snapshot lifecycle policy. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-put-policy.html - */ - return function slmPutLifecycle (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['policy_id'] == null && params['policyId'] == null) { - const err = new ConfigurationError('Missing required parameter: policy_id or policyId') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, policyId, policy_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'PUT' - path = '/' + '_slm' + '/' + 'policy' + '/' + encodeURIComponent(policy_id || policyId) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSlmPutLifecycle diff --git a/api/api/slm.start.js b/api/api/slm.start.js deleted file mode 100644 index 137d0c1c9..000000000 --- a/api/api/slm.start.js +++ /dev/null @@ -1,72 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSlmStart (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a slm.start request - * Turns on snapshot lifecycle management (SLM). - * https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-start.html - */ - return function slmStart (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_slm' + '/' + 'start' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSlmStart diff --git a/api/api/slm.stop.js b/api/api/slm.stop.js deleted file mode 100644 index 32ccb37a0..000000000 --- a/api/api/slm.stop.js +++ /dev/null @@ -1,72 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSlmStop (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a slm.stop request - * Turns off snapshot lifecycle management (SLM). - * https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-stop.html - */ - return function slmStop (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_slm' + '/' + 'stop' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSlmStop diff --git a/api/api/snapshot.cleanup_repository.js b/api/api/snapshot.cleanup_repository.js deleted file mode 100644 index 7fc13cdd8..000000000 --- a/api/api/snapshot.cleanup_repository.js +++ /dev/null @@ -1,86 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSnapshotCleanupRepository (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'master_timeout', - 'timeout', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a snapshot.cleanup_repository request - * Removes stale data from repository. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/clean-up-snapshot-repo-api.html - */ - return function snapshotCleanupRepository (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['repository'] == null) { - const err = new ConfigurationError('Missing required parameter: repository') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, repository, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + '_cleanup' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSnapshotCleanupRepository diff --git a/api/api/snapshot.create.js b/api/api/snapshot.create.js deleted file mode 100644 index 4c0d83631..000000000 --- a/api/api/snapshot.create.js +++ /dev/null @@ -1,97 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSnapshotCreate (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'master_timeout', - 'wait_for_completion', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - waitForCompletion: 'wait_for_completion', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a snapshot.create request - * Creates a snapshot in a repository. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html - */ - return function snapshotCreate (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['repository'] == null) { - const err = new ConfigurationError('Missing required parameter: repository') - return handleError(err, callback) - } - if (params['snapshot'] == null) { - const err = new ConfigurationError('Missing required parameter: snapshot') - return handleError(err, callback) - } - - // check required url components - if (params['snapshot'] != null && (params['repository'] == null)) { - const err = new ConfigurationError('Missing required parameter of the url: repository') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, repository, snapshot, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'PUT' - path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + encodeURIComponent(snapshot) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSnapshotCreate diff --git a/api/api/snapshot.create_repository.js b/api/api/snapshot.create_repository.js deleted file mode 100644 index b34dbbe8d..000000000 --- a/api/api/snapshot.create_repository.js +++ /dev/null @@ -1,91 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSnapshotCreateRepository (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'master_timeout', - 'timeout', - 'verify', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a snapshot.create_repository request - * Creates a repository. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html - */ - return function snapshotCreateRepository (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['repository'] == null) { - const err = new ConfigurationError('Missing required parameter: repository') - return handleError(err, callback) - } - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, repository, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'PUT' - path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSnapshotCreateRepository diff --git a/api/api/snapshot.delete.js b/api/api/snapshot.delete.js deleted file mode 100644 index d0139ee67..000000000 --- a/api/api/snapshot.delete.js +++ /dev/null @@ -1,95 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSnapshotDelete (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'master_timeout', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a snapshot.delete request - * Deletes a snapshot. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html - */ - return function snapshotDelete (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['repository'] == null) { - const err = new ConfigurationError('Missing required parameter: repository') - return handleError(err, callback) - } - if (params['snapshot'] == null) { - const err = new ConfigurationError('Missing required parameter: snapshot') - return handleError(err, callback) - } - - // check required url components - if (params['snapshot'] != null && (params['repository'] == null)) { - const err = new ConfigurationError('Missing required parameter of the url: repository') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, repository, snapshot, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'DELETE' - path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + encodeURIComponent(snapshot) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSnapshotDelete diff --git a/api/api/snapshot.delete_repository.js b/api/api/snapshot.delete_repository.js deleted file mode 100644 index 337992c00..000000000 --- a/api/api/snapshot.delete_repository.js +++ /dev/null @@ -1,86 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSnapshotDeleteRepository (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'master_timeout', - 'timeout', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a snapshot.delete_repository request - * Deletes a repository. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html - */ - return function snapshotDeleteRepository (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['repository'] == null) { - const err = new ConfigurationError('Missing required parameter: repository') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, repository, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'DELETE' - path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSnapshotDeleteRepository diff --git a/api/api/snapshot.get.js b/api/api/snapshot.get.js deleted file mode 100644 index e78500b62..000000000 --- a/api/api/snapshot.get.js +++ /dev/null @@ -1,98 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSnapshotGet (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'master_timeout', - 'ignore_unavailable', - 'verbose', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - ignoreUnavailable: 'ignore_unavailable', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a snapshot.get request - * Returns information about a snapshot. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html - */ - return function snapshotGet (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['repository'] == null) { - const err = new ConfigurationError('Missing required parameter: repository') - return handleError(err, callback) - } - if (params['snapshot'] == null) { - const err = new ConfigurationError('Missing required parameter: snapshot') - return handleError(err, callback) - } - - // check required url components - if (params['snapshot'] != null && (params['repository'] == null)) { - const err = new ConfigurationError('Missing required parameter of the url: repository') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, repository, snapshot, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + encodeURIComponent(snapshot) - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSnapshotGet diff --git a/api/api/snapshot.get_repository.js b/api/api/snapshot.get_repository.js deleted file mode 100644 index c55356d66..000000000 --- a/api/api/snapshot.get_repository.js +++ /dev/null @@ -1,85 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSnapshotGetRepository (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'master_timeout', - 'local', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a snapshot.get_repository request - * Returns information about a repository. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html - */ - return function snapshotGetRepository (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, repository, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((repository) != null) { - if (method == null) method = 'GET' - path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) - } else { - if (method == null) method = 'GET' - path = '/' + '_snapshot' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSnapshotGetRepository diff --git a/api/api/snapshot.restore.js b/api/api/snapshot.restore.js deleted file mode 100644 index 567b02d48..000000000 --- a/api/api/snapshot.restore.js +++ /dev/null @@ -1,97 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSnapshotRestore (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'master_timeout', - 'wait_for_completion', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - waitForCompletion: 'wait_for_completion', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a snapshot.restore request - * Restores a snapshot. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html - */ - return function snapshotRestore (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['repository'] == null) { - const err = new ConfigurationError('Missing required parameter: repository') - return handleError(err, callback) - } - if (params['snapshot'] == null) { - const err = new ConfigurationError('Missing required parameter: snapshot') - return handleError(err, callback) - } - - // check required url components - if (params['snapshot'] != null && (params['repository'] == null)) { - const err = new ConfigurationError('Missing required parameter of the url: repository') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, repository, snapshot, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + encodeURIComponent(snapshot) + '/' + '_restore' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSnapshotRestore diff --git a/api/api/snapshot.status.js b/api/api/snapshot.status.js deleted file mode 100644 index 9e057c997..000000000 --- a/api/api/snapshot.status.js +++ /dev/null @@ -1,95 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSnapshotStatus (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'master_timeout', - 'ignore_unavailable', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - ignoreUnavailable: 'ignore_unavailable', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a snapshot.status request - * Returns information about the status of a snapshot. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html - */ - return function snapshotStatus (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required url components - if (params['snapshot'] != null && (params['repository'] == null)) { - const err = new ConfigurationError('Missing required parameter of the url: repository') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, repository, snapshot, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((repository) != null && (snapshot) != null) { - if (method == null) method = 'GET' - path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + encodeURIComponent(snapshot) + '/' + '_status' - } else if ((repository) != null) { - if (method == null) method = 'GET' - path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + '_status' - } else { - if (method == null) method = 'GET' - path = '/' + '_snapshot' + '/' + '_status' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSnapshotStatus diff --git a/api/api/snapshot.verify_repository.js b/api/api/snapshot.verify_repository.js deleted file mode 100644 index 1e04a2f09..000000000 --- a/api/api/snapshot.verify_repository.js +++ /dev/null @@ -1,86 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSnapshotVerifyRepository (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'master_timeout', - 'timeout', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - masterTimeout: 'master_timeout', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a snapshot.verify_repository request - * Verifies a repository. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html - */ - return function snapshotVerifyRepository (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['repository'] == null) { - const err = new ConfigurationError('Missing required parameter: repository') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, repository, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + '_verify' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSnapshotVerifyRepository diff --git a/api/api/sql.clear_cursor.js b/api/api/sql.clear_cursor.js deleted file mode 100644 index bfa3ce6b8..000000000 --- a/api/api/sql.clear_cursor.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSqlClearCursor (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a sql.clear_cursor request - * Clears the SQL cursor - * https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-pagination.html - */ - return function sqlClearCursor (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_sql' + '/' + 'close' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSqlClearCursor diff --git a/api/api/sql.query.js b/api/api/sql.query.js deleted file mode 100644 index 5354b8684..000000000 --- a/api/api/sql.query.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSqlQuery (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'format' - ] - - const snakeCase = { - - } - - /** - * Perform a sql.query request - * Executes a SQL request - * https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-rest-overview.html - */ - return function sqlQuery (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + '_sql' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSqlQuery diff --git a/api/api/sql.translate.js b/api/api/sql.translate.js deleted file mode 100644 index 652570095..000000000 --- a/api/api/sql.translate.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSqlTranslate (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a sql.translate request - * Translates SQL into Elasticsearch queries - * https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-translate.html - */ - return function sqlTranslate (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + '_sql' + '/' + 'translate' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSqlTranslate diff --git a/api/api/ssl.certificates.js b/api/api/ssl.certificates.js deleted file mode 100644 index beef26f5f..000000000 --- a/api/api/ssl.certificates.js +++ /dev/null @@ -1,72 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildSslCertificates (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a ssl.certificates request - * Retrieves information about the X.509 certificates used to encrypt communications in the cluster. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-ssl.html - */ - return function sslCertificates (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + '_ssl' + '/' + 'certificates' - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildSslCertificates diff --git a/api/api/tasks.cancel.js b/api/api/tasks.cancel.js deleted file mode 100644 index 03700b092..000000000 --- a/api/api/tasks.cancel.js +++ /dev/null @@ -1,88 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildTasksCancel (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'nodes', - 'actions', - 'parent_task_id', - 'wait_for_completion', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - parentTaskId: 'parent_task_id', - waitForCompletion: 'wait_for_completion', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a tasks.cancel request - * Cancels a task, if it can be cancelled through an API. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html - */ - return function tasksCancel (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, taskId, task_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((task_id || taskId) != null) { - if (method == null) method = 'POST' - path = '/' + '_tasks' + '/' + encodeURIComponent(task_id || taskId) + '/' + '_cancel' - } else { - if (method == null) method = 'POST' - path = '/' + '_tasks' + '/' + '_cancel' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildTasksCancel diff --git a/api/api/tasks.get.js b/api/api/tasks.get.js deleted file mode 100644 index 37f09539c..000000000 --- a/api/api/tasks.get.js +++ /dev/null @@ -1,86 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildTasksGet (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'wait_for_completion', - 'timeout', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - waitForCompletion: 'wait_for_completion', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a tasks.get request - * Returns information about a task. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html - */ - return function tasksGet (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['task_id'] == null && params['taskId'] == null) { - const err = new ConfigurationError('Missing required parameter: task_id or taskId') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, taskId, task_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + '_tasks' + '/' + encodeURIComponent(task_id || taskId) - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildTasksGet diff --git a/api/api/tasks.list.js b/api/api/tasks.list.js deleted file mode 100644 index ec188c579..000000000 --- a/api/api/tasks.list.js +++ /dev/null @@ -1,87 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildTasksList (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'nodes', - 'actions', - 'detailed', - 'parent_task_id', - 'wait_for_completion', - 'group_by', - 'timeout', - 'pretty', - 'human', - 'error_trace', - 'source', - 'filter_path' - ] - - const snakeCase = { - parentTaskId: 'parent_task_id', - waitForCompletion: 'wait_for_completion', - groupBy: 'group_by', - errorTrace: 'error_trace', - filterPath: 'filter_path' - } - - /** - * Perform a tasks.list request - * Returns a list of tasks. - * https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html - */ - return function tasksList (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + '_tasks' - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildTasksList diff --git a/api/api/termvectors.js b/api/api/termvectors.js index 126e5203a..257c84c82 100644 --- a/api/api/termvectors.js +++ b/api/api/termvectors.js @@ -1,6 +1,21 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ 'use strict' @@ -20,64 +35,23 @@ function termvectorsApi (params, options, callback) { return handleError(err, callback) } - var { method, body, index, id, ...querystring } = params + var { method, body, index, id, type, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) -<<<<<<< HEAD - // check required parameters - if (params['index'] == null) { - const err = new ConfigurationError('Missing required parameter: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, id, type, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null && (type) != null && (id) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_termvectors' - } else if ((index) != null && (id) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_termvectors' + '/' + encodeURIComponent(id) - } else if ((index) != null && (type) != null) { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_termvectors' - } else { - if (method == null) method = body == null ? 'GET' : 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_termvectors' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } -======= var path = '' - if ((index) != null && (id) != null) { + if ((index) != null && (type) != null && (id) != null) { + if (method == null) method = body == null ? 'GET' : 'POST' + path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_termvectors' + } else if ((index) != null && (id) != null) { if (method == null) method = body == null ? 'GET' : 'POST' path = '/' + encodeURIComponent(index) + '/' + '_termvectors' + '/' + encodeURIComponent(id) + } else if ((index) != null && (type) != null) { + if (method == null) method = body == null ? 'GET' : 'POST' + path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_termvectors' } else { if (method == null) method = body == null ? 'GET' : 'POST' path = '/' + encodeURIComponent(index) + '/' + '_termvectors' } ->>>>>>> a064f0f3... Improve child performances (#1314) // build request object const request = { diff --git a/api/api/transform.delete_transform.js b/api/api/transform.delete_transform.js deleted file mode 100644 index 6d76bfe56..000000000 --- a/api/api/transform.delete_transform.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildTransformDeleteTransform (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'force' - ] - - const snakeCase = { - - } - - /** - * Perform a transform.delete_transform request - * Deletes an existing transform. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-transform.html - */ - return function transformDeleteTransform (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['transform_id'] == null && params['transformId'] == null) { - const err = new ConfigurationError('Missing required parameter: transform_id or transformId') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, transformId, transform_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'DELETE' - path = '/' + '_transform' + '/' + encodeURIComponent(transform_id || transformId) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildTransformDeleteTransform diff --git a/api/api/transform.get_transform.js b/api/api/transform.get_transform.js deleted file mode 100644 index 4fc5fa0e4..000000000 --- a/api/api/transform.get_transform.js +++ /dev/null @@ -1,79 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildTransformGetTransform (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'from', - 'size', - 'allow_no_match' - ] - - const snakeCase = { - allowNoMatch: 'allow_no_match' - } - - /** - * Perform a transform.get_transform request - * Retrieves configuration information for transforms. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform.html - */ - return function transformGetTransform (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, transformId, transform_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((transform_id || transformId) != null) { - if (method == null) method = 'GET' - path = '/' + '_transform' + '/' + encodeURIComponent(transform_id || transformId) - } else { - if (method == null) method = 'GET' - path = '/' + '_transform' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildTransformGetTransform diff --git a/api/api/transform.get_transform_stats.js b/api/api/transform.get_transform_stats.js deleted file mode 100644 index d139d9e00..000000000 --- a/api/api/transform.get_transform_stats.js +++ /dev/null @@ -1,80 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildTransformGetTransformStats (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'from', - 'size', - 'allow_no_match' - ] - - const snakeCase = { - allowNoMatch: 'allow_no_match' - } - - /** - * Perform a transform.get_transform_stats request - * Retrieves usage information for transforms. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform-stats.html - */ - return function transformGetTransformStats (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['transform_id'] == null && params['transformId'] == null) { - const err = new ConfigurationError('Missing required parameter: transform_id or transformId') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, transformId, transform_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + '_transform' + '/' + encodeURIComponent(transform_id || transformId) + '/' + '_stats' - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildTransformGetTransformStats diff --git a/api/api/transform.preview_transform.js b/api/api/transform.preview_transform.js deleted file mode 100644 index 73aadb2c2..000000000 --- a/api/api/transform.preview_transform.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildTransformPreviewTransform (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a transform.preview_transform request - * Previews a transform. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-transform.html - */ - return function transformPreviewTransform (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_transform' + '/' + '_preview' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildTransformPreviewTransform diff --git a/api/api/transform.put_transform.js b/api/api/transform.put_transform.js deleted file mode 100644 index 578f1c0b3..000000000 --- a/api/api/transform.put_transform.js +++ /dev/null @@ -1,82 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildTransformPutTransform (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'defer_validation' - ] - - const snakeCase = { - deferValidation: 'defer_validation' - } - - /** - * Perform a transform.put_transform request - * Instantiates a transform. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/put-transform.html - */ - return function transformPutTransform (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['transform_id'] == null && params['transformId'] == null) { - const err = new ConfigurationError('Missing required parameter: transform_id or transformId') - return handleError(err, callback) - } - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, transformId, transform_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'PUT' - path = '/' + '_transform' + '/' + encodeURIComponent(transform_id || transformId) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildTransformPutTransform diff --git a/api/api/transform.start_transform.js b/api/api/transform.start_transform.js deleted file mode 100644 index b06f6a793..000000000 --- a/api/api/transform.start_transform.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildTransformStartTransform (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'timeout' - ] - - const snakeCase = { - - } - - /** - * Perform a transform.start_transform request - * Starts one or more transforms. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/start-transform.html - */ - return function transformStartTransform (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['transform_id'] == null && params['transformId'] == null) { - const err = new ConfigurationError('Missing required parameter: transform_id or transformId') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, transformId, transform_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_transform' + '/' + encodeURIComponent(transform_id || transformId) + '/' + '_start' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildTransformStartTransform diff --git a/api/api/transform.stop_transform.js b/api/api/transform.stop_transform.js deleted file mode 100644 index be60db461..000000000 --- a/api/api/transform.stop_transform.js +++ /dev/null @@ -1,84 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildTransformStopTransform (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'force', - 'wait_for_completion', - 'timeout', - 'allow_no_match', - 'wait_for_checkpoint' - ] - - const snakeCase = { - waitForCompletion: 'wait_for_completion', - allowNoMatch: 'allow_no_match', - waitForCheckpoint: 'wait_for_checkpoint' - } - - /** - * Perform a transform.stop_transform request - * Stops one or more transforms. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-transform.html - */ - return function transformStopTransform (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['transform_id'] == null && params['transformId'] == null) { - const err = new ConfigurationError('Missing required parameter: transform_id or transformId') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, transformId, transform_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_transform' + '/' + encodeURIComponent(transform_id || transformId) + '/' + '_stop' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildTransformStopTransform diff --git a/api/api/transform.update_transform.js b/api/api/transform.update_transform.js deleted file mode 100644 index eaa9404ae..000000000 --- a/api/api/transform.update_transform.js +++ /dev/null @@ -1,82 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildTransformUpdateTransform (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'defer_validation' - ] - - const snakeCase = { - deferValidation: 'defer_validation' - } - - /** - * Perform a transform.update_transform request - * Updates certain properties of a transform. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/update-transform.html - */ - return function transformUpdateTransform (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['transform_id'] == null && params['transformId'] == null) { - const err = new ConfigurationError('Missing required parameter: transform_id or transformId') - return handleError(err, callback) - } - if (params['body'] == null) { - const err = new ConfigurationError('Missing required parameter: body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, transformId, transform_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_transform' + '/' + encodeURIComponent(transform_id || transformId) + '/' + '_update' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildTransformUpdateTransform diff --git a/api/api/update.js b/api/api/update.js index dd04a5107..b0c0246bd 100644 --- a/api/api/update.js +++ b/api/api/update.js @@ -1,6 +1,21 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ 'use strict' @@ -8,43 +23,9 @@ /* eslint no-unused-vars: 0 */ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') -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', 'require_alias', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] -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', requireAlias: 'require_alias', errorTrace: 'error_trace', filterPath: 'filter_path' } +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'] +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' } -<<<<<<< HEAD - 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' - ] - - 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' -======= function updateApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) @@ -60,7 +41,6 @@ function updateApi (params, options, callback) { if (params['body'] == null) { const err = new this[kConfigurationError]('Missing required parameter: body') return handleError(err, callback) ->>>>>>> a064f0f3... Improve child performances (#1314) } var { method, body, id, index, type, ...querystring } = params diff --git a/api/api/update_by_query.js b/api/api/update_by_query.js index 357894334..d7760bc9e 100644 --- a/api/api/update_by_query.js +++ b/api/api/update_by_query.js @@ -1,6 +1,21 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ 'use strict' @@ -8,78 +23,9 @@ /* eslint no-unused-vars: 0 */ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') -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', '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'] +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'] 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' } -<<<<<<< HEAD - 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' - ] - - 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' -======= function updateByQueryApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) @@ -87,66 +33,32 @@ function updateByQueryApi (params, options, callback) { if (params['index'] == null) { const err = new this[kConfigurationError]('Missing required parameter: index') return handleError(err, callback) ->>>>>>> a064f0f3... Improve child performances (#1314) } - var { method, body, index, ...querystring } = params + // check required url components + if (params['type'] != null && (params['index'] == null)) { + const err = new this[kConfigurationError]('Missing required parameter of the url: index') + return handleError(err, callback) + } + + var { method, body, index, type, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) var path = '' - if (method == null) method = 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_update_by_query' + if ((index) != null && (type) != null) { + if (method == null) method = 'POST' + path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_update_by_query' + } else { + if (method == null) method = 'POST' + path = '/' + encodeURIComponent(index) + '/' + '_update_by_query' + } -<<<<<<< HEAD - // check required url components - if (params['type'] != null && (params['index'] == null)) { - const err = new ConfigurationError('Missing required parameter of the url: index') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, index, type, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((index) != null && (type) != null) { - if (method == null) method = 'POST' - path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_update_by_query' - } else { - if (method == null) method = 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_update_by_query' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) -======= // build request object const request = { method, path, body: body || '', querystring ->>>>>>> a064f0f3... Improve child performances (#1314) } return this.transport.request(request, options, callback) diff --git a/api/api/update_by_query_rethrottle.js b/api/api/update_by_query_rethrottle.js index 0d2e0a44b..a5c8145af 100644 --- a/api/api/update_by_query_rethrottle.js +++ b/api/api/update_by_query_rethrottle.js @@ -1,6 +1,21 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ 'use strict' diff --git a/api/api/watcher.ack_watch.js b/api/api/watcher.ack_watch.js deleted file mode 100644 index ea399d928..000000000 --- a/api/api/watcher.ack_watch.js +++ /dev/null @@ -1,89 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildWatcherAckWatch (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a watcher.ack_watch request - * Acknowledges a watch, manually throttling the execution of the watch's actions. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-ack-watch.html - */ - return function watcherAckWatch (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['watch_id'] == null && params['watchId'] == null) { - const err = new ConfigurationError('Missing required parameter: watch_id or watchId') - return handleError(err, callback) - } - - // check required url components - if ((params['action_id'] != null || params['actionId'] != null) && ((params['watch_id'] == null && params['watchId'] == null))) { - const err = new ConfigurationError('Missing required parameter of the url: watch_id') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, watchId, watch_id, actionId, action_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((watch_id || watchId) != null && (action_id || actionId) != null) { - if (method == null) method = 'PUT' - path = '/' + '_watcher' + '/' + 'watch' + '/' + encodeURIComponent(watch_id || watchId) + '/' + '_ack' + '/' + encodeURIComponent(action_id || actionId) - } else { - if (method == null) method = 'PUT' - path = '/' + '_watcher' + '/' + 'watch' + '/' + encodeURIComponent(watch_id || watchId) + '/' + '_ack' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildWatcherAckWatch diff --git a/api/api/watcher.activate_watch.js b/api/api/watcher.activate_watch.js deleted file mode 100644 index f78edec85..000000000 --- a/api/api/watcher.activate_watch.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildWatcherActivateWatch (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a watcher.activate_watch request - * Activates a currently inactive watch. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-activate-watch.html - */ - return function watcherActivateWatch (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['watch_id'] == null && params['watchId'] == null) { - const err = new ConfigurationError('Missing required parameter: watch_id or watchId') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, watchId, watch_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'PUT' - path = '/' + '_watcher' + '/' + 'watch' + '/' + encodeURIComponent(watch_id || watchId) + '/' + '_activate' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildWatcherActivateWatch diff --git a/api/api/watcher.deactivate_watch.js b/api/api/watcher.deactivate_watch.js deleted file mode 100644 index add97ef75..000000000 --- a/api/api/watcher.deactivate_watch.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildWatcherDeactivateWatch (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a watcher.deactivate_watch request - * Deactivates a currently active watch. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-deactivate-watch.html - */ - return function watcherDeactivateWatch (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['watch_id'] == null && params['watchId'] == null) { - const err = new ConfigurationError('Missing required parameter: watch_id or watchId') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, watchId, watch_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'PUT' - path = '/' + '_watcher' + '/' + 'watch' + '/' + encodeURIComponent(watch_id || watchId) + '/' + '_deactivate' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildWatcherDeactivateWatch diff --git a/api/api/watcher.delete_watch.js b/api/api/watcher.delete_watch.js deleted file mode 100644 index 544480b14..000000000 --- a/api/api/watcher.delete_watch.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildWatcherDeleteWatch (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a watcher.delete_watch request - * Removes a watch from Watcher. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-delete-watch.html - */ - return function watcherDeleteWatch (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['id'] == null) { - const err = new ConfigurationError('Missing required parameter: id') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'DELETE' - path = '/' + '_watcher' + '/' + 'watch' + '/' + encodeURIComponent(id) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildWatcherDeleteWatch diff --git a/api/api/watcher.execute_watch.js b/api/api/watcher.execute_watch.js deleted file mode 100644 index 62bf13a11..000000000 --- a/api/api/watcher.execute_watch.js +++ /dev/null @@ -1,77 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildWatcherExecuteWatch (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'debug' - ] - - const snakeCase = { - - } - - /** - * Perform a watcher.execute_watch request - * Forces the execution of a stored watch. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-execute-watch.html - */ - return function watcherExecuteWatch (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((id) != null) { - if (method == null) method = 'PUT' - path = '/' + '_watcher' + '/' + 'watch' + '/' + encodeURIComponent(id) + '/' + '_execute' - } else { - if (method == null) method = 'PUT' - path = '/' + '_watcher' + '/' + 'watch' + '/' + '_execute' - } - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildWatcherExecuteWatch diff --git a/api/api/watcher.get_watch.js b/api/api/watcher.get_watch.js deleted file mode 100644 index 61e693964..000000000 --- a/api/api/watcher.get_watch.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildWatcherGetWatch (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a watcher.get_watch request - * Retrieves a watch by its ID. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-get-watch.html - */ - return function watcherGetWatch (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['id'] == null) { - const err = new ConfigurationError('Missing required parameter: id') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + '_watcher' + '/' + 'watch' + '/' + encodeURIComponent(id) - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildWatcherGetWatch diff --git a/api/api/watcher.put_watch.js b/api/api/watcher.put_watch.js deleted file mode 100644 index 1a60b2d4b..000000000 --- a/api/api/watcher.put_watch.js +++ /dev/null @@ -1,82 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildWatcherPutWatch (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'active', - 'version', - 'if_seq_no', - 'if_primary_term' - ] - - const snakeCase = { - ifSeqNo: 'if_seq_no', - ifPrimaryTerm: 'if_primary_term' - } - - /** - * Perform a watcher.put_watch request - * Creates a new watch, or updates an existing one. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-put-watch.html - */ - return function watcherPutWatch (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params['id'] == null) { - const err = new ConfigurationError('Missing required parameter: id') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'PUT' - path = '/' + '_watcher' + '/' + 'watch' + '/' + encodeURIComponent(id) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildWatcherPutWatch diff --git a/api/api/watcher.start.js b/api/api/watcher.start.js deleted file mode 100644 index c9e3b9047..000000000 --- a/api/api/watcher.start.js +++ /dev/null @@ -1,72 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildWatcherStart (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a watcher.start request - * Starts Watcher if it is not already running. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-start.html - */ - return function watcherStart (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_watcher' + '/' + '_start' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildWatcherStart diff --git a/api/api/watcher.stats.js b/api/api/watcher.stats.js deleted file mode 100644 index 647b733f6..000000000 --- a/api/api/watcher.stats.js +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildWatcherStats (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'metric', - 'emit_stacktraces' - ] - - const snakeCase = { - emitStacktraces: 'emit_stacktraces' - } - - /** - * Perform a watcher.stats request - * Retrieves the current Watcher metrics. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stats.html - */ - return function watcherStats (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, metric, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if ((metric) != null) { - if (method == null) method = 'GET' - path = '/' + '_watcher' + '/' + 'stats' + '/' + encodeURIComponent(metric) - } else { - if (method == null) method = 'GET' - path = '/' + '_watcher' + '/' + 'stats' - } - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildWatcherStats diff --git a/api/api/watcher.stop.js b/api/api/watcher.stop.js deleted file mode 100644 index ac5a97d88..000000000 --- a/api/api/watcher.stop.js +++ /dev/null @@ -1,72 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildWatcherStop (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - - ] - - const snakeCase = { - - } - - /** - * Perform a watcher.stop request - * Stops Watcher if it is running. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stop.html - */ - return function watcherStop (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'POST' - path = '/' + '_watcher' + '/' + '_stop' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildWatcherStop diff --git a/api/api/xpack.info.js b/api/api/xpack.info.js deleted file mode 100644 index 4d12aa3cd..000000000 --- a/api/api/xpack.info.js +++ /dev/null @@ -1,73 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildXpackInfo (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'categories', - 'accept_enterprise' - ] - - const snakeCase = { - acceptEnterprise: 'accept_enterprise' - } - - /** - * Perform a xpack.info request - * Retrieves information about the installed X-Pack features. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/info-api.html - */ - return function xpackInfo (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + '_xpack' - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildXpackInfo diff --git a/api/api/xpack.usage.js b/api/api/xpack.usage.js deleted file mode 100644 index bebe72ee5..000000000 --- a/api/api/xpack.usage.js +++ /dev/null @@ -1,72 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildXpackUsage (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts - - const acceptedQuerystring = [ - 'master_timeout' - ] - - const snakeCase = { - masterTimeout: 'master_timeout' - } - - /** - * Perform a xpack.usage request - * Retrieves usage information about the installed X-Pack features. - * https://www.elastic.co/guide/en/elasticsearch/reference/current/usage-api.html - */ - return function xpackUsage (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = [] - var { method, body, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings) - - var ignore = options.ignore - if (typeof ignore === 'number') { - options.ignore = [ignore] - } - - var path = '' - - if (method == null) method = 'GET' - path = '/' + '_xpack' + '/' + 'usage' - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - options.warnings = warnings.length === 0 ? null : warnings - return makeRequest(request, options, callback) - } -} - -module.exports = buildXpackUsage diff --git a/api/index.js b/api/index.js index 013bc26cd..557d16ed6 100644 --- a/api/index.js +++ b/api/index.js @@ -53,7 +53,6 @@ const updateByQueryRethrottleApi = require('./api/update_by_query_rethrottle') const AsyncSearchApi = require('./api/async_search') const AutoscalingApi = require('./api/autoscaling') const CcrApi = require('./api/ccr') -const closePointInTimeApi = require('./api/close_point_in_time') const EnrichApi = require('./api/enrich') const EqlApi = require('./api/eql') const GraphApi = require('./api/graph') @@ -62,7 +61,6 @@ const LicenseApi = require('./api/license') const MigrationApi = require('./api/migration') const MlApi = require('./api/ml') const MonitoringApi = require('./api/monitoring') -const openPointInTimeApi = require('./api/open_point_in_time') const RollupApi = require('./api/rollup') const SearchableSnapshotsApi = require('./api/searchable_snapshots') const SecurityApi = require('./api/security') @@ -173,654 +171,7 @@ ESAPI.prototype.termvectors = termvectorsApi ESAPI.prototype.update = updateApi ESAPI.prototype.updateByQuery = updateByQueryApi ESAPI.prototype.updateByQueryRethrottle = updateByQueryRethrottleApi -ESAPI.prototype.closePointInTime = closePointInTimeApi -ESAPI.prototype.openPointInTime = openPointInTimeApi -<<<<<<< HEAD - const apis = { - async_search: { - delete: lazyLoad('async_search.delete', opts), - get: lazyLoad('async_search.get', opts), - submit: lazyLoad('async_search.submit', opts) - }, - asyncSearch: { - delete: lazyLoad('async_search.delete', opts), - get: lazyLoad('async_search.get', opts), - submit: lazyLoad('async_search.submit', opts) - }, - autoscaling: { - delete_autoscaling_policy: lazyLoad('autoscaling.delete_autoscaling_policy', opts), - deleteAutoscalingPolicy: lazyLoad('autoscaling.delete_autoscaling_policy', opts), - get_autoscaling_decision: lazyLoad('autoscaling.get_autoscaling_decision', opts), - getAutoscalingDecision: lazyLoad('autoscaling.get_autoscaling_decision', opts), - get_autoscaling_policy: lazyLoad('autoscaling.get_autoscaling_policy', opts), - getAutoscalingPolicy: lazyLoad('autoscaling.get_autoscaling_policy', opts), - put_autoscaling_policy: lazyLoad('autoscaling.put_autoscaling_policy', opts), - putAutoscalingPolicy: lazyLoad('autoscaling.put_autoscaling_policy', opts) - }, - bulk: lazyLoad('bulk', opts), - cat: { - aliases: lazyLoad('cat.aliases', opts), - allocation: lazyLoad('cat.allocation', opts), - count: lazyLoad('cat.count', opts), - fielddata: lazyLoad('cat.fielddata', opts), - health: lazyLoad('cat.health', opts), - help: lazyLoad('cat.help', opts), - indices: lazyLoad('cat.indices', opts), - master: lazyLoad('cat.master', opts), - ml_data_frame_analytics: lazyLoad('cat.ml_data_frame_analytics', opts), - mlDataFrameAnalytics: lazyLoad('cat.ml_data_frame_analytics', opts), - ml_datafeeds: lazyLoad('cat.ml_datafeeds', opts), - mlDatafeeds: lazyLoad('cat.ml_datafeeds', opts), - ml_jobs: lazyLoad('cat.ml_jobs', opts), - mlJobs: lazyLoad('cat.ml_jobs', opts), - ml_trained_models: lazyLoad('cat.ml_trained_models', opts), - mlTrainedModels: lazyLoad('cat.ml_trained_models', opts), - nodeattrs: lazyLoad('cat.nodeattrs', opts), - nodes: lazyLoad('cat.nodes', opts), - pending_tasks: lazyLoad('cat.pending_tasks', opts), - pendingTasks: lazyLoad('cat.pending_tasks', opts), - plugins: lazyLoad('cat.plugins', opts), - recovery: lazyLoad('cat.recovery', opts), - repositories: lazyLoad('cat.repositories', opts), - segments: lazyLoad('cat.segments', opts), - shards: lazyLoad('cat.shards', opts), - snapshots: lazyLoad('cat.snapshots', opts), - tasks: lazyLoad('cat.tasks', opts), - templates: lazyLoad('cat.templates', opts), - thread_pool: lazyLoad('cat.thread_pool', opts), - threadPool: lazyLoad('cat.thread_pool', opts), - transforms: lazyLoad('cat.transforms', opts) - }, - ccr: { - delete_auto_follow_pattern: lazyLoad('ccr.delete_auto_follow_pattern', opts), - deleteAutoFollowPattern: lazyLoad('ccr.delete_auto_follow_pattern', opts), - follow: lazyLoad('ccr.follow', opts), - follow_info: lazyLoad('ccr.follow_info', opts), - followInfo: lazyLoad('ccr.follow_info', opts), - follow_stats: lazyLoad('ccr.follow_stats', opts), - followStats: lazyLoad('ccr.follow_stats', opts), - forget_follower: lazyLoad('ccr.forget_follower', opts), - forgetFollower: lazyLoad('ccr.forget_follower', opts), - get_auto_follow_pattern: lazyLoad('ccr.get_auto_follow_pattern', opts), - getAutoFollowPattern: lazyLoad('ccr.get_auto_follow_pattern', opts), - pause_auto_follow_pattern: lazyLoad('ccr.pause_auto_follow_pattern', opts), - pauseAutoFollowPattern: lazyLoad('ccr.pause_auto_follow_pattern', opts), - pause_follow: lazyLoad('ccr.pause_follow', opts), - pauseFollow: lazyLoad('ccr.pause_follow', opts), - put_auto_follow_pattern: lazyLoad('ccr.put_auto_follow_pattern', opts), - putAutoFollowPattern: lazyLoad('ccr.put_auto_follow_pattern', opts), - resume_auto_follow_pattern: lazyLoad('ccr.resume_auto_follow_pattern', opts), - resumeAutoFollowPattern: lazyLoad('ccr.resume_auto_follow_pattern', opts), - resume_follow: lazyLoad('ccr.resume_follow', opts), - resumeFollow: lazyLoad('ccr.resume_follow', opts), - stats: lazyLoad('ccr.stats', opts), - unfollow: lazyLoad('ccr.unfollow', opts) - }, - clear_scroll: lazyLoad('clear_scroll', opts), - clearScroll: lazyLoad('clear_scroll', opts), - cluster: { - allocation_explain: lazyLoad('cluster.allocation_explain', opts), - allocationExplain: lazyLoad('cluster.allocation_explain', opts), - delete_component_template: lazyLoad('cluster.delete_component_template', opts), - deleteComponentTemplate: lazyLoad('cluster.delete_component_template', opts), - delete_voting_config_exclusions: lazyLoad('cluster.delete_voting_config_exclusions', opts), - deleteVotingConfigExclusions: lazyLoad('cluster.delete_voting_config_exclusions', opts), - exists_component_template: lazyLoad('cluster.exists_component_template', opts), - existsComponentTemplate: lazyLoad('cluster.exists_component_template', opts), - get_component_template: lazyLoad('cluster.get_component_template', opts), - getComponentTemplate: lazyLoad('cluster.get_component_template', opts), - get_settings: lazyLoad('cluster.get_settings', opts), - getSettings: lazyLoad('cluster.get_settings', opts), - health: lazyLoad('cluster.health', opts), - pending_tasks: lazyLoad('cluster.pending_tasks', opts), - pendingTasks: lazyLoad('cluster.pending_tasks', opts), - post_voting_config_exclusions: lazyLoad('cluster.post_voting_config_exclusions', opts), - postVotingConfigExclusions: lazyLoad('cluster.post_voting_config_exclusions', opts), - put_component_template: lazyLoad('cluster.put_component_template', opts), - putComponentTemplate: lazyLoad('cluster.put_component_template', opts), - put_settings: lazyLoad('cluster.put_settings', opts), - putSettings: lazyLoad('cluster.put_settings', opts), - remote_info: lazyLoad('cluster.remote_info', opts), - remoteInfo: lazyLoad('cluster.remote_info', opts), - reroute: lazyLoad('cluster.reroute', opts), - state: lazyLoad('cluster.state', opts), - stats: lazyLoad('cluster.stats', opts) - }, - count: lazyLoad('count', opts), - create: lazyLoad('create', opts), - dangling_indices: { - delete_dangling_index: lazyLoad('dangling_indices.delete_dangling_index', opts), - deleteDanglingIndex: lazyLoad('dangling_indices.delete_dangling_index', opts), - import_dangling_index: lazyLoad('dangling_indices.import_dangling_index', opts), - importDanglingIndex: lazyLoad('dangling_indices.import_dangling_index', opts), - list_dangling_indices: lazyLoad('dangling_indices.list_dangling_indices', opts), - listDanglingIndices: lazyLoad('dangling_indices.list_dangling_indices', opts) - }, - danglingIndices: { - delete_dangling_index: lazyLoad('dangling_indices.delete_dangling_index', opts), - deleteDanglingIndex: lazyLoad('dangling_indices.delete_dangling_index', opts), - import_dangling_index: lazyLoad('dangling_indices.import_dangling_index', opts), - importDanglingIndex: lazyLoad('dangling_indices.import_dangling_index', opts), - list_dangling_indices: lazyLoad('dangling_indices.list_dangling_indices', opts), - listDanglingIndices: lazyLoad('dangling_indices.list_dangling_indices', opts) - }, - delete: lazyLoad('delete', opts), - delete_by_query: lazyLoad('delete_by_query', opts), - deleteByQuery: lazyLoad('delete_by_query', opts), - delete_by_query_rethrottle: lazyLoad('delete_by_query_rethrottle', opts), - deleteByQueryRethrottle: lazyLoad('delete_by_query_rethrottle', opts), - delete_script: lazyLoad('delete_script', opts), - deleteScript: lazyLoad('delete_script', opts), - enrich: { - delete_policy: lazyLoad('enrich.delete_policy', opts), - deletePolicy: lazyLoad('enrich.delete_policy', opts), - execute_policy: lazyLoad('enrich.execute_policy', opts), - executePolicy: lazyLoad('enrich.execute_policy', opts), - get_policy: lazyLoad('enrich.get_policy', opts), - getPolicy: lazyLoad('enrich.get_policy', opts), - put_policy: lazyLoad('enrich.put_policy', opts), - putPolicy: lazyLoad('enrich.put_policy', opts), - stats: lazyLoad('enrich.stats', opts) - }, - eql: { - delete: lazyLoad('eql.delete', opts), - get: lazyLoad('eql.get', opts), - search: lazyLoad('eql.search', opts) - }, - exists: lazyLoad('exists', opts), - exists_source: lazyLoad('exists_source', opts), - existsSource: lazyLoad('exists_source', opts), - explain: lazyLoad('explain', opts), - field_caps: lazyLoad('field_caps', opts), - fieldCaps: lazyLoad('field_caps', opts), - get: lazyLoad('get', opts), - get_script: lazyLoad('get_script', opts), - getScript: lazyLoad('get_script', opts), - get_script_context: lazyLoad('get_script_context', opts), - getScriptContext: lazyLoad('get_script_context', opts), - get_script_languages: lazyLoad('get_script_languages', opts), - getScriptLanguages: lazyLoad('get_script_languages', opts), - get_source: lazyLoad('get_source', opts), - getSource: lazyLoad('get_source', opts), - graph: { - explore: lazyLoad('graph.explore', opts) - }, - ilm: { - delete_lifecycle: lazyLoad('ilm.delete_lifecycle', opts), - deleteLifecycle: lazyLoad('ilm.delete_lifecycle', opts), - explain_lifecycle: lazyLoad('ilm.explain_lifecycle', opts), - explainLifecycle: lazyLoad('ilm.explain_lifecycle', opts), - get_lifecycle: lazyLoad('ilm.get_lifecycle', opts), - getLifecycle: lazyLoad('ilm.get_lifecycle', opts), - get_status: lazyLoad('ilm.get_status', opts), - getStatus: lazyLoad('ilm.get_status', opts), - move_to_step: lazyLoad('ilm.move_to_step', opts), - moveToStep: lazyLoad('ilm.move_to_step', opts), - put_lifecycle: lazyLoad('ilm.put_lifecycle', opts), - putLifecycle: lazyLoad('ilm.put_lifecycle', opts), - remove_policy: lazyLoad('ilm.remove_policy', opts), - removePolicy: lazyLoad('ilm.remove_policy', opts), - retry: lazyLoad('ilm.retry', opts), - start: lazyLoad('ilm.start', opts), - stop: lazyLoad('ilm.stop', opts) - }, - index: lazyLoad('index', opts), - indices: { - add_block: lazyLoad('indices.add_block', opts), - addBlock: lazyLoad('indices.add_block', opts), - analyze: lazyLoad('indices.analyze', opts), - clear_cache: lazyLoad('indices.clear_cache', opts), - clearCache: lazyLoad('indices.clear_cache', opts), - clone: lazyLoad('indices.clone', opts), - close: lazyLoad('indices.close', opts), - create: lazyLoad('indices.create', opts), - create_data_stream: lazyLoad('indices.create_data_stream', opts), - createDataStream: lazyLoad('indices.create_data_stream', opts), - data_streams_stats: lazyLoad('indices.data_streams_stats', opts), - dataStreamsStats: lazyLoad('indices.data_streams_stats', opts), - delete: lazyLoad('indices.delete', opts), - delete_alias: lazyLoad('indices.delete_alias', opts), - deleteAlias: lazyLoad('indices.delete_alias', opts), - delete_data_stream: lazyLoad('indices.delete_data_stream', opts), - deleteDataStream: lazyLoad('indices.delete_data_stream', opts), - delete_index_template: lazyLoad('indices.delete_index_template', opts), - deleteIndexTemplate: lazyLoad('indices.delete_index_template', opts), - delete_template: lazyLoad('indices.delete_template', opts), - deleteTemplate: lazyLoad('indices.delete_template', opts), - exists: lazyLoad('indices.exists', opts), - exists_alias: lazyLoad('indices.exists_alias', opts), - existsAlias: lazyLoad('indices.exists_alias', opts), - exists_index_template: lazyLoad('indices.exists_index_template', opts), - existsIndexTemplate: lazyLoad('indices.exists_index_template', opts), - exists_template: lazyLoad('indices.exists_template', opts), - existsTemplate: lazyLoad('indices.exists_template', opts), - exists_type: lazyLoad('indices.exists_type', opts), - existsType: lazyLoad('indices.exists_type', opts), - flush: lazyLoad('indices.flush', opts), - flush_synced: lazyLoad('indices.flush_synced', opts), - flushSynced: lazyLoad('indices.flush_synced', opts), - forcemerge: lazyLoad('indices.forcemerge', opts), - freeze: lazyLoad('indices.freeze', opts), - get: lazyLoad('indices.get', opts), - get_alias: lazyLoad('indices.get_alias', opts), - getAlias: lazyLoad('indices.get_alias', opts), - get_data_stream: lazyLoad('indices.get_data_stream', opts), - getDataStream: lazyLoad('indices.get_data_stream', opts), - get_field_mapping: lazyLoad('indices.get_field_mapping', opts), - getFieldMapping: lazyLoad('indices.get_field_mapping', opts), - get_index_template: lazyLoad('indices.get_index_template', opts), - getIndexTemplate: lazyLoad('indices.get_index_template', opts), - get_mapping: lazyLoad('indices.get_mapping', opts), - getMapping: lazyLoad('indices.get_mapping', opts), - get_settings: lazyLoad('indices.get_settings', opts), - getSettings: lazyLoad('indices.get_settings', opts), - get_template: lazyLoad('indices.get_template', opts), - getTemplate: lazyLoad('indices.get_template', opts), - get_upgrade: lazyLoad('indices.get_upgrade', opts), - getUpgrade: lazyLoad('indices.get_upgrade', opts), - open: lazyLoad('indices.open', opts), - put_alias: lazyLoad('indices.put_alias', opts), - putAlias: lazyLoad('indices.put_alias', opts), - put_index_template: lazyLoad('indices.put_index_template', opts), - putIndexTemplate: lazyLoad('indices.put_index_template', opts), - put_mapping: lazyLoad('indices.put_mapping', opts), - putMapping: lazyLoad('indices.put_mapping', opts), - put_settings: lazyLoad('indices.put_settings', opts), - putSettings: lazyLoad('indices.put_settings', opts), - put_template: lazyLoad('indices.put_template', opts), - putTemplate: lazyLoad('indices.put_template', opts), - recovery: lazyLoad('indices.recovery', opts), - refresh: lazyLoad('indices.refresh', opts), - reload_search_analyzers: lazyLoad('indices.reload_search_analyzers', opts), - reloadSearchAnalyzers: lazyLoad('indices.reload_search_analyzers', opts), - resolve_index: lazyLoad('indices.resolve_index', opts), - resolveIndex: lazyLoad('indices.resolve_index', opts), - rollover: lazyLoad('indices.rollover', opts), - segments: lazyLoad('indices.segments', opts), - shard_stores: lazyLoad('indices.shard_stores', opts), - shardStores: lazyLoad('indices.shard_stores', opts), - shrink: lazyLoad('indices.shrink', opts), - simulate_index_template: lazyLoad('indices.simulate_index_template', opts), - simulateIndexTemplate: lazyLoad('indices.simulate_index_template', opts), - simulate_template: lazyLoad('indices.simulate_template', opts), - simulateTemplate: lazyLoad('indices.simulate_template', opts), - split: lazyLoad('indices.split', opts), - stats: lazyLoad('indices.stats', opts), - unfreeze: lazyLoad('indices.unfreeze', opts), - update_aliases: lazyLoad('indices.update_aliases', opts), - updateAliases: lazyLoad('indices.update_aliases', opts), - upgrade: lazyLoad('indices.upgrade', opts), - validate_query: lazyLoad('indices.validate_query', opts), - validateQuery: lazyLoad('indices.validate_query', opts) - }, - info: lazyLoad('info', opts), - ingest: { - delete_pipeline: lazyLoad('ingest.delete_pipeline', opts), - deletePipeline: lazyLoad('ingest.delete_pipeline', opts), - get_pipeline: lazyLoad('ingest.get_pipeline', opts), - getPipeline: lazyLoad('ingest.get_pipeline', opts), - processor_grok: lazyLoad('ingest.processor_grok', opts), - processorGrok: lazyLoad('ingest.processor_grok', opts), - put_pipeline: lazyLoad('ingest.put_pipeline', opts), - putPipeline: lazyLoad('ingest.put_pipeline', opts), - simulate: lazyLoad('ingest.simulate', opts) - }, - license: { - delete: lazyLoad('license.delete', opts), - get: lazyLoad('license.get', opts), - get_basic_status: lazyLoad('license.get_basic_status', opts), - getBasicStatus: lazyLoad('license.get_basic_status', opts), - get_trial_status: lazyLoad('license.get_trial_status', opts), - getTrialStatus: lazyLoad('license.get_trial_status', opts), - post: lazyLoad('license.post', opts), - post_start_basic: lazyLoad('license.post_start_basic', opts), - postStartBasic: lazyLoad('license.post_start_basic', opts), - post_start_trial: lazyLoad('license.post_start_trial', opts), - postStartTrial: lazyLoad('license.post_start_trial', opts) - }, - mget: lazyLoad('mget', opts), - migration: { - deprecations: lazyLoad('migration.deprecations', opts) - }, - ml: { - close_job: lazyLoad('ml.close_job', opts), - closeJob: lazyLoad('ml.close_job', opts), - delete_calendar: lazyLoad('ml.delete_calendar', opts), - deleteCalendar: lazyLoad('ml.delete_calendar', opts), - delete_calendar_event: lazyLoad('ml.delete_calendar_event', opts), - deleteCalendarEvent: lazyLoad('ml.delete_calendar_event', opts), - delete_calendar_job: lazyLoad('ml.delete_calendar_job', opts), - deleteCalendarJob: lazyLoad('ml.delete_calendar_job', opts), - delete_data_frame_analytics: lazyLoad('ml.delete_data_frame_analytics', opts), - deleteDataFrameAnalytics: lazyLoad('ml.delete_data_frame_analytics', opts), - delete_datafeed: lazyLoad('ml.delete_datafeed', opts), - deleteDatafeed: lazyLoad('ml.delete_datafeed', opts), - delete_expired_data: lazyLoad('ml.delete_expired_data', opts), - deleteExpiredData: lazyLoad('ml.delete_expired_data', opts), - delete_filter: lazyLoad('ml.delete_filter', opts), - deleteFilter: lazyLoad('ml.delete_filter', opts), - delete_forecast: lazyLoad('ml.delete_forecast', opts), - deleteForecast: lazyLoad('ml.delete_forecast', opts), - delete_job: lazyLoad('ml.delete_job', opts), - deleteJob: lazyLoad('ml.delete_job', opts), - delete_model_snapshot: lazyLoad('ml.delete_model_snapshot', opts), - deleteModelSnapshot: lazyLoad('ml.delete_model_snapshot', opts), - delete_trained_model: lazyLoad('ml.delete_trained_model', opts), - deleteTrainedModel: lazyLoad('ml.delete_trained_model', opts), - estimate_model_memory: lazyLoad('ml.estimate_model_memory', opts), - estimateModelMemory: lazyLoad('ml.estimate_model_memory', opts), - evaluate_data_frame: lazyLoad('ml.evaluate_data_frame', opts), - evaluateDataFrame: lazyLoad('ml.evaluate_data_frame', opts), - explain_data_frame_analytics: lazyLoad('ml.explain_data_frame_analytics', opts), - explainDataFrameAnalytics: lazyLoad('ml.explain_data_frame_analytics', opts), - find_file_structure: lazyLoad('ml.find_file_structure', opts), - findFileStructure: lazyLoad('ml.find_file_structure', opts), - flush_job: lazyLoad('ml.flush_job', opts), - flushJob: lazyLoad('ml.flush_job', opts), - forecast: lazyLoad('ml.forecast', opts), - get_buckets: lazyLoad('ml.get_buckets', opts), - getBuckets: lazyLoad('ml.get_buckets', opts), - get_calendar_events: lazyLoad('ml.get_calendar_events', opts), - getCalendarEvents: lazyLoad('ml.get_calendar_events', opts), - get_calendars: lazyLoad('ml.get_calendars', opts), - getCalendars: lazyLoad('ml.get_calendars', opts), - get_categories: lazyLoad('ml.get_categories', opts), - getCategories: lazyLoad('ml.get_categories', opts), - get_data_frame_analytics: lazyLoad('ml.get_data_frame_analytics', opts), - getDataFrameAnalytics: lazyLoad('ml.get_data_frame_analytics', opts), - get_data_frame_analytics_stats: lazyLoad('ml.get_data_frame_analytics_stats', opts), - getDataFrameAnalyticsStats: lazyLoad('ml.get_data_frame_analytics_stats', opts), - get_datafeed_stats: lazyLoad('ml.get_datafeed_stats', opts), - getDatafeedStats: lazyLoad('ml.get_datafeed_stats', opts), - get_datafeeds: lazyLoad('ml.get_datafeeds', opts), - getDatafeeds: lazyLoad('ml.get_datafeeds', opts), - get_filters: lazyLoad('ml.get_filters', opts), - getFilters: lazyLoad('ml.get_filters', opts), - get_influencers: lazyLoad('ml.get_influencers', opts), - getInfluencers: lazyLoad('ml.get_influencers', opts), - get_job_stats: lazyLoad('ml.get_job_stats', opts), - getJobStats: lazyLoad('ml.get_job_stats', opts), - get_jobs: lazyLoad('ml.get_jobs', opts), - getJobs: lazyLoad('ml.get_jobs', opts), - get_model_snapshots: lazyLoad('ml.get_model_snapshots', opts), - getModelSnapshots: lazyLoad('ml.get_model_snapshots', opts), - get_overall_buckets: lazyLoad('ml.get_overall_buckets', opts), - getOverallBuckets: lazyLoad('ml.get_overall_buckets', opts), - get_records: lazyLoad('ml.get_records', opts), - getRecords: lazyLoad('ml.get_records', opts), - get_trained_models: lazyLoad('ml.get_trained_models', opts), - getTrainedModels: lazyLoad('ml.get_trained_models', opts), - get_trained_models_stats: lazyLoad('ml.get_trained_models_stats', opts), - getTrainedModelsStats: lazyLoad('ml.get_trained_models_stats', opts), - info: lazyLoad('ml.info', opts), - open_job: lazyLoad('ml.open_job', opts), - openJob: lazyLoad('ml.open_job', opts), - post_calendar_events: lazyLoad('ml.post_calendar_events', opts), - postCalendarEvents: lazyLoad('ml.post_calendar_events', opts), - post_data: lazyLoad('ml.post_data', opts), - postData: lazyLoad('ml.post_data', opts), - preview_datafeed: lazyLoad('ml.preview_datafeed', opts), - previewDatafeed: lazyLoad('ml.preview_datafeed', opts), - put_calendar: lazyLoad('ml.put_calendar', opts), - putCalendar: lazyLoad('ml.put_calendar', opts), - put_calendar_job: lazyLoad('ml.put_calendar_job', opts), - putCalendarJob: lazyLoad('ml.put_calendar_job', opts), - put_data_frame_analytics: lazyLoad('ml.put_data_frame_analytics', opts), - putDataFrameAnalytics: lazyLoad('ml.put_data_frame_analytics', opts), - put_datafeed: lazyLoad('ml.put_datafeed', opts), - putDatafeed: lazyLoad('ml.put_datafeed', opts), - put_filter: lazyLoad('ml.put_filter', opts), - putFilter: lazyLoad('ml.put_filter', opts), - put_job: lazyLoad('ml.put_job', opts), - putJob: lazyLoad('ml.put_job', opts), - put_trained_model: lazyLoad('ml.put_trained_model', opts), - putTrainedModel: lazyLoad('ml.put_trained_model', opts), - revert_model_snapshot: lazyLoad('ml.revert_model_snapshot', opts), - revertModelSnapshot: lazyLoad('ml.revert_model_snapshot', opts), - set_upgrade_mode: lazyLoad('ml.set_upgrade_mode', opts), - setUpgradeMode: lazyLoad('ml.set_upgrade_mode', opts), - start_data_frame_analytics: lazyLoad('ml.start_data_frame_analytics', opts), - startDataFrameAnalytics: lazyLoad('ml.start_data_frame_analytics', opts), - start_datafeed: lazyLoad('ml.start_datafeed', opts), - startDatafeed: lazyLoad('ml.start_datafeed', opts), - stop_data_frame_analytics: lazyLoad('ml.stop_data_frame_analytics', opts), - stopDataFrameAnalytics: lazyLoad('ml.stop_data_frame_analytics', opts), - stop_datafeed: lazyLoad('ml.stop_datafeed', opts), - stopDatafeed: lazyLoad('ml.stop_datafeed', opts), - update_data_frame_analytics: lazyLoad('ml.update_data_frame_analytics', opts), - updateDataFrameAnalytics: lazyLoad('ml.update_data_frame_analytics', opts), - update_datafeed: lazyLoad('ml.update_datafeed', opts), - updateDatafeed: lazyLoad('ml.update_datafeed', opts), - update_filter: lazyLoad('ml.update_filter', opts), - updateFilter: lazyLoad('ml.update_filter', opts), - update_job: lazyLoad('ml.update_job', opts), - updateJob: lazyLoad('ml.update_job', opts), - update_model_snapshot: lazyLoad('ml.update_model_snapshot', opts), - updateModelSnapshot: lazyLoad('ml.update_model_snapshot', opts), - validate: lazyLoad('ml.validate', opts), - validate_detector: lazyLoad('ml.validate_detector', opts), - validateDetector: lazyLoad('ml.validate_detector', opts) - }, - monitoring: { - bulk: lazyLoad('monitoring.bulk', opts) - }, - msearch: lazyLoad('msearch', opts), - msearch_template: lazyLoad('msearch_template', opts), - msearchTemplate: lazyLoad('msearch_template', opts), - mtermvectors: lazyLoad('mtermvectors', opts), - nodes: { - hot_threads: lazyLoad('nodes.hot_threads', opts), - hotThreads: lazyLoad('nodes.hot_threads', opts), - info: lazyLoad('nodes.info', opts), - reload_secure_settings: lazyLoad('nodes.reload_secure_settings', opts), - reloadSecureSettings: lazyLoad('nodes.reload_secure_settings', opts), - stats: lazyLoad('nodes.stats', opts), - usage: lazyLoad('nodes.usage', opts) - }, - ping: lazyLoad('ping', opts), - put_script: lazyLoad('put_script', opts), - putScript: lazyLoad('put_script', opts), - rank_eval: lazyLoad('rank_eval', opts), - rankEval: lazyLoad('rank_eval', opts), - reindex: lazyLoad('reindex', opts), - reindex_rethrottle: lazyLoad('reindex_rethrottle', opts), - reindexRethrottle: lazyLoad('reindex_rethrottle', opts), - render_search_template: lazyLoad('render_search_template', opts), - renderSearchTemplate: lazyLoad('render_search_template', opts), - rollup: { - delete_job: lazyLoad('rollup.delete_job', opts), - deleteJob: lazyLoad('rollup.delete_job', opts), - get_jobs: lazyLoad('rollup.get_jobs', opts), - getJobs: lazyLoad('rollup.get_jobs', opts), - get_rollup_caps: lazyLoad('rollup.get_rollup_caps', opts), - getRollupCaps: lazyLoad('rollup.get_rollup_caps', opts), - get_rollup_index_caps: lazyLoad('rollup.get_rollup_index_caps', opts), - getRollupIndexCaps: lazyLoad('rollup.get_rollup_index_caps', opts), - put_job: lazyLoad('rollup.put_job', opts), - putJob: lazyLoad('rollup.put_job', opts), - rollup_search: lazyLoad('rollup.rollup_search', opts), - rollupSearch: lazyLoad('rollup.rollup_search', opts), - start_job: lazyLoad('rollup.start_job', opts), - startJob: lazyLoad('rollup.start_job', opts), - stop_job: lazyLoad('rollup.stop_job', opts), - stopJob: lazyLoad('rollup.stop_job', opts) - }, - scripts_painless_execute: lazyLoad('scripts_painless_execute', opts), - scriptsPainlessExecute: lazyLoad('scripts_painless_execute', opts), - scroll: lazyLoad('scroll', opts), - search: lazyLoad('search', opts), - search_shards: lazyLoad('search_shards', opts), - searchShards: lazyLoad('search_shards', opts), - search_template: lazyLoad('search_template', opts), - searchTemplate: lazyLoad('search_template', opts), - searchable_snapshots: { - clear_cache: lazyLoad('searchable_snapshots.clear_cache', opts), - clearCache: lazyLoad('searchable_snapshots.clear_cache', opts), - mount: lazyLoad('searchable_snapshots.mount', opts), - repository_stats: lazyLoad('searchable_snapshots.repository_stats', opts), - repositoryStats: lazyLoad('searchable_snapshots.repository_stats', opts), - stats: lazyLoad('searchable_snapshots.stats', opts) - }, - searchableSnapshots: { - clear_cache: lazyLoad('searchable_snapshots.clear_cache', opts), - clearCache: lazyLoad('searchable_snapshots.clear_cache', opts), - mount: lazyLoad('searchable_snapshots.mount', opts), - repository_stats: lazyLoad('searchable_snapshots.repository_stats', opts), - repositoryStats: lazyLoad('searchable_snapshots.repository_stats', opts), - stats: lazyLoad('searchable_snapshots.stats', opts) - }, - security: { - authenticate: lazyLoad('security.authenticate', opts), - change_password: lazyLoad('security.change_password', opts), - changePassword: lazyLoad('security.change_password', opts), - clear_cached_privileges: lazyLoad('security.clear_cached_privileges', opts), - clearCachedPrivileges: lazyLoad('security.clear_cached_privileges', opts), - clear_cached_realms: lazyLoad('security.clear_cached_realms', opts), - clearCachedRealms: lazyLoad('security.clear_cached_realms', opts), - clear_cached_roles: lazyLoad('security.clear_cached_roles', opts), - clearCachedRoles: lazyLoad('security.clear_cached_roles', opts), - create_api_key: lazyLoad('security.create_api_key', opts), - createApiKey: lazyLoad('security.create_api_key', opts), - delete_privileges: lazyLoad('security.delete_privileges', opts), - deletePrivileges: lazyLoad('security.delete_privileges', opts), - delete_role: lazyLoad('security.delete_role', opts), - deleteRole: lazyLoad('security.delete_role', opts), - delete_role_mapping: lazyLoad('security.delete_role_mapping', opts), - deleteRoleMapping: lazyLoad('security.delete_role_mapping', opts), - delete_user: lazyLoad('security.delete_user', opts), - deleteUser: lazyLoad('security.delete_user', opts), - disable_user: lazyLoad('security.disable_user', opts), - disableUser: lazyLoad('security.disable_user', opts), - enable_user: lazyLoad('security.enable_user', opts), - enableUser: lazyLoad('security.enable_user', opts), - get_api_key: lazyLoad('security.get_api_key', opts), - getApiKey: lazyLoad('security.get_api_key', opts), - get_builtin_privileges: lazyLoad('security.get_builtin_privileges', opts), - getBuiltinPrivileges: lazyLoad('security.get_builtin_privileges', opts), - get_privileges: lazyLoad('security.get_privileges', opts), - getPrivileges: lazyLoad('security.get_privileges', opts), - get_role: lazyLoad('security.get_role', opts), - getRole: lazyLoad('security.get_role', opts), - get_role_mapping: lazyLoad('security.get_role_mapping', opts), - getRoleMapping: lazyLoad('security.get_role_mapping', opts), - get_token: lazyLoad('security.get_token', opts), - getToken: lazyLoad('security.get_token', opts), - get_user: lazyLoad('security.get_user', opts), - getUser: lazyLoad('security.get_user', opts), - get_user_privileges: lazyLoad('security.get_user_privileges', opts), - getUserPrivileges: lazyLoad('security.get_user_privileges', opts), - has_privileges: lazyLoad('security.has_privileges', opts), - hasPrivileges: lazyLoad('security.has_privileges', opts), - invalidate_api_key: lazyLoad('security.invalidate_api_key', opts), - invalidateApiKey: lazyLoad('security.invalidate_api_key', opts), - invalidate_token: lazyLoad('security.invalidate_token', opts), - invalidateToken: lazyLoad('security.invalidate_token', opts), - put_privileges: lazyLoad('security.put_privileges', opts), - putPrivileges: lazyLoad('security.put_privileges', opts), - put_role: lazyLoad('security.put_role', opts), - putRole: lazyLoad('security.put_role', opts), - put_role_mapping: lazyLoad('security.put_role_mapping', opts), - putRoleMapping: lazyLoad('security.put_role_mapping', opts), - put_user: lazyLoad('security.put_user', opts), - putUser: lazyLoad('security.put_user', opts) - }, - slm: { - delete_lifecycle: lazyLoad('slm.delete_lifecycle', opts), - deleteLifecycle: lazyLoad('slm.delete_lifecycle', opts), - execute_lifecycle: lazyLoad('slm.execute_lifecycle', opts), - executeLifecycle: lazyLoad('slm.execute_lifecycle', opts), - execute_retention: lazyLoad('slm.execute_retention', opts), - executeRetention: lazyLoad('slm.execute_retention', opts), - get_lifecycle: lazyLoad('slm.get_lifecycle', opts), - getLifecycle: lazyLoad('slm.get_lifecycle', opts), - get_stats: lazyLoad('slm.get_stats', opts), - getStats: lazyLoad('slm.get_stats', opts), - get_status: lazyLoad('slm.get_status', opts), - getStatus: lazyLoad('slm.get_status', opts), - put_lifecycle: lazyLoad('slm.put_lifecycle', opts), - putLifecycle: lazyLoad('slm.put_lifecycle', opts), - start: lazyLoad('slm.start', opts), - stop: lazyLoad('slm.stop', opts) - }, - snapshot: { - cleanup_repository: lazyLoad('snapshot.cleanup_repository', opts), - cleanupRepository: lazyLoad('snapshot.cleanup_repository', opts), - create: lazyLoad('snapshot.create', opts), - create_repository: lazyLoad('snapshot.create_repository', opts), - createRepository: lazyLoad('snapshot.create_repository', opts), - delete: lazyLoad('snapshot.delete', opts), - delete_repository: lazyLoad('snapshot.delete_repository', opts), - deleteRepository: lazyLoad('snapshot.delete_repository', opts), - get: lazyLoad('snapshot.get', opts), - get_repository: lazyLoad('snapshot.get_repository', opts), - getRepository: lazyLoad('snapshot.get_repository', opts), - restore: lazyLoad('snapshot.restore', opts), - status: lazyLoad('snapshot.status', opts), - verify_repository: lazyLoad('snapshot.verify_repository', opts), - verifyRepository: lazyLoad('snapshot.verify_repository', opts) - }, - sql: { - clear_cursor: lazyLoad('sql.clear_cursor', opts), - clearCursor: lazyLoad('sql.clear_cursor', opts), - query: lazyLoad('sql.query', opts), - translate: lazyLoad('sql.translate', opts) - }, - ssl: { - certificates: lazyLoad('ssl.certificates', opts) - }, - tasks: { - cancel: lazyLoad('tasks.cancel', opts), - get: lazyLoad('tasks.get', opts), - list: lazyLoad('tasks.list', opts) - }, - termvectors: lazyLoad('termvectors', opts), - transform: { - delete_transform: lazyLoad('transform.delete_transform', opts), - deleteTransform: lazyLoad('transform.delete_transform', opts), - get_transform: lazyLoad('transform.get_transform', opts), - getTransform: lazyLoad('transform.get_transform', opts), - get_transform_stats: lazyLoad('transform.get_transform_stats', opts), - getTransformStats: lazyLoad('transform.get_transform_stats', opts), - preview_transform: lazyLoad('transform.preview_transform', opts), - previewTransform: lazyLoad('transform.preview_transform', opts), - put_transform: lazyLoad('transform.put_transform', opts), - putTransform: lazyLoad('transform.put_transform', opts), - start_transform: lazyLoad('transform.start_transform', opts), - startTransform: lazyLoad('transform.start_transform', opts), - stop_transform: lazyLoad('transform.stop_transform', opts), - stopTransform: lazyLoad('transform.stop_transform', opts), - update_transform: lazyLoad('transform.update_transform', opts), - updateTransform: lazyLoad('transform.update_transform', opts) - }, - update: lazyLoad('update', opts), - update_by_query: lazyLoad('update_by_query', opts), - updateByQuery: lazyLoad('update_by_query', opts), - update_by_query_rethrottle: lazyLoad('update_by_query_rethrottle', opts), - updateByQueryRethrottle: lazyLoad('update_by_query_rethrottle', opts), - watcher: { - ack_watch: lazyLoad('watcher.ack_watch', opts), - ackWatch: lazyLoad('watcher.ack_watch', opts), - activate_watch: lazyLoad('watcher.activate_watch', opts), - activateWatch: lazyLoad('watcher.activate_watch', opts), - deactivate_watch: lazyLoad('watcher.deactivate_watch', opts), - deactivateWatch: lazyLoad('watcher.deactivate_watch', opts), - delete_watch: lazyLoad('watcher.delete_watch', opts), - deleteWatch: lazyLoad('watcher.delete_watch', opts), - execute_watch: lazyLoad('watcher.execute_watch', opts), - executeWatch: lazyLoad('watcher.execute_watch', opts), - get_watch: lazyLoad('watcher.get_watch', opts), - getWatch: lazyLoad('watcher.get_watch', opts), - put_watch: lazyLoad('watcher.put_watch', opts), - putWatch: lazyLoad('watcher.put_watch', opts), - start: lazyLoad('watcher.start', opts), - stats: lazyLoad('watcher.stats', opts), - stop: lazyLoad('watcher.stop', opts) - }, - xpack: { - info: lazyLoad('xpack.info', opts), - usage: lazyLoad('xpack.usage', opts) -======= Object.defineProperties(ESAPI.prototype, { cat: { get () { @@ -828,7 +179,6 @@ Object.defineProperties(ESAPI.prototype, { this[kCat] = new CatApi(this.transport, this[kConfigurationError]) } return this[kCat] ->>>>>>> a064f0f3... Improve child performances (#1314) } }, clear_scroll: { get () { return this.clearScroll } }, @@ -933,7 +283,6 @@ Object.defineProperties(ESAPI.prototype, { return this[kCcr] } }, - close_point_in_time: { get () { return this.closePointInTime } }, enrich: { get () { if (this[kEnrich] === null) { @@ -998,7 +347,6 @@ Object.defineProperties(ESAPI.prototype, { return this[kMonitoring] } }, - open_point_in_time: { get () { return this.openPointInTime } }, rollup: { get () { if (this[kRollup] === null) { diff --git a/api/requestParams.d.ts b/api/requestParams.d.ts index 7d38f7843..ad6622ab5 100644 --- a/api/requestParams.d.ts +++ b/api/requestParams.d.ts @@ -63,7 +63,7 @@ export interface AsyncSearchSubmit extends Generic { suggest_text?: string; timeout?: string; track_scores?: boolean; - track_total_hits?: boolean | number; + track_total_hits?: boolean; allow_partial_search_results?: boolean; typed_keys?: boolean; version?: boolean; @@ -202,7 +202,6 @@ export interface CatMlDataFrameAnalytics extends Generic { export interface CatMlDatafeeds extends Generic { datafeed_id?: string; - allow_no_match?: boolean; allow_no_datafeeds?: boolean; format?: string; h?: string | string[]; @@ -214,7 +213,6 @@ export interface CatMlDatafeeds extends Generic { export interface CatMlJobs extends Generic { job_id?: string; - allow_no_match?: boolean; allow_no_jobs?: boolean; bytes?: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb'; format?: string; @@ -451,10 +449,6 @@ export interface ClearScroll extends Generic { body?: T; } -export interface ClosePointInTime extends Generic { - body?: T; -} - export interface ClusterAllocationExplain extends Generic { include_yes_decisions?: boolean; include_disk_info?: boolean; @@ -831,30 +825,12 @@ export interface GetSource extends Generic { version_type?: 'internal' | 'external' | 'external_gte' | 'force'; } -<<<<<<< HEAD -export interface Index extends Generic { - id?: string; - index: string; - type?: string; - wait_for_active_shards?: string; - op_type?: 'index' | 'create'; - refresh?: 'wait_for' | boolean; -======= export interface GraphExplore extends Generic { index: string | string[]; ->>>>>>> a064f0f3... Improve child performances (#1314) + type?: string | string[]; routing?: string; timeout?: string; -<<<<<<< HEAD - version?: number; - version_type?: 'internal' | 'external' | 'external_gte'; - if_seq_no?: number; - if_primary_term?: number; - pipeline?: string; - body: T; -======= body?: T; ->>>>>>> 3db1bed4... Improve child performances (#1314) } export interface IlmDeleteLifecycle extends Generic { @@ -901,6 +877,7 @@ export interface IlmStop extends Generic { export interface Index extends Generic { id?: string; index: string; + type?: string; wait_for_active_shards?: string; op_type?: 'index' | 'create'; refresh?: 'wait_for' | boolean; @@ -911,7 +888,6 @@ export interface Index extends Generic { if_seq_no?: number; if_primary_term?: number; pipeline?: string; - require_alias?: boolean; body: T; } @@ -1449,777 +1425,6 @@ export interface Mget extends Generic { body: T; } -<<<<<<< HEAD -export interface Msearch extends Generic { - index?: string | string[]; - type?: string | string[]; - search_type?: 'query_then_fetch' | 'query_and_fetch' | 'dfs_query_then_fetch' | 'dfs_query_and_fetch'; - max_concurrent_searches?: number; - typed_keys?: boolean; - pre_filter_shard_size?: number; - max_concurrent_shard_requests?: number; - rest_total_hits_as_int?: boolean; - ccs_minimize_roundtrips?: boolean; - body: T; -} - -export interface MsearchTemplate extends Generic { - index?: string | string[]; - type?: string | string[]; - search_type?: 'query_then_fetch' | 'query_and_fetch' | 'dfs_query_then_fetch' | 'dfs_query_and_fetch'; - typed_keys?: boolean; - max_concurrent_searches?: number; - rest_total_hits_as_int?: boolean; - ccs_minimize_roundtrips?: boolean; - body: T; -} - -export interface Mtermvectors extends Generic { - index?: string; - type?: string; - ids?: string | string[]; - term_statistics?: boolean; - field_statistics?: boolean; - fields?: string | string[]; - offsets?: boolean; - positions?: boolean; - payloads?: boolean; - preference?: string; - routing?: string; - realtime?: boolean; - version?: number; - version_type?: 'internal' | 'external' | 'external_gte' | 'force'; - body?: T; -======= -export interface MigrationDeprecations extends Generic { - index?: string; -} - -export interface MlCloseJob extends Generic { - job_id: string; - allow_no_match?: boolean; - allow_no_jobs?: boolean; - force?: boolean; - timeout?: string; - body?: T; -} - -export interface MlDeleteCalendar extends Generic { - calendar_id: string; ->>>>>>> a064f0f3... Improve child performances (#1314) -} - -export interface MlDeleteCalendarEvent extends Generic { - calendar_id: string; - event_id: string; -} - -export interface MlDeleteCalendarJob extends Generic { - calendar_id: string; - job_id: string; -} - -export interface MlDeleteDataFrameAnalytics extends Generic { - id: string; - force?: boolean; - timeout?: string; -} - -export interface MlDeleteDatafeed extends Generic { - datafeed_id: string; - force?: boolean; -} - -export interface MlDeleteExpiredData extends Generic { - job_id?: string; - requests_per_second?: number; - timeout?: string; - body?: T; -} - -export interface MlDeleteFilter extends Generic { - filter_id: string; -} - -export interface MlDeleteForecast extends Generic { - job_id: string; - forecast_id?: string; - allow_no_forecasts?: boolean; - timeout?: string; -} - -export interface MlDeleteJob extends Generic { - job_id: string; - force?: boolean; - wait_for_completion?: boolean; -} - -export interface MlDeleteModelSnapshot extends Generic { - job_id: string; - snapshot_id: string; -} - -export interface MlDeleteTrainedModel extends Generic { - model_id: string; -} - -export interface MlEstimateModelMemory extends Generic { - body: T; -} - -<<<<<<< HEAD -export interface RankEval extends Generic { - index?: string | string[]; - ignore_unavailable?: boolean; - allow_no_indices?: boolean; - expand_wildcards?: 'open' | 'closed' | 'hidden' | 'none' | 'all'; - search_type?: 'query_then_fetch' | 'dfs_query_then_fetch'; - body: T; -} - -export interface Reindex extends Generic { - refresh?: boolean; - timeout?: string; - wait_for_active_shards?: string; - wait_for_completion?: boolean; - requests_per_second?: number; - scroll?: string; - slices?: number|string; - max_docs?: number; - body: T; -} - -export interface ReindexRethrottle extends Generic { - task_id: string; - requests_per_second: number; -} - -export interface RenderSearchTemplate extends Generic { - id?: string; - body?: T; -} - -export interface ScriptsPainlessExecute extends Generic { - body?: T; -} - -export interface Scroll extends Generic { - scroll_id?: string; - scroll?: string; - rest_total_hits_as_int?: boolean; - body?: T; -} - -export interface Search extends Generic { - index?: string | string[]; - type?: string | string[]; - _source_exclude?: string | string[]; - _source_include?: string | string[]; - analyzer?: string; - analyze_wildcard?: boolean; - ccs_minimize_roundtrips?: boolean; - default_operator?: 'AND' | 'OR'; - df?: string; - explain?: boolean; - stored_fields?: string | string[]; - docvalue_fields?: string | string[]; - from?: number; - ignore_unavailable?: boolean; - ignore_throttled?: boolean; - allow_no_indices?: boolean; - expand_wildcards?: 'open' | 'closed' | 'hidden' | 'none' | 'all'; - lenient?: boolean; - preference?: string; - q?: string; - routing?: string | string[]; - scroll?: string; - search_type?: 'query_then_fetch' | 'dfs_query_then_fetch'; - size?: number; - sort?: string | string[]; - _source?: string | string[]; - _source_excludes?: string | string[]; - _source_includes?: string | string[]; - terminate_after?: number; - stats?: string | string[]; - suggest_field?: string; - suggest_mode?: 'missing' | 'popular' | 'always'; - suggest_size?: number; - suggest_text?: string; - timeout?: string; - track_scores?: boolean; - track_total_hits?: boolean; - allow_partial_search_results?: boolean; - typed_keys?: boolean; - version?: boolean; - seq_no_primary_term?: boolean; - request_cache?: boolean; - batched_reduce_size?: number; - max_concurrent_shard_requests?: number; - pre_filter_shard_size?: number; - rest_total_hits_as_int?: boolean; - body?: T; -} - -export interface SearchShards extends Generic { - index?: string | string[]; - preference?: string; - routing?: string; - local?: boolean; - ignore_unavailable?: boolean; - allow_no_indices?: boolean; - expand_wildcards?: 'open' | 'closed' | 'hidden' | 'none' | 'all'; -} - -export interface SearchTemplate extends Generic { - index?: string | string[]; - type?: string | string[]; - ignore_unavailable?: boolean; - ignore_throttled?: boolean; - allow_no_indices?: boolean; - expand_wildcards?: 'open' | 'closed' | 'hidden' | 'none' | 'all'; - preference?: string; - routing?: string | string[]; - scroll?: string; - search_type?: 'query_then_fetch' | 'query_and_fetch' | 'dfs_query_then_fetch' | 'dfs_query_and_fetch'; - explain?: boolean; - profile?: boolean; - typed_keys?: boolean; - rest_total_hits_as_int?: boolean; - ccs_minimize_roundtrips?: boolean; - body: T; -} - -export interface SnapshotCleanupRepository extends Generic { - repository: string; - master_timeout?: string; - timeout?: string; -} - -export interface SnapshotCreate extends Generic { - repository: string; - snapshot: string; - master_timeout?: string; - wait_for_completion?: boolean; - body?: T; -} - -export interface SnapshotCreateRepository extends Generic { - repository: string; - master_timeout?: string; - timeout?: string; - verify?: boolean; - body: T; -} - -export interface SnapshotDelete extends Generic { - repository: string; - snapshot: string; - master_timeout?: string; -} - -export interface SnapshotDeleteRepository extends Generic { - repository: string | string[]; - master_timeout?: string; - timeout?: string; -} - -export interface SnapshotGet extends Generic { - repository: string; - snapshot: string | string[]; - master_timeout?: string; - ignore_unavailable?: boolean; - verbose?: boolean; -} - -export interface SnapshotGetRepository extends Generic { - repository?: string | string[]; - master_timeout?: string; - local?: boolean; -} - -export interface SnapshotRestore extends Generic { - repository: string; - snapshot: string; - master_timeout?: string; - wait_for_completion?: boolean; - body?: T; -} - -export interface SnapshotStatus extends Generic { - repository?: string; - snapshot?: string | string[]; - master_timeout?: string; - ignore_unavailable?: boolean; -} - -export interface SnapshotVerifyRepository extends Generic { - repository: string; - master_timeout?: string; - timeout?: string; -} - -export interface TasksCancel extends Generic { - task_id?: string; - nodes?: string | string[]; - actions?: string | string[]; - parent_task_id?: string; - wait_for_completion?: boolean; -} - -export interface TasksGet extends Generic { - task_id: string; - wait_for_completion?: boolean; - timeout?: string; -} - -export interface TasksList extends Generic { - nodes?: string | string[]; - actions?: string | string[]; - detailed?: boolean; - parent_task_id?: string; - wait_for_completion?: boolean; - group_by?: 'nodes' | 'parents' | 'none'; - timeout?: string; -} - -export interface Termvectors extends Generic { - index: string; - id?: string; - type?: string; - term_statistics?: boolean; - field_statistics?: boolean; - fields?: string | string[]; - offsets?: boolean; - positions?: boolean; - payloads?: boolean; - preference?: string; - routing?: string; - realtime?: boolean; - version?: number; - version_type?: 'internal' | 'external' | 'external_gte' | 'force'; - body?: T; -} - -export interface Update extends Generic { - id: string; - index: string; - type?: string; - _source_exclude?: string | string[]; - _source_include?: string | string[]; - wait_for_active_shards?: string; - _source?: string | string[]; - _source_excludes?: string | string[]; - _source_includes?: string | string[]; - lang?: string; - refresh?: 'wait_for' | boolean; - retry_on_conflict?: number; - routing?: string; - timeout?: string; - if_seq_no?: number; - if_primary_term?: number; - body: T; -} - -export interface UpdateByQuery extends Generic { - index: string | string[]; - type?: string | string[]; - _source_exclude?: string | string[]; - _source_include?: string | string[]; - analyzer?: string; - analyze_wildcard?: boolean; - default_operator?: 'AND' | 'OR'; - df?: string; - from?: number; - ignore_unavailable?: boolean; - allow_no_indices?: boolean; - conflicts?: 'abort' | 'proceed'; - expand_wildcards?: 'open' | 'closed' | 'hidden' | 'none' | 'all'; - lenient?: boolean; - pipeline?: string; - preference?: string; - q?: string; - routing?: string | string[]; - scroll?: string; - search_type?: 'query_then_fetch' | 'dfs_query_then_fetch'; - search_timeout?: string; - size?: number; - max_docs?: number; - sort?: string | string[]; - _source?: string | string[]; - _source_excludes?: string | string[]; - _source_includes?: string | string[]; - terminate_after?: number; - stats?: string | string[]; - version?: boolean; - version_type?: boolean; - request_cache?: boolean; - refresh?: boolean; - timeout?: string; - wait_for_active_shards?: string; - scroll_size?: number; - wait_for_completion?: boolean; - requests_per_second?: number; - slices?: number|string; - body?: T; -} - -export interface UpdateByQueryRethrottle extends Generic { - task_id: string; - requests_per_second: number; -} - -export interface AsyncSearchDelete extends Generic { - id: string; -} - -export interface AsyncSearchGet extends Generic { - id: string; - wait_for_completion_timeout?: string; - keep_alive?: string; - typed_keys?: boolean; -} - -export interface AsyncSearchSubmit extends Generic { - index?: string | string[]; - _source_exclude?: string | string[]; - _source_include?: string | string[]; - wait_for_completion_timeout?: string; - keep_on_completion?: boolean; - keep_alive?: string; - batched_reduce_size?: number; - request_cache?: boolean; - analyzer?: string; - analyze_wildcard?: boolean; - default_operator?: 'AND' | 'OR'; - df?: string; - explain?: boolean; - stored_fields?: string | string[]; - docvalue_fields?: string | string[]; - from?: number; - ignore_unavailable?: boolean; - ignore_throttled?: boolean; - allow_no_indices?: boolean; - expand_wildcards?: 'open' | 'closed' | 'hidden' | 'none' | 'all'; - lenient?: boolean; - preference?: string; - q?: string; - routing?: string | string[]; - search_type?: 'query_then_fetch' | 'dfs_query_then_fetch'; - size?: number; - sort?: string | string[]; - _source?: string | string[]; - _source_excludes?: string | string[]; - _source_includes?: string | string[]; - terminate_after?: number; - stats?: string | string[]; - suggest_field?: string; - suggest_mode?: 'missing' | 'popular' | 'always'; - suggest_size?: number; - suggest_text?: string; - timeout?: string; - track_scores?: boolean; - track_total_hits?: boolean; - allow_partial_search_results?: boolean; - typed_keys?: boolean; - version?: boolean; - seq_no_primary_term?: boolean; - max_concurrent_shard_requests?: number; - body?: T; -} - -export interface AutoscalingDeleteAutoscalingPolicy extends Generic { - name: string; -} - -export interface AutoscalingGetAutoscalingDecision extends Generic { -} - -export interface AutoscalingGetAutoscalingPolicy extends Generic { - name: string; -} - -export interface AutoscalingPutAutoscalingPolicy extends Generic { - name: string; - body: T; -} - -export interface CatMlDataFrameAnalytics extends Generic { - id?: string; - allow_no_match?: boolean; - bytes?: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb'; - format?: string; - h?: string | string[]; - help?: boolean; - s?: string | string[]; - time?: 'd' | 'h' | 'm' | 's' | 'ms' | 'micros' | 'nanos'; - v?: boolean; -} - -export interface CatMlDatafeeds extends Generic { - datafeed_id?: string; - allow_no_datafeeds?: boolean; - format?: string; - h?: string | string[]; - help?: boolean; - s?: string | string[]; - time?: 'd' | 'h' | 'm' | 's' | 'ms' | 'micros' | 'nanos'; - v?: boolean; -} - -export interface CatMlJobs extends Generic { - job_id?: string; - allow_no_jobs?: boolean; - bytes?: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb'; - format?: string; - h?: string | string[]; - help?: boolean; - s?: string | string[]; - time?: 'd' | 'h' | 'm' | 's' | 'ms' | 'micros' | 'nanos'; - v?: boolean; -} - -export interface CatMlTrainedModels extends Generic { - model_id?: string; - allow_no_match?: boolean; - from?: number; - size?: number; - bytes?: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb'; - format?: string; - h?: string | string[]; - help?: boolean; - s?: string | string[]; - time?: 'd' | 'h' | 'm' | 's' | 'ms' | 'micros' | 'nanos'; - v?: boolean; -} - -export interface CatTransforms extends Generic { - transform_id?: string; - from?: number; - size?: number; - allow_no_match?: boolean; - format?: string; - h?: string | string[]; - help?: boolean; - s?: string | string[]; - time?: 'd' | 'h' | 'm' | 's' | 'ms' | 'micros' | 'nanos'; - v?: boolean; -} - -export interface CcrDeleteAutoFollowPattern extends Generic { - name: string; -} - -export interface CcrFollow extends Generic { - index: string; - wait_for_active_shards?: string; - body: T; -} - -export interface CcrFollowInfo extends Generic { - index: string | string[]; -} - -export interface CcrFollowStats extends Generic { - index: string | string[]; -} - -export interface CcrForgetFollower extends Generic { - index: string; - body: T; -} - -export interface CcrGetAutoFollowPattern extends Generic { - name?: string; -} - -export interface CcrPauseAutoFollowPattern extends Generic { - name: string; -} - -export interface CcrPauseFollow extends Generic { - index: string; -} - -export interface CcrPutAutoFollowPattern extends Generic { - name: string; - body: T; -} - -export interface CcrResumeAutoFollowPattern extends Generic { - name: string; -} - -export interface CcrResumeFollow extends Generic { - index: string; - body?: T; -} - -export interface CcrStats extends Generic { -} - -export interface CcrUnfollow extends Generic { - index: string; -} - -export interface EnrichDeletePolicy extends Generic { - name: string; -} - -export interface EnrichExecutePolicy extends Generic { - name: string; - wait_for_completion?: boolean; -} - -export interface EnrichGetPolicy extends Generic { - name?: string | string[]; -} - -export interface EnrichPutPolicy extends Generic { - name: string; - body: T; -} - -export interface EnrichStats extends Generic { -} - -export interface EqlDelete extends Generic { - id: string; -} - -export interface EqlGet extends Generic { - id: string; - wait_for_completion_timeout?: string; - keep_alive?: string; -} - -export interface EqlSearch extends Generic { - index: string; - wait_for_completion_timeout?: string; - keep_on_completion?: boolean; - keep_alive?: string; - body: T; -} - -export interface GraphExplore extends Generic { - index: string | string[]; - type?: string | string[]; - routing?: string; - timeout?: string; - body?: T; -} - -export interface IlmDeleteLifecycle extends Generic { - policy: string; -} - -export interface IlmExplainLifecycle extends Generic { - index: string; - only_managed?: boolean; - only_errors?: boolean; -} - -export interface IlmGetLifecycle extends Generic { - policy?: string; -} - -export interface IlmGetStatus extends Generic { -} - -export interface IlmMoveToStep extends Generic { - index: string; - body?: T; -} - -export interface IlmPutLifecycle extends Generic { - policy: string; - body?: T; -} - -export interface IlmRemovePolicy extends Generic { - index: string; -} - -export interface IlmRetry extends Generic { - index: string; -} - -export interface IlmStart extends Generic { -} - -export interface IlmStop extends Generic { -} - -export interface IndicesCreateDataStream extends Generic { - name: string; -} - -export interface IndicesDataStreamsStats extends Generic { - name?: string | string[]; -} - -export interface IndicesDeleteDataStream extends Generic { - name: string | string[]; -} - -export interface IndicesFreeze extends Generic { - index: string; - timeout?: string; - master_timeout?: string; - ignore_unavailable?: boolean; - allow_no_indices?: boolean; - expand_wildcards?: 'open' | 'closed' | 'hidden' | 'none' | 'all'; - wait_for_active_shards?: string; -} - -export interface IndicesGetDataStream extends Generic { - name?: string | string[]; -} - -export interface IndicesReloadSearchAnalyzers extends Generic { - index: string | string[]; - ignore_unavailable?: boolean; - allow_no_indices?: boolean; - expand_wildcards?: 'open' | 'closed' | 'hidden' | 'none' | 'all'; -} - -export interface IndicesUnfreeze extends Generic { - index: string; - timeout?: string; - master_timeout?: string; - ignore_unavailable?: boolean; - allow_no_indices?: boolean; - expand_wildcards?: 'open' | 'closed' | 'hidden' | 'none' | 'all'; - wait_for_active_shards?: string; -} - -export interface LicenseDelete extends Generic { -} - -export interface LicenseGet extends Generic { - local?: boolean; - accept_enterprise?: boolean; -} - -export interface LicenseGetBasicStatus extends Generic { -} - -export interface LicenseGetTrialStatus extends Generic { -} - -export interface LicensePost extends Generic { - acknowledge?: boolean; - body?: T; -} - -export interface LicensePostStartBasic extends Generic { - acknowledge?: boolean; -} - -export interface LicensePostStartTrial extends Generic { - type?: string; - acknowledge?: boolean; -} - export interface MigrationDeprecations extends Generic { index?: string; } @@ -2294,8 +1499,6 @@ export interface MlEstimateModelMemory extends Generic { body: T; } -======= ->>>>>>> a064f0f3... Improve child performances (#1314) export interface MlEvaluateDataFrame extends Generic { body: T; } @@ -2473,7 +1676,7 @@ export interface MlGetRecords extends Generic { export interface MlGetTrainedModels extends Generic { model_id?: string; allow_no_match?: boolean; - include?: string; + include_model_definition?: boolean; decompress_definition?: boolean; from?: number; size?: number; @@ -2637,12 +1840,9 @@ export interface MonitoringBulk extends Generic { body: T; } -<<<<<<< HEAD -export interface RollupDeleteJob extends Generic { - id: string; -======= export interface Msearch extends Generic { index?: string | string[]; + type?: string | string[]; search_type?: 'query_then_fetch' | 'query_and_fetch' | 'dfs_query_then_fetch' | 'dfs_query_and_fetch'; max_concurrent_searches?: number; typed_keys?: boolean; @@ -2651,11 +1851,11 @@ export interface Msearch extends Generic { rest_total_hits_as_int?: boolean; ccs_minimize_roundtrips?: boolean; body: T; ->>>>>>> 3db1bed4... Improve child performances (#1314) } export interface MsearchTemplate extends Generic { index?: string | string[]; + type?: string | string[]; search_type?: 'query_then_fetch' | 'query_and_fetch' | 'dfs_query_then_fetch' | 'dfs_query_and_fetch'; typed_keys?: boolean; max_concurrent_searches?: number; @@ -2666,6 +1866,7 @@ export interface MsearchTemplate extends Generic { export interface Mtermvectors extends Generic { index?: string; + type?: string; ids?: string | string[]; term_statistics?: boolean; field_statistics?: boolean; @@ -2677,7 +1878,7 @@ export interface Mtermvectors extends Generic { routing?: string; realtime?: boolean; version?: number; - version_type?: 'internal' | 'external' | 'external_gte'; + version_type?: 'internal' | 'external' | 'external_gte' | 'force'; body?: T; } @@ -2724,15 +1925,6 @@ export interface NodesUsage extends Generic { timeout?: string; } -export interface OpenPointInTime extends Generic { - index?: string | string[]; - preference?: string; - routing?: string; - ignore_unavailable?: boolean; - expand_wildcards?: 'open' | 'closed' | 'hidden' | 'none' | 'all'; - keep_alive?: string; -} - export interface Ping extends Generic { } @@ -2827,6 +2019,7 @@ export interface Scroll extends Generic { export interface Search extends Generic { index?: string | string[]; + type?: string | string[]; _source_exclude?: string | string[]; _source_include?: string | string[]; analyzer?: string; @@ -2861,7 +2054,7 @@ export interface Search extends Generic { suggest_text?: string; timeout?: string; track_scores?: boolean; - track_total_hits?: boolean | number; + track_total_hits?: boolean; allow_partial_search_results?: boolean; typed_keys?: boolean; version?: boolean; @@ -2886,6 +2079,7 @@ export interface SearchShards extends Generic { export interface SearchTemplate extends Generic { index?: string | string[]; + type?: string | string[]; ignore_unavailable?: boolean; ignore_throttled?: boolean; allow_no_indices?: boolean; @@ -3110,7 +2304,7 @@ export interface SnapshotCreateRepository extends Generic { export interface SnapshotDelete extends Generic { repository: string; - snapshot: string | string[]; + snapshot: string; master_timeout?: string; } @@ -3198,6 +2392,7 @@ export interface TasksList extends Generic { export interface Termvectors extends Generic { index: string; id?: string; + type?: string; term_statistics?: boolean; field_statistics?: boolean; fields?: string | string[]; @@ -3208,7 +2403,7 @@ export interface Termvectors extends Generic { routing?: string; realtime?: boolean; version?: number; - version_type?: 'internal' | 'external' | 'external_gte'; + version_type?: 'internal' | 'external' | 'external_gte' | 'force'; body?: T; } @@ -3278,12 +2473,12 @@ export interface Update extends Generic { timeout?: string; if_seq_no?: number; if_primary_term?: number; - require_alias?: boolean; body: T; } export interface UpdateByQuery extends Generic { index: string | string[]; + type?: string | string[]; _source_exclude?: string | string[]; _source_include?: string | string[]; analyzer?: string; @@ -3303,6 +2498,7 @@ export interface UpdateByQuery extends Generic { scroll?: string; search_type?: 'query_then_fetch' | 'dfs_query_then_fetch'; search_timeout?: string; + size?: number; max_docs?: number; sort?: string | string[]; _source?: string | string[]; diff --git a/docs/reference.asciidoc b/docs/reference.asciidoc index 46fb6bfd9..80313bcca 100644 --- a/docs/reference.asciidoc +++ b/docs/reference.asciidoc @@ -95,677 +95,7 @@ link:{ref}/common-options.html[Documentation] |`list` - A comma-separated list of filters used to reduce the response. |=== -<<<<<<< HEAD -=== bulk - -[source,ts] ----- -client.bulk({ - index: string, - type: string, - wait_for_active_shards: string, - refresh: 'true' | 'false' | 'wait_for', - routing: string, - timeout: string, - _source: string | string[], - _source_excludes: string | string[], - _source_includes: string | string[], - pipeline: string, - body: object -}) ----- -link:{ref}/docs-bulk.html[Documentation] + -{jsclient}/bulk_examples.html[Code Example] + -[cols=2*] -|=== -|`index` -|`string` - Default index for items which don't provide one - -|`type` -|`string` - Default document type for items which don't provide one - -|`wait_for_active_shards` or `waitForActiveShards` -|`string` - Sets the number of shard copies that must be active before proceeding with the bulk operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - -|`refresh` -|`'true' \| 'false' \| 'wait_for'` - If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - -|`routing` -|`string` - Specific routing value - -|`timeout` -|`string` - Explicit operation timeout - -|`_source` -|`string \| string[]` - True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request - -|`_source_excludes` or `_sourceExcludes` -|`string \| string[]` - Default list of fields to exclude from the returned _source field, can be overridden on each sub-request - -|`_source_includes` or `_sourceIncludes` -|`string \| string[]` - Default list of fields to extract and return from the _source field, can be overridden on each sub-request - -|`pipeline` -|`string` - The pipeline id to preprocess incoming documents with - -|`body` -|`object` - The operation definition and data (action-data pairs), separated by newlines - -|=== - -=== cat.aliases - -[source,ts] ----- -client.cat.aliases({ - name: string | string[], - format: string, - local: boolean, - h: string | string[], - help: boolean, - s: string | string[], - v: boolean, - expand_wildcards: 'open' | 'closed' | 'hidden' | 'none' | 'all' -}) ----- -link:{ref}/cat-alias.html[Documentation] + -[cols=2*] -|=== -|`name` -|`string \| string[]` - A comma-separated list of alias names to return - -|`format` -|`string` - a short version of the Accept header, e.g. json, yaml - -|`local` -|`boolean` - Return local information, do not retrieve the state from master node (default: false) - -|`h` -|`string \| string[]` - Comma-separated list of column names to display - -|`help` -|`boolean` - Return help information - -|`s` -|`string \| string[]` - Comma-separated list of column names or column aliases to sort by - -|`v` -|`boolean` - Verbose mode. Display column headers - -|`expand_wildcards` or `expandWildcards` -|`'open' \| 'closed' \| 'hidden' \| 'none' \| 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. + -_Default:_ `all` - -|=== - -=== cat.allocation - -[source,ts] ----- -client.cat.allocation({ - node_id: string | string[], - format: string, - bytes: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb', - local: boolean, - master_timeout: string, - h: string | string[], - help: boolean, - s: string | string[], - v: boolean -}) ----- -link:{ref}/cat-allocation.html[Documentation] + -[cols=2*] -|=== -|`node_id` or `nodeId` -|`string \| string[]` - A comma-separated list of node IDs or names to limit the returned information - -|`format` -|`string` - a short version of the Accept header, e.g. json, yaml - -|`bytes` -|`'b' \| 'k' \| 'kb' \| 'm' \| 'mb' \| 'g' \| 'gb' \| 't' \| 'tb' \| 'p' \| 'pb'` - The unit in which to display byte values - -|`local` -|`boolean` - Return local information, do not retrieve the state from master node (default: false) - -|`master_timeout` or `masterTimeout` -|`string` - Explicit operation timeout for connection to master node - -|`h` -|`string \| string[]` - Comma-separated list of column names to display - -|`help` -|`boolean` - Return help information - -|`s` -|`string \| string[]` - Comma-separated list of column names or column aliases to sort by - -|`v` -|`boolean` - Verbose mode. Display column headers - -|=== - -=== cat.count - -[source,ts] ----- -client.cat.count({ - index: string | string[], - format: string, - h: string | string[], - help: boolean, - s: string | string[], - v: boolean -}) ----- -link:{ref}/cat-count.html[Documentation] + -[cols=2*] -|=== -|`index` -|`string \| string[]` - A comma-separated list of index names to limit the returned information - -|`format` -|`string` - a short version of the Accept header, e.g. json, yaml - -|`h` -|`string \| string[]` - Comma-separated list of column names to display - -|`help` -|`boolean` - Return help information - -|`s` -|`string \| string[]` - Comma-separated list of column names or column aliases to sort by - -|`v` -|`boolean` - Verbose mode. Display column headers - -|=== - -=== cat.fielddata - -[source,ts] ----- -client.cat.fielddata({ - fields: string | string[], - format: string, - bytes: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb', - h: string | string[], - help: boolean, - s: string | string[], - v: boolean -}) ----- -link:{ref}/cat-fielddata.html[Documentation] + -[cols=2*] -|=== -|`fields` -|`string \| string[]` - A comma-separated list of fields to return the fielddata size - -|`format` -|`string` - a short version of the Accept header, e.g. json, yaml - -|`bytes` -|`'b' \| 'k' \| 'kb' \| 'm' \| 'mb' \| 'g' \| 'gb' \| 't' \| 'tb' \| 'p' \| 'pb'` - The unit in which to display byte values - -|`h` -|`string \| string[]` - Comma-separated list of column names to display - -|`help` -|`boolean` - Return help information - -|`s` -|`string \| string[]` - Comma-separated list of column names or column aliases to sort by - -|`v` -|`boolean` - Verbose mode. Display column headers - -|=== - -=== cat.health - -[source,ts] ----- -client.cat.health({ - format: string, - h: string | string[], - help: boolean, - s: string | string[], - time: 'd' | 'h' | 'm' | 's' | 'ms' | 'micros' | 'nanos', - ts: boolean, - v: boolean -}) ----- -link:{ref}/cat-health.html[Documentation] + -[cols=2*] -|=== -|`format` -|`string` - a short version of the Accept header, e.g. json, yaml - -|`h` -|`string \| string[]` - Comma-separated list of column names to display - -|`help` -|`boolean` - Return help information - -|`s` -|`string \| string[]` - Comma-separated list of column names or column aliases to sort by - -|`time` -|`'d' \| 'h' \| 'm' \| 's' \| 'ms' \| 'micros' \| 'nanos'` - The unit in which to display time values - -|`ts` -|`boolean` - Set to false to disable timestamping + -_Default:_ `true` - -|`v` -|`boolean` - Verbose mode. Display column headers - -|=== - -=== cat.help - -[source,ts] ----- -client.cat.help({ - help: boolean, - s: string | string[] -}) ----- -link:{ref}/cat.html[Documentation] + -[cols=2*] -|=== -|`help` -|`boolean` - Return help information - -|`s` -|`string \| string[]` - Comma-separated list of column names or column aliases to sort by - -|=== - -=== cat.indices - -[source,ts] ----- -client.cat.indices({ - index: string | string[], - format: string, - bytes: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb', - local: boolean, - master_timeout: string, - h: string | string[], - health: 'green' | 'yellow' | 'red', - help: boolean, - pri: boolean, - s: string | string[], - time: 'd' | 'h' | 'm' | 's' | 'ms' | 'micros' | 'nanos', - v: boolean, - include_unloaded_segments: boolean, - expand_wildcards: 'open' | 'closed' | 'hidden' | 'none' | 'all' -}) ----- -link:{ref}/cat-indices.html[Documentation] + -[cols=2*] -|=== -|`index` -|`string \| string[]` - A comma-separated list of index names to limit the returned information - -|`format` -|`string` - a short version of the Accept header, e.g. json, yaml - -|`bytes` -|`'b' \| 'k' \| 'kb' \| 'm' \| 'mb' \| 'g' \| 'gb' \| 't' \| 'tb' \| 'p' \| 'pb'` - The unit in which to display byte values - -|`local` -|`boolean` - Return local information, do not retrieve the state from master node (default: false) - -|`master_timeout` or `masterTimeout` -|`string` - Explicit operation timeout for connection to master node - -|`h` -|`string \| string[]` - Comma-separated list of column names to display - -|`health` -|`'green' \| 'yellow' \| 'red'` - A health status ("green", "yellow", or "red" to filter only indices matching the specified health status - -|`help` -|`boolean` - Return help information - -|`pri` -|`boolean` - Set to true to return stats only for primary shards - -|`s` -|`string \| string[]` - Comma-separated list of column names or column aliases to sort by - -|`time` -|`'d' \| 'h' \| 'm' \| 's' \| 'ms' \| 'micros' \| 'nanos'` - The unit in which to display time values - -|`v` -|`boolean` - Verbose mode. Display column headers - -|`include_unloaded_segments` or `includeUnloadedSegments` -|`boolean` - If set to true segment stats will include stats for segments that are not currently loaded into memory - -|`expand_wildcards` or `expandWildcards` -|`'open' \| 'closed' \| 'hidden' \| 'none' \| 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. + -_Default:_ `all` - -|=== - -=== cat.master - -[source,ts] ----- -client.cat.master({ - format: string, - local: boolean, - master_timeout: string, - h: string | string[], - help: boolean, - s: string | string[], - v: boolean -}) ----- -link:{ref}/cat-master.html[Documentation] + -[cols=2*] -|=== -|`format` -|`string` - a short version of the Accept header, e.g. json, yaml - -|`local` -|`boolean` - Return local information, do not retrieve the state from master node (default: false) - -|`master_timeout` or `masterTimeout` -|`string` - Explicit operation timeout for connection to master node - -|`h` -|`string \| string[]` - Comma-separated list of column names to display - -|`help` -|`boolean` - Return help information - -|`s` -|`string \| string[]` - Comma-separated list of column names or column aliases to sort by - -|`v` -|`boolean` - Verbose mode. Display column headers - -|=== - -=== cat.nodeattrs - -[source,ts] ----- -client.cat.nodeattrs({ - format: string, - local: boolean, - master_timeout: string, - h: string | string[], - help: boolean, - s: string | string[], - v: boolean -}) ----- -link:{ref}/cat-nodeattrs.html[Documentation] + -[cols=2*] -|=== -|`format` -|`string` - a short version of the Accept header, e.g. json, yaml - -|`local` -|`boolean` - Return local information, do not retrieve the state from master node (default: false) - -|`master_timeout` or `masterTimeout` -|`string` - Explicit operation timeout for connection to master node - -|`h` -|`string \| string[]` - Comma-separated list of column names to display - -|`help` -|`boolean` - Return help information - -|`s` -|`string \| string[]` - Comma-separated list of column names or column aliases to sort by - -|`v` -|`boolean` - Verbose mode. Display column headers - -|=== - -=== cat.nodes - -[source,ts] ----- -client.cat.nodes({ - bytes: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb', - format: string, - full_id: boolean, - local: boolean, - master_timeout: string, - h: string | string[], - help: boolean, - s: string | string[], - time: 'd' | 'h' | 'm' | 's' | 'ms' | 'micros' | 'nanos', - v: boolean -}) ----- -link:{ref}/cat-nodes.html[Documentation] + -[cols=2*] -|=== -|`bytes` -|`'b' \| 'k' \| 'kb' \| 'm' \| 'mb' \| 'g' \| 'gb' \| 't' \| 'tb' \| 'p' \| 'pb'` - The unit in which to display byte values - -|`format` -|`string` - a short version of the Accept header, e.g. json, yaml - -|`full_id` or `fullId` -|`boolean` - Return the full node ID instead of the shortened version (default: false) - -|`local` -|`boolean` - Calculate the selected nodes using the local cluster state rather than the state from master node (default: false) + - -WARNING: This parameter has been deprecated. - -|`master_timeout` or `masterTimeout` -|`string` - Explicit operation timeout for connection to master node - -|`h` -|`string \| string[]` - Comma-separated list of column names to display - -|`help` -|`boolean` - Return help information - -|`s` -|`string \| string[]` - Comma-separated list of column names or column aliases to sort by - -|`time` -|`'d' \| 'h' \| 'm' \| 's' \| 'ms' \| 'micros' \| 'nanos'` - The unit in which to display time values - -|`v` -|`boolean` - Verbose mode. Display column headers - -|=== - -=== cat.pendingTasks - -[source,ts] ----- -client.cat.pendingTasks({ - format: string, - local: boolean, - master_timeout: string, - h: string | string[], - help: boolean, - s: string | string[], - time: 'd' | 'h' | 'm' | 's' | 'ms' | 'micros' | 'nanos', - v: boolean -}) ----- -link:{ref}/cat-pending-tasks.html[Documentation] + -[cols=2*] -|=== -|`format` -|`string` - a short version of the Accept header, e.g. json, yaml - -|`local` -|`boolean` - Return local information, do not retrieve the state from master node (default: false) - -|`master_timeout` or `masterTimeout` -|`string` - Explicit operation timeout for connection to master node - -|`h` -|`string \| string[]` - Comma-separated list of column names to display - -|`help` -|`boolean` - Return help information - -|`s` -|`string \| string[]` - Comma-separated list of column names or column aliases to sort by - -|`time` -|`'d' \| 'h' \| 'm' \| 's' \| 'ms' \| 'micros' \| 'nanos'` - The unit in which to display time values - -|`v` -|`boolean` - Verbose mode. Display column headers - -|=== - -=== cat.plugins - -[source,ts] ----- -client.cat.plugins({ - format: string, - local: boolean, - master_timeout: string, - h: string | string[], - help: boolean, - s: string | string[], - v: boolean -}) ----- -link:{ref}/cat-plugins.html[Documentation] + -[cols=2*] -|=== -|`format` -|`string` - a short version of the Accept header, e.g. json, yaml - -|`local` -|`boolean` - Return local information, do not retrieve the state from master node (default: false) - -|`master_timeout` or `masterTimeout` -|`string` - Explicit operation timeout for connection to master node - -|`h` -|`string \| string[]` - Comma-separated list of column names to display - -|`help` -|`boolean` - Return help information - -|`s` -|`string \| string[]` - Comma-separated list of column names or column aliases to sort by - -|`v` -|`boolean` - Verbose mode. Display column headers - -|=== - -=== cat.recovery - -[source,ts] ----- -client.cat.recovery({ - index: string | string[], - format: string, - active_only: boolean, - bytes: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb', - detailed: boolean, - h: string | string[], - help: boolean, - s: string | string[], - time: 'd' | 'h' | 'm' | 's' | 'ms' | 'micros' | 'nanos', - v: boolean -}) ----- -link:{ref}/cat-recovery.html[Documentation] + -[cols=2*] -|=== -|`index` -|`string \| string[]` - Comma-separated list or wildcard expression of index names to limit the returned information - -|`format` -|`string` - a short version of the Accept header, e.g. json, yaml - -|`active_only` or `activeOnly` -|`boolean` - If `true`, the response only includes ongoing shard recoveries - -|`bytes` -|`'b' \| 'k' \| 'kb' \| 'm' \| 'mb' \| 'g' \| 'gb' \| 't' \| 'tb' \| 'p' \| 'pb'` - The unit in which to display byte values - -|`detailed` -|`boolean` - If `true`, the response includes detailed information about shard recoveries - -|`h` -|`string \| string[]` - Comma-separated list of column names to display - -|`help` -|`boolean` - Return help information - -|`s` -|`string \| string[]` - Comma-separated list of column names or column aliases to sort by - -|`time` -|`'d' \| 'h' \| 'm' \| 's' \| 'ms' \| 'micros' \| 'nanos'` - The unit in which to display time values - -|`v` -|`boolean` - Verbose mode. Display column headers - -|=== - -=== cat.repositories - -[source,ts] ----- -client.cat.repositories({ - format: string, - local: boolean, - master_timeout: string, - h: string | string[], - help: boolean, - s: string | string[], - v: boolean -}) ----- -link:{ref}/cat-repositories.html[Documentation] + -[cols=2*] -|=== -|`format` -|`string` - a short version of the Accept header, e.g. json, yaml - -|`local` -|`boolean` - Return local information, do not retrieve the state from master node - -|`master_timeout` or `masterTimeout` -|`string` - Explicit operation timeout for connection to master node - -|`h` -|`string \| string[]` - Comma-separated list of column names to display - -|`help` -|`boolean` - Return help information - -|`s` -|`string \| string[]` - Comma-separated list of column names or column aliases to sort by - -|`v` -|`boolean` - Verbose mode. Display column headers - -|=== - -=== cat.segments -======= === asyncSearch.delete ->>>>>>> a064f0f3... Improve child performances (#1314) [source,ts] ---- @@ -850,7 +180,7 @@ client.asyncSearch.submit({ suggest_text: string, timeout: string, track_scores: boolean, - track_total_hits: boolean|long, + track_total_hits: boolean, allow_partial_search_results: boolean, typed_keys: boolean, version: boolean, @@ -970,43 +300,14 @@ _Default:_ `missing` |`suggest_text` or `suggestText` |`string` - The source text for which the suggestions should be returned -<<<<<<< HEAD -[source,ts] ----- -client.cat.threadPool({ - thread_pool_patterns: string | string[], - format: string, - size: '' | 'k' | 'm' | 'g' | 't' | 'p', - local: boolean, - master_timeout: string, - h: string | string[], - help: boolean, - s: string | string[], - v: boolean -}) ----- -link:{ref}/cat-thread-pool.html[Documentation] + -[cols=2*] -|=== -|`thread_pool_patterns` or `threadPoolPatterns` -|`string \| string[]` - A comma-separated list of regular-expressions to filter the thread pools in the output -======= |`timeout` |`string` - Explicit operation timeout ->>>>>>> a064f0f3... Improve child performances (#1314) |`track_scores` or `trackScores` |`boolean` - Whether to calculate and return scores even if they are not used for sorting -<<<<<<< HEAD -|`size` -|`'' \| 'k' \| 'm' \| 'g' \| 't' \| 'p'` - The multiplier in which to display values + - -WARNING: This parameter has been deprecated. -======= |`track_total_hits` or `trackTotalHits` -|`boolean\|long` - Indicate if the number of documents that match the query should be tracked. A number can also be specified, to accurately track the total hit count up to the number. ->>>>>>> a064f0f3... Improve child performances (#1314) +|`boolean` - Indicate if the number of documents that match the query should be tracked |`allow_partial_search_results` or `allowPartialSearchResults` |`boolean` - Indicate if an error should be returned if there is a partial search failure or timeout + @@ -1106,7 +407,6 @@ client.bulk({ _source_excludes: string | string[], _source_includes: string | string[], pipeline: string, - require_alias: boolean, body: object }) ---- @@ -1144,9 +444,6 @@ link:{ref}/docs-bulk.html[Documentation] + |`pipeline` |`string` - The pipeline id to preprocess incoming documents with -|`require_alias` or `requireAlias` -|`boolean` - Sets require_alias for all incoming documents. Defaults to unset (false) - |`body` |`object` - The operation definition and data (action-data pairs), separated by newlines @@ -1545,7 +842,6 @@ link:{ref}/cat-dfanalytics.html[Documentation] + ---- client.cat.mlDatafeeds({ datafeed_id: string, - allow_no_match: boolean, allow_no_datafeeds: boolean, format: string, h: string | string[], @@ -1561,13 +857,8 @@ link:{ref}/cat-datafeeds.html[Documentation] + |`datafeed_id` or `datafeedId` |`string` - The ID of the datafeeds stats to fetch -|`allow_no_match` or `allowNoMatch` -|`boolean` - Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified) - |`allow_no_datafeeds` or `allowNoDatafeeds` -|`boolean` - Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified) + - -WARNING: This parameter has been deprecated. +|`boolean` - Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified) |`format` |`string` - a short version of the Accept header, e.g. json, yaml @@ -1595,7 +886,6 @@ WARNING: This parameter has been deprecated. ---- client.cat.mlJobs({ job_id: string, - allow_no_match: boolean, allow_no_jobs: boolean, bytes: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb', format: string, @@ -1612,13 +902,8 @@ link:{ref}/cat-anomaly-detectors.html[Documentation] + |`job_id` or `jobId` |`string` - The ID of the jobs stats to fetch -|`allow_no_match` or `allowNoMatch` -|`boolean` - Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified) - |`allow_no_jobs` or `allowNoJobs` -|`boolean` - Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified) + - -WARNING: This parameter has been deprecated. +|`boolean` - Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified) |`bytes` |`'b' \| 'k' \| 'kb' \| 'm' \| 'mb' \| 'g' \| 'gb' \| 't' \| 'tb' \| 'p' \| 'pb'` - The unit in which to display byte values @@ -1647,26 +932,6 @@ WARNING: This parameter has been deprecated. [source,ts] ---- -<<<<<<< HEAD -client.count({ - index: string | string[], - type: string | string[], - ignore_unavailable: boolean, - ignore_throttled: boolean, - allow_no_indices: boolean, - expand_wildcards: 'open' | 'closed' | 'hidden' | 'none' | 'all', - min_score: number, - preference: string, - routing: string | string[], - q: string, - analyzer: string, - analyze_wildcard: boolean, - default_operator: 'AND' | 'OR', - df: string, - lenient: boolean, - terminate_after: number, - body: object -======= client.cat.mlTrainedModels({ model_id: string, allow_no_match: boolean, @@ -1679,7 +944,6 @@ client.cat.mlTrainedModels({ s: string | string[], time: 'd' | 'h' | 'm' | 's' | 'ms' | 'micros' | 'nanos', v: boolean ->>>>>>> a064f0f3... Improve child performances (#1314) }) ---- link:{ref}/cat-trained-model.html[Documentation] + @@ -1688,17 +952,9 @@ link:{ref}/cat-trained-model.html[Documentation] + |`model_id` or `modelId` |`string` - The ID of the trained models stats to fetch -<<<<<<< HEAD -|`type` -|`string \| string[]` - A comma-separated list of types to restrict the results - -|`ignore_unavailable` or `ignoreUnavailable` -|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed) -======= |`allow_no_match` or `allowNoMatch` |`boolean` - Whether to ignore if a wildcard expression matches no trained models. (This includes `_all` string or when no trained models have been specified) + _Default:_ `true` ->>>>>>> a064f0f3... Improve child performances (#1314) |`from` |`number` - skips a number of trained models @@ -1778,6 +1034,7 @@ client.cat.nodes({ bytes: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb', format: string, full_id: boolean, + local: boolean, master_timeout: string, h: string | string[], help: boolean, @@ -1798,6 +1055,11 @@ link:{ref}/cat-nodes.html[Documentation] + |`full_id` or `fullId` |`boolean` - Return the full node ID instead of the shortened version (default: false) +|`local` +|`boolean` - Calculate the selected nodes using the local cluster state rather than the state from master node (default: false) + + +WARNING: This parameter has been deprecated. + |`master_timeout` or `masterTimeout` |`string` - Explicit operation timeout for connection to master node @@ -1906,20 +1168,6 @@ link:{ref}/cat-plugins.html[Documentation] + [source,ts] ---- -<<<<<<< HEAD -client.delete({ - id: string, - index: string, - type: string, - wait_for_active_shards: string, - refresh: 'true' | 'false' | 'wait_for', - routing: string, - timeout: string, - if_seq_no: number, - if_primary_term: number, - version: number, - version_type: 'internal' | 'external' | 'external_gte' | 'force' -======= client.cat.recovery({ index: string | string[], format: string, @@ -1931,7 +1179,6 @@ client.cat.recovery({ s: string | string[], time: 'd' | 'h' | 'm' | 's' | 'ms' | 'micros' | 'nanos', v: boolean ->>>>>>> a064f0f3... Improve child performances (#1314) }) ---- link:{ref}/cat-recovery.html[Documentation] + @@ -1964,13 +1211,8 @@ link:{ref}/cat-recovery.html[Documentation] + |`time` |`'d' \| 'h' \| 'm' \| 's' \| 'ms' \| 'micros' \| 'nanos'` - The unit in which to display time values -<<<<<<< HEAD -|`version_type` or `versionType` -|`'internal' \| 'external' \| 'external_gte' \| 'force'` - Specific version type -======= |`v` |`boolean` - Verbose mode. Display column headers ->>>>>>> a064f0f3... Improve child performances (#1314) |=== @@ -1978,45 +1220,6 @@ link:{ref}/cat-recovery.html[Documentation] + [source,ts] ---- -<<<<<<< HEAD -client.deleteByQuery({ - index: string | string[], - type: string | string[], - analyzer: string, - analyze_wildcard: boolean, - default_operator: 'AND' | 'OR', - df: string, - from: number, - ignore_unavailable: boolean, - allow_no_indices: boolean, - conflicts: 'abort' | 'proceed', - expand_wildcards: 'open' | 'closed' | 'hidden' | 'none' | 'all', - lenient: boolean, - preference: string, - q: string, - routing: string | string[], - scroll: string, - search_type: 'query_then_fetch' | 'dfs_query_then_fetch', - search_timeout: string, - size: number, - max_docs: number, - sort: string | string[], - _source: string | string[], - _source_excludes: string | string[], - _source_includes: string | string[], - terminate_after: number, - stats: string | string[], - version: boolean, - request_cache: boolean, - refresh: boolean, - timeout: string, - wait_for_active_shards: string, - scroll_size: number, - wait_for_completion: boolean, - requests_per_second: number, - slices: number|string, - body: object -======= client.cat.repositories({ format: string, local: boolean, @@ -2025,41 +1228,13 @@ client.cat.repositories({ help: boolean, s: string | string[], v: boolean ->>>>>>> a064f0f3... Improve child performances (#1314) }) ---- link:{ref}/cat-repositories.html[Documentation] + [cols=2*] |=== -<<<<<<< HEAD -|`index` -|`string \| string[]` - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - -|`type` -|`string \| string[]` - A comma-separated list of document types to search; leave empty to perform the operation on all types - -|`analyzer` -|`string` - The analyzer to use for the query string - -|`analyze_wildcard` or `analyzeWildcard` -|`boolean` - Specify whether wildcard and prefix queries should be analyzed (default: false) - -|`default_operator` or `defaultOperator` -|`'AND' \| 'OR'` - The default operator for query string query (AND or OR) + -_Default:_ `OR` - -|`df` -|`string` - The field to use as default where no field prefix is given in the query string - -|`from` -|`number` - Starting offset (default: 0) - -|`ignore_unavailable` or `ignoreUnavailable` -|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed) -======= |`format` |`string` - a short version of the Accept header, e.g. json, yaml ->>>>>>> a064f0f3... Improve child performances (#1314) |`local` |`boolean` - Return local information, do not retrieve the state from master node @@ -2104,16 +1279,8 @@ link:{ref}/cat-segments.html[Documentation] + |`format` |`string` - a short version of the Accept header, e.g. json, yaml -<<<<<<< HEAD -|`size` -|`number` - Deprecated, please use `max_docs` instead - -|`max_docs` or `maxDocs` -|`number` - Maximum number of documents to process (default: all documents) -======= |`bytes` |`'b' \| 'k' \| 'kb' \| 'm' \| 'mb' \| 'g' \| 'gb' \| 't' \| 'tb' \| 'p' \| 'pb'` - The unit in which to display byte values ->>>>>>> a064f0f3... Improve child performances (#1314) |`h` |`string \| string[]` - Comma-separated list of column names to display @@ -2155,13 +1322,8 @@ link:{ref}/cat-shards.html[Documentation] + |`format` |`string` - a short version of the Accept header, e.g. json, yaml -<<<<<<< HEAD -|`refresh` -|`boolean` - Should the effected indexes be refreshed? -======= |`bytes` |`'b' \| 'k' \| 'kb' \| 'm' \| 'mb' \| 'g' \| 'gb' \| 't' \| 'tb' \| 'p' \| 'pb'` - The unit in which to display byte values ->>>>>>> a064f0f3... Improve child performances (#1314) |`local` |`boolean` - Return local information, do not retrieve the state from master node (default: false) @@ -2290,22 +1452,6 @@ link:{ref}/tasks.html[Documentation] + [source,ts] ---- -<<<<<<< HEAD -client.exists({ - id: string, - index: string, - type: string, - stored_fields: string | string[], - preference: string, - realtime: boolean, - refresh: boolean, - routing: string, - _source: string | string[], - _source_excludes: string | string[], - _source_includes: string | string[], - version: number, - version_type: 'internal' | 'external' | 'external_gte' | 'force' -======= client.cat.templates({ name: string, format: string, @@ -2315,36 +1461,13 @@ client.cat.templates({ help: boolean, s: string | string[], v: boolean ->>>>>>> a064f0f3... Improve child performances (#1314) }) ---- link:{ref}/cat-templates.html[Documentation] + [cols=2*] |=== -<<<<<<< HEAD -|`id` -|`string` - The document ID - -|`index` -|`string` - The name of the index - -|`type` -|`string` - The type of the document (use `_all` to fetch the first document matching the ID across all types) + - -WARNING: This parameter has been deprecated. - -|`stored_fields` or `storedFields` -|`string \| string[]` - A comma-separated list of stored fields to return in the response - -|`preference` -|`string` - Specify the node or shard the operation should be performed on (default: random) - -|`realtime` -|`boolean` - Specify whether to perform the operation in realtime or search mode -======= |`name` |`string` - A pattern that returned template names must match ->>>>>>> a064f0f3... Improve child performances (#1314) |`format` |`string` - a short version of the Accept header, e.g. json, yaml @@ -2364,13 +1487,8 @@ WARNING: This parameter has been deprecated. |`s` |`string \| string[]` - Comma-separated list of column names or column aliases to sort by -<<<<<<< HEAD -|`version_type` or `versionType` -|`'internal' \| 'external' \| 'external_gte' \| 'force'` - Specific version type -======= |`v` |`boolean` - Verbose mode. Display column headers ->>>>>>> a064f0f3... Improve child performances (#1314) |=== @@ -2378,32 +1496,16 @@ WARNING: This parameter has been deprecated. [source,ts] ---- -<<<<<<< HEAD -client.existsSource({ - id: string, - index: string, - type: string, - preference: string, - realtime: boolean, - refresh: boolean, - routing: string, - _source: string | string[], - _source_excludes: string | string[], - _source_includes: string | string[], - version: number, - version_type: 'internal' | 'external' | 'external_gte' | 'force' -======= client.cat.threadPool({ thread_pool_patterns: string | string[], format: string, - time: 'd' | 'h' | 'm' | 's' | 'ms' | 'micros' | 'nanos', + size: '' | 'k' | 'm' | 'g' | 't' | 'p', local: boolean, master_timeout: string, h: string | string[], help: boolean, s: string | string[], v: boolean ->>>>>>> a064f0f3... Improve child performances (#1314) }) ---- link:{ref}/cat-thread-pool.html[Documentation] + @@ -2415,8 +1517,10 @@ link:{ref}/cat-thread-pool.html[Documentation] + |`format` |`string` - a short version of the Accept header, e.g. json, yaml -|`time` -|`'d' \| 'h' \| 'm' \| 's' \| 'ms' \| 'micros' \| 'nanos'` - The unit in which to display time values +|`size` +|`'' \| 'k' \| 'm' \| 'g' \| 't' \| 'p'` - The multiplier in which to display values + + +WARNING: This parameter has been deprecated. |`local` |`boolean` - Return local information, do not retrieve the state from master node (default: false) @@ -2433,13 +1537,8 @@ link:{ref}/cat-thread-pool.html[Documentation] + |`s` |`string \| string[]` - Comma-separated list of column names or column aliases to sort by -<<<<<<< HEAD -|`version_type` or `versionType` -|`'internal' \| 'external' \| 'external_gte' \| 'force'` - Specific version type -======= |`v` |`boolean` - Verbose mode. Display column headers ->>>>>>> a064f0f3... Improve child performances (#1314) |=== @@ -2447,25 +1546,6 @@ link:{ref}/cat-thread-pool.html[Documentation] + [source,ts] ---- -<<<<<<< HEAD -client.explain({ - id: string, - index: string, - type: string, - analyze_wildcard: boolean, - analyzer: string, - default_operator: 'AND' | 'OR', - df: string, - stored_fields: string | string[], - lenient: boolean, - preference: string, - q: string, - routing: string, - _source: string | string[], - _source_excludes: string | string[], - _source_includes: string | string[], - body: object -======= client.cat.transforms({ transform_id: string, from: number, @@ -2477,30 +1557,13 @@ client.cat.transforms({ s: string | string[], time: 'd' | 'h' | 'm' | 's' | 'ms' | 'micros' | 'nanos', v: boolean ->>>>>>> a064f0f3... Improve child performances (#1314) }) ---- link:{ref}/cat-transforms.html[Documentation] + [cols=2*] |=== -<<<<<<< HEAD -|`id` -|`string` - The document ID - -|`index` -|`string` - The name of the index - -|`type` -|`string` - The type of the document + - -WARNING: This parameter has been deprecated. - -|`analyze_wildcard` or `analyzeWildcard` -|`boolean` - Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false) -======= |`transform_id` or `transformId` |`string` - The id of the transform for which to get stats. '_all' or '*' implies all transforms ->>>>>>> a064f0f3... Improve child performances (#1314) |`from` |`number` - skips a number of transform configs, defaults to 0 @@ -2592,25 +1655,8 @@ link:{ref}/ccr-get-follow-info.html[Documentation] + [source,ts] ---- -<<<<<<< HEAD -client.get({ - id: string, - index: string, - type: string, - stored_fields: string | string[], - preference: string, - realtime: boolean, - refresh: boolean, - routing: string, - _source: string | string[], - _source_excludes: string | string[], - _source_includes: string | string[], - version: number, - version_type: 'internal' | 'external' | 'external_gte' | 'force' -======= client.ccr.followStats({ index: string | string[] ->>>>>>> a064f0f3... Improve child performances (#1314) }) ---- link:{ref}/ccr-get-follow-stats.html[Documentation] + @@ -2619,17 +1665,7 @@ link:{ref}/ccr-get-follow-stats.html[Documentation] + |`index` |`string \| string[]` - A comma-separated list of index patterns; use `_all` to perform the operation on all indices -<<<<<<< HEAD -|`type` -|`string` - The type of the document (use `_all` to fetch the first document matching the ID across all types) + - -WARNING: This parameter has been deprecated. - -|`stored_fields` or `storedFields` -|`string \| string[]` - A comma-separated list of stored fields to return in the response -======= |=== ->>>>>>> a064f0f3... Improve child performances (#1314) === ccr.forgetFollower @@ -2669,10 +1705,6 @@ link:{ref}/ccr-get-auto-follow-pattern.html[Documentation] + === ccr.pauseAutoFollowPattern -<<<<<<< HEAD -|`version_type` or `versionType` -|`'internal' \| 'external' \| 'external_gte' \| 'force'` - Specific version type -======= [source,ts] ---- client.ccr.pauseAutoFollowPattern({ @@ -2684,7 +1716,6 @@ link:{ref}/ccr-pause-auto-follow-pattern.html[Documentation] + |=== |`name` |`string` - The name of the auto follow pattern that should pause discovering new indices to follow. ->>>>>>> a064f0f3... Improve child performances (#1314) |=== @@ -2746,42 +1777,14 @@ link:{ref}/ccr-resume-auto-follow-pattern.html[Documentation] + ---- client.ccr.resumeFollow({ index: string, -<<<<<<< HEAD - type: string, - preference: string, - realtime: boolean, - refresh: boolean, - routing: string, - _source: string | string[], - _source_excludes: string | string[], - _source_includes: string | string[], - version: number, - version_type: 'internal' | 'external' | 'external_gte' | 'force' -======= body: object ->>>>>>> a064f0f3... Improve child performances (#1314) }) ---- link:{ref}/ccr-post-resume-follow.html[Documentation] + [cols=2*] |=== |`index` -<<<<<<< HEAD -|`string` - The name of the index - -|`type` -|`string` - The type of the document; deprecated and optional starting with 7.0 + - -WARNING: This parameter has been deprecated. - -|`preference` -|`string` - Specify the node or shard the operation should be performed on (default: random) - -|`realtime` -|`boolean` - Specify whether to perform the operation in realtime or search mode -======= |`string` - The name of the follow index to resume following. ->>>>>>> a064f0f3... Improve child performances (#1314) |`body` |`object` - The name of the leader index and other optional ccr related parameters @@ -2799,10 +1802,6 @@ link:{ref}/ccr-get-stats.html[Documentation] + === ccr.unfollow -<<<<<<< HEAD -|`version_type` or `versionType` -|`'internal' \| 'external' \| 'external_gte' \| 'force'` - Specific version type -======= [source,ts] ---- client.ccr.unfollow({ @@ -2814,7 +1813,6 @@ link:{ref}/ccr-post-unfollow.html[Documentation] + |=== |`index` |`string` - The name of the follower index that should be turned into a regular index. ->>>>>>> a064f0f3... Improve child performances (#1314) |=== @@ -2822,56 +1820,16 @@ link:{ref}/ccr-post-unfollow.html[Documentation] + [source,ts] ---- -<<<<<<< HEAD -client.index({ - id: string, - index: string, - type: string, - wait_for_active_shards: string, - op_type: 'index' | 'create', - refresh: 'true' | 'false' | 'wait_for', - routing: string, - timeout: string, - version: number, - version_type: 'internal' | 'external' | 'external_gte', - if_seq_no: number, - if_primary_term: number, - pipeline: string, -<<<<<<< HEAD -======= - require_alias: boolean, -======= client.clearScroll({ scroll_id: string | string[], ->>>>>>> a064f0f3... Improve child performances (#1314) ->>>>>>> 3db1bed4... Improve child performances (#1314) body: object }) ---- link:{ref}/clear-scroll-api.html[Documentation] + [cols=2*] |=== -<<<<<<< HEAD -|`id` -|`string` - Document ID - -|`index` -|`string` - The name of the index - -|`type` -|`string` - The type of the document + - -WARNING: This parameter has been deprecated. - -|`wait_for_active_shards` or `waitForActiveShards` -|`string` - Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - -|`op_type` or `opType` -|`'index' \| 'create'` - Explicit operation type. Defaults to `index` for requests with an explicit document ID, and to `create`for requests without an explicit document ID -======= |`scroll_id` or `scrollId` |`string \| string[]` - A comma-separated list of scroll IDs to clear + ->>>>>>> a064f0f3... Improve child performances (#1314) WARNING: This parameter has been deprecated. @@ -2880,22 +1838,6 @@ WARNING: This parameter has been deprecated. |=== -=== closePointInTime - -[source,ts] ----- -client.closePointInTime({ - body: object -}) ----- -link:{ref}/point-in-time-api.html[Documentation] + -[cols=2*] -|=== -|`body` -|`object` - a point-in-time id to close - -|=== - === cluster.allocationExplain [source,ts] @@ -2912,12 +1854,9 @@ link:{ref}/cluster-allocation-explain.html[Documentation] + |`include_yes_decisions` or `includeYesDecisions` |`boolean` - Return 'YES' decisions in explanation (default: false) -<<<<<<< HEAD -======= |`include_disk_info` or `includeDiskInfo` |`boolean` - Return information about disk usage and shard sizes (default: false) ->>>>>>> 3db1bed4... Improve child performances (#1314) |`body` |`object` - The index, shard, and primary flag to explain. Empty means 'explain the first unassigned shard' @@ -3106,40 +2045,16 @@ _Default:_ `cluster` [source,ts] ---- -<<<<<<< HEAD -client.indices.create({ - index: string, - include_type_name: boolean, - wait_for_active_shards: string, - timeout: string, - master_timeout: string, - body: object -======= client.cluster.pendingTasks({ local: boolean, master_timeout: string ->>>>>>> a064f0f3... Improve child performances (#1314) }) ---- link:{ref}/cluster-pending.html[Documentation] + [cols=2*] |=== -<<<<<<< HEAD -|`index` -|`string` - The name of the index - -|`include_type_name` or `includeTypeName` -|`boolean` - Whether a type should be expected in the body of the mappings. - -|`wait_for_active_shards` or `waitForActiveShards` -|`string` - Set the number of active shards to wait for before the operation returns. - -|`timeout` -|`string` - Explicit operation timeout -======= |`local` |`boolean` - Return local information, do not retrieve the state from master node (default: false) ->>>>>>> a064f0f3... Improve child performances (#1314) |`master_timeout` or `masterTimeout` |`string` - Specify timeout for connection to master @@ -3363,6 +2278,7 @@ link:{ref}/cluster-stats.html[Documentation] + ---- client.count({ index: string | string[], + type: string | string[], ignore_unavailable: boolean, ignore_throttled: boolean, allow_no_indices: boolean, @@ -3386,6 +2302,9 @@ link:{ref}/search-count.html[Documentation] + |`index` |`string \| string[]` - A comma-separated list of indices to restrict the results +|`type` +|`string \| string[]` - A comma-separated list of types to restrict the results + |`ignore_unavailable` or `ignoreUnavailable` |`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed) @@ -3435,40 +2354,7 @@ _Default:_ `OR` |=== -<<<<<<< HEAD -=== indices.flushSynced - -[source,ts] ----- -client.indices.flushSynced({ - index: string | string[], - ignore_unavailable: boolean, - allow_no_indices: boolean, - expand_wildcards: 'open' | 'closed' | 'none' | 'all' -}) ----- -link:{ref}/indices-synced-flush-api.html[Documentation] + -[cols=2*] -|=== -|`index` -|`string \| string[]` - A comma-separated list of index names; use `_all` or empty string for all indices - -|`ignore_unavailable` or `ignoreUnavailable` -|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed) - -|`allow_no_indices` or `allowNoIndices` -|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - -|`expand_wildcards` or `expandWildcards` -|`'open' \| 'closed' \| 'none' \| 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. + -_Default:_ `open` - -|=== - -=== indices.forcemerge -======= === create ->>>>>>> a064f0f3... Improve child performances (#1314) [source,ts] ---- @@ -3530,51 +2416,18 @@ WARNING: This parameter has been deprecated. [source,ts] ---- -<<<<<<< HEAD -client.indices.get({ - index: string | string[], - include_type_name: boolean, - local: boolean, - ignore_unavailable: boolean, - allow_no_indices: boolean, - expand_wildcards: 'open' | 'closed' | 'hidden' | 'none' | 'all', - flat_settings: boolean, - include_defaults: boolean, -======= client.danglingIndices.deleteDanglingIndex({ index_uuid: string, accept_data_loss: boolean, timeout: string, ->>>>>>> a064f0f3... Improve child performances (#1314) master_timeout: string }) ---- link:{ref}/modules-gateway-dangling-indices.html[Documentation] + [cols=2*] |=== -<<<<<<< HEAD -|`index` -|`string \| string[]` - A comma-separated list of index names - -|`include_type_name` or `includeTypeName` -|`boolean` - Whether to add the type name to the response (default: false) - -|`local` -|`boolean` - Return local information, do not retrieve the state from master node (default: false) - -|`ignore_unavailable` or `ignoreUnavailable` -|`boolean` - Ignore unavailable indexes (default: false) - -|`allow_no_indices` or `allowNoIndices` -|`boolean` - Ignore if a wildcard expression resolves to no concrete indices (default: false) - -|`expand_wildcards` or `expandWildcards` -|`'open' \| 'closed' \| 'hidden' \| 'none' \| 'all'` - Whether wildcard expressions should get expanded to open or closed indices (default: open) + -_Default:_ `open` -======= |`index_uuid` or `indexUuid` |`string` - The UUID of the dangling index ->>>>>>> a064f0f3... Improve child performances (#1314) |`accept_data_loss` or `acceptDataLoss` |`boolean` - Must be set to true in order to delete the dangling index @@ -3628,18 +2481,6 @@ link:{ref}/modules-gateway-dangling-indices.html[Documentation] + [source,ts] ---- -<<<<<<< HEAD -client.indices.getFieldMapping({ - fields: string | string[], - index: string | string[], - type: string | string[], - include_type_name: boolean, - include_defaults: boolean, - ignore_unavailable: boolean, - allow_no_indices: boolean, - expand_wildcards: 'open' | 'closed' | 'hidden' | 'none' | 'all', - local: boolean -======= client.delete({ id: string, index: string, @@ -3651,8 +2492,7 @@ client.delete({ if_seq_no: number, if_primary_term: number, version: number, - version_type: 'internal' | 'external' | 'external_gte' ->>>>>>> a064f0f3... Improve child performances (#1314) + version_type: 'internal' | 'external' | 'external_gte' | 'force' }) ---- link:{ref}/docs-delete.html[Documentation] + @@ -3665,19 +2505,7 @@ link:{ref}/docs-delete.html[Documentation] + |`string` - The name of the index |`type` -<<<<<<< HEAD -|`string \| string[]` - A comma-separated list of document types + - -WARNING: This parameter has been deprecated. - -|`include_type_name` or `includeTypeName` -|`boolean` - Whether a type should be returned in the body of the mappings. - -|`include_defaults` or `includeDefaults` -|`boolean` - Whether the default mapping values should be returned as well -======= |`string` - The type of the document + ->>>>>>> a064f0f3... Improve child performances (#1314) WARNING: This parameter has been deprecated. @@ -3703,7 +2531,7 @@ WARNING: This parameter has been deprecated. |`number` - Explicit version number for concurrency control |`version_type` or `versionType` -|`'internal' \| 'external' \| 'external_gte'` - Specific version type +|`'internal' \| 'external' \| 'external_gte' \| 'force'` - Specific version type |=== @@ -3713,6 +2541,7 @@ WARNING: This parameter has been deprecated. ---- client.deleteByQuery({ index: string | string[], + type: string | string[], analyzer: string, analyze_wildcard: boolean, default_operator: 'AND' | 'OR', @@ -3729,6 +2558,7 @@ client.deleteByQuery({ scroll: string, search_type: 'query_then_fetch' | 'dfs_query_then_fetch', search_timeout: string, + size: number, max_docs: number, sort: string | string[], _source: string | string[], @@ -3754,6 +2584,9 @@ link:{ref}/docs-delete-by-query.html[Documentation] + |`index` |`string \| string[]` - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices +|`type` +|`string \| string[]` - A comma-separated list of document types to search; leave empty to perform the operation on all types + |`analyzer` |`string` - The analyzer to use for the query string @@ -3767,37 +2600,8 @@ _Default:_ `OR` |`df` |`string` - The field to use as default where no field prefix is given in the query string -<<<<<<< HEAD -[source,ts] ----- -client.indices.getMapping({ - index: string | string[], - type: string | string[], - include_type_name: boolean, - ignore_unavailable: boolean, - allow_no_indices: boolean, - expand_wildcards: 'open' | 'closed' | 'hidden' | 'none' | 'all', - master_timeout: string, - local: boolean -}) ----- -link:{ref}/indices-get-mapping.html[Documentation] + -[cols=2*] -|=== -|`index` -|`string \| string[]` - A comma-separated list of index names -======= |`from` |`number` - Starting offset (default: 0) ->>>>>>> a064f0f3... Improve child performances (#1314) - -|`type` -|`string \| string[]` - A comma-separated list of document types + - -WARNING: This parameter has been deprecated. - -|`include_type_name` or `includeTypeName` -|`boolean` - Whether to add the type name to the response (default: false) |`ignore_unavailable` or `ignoreUnavailable` |`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed) @@ -3834,6 +2638,9 @@ _Default:_ `open` |`search_timeout` or `searchTimeout` |`string` - Explicit timeout for each search request. Defaults to no timeout. +|`size` +|`number` - Deprecated, please use `max_docs` instead + |`max_docs` or `maxDocs` |`number` - Maximum number of documents to process (default: all documents) @@ -3861,36 +2668,12 @@ _Default:_ `open` |`request_cache` or `requestCache` |`boolean` - Specify if request cache should be used for this request or not, defaults to index level setting -<<<<<<< HEAD -[source,ts] ----- -client.indices.getTemplate({ - name: string | string[], - include_type_name: boolean, - flat_settings: boolean, - master_timeout: string, - local: boolean -}) ----- -link:{ref}/indices-templates.html[Documentation] + -[cols=2*] -|=== -|`name` -|`string \| string[]` - The comma separated names of the index templates - -|`include_type_name` or `includeTypeName` -|`boolean` - Whether a type should be returned in the body of the mappings. - -|`flat_settings` or `flatSettings` -|`boolean` - Return settings in flat format (default: false) -======= |`refresh` -|`boolean` - Should the affected indexes be refreshed? +|`boolean` - Should the effected indexes be refreshed? |`timeout` |`string` - Time each individual bulk request should wait for shards that are unavailable. + _Default:_ `1m` ->>>>>>> a064f0f3... Improve child performances (#1314) |`wait_for_active_shards` or `waitForActiveShards` |`string` - Sets the number of shard copies that must be active before proceeding with the delete by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) @@ -4016,48 +2799,16 @@ link:{ref}/get-enrich-policy-api.html[Documentation] + [source,ts] ---- -<<<<<<< HEAD -client.indices.putMapping({ - index: string | string[], - type: string, - include_type_name: boolean, - timeout: string, - master_timeout: string, - ignore_unavailable: boolean, - allow_no_indices: boolean, - expand_wildcards: 'open' | 'closed' | 'hidden' | 'none' | 'all', - write_index_only: boolean, -======= client.enrich.putPolicy({ name: string, ->>>>>>> a064f0f3... Improve child performances (#1314) body: object }) ---- link:{ref}/put-enrich-policy-api.html[Documentation] + [cols=2*] |=== -<<<<<<< HEAD -|`index` -|`string \| string[]` - 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. - -|`type` -|`string` - The name of the document type + - -WARNING: This parameter has been deprecated. - -|`include_type_name` or `includeTypeName` -|`boolean` - Whether a type should be expected in the body of the mappings. - -|`timeout` -|`string` - Explicit operation timeout - -|`master_timeout` or `masterTimeout` -|`string` - Specify timeout for connection to master -======= |`name` |`string` - The name of the enrich policy ->>>>>>> a064f0f3... Improve child performances (#1314) |`body` |`object` - The enrich policy to register @@ -4118,20 +2869,11 @@ _Default:_ `5d` *Stability:* beta [source,ts] ---- -<<<<<<< HEAD -client.indices.putTemplate({ - name: string, - include_type_name: boolean, - order: number, - create: boolean, - master_timeout: string, -======= client.eql.search({ index: string, wait_for_completion_timeout: string, keep_on_completion: boolean, keep_alive: string, ->>>>>>> a064f0f3... Improve child performances (#1314) body: object }) ---- @@ -4141,16 +2883,8 @@ link:{ref}/eql-search-api.html[Documentation] + |`index` |`string` - The name of the index to scope the operation -<<<<<<< HEAD -|`include_type_name` or `includeTypeName` -|`boolean` - Whether a type should be returned in the body of the mappings. - -|`order` -|`number` - The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers) -======= |`wait_for_completion_timeout` or `waitForCompletionTimeout` |`string` - Specify the time that the request should block waiting for the final response ->>>>>>> a064f0f3... Improve child performances (#1314) |`keep_on_completion` or `keepOnCompletion` |`boolean` - Control whether the response should be stored in the cluster if it completed within the provided [wait_for_completion] time (default: false) @@ -4171,6 +2905,7 @@ _Default:_ `5d` client.exists({ id: string, index: string, + type: string, stored_fields: string | string[], preference: string, realtime: boolean, @@ -4180,7 +2915,7 @@ client.exists({ _source_excludes: string | string[], _source_includes: string | string[], version: number, - version_type: 'internal' | 'external' | 'external_gte' + version_type: 'internal' | 'external' | 'external_gte' | 'force' }) ---- link:{ref}/docs-get.html[Documentation] + @@ -4193,6 +2928,11 @@ link:{ref}/docs-get.html[Documentation] + |`index` |`string` - The name of the index +|`type` +|`string` - The type of the document (use `_all` to fetch the first document matching the ID across all types) + + +WARNING: This parameter has been deprecated. + |`stored_fields` or `storedFields` |`string \| string[]` - A comma-separated list of stored fields to return in the response @@ -4221,7 +2961,7 @@ link:{ref}/docs-get.html[Documentation] + |`number` - Explicit version number for concurrency control |`version_type` or `versionType` -|`'internal' \| 'external' \| 'external_gte'` - Specific version type +|`'internal' \| 'external' \| 'external_gte' \| 'force'` - Specific version type |=== @@ -4241,7 +2981,7 @@ client.existsSource({ _source_excludes: string | string[], _source_includes: string | string[], version: number, - version_type: 'internal' | 'external' | 'external_gte' + version_type: 'internal' | 'external' | 'external_gte' | 'force' }) ---- link:{ref}/docs-get.html[Documentation] + @@ -4283,7 +3023,7 @@ WARNING: This parameter has been deprecated. |`number` - Explicit version number for concurrency control |`version_type` or `versionType` -|`'internal' \| 'external' \| 'external_gte'` - Specific version type +|`'internal' \| 'external' \| 'external_gte' \| 'force'` - Specific version type |=== @@ -4291,19 +3031,10 @@ WARNING: This parameter has been deprecated. [source,ts] ---- -<<<<<<< HEAD -client.indices.rollover({ - alias: string, - new_index: string, - include_type_name: boolean, - timeout: string, - dry_run: boolean, - master_timeout: string, - wait_for_active_shards: string, -======= client.explain({ id: string, index: string, + type: string, analyze_wildcard: boolean, analyzer: string, default_operator: 'AND' | 'OR', @@ -4316,7 +3047,6 @@ client.explain({ _source: string | string[], _source_excludes: string | string[], _source_includes: string | string[], ->>>>>>> a064f0f3... Improve child performances (#1314) body: object }) ---- @@ -4329,16 +3059,13 @@ link:{ref}/search-explain.html[Documentation] + |`index` |`string` - The name of the index -<<<<<<< HEAD -|`include_type_name` or `includeTypeName` -|`boolean` - Whether a type should be included in the body of the mappings. +|`type` +|`string` - The type of the document + + +WARNING: This parameter has been deprecated. -|`timeout` -|`string` - Explicit operation timeout -======= |`analyze_wildcard` or `analyzeWildcard` |`boolean` - Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false) ->>>>>>> a064f0f3... Improve child performances (#1314) |`analyzer` |`string` - The analyzer for the query string query @@ -4427,14 +3154,7 @@ _Default:_ `open` client.get({ id: string, index: string, -<<<<<<< HEAD - target: string, - copy_settings: boolean, - timeout: string, - master_timeout: string, - wait_for_active_shards: string, - body: object -======= + type: string, stored_fields: string | string[], preference: string, realtime: boolean, @@ -4444,8 +3164,7 @@ client.get({ _source_excludes: string | string[], _source_includes: string | string[], version: number, - version_type: 'internal' | 'external' | 'external_gte' ->>>>>>> a064f0f3... Improve child performances (#1314) + version_type: 'internal' | 'external' | 'external_gte' | 'force' }) ---- link:{ref}/docs-get.html[Documentation] + @@ -4455,16 +3174,13 @@ link:{ref}/docs-get.html[Documentation] + |`id` |`string` - The document ID -<<<<<<< HEAD -|`copy_settings` or `copySettings` -|`boolean` - whether or not to copy settings from the source index (defaults to false) - -|`timeout` -|`string` - Explicit operation timeout -======= |`index` |`string` - The name of the index ->>>>>>> a064f0f3... Improve child performances (#1314) + +|`type` +|`string` - The type of the document (use `_all` to fetch the first document matching the ID across all types) + + +WARNING: This parameter has been deprecated. |`stored_fields` or `storedFields` |`string \| string[]` - A comma-separated list of stored fields to return in the response @@ -4494,7 +3210,7 @@ link:{ref}/docs-get.html[Documentation] + |`number` - Explicit version number for concurrency control |`version_type` or `versionType` -|`'internal' \| 'external' \| 'external_gte'` - Specific version type +|`'internal' \| 'external' \| 'external_gte' \| 'force'` - Specific version type |=== @@ -4522,39 +3238,9 @@ link:{ref}/modules-scripting.html[Documentation] + *Stability:* experimental [source,ts] ---- -<<<<<<< HEAD -client.indices.split({ - index: string, - target: string, - copy_settings: boolean, - timeout: string, - master_timeout: string, - wait_for_active_shards: string, - body: object -}) ----- -link:{ref}/indices-split-index.html[Documentation] + -[cols=2*] -|=== -|`index` -|`string` - The name of the source index to split - -|`target` -|`string` - The name of the target index to split into - -|`copy_settings` or `copySettings` -|`boolean` - whether or not to copy settings from the source index (defaults to false) - -|`timeout` -|`string` - Explicit operation timeout - -|`master_timeout` or `masterTimeout` -|`string` - Specify timeout for connection to master -======= client.getScriptContext() ---- link:https://www.elastic.co/guide/en/elasticsearch/painless/master/painless-contexts.html[Documentation] + ->>>>>>> a064f0f3... Improve child performances (#1314) === getScriptLanguages @@ -4573,6 +3259,7 @@ link:{ref}/modules-scripting.html[Documentation] + client.getSource({ id: string, index: string, + type: string, preference: string, realtime: boolean, refresh: boolean, @@ -4581,7 +3268,7 @@ client.getSource({ _source_excludes: string | string[], _source_includes: string | string[], version: number, - version_type: 'internal' | 'external' | 'external_gte' + version_type: 'internal' | 'external' | 'external_gte' | 'force' }) ---- link:{ref}/docs-get.html[Documentation] + @@ -4593,6 +3280,11 @@ link:{ref}/docs-get.html[Documentation] + |`index` |`string` - The name of the index +|`type` +|`string` - The type of the document; deprecated and optional starting with 7.0 + + +WARNING: This parameter has been deprecated. + |`preference` |`string` - Specify the node or shard the operation should be performed on (default: random) @@ -4618,7 +3310,7 @@ link:{ref}/docs-get.html[Documentation] + |`number` - Explicit version number for concurrency control |`version_type` or `versionType` -|`'internal' \| 'external' \| 'external_gte'` - Specific version type +|`'internal' \| 'external' \| 'external_gte' \| 'force'` - Specific version type |=== @@ -4628,6 +3320,7 @@ link:{ref}/docs-get.html[Documentation] + ---- client.graph.explore({ index: string | string[], + type: string | string[], routing: string, timeout: string, body: object @@ -4639,6 +3332,11 @@ link:{ref}/graph-explore-api.html[Documentation] + |`index` |`string \| string[]` - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices +|`type` +|`string \| string[]` - A comma-separated list of document types to search; leave empty to perform the operation on all types + + +WARNING: This parameter has been deprecated. + |`routing` |`string` - Specific routing value @@ -4812,6 +3510,7 @@ link:{ref}/ilm-stop.html[Documentation] + client.index({ id: string, index: string, + type: string, wait_for_active_shards: string, op_type: 'index' | 'create', refresh: 'true' | 'false' | 'wait_for', @@ -4822,7 +3521,6 @@ client.index({ if_seq_no: number, if_primary_term: number, pipeline: string, - require_alias: boolean, body: object }) ---- @@ -4835,6 +3533,11 @@ link:{ref}/docs-index_.html[Documentation] + |`index` |`string` - The name of the index +|`type` +|`string` - The type of the document + + +WARNING: This parameter has been deprecated. + |`wait_for_active_shards` or `waitForActiveShards` |`string` - Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) @@ -4865,9 +3568,6 @@ link:{ref}/docs-index_.html[Documentation] + |`pipeline` |`string` - The pipeline id to preprocess incoming documents with -|`require_alias` or `requireAlias` -|`boolean` - When true, requires destination to be an alias. Default is false - |`body` |`object` - The document @@ -4877,20 +3577,6 @@ link:{ref}/docs-index_.html[Documentation] + [source,ts] ---- -<<<<<<< HEAD -client.mget({ - index: string, - type: string, - stored_fields: string | string[], - preference: string, - realtime: boolean, - refresh: boolean, - routing: string, - _source: string | string[], - _source_excludes: string | string[], - _source_includes: string | string[], - body: object -======= client.indices.addBlock({ index: string | string[], block: string, @@ -4899,7 +3585,6 @@ client.indices.addBlock({ ignore_unavailable: boolean, allow_no_indices: boolean, expand_wildcards: 'open' | 'closed' | 'hidden' | 'none' | 'all' ->>>>>>> a064f0f3... Improve child performances (#1314) }) ---- link:{ref}/index-modules-blocks.html[Documentation] + @@ -4908,18 +3593,8 @@ link:{ref}/index-modules-blocks.html[Documentation] + |`index` |`string \| string[]` - A comma separated list of indices to add a block to -<<<<<<< HEAD -|`type` -|`string` - The type of the document + - -WARNING: This parameter has been deprecated. - -|`stored_fields` or `storedFields` -|`string \| string[]` - A comma-separated list of stored fields to return in the response -======= |`block` |`string` - The block to add (one of read, write, read_only or metadata) ->>>>>>> a064f0f3... Improve child performances (#1314) |`timeout` |`string` - Explicit operation timeout @@ -4955,11 +3630,7 @@ link:{ref}/indices-analyze.html[Documentation] + |`string` - The name of the index to scope the operation |`body` -<<<<<<< HEAD -|`object` - Document identifiers; can be either `docs` (containing full document information) or `ids` (when index and type is provided in the URL. -======= |`object` - Define analyzer/tokenizer parameters and the text on which the analysis should be performed ->>>>>>> a064f0f3... Improve child performances (#1314) |=== @@ -4969,17 +3640,6 @@ link:{ref}/indices-analyze.html[Documentation] + ---- client.indices.clearCache({ index: string | string[], -<<<<<<< HEAD - type: string | string[], - search_type: 'query_then_fetch' | 'query_and_fetch' | 'dfs_query_then_fetch' | 'dfs_query_and_fetch', - max_concurrent_searches: number, - typed_keys: boolean, - pre_filter_shard_size: number, - max_concurrent_shard_requests: number, - rest_total_hits_as_int: boolean, - ccs_minimize_roundtrips: boolean, - body: object -======= fielddata: boolean, fields: string | string[], query: boolean, @@ -4987,24 +3647,13 @@ client.indices.clearCache({ allow_no_indices: boolean, expand_wildcards: 'open' | 'closed' | 'hidden' | 'none' | 'all', request: boolean ->>>>>>> a064f0f3... Improve child performances (#1314) }) ---- link:{ref}/indices-clearcache.html[Documentation] + [cols=2*] |=== |`index` -<<<<<<< HEAD -|`string \| string[]` - A comma-separated list of index names to use as default - -|`type` -|`string \| string[]` - A comma-separated list of document types to use as default - -|`search_type` or `searchType` -|`'query_then_fetch' \| 'query_and_fetch' \| 'dfs_query_then_fetch' \| 'dfs_query_and_fetch'` - Search operation type -======= |`string \| string[]` - A comma-separated list of index name to limit the operation ->>>>>>> a064f0f3... Improve child performances (#1314) |`fielddata` |`boolean` - Clear field data @@ -5034,23 +3683,12 @@ _Default:_ `open` [source,ts] ---- -<<<<<<< HEAD -client.msearchTemplate({ - index: string | string[], - type: string | string[], - search_type: 'query_then_fetch' | 'query_and_fetch' | 'dfs_query_then_fetch' | 'dfs_query_and_fetch', - typed_keys: boolean, - max_concurrent_searches: number, - rest_total_hits_as_int: boolean, - ccs_minimize_roundtrips: boolean, -======= client.indices.clone({ index: string, target: string, timeout: string, master_timeout: string, wait_for_active_shards: string, ->>>>>>> a064f0f3... Improve child performances (#1314) body: object }) ---- @@ -5058,17 +3696,7 @@ link:{ref}/indices-clone-index.html[Documentation] + [cols=2*] |=== |`index` -<<<<<<< HEAD -|`string \| string[]` - A comma-separated list of index names to use as default - -|`type` -|`string \| string[]` - A comma-separated list of document types to use as default - -|`search_type` or `searchType` -|`'query_then_fetch' \| 'query_and_fetch' \| 'dfs_query_then_fetch' \| 'dfs_query_and_fetch'` - Search operation type -======= |`string` - The name of the source index to clone ->>>>>>> a064f0f3... Improve child performances (#1314) |`target` |`string` - The name of the target index to clone into @@ -5091,24 +3719,6 @@ link:{ref}/indices-clone-index.html[Documentation] + [source,ts] ---- -<<<<<<< HEAD -client.mtermvectors({ - index: string, - type: string, - ids: string | string[], - term_statistics: boolean, - field_statistics: boolean, - fields: string | string[], - offsets: boolean, - positions: boolean, - payloads: boolean, - preference: string, - routing: string, - realtime: boolean, - version: number, - version_type: 'internal' | 'external' | 'external_gte' | 'force', - body: object -======= client.indices.close({ index: string | string[], timeout: string, @@ -5117,46 +3727,13 @@ client.indices.close({ allow_no_indices: boolean, expand_wildcards: 'open' | 'closed' | 'hidden' | 'none' | 'all', wait_for_active_shards: string ->>>>>>> a064f0f3... Improve child performances (#1314) }) ---- link:{ref}/indices-open-close.html[Documentation] + [cols=2*] |=== |`index` -<<<<<<< HEAD -|`string` - The index in which the document resides. - -|`type` -|`string` - The type of the document. - -|`ids` -|`string \| string[]` - A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body - -|`term_statistics` or `termStatistics` -|`boolean` - Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - -|`field_statistics` or `fieldStatistics` -|`boolean` - Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". + -_Default:_ `true` - -|`fields` -|`string \| string[]` - A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body "params" or "docs". - -|`offsets` -|`boolean` - Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". + -_Default:_ `true` - -|`positions` -|`boolean` - Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". + -_Default:_ `true` - -|`payloads` -|`boolean` - Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". + -_Default:_ `true` -======= |`string \| string[]` - A comma separated list of indices to close ->>>>>>> a064f0f3... Improve child performances (#1314) |`timeout` |`string` - Explicit operation timeout @@ -5170,14 +3747,9 @@ _Default:_ `true` |`allow_no_indices` or `allowNoIndices` |`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) -<<<<<<< HEAD -|`version_type` or `versionType` -|`'internal' \| 'external' \| 'external_gte' \| 'force'` - Specific version type -======= |`expand_wildcards` or `expandWildcards` |`'open' \| 'closed' \| 'hidden' \| 'none' \| 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. + _Default:_ `open` ->>>>>>> a064f0f3... Improve child performances (#1314) |`wait_for_active_shards` or `waitForActiveShards` |`string` - Sets the number of active shards to wait for before the operation returns. @@ -5190,6 +3762,7 @@ _Default:_ `open` ---- client.indices.create({ index: string, + include_type_name: boolean, wait_for_active_shards: string, timeout: string, master_timeout: string, @@ -5202,6 +3775,9 @@ link:{ref}/indices-create-index.html[Documentation] + |`index` |`string` - The name of the index +|`include_type_name` or `includeTypeName` +|`boolean` - Whether a type should be expected in the body of the mappings. + |`wait_for_active_shards` or `waitForActiveShards` |`string` - Set the number of active shards to wait for before the operation returns. @@ -5554,58 +4130,11 @@ _Default:_ `open` ---- client.indices.flush({ index: string | string[], -<<<<<<< HEAD - type: string | string[], - analyzer: string, - analyze_wildcard: boolean, - ccs_minimize_roundtrips: boolean, - default_operator: 'AND' | 'OR', - df: string, - explain: boolean, - stored_fields: string | string[], - docvalue_fields: string | string[], - from: number, -======= force: boolean, wait_if_ongoing: boolean, ->>>>>>> a064f0f3... Improve child performances (#1314) ignore_unavailable: boolean, allow_no_indices: boolean, -<<<<<<< HEAD - expand_wildcards: 'open' | 'closed' | 'hidden' | 'none' | 'all', - lenient: boolean, - preference: string, - q: string, - routing: string | string[], - scroll: string, - search_type: 'query_then_fetch' | 'dfs_query_then_fetch', - size: number, - sort: string | string[], - _source: string | string[], - _source_excludes: string | string[], - _source_includes: string | string[], - terminate_after: number, - stats: string | string[], - suggest_field: string, - suggest_mode: 'missing' | 'popular' | 'always', - suggest_size: number, - suggest_text: string, - timeout: string, - track_scores: boolean, - track_total_hits: boolean, - allow_partial_search_results: boolean, - typed_keys: boolean, - version: boolean, - seq_no_primary_term: boolean, - request_cache: boolean, - batched_reduce_size: number, - max_concurrent_shard_requests: number, - pre_filter_shard_size: number, - rest_total_hits_as_int: boolean, - body: object -======= expand_wildcards: 'open' | 'closed' | 'hidden' | 'none' | 'all' ->>>>>>> a064f0f3... Improve child performances (#1314) }) ---- link:{ref}/indices-flush.html[Documentation] + @@ -5614,16 +4143,8 @@ link:{ref}/indices-flush.html[Documentation] + |`index` |`string \| string[]` - A comma-separated list of index names; use `_all` or empty string for all indices -<<<<<<< HEAD -|`type` -|`string \| string[]` - A comma-separated list of document types to search; leave empty to perform the operation on all types - -|`analyzer` -|`string` - The analyzer to use for the query string -======= |`force` |`boolean` - 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) ->>>>>>> a064f0f3... Improve child performances (#1314) |`wait_if_ongoing` or `waitIfOngoing` |`boolean` - If set to true the flush operation will block until the flush can be executed if another flush operation is already executing. The default is true. If set to false the flush will be skipped iff if another flush operation is already running. @@ -5640,6 +4161,35 @@ _Default:_ `open` |=== +=== indices.flushSynced + +[source,ts] +---- +client.indices.flushSynced({ + index: string | string[], + ignore_unavailable: boolean, + allow_no_indices: boolean, + expand_wildcards: 'open' | 'closed' | 'none' | 'all' +}) +---- +link:{ref}/indices-synced-flush-api.html[Documentation] + +[cols=2*] +|=== +|`index` +|`string \| string[]` - A comma-separated list of index names; use `_all` or empty string for all indices + +|`ignore_unavailable` or `ignoreUnavailable` +|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed) + +|`allow_no_indices` or `allowNoIndices` +|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + +|`expand_wildcards` or `expandWildcards` +|`'open' \| 'closed' \| 'none' \| 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. + +_Default:_ `open` + +|=== + === indices.forcemerge [source,ts] @@ -5728,6 +4278,7 @@ _Default:_ `closed` ---- client.indices.get({ index: string | string[], + include_type_name: boolean, local: boolean, ignore_unavailable: boolean, allow_no_indices: boolean, @@ -5743,6 +4294,9 @@ link:{ref}/indices-get-index.html[Documentation] + |`index` |`string \| string[]` - A comma-separated list of index names +|`include_type_name` or `includeTypeName` +|`boolean` - Whether to add the type name to the response (default: false) + |`local` |`boolean` - Return local information, do not retrieve the state from master node (default: false) @@ -5765,12 +4319,7 @@ _Default:_ `open` |`master_timeout` or `masterTimeout` |`string` - Specify timeout for connection to master -<<<<<<< HEAD -|`track_total_hits` or `trackTotalHits` -|`boolean` - Indicate if the number of documents that match the query should be tracked -======= |=== ->>>>>>> a064f0f3... Improve child performances (#1314) === indices.getAlias @@ -5832,6 +4381,8 @@ link:{ref}/data-streams.html[Documentation] + client.indices.getFieldMapping({ fields: string | string[], index: string | string[], + type: string | string[], + include_type_name: boolean, include_defaults: boolean, ignore_unavailable: boolean, allow_no_indices: boolean, @@ -5848,6 +4399,14 @@ link:{ref}/indices-get-field-mapping.html[Documentation] + |`index` |`string \| string[]` - A comma-separated list of index names +|`type` +|`string \| string[]` - A comma-separated list of document types + + +WARNING: This parameter has been deprecated. + +|`include_type_name` or `includeTypeName` +|`boolean` - Whether a type should be returned in the body of the mappings. + |`include_defaults` or `includeDefaults` |`boolean` - Whether the default mapping values should be returned as well @@ -5901,6 +4460,7 @@ link:{ref}/indices-templates.html[Documentation] + client.indices.getMapping({ index: string | string[], type: string | string[], + include_type_name: boolean, ignore_unavailable: boolean, allow_no_indices: boolean, expand_wildcards: 'open' | 'closed' | 'hidden' | 'none' | 'all', @@ -5915,7 +4475,12 @@ link:{ref}/indices-get-mapping.html[Documentation] + |`string \| string[]` - A comma-separated list of index names |`type` -|`string \| string[]` - A comma-separated list of document types to search; leave empty to perform the operation on all types +|`string \| string[]` - A comma-separated list of document types + + +WARNING: This parameter has been deprecated. + +|`include_type_name` or `includeTypeName` +|`boolean` - Whether to add the type name to the response (default: false) |`ignore_unavailable` or `ignoreUnavailable` |`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed) @@ -5992,6 +4557,7 @@ _Default:_ `all` ---- client.indices.getTemplate({ name: string | string[], + include_type_name: boolean, flat_settings: boolean, master_timeout: string, local: boolean @@ -6003,6 +4569,9 @@ link:{ref}/indices-templates.html[Documentation] + |`name` |`string \| string[]` - The comma separated names of the index templates +|`include_type_name` or `includeTypeName` +|`boolean` - Whether a type should be returned in the body of the mappings. + |`flat_settings` or `flatSettings` |`boolean` - Return settings in flat format (default: false) @@ -6088,19 +4657,12 @@ _Default:_ `closed` [source,ts] ---- -<<<<<<< HEAD -client.snapshot.delete({ - repository: string, - snapshot: string, - master_timeout: string -======= client.indices.putAlias({ index: string | string[], name: string, timeout: string, master_timeout: string, body: object ->>>>>>> a064f0f3... Improve child performances (#1314) }) ---- link:{ref}/indices-aliases.html[Documentation] + @@ -6109,16 +4671,11 @@ link:{ref}/indices-aliases.html[Documentation] + |`index` |`string \| string[]` - A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices. -<<<<<<< HEAD -|`snapshot` -|`string` - A snapshot name -======= |`name` |`string` - The name of the alias to be created or updated |`timeout` |`string` - Explicit timestamp for the document ->>>>>>> a064f0f3... Improve child performances (#1314) |`master_timeout` or `masterTimeout` |`string` - Specify timeout for connection to master @@ -6166,6 +4723,8 @@ link:{ref}/indices-templates.html[Documentation] + ---- client.indices.putMapping({ index: string | string[], + type: string, + include_type_name: boolean, timeout: string, master_timeout: string, ignore_unavailable: boolean, @@ -6181,6 +4740,14 @@ link:{ref}/indices-put-mapping.html[Documentation] + |`index` |`string \| string[]` - 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. +|`type` +|`string` - The name of the document type + + +WARNING: This parameter has been deprecated. + +|`include_type_name` or `includeTypeName` +|`boolean` - Whether a type should be expected in the body of the mappings. + |`timeout` |`string` - Explicit operation timeout @@ -6260,6 +4827,7 @@ _Default:_ `open` ---- client.indices.putTemplate({ name: string, + include_type_name: boolean, order: number, create: boolean, master_timeout: string, @@ -6272,6 +4840,9 @@ link:{ref}/indices-templates.html[Documentation] + |`name` |`string` - The name of the template +|`include_type_name` or `includeTypeName` +|`boolean` - Whether a type should be returned in the body of the mappings. + |`order` |`number` - The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers) @@ -6396,6 +4967,7 @@ _Default:_ `open` client.indices.rollover({ alias: string, new_index: string, + include_type_name: boolean, timeout: string, dry_run: boolean, master_timeout: string, @@ -6412,6 +4984,9 @@ link:{ref}/indices-rollover-index.html[Documentation] + |`new_index` or `newIndex` |`string` - The name of the rollover index +|`include_type_name` or `includeTypeName` +|`boolean` - Whether a type should be included in the body of the mappings. + |`timeout` |`string` - Explicit operation timeout @@ -6433,55 +5008,19 @@ link:{ref}/indices-rollover-index.html[Documentation] + [source,ts] ---- -<<<<<<< HEAD -client.termvectors({ - index: string, - id: string, - type: string, - term_statistics: boolean, - field_statistics: boolean, - fields: string | string[], - offsets: boolean, - positions: boolean, - payloads: boolean, - preference: string, - routing: string, - realtime: boolean, - version: number, - version_type: 'internal' | 'external' | 'external_gte' | 'force', - body: object -======= client.indices.segments({ index: string | string[], ignore_unavailable: boolean, allow_no_indices: boolean, expand_wildcards: 'open' | 'closed' | 'hidden' | 'none' | 'all', verbose: boolean ->>>>>>> a064f0f3... Improve child performances (#1314) }) ---- link:{ref}/indices-segments.html[Documentation] + [cols=2*] |=== |`index` -<<<<<<< HEAD -|`string` - The index in which the document resides. - -|`id` -|`string` - The id of the document, when not specified a doc param should be supplied. - -|`type` -|`string` - The type of the document. - -|`term_statistics` or `termStatistics` -|`boolean` - Specifies if total term frequency and document frequency should be returned. - -|`field_statistics` or `fieldStatistics` -|`boolean` - Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. + -_Default:_ `true` -======= |`string \| string[]` - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices ->>>>>>> a064f0f3... Improve child performances (#1314) |`ignore_unavailable` or `ignoreUnavailable` |`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed) @@ -6519,13 +5058,8 @@ link:{ref}/indices-shards-stores.html[Documentation] + |`status` |`string \| string[]` - A comma-separated list of statuses used to filter on shards to get store information for -<<<<<<< HEAD -|`version_type` or `versionType` -|`'internal' \| 'external' \| 'external_gte' \| 'force'` - Specific version type -======= |`ignore_unavailable` or `ignoreUnavailable` |`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed) ->>>>>>> a064f0f3... Improve child performances (#1314) |`allow_no_indices` or `allowNoIndices` |`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) @@ -6543,14 +5077,10 @@ _Default:_ `open` client.indices.shrink({ index: string, target: string, + copy_settings: boolean, timeout: string, -<<<<<<< HEAD - if_seq_no: number, - if_primary_term: number, -======= master_timeout: string, wait_for_active_shards: string, ->>>>>>> 3db1bed4... Improve child performances (#1314) body: object }) ---- @@ -6563,6 +5093,9 @@ link:{ref}/indices-shrink-index.html[Documentation] + |`target` |`string` - The name of the target index to shrink into +|`copy_settings` or `copySettings` +|`boolean` - whether or not to copy settings from the source index (defaults to false) + |`timeout` |`string` - Explicit operation timeout @@ -6575,76 +5108,17 @@ link:{ref}/indices-shrink-index.html[Documentation] + |`body` |`object` - The configuration for the target index (`settings` and `aliases`) -<<<<<<< HEAD -|`timeout` -|`string` - Explicit operation timeout - -|`if_seq_no` or `ifSeqNo` -|`number` - only perform the update operation if the last operation that has changed the document has the specified sequence number - -|`if_primary_term` or `ifPrimaryTerm` -|`number` - only perform the update operation if the last operation that has changed the document has the specified primary term - -|`body` -|`object` - The request definition requires either `script` or partial `doc` - |=== -=== updateByQuery -======= -|=== ->>>>>>> 3db1bed4... Improve child performances (#1314) - === indices.simulateIndexTemplate *Stability:* experimental [source,ts] ---- -<<<<<<< HEAD -client.updateByQuery({ - index: string | string[], - type: string | string[], - analyzer: string, - analyze_wildcard: boolean, - default_operator: 'AND' | 'OR', - df: string, - from: number, - ignore_unavailable: boolean, - allow_no_indices: boolean, - conflicts: 'abort' | 'proceed', - expand_wildcards: 'open' | 'closed' | 'hidden' | 'none' | 'all', - lenient: boolean, - pipeline: string, - preference: string, - q: string, - routing: string | string[], - scroll: string, - search_type: 'query_then_fetch' | 'dfs_query_then_fetch', - search_timeout: string, - size: number, - max_docs: number, - sort: string | string[], - _source: string | string[], - _source_excludes: string | string[], - _source_includes: string | string[], - terminate_after: number, - stats: string | string[], - version: boolean, - version_type: boolean, - request_cache: boolean, - refresh: boolean, - timeout: string, - wait_for_active_shards: string, - scroll_size: number, - wait_for_completion: boolean, - requests_per_second: number, - slices: number|string, -======= client.indices.simulateIndexTemplate({ name: string, create: boolean, cause: string, master_timeout: string, ->>>>>>> a064f0f3... Improve child performances (#1314) body: object }) ---- @@ -6654,16 +5128,8 @@ link:{ref}/indices-templates.html[Documentation] + |`name` |`string` - The name of the index (it must be a concrete index name) -<<<<<<< HEAD -|`type` -|`string \| string[]` - A comma-separated list of document types to search; leave empty to perform the operation on all types - -|`analyzer` -|`string` - The analyzer to use for the query string -======= |`create` |`boolean` - 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 ->>>>>>> a064f0f3... Improve child performances (#1314) |`cause` |`string` - User defined reason for dry-run creating the new template for simulation purposes @@ -6715,6 +5181,7 @@ link:{ref}/indices-templates.html[Documentation] + client.indices.split({ index: string, target: string, + copy_settings: boolean, timeout: string, master_timeout: string, wait_for_active_shards: string, @@ -6730,6 +5197,9 @@ link:{ref}/indices-split-index.html[Documentation] + |`target` |`string` - The name of the target index to split into +|`copy_settings` or `copySettings` +|`boolean` - whether or not to copy settings from the source index (defaults to false) + |`timeout` |`string` - Explicit operation timeout @@ -6739,16 +5209,8 @@ link:{ref}/indices-split-index.html[Documentation] + |`wait_for_active_shards` or `waitForActiveShards` |`string` - Set the number of active shards to wait for on the shrunken index before the operation returns. -<<<<<<< HEAD -|`size` -|`number` - Deprecated, please use `max_docs` instead - -|`max_docs` or `maxDocs` -|`number` - Maximum number of documents to process (default: all documents) -======= |`body` |`object` - The configuration for the target index (`settings` and `aliases`) ->>>>>>> a064f0f3... Improve child performances (#1314) |=== @@ -6929,29 +5391,6 @@ client.indices.validateQuery({ allow_no_indices: boolean, expand_wildcards: 'open' | 'closed' | 'hidden' | 'none' | 'all', q: string, -<<<<<<< HEAD - routing: string | string[], - search_type: 'query_then_fetch' | 'dfs_query_then_fetch', - size: number, - sort: string | string[], - _source: string | string[], - _source_excludes: string | string[], - _source_includes: string | string[], - terminate_after: number, - stats: string | string[], - suggest_field: string, - suggest_mode: 'missing' | 'popular' | 'always', - suggest_size: number, - suggest_text: string, - timeout: string, - track_scores: boolean, - track_total_hits: boolean, - allow_partial_search_results: boolean, - typed_keys: boolean, - version: boolean, - seq_no_primary_term: boolean, - max_concurrent_shard_requests: number, -======= analyzer: string, analyze_wildcard: boolean, default_operator: 'AND' | 'OR', @@ -6959,7 +5398,6 @@ client.indices.validateQuery({ lenient: boolean, rewrite: boolean, all_shards: boolean, ->>>>>>> a064f0f3... Improve child performances (#1314) body: object }) ---- @@ -7048,35 +5486,6 @@ link:{ref}/delete-pipeline-api.html[Documentation] + |`timeout` |`string` - Explicit operation timeout -<<<<<<< HEAD -|`track_scores` or `trackScores` -|`boolean` - Whether to calculate and return scores even if they are not used for sorting - -|`track_total_hits` or `trackTotalHits` -|`boolean` - Indicate if the number of documents that match the query should be tracked - -|`allow_partial_search_results` or `allowPartialSearchResults` -|`boolean` - Indicate if an error should be returned if there is a partial search failure or timeout + -_Default:_ `true` - -|`typed_keys` or `typedKeys` -|`boolean` - Specify whether aggregation and suggester names should be prefixed by their respective types in the response - -|`version` -|`boolean` - Specify whether to return document version as part of a hit - -|`seq_no_primary_term` or `seqNoPrimaryTerm` -|`boolean` - Specify whether to return sequence number and primary term of the last modification of each hit - -|`max_concurrent_shard_requests` or `maxConcurrentShardRequests` -|`number` - The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests + -_Default:_ `5` - -|`body` -|`object` - The search definition using the Query DSL - -======= ->>>>>>> a064f0f3... Improve child performances (#1314) |=== === ingest.getPipeline @@ -7185,9 +5594,7 @@ link:{ref}/get-license.html[Documentation] + |`boolean` - Return local information, do not retrieve the state from master node (default: false) |`accept_enterprise` or `acceptEnterprise` -|`boolean` - Supported for backwards compatibility with 7.x. If this param is used it must be set to true + - -WARNING: This parameter has been deprecated. +|`boolean` - If the active license is an enterprise license, return type as 'enterprise' (default: false) |=== @@ -7213,33 +5620,14 @@ link:{ref}/get-trial-status.html[Documentation] + [source,ts] ---- -<<<<<<< HEAD -client.cat.mlDatafeeds({ - datafeed_id: string, - allow_no_datafeeds: boolean, - format: string, - h: string | string[], - help: boolean, - s: string | string[], - time: 'd' | 'h' | 'm' | 's' | 'ms' | 'micros' | 'nanos', - v: boolean -======= client.license.post({ acknowledge: boolean, body: object ->>>>>>> 3db1bed4... Improve child performances (#1314) }) ---- link:{ref}/update-license.html[Documentation] + [cols=2*] |=== -<<<<<<< HEAD -|`datafeed_id` or `datafeedId` -|`string` - The ID of the datafeeds stats to fetch - -|`allow_no_datafeeds` or `allowNoDatafeeds` -|`boolean` - Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified) -======= |`acknowledge` |`boolean` - whether the user has acknowledged acknowledge messages (default: false) @@ -7247,7 +5635,6 @@ link:{ref}/update-license.html[Documentation] + |`object` - licenses to be installed |=== ->>>>>>> 3db1bed4... Improve child performances (#1314) === license.postStartBasic @@ -7289,20 +5676,9 @@ link:{ref}/start-trial.html[Documentation] + [source,ts] ---- -<<<<<<< HEAD -client.cat.mlJobs({ - job_id: string, - allow_no_jobs: boolean, - bytes: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb', - format: string, - h: string | string[], - help: boolean, - s: string | string[], - time: 'd' | 'h' | 'm' | 's' | 'ms' | 'micros' | 'nanos', - v: boolean -======= client.mget({ index: string, + type: string, stored_fields: string | string[], preference: string, realtime: boolean, @@ -7312,28 +5688,24 @@ client.mget({ _source_excludes: string | string[], _source_includes: string | string[], body: object ->>>>>>> 3db1bed4... Improve child performances (#1314) }) ---- link:{ref}/docs-multi-get.html[Documentation] + [cols=2*] |=== -<<<<<<< HEAD -|`job_id` or `jobId` -|`string` - The ID of the jobs stats to fetch - -|`allow_no_jobs` or `allowNoJobs` -|`boolean` - Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified) -======= |`index` |`string` - The name of the index +|`type` +|`string` - The type of the document + + +WARNING: This parameter has been deprecated. + |`stored_fields` or `storedFields` |`string \| string[]` - A comma-separated list of stored fields to return in the response |`preference` |`string` - Specify the node or shard the operation should be performed on (default: random) ->>>>>>> 3db1bed4... Improve child performances (#1314) |`realtime` |`boolean` - Specify whether to perform the operation in realtime or search mode @@ -7354,7 +5726,7 @@ link:{ref}/docs-multi-get.html[Documentation] + |`string \| string[]` - A list of fields to extract and return from the _source field |`body` -|`object` - Document identifiers; can be either `docs` (containing full document information) or `ids` (when index is provided in the URL. +|`object` - Document identifiers; can be either `docs` (containing full document information) or `ids` (when index and type is provided in the URL. |=== @@ -7380,7 +5752,6 @@ link:{ref}/migration-api-deprecation.html[Documentation] + ---- client.ml.closeJob({ job_id: string, - allow_no_match: boolean, allow_no_jobs: boolean, force: boolean, timeout: string, @@ -7393,13 +5764,8 @@ link:{ref}/ml-close-job.html[Documentation] + |`job_id` or `jobId` |`string` - The name of the job to close -|`allow_no_match` or `allowNoMatch` -|`boolean` - Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified) - |`allow_no_jobs` or `allowNoJobs` -|`boolean` - Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified) + - -WARNING: This parameter has been deprecated. +|`boolean` - Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified) |`force` |`boolean` - True if the job should be forcefully closed @@ -7661,8 +6027,6 @@ link:{ref}/ml-apis.html[Documentation] + |=== -<<<<<<< HEAD -======= === ml.evaluateDataFrame *Stability:* experimental [source,ts] @@ -7679,11 +6043,6 @@ link:{ref}/evaluate-dfanalytics.html[Documentation] + |=== -<<<<<<< HEAD ->>>>>>> 3db1bed4... Improve child performances (#1314) -=== enrich.deletePolicy - -======= === ml.explainDataFrameAnalytics *Stability:* experimental [source,ts] @@ -8009,7 +6368,6 @@ link:{ref}/ml-get-category.html[Documentation] + === ml.getDataFrameAnalytics *Stability:* experimental ->>>>>>> a064f0f3... Improve child performances (#1314) [source,ts] ---- client.ml.getDataFrameAnalytics({ @@ -8046,8 +6404,7 @@ client.ml.getDataFrameAnalyticsStats({ id: string, allow_no_match: boolean, from: number, - size: number, - verbose: boolean + size: number }) ---- link:{ref}/get-dfanalytics-stats.html[Documentation] + @@ -8067,9 +6424,6 @@ _Default:_ `true` |`number` - specifies a max number of analytics to get + _Default:_ `100` -|`verbose` -|`boolean` - whether the stats response should be verbose - |=== === ml.getDatafeedStats @@ -8078,7 +6432,6 @@ _Default:_ `100` ---- client.ml.getDatafeedStats({ datafeed_id: string, - allow_no_match: boolean, allow_no_datafeeds: boolean }) ---- @@ -8088,13 +6441,8 @@ link:{ref}/ml-get-datafeed-stats.html[Documentation] + |`datafeed_id` or `datafeedId` |`string` - The ID of the datafeeds stats to fetch -|`allow_no_match` or `allowNoMatch` -|`boolean` - Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified) - |`allow_no_datafeeds` or `allowNoDatafeeds` -|`boolean` - Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified) + - -WARNING: This parameter has been deprecated. +|`boolean` - Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified) |=== @@ -8104,7 +6452,6 @@ WARNING: This parameter has been deprecated. ---- client.ml.getDatafeeds({ datafeed_id: string, - allow_no_match: boolean, allow_no_datafeeds: boolean }) ---- @@ -8114,13 +6461,8 @@ link:{ref}/ml-get-datafeed.html[Documentation] + |`datafeed_id` or `datafeedId` |`string` - The ID of the datafeeds to fetch -|`allow_no_match` or `allowNoMatch` -|`boolean` - Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified) - |`allow_no_datafeeds` or `allowNoDatafeeds` -|`boolean` - Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified) + - -WARNING: This parameter has been deprecated. +|`boolean` - Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified) |=== @@ -8204,19 +6546,9 @@ link:{ref}/ml-get-influencer.html[Documentation] + [source,ts] ---- -<<<<<<< HEAD -client.graph.explore({ - index: string | string[], - type: string | string[], - routing: string, - timeout: string, - body: object -======= client.ml.getJobStats({ job_id: string, - allow_no_match: boolean, allow_no_jobs: boolean ->>>>>>> a064f0f3... Improve child performances (#1314) }) ---- link:{ref}/ml-get-job-stats.html[Documentation] + @@ -8225,23 +6557,8 @@ link:{ref}/ml-get-job-stats.html[Documentation] + |`job_id` or `jobId` |`string` - The ID of the jobs stats to fetch -<<<<<<< HEAD -|`type` -|`string \| string[]` - A comma-separated list of document types to search; leave empty to perform the operation on all types + - -WARNING: This parameter has been deprecated. - -|`routing` -|`string` - Specific routing value -======= -|`allow_no_match` or `allowNoMatch` -|`boolean` - Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified) ->>>>>>> a064f0f3... Improve child performances (#1314) - |`allow_no_jobs` or `allowNoJobs` -|`boolean` - Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified) + - -WARNING: This parameter has been deprecated. +|`boolean` - Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified) |=== @@ -8251,7 +6568,6 @@ WARNING: This parameter has been deprecated. ---- client.ml.getJobs({ job_id: string, - allow_no_match: boolean, allow_no_jobs: boolean }) ---- @@ -8261,13 +6577,8 @@ link:{ref}/ml-get-job.html[Documentation] + |`job_id` or `jobId` |`string` - The ID of the jobs to fetch -|`allow_no_match` or `allowNoMatch` -|`boolean` - Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified) - |`allow_no_jobs` or `allowNoJobs` -|`boolean` - Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified) + - -WARNING: This parameter has been deprecated. +|`boolean` - Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified) |=== @@ -8331,7 +6642,6 @@ client.ml.getOverallBuckets({ exclude_interim: boolean, start: string, end: string, - allow_no_match: boolean, allow_no_jobs: boolean, body: object }) @@ -8360,13 +6670,8 @@ link:{ref}/ml-get-overall-buckets.html[Documentation] + |`end` |`string` - Returns overall buckets with timestamps earlier than this time -|`allow_no_match` or `allowNoMatch` -|`boolean` - Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified) - |`allow_no_jobs` or `allowNoJobs` -|`boolean` - Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified) + - -WARNING: This parameter has been deprecated. +|`boolean` - Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified) |`body` |`object` - Overall bucket selection details if not provided in URI @@ -8432,7 +6737,7 @@ link:{ref}/ml-get-record.html[Documentation] + client.ml.getTrainedModels({ model_id: string, allow_no_match: boolean, - include: string, + include_model_definition: boolean, decompress_definition: boolean, from: number, size: number, @@ -8450,8 +6755,8 @@ link:{ref}/get-inference.html[Documentation] + |`boolean` - Whether to ignore if a wildcard expression matches no trained models. (This includes `_all` string or when no trained models have been specified) + _Default:_ `true` -|`include` -|`string` - A comma-separate list of fields to optionally include. Valid options are 'definition' and 'total_feature_importance'. Default is none. +|`include_model_definition` or `includeModelDefinition` +|`boolean` - Should the full model definition be included in the results. These definitions can be large. So be cautious when including them. Defaults to false. |`decompress_definition` or `decompressDefinition` |`boolean` - Should the model definition be decompressed into valid JSON or returned in a custom compressed format. Defaults to true. + @@ -8553,14 +6858,8 @@ link:{ref}/ml-post-calendar-event.html[Documentation] + ---- client.ml.postData({ job_id: string, -<<<<<<< HEAD - allow_no_jobs: boolean, - force: boolean, - timeout: string, -======= reset_start: string, reset_end: string, ->>>>>>> 3db1bed4... Improve child performances (#1314) body: object }) ---- @@ -8568,14 +6867,7 @@ link:{ref}/ml-post-data.html[Documentation] + [cols=2*] |=== |`job_id` or `jobId` -<<<<<<< HEAD -|`string` - The name of the job to close - -|`allow_no_jobs` or `allowNoJobs` -|`boolean` - Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified) -======= |`string` - The name of the job receiving the data ->>>>>>> 3db1bed4... Improve child performances (#1314) |`reset_start` or `resetStart` |`string` - Optional parameter to specify the start of the bucket resetting range @@ -8656,35 +6948,8 @@ client.ml.putDataFrameAnalytics({ link:{ref}/put-dfanalytics.html[Documentation] + [cols=2*] |=== -<<<<<<< HEAD -|`local` -|`boolean` - Return local information, do not retrieve the state from master node (default: false) - -|`accept_enterprise` or `acceptEnterprise` -|`boolean` - If the active license is an enterprise license, return type as 'enterprise' (default: false) - -|=== - -=== license.getBasicStatus - -[source,ts] ----- -client.license.getBasicStatus() ----- -link:{ref}/get-basic-status.html[Documentation] + - - -=== license.getTrialStatus - -[source,ts] ----- -client.license.getTrialStatus() ----- -link:{ref}/get-trial-status.html[Documentation] + -======= |`id` |`string` - The ID of the data frame analytics to create ->>>>>>> a064f0f3... Improve child performances (#1314) |`body` |`object` - The data frame analytics configuration @@ -8929,11 +7194,9 @@ link:{ref}/stop-dfanalytics.html[Documentation] + ---- client.ml.stopDatafeed({ datafeed_id: string, - allow_no_match: boolean, allow_no_datafeeds: boolean, force: boolean, - timeout: string, - body: object + timeout: string }) ---- link:{ref}/ml-stop-datafeed.html[Documentation] + @@ -8942,13 +7205,8 @@ link:{ref}/ml-stop-datafeed.html[Documentation] + |`datafeed_id` or `datafeedId` |`string` - The ID of the datafeed to stop -|`allow_no_match` or `allowNoMatch` -|`boolean` - Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified) - |`allow_no_datafeeds` or `allowNoDatafeeds` -|`boolean` - Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified) + - -WARNING: This parameter has been deprecated. +|`boolean` - Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified) |`force` |`boolean` - True if the datafeed should be forcefully stopped. @@ -8956,9 +7214,6 @@ WARNING: This parameter has been deprecated. |`timeout` |`string` - Controls the time to wait until a datafeed has stopped. Default to 20 seconds -|`body` -|`object` - The URL params optionally sent in the body - |=== === ml.updateDataFrameAnalytics @@ -9151,15 +7406,9 @@ WARNING: This parameter has been deprecated. [source,ts] ---- -<<<<<<< HEAD -client.ml.getDataFrameAnalyticsStats({ - id: string, - allow_no_match: boolean, - from: number, - size: number -======= client.msearch({ index: string | string[], + type: string | string[], search_type: 'query_then_fetch' | 'query_and_fetch' | 'dfs_query_then_fetch' | 'dfs_query_and_fetch', max_concurrent_searches: number, typed_keys: boolean, @@ -9168,7 +7417,6 @@ client.msearch({ rest_total_hits_as_int: boolean, ccs_minimize_roundtrips: boolean, body: object ->>>>>>> 3db1bed4... Improve child performances (#1314) }) ---- link:{ref}/search-multi-search.html[Documentation] + @@ -9178,39 +7426,21 @@ link:{ref}/search-multi-search.html[Documentation] + |`index` |`string \| string[]` - A comma-separated list of index names to use as default +|`type` +|`string \| string[]` - A comma-separated list of document types to use as default + |`search_type` or `searchType` |`'query_then_fetch' \| 'query_and_fetch' \| 'dfs_query_then_fetch' \| 'dfs_query_and_fetch'` - Search operation type -<<<<<<< HEAD -|=== -======= |`max_concurrent_searches` or `maxConcurrentSearches` |`number` - Controls the maximum number of concurrent searches the multi search api will execute |`typed_keys` or `typedKeys` |`boolean` - Specify whether aggregation and suggester names should be prefixed by their respective types in the response ->>>>>>> 3db1bed4... Improve child performances (#1314) |`pre_filter_shard_size` or `preFilterShardSize` |`number` - A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint. -<<<<<<< HEAD -[source,ts] ----- -client.ml.getDatafeedStats({ - datafeed_id: string, - allow_no_datafeeds: boolean -}) ----- -link:{ref}/ml-get-datafeed-stats.html[Documentation] + -[cols=2*] -|=== -|`datafeed_id` or `datafeedId` -|`string` - The ID of the datafeeds stats to fetch - -|`allow_no_datafeeds` or `allowNoDatafeeds` -|`boolean` - Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified) -======= |`max_concurrent_shard_requests` or `maxConcurrentShardRequests` |`number` - The number of concurrent shard requests each sub search executes concurrently per node. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests + _Default:_ `5` @@ -9224,7 +7454,6 @@ _Default:_ `true` |`body` |`object` - The request definitions (metadata-search request definition pairs), separated by newlines ->>>>>>> 3db1bed4... Improve child performances (#1314) |=== @@ -9232,38 +7461,28 @@ _Default:_ `true` [source,ts] ---- -<<<<<<< HEAD -client.ml.getDatafeeds({ - datafeed_id: string, - allow_no_datafeeds: boolean -======= client.msearchTemplate({ index: string | string[], + type: string | string[], search_type: 'query_then_fetch' | 'query_and_fetch' | 'dfs_query_then_fetch' | 'dfs_query_and_fetch', typed_keys: boolean, max_concurrent_searches: number, rest_total_hits_as_int: boolean, ccs_minimize_roundtrips: boolean, body: object ->>>>>>> 3db1bed4... Improve child performances (#1314) }) ---- link:{ref}/search-multi-search.html[Documentation] + [cols=2*] |=== -<<<<<<< HEAD -|`datafeed_id` or `datafeedId` -|`string` - The ID of the datafeeds to fetch - -|`allow_no_datafeeds` or `allowNoDatafeeds` -|`boolean` - Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified) -======= |`index` |`string \| string[]` - A comma-separated list of index names to use as default +|`type` +|`string \| string[]` - A comma-separated list of document types to use as default + |`search_type` or `searchType` |`'query_then_fetch' \| 'query_and_fetch' \| 'dfs_query_then_fetch' \| 'dfs_query_and_fetch'` - Search operation type ->>>>>>> 3db1bed4... Improve child performances (#1314) |`typed_keys` or `typedKeys` |`boolean` - Specify whether aggregation and suggester names should be prefixed by their respective types in the response @@ -9289,6 +7508,7 @@ _Default:_ `true` ---- client.mtermvectors({ index: string, + type: string, ids: string | string[], term_statistics: boolean, field_statistics: boolean, @@ -9300,7 +7520,7 @@ client.mtermvectors({ routing: string, realtime: boolean, version: number, - version_type: 'internal' | 'external' | 'external_gte', + version_type: 'internal' | 'external' | 'external_gte' | 'force', body: object }) ---- @@ -9310,6 +7530,9 @@ link:{ref}/docs-multi-termvectors.html[Documentation] + |`index` |`string` - The index in which the document resides. +|`type` +|`string` - The type of the document. + |`ids` |`string \| string[]` - A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body @@ -9348,7 +7571,7 @@ _Default:_ `true` |`number` - Explicit version number for concurrency control |`version_type` or `versionType` -|`'internal' \| 'external' \| 'external_gte'` - Specific version type +|`'internal' \| 'external' \| 'external_gte' \| 'force'` - Specific version type |`body` |`object` - Define ids, documents, parameters or a list of parameters per document here. You must at least provide a list of document ids. See documentation. @@ -9359,11 +7582,6 @@ _Default:_ `true` [source,ts] ---- -<<<<<<< HEAD -client.ml.getJobStats({ - job_id: string, - allow_no_jobs: boolean -======= client.nodes.hotThreads({ node_id: string | string[], interval: string, @@ -9372,7 +7590,6 @@ client.nodes.hotThreads({ ignore_idle_threads: boolean, type: 'cpu' | 'wait' | 'block', timeout: string ->>>>>>> 3db1bed4... Improve child performances (#1314) }) ---- link:{ref}/cluster-nodes-hot-threads.html[Documentation] + @@ -9381,10 +7598,6 @@ link:{ref}/cluster-nodes-hot-threads.html[Documentation] + |`node_id` or `nodeId` |`string \| string[]` - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes -<<<<<<< HEAD -|`allow_no_jobs` or `allowNoJobs` -|`boolean` - Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified) -======= |`interval` |`string` - The interval for the second sampling of threads @@ -9402,7 +7615,6 @@ link:{ref}/cluster-nodes-hot-threads.html[Documentation] + |`timeout` |`string` - Explicit operation timeout ->>>>>>> 3db1bed4... Improve child performances (#1314) |=== @@ -9410,17 +7622,11 @@ link:{ref}/cluster-nodes-hot-threads.html[Documentation] + [source,ts] ---- -<<<<<<< HEAD -client.ml.getJobs({ - job_id: string, - allow_no_jobs: boolean -======= client.nodes.info({ node_id: string | string[], metric: string | string[], flat_settings: boolean, timeout: string ->>>>>>> 3db1bed4... Improve child performances (#1314) }) ---- link:{ref}/cluster-nodes-info.html[Documentation] + @@ -9429,10 +7635,6 @@ link:{ref}/cluster-nodes-info.html[Documentation] + |`node_id` or `nodeId` |`string \| string[]` - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes -<<<<<<< HEAD -|`allow_no_jobs` or `allowNoJobs` -|`boolean` - Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified) -======= |`metric` |`string \| string[]` - A comma-separated list of metrics you wish returned. Leave empty to return all. @@ -9441,7 +7643,6 @@ link:{ref}/cluster-nodes-info.html[Documentation] + |`timeout` |`string` - Explicit operation timeout ->>>>>>> 3db1bed4... Improve child performances (#1314) |=== @@ -9473,18 +7674,6 @@ link:{ref}/secure-settings.html#reloadable-secure-settings[Documentation] + [source,ts] ---- -<<<<<<< HEAD -client.ml.getOverallBuckets({ - job_id: string, - top_n: number, - bucket_span: string, - overall_score: number, - exclude_interim: boolean, - start: string, - end: string, - allow_no_jobs: boolean, - body: object -======= client.nodes.stats({ node_id: string | string[], metric: string | string[], @@ -9497,7 +7686,6 @@ client.nodes.stats({ types: string | string[], timeout: string, include_segment_file_sizes: boolean ->>>>>>> 3db1bed4... Improve child performances (#1314) }) ---- link:{ref}/cluster-nodes-stats.html[Documentation] + @@ -9524,10 +7712,6 @@ link:{ref}/cluster-nodes-stats.html[Documentation] + |`groups` |`boolean` - A comma-separated list of search groups for `search` index metric -<<<<<<< HEAD -|`allow_no_jobs` or `allowNoJobs` -|`boolean` - Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified) -======= |`level` |`'indices' \| 'node' \| 'shards'` - Return indices stats aggregated at index, node or shard level + _Default:_ `node` @@ -9537,7 +7721,6 @@ _Default:_ `node` |`timeout` |`string` - Explicit operation timeout ->>>>>>> 3db1bed4... Improve child performances (#1314) |`include_segment_file_sizes` or `includeSegmentFileSizes` |`boolean` - Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested) @@ -9568,43 +7751,6 @@ link:{ref}/cluster-nodes-usage.html[Documentation] + |=== -=== openPointInTime - -[source,ts] ----- -client.openPointInTime({ - index: string | string[], - preference: string, - routing: string, - ignore_unavailable: boolean, - expand_wildcards: 'open' | 'closed' | 'hidden' | 'none' | 'all', - keep_alive: string -}) ----- -link:{ref}/point-in-time-api.html[Documentation] + -[cols=2*] -|=== -|`index` -|`string \| string[]` - A comma-separated list of index names to open point in time; use `_all` or empty string to perform the operation on all indices - -|`preference` -|`string` - Specify the node or shard the operation should be performed on (default: random) - -|`routing` -|`string` - Specific routing value - -|`ignore_unavailable` or `ignoreUnavailable` -|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed) - -|`expand_wildcards` or `expandWildcards` -|`'open' \| 'closed' \| 'hidden' \| 'none' \| 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. + -_Default:_ `open` - -|`keep_alive` or `keepAlive` -|`string` - Specific the time to live for the point in time - -|=== - === ping [source,ts] @@ -9985,15 +8131,9 @@ WARNING: This parameter has been deprecated. [source,ts] ---- -<<<<<<< HEAD -client.ml.stopDatafeed({ - datafeed_id: string, - allow_no_datafeeds: boolean, - force: boolean, - timeout: string -======= client.search({ index: string | string[], + type: string | string[], analyzer: string, analyze_wildcard: boolean, ccs_minimize_roundtrips: boolean, @@ -10026,7 +8166,7 @@ client.search({ suggest_text: string, timeout: string, track_scores: boolean, - track_total_hits: boolean|long, + track_total_hits: boolean, allow_partial_search_results: boolean, typed_keys: boolean, version: boolean, @@ -10046,6 +8186,9 @@ link:{ref}/search-search.html[Documentation] + |`index` |`string \| string[]` - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices +|`type` +|`string \| string[]` - A comma-separated list of document types to search; leave empty to perform the operation on all types + |`analyzer` |`string` - The analyzer to use for the query string @@ -10147,7 +8290,7 @@ _Default:_ `missing` |`boolean` - Whether to calculate and return scores even if they are not used for sorting |`track_total_hits` or `trackTotalHits` -|`boolean\|long` - Indicate if the number of documents that match the query should be tracked. A number can also be specified, to accurately track the total hit count up to the number. +|`boolean` - Indicate if the number of documents that match the query should be tracked |`allow_partial_search_results` or `allowPartialSearchResults` |`boolean` - Indicate if an error should be returned if there is a partial search failure or timeout + @@ -10231,6 +8374,7 @@ _Default:_ `open` ---- client.searchTemplate({ index: string | string[], + type: string | string[], ignore_unavailable: boolean, ignore_throttled: boolean, allow_no_indices: boolean, @@ -10245,7 +8389,6 @@ client.searchTemplate({ rest_total_hits_as_int: boolean, ccs_minimize_roundtrips: boolean, body: object ->>>>>>> 3db1bed4... Improve child performances (#1314) }) ---- link:{ref}/search-template.html[Documentation] + @@ -10254,6 +8397,9 @@ link:{ref}/search-template.html[Documentation] + |`index` |`string \| string[]` - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices +|`type` +|`string \| string[]` - A comma-separated list of document types to search; leave empty to perform the operation on all types + |`ignore_unavailable` or `ignoreUnavailable` |`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed) @@ -10311,16 +8457,12 @@ client.searchableSnapshots.clearCache({ expand_wildcards: 'open' | 'closed' | 'none' | 'all' }) ---- -link:{ref}/searchable-snapshots-apis.html[Documentation] + +link:{ref}/searchable-snapshots-api-clear-cache.html[Documentation] + [cols=2*] |=== |`index` |`string \| string[]` - A comma-separated list of index names -<<<<<<< HEAD -|`allow_no_datafeeds` or `allowNoDatafeeds` -|`boolean` - Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified) -======= |`ignore_unavailable` or `ignoreUnavailable` |`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed) @@ -10330,7 +8472,6 @@ link:{ref}/searchable-snapshots-apis.html[Documentation] + |`expand_wildcards` or `expandWildcards` |`'open' \| 'closed' \| 'none' \| 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. + _Default:_ `open` ->>>>>>> 3db1bed4... Improve child performances (#1314) |=== @@ -10361,12 +8502,9 @@ link:{ref}/searchable-snapshots-api-mount-snapshot.html[Documentation] + |`wait_for_completion` or `waitForCompletion` |`boolean` - Should this request wait until the operation has completed before returning -<<<<<<< HEAD -======= |`body` |`object` - The restore configuration for mounting the snapshot as searchable ->>>>>>> 3db1bed4... Improve child performances (#1314) |=== === searchableSnapshots.repositoryStats @@ -10377,7 +8515,7 @@ client.searchableSnapshots.repositoryStats({ repository: string }) ---- -link:{ref}/searchable-snapshots-apis.html[Documentation] + +link:{ref}/searchable-snapshots-repository-stats.html[Documentation] + [cols=2*] |=== |`repository` @@ -10393,7 +8531,7 @@ client.searchableSnapshots.stats({ index: string | string[] }) ---- -link:{ref}/searchable-snapshots-apis.html[Documentation] + +link:{ref}/searchable-snapshots-api-stats.html[Documentation] + [cols=2*] |=== |`index` @@ -10662,10 +8800,6 @@ link:{ref}/security-api-get-api-key.html[Documentation] + |=== -<<<<<<< HEAD -=== rollup.deleteJob -*Stability:* experimental -======= === security.getBuiltinPrivileges [source,ts] @@ -10700,31 +8834,30 @@ link:{ref}/security-api-get-privileges.html[Documentation] + [source,ts] ---- client.security.getRole({ - name: string | string[] + name: string }) ---- link:{ref}/security-api-get-role.html[Documentation] + [cols=2*] |=== |`name` -|`string \| string[]` - A comma-separated list of role names +|`string` - Role name |=== === security.getRoleMapping ->>>>>>> 3db1bed4... Improve child performances (#1314) [source,ts] ---- client.security.getRoleMapping({ - name: string | string[] + name: string }) ---- link:{ref}/security-api-get-role-mapping.html[Documentation] + [cols=2*] |=== |`name` -|`string \| string[]` - A comma-separated list of role-mapping names +|`string` - Role-Mapping name |=== @@ -10875,11 +9008,7 @@ client.security.putRoleMapping({ body: object }) ---- -<<<<<<< HEAD -link:{ref}/searchable-snapshots-api-clear-cache.html[Documentation] + -======= link:{ref}/security-api-put-role-mapping.html[Documentation] + ->>>>>>> 3db1bed4... Improve child performances (#1314) [cols=2*] |=== |`name` @@ -10925,11 +9054,7 @@ client.slm.deleteLifecycle({ policy_id: string }) ---- -<<<<<<< HEAD -link:{ref}/searchable-snapshots-repository-stats.html[Documentation] + -======= link:{ref}/slm-api-delete-policy.html[Documentation] + ->>>>>>> 3db1bed4... Improve child performances (#1314) [cols=2*] |=== |`policy_id` or `policyId` @@ -10945,11 +9070,7 @@ client.slm.executeLifecycle({ policy_id: string }) ---- -<<<<<<< HEAD -link:{ref}/searchable-snapshots-api-stats.html[Documentation] + -======= link:{ref}/slm-api-execute-lifecycle.html[Documentation] + ->>>>>>> 3db1bed4... Improve child performances (#1314) [cols=2*] |=== |`policy_id` or `policyId` @@ -11132,7 +9253,7 @@ link:{ref}/modules-snapshots.html[Documentation] + ---- client.snapshot.delete({ repository: string, - snapshot: string | string[], + snapshot: string, master_timeout: string }) ---- @@ -11143,7 +9264,7 @@ link:{ref}/modules-snapshots.html[Documentation] + |`string` - A repository name |`snapshot` -|`string \| string[]` - A comma-separated list of snapshot names +|`string` - A snapshot name |`master_timeout` or `masterTimeout` |`string` - Explicit operation timeout for connection to master node @@ -11234,26 +9355,17 @@ link:{ref}/modules-snapshots.html[Documentation] + [source,ts] ---- -<<<<<<< HEAD -client.security.getRole({ - name: string -======= client.snapshot.restore({ repository: string, snapshot: string, master_timeout: string, wait_for_completion: boolean, body: object ->>>>>>> a064f0f3... Improve child performances (#1314) }) ---- link:{ref}/modules-snapshots.html[Documentation] + [cols=2*] |=== -<<<<<<< HEAD -|`name` -|`string` - Role name -======= |`repository` |`string` - A repository name @@ -11268,7 +9380,6 @@ link:{ref}/modules-snapshots.html[Documentation] + |`body` |`object` - Details of what to restore ->>>>>>> a064f0f3... Improve child performances (#1314) |=== @@ -11276,25 +9387,16 @@ link:{ref}/modules-snapshots.html[Documentation] + [source,ts] ---- -<<<<<<< HEAD -client.security.getRoleMapping({ - name: string -======= client.snapshot.status({ repository: string, snapshot: string | string[], master_timeout: string, ignore_unavailable: boolean ->>>>>>> a064f0f3... Improve child performances (#1314) }) ---- link:{ref}/modules-snapshots.html[Documentation] + [cols=2*] |=== -<<<<<<< HEAD -|`name` -|`string` - Role-Mapping name -======= |`repository` |`string` - A repository name @@ -11306,7 +9408,6 @@ link:{ref}/modules-snapshots.html[Documentation] + |`ignore_unavailable` or `ignoreUnavailable` |`boolean` - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown ->>>>>>> a064f0f3... Improve child performances (#1314) |=== @@ -11500,6 +9601,7 @@ _Default:_ `nodes` client.termvectors({ index: string, id: string, + type: string, term_statistics: boolean, field_statistics: boolean, fields: string | string[], @@ -11510,7 +9612,7 @@ client.termvectors({ routing: string, realtime: boolean, version: number, - version_type: 'internal' | 'external' | 'external_gte', + version_type: 'internal' | 'external' | 'external_gte' | 'force', body: object }) ---- @@ -11523,6 +9625,9 @@ link:{ref}/docs-termvectors.html[Documentation] + |`id` |`string` - The id of the document, when not specified a doc param should be supplied. +|`type` +|`string` - The type of the document. + |`term_statistics` or `termStatistics` |`boolean` - Specifies if total term frequency and document frequency should be returned. @@ -11558,7 +9663,7 @@ _Default:_ `true` |`number` - Explicit version number for concurrency control |`version_type` or `versionType` -|`'internal' \| 'external' \| 'external_gte'` - Specific version type +|`'internal' \| 'external' \| 'external_gte' \| 'force'` - Specific version type |`body` |`object` - Define parameters and or supply a document to get termvectors for. See documentation. @@ -11780,7 +9885,6 @@ client.update({ timeout: string, if_seq_no: number, if_primary_term: number, - require_alias: boolean, body: object }) ---- @@ -11832,9 +9936,6 @@ WARNING: This parameter has been deprecated. |`if_primary_term` or `ifPrimaryTerm` |`number` - only perform the update operation if the last operation that has changed the document has the specified primary term -|`require_alias` or `requireAlias` -|`boolean` - When true, requires destination is an alias. Default is false - |`body` |`object` - The request definition requires either `script` or partial `doc` @@ -11846,6 +9947,7 @@ WARNING: This parameter has been deprecated. ---- client.updateByQuery({ index: string | string[], + type: string | string[], analyzer: string, analyze_wildcard: boolean, default_operator: 'AND' | 'OR', @@ -11863,6 +9965,7 @@ client.updateByQuery({ scroll: string, search_type: 'query_then_fetch' | 'dfs_query_then_fetch', search_timeout: string, + size: number, max_docs: number, sort: string | string[], _source: string | string[], @@ -11890,6 +9993,9 @@ link:{ref}/docs-update-by-query.html[Documentation] + |`index` |`string \| string[]` - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices +|`type` +|`string \| string[]` - A comma-separated list of document types to search; leave empty to perform the operation on all types + |`analyzer` |`string` - The analyzer to use for the query string @@ -11944,6 +10050,9 @@ _Default:_ `open` |`search_timeout` or `searchTimeout` |`string` - Explicit timeout for each search request. Defaults to no timeout. +|`size` +|`number` - Deprecated, please use `max_docs` instead + |`max_docs` or `maxDocs` |`number` - Maximum number of documents to process (default: all documents)