diff --git a/api/api/async_search.js b/api/api/async_search.js index 86a68e30a..1d73931b9 100644 --- a/api/api/async_search.js +++ b/api/api/async_search.js @@ -23,8 +23,8 @@ /* eslint no-unused-vars: 0 */ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') -const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path', 'wait_for_completion_timeout', 'keep_alive', 'typed_keys', 'keep_on_completion', '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_includes', 'terminate_after', 'stats', 'suggest_field', 'suggest_mode', 'suggest_size', 'suggest_text', 'timeout', 'track_scores', 'track_total_hits', 'allow_partial_search_results', 'version', 'seq_no_primary_term', 'max_concurrent_shard_requests'] -const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path', waitForCompletionTimeout: 'wait_for_completion_timeout', keepAlive: 'keep_alive', typedKeys: 'typed_keys', keepOnCompletion: 'keep_on_completion', 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', _sourceIncludes: '_source_includes', 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', seqNoPrimaryTerm: 'seq_no_primary_term', maxConcurrentShardRequests: 'max_concurrent_shard_requests' } +const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path', 'wait_for_completion_timeout', 'keep_alive', 'typed_keys', 'keep_on_completion', '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', 'version', 'seq_no_primary_term', 'max_concurrent_shard_requests'] +const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path', waitForCompletionTimeout: 'wait_for_completion_timeout', keepAlive: 'keep_alive', typedKeys: 'typed_keys', keepOnCompletion: 'keep_on_completion', 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', seqNoPrimaryTerm: 'seq_no_primary_term', maxConcurrentShardRequests: 'max_concurrent_shard_requests' } function AsyncSearchApi (transport, ConfigurationError) { this.transport = transport diff --git a/api/api/bulk.js b/api/api/bulk.js index b32fc633e..100130755 100644 --- a/api/api/bulk.js +++ b/api/api/bulk.js @@ -23,8 +23,8 @@ /* 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_includes', 'pipeline', 'require_alias', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] -const snakeCase = { waitForActiveShards: 'wait_for_active_shards', _sourceExcludes: '_source_excludes', _sourceIncludes: '_source_includes', 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', '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' } function bulkApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) diff --git a/api/api/cat.js b/api/api/cat.js index 39d9ad3dd..87d6120cd 100644 --- a/api/api/cat.js +++ b/api/api/cat.js @@ -23,8 +23,8 @@ /* 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', 'include_bootstrap', 'active_only', 'detailed', 'index', 'ignore_unavailable', 'nodes', 'actions', 'parent_task_id', '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', includeBootstrap: 'include_bootstrap', activeOnly: 'active_only', ignoreUnavailable: 'ignore_unavailable', parentTaskId: 'parent_task_id', allowNoMatch: 'allow_no_match', allowNoDatafeeds: 'allow_no_datafeeds', allowNoJobs: 'allow_no_jobs' } +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', 'allow_no_match', 'allow_no_datafeeds', 'allow_no_jobs', 'from', 'size', 'full_id', 'include_bootstrap', 'active_only', 'detailed', 'index', 'ignore_unavailable', 'nodes', 'actions', 'parent_task_id'] +const snakeCase = { expandWildcards: 'expand_wildcards', errorTrace: 'error_trace', filterPath: 'filter_path', masterTimeout: 'master_timeout', includeUnloadedSegments: 'include_unloaded_segments', allowNoMatch: 'allow_no_match', allowNoDatafeeds: 'allow_no_datafeeds', allowNoJobs: 'allow_no_jobs', fullId: 'full_id', includeBootstrap: 'include_bootstrap', activeOnly: 'active_only', ignoreUnavailable: 'ignore_unavailable', parentTaskId: 'parent_task_id' } function CatApi (transport, ConfigurationError) { this.transport = transport @@ -224,6 +224,110 @@ CatApi.prototype.master = function catMasterApi (params, options, callback) { return this.transport.request(request, options, callback) } +CatApi.prototype.mlDataFrameAnalytics = function catMlDataFrameAnalyticsApi (params, options, callback) { + ;[params, options, callback] = normalizeArguments(params, options, callback) + + let { method, body, id, ...querystring } = params + querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) + + let 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 + } + + return this.transport.request(request, options, callback) +} + +CatApi.prototype.mlDatafeeds = function catMlDatafeedsApi (params, options, callback) { + ;[params, options, callback] = normalizeArguments(params, options, callback) + + let { method, body, datafeedId, datafeed_id, ...querystring } = params + querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) + + let 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 + } + + return this.transport.request(request, options, callback) +} + +CatApi.prototype.mlJobs = function catMlJobsApi (params, options, callback) { + ;[params, options, callback] = normalizeArguments(params, options, callback) + + let { method, body, jobId, job_id, ...querystring } = params + querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) + + let 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 + } + + return this.transport.request(request, options, callback) +} + +CatApi.prototype.mlTrainedModels = function catMlTrainedModelsApi (params, options, callback) { + ;[params, options, callback] = normalizeArguments(params, options, callback) + + let { method, body, modelId, model_id, ...querystring } = params + querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) + + let 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 + } + + return this.transport.request(request, options, callback) +} + CatApi.prototype.nodeattrs = function catNodeattrsApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) @@ -506,110 +610,6 @@ CatApi.prototype.threadPool = function catThreadPoolApi (params, options, callba return this.transport.request(request, options, callback) } -CatApi.prototype.mlDataFrameAnalytics = function catMlDataFrameAnalyticsApi (params, options, callback) { - ;[params, options, callback] = normalizeArguments(params, options, callback) - - let { method, body, id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) - - let 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 - } - - return this.transport.request(request, options, callback) -} - -CatApi.prototype.mlDatafeeds = function catMlDatafeedsApi (params, options, callback) { - ;[params, options, callback] = normalizeArguments(params, options, callback) - - let { method, body, datafeedId, datafeed_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) - - let 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 - } - - return this.transport.request(request, options, callback) -} - -CatApi.prototype.mlJobs = function catMlJobsApi (params, options, callback) { - ;[params, options, callback] = normalizeArguments(params, options, callback) - - let { method, body, jobId, job_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) - - let 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 - } - - return this.transport.request(request, options, callback) -} - -CatApi.prototype.mlTrainedModels = function catMlTrainedModelsApi (params, options, callback) { - ;[params, options, callback] = normalizeArguments(params, options, callback) - - let { method, body, modelId, model_id, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) - - let 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 - } - - return this.transport.request(request, options, callback) -} - CatApi.prototype.transforms = function catTransformsApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) @@ -637,12 +637,12 @@ CatApi.prototype.transforms = function catTransformsApi (params, options, callba } Object.defineProperties(CatApi.prototype, { - pending_tasks: { get () { return this.pendingTasks } }, - thread_pool: { get () { return this.threadPool } }, ml_data_frame_analytics: { get () { return this.mlDataFrameAnalytics } }, ml_datafeeds: { get () { return this.mlDatafeeds } }, ml_jobs: { get () { return this.mlJobs } }, - ml_trained_models: { get () { return this.mlTrainedModels } } + ml_trained_models: { get () { return this.mlTrainedModels } }, + pending_tasks: { get () { return this.pendingTasks } }, + thread_pool: { get () { return this.threadPool } } }) module.exports = CatApi diff --git a/api/api/delete_by_query.js b/api/api/delete_by_query.js index 50c6533d3..9cf0cde71 100644 --- a/api/api/delete_by_query.js +++ b/api/api/delete_by_query.js @@ -23,8 +23,8 @@ /* 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', 'size', 'max_docs', 'sort', '_source', '_source_excludes', '_source_includes', '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', _sourceIncludes: '_source_includes', 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' } +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' } function deleteByQueryApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) diff --git a/api/api/exists.js b/api/api/exists.js index 35c285d33..44df4e381 100644 --- a/api/api/exists.js +++ b/api/api/exists.js @@ -23,8 +23,8 @@ /* eslint no-unused-vars: 0 */ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') -const acceptedQuerystring = ['stored_fields', 'preference', 'realtime', 'refresh', 'routing', '_source', '_source_excludes', '_source_includes', 'version', 'version_type', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] -const snakeCase = { storedFields: 'stored_fields', _sourceExcludes: '_source_excludes', _sourceIncludes: '_source_includes', versionType: 'version_type', errorTrace: 'error_trace', filterPath: 'filter_path' } +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' } function existsApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) diff --git a/api/api/exists_source.js b/api/api/exists_source.js index 8cef71e8e..6677f8d01 100644 --- a/api/api/exists_source.js +++ b/api/api/exists_source.js @@ -23,8 +23,8 @@ /* eslint no-unused-vars: 0 */ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') -const acceptedQuerystring = ['preference', 'realtime', 'refresh', 'routing', '_source', '_source_excludes', '_source_includes', 'version', 'version_type', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] -const snakeCase = { _sourceExcludes: '_source_excludes', _sourceIncludes: '_source_includes', versionType: 'version_type', errorTrace: 'error_trace', filterPath: 'filter_path' } +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) diff --git a/api/api/explain.js b/api/api/explain.js index 179a04a45..701ca99f6 100644 --- a/api/api/explain.js +++ b/api/api/explain.js @@ -23,8 +23,8 @@ /* eslint no-unused-vars: 0 */ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') -const acceptedQuerystring = ['analyze_wildcard', 'analyzer', 'default_operator', 'df', 'stored_fields', 'lenient', 'preference', 'q', 'routing', '_source', '_source_excludes', '_source_includes', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] -const snakeCase = { analyzeWildcard: 'analyze_wildcard', defaultOperator: 'default_operator', storedFields: 'stored_fields', _sourceExcludes: '_source_excludes', _sourceIncludes: '_source_includes', errorTrace: 'error_trace', filterPath: 'filter_path' } +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' } function explainApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) diff --git a/api/api/get.js b/api/api/get.js index eef0d9563..b267e4197 100644 --- a/api/api/get.js +++ b/api/api/get.js @@ -23,8 +23,8 @@ /* eslint no-unused-vars: 0 */ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') -const acceptedQuerystring = ['stored_fields', 'preference', 'realtime', 'refresh', 'routing', '_source', '_source_excludes', '_source_includes', 'version', 'version_type', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] -const snakeCase = { storedFields: 'stored_fields', _sourceExcludes: '_source_excludes', _sourceIncludes: '_source_includes', versionType: 'version_type', errorTrace: 'error_trace', filterPath: 'filter_path' } +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' } function getApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) diff --git a/api/api/get_source.js b/api/api/get_source.js index f037f8213..f4d1e25f0 100644 --- a/api/api/get_source.js +++ b/api/api/get_source.js @@ -23,8 +23,8 @@ /* eslint no-unused-vars: 0 */ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') -const acceptedQuerystring = ['preference', 'realtime', 'refresh', 'routing', '_source', '_source_excludes', '_source_includes', 'version', 'version_type', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] -const snakeCase = { _sourceExcludes: '_source_excludes', _sourceIncludes: '_source_includes', versionType: 'version_type', errorTrace: 'error_trace', filterPath: 'filter_path' } +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 getSourceApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) diff --git a/api/api/indices.js b/api/api/indices.js index c3dd1206e..654141cf2 100644 --- a/api/api/indices.js +++ b/api/api/indices.js @@ -211,6 +211,59 @@ IndicesApi.prototype.create = function indicesCreateApi (params, options, callba return this.transport.request(request, options, callback) } +IndicesApi.prototype.createDataStream = function indicesCreateDataStreamApi (params, options, callback) { + ;[params, options, callback] = normalizeArguments(params, options, callback) + + // check required parameters + if (params.name == null) { + const err = new this[kConfigurationError]('Missing required parameter: name') + return handleError(err, callback) + } + + let { method, body, name, ...querystring } = params + querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) + + let path = '' + if (method == null) method = 'PUT' + path = '/' + '_data_stream' + '/' + encodeURIComponent(name) + + // build request object + const request = { + method, + path, + body: body || '', + querystring + } + + return this.transport.request(request, options, callback) +} + +IndicesApi.prototype.dataStreamsStats = function indicesDataStreamsStatsApi (params, options, callback) { + ;[params, options, callback] = normalizeArguments(params, options, callback) + + let { method, body, name, ...querystring } = params + querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) + + let 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 + } + + return this.transport.request(request, options, callback) +} + IndicesApi.prototype.delete = function indicesDeleteApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) @@ -280,6 +333,33 @@ IndicesApi.prototype.deleteAlias = function indicesDeleteAliasApi (params, optio return this.transport.request(request, options, callback) } +IndicesApi.prototype.deleteDataStream = function indicesDeleteDataStreamApi (params, options, callback) { + ;[params, options, callback] = normalizeArguments(params, options, callback) + + // check required parameters + if (params.name == null) { + const err = new this[kConfigurationError]('Missing required parameter: name') + return handleError(err, callback) + } + + let { method, body, name, ...querystring } = params + querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) + + let path = '' + if (method == null) method = 'DELETE' + path = '/' + '_data_stream' + '/' + encodeURIComponent(name) + + // build request object + const request = { + method, + path, + body: body || '', + querystring + } + + return this.transport.request(request, options, callback) +} + IndicesApi.prototype.deleteIndexTemplate = function indicesDeleteIndexTemplateApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) @@ -557,6 +637,33 @@ IndicesApi.prototype.forcemerge = function indicesForcemergeApi (params, options return this.transport.request(request, options, callback) } +IndicesApi.prototype.freeze = function indicesFreezeApi (params, options, callback) { + ;[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) + } + + let { method, body, index, ...querystring } = params + querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) + + let path = '' + if (method == null) method = 'POST' + path = '/' + encodeURIComponent(index) + '/' + '_freeze' + + // build request object + const request = { + method, + path, + body: body || '', + querystring + } + + return this.transport.request(request, options, callback) +} + IndicesApi.prototype.get = function indicesGetApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) @@ -616,6 +723,32 @@ IndicesApi.prototype.getAlias = function indicesGetAliasApi (params, options, ca return this.transport.request(request, options, callback) } +IndicesApi.prototype.getDataStream = function indicesGetDataStreamApi (params, options, callback) { + ;[params, options, callback] = normalizeArguments(params, options, callback) + + let { method, body, name, ...querystring } = params + querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) + + let 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 + } + + return this.transport.request(request, options, callback) +} + IndicesApi.prototype.getFieldMapping = function indicesGetFieldMappingApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) @@ -791,6 +924,33 @@ IndicesApi.prototype.getUpgrade = function indicesGetUpgradeApi (params, options return this.transport.request(request, options, callback) } +IndicesApi.prototype.migrateToDataStream = function indicesMigrateToDataStreamApi (params, options, callback) { + ;[params, options, callback] = normalizeArguments(params, options, callback) + + // check required parameters + if (params.name == null) { + const err = new this[kConfigurationError]('Missing required parameter: name') + return handleError(err, callback) + } + + let { method, body, name, ...querystring } = params + querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) + + let path = '' + if (method == null) method = 'POST' + path = '/' + '_data_stream' + '/' + '_migrate' + '/' + encodeURIComponent(name) + + // build request object + const request = { + method, + path, + body: body || '', + querystring + } + + return this.transport.request(request, options, callback) +} + IndicesApi.prototype.open = function indicesOpenApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) @@ -818,6 +978,33 @@ IndicesApi.prototype.open = function indicesOpenApi (params, options, callback) return this.transport.request(request, options, callback) } +IndicesApi.prototype.promoteDataStream = function indicesPromoteDataStreamApi (params, options, callback) { + ;[params, options, callback] = normalizeArguments(params, options, callback) + + // check required parameters + if (params.name == null) { + const err = new this[kConfigurationError]('Missing required parameter: name') + return handleError(err, callback) + } + + let { method, body, name, ...querystring } = params + querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) + + let path = '' + if (method == null) method = 'POST' + path = '/' + '_data_stream' + '/' + '_promote' + '/' + encodeURIComponent(name) + + // build request object + const request = { + method, + path, + body: body || '', + querystring + } + + return this.transport.request(request, options, callback) +} + IndicesApi.prototype.putAlias = function indicesPutAliasApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) @@ -1056,6 +1243,33 @@ IndicesApi.prototype.refresh = function indicesRefreshApi (params, options, call return this.transport.request(request, options, callback) } +IndicesApi.prototype.reloadSearchAnalyzers = function indicesReloadSearchAnalyzersApi (params, options, callback) { + ;[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) + } + + let { method, body, index, ...querystring } = params + querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) + + let 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 + } + + return this.transport.request(request, options, callback) +} + IndicesApi.prototype.resolveIndex = function indicesResolveIndexApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) @@ -1332,6 +1546,33 @@ IndicesApi.prototype.stats = function indicesStatsApi (params, options, callback return this.transport.request(request, options, callback) } +IndicesApi.prototype.unfreeze = function indicesUnfreezeApi (params, options, callback) { + ;[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) + } + + let { method, body, index, ...querystring } = params + querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) + + let path = '' + if (method == null) method = 'POST' + path = '/' + encodeURIComponent(index) + '/' + '_unfreeze' + + // build request object + const request = { + method, + path, + body: body || '', + querystring + } + + return this.transport.request(request, options, callback) +} + IndicesApi.prototype.updateAliases = function indicesUpdateAliasesApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) @@ -1415,251 +1656,13 @@ IndicesApi.prototype.validateQuery = function indicesValidateQueryApi (params, o return this.transport.request(request, options, callback) } -IndicesApi.prototype.createDataStream = function indicesCreateDataStreamApi (params, options, callback) { - ;[params, options, callback] = normalizeArguments(params, options, callback) - - // check required parameters - if (params.name == null) { - const err = new this[kConfigurationError]('Missing required parameter: name') - return handleError(err, callback) - } - - let { method, body, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) - - let path = '' - if (method == null) method = 'PUT' - path = '/' + '_data_stream' + '/' + encodeURIComponent(name) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - return this.transport.request(request, options, callback) -} - -IndicesApi.prototype.dataStreamsStats = function indicesDataStreamsStatsApi (params, options, callback) { - ;[params, options, callback] = normalizeArguments(params, options, callback) - - let { method, body, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) - - let 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 - } - - return this.transport.request(request, options, callback) -} - -IndicesApi.prototype.deleteDataStream = function indicesDeleteDataStreamApi (params, options, callback) { - ;[params, options, callback] = normalizeArguments(params, options, callback) - - // check required parameters - if (params.name == null) { - const err = new this[kConfigurationError]('Missing required parameter: name') - return handleError(err, callback) - } - - let { method, body, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) - - let path = '' - if (method == null) method = 'DELETE' - path = '/' + '_data_stream' + '/' + encodeURIComponent(name) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - return this.transport.request(request, options, callback) -} - -IndicesApi.prototype.freeze = function indicesFreezeApi (params, options, callback) { - ;[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) - } - - let { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) - - let path = '' - if (method == null) method = 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_freeze' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - return this.transport.request(request, options, callback) -} - -IndicesApi.prototype.getDataStream = function indicesGetDataStreamApi (params, options, callback) { - ;[params, options, callback] = normalizeArguments(params, options, callback) - - let { method, body, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) - - let 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 - } - - return this.transport.request(request, options, callback) -} - -IndicesApi.prototype.migrateToDataStream = function indicesMigrateToDataStreamApi (params, options, callback) { - ;[params, options, callback] = normalizeArguments(params, options, callback) - - // check required parameters - if (params.name == null) { - const err = new this[kConfigurationError]('Missing required parameter: name') - return handleError(err, callback) - } - - let { method, body, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) - - let path = '' - if (method == null) method = 'POST' - path = '/' + '_data_stream' + '/' + '_migrate' + '/' + encodeURIComponent(name) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - return this.transport.request(request, options, callback) -} - -IndicesApi.prototype.promoteDataStream = function indicesPromoteDataStreamApi (params, options, callback) { - ;[params, options, callback] = normalizeArguments(params, options, callback) - - // check required parameters - if (params.name == null) { - const err = new this[kConfigurationError]('Missing required parameter: name') - return handleError(err, callback) - } - - let { method, body, name, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) - - let path = '' - if (method == null) method = 'POST' - path = '/' + '_data_stream' + '/' + '_promote' + '/' + encodeURIComponent(name) - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - return this.transport.request(request, options, callback) -} - -IndicesApi.prototype.reloadSearchAnalyzers = function indicesReloadSearchAnalyzersApi (params, options, callback) { - ;[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) - } - - let { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) - - let 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 - } - - return this.transport.request(request, options, callback) -} - -IndicesApi.prototype.unfreeze = function indicesUnfreezeApi (params, options, callback) { - ;[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) - } - - let { method, body, index, ...querystring } = params - querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) - - let path = '' - if (method == null) method = 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_unfreeze' - - // build request object - const request = { - method, - path, - body: body || '', - querystring - } - - return this.transport.request(request, options, callback) -} - Object.defineProperties(IndicesApi.prototype, { add_block: { get () { return this.addBlock } }, clear_cache: { get () { return this.clearCache } }, + create_data_stream: { get () { return this.createDataStream } }, + data_streams_stats: { get () { return this.dataStreamsStats } }, delete_alias: { get () { return this.deleteAlias } }, + delete_data_stream: { get () { return this.deleteDataStream } }, delete_index_template: { get () { return this.deleteIndexTemplate } }, delete_template: { get () { return this.deleteTemplate } }, exists_alias: { get () { return this.existsAlias } }, @@ -1668,30 +1671,27 @@ Object.defineProperties(IndicesApi.prototype, { exists_type: { get () { return this.existsType } }, flush_synced: { get () { return this.flushSynced } }, get_alias: { get () { return this.getAlias } }, + get_data_stream: { get () { return this.getDataStream } }, get_field_mapping: { get () { return this.getFieldMapping } }, get_index_template: { get () { return this.getIndexTemplate } }, get_mapping: { get () { return this.getMapping } }, get_settings: { get () { return this.getSettings } }, get_template: { get () { return this.getTemplate } }, get_upgrade: { get () { return this.getUpgrade } }, + migrate_to_data_stream: { get () { return this.migrateToDataStream } }, + promote_data_stream: { get () { return this.promoteDataStream } }, put_alias: { get () { return this.putAlias } }, put_index_template: { get () { return this.putIndexTemplate } }, put_mapping: { get () { return this.putMapping } }, put_settings: { get () { return this.putSettings } }, put_template: { get () { return this.putTemplate } }, + reload_search_analyzers: { get () { return this.reloadSearchAnalyzers } }, resolve_index: { get () { return this.resolveIndex } }, shard_stores: { get () { return this.shardStores } }, simulate_index_template: { get () { return this.simulateIndexTemplate } }, simulate_template: { get () { return this.simulateTemplate } }, update_aliases: { get () { return this.updateAliases } }, - validate_query: { get () { return this.validateQuery } }, - create_data_stream: { get () { return this.createDataStream } }, - data_streams_stats: { get () { return this.dataStreamsStats } }, - delete_data_stream: { get () { return this.deleteDataStream } }, - get_data_stream: { get () { return this.getDataStream } }, - migrate_to_data_stream: { get () { return this.migrateToDataStream } }, - promote_data_stream: { get () { return this.promoteDataStream } }, - reload_search_analyzers: { get () { return this.reloadSearchAnalyzers } } + validate_query: { get () { return this.validateQuery } } }) module.exports = IndicesApi diff --git a/api/api/ingest.js b/api/api/ingest.js index 56e4acc7b..e3016377d 100644 --- a/api/api/ingest.js +++ b/api/api/ingest.js @@ -58,6 +58,27 @@ IngestApi.prototype.deletePipeline = function ingestDeletePipelineApi (params, o return this.transport.request(request, options, callback) } +IngestApi.prototype.geoIpStats = function ingestGeoIpStatsApi (params, options, callback) { + ;[params, options, callback] = normalizeArguments(params, options, callback) + + let { method, body, ...querystring } = params + querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) + + let path = '' + if (method == null) method = 'GET' + path = '/' + '_ingest' + '/' + 'geoip' + '/' + 'stats' + + // build request object + const request = { + method, + path, + body: null, + querystring + } + + return this.transport.request(request, options, callback) +} + IngestApi.prototype.getPipeline = function ingestGetPipelineApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) @@ -170,6 +191,7 @@ IngestApi.prototype.simulate = function ingestSimulateApi (params, options, call Object.defineProperties(IngestApi.prototype, { delete_pipeline: { get () { return this.deletePipeline } }, + geo_ip_stats: { get () { return this.geoIpStats } }, get_pipeline: { get () { return this.getPipeline } }, processor_grok: { get () { return this.processorGrok } }, put_pipeline: { get () { return this.putPipeline } } diff --git a/api/api/mget.js b/api/api/mget.js index 3c0d63494..83ab77490 100644 --- a/api/api/mget.js +++ b/api/api/mget.js @@ -23,8 +23,8 @@ /* eslint no-unused-vars: 0 */ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') -const acceptedQuerystring = ['stored_fields', 'preference', 'realtime', 'refresh', 'routing', '_source', '_source_excludes', '_source_includes', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] -const snakeCase = { storedFields: 'stored_fields', _sourceExcludes: '_source_excludes', _sourceIncludes: '_source_includes', errorTrace: 'error_trace', filterPath: 'filter_path' } +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) diff --git a/api/api/ml.js b/api/api/ml.js index a4b398931..6b4a66b6f 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', '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', 'exclude_generated', 'verbose', 'allow_no_datafeeds', 'influencer_score', 'top_n', 'bucket_span', 'overall_score', 'record_score', 'include', 'include_model_definition', 'decompress_definition', 'tags', 'reset_start', 'reset_end', 'ignore_unavailable', 'allow_no_indices', 'ignore_throttled', 'expand_wildcards', 'reassign', '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', 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', excludeGenerated: 'exclude_generated', 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', 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_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', 'exclude_generated', 'verbose', 'allow_no_datafeeds', 'influencer_score', 'top_n', 'bucket_span', 'overall_score', 'record_score', 'include', 'include_model_definition', 'decompress_definition', 'tags', 'reset_start', 'reset_end', 'ignore_unavailable', 'allow_no_indices', 'ignore_throttled', 'expand_wildcards', 'reassign', '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', excludeGenerated: 'exclude_generated', 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', 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 @@ -512,6 +512,31 @@ MlApi.prototype.explainDataFrameAnalytics = function mlExplainDataFrameAnalytics return this.transport.request(request, options, callback) } +MlApi.prototype.findFileStructure = function mlFindFileStructureApi (params, options, callback) { + ;[params, options, callback] = normalizeArguments(params, options, callback) + + // check required parameters + if (params.body == null) { + const err = new this[kConfigurationError]('Missing required parameter: body') + return handleError(err, callback) + } + + let { method, body, ...querystring } = params + querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) + + const path = '' + + // build request object + const request = { + method, + path, + bulkBody: body, + querystring + } + + return this.transport.request(request, options, callback) +} + MlApi.prototype.flushJob = function mlFlushJobApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) @@ -1187,24 +1212,23 @@ MlApi.prototype.previewDataFrameAnalytics = function mlPreviewDataFrameAnalytics MlApi.prototype.previewDatafeed = function mlPreviewDatafeedApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) - // check required parameters - if (params.datafeed_id == null && params.datafeedId == null) { - const err = new this[kConfigurationError]('Missing required parameter: datafeed_id or datafeedId') - return handleError(err, callback) - } - let { method, body, datafeedId, datafeed_id, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) let path = '' - if (method == null) method = 'GET' - path = '/' + '_ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId) + '/' + '_preview' + if ((datafeed_id || datafeedId) != null) { + if (method == null) method = body == null ? 'GET' : 'POST' + path = '/' + '_ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId) + '/' + '_preview' + } else { + if (method == null) method = body == null ? 'GET' : 'POST' + path = '/' + '_ml' + '/' + 'datafeeds' + '/' + '_preview' + } // build request object const request = { method, path, - body: null, + body: body || '', querystring } @@ -1906,6 +1930,7 @@ Object.defineProperties(MlApi.prototype, { estimate_model_memory: { get () { return this.estimateModelMemory } }, evaluate_data_frame: { get () { return this.evaluateDataFrame } }, explain_data_frame_analytics: { get () { return this.explainDataFrameAnalytics } }, + find_file_structure: { get () { return this.findFileStructure } }, flush_job: { get () { return this.flushJob } }, get_buckets: { get () { return this.getBuckets } }, get_calendar_events: { get () { return this.getCalendarEvents } }, diff --git a/api/api/search.js b/api/api/search.js index bf838fd28..106242ba8 100644 --- a/api/api/search.js +++ b/api/api/search.js @@ -23,8 +23,8 @@ /* eslint no-unused-vars: 0 */ 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_includes', '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', 'min_compatible_shard_node', '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', _sourceIncludes: '_source_includes', 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', minCompatibleShardNode: 'min_compatible_shard_node', errorTrace: 'error_trace', filterPath: 'filter_path' } +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', 'min_compatible_shard_node', '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', minCompatibleShardNode: 'min_compatible_shard_node', errorTrace: 'error_trace', filterPath: 'filter_path' } function searchApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) diff --git a/api/api/shutdown.js b/api/api/shutdown.js new file mode 100644 index 000000000..096b1dfdf --- /dev/null +++ b/api/api/shutdown.js @@ -0,0 +1,124 @@ +/* + * 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 ShutdownApi (transport, ConfigurationError) { + this.transport = transport + this[kConfigurationError] = ConfigurationError +} + +ShutdownApi.prototype.deleteNode = function shutdownDeleteNodeApi (params, options, callback) { + ;[params, options, callback] = normalizeArguments(params, options, callback) + + // check required parameters + if (params.node_id == null && params.nodeId == null) { + const err = new this[kConfigurationError]('Missing required parameter: node_id or nodeId') + return handleError(err, callback) + } + + let { method, body, nodeId, node_id, ...querystring } = params + querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) + + let path = '' + if (method == null) method = 'DELETE' + path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'shutdown' + + // build request object + const request = { + method, + path, + body: body || '', + querystring + } + + return this.transport.request(request, options, callback) +} + +ShutdownApi.prototype.getNode = function shutdownGetNodeApi (params, options, callback) { + ;[params, options, callback] = normalizeArguments(params, options, callback) + + let { method, body, nodeId, node_id, ...querystring } = params + querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) + + let path = '' + if ((node_id || nodeId) != null) { + if (method == null) method = 'GET' + path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'shutdown' + } else { + if (method == null) method = 'GET' + path = '/' + '_nodes' + '/' + 'shutdown' + } + + // build request object + const request = { + method, + path, + body: null, + querystring + } + + return this.transport.request(request, options, callback) +} + +ShutdownApi.prototype.putNode = function shutdownPutNodeApi (params, options, callback) { + ;[params, options, callback] = normalizeArguments(params, options, callback) + + // check required parameters + if (params.node_id == null && params.nodeId == null) { + const err = new this[kConfigurationError]('Missing required parameter: node_id or nodeId') + return handleError(err, callback) + } + if (params.body == null) { + const err = new this[kConfigurationError]('Missing required parameter: body') + return handleError(err, callback) + } + + let { method, body, nodeId, node_id, ...querystring } = params + querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) + + let path = '' + if (method == null) method = 'PUT' + path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'shutdown' + + // build request object + const request = { + method, + path, + body: body || '', + querystring + } + + return this.transport.request(request, options, callback) +} + +Object.defineProperties(ShutdownApi.prototype, { + delete_node: { get () { return this.deleteNode } }, + get_node: { get () { return this.getNode } }, + put_node: { get () { return this.putNode } } +}) + +module.exports = ShutdownApi diff --git a/api/api/update.js b/api/api/update.js index edc0164bf..f6eb8f34d 100644 --- a/api/api/update.js +++ b/api/api/update.js @@ -23,8 +23,8 @@ /* eslint no-unused-vars: 0 */ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') -const acceptedQuerystring = ['wait_for_active_shards', '_source', '_source_excludes', '_source_includes', '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', _sourceIncludes: '_source_includes', 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', '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' } function updateApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) diff --git a/api/api/update_by_query.js b/api/api/update_by_query.js index 6305226d8..15c6657f3 100644 --- a/api/api/update_by_query.js +++ b/api/api/update_by_query.js @@ -23,8 +23,8 @@ /* 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', 'size', 'max_docs', 'sort', '_source', '_source_excludes', '_source_includes', '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', _sourceIncludes: '_source_includes', 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' } +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) diff --git a/api/index.js b/api/index.js index 2156ab29c..e3f2a4cac 100644 --- a/api/index.js +++ b/api/index.js @@ -19,9 +19,13 @@ 'use strict' +const AsyncSearchApi = require('./api/async_search') +const AutoscalingApi = require('./api/autoscaling') const bulkApi = require('./api/bulk') const CatApi = require('./api/cat') +const CcrApi = require('./api/ccr') const clearScrollApi = require('./api/clear_scroll') +const closePointInTimeApi = require('./api/close_point_in_time') const ClusterApi = require('./api/cluster') const countApi = require('./api/count') const createApi = require('./api/create') @@ -30,6 +34,8 @@ const deleteApi = require('./api/delete') const deleteByQueryApi = require('./api/delete_by_query') const deleteByQueryRethrottleApi = require('./api/delete_by_query_rethrottle') const deleteScriptApi = require('./api/delete_script') +const EnrichApi = require('./api/enrich') +const EqlApi = require('./api/eql') const existsApi = require('./api/exists') const existsSourceApi = require('./api/exists_source') const explainApi = require('./api/explain') @@ -40,85 +46,81 @@ const getScriptApi = require('./api/get_script') const getScriptContextApi = require('./api/get_script_context') const getScriptLanguagesApi = require('./api/get_script_languages') const getSourceApi = require('./api/get_source') +const GraphApi = require('./api/graph') +const IlmApi = require('./api/ilm') const indexApi = require('./api/index') const IndicesApi = require('./api/indices') const infoApi = require('./api/info') const IngestApi = require('./api/ingest') +const LicenseApi = require('./api/license') +const LogstashApi = require('./api/logstash') const mgetApi = require('./api/mget') +const MigrationApi = require('./api/migration') +const MlApi = require('./api/ml') +const MonitoringApi = require('./api/monitoring') const msearchApi = require('./api/msearch') const msearchTemplateApi = require('./api/msearch_template') const mtermvectorsApi = require('./api/mtermvectors') const NodesApi = require('./api/nodes') +const openPointInTimeApi = require('./api/open_point_in_time') const pingApi = require('./api/ping') const putScriptApi = require('./api/put_script') const rankEvalApi = require('./api/rank_eval') const reindexApi = require('./api/reindex') const reindexRethrottleApi = require('./api/reindex_rethrottle') const renderSearchTemplateApi = require('./api/render_search_template') +const RollupApi = require('./api/rollup') const scriptsPainlessExecuteApi = require('./api/scripts_painless_execute') const scrollApi = require('./api/scroll') const searchApi = require('./api/search') const searchShardsApi = require('./api/search_shards') const searchTemplateApi = require('./api/search_template') +const SearchableSnapshotsApi = require('./api/searchable_snapshots') +const SecurityApi = require('./api/security') +const ShutdownApi = require('./api/shutdown') +const SlmApi = require('./api/slm') const SnapshotApi = require('./api/snapshot') +const SqlApi = require('./api/sql') +const SslApi = require('./api/ssl') const TasksApi = require('./api/tasks') const termvectorsApi = require('./api/termvectors') +const TextStructureApi = require('./api/text_structure') +const TransformApi = require('./api/transform') const updateApi = require('./api/update') const updateByQueryApi = require('./api/update_by_query') 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') -const IlmApi = require('./api/ilm') -const LicenseApi = require('./api/license') -const LogstashApi = require('./api/logstash') -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') -const SlmApi = require('./api/slm') -const SqlApi = require('./api/sql') -const SslApi = require('./api/ssl') -const TextStructureApi = require('./api/text_structure') -const TransformApi = require('./api/transform') const WatcherApi = require('./api/watcher') const XpackApi = require('./api/xpack') const { kConfigurationError } = require('./utils') -const kCat = Symbol('Cat') -const kCluster = Symbol('Cluster') -const kDanglingIndices = Symbol('DanglingIndices') -const kFeatures = Symbol('Features') -const kIndices = Symbol('Indices') -const kIngest = Symbol('Ingest') -const kNodes = Symbol('Nodes') -const kSnapshot = Symbol('Snapshot') -const kTasks = Symbol('Tasks') const kAsyncSearch = Symbol('AsyncSearch') const kAutoscaling = Symbol('Autoscaling') +const kCat = Symbol('Cat') const kCcr = Symbol('Ccr') +const kCluster = Symbol('Cluster') +const kDanglingIndices = Symbol('DanglingIndices') const kEnrich = Symbol('Enrich') const kEql = Symbol('Eql') +const kFeatures = Symbol('Features') const kGraph = Symbol('Graph') const kIlm = Symbol('Ilm') +const kIndices = Symbol('Indices') +const kIngest = Symbol('Ingest') const kLicense = Symbol('License') const kLogstash = Symbol('Logstash') const kMigration = Symbol('Migration') const kMl = Symbol('Ml') const kMonitoring = Symbol('Monitoring') +const kNodes = Symbol('Nodes') const kRollup = Symbol('Rollup') const kSearchableSnapshots = Symbol('SearchableSnapshots') const kSecurity = Symbol('Security') +const kShutdown = Symbol('Shutdown') const kSlm = Symbol('Slm') +const kSnapshot = Symbol('Snapshot') const kSql = Symbol('Sql') const kSsl = Symbol('Ssl') +const kTasks = Symbol('Tasks') const kTextStructure = Symbol('TextStructure') const kTransform = Symbol('Transform') const kWatcher = Symbol('Watcher') @@ -126,33 +128,34 @@ const kXpack = Symbol('Xpack') function ESAPI (opts) { this[kConfigurationError] = opts.ConfigurationError - this[kCat] = null - this[kCluster] = null - this[kDanglingIndices] = null - this[kFeatures] = null - this[kIndices] = null - this[kIngest] = null - this[kNodes] = null - this[kSnapshot] = null - this[kTasks] = null this[kAsyncSearch] = null this[kAutoscaling] = null + this[kCat] = null this[kCcr] = null + this[kCluster] = null + this[kDanglingIndices] = null this[kEnrich] = null this[kEql] = null + this[kFeatures] = null this[kGraph] = null this[kIlm] = null + this[kIndices] = null + this[kIngest] = null this[kLicense] = null this[kLogstash] = null this[kMigration] = null this[kMl] = null this[kMonitoring] = null + this[kNodes] = null this[kRollup] = null this[kSearchableSnapshots] = null this[kSecurity] = null + this[kShutdown] = null this[kSlm] = null + this[kSnapshot] = null this[kSql] = null this[kSsl] = null + this[kTasks] = null this[kTextStructure] = null this[kTransform] = null this[kWatcher] = null @@ -161,6 +164,7 @@ function ESAPI (opts) { ESAPI.prototype.bulk = bulkApi ESAPI.prototype.clearScroll = clearScrollApi +ESAPI.prototype.closePointInTime = closePointInTimeApi ESAPI.prototype.count = countApi ESAPI.prototype.create = createApi ESAPI.prototype.delete = deleteApi @@ -182,6 +186,7 @@ ESAPI.prototype.mget = mgetApi ESAPI.prototype.msearch = msearchApi ESAPI.prototype.msearchTemplate = msearchTemplateApi ESAPI.prototype.mtermvectors = mtermvectorsApi +ESAPI.prototype.openPointInTime = openPointInTimeApi ESAPI.prototype.ping = pingApi ESAPI.prototype.putScript = putScriptApi ESAPI.prototype.rankEval = rankEvalApi @@ -197,10 +202,25 @@ ESAPI.prototype.termvectors = termvectorsApi ESAPI.prototype.update = updateApi ESAPI.prototype.updateByQuery = updateByQueryApi ESAPI.prototype.updateByQueryRethrottle = updateByQueryRethrottleApi -ESAPI.prototype.closePointInTime = closePointInTimeApi -ESAPI.prototype.openPointInTime = openPointInTimeApi Object.defineProperties(ESAPI.prototype, { + asyncSearch: { + get () { + if (this[kAsyncSearch] === null) { + this[kAsyncSearch] = new AsyncSearchApi(this.transport, this[kConfigurationError]) + } + return this[kAsyncSearch] + } + }, + async_search: { get () { return this.asyncSearch } }, + autoscaling: { + get () { + if (this[kAutoscaling] === null) { + this[kAutoscaling] = new AutoscalingApi(this.transport, this[kConfigurationError]) + } + return this[kAutoscaling] + } + }, cat: { get () { if (this[kCat] === null) { @@ -209,7 +229,16 @@ Object.defineProperties(ESAPI.prototype, { return this[kCat] } }, + ccr: { + get () { + if (this[kCcr] === null) { + this[kCcr] = new CcrApi(this.transport, this[kConfigurationError]) + } + return this[kCcr] + } + }, clear_scroll: { get () { return this.clearScroll } }, + close_point_in_time: { get () { return this.closePointInTime } }, cluster: { get () { if (this[kCluster] === null) { @@ -230,96 +259,6 @@ Object.defineProperties(ESAPI.prototype, { delete_by_query: { get () { return this.deleteByQuery } }, delete_by_query_rethrottle: { get () { return this.deleteByQueryRethrottle } }, delete_script: { get () { return this.deleteScript } }, - exists_source: { get () { return this.existsSource } }, - features: { - get () { - if (this[kFeatures] === null) { - this[kFeatures] = new FeaturesApi(this.transport, this[kConfigurationError]) - } - return this[kFeatures] - } - }, - field_caps: { get () { return this.fieldCaps } }, - get_script: { get () { return this.getScript } }, - get_script_context: { get () { return this.getScriptContext } }, - get_script_languages: { get () { return this.getScriptLanguages } }, - get_source: { get () { return this.getSource } }, - indices: { - get () { - if (this[kIndices] === null) { - this[kIndices] = new IndicesApi(this.transport, this[kConfigurationError]) - } - return this[kIndices] - } - }, - ingest: { - get () { - if (this[kIngest] === null) { - this[kIngest] = new IngestApi(this.transport, this[kConfigurationError]) - } - return this[kIngest] - } - }, - msearch_template: { get () { return this.msearchTemplate } }, - nodes: { - get () { - if (this[kNodes] === null) { - this[kNodes] = new NodesApi(this.transport, this[kConfigurationError]) - } - return this[kNodes] - } - }, - put_script: { get () { return this.putScript } }, - rank_eval: { get () { return this.rankEval } }, - reindex_rethrottle: { get () { return this.reindexRethrottle } }, - render_search_template: { get () { return this.renderSearchTemplate } }, - scripts_painless_execute: { get () { return this.scriptsPainlessExecute } }, - search_shards: { get () { return this.searchShards } }, - search_template: { get () { return this.searchTemplate } }, - snapshot: { - get () { - if (this[kSnapshot] === null) { - this[kSnapshot] = new SnapshotApi(this.transport, this[kConfigurationError]) - } - return this[kSnapshot] - } - }, - tasks: { - get () { - if (this[kTasks] === null) { - this[kTasks] = new TasksApi(this.transport, this[kConfigurationError]) - } - return this[kTasks] - } - }, - update_by_query: { get () { return this.updateByQuery } }, - update_by_query_rethrottle: { get () { return this.updateByQueryRethrottle } }, - asyncSearch: { - get () { - if (this[kAsyncSearch] === null) { - this[kAsyncSearch] = new AsyncSearchApi(this.transport, this[kConfigurationError]) - } - return this[kAsyncSearch] - } - }, - async_search: { get () { return this.asyncSearch } }, - autoscaling: { - get () { - if (this[kAutoscaling] === null) { - this[kAutoscaling] = new AutoscalingApi(this.transport, this[kConfigurationError]) - } - return this[kAutoscaling] - } - }, - ccr: { - get () { - if (this[kCcr] === null) { - this[kCcr] = new CcrApi(this.transport, this[kConfigurationError]) - } - return this[kCcr] - } - }, - close_point_in_time: { get () { return this.closePointInTime } }, enrich: { get () { if (this[kEnrich] === null) { @@ -336,6 +275,20 @@ Object.defineProperties(ESAPI.prototype, { return this[kEql] } }, + exists_source: { get () { return this.existsSource } }, + features: { + get () { + if (this[kFeatures] === null) { + this[kFeatures] = new FeaturesApi(this.transport, this[kConfigurationError]) + } + return this[kFeatures] + } + }, + field_caps: { get () { return this.fieldCaps } }, + get_script: { get () { return this.getScript } }, + get_script_context: { get () { return this.getScriptContext } }, + get_script_languages: { get () { return this.getScriptLanguages } }, + get_source: { get () { return this.getSource } }, graph: { get () { if (this[kGraph] === null) { @@ -352,6 +305,22 @@ Object.defineProperties(ESAPI.prototype, { return this[kIlm] } }, + indices: { + get () { + if (this[kIndices] === null) { + this[kIndices] = new IndicesApi(this.transport, this[kConfigurationError]) + } + return this[kIndices] + } + }, + ingest: { + get () { + if (this[kIngest] === null) { + this[kIngest] = new IngestApi(this.transport, this[kConfigurationError]) + } + return this[kIngest] + } + }, license: { get () { if (this[kLicense] === null) { @@ -392,7 +361,20 @@ Object.defineProperties(ESAPI.prototype, { return this[kMonitoring] } }, + msearch_template: { get () { return this.msearchTemplate } }, + nodes: { + get () { + if (this[kNodes] === null) { + this[kNodes] = new NodesApi(this.transport, this[kConfigurationError]) + } + return this[kNodes] + } + }, open_point_in_time: { get () { return this.openPointInTime } }, + put_script: { get () { return this.putScript } }, + rank_eval: { get () { return this.rankEval } }, + reindex_rethrottle: { get () { return this.reindexRethrottle } }, + render_search_template: { get () { return this.renderSearchTemplate } }, rollup: { get () { if (this[kRollup] === null) { @@ -401,6 +383,9 @@ Object.defineProperties(ESAPI.prototype, { return this[kRollup] } }, + scripts_painless_execute: { get () { return this.scriptsPainlessExecute } }, + search_shards: { get () { return this.searchShards } }, + search_template: { get () { return this.searchTemplate } }, searchableSnapshots: { get () { if (this[kSearchableSnapshots] === null) { @@ -418,6 +403,14 @@ Object.defineProperties(ESAPI.prototype, { return this[kSecurity] } }, + shutdown: { + get () { + if (this[kShutdown] === null) { + this[kShutdown] = new ShutdownApi(this.transport, this[kConfigurationError]) + } + return this[kShutdown] + } + }, slm: { get () { if (this[kSlm] === null) { @@ -426,6 +419,14 @@ Object.defineProperties(ESAPI.prototype, { return this[kSlm] } }, + snapshot: { + get () { + if (this[kSnapshot] === null) { + this[kSnapshot] = new SnapshotApi(this.transport, this[kConfigurationError]) + } + return this[kSnapshot] + } + }, sql: { get () { if (this[kSql] === null) { @@ -442,6 +443,14 @@ Object.defineProperties(ESAPI.prototype, { return this[kSsl] } }, + tasks: { + get () { + if (this[kTasks] === null) { + this[kTasks] = new TasksApi(this.transport, this[kConfigurationError]) + } + return this[kTasks] + } + }, textStructure: { get () { if (this[kTextStructure] === null) { @@ -459,6 +468,8 @@ Object.defineProperties(ESAPI.prototype, { return this[kTransform] } }, + update_by_query: { get () { return this.updateByQuery } }, + update_by_query_rethrottle: { get () { return this.updateByQueryRethrottle } }, watcher: { get () { if (this[kWatcher] === null) { diff --git a/api/kibana.d.ts b/api/kibana.d.ts index 005dbf9dc..4b1e6fc48 100644 --- a/api/kibana.d.ts +++ b/api/kibana.d.ts @@ -191,6 +191,7 @@ interface KibanaClient { explain(params: T.ExplainRequest, options?: TransportRequestOptions): TransportRequestPromise, TContext>> features: { getFeatures(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise> + resetFeatures(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise> } fieldCaps(params?: T.FieldCapabilitiesRequest, options?: TransportRequestOptions): TransportRequestPromise> get(params: T.GetRequest, options?: TransportRequestOptions): TransportRequestPromise, TContext>> @@ -221,7 +222,7 @@ interface KibanaClient { clone(params: T.CloneIndexRequest, options?: TransportRequestOptions): TransportRequestPromise> close(params: T.CloseIndexRequest, options?: TransportRequestOptions): TransportRequestPromise> create(params: T.CreateIndexRequest, options?: TransportRequestOptions): TransportRequestPromise> - createDataStream(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise> + createDataStream(params: T.IndicesCreateDataStreamRequest, options?: TransportRequestOptions): TransportRequestPromise> dataStreamsStats(params?: T.IndicesDataStreamsStatsRequest, options?: TransportRequestOptions): TransportRequestPromise> delete(params: T.DeleteIndexRequest, options?: TransportRequestOptions): TransportRequestPromise> deleteAlias(params: T.DeleteAliasRequest, options?: TransportRequestOptions): TransportRequestPromise> @@ -239,7 +240,7 @@ interface KibanaClient { freeze(params: T.FreezeIndexRequest, options?: TransportRequestOptions): TransportRequestPromise> get(params: T.GetIndexRequest, options?: TransportRequestOptions): TransportRequestPromise> getAlias(params?: T.GetAliasRequest, options?: TransportRequestOptions): TransportRequestPromise> - getDataStream(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise> + getDataStream(params?: T.IndicesGetDataStreamRequest, options?: TransportRequestOptions): TransportRequestPromise> getFieldMapping(params: T.GetFieldMappingRequest, options?: TransportRequestOptions): TransportRequestPromise> getIndexTemplate(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise> getMapping(params?: T.GetMappingRequest, options?: TransportRequestOptions): TransportRequestPromise> @@ -274,6 +275,7 @@ interface KibanaClient { info(params?: T.RootNodeInfoRequest, options?: TransportRequestOptions): TransportRequestPromise> ingest: { deletePipeline(params: T.DeletePipelineRequest, options?: TransportRequestOptions): TransportRequestPromise> + geoIpStats(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise> getPipeline(params?: T.GetPipelineRequest, options?: TransportRequestOptions): TransportRequestPromise> processorGrok(params?: T.GrokProcessorPatternsRequest, options?: TransportRequestOptions): TransportRequestPromise> putPipeline(params: T.PutPipelineRequest, options?: TransportRequestOptions): TransportRequestPromise> @@ -302,7 +304,7 @@ interface KibanaClient { deleteCalendar(params: T.DeleteCalendarRequest, options?: TransportRequestOptions): TransportRequestPromise> deleteCalendarEvent(params: T.DeleteCalendarEventRequest, options?: TransportRequestOptions): TransportRequestPromise> deleteCalendarJob(params: T.DeleteCalendarJobRequest, options?: TransportRequestOptions): TransportRequestPromise> - deleteDataFrameAnalytics(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise> + deleteDataFrameAnalytics(params: T.DeleteDataFrameAnalyticsRequest, options?: TransportRequestOptions): TransportRequestPromise> deleteDatafeed(params: T.DeleteDatafeedRequest, options?: TransportRequestOptions): TransportRequestPromise> deleteExpiredData(params?: T.DeleteExpiredDataRequest, options?: TransportRequestOptions): TransportRequestPromise> deleteFilter(params: T.DeleteFilterRequest, options?: TransportRequestOptions): TransportRequestPromise> @@ -314,6 +316,7 @@ interface KibanaClient { estimateModelMemory(params?: T.EstimateModelMemoryRequest, options?: TransportRequestOptions): TransportRequestPromise> evaluateDataFrame(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise> explainDataFrameAnalytics(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise> + findFileStructure(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise> flushJob(params: T.FlushJobRequest, options?: TransportRequestOptions): TransportRequestPromise> forecast(params: T.ForecastJobRequest, options?: TransportRequestOptions): TransportRequestPromise> getBuckets(params: T.GetBucketsRequest, options?: TransportRequestOptions): TransportRequestPromise> @@ -365,7 +368,7 @@ interface KibanaClient { monitoring: { bulk(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise> } - msearch(params?: T.MultiSearchRequest, options?: TransportRequestOptions): TransportRequestPromise> + msearch(params?: T.MultiSearchRequest, options?: TransportRequestOptions): TransportRequestPromise, TContext>> msearchTemplate(params?: T.MultiSearchTemplateRequest, options?: TransportRequestOptions): TransportRequestPromise> mtermvectors(params?: T.MultiTermVectorsRequest, options?: TransportRequestOptions): TransportRequestPromise> nodes: { @@ -435,6 +438,11 @@ interface KibanaClient { putRoleMapping(params: T.PutRoleMappingRequest, options?: TransportRequestOptions): TransportRequestPromise> putUser(params: T.PutUserRequest, options?: TransportRequestOptions): TransportRequestPromise> } + shutdown: { + deleteNode(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise> + getNode(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise> + putNode(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise> + } slm: { deleteLifecycle(params: T.DeleteSnapshotLifecycleRequest, options?: TransportRequestOptions): TransportRequestPromise> executeLifecycle(params: T.ExecuteSnapshotLifecycleRequest, options?: TransportRequestOptions): TransportRequestPromise> @@ -488,7 +496,7 @@ interface KibanaClient { } update(params: T.UpdateRequest, options?: TransportRequestOptions): TransportRequestPromise, TContext>> updateByQuery(params: T.UpdateByQueryRequest, options?: TransportRequestOptions): TransportRequestPromise> - updateByQueryRethrottle(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise> + updateByQueryRethrottle(params: T.UpdateByQueryRethrottleRequest, options?: TransportRequestOptions): TransportRequestPromise> watcher: { ackWatch(params: T.AcknowledgeWatchRequest, options?: TransportRequestOptions): TransportRequestPromise> activateWatch(params: T.ActivateWatchRequest, options?: TransportRequestOptions): TransportRequestPromise> diff --git a/api/new.d.ts b/api/new.d.ts index 492cdbd00..74432ba99 100644 --- a/api/new.d.ts +++ b/api/new.d.ts @@ -445,6 +445,10 @@ interface NewClientTypes { getFeatures(callback: callbackFn): TransportRequestCallback getFeatures(params: TODO, callback: callbackFn): TransportRequestCallback getFeatures(params: TODO, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + resetFeatures(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise> + resetFeatures(callback: callbackFn): TransportRequestCallback + resetFeatures(params: TODO, callback: callbackFn): TransportRequestCallback + resetFeatures(params: TODO, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback } fieldCaps(params?: T.FieldCapabilitiesRequest, options?: TransportRequestOptions): TransportRequestPromise> fieldCaps(callback: callbackFn): TransportRequestCallback @@ -533,10 +537,9 @@ interface NewClientTypes { create(params: T.CreateIndexRequest, options?: TransportRequestOptions): TransportRequestPromise> create(params: T.CreateIndexRequest, callback: callbackFn): TransportRequestCallback create(params: T.CreateIndexRequest, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback - createDataStream(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise> - createDataStream(callback: callbackFn): TransportRequestCallback - createDataStream(params: TODO, callback: callbackFn): TransportRequestCallback - createDataStream(params: TODO, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + createDataStream(params: T.IndicesCreateDataStreamRequest, options?: TransportRequestOptions): TransportRequestPromise> + createDataStream(params: T.IndicesCreateDataStreamRequest, callback: callbackFn): TransportRequestCallback + createDataStream(params: T.IndicesCreateDataStreamRequest, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback dataStreamsStats(params?: T.IndicesDataStreamsStatsRequest, options?: TransportRequestOptions): TransportRequestPromise> dataStreamsStats(callback: callbackFn): TransportRequestCallback dataStreamsStats(params: T.IndicesDataStreamsStatsRequest, callback: callbackFn): TransportRequestCallback @@ -595,10 +598,10 @@ interface NewClientTypes { getAlias(callback: callbackFn): TransportRequestCallback getAlias(params: T.GetAliasRequest, callback: callbackFn): TransportRequestCallback getAlias(params: T.GetAliasRequest, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback - getDataStream(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise> - getDataStream(callback: callbackFn): TransportRequestCallback - getDataStream(params: TODO, callback: callbackFn): TransportRequestCallback - getDataStream(params: TODO, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + getDataStream(params?: T.IndicesGetDataStreamRequest, options?: TransportRequestOptions): TransportRequestPromise> + getDataStream(callback: callbackFn): TransportRequestCallback + getDataStream(params: T.IndicesGetDataStreamRequest, callback: callbackFn): TransportRequestCallback + getDataStream(params: T.IndicesGetDataStreamRequest, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback getFieldMapping(params: T.GetFieldMappingRequest, options?: TransportRequestOptions): TransportRequestPromise> getFieldMapping(params: T.GetFieldMappingRequest, callback: callbackFn): TransportRequestCallback getFieldMapping(params: T.GetFieldMappingRequest, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback @@ -717,6 +720,10 @@ interface NewClientTypes { deletePipeline(params: T.DeletePipelineRequest, options?: TransportRequestOptions): TransportRequestPromise> deletePipeline(params: T.DeletePipelineRequest, callback: callbackFn): TransportRequestCallback deletePipeline(params: T.DeletePipelineRequest, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + geoIpStats(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise> + geoIpStats(callback: callbackFn): TransportRequestCallback + geoIpStats(params: TODO, callback: callbackFn): TransportRequestCallback + geoIpStats(params: TODO, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback getPipeline(params?: T.GetPipelineRequest, options?: TransportRequestOptions): TransportRequestPromise> getPipeline(callback: callbackFn): TransportRequestCallback getPipeline(params: T.GetPipelineRequest, callback: callbackFn): TransportRequestCallback @@ -800,10 +807,9 @@ interface NewClientTypes { deleteCalendarJob(params: T.DeleteCalendarJobRequest, options?: TransportRequestOptions): TransportRequestPromise> deleteCalendarJob(params: T.DeleteCalendarJobRequest, callback: callbackFn): TransportRequestCallback deleteCalendarJob(params: T.DeleteCalendarJobRequest, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback - deleteDataFrameAnalytics(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise> - deleteDataFrameAnalytics(callback: callbackFn): TransportRequestCallback - deleteDataFrameAnalytics(params: TODO, callback: callbackFn): TransportRequestCallback - deleteDataFrameAnalytics(params: TODO, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + deleteDataFrameAnalytics(params: T.DeleteDataFrameAnalyticsRequest, options?: TransportRequestOptions): TransportRequestPromise> + deleteDataFrameAnalytics(params: T.DeleteDataFrameAnalyticsRequest, callback: callbackFn): TransportRequestCallback + deleteDataFrameAnalytics(params: T.DeleteDataFrameAnalyticsRequest, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback deleteDatafeed(params: T.DeleteDatafeedRequest, options?: TransportRequestOptions): TransportRequestPromise> deleteDatafeed(params: T.DeleteDatafeedRequest, callback: callbackFn): TransportRequestCallback deleteDatafeed(params: T.DeleteDatafeedRequest, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback @@ -841,6 +847,10 @@ interface NewClientTypes { explainDataFrameAnalytics(callback: callbackFn): TransportRequestCallback explainDataFrameAnalytics(params: TODO, callback: callbackFn): TransportRequestCallback explainDataFrameAnalytics(params: TODO, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + findFileStructure(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise> + findFileStructure(callback: callbackFn): TransportRequestCallback + findFileStructure(params: TODO, callback: callbackFn): TransportRequestCallback + findFileStructure(params: TODO, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback flushJob(params: T.FlushJobRequest, options?: TransportRequestOptions): TransportRequestPromise> flushJob(params: T.FlushJobRequest, callback: callbackFn): TransportRequestCallback flushJob(params: T.FlushJobRequest, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback @@ -1011,10 +1021,10 @@ interface NewClientTypes { bulk(params: TODO, callback: callbackFn): TransportRequestCallback bulk(params: TODO, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback } - msearch(params?: T.MultiSearchRequest, options?: TransportRequestOptions): TransportRequestPromise> - msearch(callback: callbackFn): TransportRequestCallback - msearch(params: T.MultiSearchRequest, callback: callbackFn): TransportRequestCallback - msearch(params: T.MultiSearchRequest, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + msearch(params?: T.MultiSearchRequest, options?: TransportRequestOptions): TransportRequestPromise, TContext>> + msearch(callback: callbackFn, TContext>): TransportRequestCallback + msearch(params: T.MultiSearchRequest, callback: callbackFn, TContext>): TransportRequestCallback + msearch(params: T.MultiSearchRequest, options: TransportRequestOptions, callback: callbackFn, TContext>): TransportRequestCallback msearchTemplate(params?: T.MultiSearchTemplateRequest, options?: TransportRequestOptions): TransportRequestPromise> msearchTemplate(callback: callbackFn): TransportRequestCallback msearchTemplate(params: T.MultiSearchTemplateRequest, callback: callbackFn): TransportRequestCallback @@ -1245,6 +1255,20 @@ interface NewClientTypes { putUser(params: T.PutUserRequest, callback: callbackFn): TransportRequestCallback putUser(params: T.PutUserRequest, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback } + shutdown: { + deleteNode(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise> + deleteNode(callback: callbackFn): TransportRequestCallback + deleteNode(params: TODO, callback: callbackFn): TransportRequestCallback + deleteNode(params: TODO, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + getNode(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise> + getNode(callback: callbackFn): TransportRequestCallback + getNode(params: TODO, callback: callbackFn): TransportRequestCallback + getNode(params: TODO, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + putNode(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise> + putNode(callback: callbackFn): TransportRequestCallback + putNode(params: TODO, callback: callbackFn): TransportRequestCallback + putNode(params: TODO, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + } slm: { deleteLifecycle(params: T.DeleteSnapshotLifecycleRequest, options?: TransportRequestOptions): TransportRequestPromise> deleteLifecycle(params: T.DeleteSnapshotLifecycleRequest, callback: callbackFn): TransportRequestCallback @@ -1392,10 +1416,9 @@ interface NewClientTypes { updateByQuery(params: T.UpdateByQueryRequest, options?: TransportRequestOptions): TransportRequestPromise> updateByQuery(params: T.UpdateByQueryRequest, callback: callbackFn): TransportRequestCallback updateByQuery(params: T.UpdateByQueryRequest, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback - updateByQueryRethrottle(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise> - updateByQueryRethrottle(callback: callbackFn): TransportRequestCallback - updateByQueryRethrottle(params: TODO, callback: callbackFn): TransportRequestCallback - updateByQueryRethrottle(params: TODO, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + updateByQueryRethrottle(params: T.UpdateByQueryRethrottleRequest, options?: TransportRequestOptions): TransportRequestPromise> + updateByQueryRethrottle(params: T.UpdateByQueryRethrottleRequest, callback: callbackFn): TransportRequestCallback + updateByQueryRethrottle(params: T.UpdateByQueryRethrottleRequest, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback watcher: { ackWatch(params: T.AcknowledgeWatchRequest, options?: TransportRequestOptions): TransportRequestPromise> ackWatch(params: T.AcknowledgeWatchRequest, callback: callbackFn): TransportRequestCallback diff --git a/api/requestParams.d.ts b/api/requestParams.d.ts index 73e1fc1a0..2e3a1f004 100644 --- a/api/requestParams.d.ts +++ b/api/requestParams.d.ts @@ -45,6 +45,8 @@ export interface AsyncSearchStatus extends Generic { 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; @@ -108,6 +110,8 @@ export interface AutoscalingPutAutoscalingPolicy extends Generi export interface Bulk extends Generic { index?: string; type?: string; + _source_exclude?: string | string[]; + _source_include?: string | string[]; wait_for_active_shards?: string; refresh?: 'wait_for' | boolean; routing?: string; @@ -649,6 +653,8 @@ export interface Delete extends Generic { export interface DeleteByQuery 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'; @@ -743,6 +749,8 @@ export interface Exists extends Generic { id: string; index: string; type?: string; + _source_exclude?: string | string[]; + _source_include?: string | string[]; stored_fields?: string | string[]; preference?: string; realtime?: boolean; @@ -759,6 +767,8 @@ export interface ExistsSource extends Generic { id: string; index: string; type?: string; + _source_exclude?: string | string[]; + _source_include?: string | string[]; preference?: string; realtime?: boolean; refresh?: boolean; @@ -774,6 +784,8 @@ export interface Explain extends Generic { id: string; index: string; type?: string; + _source_exclude?: string | string[]; + _source_include?: string | string[]; analyze_wildcard?: boolean; analyzer?: string; default_operator?: 'AND' | 'OR'; @@ -810,6 +822,8 @@ export interface Get extends Generic { id: string; index: string; type?: string; + _source_exclude?: string | string[]; + _source_include?: string | string[]; stored_fields?: string | string[]; preference?: string; realtime?: boolean; @@ -837,6 +851,8 @@ export interface GetSource extends Generic { id: string; index: string; type?: string; + _source_exclude?: string | string[]; + _source_include?: string | string[]; preference?: string; realtime?: boolean; refresh?: boolean; @@ -1463,6 +1479,8 @@ export interface LogstashPutPipeline extends Generic { export interface Mget extends Generic { index?: string; type?: string; + _source_exclude?: string | string[]; + _source_include?: string | string[]; stored_fields?: string | string[]; preference?: string; realtime?: boolean; @@ -1563,6 +1581,24 @@ export interface MlExplainDataFrameAnalytics extends Generic { body?: T; } +export interface MlFindFileStructure extends Generic { + lines_to_sample?: number; + line_merge_size_limit?: number; + timeout?: string; + charset?: string; + format?: 'ndjson' | 'xml' | 'delimited' | 'semi_structured_text'; + has_header_row?: boolean; + column_names?: string | string[]; + delimiter?: string; + quote?: string; + should_trim_fields?: boolean; + grok_pattern?: string; + timestamp_field?: string; + timestamp_format?: string; + explain?: boolean; + body: T; +} + export interface MlFlushJob extends Generic { job_id: string; calc_interim?: boolean; @@ -2104,6 +2140,8 @@ 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; analyze_wildcard?: boolean; ccs_minimize_roundtrips?: boolean; @@ -2594,6 +2632,8 @@ 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[]; @@ -2612,6 +2652,8 @@ export interface Update extends Generic { 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'; diff --git a/api/types.d.ts b/api/types.d.ts index 0d07dc4b5..da0b09124 100644 --- a/api/types.d.ts +++ b/api/types.d.ts @@ -292,7 +292,7 @@ export interface AnalysisConfig { categorization_field_name?: Field categorization_filters?: Array detectors: Array - influencers: Array + influencers?: Array latency?: Time multivariate_by_fields?: boolean per_partition_categorization?: PerPartitionCategorization @@ -387,8 +387,9 @@ export interface AnomalyCause { export interface AnomalyDetectors { categorization_analyzer: CategorizationAnalyzer categorization_examples_limit: integer - model_memory_limit: string + model_memory_limit: ByteSize model_snapshot_retention_days: integer + daily_model_snapshot_retention_after_days: integer } export interface AnomalyRecord { @@ -785,7 +786,7 @@ export interface BucketInfluencer { influencer_score: double initial_influencer_score: double is_interim: boolean - job_id: string + job_id: Id probability: double result_type: string timestamp: DateString @@ -3813,17 +3814,18 @@ export interface DailySchedule { export interface DataCounts { bucket_count: long - earliest_record_timestamp: long + earliest_record_timestamp?: long empty_bucket_count: long input_bytes: long input_field_count: long input_record_count: long invalid_date_count: long - job_id: string - last_data_time: long - latest_empty_bucket_timestamp: long - latest_record_timestamp: long - latest_sparse_bucket_timestamp: long + job_id: Id + last_data_time?: long + latest_empty_bucket_timestamp?: long + latest_record_timestamp?: long + latest_sparse_bucket_timestamp?: long + latest_bucket_timestamp?: long missing_field_count: long out_of_order_timestamp_count: long processed_field_count: long @@ -3835,6 +3837,7 @@ export interface DataDescription { format?: string time_field: Field time_format?: string + field_delimiter?: string } export interface DataPathStats { @@ -3856,6 +3859,8 @@ export interface DataPathStats { type: string } +export type DataStreamHealthStatus = 'GREEN' | 'green' | 'YELLOW' | 'yellow' | 'RED' | 'red' + export type DataStreamName = string export interface DataStreamsStatsItem { @@ -3895,10 +3900,10 @@ export interface DataTiersUsage extends XPackUsage { export interface Datafeed { aggregations?: Record aggs?: Record - chunking_config: ChunkingConfig - datafeed_id: string + chunking_config?: ChunkingConfig + datafeed_id: Id frequency?: Timestamp - indices: Array + indices: Indices indexes?: Array job_id: Id max_empty_searches?: integer @@ -3908,18 +3913,26 @@ export interface Datafeed { scroll_size?: integer delayed_data_check_config: DelayedDataCheckConfig runtime_mappings?: RuntimeFields + indices_options?: DatafeedIndicesOptions } export interface DatafeedCount { count: long } +export interface DatafeedIndicesOptions { + allow_no_indices?: boolean + expand_wildcards?: ExpandWildcards + ignore_unavailable?: boolean + ignore_throttled?: boolean +} + export type DatafeedState = 'started' | 'stopped' | 'starting' | 'stopping' export interface DatafeedStats { - assignment_explanation: string - datafeed_id: string - node: DiscoveryNode + assignment_explanation?: string + datafeed_id: Id + node?: DiscoveryNode state: DatafeedState timing_stats: DatafeedTimingStats } @@ -4198,9 +4211,9 @@ export interface DeleteCalendarJobRequest extends RequestBase { } export interface DeleteCalendarJobResponse extends ResponseBase { - calendar_id: string - description: string - job_ids: Array + calendar_id: Id + description?: string + job_ids: Ids } export interface DeleteCalendarRequest extends RequestBase { @@ -4222,6 +4235,15 @@ export interface DeleteDanglingIndexResponse extends ResponseBase { stub: integer } +export interface DeleteDataFrameAnalyticsRequest extends RequestBase { + id: Id + force?: boolean + timeout?: Time +} + +export interface DeleteDataFrameAnalyticsResponse extends AcknowledgedResponseBase { +} + export interface DeleteDatafeedRequest extends RequestBase { datafeed_id: Id force?: boolean @@ -4301,7 +4323,7 @@ export interface DeleteJobResponse extends AcknowledgedResponseBase { export interface DeleteLicenseRequest extends RequestBase { } -export interface DeleteLicenseResponse extends ResponseBase { +export interface DeleteLicenseResponse extends AcknowledgedResponseBase { } export interface DeleteLifecycleRequest extends RequestBase { @@ -4416,7 +4438,7 @@ export interface DeleteSnapshotResponse extends AcknowledgedResponseBase { } export interface DeleteTrainedModelAliasRequest extends RequestBase { - model_alias: Alias + model_alias: Name model_id: Id } @@ -4540,9 +4562,9 @@ export interface DisableUserResponse extends ResponseBase { export interface DiscoveryNode { attributes: Record - ephemeral_id: string - id: string - name: string + ephemeral_id: Id + id: Id + name: Name transport_address: string } @@ -5313,8 +5335,8 @@ export interface FileSystemStats { } export interface Filter { - description: string - filter_id: string + description?: string + filter_id: Id items: Array } @@ -5836,14 +5858,19 @@ export interface GetAliasResponse extends DictionaryResponseBase } +export interface GetScriptContextRequest extends RequestBase { + stub_a: integer + stub_b: integer + body?: { + stub_c: integer + } +} + +export interface GetScriptContextResponse extends ResponseBase { + stub: integer +} + +export interface GetScriptLanguagesRequest extends RequestBase { + stub_a: integer + stub_b: integer + body?: { + stub_c: integer + } +} + +export interface GetScriptLanguagesResponse extends ResponseBase { + stub: integer +} + export interface GetScriptRequest extends RequestBase { id: Id master_timeout?: Time @@ -7026,15 +7088,10 @@ export interface IndexingStats { export type Indices = string | Array export interface IndicesCreateDataStreamRequest extends RequestBase { - stub_a: integer - stub_b: integer - body?: { - stub_c: integer - } + name: DataStreamName } -export interface IndicesCreateDataStreamResponse extends ResponseBase { - stub: integer +export interface IndicesCreateDataStreamResponse extends AcknowledgedResponseBase { } export interface IndicesDataStreamsStatsRequest extends RequestBase { @@ -7059,13 +7116,34 @@ export interface IndicesDeleteDataStreamRequest extends RequestBase { export interface IndicesDeleteDataStreamResponse extends AcknowledgedResponseBase { } +export interface IndicesGetDataStreamItem { + name: DataStreamName + timestamp_field: IndicesGetDataStreamItemTimestampField + indices: Array + generation: integer + template: Name + hidden: boolean + status: DataStreamHealthStatus + ilm_policy?: Name + _meta?: Record +} + +export interface IndicesGetDataStreamItemIndex { + index_name: IndexName + index_uuid: Uuid +} + +export interface IndicesGetDataStreamItemTimestampField { + name: Field +} + export interface IndicesGetDataStreamRequest extends RequestBase { name?: IndexName expand_wildcards?: ExpandWildcardOptions } export interface IndicesGetDataStreamResponse extends ResponseBase { - stub: integer + data_streams: Array } export interface IndicesMigrateToDataStreamRequest extends RequestBase { @@ -7412,14 +7490,14 @@ export interface Job { analysis_config?: AnalysisConfig analysis_limits?: AnalysisLimits background_persist_interval?: Time - count: integer - created_by: EmptyObject + count?: integer + created_by?: EmptyObject create_time?: integer detectors?: JobStatistics data_description?: DataDescription description?: string finished_time?: integer - forecasts: MlJobForecasts + forecasts?: MlJobForecasts job_id?: Id job_type?: string model_plot?: ModelPlotConfig @@ -7438,11 +7516,12 @@ export interface Job { } export interface JobForecastStatistics { - memory_bytes: JobStatistics - processing_time_ms: JobStatistics - records: JobStatistics - status: Record + memory_bytes?: JobStatistics + processing_time_ms?: JobStatistics + records?: JobStatistics + status?: Record total: long + forecasted_jobs: integer } export type JobState = 'closing' | 'closed' | 'opened' | 'failed' | 'opening' @@ -7455,13 +7534,13 @@ export interface JobStatistics { } export interface JobStats { - assignment_explanation: string + assignment_explanation?: string data_counts: DataCounts forecasts_stats: JobForecastStatistics job_id: string model_size_stats: ModelSizeStats - node: DiscoveryNode - open_time: DateString + node?: DiscoveryNode + open_time?: DateString state: JobState timing_stats: TimingStats deleting?: boolean @@ -7683,8 +7762,9 @@ export interface LimitTokenCountTokenFilter extends TokenFilterBase { } export interface Limits { - max_model_memory_limit: string - effective_max_model_memory_limit: string + max_model_memory_limit?: ByteSize + effective_max_model_memory_limit: ByteSize + total_ml_memory: ByteSize } export interface LineStringGeoShape { @@ -7789,6 +7869,7 @@ export interface MachineLearningInfoResponse extends ResponseBase { defaults: Defaults limits: Limits upgrade_mode: boolean + native_code: NativeCode } export interface MachineLearningUsage extends XPackUsage { @@ -8029,6 +8110,7 @@ export interface ModelPlotConfig { export interface ModelPlotConfigEnabled { enabled: boolean + terms?: string } export interface ModelSizeStats { @@ -8037,6 +8119,10 @@ export interface ModelSizeStats { log_time: Time memory_status: MemoryStatus model_bytes: long + model_bytes_exceeded?: long + model_bytes_memory_limit?: long + peak_model_bytes?: long + assignment_memory_basis?: string result_type: string total_by_field_count: long total_over_field_count: long @@ -8048,6 +8134,7 @@ export interface ModelSizeStats { frequent_category_count: integer rare_category_count: integer total_category_count: integer + timestamp?: long } export interface ModelSnapshot { @@ -8200,6 +8287,28 @@ export interface MultiMatchQuery extends QueryBase { zero_terms_query?: ZeroTermsQuery } +export interface MultiSearchBody { + aggregations?: Record + aggs?: Record + query?: QueryContainer + from?: integer + size?: integer + pit?: PointInTimeReference + track_total_hits?: boolean | integer + suggest?: SuggestContainer | Record +} + +export interface MultiSearchHeader { + allow_no_indices?: boolean + expand_wildcards?: ExpandWildcards + ignore_unavailable?: boolean + index?: Indices + preference?: string + request_cache?: boolean + routing?: string + search_type?: SearchType +} + export interface MultiSearchRequest extends RequestBase { index?: Indices type?: Types @@ -8208,15 +8317,18 @@ export interface MultiSearchRequest extends RequestBase { max_concurrent_shard_requests?: long pre_filter_shard_size?: long search_type?: SearchType - total_hits_as_integer?: boolean + rest_total_hits_as_int?: boolean typed_keys?: boolean - body: { - operations?: Record - } + body: Array } -export interface MultiSearchResponse extends ResponseBase { - responses: Array> +export interface MultiSearchResponse extends ResponseBase { + took: long + responses: Array | ErrorResponse> +} + +export interface MultiSearchResult extends SearchResponse { + status: integer } export interface MultiSearchTemplateRequest extends RequestBase { @@ -8340,6 +8452,11 @@ export type NamedQuery = NamedQueryKeys | export type Names = string | Array +export interface NativeCode { + build_hash: string + version: VersionString +} + export interface NativeCodeInformation { build_hash: string version: VersionString @@ -9445,6 +9562,7 @@ export interface PutMappingRequest extends RequestBase { routing_field?: RoutingField size_field?: SizeField source_field?: SourceField + runtime?: RuntimeFields } } @@ -10020,7 +10138,7 @@ export interface ReindexNode { attributes: Record host: string ip: string - name: string + name: Name roles: Array tasks: Record transport_address: string @@ -10105,11 +10223,12 @@ export interface ReindexTask { cancellable: boolean description: string id: long - node: string + node: Name running_time_in_nanos: long start_time_in_millis: long status: ReindexStatus type: string + headers: Record } export type RelationName = string @@ -10300,11 +10419,11 @@ export interface ResultBucket { event_count: long initial_anomaly_score: double is_interim: boolean - job_id: string - partition_scores: Array + job_id: Id + partition_scores?: Array processing_time_ms: double result_type: string - timestamp: DateString + timestamp: Time } export interface ResumeAutoFollowPatternRequest extends RequestBase { @@ -10482,7 +10601,7 @@ export interface RollupJobStats { export interface RollupJobStatus { current_position?: Record job_state: IndexingJobState - upgraded_doc_id: boolean + upgraded_doc_id?: boolean } export interface RollupJobTaskFailure { @@ -10555,10 +10674,12 @@ export type RuleFilterType = 'include' | 'exclude' export interface RuntimeField { format?: string - script?: StoredScript - type: FieldType + script?: Script + type: RuntimeFieldType } +export type RuntimeFieldType = 'boolean' | 'date' | 'double' | 'geo_point' | 'ip' | 'keyword' | 'long' + export interface RuntimeFieldTypesStats { name: Name count: integer @@ -10631,9 +10752,9 @@ export interface ScheduleTriggerEvent { export interface ScheduledEvent { calendar_id: Id description: string - end_time: DateString + end_time: EpochMillis event_id: Id - start_time: DateString + start_time: EpochMillis } export interface ScoreFunctionBase { @@ -11648,7 +11769,7 @@ export interface SmoothingModelContainer { } export interface SnapshotIndexStats { - shards: Record + shards: Record shards_stats: SnapshotShardsStats stats: SnapshotStats } @@ -11804,6 +11925,25 @@ export interface SnapshotShardsStats { total: long } +export type SnapshotShardsStatsStage = 'DONE' | 'FAILURE' | 'FINALIZE' | 'INIT' | 'STARTED' + +export interface SnapshotShardsStatsSummary { + incremental: SnapshotShardsStatsSummaryItem + total: SnapshotShardsStatsSummaryItem + start_time_in_millis: long + time_in_millis: long +} + +export interface SnapshotShardsStatsSummaryItem { + file_count: long + size_in_bytes: long +} + +export interface SnapshotShardsStatus { + stage: SnapshotShardsStatsStage + stats: SnapshotShardsStatsSummary +} + export interface SnapshotStats { incremental: FileCountSnapshotStats start_time_in_millis: long @@ -12046,9 +12186,10 @@ export interface StartBasicLicenseResponse extends AcknowledgedResponseBase { export interface StartDatafeedRequest extends RequestBase { datafeed_id: Id + start?: Time body?: { - end?: DateString - start?: DateString + end?: Time + start?: Time timeout?: Time } } @@ -12136,8 +12277,9 @@ export interface StepKey { } export interface StopDatafeedRequest extends RequestBase { - datafeed_id: Id - allow_no_datafeeds?: boolean + datafeed_id: Ids + allow_no_match?: boolean + force?: boolean body?: { force?: boolean timeout?: Time @@ -12430,7 +12572,7 @@ export interface TermQuery extends QueryBase { export interface TermSuggestOption { text: string - freq: long + freq?: long score: double } @@ -12658,13 +12800,14 @@ export type TimeSpan = string export type Timestamp = string export interface TimingStats { - average_bucket_processing_time_ms: double + average_bucket_processing_time_ms?: double bucket_count: long - exponential_average_bucket_processing_time_ms: double + exponential_average_bucket_processing_time_ms?: double exponential_average_bucket_processing_time_per_hour_ms: double - job_id: string - maximum_bucket_processing_time_ms: double - minimum_bucket_processing_time_ms: double + job_id: Id + total_bucket_processing_time_ms: double + maximum_bucket_processing_time_ms?: double + minimum_bucket_processing_time_ms?: double } export interface Token { @@ -13063,11 +13206,25 @@ export interface UpdateByQueryResponse extends ResponseBase { throttled_until_millis?: ulong } +export interface UpdateByQueryRethrottleNode { + attributes: Record + host: string + transport_address: string + ip: string + name: Name + roles: Array + tasks: Record +} + export interface UpdateByQueryRethrottleRequest extends RequestBase { task_id: Id requests_per_second?: long } +export interface UpdateByQueryRethrottleResponse extends ResponseBase { + nodes: Record +} + export interface UpdateDatafeedRequest extends RequestBase { datafeed_id: Id allow_no_indices?: boolean @@ -13077,8 +13234,11 @@ export interface UpdateDatafeedRequest extends RequestBase { body: { aggregations?: Record chunking_config?: ChunkingConfig + delayed_data_check_config?: DelayedDataCheckConfig frequency?: Time + indexes?: Indices indices?: Indices + indices_options?: DatafeedIndicesOptions job_id?: Id max_empty_searches?: integer query?: QueryContainer @@ -13089,17 +13249,19 @@ export interface UpdateDatafeedRequest extends RequestBase { } export interface UpdateDatafeedResponse extends ResponseBase { - aggregations: Record - chunking_config: ChunkingConfig - datafeed_id: string - frequency: Time + aggregations?: Record + chunking_config?: ChunkingConfig + datafeed_id: Id + frequency?: Time indices: Indices job_id: string - max_empty_searches: integer + max_empty_searches?: integer query: QueryContainer query_delay: Time - script_fields: Record + script_fields?: Record scroll_size: integer + indices_options: DatafeedIndicesOptions + delayed_data_check_config: DelayedDataCheckConfig } export interface UpdateFilterRequest extends RequestBase { @@ -13283,6 +13445,7 @@ export interface ValidateDetectorResponse extends AcknowledgedResponseBase { export interface ValidateJobRequest extends RequestBase { body: { + job_id?: Id analysis_config?: AnalysisConfig analysis_limits?: AnalysisLimits data_description?: DataDescription @@ -13311,21 +13474,23 @@ export interface ValidateQueryRequest extends RequestBase { lenient?: boolean query_on_query_string?: string rewrite?: boolean + q?: string body?: { query?: QueryContainer } } export interface ValidateQueryResponse extends ResponseBase { - explanations: Array - _shards: ShardStatistics + explanations?: Array + _shards?: ShardStatistics valid: boolean + error?: string } export interface ValidationExplanation { - error: string - explanation: string - index: string + error?: string + explanation?: string + index: IndexName valid: boolean } diff --git a/docs/reference.asciidoc b/docs/reference.asciidoc index 11b658503..56e51fdee 100644 --- a/docs/reference.asciidoc +++ b/docs/reference.asciidoc @@ -2324,8 +2324,8 @@ link:{ref}/cluster-reroute.html[Documentation] + [source,ts] ---- client.cluster.state({ - metric: string | string[], index: string | string[], + metric: string | string[], local: boolean, master_timeout: string, flat_settings: boolean, @@ -2339,12 +2339,12 @@ client.cluster.state({ link:{ref}/cluster-state.html[Documentation] + [cols=2*] |=== -|`metric` -|`string \| string[]` - Limit the information returned to the specified metrics - |`index` |`string \| string[]` - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices +|`metric` +|`string \| string[]` - Limit the information returned to the specified metrics + |`local` |`boolean` - Return local information, do not retrieve the state from master node (default: false) @@ -3277,7 +3277,7 @@ client.features.getFeatures({ master_timeout: string }) ---- -link:{ref}/modules-snapshots.html[Documentation] + +link:{ref}/get-features-api.html[Documentation] + [cols=2*] |=== |`master_timeout` or `masterTimeout` @@ -5798,6 +5798,16 @@ link:{ref}/delete-pipeline-api.html[Documentation] + |=== +[discrete] +=== ingest.geoIpStats + +[source,ts] +---- +client.ingest.geoIpStats() +---- +link:{ref}/geoip-stats-api.html[Documentation] + + + [discrete] === ingest.getPipeline @@ -6487,6 +6497,82 @@ link:{ref}/explain-dfanalytics.html[Documentation] + |=== +[discrete] +=== ml.findFileStructure +*Stability:* experimental +[source,ts] +---- +client.ml.findFileStructure({ + lines_to_sample: number, + line_merge_size_limit: number, + timeout: string, + charset: string, + format: 'ndjson' | 'xml' | 'delimited' | 'semi_structured_text', + has_header_row: boolean, + column_names: string | string[], + delimiter: string, + quote: string, + should_trim_fields: boolean, + grok_pattern: string, + timestamp_field: string, + timestamp_format: string, + explain: boolean, + body: object +}) +---- +link:{ref}/find-structure.html[Documentation] + +[cols=2*] +|=== +|`lines_to_sample` or `linesToSample` +|`number` - How many lines of the file should be included in the analysis + +_Default:_ `1000` + +|`line_merge_size_limit` or `lineMergeSizeLimit` +|`number` - Maximum number of characters permitted in a single message when lines are merged to create messages. + +_Default:_ `10000` + +|`timeout` +|`string` - Timeout after which the analysis will be aborted + +_Default:_ `25s` + +|`charset` +|`string` - Optional parameter to specify the character set of the file + +|`format` +|`'ndjson' \| 'xml' \| 'delimited' \| 'semi_structured_text'` - Optional parameter to specify the high level file format + +|`has_header_row` or `hasHeaderRow` +|`boolean` - Optional parameter to specify whether a delimited file includes the column names in its first row + +|`column_names` or `columnNames` +|`string \| string[]` - Optional parameter containing a comma separated list of the column names for a delimited file + +|`delimiter` +|`string` - Optional parameter to specify the delimiter character for a delimited file - must be a single character + +|`quote` +|`string` - Optional parameter to specify the quote character for a delimited file - must be a single character + +|`should_trim_fields` or `shouldTrimFields` +|`boolean` - Optional parameter to specify whether the values between delimiters in a delimited file should have whitespace trimmed from them + +|`grok_pattern` or `grokPattern` +|`string` - Optional parameter to specify the Grok pattern that should be used to extract fields from messages in a semi-structured text file + +|`timestamp_field` or `timestampField` +|`string` - Optional parameter to specify the timestamp field in the file + +|`timestamp_format` or `timestampFormat` +|`string` - Optional parameter to specify the timestamp format in the file - may be either a Joda or Java time format + +|`explain` +|`boolean` - Whether to include a commentary on how the structure was derived + +|`body` +|`object` - The contents of the file to be analyzed + +|=== + [discrete] === ml.flushJob @@ -7331,7 +7417,8 @@ link:{ref}/preview-dfanalytics.html[Documentation] + [source,ts] ---- client.ml.previewDatafeed({ - datafeed_id: string + datafeed_id: string, + body: object }) ---- link:{ref}/ml-preview-datafeed.html[Documentation] + @@ -7340,6 +7427,9 @@ link:{ref}/ml-preview-datafeed.html[Documentation] + |`datafeed_id` or `datafeedId` |`string` - The ID of the datafeed to preview +|`body` +|`object` - The datafeed config and job config with which to execute the preview + |=== [discrete] @@ -9753,6 +9843,61 @@ link:{ref}/security-api-put-user.html[Documentation] + |=== +[discrete] +=== shutdown.deleteNode +*Stability:* experimental +[source,ts] +---- +client.shutdown.deleteNode({ + node_id: string +}) +---- +link:https://www.elastic.co/guide/en/elasticsearch/reference/current[Documentation] + +[cols=2*] +|=== +|`node_id` or `nodeId` +|`string` - The node id of node to be removed from the shutdown state + +|=== + +[discrete] +=== shutdown.getNode +*Stability:* experimental +[source,ts] +---- +client.shutdown.getNode({ + node_id: string +}) +---- +link:https://www.elastic.co/guide/en/elasticsearch/reference/current[Documentation] + +[cols=2*] +|=== +|`node_id` or `nodeId` +|`string` - Which node for which to retrieve the shutdown status + +|=== + +[discrete] +=== shutdown.putNode +*Stability:* experimental +[source,ts] +---- +client.shutdown.putNode({ + node_id: string, + body: object +}) +---- +link:https://www.elastic.co/guide/en/elasticsearch/reference/current[Documentation] + +[cols=2*] +|=== +|`node_id` or `nodeId` +|`string` - The node id of node to be shut down + +|`body` +|`object` - The shutdown type definition to register + +|=== + [discrete] === slm.deleteLifecycle @@ -10439,7 +10584,7 @@ _Default:_ `true` [discrete] === textStructure.findStructure -*Stability:* experimental + [source,ts] ---- client.textStructure.findStructure({ diff --git a/index.d.ts b/index.d.ts index e881268d5..70ca1e2ef 100644 --- a/index.d.ts +++ b/index.d.ts @@ -988,6 +988,14 @@ declare class Client { flush, TContext = Context>(callback: callbackFn): TransportRequestCallback flush, TContext = Context>(params: RequestParams.IndicesFlush, callback: callbackFn): TransportRequestCallback flush, TContext = Context>(params: RequestParams.IndicesFlush, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + flush_synced, TContext = Context>(params?: RequestParams.IndicesFlushSynced, options?: TransportRequestOptions): TransportRequestPromise> + flush_synced, TContext = Context>(callback: callbackFn): TransportRequestCallback + flush_synced, TContext = Context>(params: RequestParams.IndicesFlushSynced, callback: callbackFn): TransportRequestCallback + flush_synced, TContext = Context>(params: RequestParams.IndicesFlushSynced, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + flushSynced, TContext = Context>(params?: RequestParams.IndicesFlushSynced, options?: TransportRequestOptions): TransportRequestPromise> + flushSynced, TContext = Context>(callback: callbackFn): TransportRequestCallback + flushSynced, TContext = Context>(params: RequestParams.IndicesFlushSynced, callback: callbackFn): TransportRequestCallback + flushSynced, TContext = Context>(params: RequestParams.IndicesFlushSynced, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback forcemerge, TContext = Context>(params?: RequestParams.IndicesForcemerge, options?: TransportRequestOptions): TransportRequestPromise> forcemerge, TContext = Context>(callback: callbackFn): TransportRequestCallback forcemerge, TContext = Context>(params: RequestParams.IndicesForcemerge, callback: callbackFn): TransportRequestCallback @@ -1056,6 +1064,14 @@ declare class Client { getTemplate, TContext = Context>(callback: callbackFn): TransportRequestCallback getTemplate, TContext = Context>(params: RequestParams.IndicesGetTemplate, callback: callbackFn): TransportRequestCallback getTemplate, TContext = Context>(params: RequestParams.IndicesGetTemplate, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + get_upgrade, TContext = Context>(params?: RequestParams.IndicesGetUpgrade, options?: TransportRequestOptions): TransportRequestPromise> + get_upgrade, TContext = Context>(callback: callbackFn): TransportRequestCallback + get_upgrade, TContext = Context>(params: RequestParams.IndicesGetUpgrade, callback: callbackFn): TransportRequestCallback + get_upgrade, TContext = Context>(params: RequestParams.IndicesGetUpgrade, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + getUpgrade, TContext = Context>(params?: RequestParams.IndicesGetUpgrade, options?: TransportRequestOptions): TransportRequestPromise> + getUpgrade, TContext = Context>(callback: callbackFn): TransportRequestCallback + getUpgrade, TContext = Context>(params: RequestParams.IndicesGetUpgrade, callback: callbackFn): TransportRequestCallback + getUpgrade, TContext = Context>(params: RequestParams.IndicesGetUpgrade, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback migrate_to_data_stream, TContext = Context>(params?: RequestParams.IndicesMigrateToDataStream, options?: TransportRequestOptions): TransportRequestPromise> migrate_to_data_stream, TContext = Context>(callback: callbackFn): TransportRequestCallback migrate_to_data_stream, TContext = Context>(params: RequestParams.IndicesMigrateToDataStream, callback: callbackFn): TransportRequestCallback @@ -1196,6 +1212,10 @@ declare class Client { updateAliases, TRequestBody extends RequestBody = Record, TContext = Context>(callback: callbackFn): TransportRequestCallback updateAliases, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.IndicesUpdateAliases, callback: callbackFn): TransportRequestCallback updateAliases, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.IndicesUpdateAliases, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + upgrade, TContext = Context>(params?: RequestParams.IndicesUpgrade, options?: TransportRequestOptions): TransportRequestPromise> + upgrade, TContext = Context>(callback: callbackFn): TransportRequestCallback + upgrade, TContext = Context>(params: RequestParams.IndicesUpgrade, callback: callbackFn): TransportRequestCallback + upgrade, TContext = Context>(params: RequestParams.IndicesUpgrade, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback validate_query, TRequestBody extends RequestBody = Record, TContext = Context>(params?: RequestParams.IndicesValidateQuery, options?: TransportRequestOptions): TransportRequestPromise> validate_query, TRequestBody extends RequestBody = Record, TContext = Context>(callback: callbackFn): TransportRequestCallback validate_query, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.IndicesValidateQuery, callback: callbackFn): TransportRequestCallback @@ -1466,6 +1486,14 @@ declare class Client { explainDataFrameAnalytics, TRequestBody extends RequestBody = Record, TContext = Context>(callback: callbackFn): TransportRequestCallback explainDataFrameAnalytics, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.MlExplainDataFrameAnalytics, callback: callbackFn): TransportRequestCallback explainDataFrameAnalytics, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.MlExplainDataFrameAnalytics, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + find_file_structure, TRequestBody extends RequestNDBody = Record[], TContext = Context>(params?: RequestParams.MlFindFileStructure, options?: TransportRequestOptions): TransportRequestPromise> + find_file_structure, TRequestBody extends RequestNDBody = Record[], TContext = Context>(callback: callbackFn): TransportRequestCallback + find_file_structure, TRequestBody extends RequestNDBody = Record[], TContext = Context>(params: RequestParams.MlFindFileStructure, callback: callbackFn): TransportRequestCallback + find_file_structure, TRequestBody extends RequestNDBody = Record[], TContext = Context>(params: RequestParams.MlFindFileStructure, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + findFileStructure, TRequestBody extends RequestNDBody = Record[], TContext = Context>(params?: RequestParams.MlFindFileStructure, options?: TransportRequestOptions): TransportRequestPromise> + findFileStructure, TRequestBody extends RequestNDBody = Record[], TContext = Context>(callback: callbackFn): TransportRequestCallback + findFileStructure, TRequestBody extends RequestNDBody = Record[], TContext = Context>(params: RequestParams.MlFindFileStructure, callback: callbackFn): TransportRequestCallback + findFileStructure, TRequestBody extends RequestNDBody = Record[], TContext = Context>(params: RequestParams.MlFindFileStructure, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback flush_job, TRequestBody extends RequestBody = Record, TContext = Context>(params?: RequestParams.MlFlushJob, options?: TransportRequestOptions): TransportRequestPromise> flush_job, TRequestBody extends RequestBody = Record, TContext = Context>(callback: callbackFn): TransportRequestCallback flush_job, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.MlFlushJob, callback: callbackFn): TransportRequestCallback @@ -2046,6 +2074,14 @@ declare class Client { mount, TRequestBody extends RequestBody = Record, TContext = Context>(callback: callbackFn): TransportRequestCallback mount, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.SearchableSnapshotsMount, callback: callbackFn): TransportRequestCallback mount, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.SearchableSnapshotsMount, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + repository_stats, TContext = Context>(params?: RequestParams.SearchableSnapshotsRepositoryStats, options?: TransportRequestOptions): TransportRequestPromise> + repository_stats, TContext = Context>(callback: callbackFn): TransportRequestCallback + repository_stats, TContext = Context>(params: RequestParams.SearchableSnapshotsRepositoryStats, callback: callbackFn): TransportRequestCallback + repository_stats, TContext = Context>(params: RequestParams.SearchableSnapshotsRepositoryStats, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + repositoryStats, TContext = Context>(params?: RequestParams.SearchableSnapshotsRepositoryStats, options?: TransportRequestOptions): TransportRequestPromise> + repositoryStats, TContext = Context>(callback: callbackFn): TransportRequestCallback + repositoryStats, TContext = Context>(params: RequestParams.SearchableSnapshotsRepositoryStats, callback: callbackFn): TransportRequestCallback + repositoryStats, TContext = Context>(params: RequestParams.SearchableSnapshotsRepositoryStats, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback stats, TContext = Context>(params?: RequestParams.SearchableSnapshotsStats, options?: TransportRequestOptions): TransportRequestPromise> stats, TContext = Context>(callback: callbackFn): TransportRequestCallback stats, TContext = Context>(params: RequestParams.SearchableSnapshotsStats, callback: callbackFn): TransportRequestCallback @@ -2064,6 +2100,14 @@ declare class Client { mount, TRequestBody extends RequestBody = Record, TContext = Context>(callback: callbackFn): TransportRequestCallback mount, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.SearchableSnapshotsMount, callback: callbackFn): TransportRequestCallback mount, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.SearchableSnapshotsMount, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + repository_stats, TContext = Context>(params?: RequestParams.SearchableSnapshotsRepositoryStats, options?: TransportRequestOptions): TransportRequestPromise> + repository_stats, TContext = Context>(callback: callbackFn): TransportRequestCallback + repository_stats, TContext = Context>(params: RequestParams.SearchableSnapshotsRepositoryStats, callback: callbackFn): TransportRequestCallback + repository_stats, TContext = Context>(params: RequestParams.SearchableSnapshotsRepositoryStats, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + repositoryStats, TContext = Context>(params?: RequestParams.SearchableSnapshotsRepositoryStats, options?: TransportRequestOptions): TransportRequestPromise> + repositoryStats, TContext = Context>(callback: callbackFn): TransportRequestCallback + repositoryStats, TContext = Context>(params: RequestParams.SearchableSnapshotsRepositoryStats, callback: callbackFn): TransportRequestCallback + repositoryStats, TContext = Context>(params: RequestParams.SearchableSnapshotsRepositoryStats, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback stats, TContext = Context>(params?: RequestParams.SearchableSnapshotsStats, options?: TransportRequestOptions): TransportRequestPromise> stats, TContext = Context>(callback: callbackFn): TransportRequestCallback stats, TContext = Context>(params: RequestParams.SearchableSnapshotsStats, callback: callbackFn): TransportRequestCallback