@elastic/elasticsearch 7.9.0 → 7.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/api/async_search.js +114 -0
- package/api/api/autoscaling.js +147 -0
- package/api/api/bulk.js +55 -98
- package/api/api/cat.js +648 -0
- package/api/api/ccr.js +403 -0
- package/api/api/clear_scroll.js +42 -69
- package/api/api/cluster.js +420 -0
- package/api/api/count.js +49 -98
- package/api/api/create.js +54 -92
- package/api/api/dangling_indices.js +115 -0
- package/api/api/delete.js +50 -89
- package/api/api/delete_by_query.js +55 -135
- package/api/api/delete_by_query_rethrottle.js +45 -74
- package/api/api/delete_script.js +41 -71
- package/api/api/enrich.js +173 -0
- package/api/api/eql.js +119 -0
- package/api/api/exists.js +50 -95
- package/api/api/exists_source.js +58 -101
- package/api/api/explain.js +50 -98
- package/api/api/field_caps.js +42 -78
- package/api/api/get.js +50 -95
- package/api/api/get_script.js +41 -70
- package/api/api/get_script_context.js +37 -64
- package/api/api/get_script_languages.js +37 -64
- package/api/api/get_source.js +50 -93
- package/api/api/graph.js +72 -0
- package/api/api/ilm.js +295 -0
- package/api/api/index.js +56 -98
- package/api/api/indices.js +1656 -0
- package/api/api/info.js +37 -64
- package/api/api/ingest.js +178 -0
- package/api/api/license.js +188 -0
- package/api/api/mget.js +55 -97
- package/api/api/migration.js +60 -0
- package/api/api/ml.js +1842 -0
- package/api/api/monitoring.js +66 -0
- package/api/api/msearch.js +55 -96
- package/api/api/msearch_template.js +55 -92
- package/api/api/mtermvectors.js +49 -91
- package/api/api/nodes.js +202 -0
- package/api/api/ping.js +37 -64
- package/api/api/put_script.js +55 -86
- package/api/api/rank_eval.js +46 -81
- package/api/api/reindex.js +41 -82
- package/api/api/reindex_rethrottle.js +45 -74
- package/api/api/render_search_template.js +42 -69
- package/api/api/rollup.js +278 -0
- package/api/api/scripts_painless_execute.js +37 -64
- package/api/api/scroll.js +42 -74
- package/api/api/search.js +49 -149
- package/api/api/search_shards.js +42 -78
- package/api/api/search_template.js +55 -103
- package/api/api/searchable_snapshots.js +159 -0
- package/api/api/security.js +805 -0
- package/api/api/slm.js +256 -0
- package/api/api/snapshot.js +363 -0
- package/api/api/sql.js +119 -0
- package/api/api/ssl.js +55 -0
- package/api/api/tasks.js +108 -0
- package/api/api/termvectors.js +52 -93
- package/api/api/transform.js +268 -0
- package/api/api/update.js +54 -102
- package/api/api/update_by_query.js +51 -135
- package/api/api/update_by_query_rethrottle.js +45 -74
- package/api/api/watcher.js +311 -0
- package/api/api/xpack.js +76 -0
- package/api/index.js +408 -685
- package/api/requestParams.d.ts +813 -813
- package/api/utils.js +58 -0
- package/index.js +49 -48
- package/lib/Connection.d.ts +1 -1
- package/lib/Connection.js +1 -0
- package/lib/Helpers.js +4 -3
- package/lib/Transport.js +31 -25
- package/package.json +1 -1
- package/api/api/async_search.delete.js +0 -78
- package/api/api/async_search.get.js +0 -82
- package/api/api/async_search.submit.js +0 -147
- package/api/api/autoscaling.delete_autoscaling_policy.js +0 -78
- package/api/api/autoscaling.get_autoscaling_decision.js +0 -72
- package/api/api/autoscaling.get_autoscaling_policy.js +0 -78
- package/api/api/autoscaling.put_autoscaling_policy.js +0 -82
- package/api/api/cat.aliases.js +0 -90
- package/api/api/cat.allocation.js +0 -91
- package/api/api/cat.count.js +0 -87
- package/api/api/cat.fielddata.js +0 -89
- package/api/api/cat.health.js +0 -84
- package/api/api/cat.help.js +0 -79
- package/api/api/cat.indices.js +0 -98
- package/api/api/cat.master.js +0 -85
- package/api/api/cat.ml_data_frame_analytics.js +0 -85
- package/api/api/cat.ml_datafeeds.js +0 -84
- package/api/api/cat.ml_jobs.js +0 -85
- package/api/api/cat.ml_trained_models.js +0 -87
- package/api/api/cat.nodeattrs.js +0 -85
- package/api/api/cat.nodes.js +0 -89
- package/api/api/cat.pending_tasks.js +0 -86
- package/api/api/cat.plugins.js +0 -85
- package/api/api/cat.recovery.js +0 -93
- package/api/api/cat.repositories.js +0 -85
- package/api/api/cat.segments.js +0 -88
- package/api/api/cat.shards.js +0 -92
- package/api/api/cat.snapshots.js +0 -92
- package/api/api/cat.tasks.js +0 -89
- package/api/api/cat.templates.js +0 -90
- package/api/api/cat.thread_pool.js +0 -92
- package/api/api/cat.transforms.js +0 -86
- package/api/api/ccr.delete_auto_follow_pattern.js +0 -78
- package/api/api/ccr.follow.js +0 -82
- package/api/api/ccr.follow_info.js +0 -78
- package/api/api/ccr.follow_stats.js +0 -78
- package/api/api/ccr.forget_follower.js +0 -82
- package/api/api/ccr.get_auto_follow_pattern.js +0 -77
- package/api/api/ccr.pause_auto_follow_pattern.js +0 -78
- package/api/api/ccr.pause_follow.js +0 -78
- package/api/api/ccr.put_auto_follow_pattern.js +0 -82
- package/api/api/ccr.resume_auto_follow_pattern.js +0 -78
- package/api/api/ccr.resume_follow.js +0 -78
- package/api/api/ccr.stats.js +0 -72
- package/api/api/ccr.unfollow.js +0 -78
- package/api/api/cluster.allocation_explain.js +0 -81
- package/api/api/cluster.delete_component_template.js +0 -86
- package/api/api/cluster.delete_voting_config_exclusions.js +0 -79
- package/api/api/cluster.exists_component_template.js +0 -86
- package/api/api/cluster.get_component_template.js +0 -85
- package/api/api/cluster.get_settings.js +0 -84
- package/api/api/cluster.health.js +0 -101
- package/api/api/cluster.pending_tasks.js +0 -81
- package/api/api/cluster.post_voting_config_exclusions.js +0 -82
- package/api/api/cluster.put_component_template.js +0 -91
- package/api/api/cluster.put_settings.js +0 -88
- package/api/api/cluster.remote_info.js +0 -77
- package/api/api/cluster.reroute.js +0 -86
- package/api/api/cluster.state.js +0 -106
- package/api/api/cluster.stats.js +0 -85
- package/api/api/dangling_indices.delete_dangling_index.js +0 -88
- package/api/api/dangling_indices.import_dangling_index.js +0 -88
- package/api/api/dangling_indices.list_dangling_indices.js +0 -77
- package/api/api/enrich.delete_policy.js +0 -78
- package/api/api/enrich.execute_policy.js +0 -78
- package/api/api/enrich.get_policy.js +0 -77
- package/api/api/enrich.put_policy.js +0 -82
- package/api/api/enrich.stats.js +0 -72
- package/api/api/eql.delete.js +0 -78
- package/api/api/eql.get.js +0 -80
- package/api/api/eql.search.js +0 -86
- package/api/api/graph.explore.js +0 -90
- package/api/api/ilm.delete_lifecycle.js +0 -78
- package/api/api/ilm.explain_lifecycle.js +0 -80
- package/api/api/ilm.get_lifecycle.js +0 -77
- package/api/api/ilm.get_status.js +0 -72
- package/api/api/ilm.move_to_step.js +0 -78
- package/api/api/ilm.put_lifecycle.js +0 -78
- package/api/api/ilm.remove_policy.js +0 -78
- package/api/api/ilm.retry.js +0 -78
- package/api/api/ilm.start.js +0 -72
- package/api/api/ilm.stop.js +0 -72
- package/api/api/indices.add_block.js +0 -102
- package/api/api/indices.analyze.js +0 -83
- package/api/api/indices.clear_cache.js +0 -93
- package/api/api/indices.clone.js +0 -98
- package/api/api/indices.close.js +0 -94
- package/api/api/indices.create.js +0 -90
- package/api/api/indices.create_data_stream.js +0 -78
- package/api/api/indices.data_streams_stats.js +0 -77
- package/api/api/indices.delete.js +0 -92
- package/api/api/indices.delete_alias.js +0 -101
- package/api/api/indices.delete_data_stream.js +0 -78
- package/api/api/indices.delete_index_template.js +0 -86
- package/api/api/indices.delete_template.js +0 -86
- package/api/api/indices.exists.js +0 -94
- package/api/api/indices.exists_alias.js +0 -95
- package/api/api/indices.exists_index_template.js +0 -88
- package/api/api/indices.exists_template.js +0 -88
- package/api/api/indices.exists_type.js +0 -100
- package/api/api/indices.flush.js +0 -91
- package/api/api/indices.flush_synced.js +0 -88
- package/api/api/indices.forcemerge.js +0 -93
- package/api/api/indices.freeze.js +0 -87
- package/api/api/indices.get.js +0 -98
- package/api/api/indices.get_alias.js +0 -95
- package/api/api/indices.get_data_stream.js +0 -77
- package/api/api/indices.get_field_mapping.js +0 -105
- package/api/api/indices.get_index_template.js +0 -87
- package/api/api/indices.get_mapping.js +0 -99
- package/api/api/indices.get_settings.js +0 -101
- package/api/api/indices.get_template.js +0 -89
- package/api/api/indices.get_upgrade.js +0 -88
- package/api/api/indices.open.js +0 -94
- package/api/api/indices.put_alias.js +0 -101
- package/api/api/indices.put_index_template.js +0 -91
- package/api/api/indices.put_mapping.js +0 -119
- package/api/api/indices.put_settings.js +0 -101
- package/api/api/indices.put_template.js +0 -93
- package/api/api/indices.recovery.js +0 -85
- package/api/api/indices.refresh.js +0 -88
- package/api/api/indices.reload_search_analyzers.js +0 -82
- package/api/api/indices.resolve_index.js +0 -85
- package/api/api/indices.rollover.js +0 -104
- package/api/api/indices.segments.js +0 -89
- package/api/api/indices.shard_stores.js +0 -89
- package/api/api/indices.shrink.js +0 -100
- package/api/api/indices.simulate_index_template.js +0 -87
- package/api/api/indices.simulate_template.js +0 -86
- package/api/api/indices.split.js +0 -100
- package/api/api/indices.stats.js +0 -104
- package/api/api/indices.unfreeze.js +0 -87
- package/api/api/indices.update_aliases.js +0 -86
- package/api/api/indices.upgrade.js +0 -92
- package/api/api/indices.validate_query.js +0 -109
- package/api/api/ingest.delete_pipeline.js +0 -86
- package/api/api/ingest.get_pipeline.js +0 -84
- package/api/api/ingest.processor_grok.js +0 -77
- package/api/api/ingest.put_pipeline.js +0 -90
- package/api/api/ingest.simulate.js +0 -89
- package/api/api/license.delete.js +0 -72
- package/api/api/license.get.js +0 -73
- package/api/api/license.get_basic_status.js +0 -72
- package/api/api/license.get_trial_status.js +0 -72
- package/api/api/license.post.js +0 -72
- package/api/api/license.post_start_basic.js +0 -72
- package/api/api/license.post_start_trial.js +0 -73
- package/api/api/migration.deprecations.js +0 -77
- package/api/api/ml.close_job.js +0 -81
- package/api/api/ml.delete_calendar.js +0 -78
- package/api/api/ml.delete_calendar_event.js +0 -88
- package/api/api/ml.delete_calendar_job.js +0 -88
- package/api/api/ml.delete_data_frame_analytics.js +0 -79
- package/api/api/ml.delete_datafeed.js +0 -78
- package/api/api/ml.delete_expired_data.js +0 -79
- package/api/api/ml.delete_filter.js +0 -78
- package/api/api/ml.delete_forecast.js +0 -91
- package/api/api/ml.delete_job.js +0 -79
- package/api/api/ml.delete_model_snapshot.js +0 -88
- package/api/api/ml.delete_trained_model.js +0 -78
- package/api/api/ml.estimate_model_memory.js +0 -78
- package/api/api/ml.evaluate_data_frame.js +0 -78
- package/api/api/ml.explain_data_frame_analytics.js +0 -77
- package/api/api/ml.find_file_structure.js +0 -99
- package/api/api/ml.flush_job.js +0 -84
- package/api/api/ml.forecast.js +0 -81
- package/api/api/ml.get_buckets.js +0 -99
- package/api/api/ml.get_calendar_events.js +0 -83
- package/api/api/ml.get_calendars.js +0 -78
- package/api/api/ml.get_categories.js +0 -91
- package/api/api/ml.get_data_frame_analytics.js +0 -80
- package/api/api/ml.get_data_frame_analytics_stats.js +0 -80
- package/api/api/ml.get_datafeed_stats.js +0 -77
- package/api/api/ml.get_datafeeds.js +0 -77
- package/api/api/ml.get_filters.js +0 -78
- package/api/api/ml.get_influencers.js +0 -87
- package/api/api/ml.get_job_stats.js +0 -77
- package/api/api/ml.get_jobs.js +0 -77
- package/api/api/ml.get_model_snapshots.js +0 -94
- package/api/api/ml.get_overall_buckets.js +0 -88
- package/api/api/ml.get_records.js +0 -87
- package/api/api/ml.get_trained_models.js +0 -86
- package/api/api/ml.get_trained_models_stats.js +0 -80
- package/api/api/ml.info.js +0 -72
- package/api/api/ml.open_job.js +0 -78
- package/api/api/ml.post_calendar_events.js +0 -82
- package/api/api/ml.post_data.js +0 -84
- package/api/api/ml.preview_datafeed.js +0 -78
- package/api/api/ml.put_calendar.js +0 -78
- package/api/api/ml.put_calendar_job.js +0 -88
- package/api/api/ml.put_data_frame_analytics.js +0 -82
- package/api/api/ml.put_datafeed.js +0 -88
- package/api/api/ml.put_filter.js +0 -82
- package/api/api/ml.put_job.js +0 -82
- package/api/api/ml.put_trained_model.js +0 -82
- package/api/api/ml.revert_model_snapshot.js +0 -88
- package/api/api/ml.set_upgrade_mode.js +0 -73
- package/api/api/ml.start_data_frame_analytics.js +0 -78
- package/api/api/ml.start_datafeed.js +0 -80
- package/api/api/ml.stop_data_frame_analytics.js +0 -81
- package/api/api/ml.stop_datafeed.js +0 -81
- package/api/api/ml.update_data_frame_analytics.js +0 -82
- package/api/api/ml.update_datafeed.js +0 -88
- package/api/api/ml.update_filter.js +0 -82
- package/api/api/ml.update_job.js +0 -82
- package/api/api/ml.update_model_snapshot.js +0 -92
- package/api/api/ml.validate.js +0 -78
- package/api/api/ml.validate_detector.js +0 -78
- package/api/api/monitoring.bulk.js +0 -87
- package/api/api/nodes.hot_threads.js +0 -98
- package/api/api/nodes.info.js +0 -91
- package/api/api/nodes.reload_secure_settings.js +0 -83
- package/api/api/nodes.stats.js +0 -105
- package/api/api/nodes.usage.js +0 -89
- package/api/api/rollup.delete_job.js +0 -78
- package/api/api/rollup.get_jobs.js +0 -77
- package/api/api/rollup.get_rollup_caps.js +0 -77
- package/api/api/rollup.get_rollup_index_caps.js +0 -78
- package/api/api/rollup.put_job.js +0 -82
- package/api/api/rollup.rollup_search.js +0 -95
- package/api/api/rollup.start_job.js +0 -78
- package/api/api/rollup.stop_job.js +0 -80
- package/api/api/searchable_snapshots.clear_cache.js +0 -83
- package/api/api/searchable_snapshots.mount.js +0 -94
- package/api/api/searchable_snapshots.repository_stats.js +0 -78
- package/api/api/searchable_snapshots.stats.js +0 -77
- package/api/api/security.authenticate.js +0 -72
- package/api/api/security.change_password.js +0 -83
- package/api/api/security.clear_cached_privileges.js +0 -78
- package/api/api/security.clear_cached_realms.js +0 -78
- package/api/api/security.clear_cached_roles.js +0 -78
- package/api/api/security.create_api_key.js +0 -78
- package/api/api/security.delete_privileges.js +0 -88
- package/api/api/security.delete_role.js +0 -78
- package/api/api/security.delete_role_mapping.js +0 -78
- package/api/api/security.delete_user.js +0 -78
- package/api/api/security.disable_user.js +0 -78
- package/api/api/security.enable_user.js +0 -78
- package/api/api/security.get_api_key.js +0 -77
- package/api/api/security.get_builtin_privileges.js +0 -72
- package/api/api/security.get_privileges.js +0 -86
- package/api/api/security.get_role.js +0 -77
- package/api/api/security.get_role_mapping.js +0 -77
- package/api/api/security.get_token.js +0 -78
- package/api/api/security.get_user.js +0 -77
- package/api/api/security.get_user_privileges.js +0 -72
- package/api/api/security.has_privileges.js +0 -83
- package/api/api/security.invalidate_api_key.js +0 -78
- package/api/api/security.invalidate_token.js +0 -78
- package/api/api/security.put_privileges.js +0 -78
- package/api/api/security.put_role.js +0 -82
- package/api/api/security.put_role_mapping.js +0 -82
- package/api/api/security.put_user.js +0 -82
- package/api/api/slm.delete_lifecycle.js +0 -78
- package/api/api/slm.execute_lifecycle.js +0 -78
- package/api/api/slm.execute_retention.js +0 -72
- package/api/api/slm.get_lifecycle.js +0 -77
- package/api/api/slm.get_stats.js +0 -72
- package/api/api/slm.get_status.js +0 -72
- package/api/api/slm.put_lifecycle.js +0 -78
- package/api/api/slm.start.js +0 -72
- package/api/api/slm.stop.js +0 -72
- package/api/api/snapshot.cleanup_repository.js +0 -86
- package/api/api/snapshot.create.js +0 -97
- package/api/api/snapshot.create_repository.js +0 -91
- package/api/api/snapshot.delete.js +0 -95
- package/api/api/snapshot.delete_repository.js +0 -86
- package/api/api/snapshot.get.js +0 -98
- package/api/api/snapshot.get_repository.js +0 -85
- package/api/api/snapshot.restore.js +0 -97
- package/api/api/snapshot.status.js +0 -95
- package/api/api/snapshot.verify_repository.js +0 -86
- package/api/api/sql.clear_cursor.js +0 -78
- package/api/api/sql.query.js +0 -78
- package/api/api/sql.translate.js +0 -78
- package/api/api/ssl.certificates.js +0 -72
- package/api/api/tasks.cancel.js +0 -88
- package/api/api/tasks.get.js +0 -86
- package/api/api/tasks.list.js +0 -87
- package/api/api/transform.delete_transform.js +0 -78
- package/api/api/transform.get_transform.js +0 -79
- package/api/api/transform.get_transform_stats.js +0 -80
- package/api/api/transform.preview_transform.js +0 -78
- package/api/api/transform.put_transform.js +0 -82
- package/api/api/transform.start_transform.js +0 -78
- package/api/api/transform.stop_transform.js +0 -84
- package/api/api/transform.update_transform.js +0 -82
- package/api/api/watcher.ack_watch.js +0 -89
- package/api/api/watcher.activate_watch.js +0 -78
- package/api/api/watcher.deactivate_watch.js +0 -78
- package/api/api/watcher.delete_watch.js +0 -78
- package/api/api/watcher.execute_watch.js +0 -77
- package/api/api/watcher.get_watch.js +0 -78
- package/api/api/watcher.put_watch.js +0 -82
- package/api/api/watcher.start.js +0 -72
- package/api/api/watcher.stats.js +0 -78
- package/api/api/watcher.stop.js +0 -72
- package/api/api/xpack.info.js +0 -73
- package/api/api/xpack.usage.js +0 -72
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
// Licensed to Elasticsearch B.V under one or more agreements.
|
|
2
|
-
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
|
3
|
-
// See the LICENSE file in the project root for more information
|
|
4
|
-
|
|
5
|
-
'use strict'
|
|
6
|
-
|
|
7
|
-
/* eslint camelcase: 0 */
|
|
8
|
-
/* eslint no-unused-vars: 0 */
|
|
9
|
-
|
|
10
|
-
function buildMlFindFileStructure (opts) {
|
|
11
|
-
// eslint-disable-next-line no-unused-vars
|
|
12
|
-
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
|
13
|
-
|
|
14
|
-
const acceptedQuerystring = [
|
|
15
|
-
'lines_to_sample',
|
|
16
|
-
'line_merge_size_limit',
|
|
17
|
-
'timeout',
|
|
18
|
-
'charset',
|
|
19
|
-
'format',
|
|
20
|
-
'has_header_row',
|
|
21
|
-
'column_names',
|
|
22
|
-
'delimiter',
|
|
23
|
-
'quote',
|
|
24
|
-
'should_trim_fields',
|
|
25
|
-
'grok_pattern',
|
|
26
|
-
'timestamp_field',
|
|
27
|
-
'timestamp_format',
|
|
28
|
-
'explain'
|
|
29
|
-
]
|
|
30
|
-
|
|
31
|
-
const snakeCase = {
|
|
32
|
-
linesToSample: 'lines_to_sample',
|
|
33
|
-
lineMergeSizeLimit: 'line_merge_size_limit',
|
|
34
|
-
hasHeaderRow: 'has_header_row',
|
|
35
|
-
columnNames: 'column_names',
|
|
36
|
-
shouldTrimFields: 'should_trim_fields',
|
|
37
|
-
grokPattern: 'grok_pattern',
|
|
38
|
-
timestampField: 'timestamp_field',
|
|
39
|
-
timestampFormat: 'timestamp_format'
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Perform a ml.find_file_structure request
|
|
45
|
-
* Finds the structure of a text file. The text file must contain data that is suitable to be ingested into Elasticsearch.
|
|
46
|
-
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-find-file-structure.html
|
|
47
|
-
*/
|
|
48
|
-
return function mlFindFileStructure (params, options, callback) {
|
|
49
|
-
options = options || {}
|
|
50
|
-
if (typeof options === 'function') {
|
|
51
|
-
callback = options
|
|
52
|
-
options = {}
|
|
53
|
-
}
|
|
54
|
-
if (typeof params === 'function' || params == null) {
|
|
55
|
-
callback = params
|
|
56
|
-
params = {}
|
|
57
|
-
options = {}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// check required parameters
|
|
61
|
-
if (params['body'] == null) {
|
|
62
|
-
const err = new ConfigurationError('Missing required parameter: body')
|
|
63
|
-
return handleError(err, callback)
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
// validate headers object
|
|
67
|
-
if (options.headers != null && typeof options.headers !== 'object') {
|
|
68
|
-
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
|
69
|
-
return handleError(err, callback)
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
var warnings = []
|
|
73
|
-
var { method, body, ...querystring } = params
|
|
74
|
-
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
|
75
|
-
|
|
76
|
-
var ignore = options.ignore
|
|
77
|
-
if (typeof ignore === 'number') {
|
|
78
|
-
options.ignore = [ignore]
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
var path = ''
|
|
82
|
-
|
|
83
|
-
if (method == null) method = 'POST'
|
|
84
|
-
path = '/' + '_ml' + '/' + 'find_file_structure'
|
|
85
|
-
|
|
86
|
-
// build request object
|
|
87
|
-
const request = {
|
|
88
|
-
method,
|
|
89
|
-
path,
|
|
90
|
-
bulkBody: body,
|
|
91
|
-
querystring
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
options.warnings = warnings.length === 0 ? null : warnings
|
|
95
|
-
return makeRequest(request, options, callback)
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
module.exports = buildMlFindFileStructure
|
package/api/api/ml.flush_job.js
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
// Licensed to Elasticsearch B.V under one or more agreements.
|
|
2
|
-
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
|
3
|
-
// See the LICENSE file in the project root for more information
|
|
4
|
-
|
|
5
|
-
'use strict'
|
|
6
|
-
|
|
7
|
-
/* eslint camelcase: 0 */
|
|
8
|
-
/* eslint no-unused-vars: 0 */
|
|
9
|
-
|
|
10
|
-
function buildMlFlushJob (opts) {
|
|
11
|
-
// eslint-disable-next-line no-unused-vars
|
|
12
|
-
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
|
13
|
-
|
|
14
|
-
const acceptedQuerystring = [
|
|
15
|
-
'calc_interim',
|
|
16
|
-
'start',
|
|
17
|
-
'end',
|
|
18
|
-
'advance_time',
|
|
19
|
-
'skip_time'
|
|
20
|
-
]
|
|
21
|
-
|
|
22
|
-
const snakeCase = {
|
|
23
|
-
calcInterim: 'calc_interim',
|
|
24
|
-
advanceTime: 'advance_time',
|
|
25
|
-
skipTime: 'skip_time'
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Perform a ml.flush_job request
|
|
30
|
-
* Forces any buffered data to be processed by the job.
|
|
31
|
-
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-flush-job.html
|
|
32
|
-
*/
|
|
33
|
-
return function mlFlushJob (params, options, callback) {
|
|
34
|
-
options = options || {}
|
|
35
|
-
if (typeof options === 'function') {
|
|
36
|
-
callback = options
|
|
37
|
-
options = {}
|
|
38
|
-
}
|
|
39
|
-
if (typeof params === 'function' || params == null) {
|
|
40
|
-
callback = params
|
|
41
|
-
params = {}
|
|
42
|
-
options = {}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// check required parameters
|
|
46
|
-
if (params['job_id'] == null && params['jobId'] == null) {
|
|
47
|
-
const err = new ConfigurationError('Missing required parameter: job_id or jobId')
|
|
48
|
-
return handleError(err, callback)
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// validate headers object
|
|
52
|
-
if (options.headers != null && typeof options.headers !== 'object') {
|
|
53
|
-
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
|
54
|
-
return handleError(err, callback)
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
var warnings = []
|
|
58
|
-
var { method, body, jobId, job_id, ...querystring } = params
|
|
59
|
-
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
|
60
|
-
|
|
61
|
-
var ignore = options.ignore
|
|
62
|
-
if (typeof ignore === 'number') {
|
|
63
|
-
options.ignore = [ignore]
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
var path = ''
|
|
67
|
-
|
|
68
|
-
if (method == null) method = 'POST'
|
|
69
|
-
path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_flush'
|
|
70
|
-
|
|
71
|
-
// build request object
|
|
72
|
-
const request = {
|
|
73
|
-
method,
|
|
74
|
-
path,
|
|
75
|
-
body: body || '',
|
|
76
|
-
querystring
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
options.warnings = warnings.length === 0 ? null : warnings
|
|
80
|
-
return makeRequest(request, options, callback)
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
module.exports = buildMlFlushJob
|
package/api/api/ml.forecast.js
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
// Licensed to Elasticsearch B.V under one or more agreements.
|
|
2
|
-
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
|
3
|
-
// See the LICENSE file in the project root for more information
|
|
4
|
-
|
|
5
|
-
'use strict'
|
|
6
|
-
|
|
7
|
-
/* eslint camelcase: 0 */
|
|
8
|
-
/* eslint no-unused-vars: 0 */
|
|
9
|
-
|
|
10
|
-
function buildMlForecast (opts) {
|
|
11
|
-
// eslint-disable-next-line no-unused-vars
|
|
12
|
-
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
|
13
|
-
|
|
14
|
-
const acceptedQuerystring = [
|
|
15
|
-
'duration',
|
|
16
|
-
'expires_in',
|
|
17
|
-
'max_model_memory'
|
|
18
|
-
]
|
|
19
|
-
|
|
20
|
-
const snakeCase = {
|
|
21
|
-
expiresIn: 'expires_in',
|
|
22
|
-
maxModelMemory: 'max_model_memory'
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Perform a ml.forecast request
|
|
27
|
-
* Predicts the future behavior of a time series by using its historical behavior.
|
|
28
|
-
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-forecast.html
|
|
29
|
-
*/
|
|
30
|
-
return function mlForecast (params, options, callback) {
|
|
31
|
-
options = options || {}
|
|
32
|
-
if (typeof options === 'function') {
|
|
33
|
-
callback = options
|
|
34
|
-
options = {}
|
|
35
|
-
}
|
|
36
|
-
if (typeof params === 'function' || params == null) {
|
|
37
|
-
callback = params
|
|
38
|
-
params = {}
|
|
39
|
-
options = {}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// check required parameters
|
|
43
|
-
if (params['job_id'] == null && params['jobId'] == null) {
|
|
44
|
-
const err = new ConfigurationError('Missing required parameter: job_id or jobId')
|
|
45
|
-
return handleError(err, callback)
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// validate headers object
|
|
49
|
-
if (options.headers != null && typeof options.headers !== 'object') {
|
|
50
|
-
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
|
51
|
-
return handleError(err, callback)
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
var warnings = []
|
|
55
|
-
var { method, body, jobId, job_id, ...querystring } = params
|
|
56
|
-
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
|
57
|
-
|
|
58
|
-
var ignore = options.ignore
|
|
59
|
-
if (typeof ignore === 'number') {
|
|
60
|
-
options.ignore = [ignore]
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
var path = ''
|
|
64
|
-
|
|
65
|
-
if (method == null) method = 'POST'
|
|
66
|
-
path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_forecast'
|
|
67
|
-
|
|
68
|
-
// build request object
|
|
69
|
-
const request = {
|
|
70
|
-
method,
|
|
71
|
-
path,
|
|
72
|
-
body: body || '',
|
|
73
|
-
querystring
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
options.warnings = warnings.length === 0 ? null : warnings
|
|
77
|
-
return makeRequest(request, options, callback)
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
module.exports = buildMlForecast
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
// Licensed to Elasticsearch B.V under one or more agreements.
|
|
2
|
-
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
|
3
|
-
// See the LICENSE file in the project root for more information
|
|
4
|
-
|
|
5
|
-
'use strict'
|
|
6
|
-
|
|
7
|
-
/* eslint camelcase: 0 */
|
|
8
|
-
/* eslint no-unused-vars: 0 */
|
|
9
|
-
|
|
10
|
-
function buildMlGetBuckets (opts) {
|
|
11
|
-
// eslint-disable-next-line no-unused-vars
|
|
12
|
-
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
|
13
|
-
|
|
14
|
-
const acceptedQuerystring = [
|
|
15
|
-
'expand',
|
|
16
|
-
'exclude_interim',
|
|
17
|
-
'from',
|
|
18
|
-
'size',
|
|
19
|
-
'start',
|
|
20
|
-
'end',
|
|
21
|
-
'anomaly_score',
|
|
22
|
-
'sort',
|
|
23
|
-
'desc'
|
|
24
|
-
]
|
|
25
|
-
|
|
26
|
-
const snakeCase = {
|
|
27
|
-
excludeInterim: 'exclude_interim',
|
|
28
|
-
anomalyScore: 'anomaly_score'
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Perform a ml.get_buckets request
|
|
34
|
-
* Retrieves anomaly detection job results for one or more buckets.
|
|
35
|
-
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-bucket.html
|
|
36
|
-
*/
|
|
37
|
-
return function mlGetBuckets (params, options, callback) {
|
|
38
|
-
options = options || {}
|
|
39
|
-
if (typeof options === 'function') {
|
|
40
|
-
callback = options
|
|
41
|
-
options = {}
|
|
42
|
-
}
|
|
43
|
-
if (typeof params === 'function' || params == null) {
|
|
44
|
-
callback = params
|
|
45
|
-
params = {}
|
|
46
|
-
options = {}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// check required parameters
|
|
50
|
-
if (params['job_id'] == null && params['jobId'] == null) {
|
|
51
|
-
const err = new ConfigurationError('Missing required parameter: job_id or jobId')
|
|
52
|
-
return handleError(err, callback)
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// check required url components
|
|
56
|
-
if (params['timestamp'] != null && ((params['job_id'] == null && params['jobId'] == null))) {
|
|
57
|
-
const err = new ConfigurationError('Missing required parameter of the url: job_id')
|
|
58
|
-
return handleError(err, callback)
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// validate headers object
|
|
62
|
-
if (options.headers != null && typeof options.headers !== 'object') {
|
|
63
|
-
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
|
64
|
-
return handleError(err, callback)
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
var warnings = []
|
|
68
|
-
var { method, body, jobId, job_id, timestamp, ...querystring } = params
|
|
69
|
-
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
|
70
|
-
|
|
71
|
-
var ignore = options.ignore
|
|
72
|
-
if (typeof ignore === 'number') {
|
|
73
|
-
options.ignore = [ignore]
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
var path = ''
|
|
77
|
-
|
|
78
|
-
if ((job_id || jobId) != null && (timestamp) != null) {
|
|
79
|
-
if (method == null) method = body == null ? 'GET' : 'POST'
|
|
80
|
-
path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'results' + '/' + 'buckets' + '/' + encodeURIComponent(timestamp)
|
|
81
|
-
} else {
|
|
82
|
-
if (method == null) method = body == null ? 'GET' : 'POST'
|
|
83
|
-
path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'results' + '/' + 'buckets'
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
// build request object
|
|
87
|
-
const request = {
|
|
88
|
-
method,
|
|
89
|
-
path,
|
|
90
|
-
body: body || '',
|
|
91
|
-
querystring
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
options.warnings = warnings.length === 0 ? null : warnings
|
|
95
|
-
return makeRequest(request, options, callback)
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
module.exports = buildMlGetBuckets
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
// Licensed to Elasticsearch B.V under one or more agreements.
|
|
2
|
-
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
|
3
|
-
// See the LICENSE file in the project root for more information
|
|
4
|
-
|
|
5
|
-
'use strict'
|
|
6
|
-
|
|
7
|
-
/* eslint camelcase: 0 */
|
|
8
|
-
/* eslint no-unused-vars: 0 */
|
|
9
|
-
|
|
10
|
-
function buildMlGetCalendarEvents (opts) {
|
|
11
|
-
// eslint-disable-next-line no-unused-vars
|
|
12
|
-
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
|
13
|
-
|
|
14
|
-
const acceptedQuerystring = [
|
|
15
|
-
'job_id',
|
|
16
|
-
'start',
|
|
17
|
-
'end',
|
|
18
|
-
'from',
|
|
19
|
-
'size'
|
|
20
|
-
]
|
|
21
|
-
|
|
22
|
-
const snakeCase = {
|
|
23
|
-
jobId: 'job_id'
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Perform a ml.get_calendar_events request
|
|
29
|
-
* Retrieves information about the scheduled events in calendars.
|
|
30
|
-
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-calendar-event.html
|
|
31
|
-
*/
|
|
32
|
-
return function mlGetCalendarEvents (params, options, callback) {
|
|
33
|
-
options = options || {}
|
|
34
|
-
if (typeof options === 'function') {
|
|
35
|
-
callback = options
|
|
36
|
-
options = {}
|
|
37
|
-
}
|
|
38
|
-
if (typeof params === 'function' || params == null) {
|
|
39
|
-
callback = params
|
|
40
|
-
params = {}
|
|
41
|
-
options = {}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// check required parameters
|
|
45
|
-
if (params['calendar_id'] == null && params['calendarId'] == null) {
|
|
46
|
-
const err = new ConfigurationError('Missing required parameter: calendar_id or calendarId')
|
|
47
|
-
return handleError(err, callback)
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// validate headers object
|
|
51
|
-
if (options.headers != null && typeof options.headers !== 'object') {
|
|
52
|
-
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
|
53
|
-
return handleError(err, callback)
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
var warnings = []
|
|
57
|
-
var { method, body, calendarId, calendar_id, ...querystring } = params
|
|
58
|
-
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
|
59
|
-
|
|
60
|
-
var ignore = options.ignore
|
|
61
|
-
if (typeof ignore === 'number') {
|
|
62
|
-
options.ignore = [ignore]
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
var path = ''
|
|
66
|
-
|
|
67
|
-
if (method == null) method = 'GET'
|
|
68
|
-
path = '/' + '_ml' + '/' + 'calendars' + '/' + encodeURIComponent(calendar_id || calendarId) + '/' + 'events'
|
|
69
|
-
|
|
70
|
-
// build request object
|
|
71
|
-
const request = {
|
|
72
|
-
method,
|
|
73
|
-
path,
|
|
74
|
-
body: null,
|
|
75
|
-
querystring
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
options.warnings = warnings.length === 0 ? null : warnings
|
|
79
|
-
return makeRequest(request, options, callback)
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
module.exports = buildMlGetCalendarEvents
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
// Licensed to Elasticsearch B.V under one or more agreements.
|
|
2
|
-
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
|
3
|
-
// See the LICENSE file in the project root for more information
|
|
4
|
-
|
|
5
|
-
'use strict'
|
|
6
|
-
|
|
7
|
-
/* eslint camelcase: 0 */
|
|
8
|
-
/* eslint no-unused-vars: 0 */
|
|
9
|
-
|
|
10
|
-
function buildMlGetCalendars (opts) {
|
|
11
|
-
// eslint-disable-next-line no-unused-vars
|
|
12
|
-
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
|
13
|
-
|
|
14
|
-
const acceptedQuerystring = [
|
|
15
|
-
'from',
|
|
16
|
-
'size'
|
|
17
|
-
]
|
|
18
|
-
|
|
19
|
-
const snakeCase = {
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Perform a ml.get_calendars request
|
|
25
|
-
* Retrieves configuration information for calendars.
|
|
26
|
-
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-calendar.html
|
|
27
|
-
*/
|
|
28
|
-
return function mlGetCalendars (params, options, callback) {
|
|
29
|
-
options = options || {}
|
|
30
|
-
if (typeof options === 'function') {
|
|
31
|
-
callback = options
|
|
32
|
-
options = {}
|
|
33
|
-
}
|
|
34
|
-
if (typeof params === 'function' || params == null) {
|
|
35
|
-
callback = params
|
|
36
|
-
params = {}
|
|
37
|
-
options = {}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// validate headers object
|
|
41
|
-
if (options.headers != null && typeof options.headers !== 'object') {
|
|
42
|
-
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
|
43
|
-
return handleError(err, callback)
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
var warnings = []
|
|
47
|
-
var { method, body, calendarId, calendar_id, ...querystring } = params
|
|
48
|
-
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
|
49
|
-
|
|
50
|
-
var ignore = options.ignore
|
|
51
|
-
if (typeof ignore === 'number') {
|
|
52
|
-
options.ignore = [ignore]
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
var path = ''
|
|
56
|
-
|
|
57
|
-
if ((calendar_id || calendarId) != null) {
|
|
58
|
-
if (method == null) method = body == null ? 'GET' : 'POST'
|
|
59
|
-
path = '/' + '_ml' + '/' + 'calendars' + '/' + encodeURIComponent(calendar_id || calendarId)
|
|
60
|
-
} else {
|
|
61
|
-
if (method == null) method = body == null ? 'GET' : 'POST'
|
|
62
|
-
path = '/' + '_ml' + '/' + 'calendars'
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// build request object
|
|
66
|
-
const request = {
|
|
67
|
-
method,
|
|
68
|
-
path,
|
|
69
|
-
body: body || '',
|
|
70
|
-
querystring
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
options.warnings = warnings.length === 0 ? null : warnings
|
|
74
|
-
return makeRequest(request, options, callback)
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
module.exports = buildMlGetCalendars
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
// Licensed to Elasticsearch B.V under one or more agreements.
|
|
2
|
-
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
|
3
|
-
// See the LICENSE file in the project root for more information
|
|
4
|
-
|
|
5
|
-
'use strict'
|
|
6
|
-
|
|
7
|
-
/* eslint camelcase: 0 */
|
|
8
|
-
/* eslint no-unused-vars: 0 */
|
|
9
|
-
|
|
10
|
-
function buildMlGetCategories (opts) {
|
|
11
|
-
// eslint-disable-next-line no-unused-vars
|
|
12
|
-
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
|
13
|
-
|
|
14
|
-
const acceptedQuerystring = [
|
|
15
|
-
'from',
|
|
16
|
-
'size',
|
|
17
|
-
'partition_field_value'
|
|
18
|
-
]
|
|
19
|
-
|
|
20
|
-
const snakeCase = {
|
|
21
|
-
partitionFieldValue: 'partition_field_value'
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Perform a ml.get_categories request
|
|
26
|
-
* Retrieves anomaly detection job results for one or more categories.
|
|
27
|
-
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-category.html
|
|
28
|
-
*/
|
|
29
|
-
return function mlGetCategories (params, options, callback) {
|
|
30
|
-
options = options || {}
|
|
31
|
-
if (typeof options === 'function') {
|
|
32
|
-
callback = options
|
|
33
|
-
options = {}
|
|
34
|
-
}
|
|
35
|
-
if (typeof params === 'function' || params == null) {
|
|
36
|
-
callback = params
|
|
37
|
-
params = {}
|
|
38
|
-
options = {}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// check required parameters
|
|
42
|
-
if (params['job_id'] == null && params['jobId'] == null) {
|
|
43
|
-
const err = new ConfigurationError('Missing required parameter: job_id or jobId')
|
|
44
|
-
return handleError(err, callback)
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// check required url components
|
|
48
|
-
if ((params['category_id'] != null || params['categoryId'] != null) && ((params['job_id'] == null && params['jobId'] == null))) {
|
|
49
|
-
const err = new ConfigurationError('Missing required parameter of the url: job_id')
|
|
50
|
-
return handleError(err, callback)
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// validate headers object
|
|
54
|
-
if (options.headers != null && typeof options.headers !== 'object') {
|
|
55
|
-
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
|
56
|
-
return handleError(err, callback)
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
var warnings = []
|
|
60
|
-
var { method, body, jobId, job_id, categoryId, category_id, ...querystring } = params
|
|
61
|
-
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
|
62
|
-
|
|
63
|
-
var ignore = options.ignore
|
|
64
|
-
if (typeof ignore === 'number') {
|
|
65
|
-
options.ignore = [ignore]
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
var path = ''
|
|
69
|
-
|
|
70
|
-
if ((job_id || jobId) != null && (category_id || categoryId) != null) {
|
|
71
|
-
if (method == null) method = body == null ? 'GET' : 'POST'
|
|
72
|
-
path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'results' + '/' + 'categories' + '/' + encodeURIComponent(category_id || categoryId)
|
|
73
|
-
} else {
|
|
74
|
-
if (method == null) method = body == null ? 'GET' : 'POST'
|
|
75
|
-
path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'results' + '/' + 'categories'
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
// build request object
|
|
79
|
-
const request = {
|
|
80
|
-
method,
|
|
81
|
-
path,
|
|
82
|
-
body: body || '',
|
|
83
|
-
querystring
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
options.warnings = warnings.length === 0 ? null : warnings
|
|
87
|
-
return makeRequest(request, options, callback)
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
module.exports = buildMlGetCategories
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
// Licensed to Elasticsearch B.V under one or more agreements.
|
|
2
|
-
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
|
3
|
-
// See the LICENSE file in the project root for more information
|
|
4
|
-
|
|
5
|
-
'use strict'
|
|
6
|
-
|
|
7
|
-
/* eslint camelcase: 0 */
|
|
8
|
-
/* eslint no-unused-vars: 0 */
|
|
9
|
-
|
|
10
|
-
function buildMlGetDataFrameAnalytics (opts) {
|
|
11
|
-
// eslint-disable-next-line no-unused-vars
|
|
12
|
-
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
|
13
|
-
|
|
14
|
-
const acceptedQuerystring = [
|
|
15
|
-
'allow_no_match',
|
|
16
|
-
'from',
|
|
17
|
-
'size'
|
|
18
|
-
]
|
|
19
|
-
|
|
20
|
-
const snakeCase = {
|
|
21
|
-
allowNoMatch: 'allow_no_match'
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Perform a ml.get_data_frame_analytics request
|
|
27
|
-
* Retrieves configuration information for data frame analytics jobs.
|
|
28
|
-
* https://www.elastic.co/guide/en/elasticsearch/reference/current/get-dfanalytics.html
|
|
29
|
-
*/
|
|
30
|
-
return function mlGetDataFrameAnalytics (params, options, callback) {
|
|
31
|
-
options = options || {}
|
|
32
|
-
if (typeof options === 'function') {
|
|
33
|
-
callback = options
|
|
34
|
-
options = {}
|
|
35
|
-
}
|
|
36
|
-
if (typeof params === 'function' || params == null) {
|
|
37
|
-
callback = params
|
|
38
|
-
params = {}
|
|
39
|
-
options = {}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// validate headers object
|
|
43
|
-
if (options.headers != null && typeof options.headers !== 'object') {
|
|
44
|
-
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
|
45
|
-
return handleError(err, callback)
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
var warnings = []
|
|
49
|
-
var { method, body, id, ...querystring } = params
|
|
50
|
-
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
|
51
|
-
|
|
52
|
-
var ignore = options.ignore
|
|
53
|
-
if (typeof ignore === 'number') {
|
|
54
|
-
options.ignore = [ignore]
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
var path = ''
|
|
58
|
-
|
|
59
|
-
if ((id) != null) {
|
|
60
|
-
if (method == null) method = 'GET'
|
|
61
|
-
path = '/' + '_ml' + '/' + 'data_frame' + '/' + 'analytics' + '/' + encodeURIComponent(id)
|
|
62
|
-
} else {
|
|
63
|
-
if (method == null) method = 'GET'
|
|
64
|
-
path = '/' + '_ml' + '/' + 'data_frame' + '/' + 'analytics'
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// build request object
|
|
68
|
-
const request = {
|
|
69
|
-
method,
|
|
70
|
-
path,
|
|
71
|
-
body: null,
|
|
72
|
-
querystring
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
options.warnings = warnings.length === 0 ? null : warnings
|
|
76
|
-
return makeRequest(request, options, callback)
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
module.exports = buildMlGetDataFrameAnalytics
|