API generation

This commit is contained in:
delvedor
2020-02-06 09:16:30 +01:00
parent d701516dda
commit 41927914bb
55 changed files with 370 additions and 68 deletions

View File

@ -0,0 +1,83 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCatMlDatafeeds (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'allow_no_datafeeds',
'format',
'h',
'help',
's',
'time',
'v'
]
const snakeCase = {
allowNoDatafeeds: 'allow_no_datafeeds'
}
/**
* Perform a cat.ml.datafeeds request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed-stats.html
*/
return function catMlDatafeeds (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, datafeedId, datafeed_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if ((datafeed_id || datafeedId) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'ml' + '/' + 'datafeeds'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildCatMlDatafeeds

View File

@ -0,0 +1,86 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCatMlTrainedModels (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'allow_no_match',
'from',
'size',
'bytes',
'format',
'h',
'help',
's',
'time',
'v'
]
const snakeCase = {
allowNoMatch: 'allow_no_match'
}
/**
* Perform a cat.ml.trained_models request
* https://www.elastic.co/guide/en/elasticsearch/reference/current/get-inference-stats.html
*/
return function catMlTrainedModels (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, modelId, model_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if ((model_id || modelId) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'ml' + '/' + 'trained_models' + '/' + encodeURIComponent(model_id || modelId)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'ml' + '/' + 'trained_models'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildCatMlTrainedModels

View File

@ -21,7 +21,7 @@ function buildCcrForgetFollower (opts) {
/**
* Perform a ccr.forget_follower request
* http://www.elastic.co/guide/en/elasticsearch/reference/current
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-forget-follower.html
*/
return function ccrForgetFollower (params, options, callback) {
options = options || {}

View File

@ -21,7 +21,7 @@ function buildCcrUnfollow (opts) {
/**
* Perform a ccr.unfollow request
* http://www.elastic.co/guide/en/elasticsearch/reference/current
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-unfollow.html
*/
return function ccrUnfollow (params, options, callback) {
options = options || {}

View File

@ -21,7 +21,7 @@ function buildMigrationDeprecations (opts) {
/**
* Perform a migration.deprecations request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-deprecation.html
* https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-deprecation.html
*/
return function migrationDeprecations (params, options, callback) {
options = options || {}

View File

@ -24,7 +24,7 @@ function buildMlCloseJob (opts) {
/**
* Perform a ml.close_job request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-close-job.html
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-close-job.html
*/
return function mlCloseJob (params, options, callback) {
options = options || {}

View File

@ -21,7 +21,7 @@ function buildMlDeleteDataFrameAnalytics (opts) {
/**
* Perform a ml.delete_data_frame_analytics request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/delete-dfanalytics.html
* https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-dfanalytics.html
*/
return function mlDeleteDataFrameAnalytics (params, options, callback) {
options = options || {}

View File

@ -21,7 +21,7 @@ function buildMlDeleteDatafeed (opts) {
/**
* Perform a ml.delete_datafeed request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-datafeed.html
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-datafeed.html
*/
return function mlDeleteDatafeed (params, options, callback) {
options = options || {}

View File

@ -23,7 +23,7 @@ function buildMlDeleteForecast (opts) {
/**
* Perform a ml.delete_forecast request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-forecast.html
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-forecast.html
*/
return function mlDeleteForecast (params, options, callback) {
options = options || {}

View File

@ -22,7 +22,7 @@ function buildMlDeleteJob (opts) {
/**
* Perform a ml.delete_job request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-job.html
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-job.html
*/
return function mlDeleteJob (params, options, callback) {
options = options || {}

View File

@ -21,7 +21,7 @@ function buildMlDeleteModelSnapshot (opts) {
/**
* Perform a ml.delete_model_snapshot request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-snapshot.html
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-snapshot.html
*/
return function mlDeleteModelSnapshot (params, options, callback) {
options = options || {}

View File

@ -21,7 +21,7 @@ function buildMlEvaluateDataFrame (opts) {
/**
* Perform a ml.evaluate_data_frame request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/evaluate-dfanalytics.html
* https://www.elastic.co/guide/en/elasticsearch/reference/current/evaluate-dfanalytics.html
*/
return function mlEvaluateDataFrame (params, options, callback) {
options = options || {}

View File

@ -42,7 +42,7 @@ function buildMlFindFileStructure (opts) {
/**
* Perform a ml.find_file_structure request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-find-file-structure.html
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-find-file-structure.html
*/
return function mlFindFileStructure (params, options, callback) {
options = options || {}

View File

@ -27,7 +27,7 @@ function buildMlFlushJob (opts) {
/**
* Perform a ml.flush_job request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-flush-job.html
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-flush-job.html
*/
return function mlFlushJob (params, options, callback) {
options = options || {}

View File

@ -31,7 +31,7 @@ function buildMlGetBuckets (opts) {
/**
* Perform a ml.get_buckets request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-bucket.html
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-bucket.html
*/
return function mlGetBuckets (params, options, callback) {
options = options || {}

View File

@ -22,7 +22,7 @@ function buildMlGetCategories (opts) {
/**
* Perform a ml.get_categories request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-category.html
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-category.html
*/
return function mlGetCategories (params, options, callback) {
options = options || {}

View File

@ -24,7 +24,7 @@ function buildMlGetDataFrameAnalytics (opts) {
/**
* Perform a ml.get_data_frame_analytics request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/get-dfanalytics.html
* https://www.elastic.co/guide/en/elasticsearch/reference/current/get-dfanalytics.html
*/
return function mlGetDataFrameAnalytics (params, options, callback) {
options = options || {}

View File

@ -24,7 +24,7 @@ function buildMlGetDataFrameAnalyticsStats (opts) {
/**
* Perform a ml.get_data_frame_analytics_stats request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/get-dfanalytics-stats.html
* https://www.elastic.co/guide/en/elasticsearch/reference/current/get-dfanalytics-stats.html
*/
return function mlGetDataFrameAnalyticsStats (params, options, callback) {
options = options || {}

View File

@ -21,7 +21,7 @@ function buildMlGetDatafeedStats (opts) {
/**
* Perform a ml.get_datafeed_stats request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed-stats.html
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed-stats.html
*/
return function mlGetDatafeedStats (params, options, callback) {
options = options || {}

View File

@ -21,7 +21,7 @@ function buildMlGetDatafeeds (opts) {
/**
* Perform a ml.get_datafeeds request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed.html
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed.html
*/
return function mlGetDatafeeds (params, options, callback) {
options = options || {}

View File

@ -30,7 +30,7 @@ function buildMlGetInfluencers (opts) {
/**
* Perform a ml.get_influencers request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-influencer.html
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-influencer.html
*/
return function mlGetInfluencers (params, options, callback) {
options = options || {}

View File

@ -21,7 +21,7 @@ function buildMlGetJobStats (opts) {
/**
* Perform a ml.get_job_stats request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-stats.html
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-stats.html
*/
return function mlGetJobStats (params, options, callback) {
options = options || {}

View File

@ -21,7 +21,7 @@ function buildMlGetJobs (opts) {
/**
* Perform a ml.get_jobs request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job.html
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job.html
*/
return function mlGetJobs (params, options, callback) {
options = options || {}

View File

@ -26,7 +26,7 @@ function buildMlGetModelSnapshots (opts) {
/**
* Perform a ml.get_model_snapshots request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-snapshot.html
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-snapshot.html
*/
return function mlGetModelSnapshots (params, options, callback) {
options = options || {}

View File

@ -31,7 +31,7 @@ function buildMlGetOverallBuckets (opts) {
/**
* Perform a ml.get_overall_buckets request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-overall-buckets.html
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-overall-buckets.html
*/
return function mlGetOverallBuckets (params, options, callback) {
options = options || {}

View File

@ -30,7 +30,7 @@ function buildMlGetRecords (opts) {
/**
* Perform a ml.get_records request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-record.html
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-record.html
*/
return function mlGetRecords (params, options, callback) {
options = options || {}

View File

@ -21,7 +21,7 @@ function buildMlOpenJob (opts) {
/**
* Perform a ml.open_job request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-open-job.html
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-open-job.html
*/
return function mlOpenJob (params, options, callback) {
options = options || {}

View File

@ -23,7 +23,7 @@ function buildMlPostData (opts) {
/**
* Perform a ml.post_data request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-data.html
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-data.html
*/
return function mlPostData (params, options, callback) {
options = options || {}

View File

@ -21,7 +21,7 @@ function buildMlPreviewDatafeed (opts) {
/**
* Perform a ml.preview_datafeed request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-preview-datafeed.html
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-preview-datafeed.html
*/
return function mlPreviewDatafeed (params, options, callback) {
options = options || {}

View File

@ -21,7 +21,7 @@ function buildMlPutDataFrameAnalytics (opts) {
/**
* Perform a ml.put_data_frame_analytics request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/put-dfanalytics.html
* https://www.elastic.co/guide/en/elasticsearch/reference/current/put-dfanalytics.html
*/
return function mlPutDataFrameAnalytics (params, options, callback) {
options = options || {}

View File

@ -21,7 +21,7 @@ function buildMlPutDatafeed (opts) {
/**
* Perform a ml.put_datafeed request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-datafeed.html
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-datafeed.html
*/
return function mlPutDatafeed (params, options, callback) {
options = options || {}

View File

@ -21,7 +21,7 @@ function buildMlPutJob (opts) {
/**
* Perform a ml.put_job request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-job.html
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-job.html
*/
return function mlPutJob (params, options, callback) {
options = options || {}

View File

@ -21,7 +21,7 @@ function buildMlRevertModelSnapshot (opts) {
/**
* Perform a ml.revert_model_snapshot request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-revert-snapshot.html
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-revert-snapshot.html
*/
return function mlRevertModelSnapshot (params, options, callback) {
options = options || {}

View File

@ -22,7 +22,7 @@ function buildMlSetUpgradeMode (opts) {
/**
* Perform a ml.set_upgrade_mode request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-set-upgrade-mode.html
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-set-upgrade-mode.html
*/
return function mlSetUpgradeMode (params, options, callback) {
options = options || {}

View File

@ -21,7 +21,7 @@ function buildMlStartDataFrameAnalytics (opts) {
/**
* Perform a ml.start_data_frame_analytics request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/start-dfanalytics.html
* https://www.elastic.co/guide/en/elasticsearch/reference/current/start-dfanalytics.html
*/
return function mlStartDataFrameAnalytics (params, options, callback) {
options = options || {}

View File

@ -23,7 +23,7 @@ function buildMlStartDatafeed (opts) {
/**
* Perform a ml.start_datafeed request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-start-datafeed.html
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-start-datafeed.html
*/
return function mlStartDatafeed (params, options, callback) {
options = options || {}

View File

@ -24,7 +24,7 @@ function buildMlStopDataFrameAnalytics (opts) {
/**
* Perform a ml.stop_data_frame_analytics request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/stop-dfanalytics.html
* https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-dfanalytics.html
*/
return function mlStopDataFrameAnalytics (params, options, callback) {
options = options || {}

View File

@ -24,7 +24,7 @@ function buildMlStopDatafeed (opts) {
/**
* Perform a ml.stop_datafeed request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-stop-datafeed.html
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-stop-datafeed.html
*/
return function mlStopDatafeed (params, options, callback) {
options = options || {}

View File

@ -21,7 +21,7 @@ function buildMlUpdateDatafeed (opts) {
/**
* Perform a ml.update_datafeed request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-datafeed.html
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-datafeed.html
*/
return function mlUpdateDatafeed (params, options, callback) {
options = options || {}

View File

@ -21,7 +21,7 @@ function buildMlUpdateJob (opts) {
/**
* Perform a ml.update_job request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-job.html
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-job.html
*/
return function mlUpdateJob (params, options, callback) {
options = options || {}

View File

@ -21,7 +21,7 @@ function buildMlUpdateModelSnapshot (opts) {
/**
* Perform a ml.update_model_snapshot request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-snapshot.html
* https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-snapshot.html
*/
return function mlUpdateModelSnapshot (params, options, callback) {
options = options || {}

View File

@ -21,7 +21,7 @@ function buildSecurityDeletePrivileges (opts) {
/**
* Perform a security.delete_privileges request
* TODO
* https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-privilege.html
*/
return function securityDeletePrivileges (params, options, callback) {
options = options || {}

View File

@ -21,7 +21,7 @@ function buildSecurityPutPrivileges (opts) {
/**
* Perform a security.put_privileges request
* TODO
* https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-privileges.html
*/
return function securityPutPrivileges (params, options, callback) {
options = options || {}

View File

@ -21,7 +21,7 @@ function buildWatcherAckWatch (opts) {
/**
* Perform a watcher.ack_watch request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-ack-watch.html
* https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-ack-watch.html
*/
return function watcherAckWatch (params, options, callback) {
options = options || {}

View File

@ -21,7 +21,7 @@ function buildWatcherDeleteWatch (opts) {
/**
* Perform a watcher.delete_watch request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-delete-watch.html
* https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-delete-watch.html
*/
return function watcherDeleteWatch (params, options, callback) {
options = options || {}

View File

@ -21,7 +21,7 @@ function buildWatcherExecuteWatch (opts) {
/**
* Perform a watcher.execute_watch request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-execute-watch.html
* https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-execute-watch.html
*/
return function watcherExecuteWatch (params, options, callback) {
options = options || {}

View File

@ -21,7 +21,7 @@ function buildWatcherGetWatch (opts) {
/**
* Perform a watcher.get_watch request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-get-watch.html
* https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-get-watch.html
*/
return function watcherGetWatch (params, options, callback) {
options = options || {}

View File

@ -25,7 +25,7 @@ function buildWatcherPutWatch (opts) {
/**
* Perform a watcher.put_watch request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-put-watch.html
* https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-put-watch.html
*/
return function watcherPutWatch (params, options, callback) {
options = options || {}

View File

@ -21,7 +21,7 @@ function buildWatcherStart (opts) {
/**
* Perform a watcher.start request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-start.html
* https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-start.html
*/
return function watcherStart (params, options, callback) {
options = options || {}

View File

@ -22,7 +22,7 @@ function buildWatcherStats (opts) {
/**
* Perform a watcher.stats request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stats.html
* https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stats.html
*/
return function watcherStats (params, options, callback) {
options = options || {}

View File

@ -21,7 +21,7 @@ function buildWatcherStop (opts) {
/**
* Perform a watcher.stop request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stop.html
* https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stop.html
*/
return function watcherStop (params, options, callback) {
options = options || {}

View File

@ -27,7 +27,10 @@ function ESAPI (opts) {
indices: lazyLoad('cat.indices', opts),
master: lazyLoad('cat.master', opts),
ml: {
jobs: lazyLoad('cat.ml.jobs', opts)
datafeeds: lazyLoad('cat.ml.datafeeds', opts),
jobs: lazyLoad('cat.ml.jobs', opts),
trained_models: lazyLoad('cat.ml.trained_models', opts),
trainedModels: lazyLoad('cat.ml.trained_models', opts)
},
nodeattrs: lazyLoad('cat.nodeattrs', opts),
nodes: lazyLoad('cat.nodes', opts),

View File

@ -1036,7 +1036,7 @@ export interface Reindex<T = any> extends Generic {
wait_for_completion?: boolean;
requests_per_second?: number;
scroll?: string;
slices?: number;
slices?: number|string;
max_docs?: number;
body: T;
}
@ -1306,7 +1306,7 @@ export interface UpdateByQuery<T = any> extends Generic {
scroll_size?: number;
wait_for_completion?: boolean;
requests_per_second?: number;
slices?: number;
slices?: number|string;
body?: T;
}
@ -1315,6 +1315,17 @@ export interface UpdateByQueryRethrottle extends Generic {
requests_per_second: number;
}
export interface CatMlDatafeeds extends Generic {
datafeed_id?: string;
allow_no_datafeeds?: boolean;
format?: string;
h?: string | string[];
help?: boolean;
s?: string | string[];
time?: 'd (Days)' | 'h (Hours)' | 'm (Minutes)' | 's (Seconds)' | 'ms (Milliseconds)' | 'micros (Microseconds)' | 'nanos (Nanoseconds)';
v?: boolean;
}
export interface CatMlJobs extends Generic {
job_id?: string;
allow_no_jobs?: boolean;
@ -1327,6 +1338,20 @@ export interface CatMlJobs extends Generic {
v?: boolean;
}
export interface CatMlTrainedModels extends Generic {
model_id?: string;
allow_no_match?: boolean;
from?: number;
size?: number;
bytes?: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb';
format?: string;
h?: string | string[];
help?: boolean;
s?: string | string[];
time?: 'd (Days)' | 'h (Hours)' | 'm (Minutes)' | 's (Seconds)' | 'ms (Milliseconds)' | 'micros (Microseconds)' | 'nanos (Nanoseconds)';
v?: boolean;
}
export interface CcrDeleteAutoFollowPattern extends Generic {
name: string;
}

View File

@ -4154,7 +4154,7 @@ client.reindex({
wait_for_completion: boolean,
requests_per_second: number,
scroll: string,
slices: number,
slices: number|string,
max_docs: number,
body: object
})
@ -4185,7 +4185,7 @@ _Default:_ `true`
_Default:_ `5m`
|`slices`
|`number` - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. +
|`number\|string` - The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be set to `auto`. +
_Default:_ `1`
|`max_docs` or `maxDocs`
@ -5154,7 +5154,7 @@ client.updateByQuery({
scroll_size: number,
wait_for_completion: boolean,
requests_per_second: number,
slices: number,
slices: number|string,
body: object
})
----
@ -5270,7 +5270,7 @@ _Default:_ `true`
|`number` - The throttle to set on this request in sub-requests per second. -1 means no throttle.
|`slices`
|`number` - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. +
|`number\|string` - The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be set to `auto`. +
_Default:_ `1`
|`body`
@ -5298,6 +5298,50 @@ link:{ref}/docs-update-by-query.html[Documentation] +
|===
=== cat.ml.datafeeds
[source,ts]
----
client.cat.ml.datafeeds({
datafeed_id: string,
allow_no_datafeeds: boolean,
format: string,
h: string | string[],
help: boolean,
s: string | string[],
time: 'd (Days)' | 'h (Hours)' | 'm (Minutes)' | 's (Seconds)' | 'ms (Milliseconds)' | 'micros (Microseconds)' | 'nanos (Nanoseconds)',
v: boolean
})
----
link:{ref}/ml-get-datafeed-stats.html[Documentation] +
[cols=2*]
|===
|`datafeed_id` or `datafeedId`
|`string` - The ID of the datafeeds stats to fetch
|`allow_no_datafeeds` or `allowNoDatafeeds`
|`boolean` - Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified)
|`format`
|`string` - a short version of the Accept header, e.g. json, yaml
|`h`
|`string \| string[]` - Comma-separated list of column names to display
|`help`
|`boolean` - Return help information
|`s`
|`string \| string[]` - Comma-separated list of column names or column aliases to sort by
|`time`
|`'d (Days)' \| 'h (Hours)' \| 'm (Minutes)' \| 's (Seconds)' \| 'ms (Milliseconds)' \| 'micros (Microseconds)' \| 'nanos (Nanoseconds)'` - The unit in which to display time values
|`v`
|`boolean` - Verbose mode. Display column headers
|===
=== cat.ml.jobs
[source,ts]
@ -5346,6 +5390,64 @@ link:{ref}/ml-get-job-stats.html[Documentation] +
|===
=== cat.ml.trainedModels
[source,ts]
----
client.cat.ml.trainedModels({
model_id: string,
allow_no_match: boolean,
from: number,
size: number,
bytes: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb',
format: string,
h: string | string[],
help: boolean,
s: string | string[],
time: 'd (Days)' | 'h (Hours)' | 'm (Minutes)' | 's (Seconds)' | 'ms (Milliseconds)' | 'micros (Microseconds)' | 'nanos (Nanoseconds)',
v: boolean
})
----
link:{ref}/get-inference-stats.html[Documentation] +
[cols=2*]
|===
|`model_id` or `modelId`
|`string` - The ID of the trained models stats to fetch
|`allow_no_match` or `allowNoMatch`
|`boolean` - Whether to ignore if a wildcard expression matches no trained models. (This includes `_all` string or when no trained models have been specified) +
_Default:_ `true`
|`from`
|`number` - skips a number of trained models
|`size`
|`number` - specifies a max number of trained models to get +
_Default:_ `100`
|`bytes`
|`'b' \| 'k' \| 'kb' \| 'm' \| 'mb' \| 'g' \| 'gb' \| 't' \| 'tb' \| 'p' \| 'pb'` - The unit in which to display byte values
|`format`
|`string` - a short version of the Accept header, e.g. json, yaml
|`h`
|`string \| string[]` - Comma-separated list of column names to display
|`help`
|`boolean` - Return help information
|`s`
|`string \| string[]` - Comma-separated list of column names or column aliases to sort by
|`time`
|`'d (Days)' \| 'h (Hours)' \| 'm (Minutes)' \| 's (Seconds)' \| 'ms (Milliseconds)' \| 'micros (Microseconds)' \| 'nanos (Nanoseconds)'` - The unit in which to display time values
|`v`
|`boolean` - Verbose mode. Display column headers
|===
=== ccr.deleteAutoFollowPattern
[source,ts]
@ -5428,7 +5530,7 @@ client.ccr.forgetFollower({
body: object
})
----
link:http://www.elastic.co/guide/en/elasticsearch/reference/current[Documentation] +
link:{ref}/ccr-post-forget-follower.html[Documentation] +
[cols=2*]
|===
|`index`
@ -5560,7 +5662,7 @@ client.ccr.unfollow({
index: string
})
----
link:http://www.elastic.co/guide/en/elasticsearch/reference/current[Documentation] +
link:{ref}/ccr-post-unfollow.html[Documentation] +
[cols=2*]
|===
|`index`
@ -8058,7 +8160,7 @@ client.security.deletePrivileges({
refresh: 'true' | 'false' | 'wait_for'
})
----
link:TODO[Documentation] +
link:{ref}/security-api-delete-privilege.html[Documentation] +
[cols=2*]
|===
|`application`
@ -8367,7 +8469,7 @@ client.security.putPrivileges({
body: object
})
----
link:TODO[Documentation] +
link:{ref}/security-api-put-privileges.html[Documentation] +
[cols=2*]
|===
|`refresh`
@ -8626,7 +8728,7 @@ link:{ref}/security-api-ssl.html[Documentation] +
=== transform.deleteTransform
*Stability:* beta
[source,ts]
----
client.transform.deleteTransform({
@ -8646,7 +8748,7 @@ link:{ref}/delete-transform.html[Documentation] +
|===
=== transform.getTransform
*Stability:* beta
[source,ts]
----
client.transform.getTransform({
@ -8674,7 +8776,7 @@ link:{ref}/get-transform.html[Documentation] +
|===
=== transform.getTransformStats
*Stability:* beta
[source,ts]
----
client.transform.getTransformStats({
@ -8702,7 +8804,7 @@ link:{ref}/get-transform-stats.html[Documentation] +
|===
=== transform.previewTransform
*Stability:* beta
[source,ts]
----
client.transform.previewTransform({
@ -8718,7 +8820,7 @@ link:{ref}/preview-transform.html[Documentation] +
|===
=== transform.putTransform
*Stability:* beta
[source,ts]
----
client.transform.putTransform({
@ -8742,7 +8844,7 @@ link:{ref}/put-transform.html[Documentation] +
|===
=== transform.startTransform
*Stability:* beta
[source,ts]
----
client.transform.startTransform({
@ -8762,7 +8864,7 @@ link:{ref}/start-transform.html[Documentation] +
|===
=== transform.stopTransform
*Stability:* beta
[source,ts]
----
client.transform.stopTransform({
@ -8798,7 +8900,7 @@ link:{ref}/stop-transform.html[Documentation] +
|===
=== transform.updateTransform
*Stability:* beta
[source,ts]
----
client.transform.updateTransform({

3
index.d.ts vendored
View File

@ -126,7 +126,10 @@ declare class Client extends EventEmitter {
indices: ApiMethod<RequestParams.CatIndices>
master: ApiMethod<RequestParams.CatMaster>
ml: {
datafeeds: ApiMethod<RequestParams.CatMlDatafeeds>
jobs: ApiMethod<RequestParams.CatMlJobs>
trained_models: ApiMethod<RequestParams.CatMlTrainedModels>
trainedModels: ApiMethod<RequestParams.CatMlTrainedModels>
}
nodeattrs: ApiMethod<RequestParams.CatNodeattrs>
nodes: ApiMethod<RequestParams.CatNodes>