From 92e786e9c6ed3c36b303dd1af71d761f1928a348 Mon Sep 17 00:00:00 2001 From: delvedor Date: Wed, 10 Apr 2019 11:47:21 +0200 Subject: [PATCH] API generation --- ...ta_frame.get_data_frame_transform_stats.js | 125 - api/requestParams.d.ts | 870 +------ docs/reference.asciidoc | 2291 ----------------- 3 files changed, 16 insertions(+), 3270 deletions(-) delete mode 100644 api/api/data_frame.get_data_frame_transform_stats.js diff --git a/api/api/data_frame.get_data_frame_transform_stats.js b/api/api/data_frame.get_data_frame_transform_stats.js deleted file mode 100644 index 730085eeb..000000000 --- a/api/api/data_frame.get_data_frame_transform_stats.js +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -'use strict' - -/* eslint camelcase: 0 */ -/* eslint no-unused-vars: 0 */ - -function buildDataFrameGetDataFrameTransformStats (opts) { - // eslint-disable-next-line no-unused-vars - const { makeRequest, ConfigurationError, handleError } = opts - /** - * Perform a [data_frame.get_data_frame_transform_stats](https://www.elastic.co/guide/en/elasticsearch/reference/current/get-data-frame-transform-stats.html) request - * - * @param {string} transform_id - The id of the transform for which to get stats. '_all' or '*' implies all transforms - * @param {number} from - skips a number of transform stats, defaults to 0 - * @param {number} size - specifies a max number of transform stats to get, defaults to 100 - */ - - const acceptedQuerystring = [ - 'from', - 'size' - ] - - const snakeCase = { - - } - - return function dataFrameGetDataFrameTransformStats (params, options, callback) { - options = options || {} - if (typeof options === 'function') { - callback = options - options = {} - } - if (typeof params === 'function' || params == null) { - callback = params - params = {} - options = {} - } - - // check required parameters - if (params.body != null) { - const err = new ConfigurationError('This API does not require a body') - return handleError(err, callback) - } - - // validate headers object - if (options.headers != null && typeof options.headers !== 'object') { - const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`) - return handleError(err, callback) - } - - var warnings = null - var { method, body, transformId, transform_id } = params - var querystring = semicopy(params, ['method', 'body', 'transformId', 'transform_id']) - - if (method == null) { - method = 'GET' - } - - var ignore = options.ignore || null - if (typeof ignore === 'number') { - ignore = [ignore] - } - - var path = '' - - path = '/' + '_data_frame' + '/' + 'transforms' + '/' + encodeURIComponent(transform_id || transformId) + '/' + '_stats' - - // build request object - const request = { - method, - path, - body: null, - querystring - } - - const requestOptions = { - ignore, - requestTimeout: options.requestTimeout || null, - maxRetries: options.maxRetries || null, - asStream: options.asStream || false, - headers: options.headers || null, - querystring: options.querystring || null, - compression: options.compression || false, - warnings - } - - return makeRequest(request, requestOptions, callback) - - function semicopy (obj, exclude) { - var target = {} - var keys = Object.keys(obj) - for (var i = 0, len = keys.length; i < len; i++) { - var key = keys[i] - if (exclude.indexOf(key) === -1) { - target[snakeCase[key] || key] = obj[key] - if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) { - warnings = warnings || [] - warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter') - } - } - } - return target - } - } -} - -module.exports = buildDataFrameGetDataFrameTransformStats diff --git a/api/requestParams.d.ts b/api/requestParams.d.ts index 7251061ae..47a1d4bff 100644 --- a/api/requestParams.d.ts +++ b/api/requestParams.d.ts @@ -299,11 +299,7 @@ export interface ClusterPutSettings extends Generic { flat_settings?: boolean; master_timeout?: string; timeout?: string; -<<<<<<< HEAD - body?: any; -======= - body: T; ->>>>>>> a21281f... Improve typings (#813) + body?: T; } export interface ClusterRemoteInfo extends Generic { @@ -355,8 +351,7 @@ export interface Count extends Generic { body?: T; } -<<<<<<< HEAD -export interface CountPercolate extends Generic { +export interface CountPercolate extends Generic { index: string; type: string; id?: string; @@ -369,13 +364,10 @@ export interface CountPercolate extends Generic { percolate_type?: string; version?: number; version_type?: 'internal' | 'external' | 'external_gte' | 'force'; - body?: any; + body?: T; } -export interface Create extends Generic { -======= export interface Create extends Generic { ->>>>>>> a21281f... Improve typings (#813) id: string; index: string; type: string; @@ -502,34 +494,28 @@ export interface Explain extends Generic { q?: string; routing?: string; _source?: string | string[]; -<<<<<<< HEAD _source_exclude?: string | string[]; _source_include?: string | string[]; - body?: any; -======= - _source_excludes?: string | string[]; - _source_includes?: string | string[]; body?: T; ->>>>>>> a21281f... Improve typings (#813) } -export interface FieldCaps extends Generic { +export interface FieldCaps extends Generic { index?: string | string[]; fields?: string | string[]; ignore_unavailable?: boolean; allow_no_indices?: boolean; expand_wildcards?: 'open' | 'closed' | 'none' | 'all'; - body?: any; + body?: T; } -export interface FieldStats extends Generic { +export interface FieldStats extends Generic { index?: string | string[]; fields?: string | string[]; level?: 'indices' | 'cluster'; ignore_unavailable?: boolean; allow_no_indices?: boolean; expand_wildcards?: 'open' | 'closed' | 'none' | 'all'; - body?: any; + body?: T; } export interface Get extends Generic { @@ -570,15 +556,11 @@ export interface GetSource extends Generic { version_type?: 'internal' | 'external' | 'external_gte' | 'force'; } -<<<<<<< HEAD export interface GetTemplate extends Generic { id: string; } -export interface Index extends Generic { -======= export interface Index extends Generic { ->>>>>>> a21281f... Improve typings (#813) id?: string; index: string; type: string; @@ -598,7 +580,6 @@ export interface Index extends Generic { export interface IndicesAnalyze extends Generic { index?: string; -<<<<<<< HEAD analyzer?: string; char_filter?: string | string[]; field?: string; @@ -609,10 +590,7 @@ export interface IndicesAnalyze extends Generic { explain?: boolean; attributes?: string | string[]; format?: 'detailed' | 'text'; - body?: any; -======= body?: T; ->>>>>>> a21281f... Improve typings (#813) } export interface IndicesClearCache extends Generic { @@ -643,12 +621,8 @@ export interface IndicesCreate extends Generic { wait_for_active_shards?: string; timeout?: string; master_timeout?: string; -<<<<<<< HEAD update_all_types?: boolean; - body?: any; -======= body?: T; ->>>>>>> a21281f... Improve typings (#813) } export interface IndicesDelete extends Generic { @@ -823,12 +797,8 @@ export interface IndicesPutMapping extends Generic { ignore_unavailable?: boolean; allow_no_indices?: boolean; expand_wildcards?: 'open' | 'closed' | 'none' | 'all'; -<<<<<<< HEAD update_all_types?: boolean; - body: any; -======= body: T; ->>>>>>> a21281f... Improve typings (#813) } export interface IndicesPutSettings extends Generic { @@ -902,18 +872,6 @@ export interface IndicesShrink extends Generic { body?: T; } -<<<<<<< HEAD -======= -export interface IndicesSplit extends Generic { - index: string; - target: string; - timeout?: string; - master_timeout?: string; - wait_for_active_shards?: string; - body?: T; -} - ->>>>>>> a21281f... Improve typings (#813) export interface IndicesStats extends Generic { index?: string | string[]; metric?: string | string[]; @@ -999,24 +957,18 @@ export interface Mget extends Generic { refresh?: boolean; routing?: string; _source?: string | string[]; -<<<<<<< HEAD _source_exclude?: string | string[]; _source_include?: string | string[]; - body: any; + body: T; } -export interface Mpercolate extends Generic { +export interface Mpercolate extends Generic { index?: string; type?: string; ignore_unavailable?: boolean; allow_no_indices?: boolean; expand_wildcards?: 'open' | 'closed' | 'none' | 'all'; - body: any; -======= - _source_excludes?: string | string[]; - _source_includes?: string | string[]; body: T; ->>>>>>> a21281f... Improve typings (#813) } export interface Msearch extends Generic { @@ -1026,14 +978,7 @@ export interface Msearch extends Generic { max_concurrent_searches?: number; typed_keys?: boolean; pre_filter_shard_size?: number; -<<<<<<< HEAD - body: any; -======= - max_concurrent_shard_requests?: number; - rest_total_hits_as_int?: boolean; - ccs_minimize_roundtrips?: boolean; body: T; ->>>>>>> a21281f... Improve typings (#813) } export interface MsearchTemplate extends Generic { @@ -1042,13 +987,7 @@ export interface MsearchTemplate extends Generic { search_type?: 'query_then_fetch' | 'query_and_fetch' | 'dfs_query_then_fetch' | 'dfs_query_and_fetch'; typed_keys?: boolean; max_concurrent_searches?: number; -<<<<<<< HEAD - body: any; -======= - rest_total_hits_as_int?: boolean; - ccs_minimize_roundtrips?: boolean; body: T; ->>>>>>> a21281f... Improve typings (#813) } export interface Mtermvectors extends Generic { @@ -1101,7 +1040,7 @@ export interface NodesStats extends Generic { include_segment_file_sizes?: boolean; } -export interface Percolate extends Generic { +export interface Percolate extends Generic { index: string; type: string; id?: string; @@ -1117,7 +1056,7 @@ export interface Percolate extends Generic { percolate_format?: 'ids'; version?: number; version_type?: 'internal' | 'external' | 'external_gte' | 'force'; - body?: any; + body?: T; } export interface Ping extends Generic { @@ -1131,18 +1070,9 @@ export interface PutScript extends Generic { body: T; } -<<<<<<< HEAD -export interface PutTemplate extends Generic { +export interface PutTemplate extends Generic { id: string; - body: any; -======= -export interface RankEval extends Generic { - index?: string | string[]; - ignore_unavailable?: boolean; - allow_no_indices?: boolean; - expand_wildcards?: 'open' | 'closed' | 'none' | 'all'; body: T; ->>>>>>> a21281f... Improve typings (#813) } export interface Reindex extends Generic { @@ -1165,26 +1095,10 @@ export interface RenderSearchTemplate extends Generic { body?: T; } -<<<<<<< HEAD -export interface Scroll extends Generic { - scroll_id?: string; - scroll?: string; - body?: any; -======= -export interface ScriptsPainlessContext extends Generic { - context?: string; -} - -export interface ScriptsPainlessExecute extends Generic { - body?: T; -} - export interface Scroll extends Generic { scroll_id?: string; scroll?: string; - rest_total_hits_as_int?: boolean; body?: T; ->>>>>>> a21281f... Improve typings (#813) } export interface Search extends Generic { @@ -1227,12 +1141,7 @@ export interface Search extends Generic { batched_reduce_size?: number; max_concurrent_shard_requests?: number; pre_filter_shard_size?: number; -<<<<<<< HEAD - body?: any; -======= - rest_total_hits_as_int?: boolean; body?: T; ->>>>>>> a21281f... Improve typings (#813) } export interface SearchShards extends Generic { @@ -1259,13 +1168,7 @@ export interface SearchTemplate extends Generic { explain?: boolean; profile?: boolean; typed_keys?: boolean; -<<<<<<< HEAD - body?: any; -======= - rest_total_hits_as_int?: boolean; - ccs_minimize_roundtrips?: boolean; - body: T; ->>>>>>> a21281f... Improve typings (#813) + body?: T; } export interface SnapshotCreate extends Generic { @@ -1331,14 +1234,14 @@ export interface SnapshotVerifyRepository extends Generic { timeout?: string; } -export interface Suggest extends Generic { +export interface Suggest extends Generic { index?: string | string[]; ignore_unavailable?: boolean; allow_no_indices?: boolean; expand_wildcards?: 'open' | 'closed' | 'none' | 'all'; preference?: string; routing?: string; - body: any; + body: T; } export interface TasksCancel extends Generic { @@ -1398,17 +1301,11 @@ export interface Update extends Generic { retry_on_conflict?: number; routing?: string; timeout?: string; -<<<<<<< HEAD timestamp?: string; ttl?: string; version?: number; version_type?: 'internal' | 'force'; - body?: any; -======= - if_seq_no?: number; - if_primary_term?: number; - body: T; ->>>>>>> a21281f... Improve typings (#813) + body?: T; } export interface UpdateByQuery extends Generic { @@ -1450,738 +1347,3 @@ export interface UpdateByQuery extends Generic { slices?: number; body?: T; } -<<<<<<< HEAD -======= - -export interface UpdateByQueryRethrottle extends Generic { - task_id: string; - requests_per_second: number; -} - -export interface CcrDeleteAutoFollowPattern extends Generic { - name: string; -} - -export interface CcrFollow extends Generic { - index: string; - wait_for_active_shards?: string; - body: T; -} - -export interface CcrFollowInfo extends Generic { - index?: string | string[]; -} - -export interface CcrFollowStats extends Generic { - index: string | string[]; -} - -export interface CcrForgetFollower extends Generic { - index: string; - body: T; -} - -export interface CcrGetAutoFollowPattern extends Generic { - name?: string; -} - -export interface CcrPauseFollow extends Generic { - index: string; -} - -export interface CcrPutAutoFollowPattern extends Generic { - name: string; - body: T; -} - -export interface CcrResumeFollow extends Generic { - index: string; - body?: T; -} - -export interface CcrStats extends Generic { -} - -export interface CcrUnfollow extends Generic { - index: string; -} - -export interface DataFrameDeleteDataFrameTransform extends Generic { - transform_id: string; -} - -export interface DataFrameGetDataFrameTransform extends Generic { - transform_id?: string; - from?: number; - size?: number; -} - -export interface DataFrameGetDataFrameTransformStats extends Generic { - transform_id?: string; - from?: number; - size?: number; -} - -export interface DataFramePreviewDataFrameTransform extends Generic { - body: T; -} - -export interface DataFramePutDataFrameTransform extends Generic { - transform_id: string; - body: T; -} - -export interface DataFrameStartDataFrameTransform extends Generic { - transform_id: string; - timeout?: string; -} - -export interface DataFrameStopDataFrameTransform extends Generic { - transform_id: string; - wait_for_completion?: boolean; - timeout?: string; -} - -export interface GraphExplore extends Generic { - index?: string | string[]; - type?: string | string[]; - routing?: string; - timeout?: string; - body?: T; -} - -export interface IlmDeleteLifecycle extends Generic { - policy?: string; -} - -export interface IlmExplainLifecycle extends Generic { - index?: string; -} - -export interface IlmGetLifecycle extends Generic { - policy?: string; -} - -export interface IlmGetStatus extends Generic { -} - -export interface IlmMoveToStep extends Generic { - index?: string; - body?: T; -} - -export interface IlmPutLifecycle extends Generic { - policy?: string; - body?: T; -} - -export interface IlmRemovePolicy extends Generic { - index?: string; -} - -export interface IlmRetry extends Generic { - index?: string; -} - -export interface IlmStart extends Generic { -} - -export interface IlmStop extends Generic { -} - -export interface IndicesFreeze extends Generic { - index: string; - timeout?: string; - master_timeout?: string; - ignore_unavailable?: boolean; - allow_no_indices?: boolean; - expand_wildcards?: 'open' | 'closed' | 'none' | 'all'; - wait_for_active_shards?: string; -} - -export interface IndicesUnfreeze extends Generic { - index: string; - timeout?: string; - master_timeout?: string; - ignore_unavailable?: boolean; - allow_no_indices?: boolean; - expand_wildcards?: 'open' | 'closed' | 'none' | 'all'; - wait_for_active_shards?: string; -} - -export interface LicenseDelete extends Generic { -} - -export interface LicenseGet extends Generic { - local?: boolean; -} - -export interface LicenseGetBasicStatus extends Generic { -} - -export interface LicenseGetTrialStatus extends Generic { -} - -export interface LicensePost extends Generic { - acknowledge?: boolean; - body?: T; -} - -export interface LicensePostStartBasic extends Generic { - acknowledge?: boolean; -} - -export interface LicensePostStartTrial extends Generic { - type?: string; - acknowledge?: boolean; -} - -export interface MigrationDeprecations extends Generic { - index?: string; -} - -export interface MlCloseJob extends Generic { - job_id: string; - allow_no_jobs?: boolean; - force?: boolean; - timeout?: string; - body?: T; -} - -export interface MlDeleteCalendar extends Generic { - calendar_id: string; -} - -export interface MlDeleteCalendarEvent extends Generic { - calendar_id: string; - event_id: string; -} - -export interface MlDeleteCalendarJob extends Generic { - calendar_id: string; - job_id: string; -} - -export interface MlDeleteDatafeed extends Generic { - datafeed_id: string; - force?: boolean; -} - -export interface MlDeleteExpiredData extends Generic { -} - -export interface MlDeleteFilter extends Generic { - filter_id: string; -} - -export interface MlDeleteForecast extends Generic { - job_id: string; - forecast_id?: string; - allow_no_forecasts?: boolean; - timeout?: string; -} - -export interface MlDeleteJob extends Generic { - job_id: string; - force?: boolean; - wait_for_completion?: boolean; -} - -export interface MlDeleteModelSnapshot extends Generic { - job_id: string; - snapshot_id: string; -} - -export interface MlFindFileStructure extends Generic { - lines_to_sample?: 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; - start?: string; - end?: string; - advance_time?: string; - skip_time?: string; - body?: T; -} - -export interface MlForecast extends Generic { - job_id: string; - duration?: string; - expires_in?: string; -} - -export interface MlGetBuckets extends Generic { - job_id: string; - timestamp?: string; - expand?: boolean; - exclude_interim?: boolean; - from?: number; - size?: number; - start?: string; - end?: string; - anomaly_score?: number; - sort?: string; - desc?: boolean; - body?: T; -} - -export interface MlGetCalendarEvents extends Generic { - calendar_id: string; - job_id?: string; - start?: string; - end?: string; - from?: number; - size?: number; -} - -export interface MlGetCalendars extends Generic { - calendar_id?: string; - from?: number; - size?: number; - body?: T; -} - -export interface MlGetCategories extends Generic { - job_id: string; - category_id?: number; - from?: number; - size?: number; - body?: T; -} - -export interface MlGetDatafeedStats extends Generic { - datafeed_id?: string; - allow_no_datafeeds?: boolean; -} - -export interface MlGetDatafeeds extends Generic { - datafeed_id?: string; - allow_no_datafeeds?: boolean; -} - -export interface MlGetFilters extends Generic { - filter_id?: string; - from?: number; - size?: number; -} - -export interface MlGetInfluencers extends Generic { - job_id: string; - exclude_interim?: boolean; - from?: number; - size?: number; - start?: string; - end?: string; - influencer_score?: number; - sort?: string; - desc?: boolean; - body?: T; -} - -export interface MlGetJobStats extends Generic { - job_id?: string; - allow_no_jobs?: boolean; -} - -export interface MlGetJobs extends Generic { - job_id?: string; - allow_no_jobs?: boolean; -} - -export interface MlGetModelSnapshots extends Generic { - job_id: string; - snapshot_id?: string; - from?: number; - size?: number; - start?: string; - end?: string; - sort?: string; - desc?: boolean; - body?: T; -} - -export interface MlGetOverallBuckets extends Generic { - job_id: string; - top_n?: number; - bucket_span?: string; - overall_score?: number; - exclude_interim?: boolean; - start?: string; - end?: string; - allow_no_jobs?: boolean; - body?: T; -} - -export interface MlGetRecords extends Generic { - job_id: string; - exclude_interim?: boolean; - from?: number; - size?: number; - start?: string; - end?: string; - record_score?: number; - sort?: string; - desc?: boolean; - body?: T; -} - -export interface MlInfo extends Generic { -} - -export interface MlOpenJob extends Generic { - job_id: string; - ignore_downtime?: boolean; - timeout?: string; -} - -export interface MlPostCalendarEvents extends Generic { - calendar_id: string; - body: T; -} - -export interface MlPostData extends Generic { - job_id: string; - reset_start?: string; - reset_end?: string; - body: T; -} - -export interface MlPreviewDatafeed extends Generic { - datafeed_id: string; -} - -export interface MlPutCalendar extends Generic { - calendar_id: string; - body?: T; -} - -export interface MlPutCalendarJob extends Generic { - calendar_id: string; - job_id: string; -} - -export interface MlPutDatafeed extends Generic { - datafeed_id: string; - body: T; -} - -export interface MlPutFilter extends Generic { - filter_id: string; - body: T; -} - -export interface MlPutJob extends Generic { - job_id: string; - body: T; -} - -export interface MlRevertModelSnapshot extends Generic { - job_id: string; - snapshot_id: string; - delete_intervening_results?: boolean; - body?: T; -} - -export interface MlSetUpgradeMode extends Generic { - enabled?: boolean; - timeout?: string; -} - -export interface MlStartDatafeed extends Generic { - datafeed_id: string; - start?: string; - end?: string; - timeout?: string; - body?: T; -} - -export interface MlStopDatafeed extends Generic { - datafeed_id: string; - allow_no_datafeeds?: boolean; - force?: boolean; - timeout?: string; -} - -export interface MlUpdateDatafeed extends Generic { - datafeed_id: string; - body: T; -} - -export interface MlUpdateFilter extends Generic { - filter_id: string; - body: T; -} - -export interface MlUpdateJob extends Generic { - job_id: string; - body: T; -} - -export interface MlUpdateModelSnapshot extends Generic { - job_id: string; - snapshot_id: string; - body: T; -} - -export interface MlValidate extends Generic { - body: T; -} - -export interface MlValidateDetector extends Generic { - body: T; -} - -export interface MonitoringBulk extends Generic { - type?: string; - system_id?: string; - system_api_version?: string; - interval?: string; - body: T; -} - -export interface RollupDeleteJob extends Generic { - id: string; -} - -export interface RollupGetJobs extends Generic { - id?: string; -} - -export interface RollupGetRollupCaps extends Generic { - id?: string; -} - -export interface RollupGetRollupIndexCaps extends Generic { - index: string; -} - -export interface RollupPutJob extends Generic { - id: string; - body: T; -} - -export interface RollupRollupSearch extends Generic { - index: string | string[]; - type?: string; - typed_keys?: boolean; - rest_total_hits_as_int?: boolean; - body: T; -} - -export interface RollupStartJob extends Generic { - id: string; -} - -export interface RollupStopJob extends Generic { - id: string; - wait_for_completion?: boolean; - timeout?: string; -} - -export interface SecurityAuthenticate extends Generic { -} - -export interface SecurityChangePassword extends Generic { - username?: string; - refresh?: 'true' | 'false' | 'wait_for'; - body: T; -} - -export interface SecurityClearCachedRealms extends Generic { - realms: string | string[]; - usernames?: string | string[]; -} - -export interface SecurityClearCachedRoles extends Generic { - name: string | string[]; -} - -export interface SecurityCreateApiKey extends Generic { - refresh?: 'true' | 'false' | 'wait_for'; - body: T; -} - -export interface SecurityDeletePrivileges extends Generic { - application: string; - name: string; - refresh?: 'true' | 'false' | 'wait_for'; -} - -export interface SecurityDeleteRole extends Generic { - name: string; - refresh?: 'true' | 'false' | 'wait_for'; -} - -export interface SecurityDeleteRoleMapping extends Generic { - name: string; - refresh?: 'true' | 'false' | 'wait_for'; -} - -export interface SecurityDeleteUser extends Generic { - username: string; - refresh?: 'true' | 'false' | 'wait_for'; -} - -export interface SecurityDisableUser extends Generic { - username: string; - refresh?: 'true' | 'false' | 'wait_for'; -} - -export interface SecurityEnableUser extends Generic { - username: string; - refresh?: 'true' | 'false' | 'wait_for'; -} - -export interface SecurityGetApiKey extends Generic { - id?: string; - name?: string; - username?: string; - realm_name?: string; -} - -export interface SecurityGetPrivileges extends Generic { - application?: string; - name?: string; -} - -export interface SecurityGetRole extends Generic { - name?: string; -} - -export interface SecurityGetRoleMapping extends Generic { - name?: string; -} - -export interface SecurityGetToken extends Generic { - body: T; -} - -export interface SecurityGetUser extends Generic { - username?: string | string[]; -} - -export interface SecurityGetUserPrivileges extends Generic { -} - -export interface SecurityHasPrivileges extends Generic { - user?: string; - body: T; -} - -export interface SecurityInvalidateApiKey extends Generic { - body: T; -} - -export interface SecurityInvalidateToken extends Generic { - body: T; -} - -export interface SecurityPutPrivileges extends Generic { - refresh?: 'true' | 'false' | 'wait_for'; - body: T; -} - -export interface SecurityPutRole extends Generic { - name: string; - refresh?: 'true' | 'false' | 'wait_for'; - body: T; -} - -export interface SecurityPutRoleMapping extends Generic { - name: string; - refresh?: 'true' | 'false' | 'wait_for'; - body: T; -} - -export interface SecurityPutUser extends Generic { - username: string; - refresh?: 'true' | 'false' | 'wait_for'; - body: T; -} - -export interface SqlClearCursor extends Generic { - body: T; -} - -export interface SqlQuery extends Generic { - format?: string; - body: T; -} - -export interface SqlTranslate extends Generic { - body: T; -} - -export interface SslCertificates extends Generic { -} - -export interface WatcherAckWatch extends Generic { - watch_id: string; - action_id?: string | string[]; -} - -export interface WatcherActivateWatch extends Generic { - watch_id: string; -} - -export interface WatcherDeactivateWatch extends Generic { - watch_id: string; -} - -export interface WatcherDeleteWatch extends Generic { - id: string; -} - -export interface WatcherExecuteWatch extends Generic { - id?: string; - debug?: boolean; - body?: T; -} - -export interface WatcherGetWatch extends Generic { - id: string; -} - -export interface WatcherPutWatch extends Generic { - id: string; - active?: boolean; - version?: number; - if_seq_no?: number; - if_primary_term?: number; - body?: T; -} - -export interface WatcherStart extends Generic { -} - -export interface WatcherStats extends Generic { - metric?: string | string[]; - emit_stacktraces?: boolean; -} - -export interface WatcherStop extends Generic { -} - -export interface XpackInfo extends Generic { - categories?: string | string[]; -} - -export interface XpackUsage extends Generic { - master_timeout?: string; -} ->>>>>>> a21281f... Improve typings (#813) diff --git a/docs/reference.asciidoc b/docs/reference.asciidoc index e4100e3a4..6eb11e4ca 100644 --- a/docs/reference.asciidoc +++ b/docs/reference.asciidoc @@ -4198,2294 +4198,3 @@ _Default:_ `1` |`object` - The search definition using the Query DSL |=== -<<<<<<< HEAD -======= - -=== updateByQueryRethrottle -[source,js] ----- -client.updateByQueryRethrottle([params] [, options] [, callback]) ----- -link:{ref}/docs-update-by-query.html[Reference] -[cols=2*] -|=== -|`task_id` or `taskId` -|`string` - The task id to rethrottle - -|`requests_per_second` or `requestsPerSecond` -|`number` - The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. - -|=== - -=== ccr.deleteAutoFollowPattern -[source,js] ----- -client.ccr.deleteAutoFollowPattern([params] [, options] [, callback]) ----- -link:{ref}/ccr-delete-auto-follow-pattern.html[Reference] -[cols=2*] -|=== -|`name` -|`string` - The name of the auto follow pattern. - -|=== - -=== ccr.follow -[source,js] ----- -client.ccr.follow([params] [, options] [, callback]) ----- -link:{ref}/ccr-put-follow.html[Reference] -[cols=2*] -|=== -|`index` -|`string` - The name of the follower index - -|`wait_for_active_shards` or `waitForActiveShards` -|`string` - Sets the number of shard copies that must be active before returning. Defaults to 0. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) + -_Default:_ `0` - -|`body` -|`object` - The name of the leader index and other optional ccr related parameters - -|=== - -=== ccr.followInfo -[source,js] ----- -client.ccr.followInfo([params] [, options] [, callback]) ----- -link:{ref}/ccr-get-follow-info.html[Reference] -[cols=2*] -|=== -|`index` -|`string, string[]` - A comma-separated list of index patterns; use `_all` to perform the operation on all indices - -|=== - -=== ccr.followStats -[source,js] ----- -client.ccr.followStats([params] [, options] [, callback]) ----- -link:{ref}/ccr-get-follow-stats.html[Reference] -[cols=2*] -|=== -|`index` -|`string, string[]` - A comma-separated list of index patterns; use `_all` to perform the operation on all indices - -|=== - -=== ccr.forgetFollower -[source,js] ----- -client.ccr.forgetFollower([params] [, options] [, callback]) ----- -link:http://www.elastic.co/guide/en/elasticsearch/reference/current[Reference] -[cols=2*] -|=== -|`index` -|`string` - the name of the leader index for which specified follower retention leases should be removed - -|`body` -|`object` - the name and UUID of the follower index, the name of the cluster containing the follower index, and the alias from the perspective of that cluster for the remote cluster containing the leader index - -|=== - -=== ccr.getAutoFollowPattern -[source,js] ----- -client.ccr.getAutoFollowPattern([params] [, options] [, callback]) ----- -link:{ref}/ccr-get-auto-follow-pattern.html[Reference] -[cols=2*] -|=== -|`name` -|`string` - The name of the auto follow pattern. - -|=== - -=== ccr.pauseFollow -[source,js] ----- -client.ccr.pauseFollow([params] [, options] [, callback]) ----- -link:{ref}/ccr-post-pause-follow.html[Reference] -[cols=2*] -|=== -|`index` -|`string` - The name of the follower index that should pause following its leader index. - -|=== - -=== ccr.putAutoFollowPattern -[source,js] ----- -client.ccr.putAutoFollowPattern([params] [, options] [, callback]) ----- -link:{ref}/ccr-put-auto-follow-pattern.html[Reference] -[cols=2*] -|=== -|`name` -|`string` - The name of the auto follow pattern. - -|`body` -|`object` - The specification of the auto follow pattern - -|=== - -=== ccr.resumeFollow -[source,js] ----- -client.ccr.resumeFollow([params] [, options] [, callback]) ----- -link:{ref}/ccr-post-resume-follow.html[Reference] -[cols=2*] -|=== -|`index` -|`string` - The name of the follow index to resume following. - -|`body` -|`object` - The name of the leader index and other optional ccr related parameters - -|=== - -=== ccr.stats -[source,js] ----- -client.ccr.stats([params] [, options] [, callback]) ----- -link:{ref}/ccr-get-stats.html[Reference] - - -=== ccr.unfollow -[source,js] ----- -client.ccr.unfollow([params] [, options] [, callback]) ----- -link:http://www.elastic.co/guide/en/elasticsearch/reference/current[Reference] -[cols=2*] -|=== -|`index` -|`string` - The name of the follower index that should be turned into a regular index. - -|=== - -=== dataFrame.deleteDataFrameTransform -[source,js] ----- -client.dataFrame.deleteDataFrameTransform([params] [, options] [, callback]) ----- -link:{ref}/delete-data-frame-transform.html[Reference] -[cols=2*] -|=== -|`transform_id` or `transformId` -|`string` - The id of the transform to delete - -|=== - -=== dataFrame.getDataFrameTransform -[source,js] ----- -client.dataFrame.getDataFrameTransform([params] [, options] [, callback]) ----- -link:{ref}/get-data-frame-transform.html[Reference] -[cols=2*] -|=== -|`transform_id` or `transformId` -|`string` - The id or comma delimited list of id expressions of the transforms to get, '_all' or '*' implies get all transforms - -|`from` -|`number` - skips a number of transform configs, defaults to 0 - -|`size` -|`number` - specifies a max number of transforms to get, defaults to 100 - -|=== - -=== dataFrame.getDataFrameTransformStats -[source,js] ----- -client.dataFrame.getDataFrameTransformStats([params] [, options] [, callback]) ----- -link:{ref}/get-data-frame-transform-stats.html[Reference] -[cols=2*] -|=== -|`transform_id` or `transformId` -|`string` - The id of the transform for which to get stats. '_all' or '*' implies all transforms - -|`from` -|`number` - skips a number of transform stats, defaults to 0 - -|`size` -|`number` - specifies a max number of transform stats to get, defaults to 100 - -|=== - -=== dataFrame.previewDataFrameTransform -[source,js] ----- -client.dataFrame.previewDataFrameTransform([params] [, options] [, callback]) ----- -link:{ref}/preview-data-frame-transform.html[Reference] -[cols=2*] -|=== -|`body` -|`object` - The definition for the data_frame transform to preview - -|=== - -=== dataFrame.putDataFrameTransform -[source,js] ----- -client.dataFrame.putDataFrameTransform([params] [, options] [, callback]) ----- -link:{ref}/put-data-frame-transform.html[Reference] -[cols=2*] -|=== -|`transform_id` or `transformId` -|`string` - The id of the new transform. - -|`body` -|`object` - The data frame transform definition - -|=== - -=== dataFrame.startDataFrameTransform -[source,js] ----- -client.dataFrame.startDataFrameTransform([params] [, options] [, callback]) ----- -link:{ref}/start-data-frame-transform.html[Reference] -[cols=2*] -|=== -|`transform_id` or `transformId` -|`string` - The id of the transform to start - -|`timeout` -|`string` - Controls the time to wait for the transform to start - -|=== - -=== dataFrame.stopDataFrameTransform -[source,js] ----- -client.dataFrame.stopDataFrameTransform([params] [, options] [, callback]) ----- -link:{ref}/stop-data-frame-transform.html[Reference] -[cols=2*] -|=== -|`transform_id` or `transformId` -|`string` - The id of the transform to stop - -|`wait_for_completion` or `waitForCompletion` -|`boolean` - Whether to wait for the transform to fully stop before returning or not. Default to false - -|`timeout` -|`string` - Controls the time to wait until the transform has stopped. Default to 30 seconds - -|=== - -=== graph.explore -[source,js] ----- -client.graph.explore([params] [, options] [, callback]) ----- -link:{ref}/graph-explore-api.html[Reference] -[cols=2*] -|=== -|`index` -|`string, string[]` - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - -|`type` -|`string, string[]` - A comma-separated list of document types to search; leave empty to perform the operation on all types - -|`routing` -|`string` - Specific routing value - -|`timeout` -|`string` - Explicit operation timeout - -|`body` -|`object` - Graph Query DSL - -|=== - -=== ilm.deleteLifecycle -[source,js] ----- -client.ilm.deleteLifecycle([params] [, options] [, callback]) ----- -link:{ref}/ilm-delete-lifecycle.html[Reference] -[cols=2*] -|=== -|`policy` -|`string` - The name of the index lifecycle policy - -|=== - -=== ilm.explainLifecycle -[source,js] ----- -client.ilm.explainLifecycle([params] [, options] [, callback]) ----- -link:{ref}/ilm-explain-lifecycle.html[Reference] -[cols=2*] -|=== -|`index` -|`string` - The name of the index to explain - -|=== - -=== ilm.getLifecycle -[source,js] ----- -client.ilm.getLifecycle([params] [, options] [, callback]) ----- -link:{ref}/ilm-get-lifecycle.html[Reference] -[cols=2*] -|=== -|`policy` -|`string` - The name of the index lifecycle policy - -|=== - -=== ilm.getStatus -[source,js] ----- -client.ilm.getStatus([params] [, options] [, callback]) ----- -link:{ref}/ilm-get-status.html[Reference] - - -=== ilm.moveToStep -[source,js] ----- -client.ilm.moveToStep([params] [, options] [, callback]) ----- -link:{ref}/ilm-move-to-step.html[Reference] -[cols=2*] -|=== -|`index` -|`string` - The name of the index whose lifecycle step is to change - -|`body` -|`object` - The new lifecycle step to move to - -|=== - -=== ilm.putLifecycle -[source,js] ----- -client.ilm.putLifecycle([params] [, options] [, callback]) ----- -link:{ref}/ilm-put-lifecycle.html[Reference] -[cols=2*] -|=== -|`policy` -|`string` - The name of the index lifecycle policy - -|`body` -|`object` - The lifecycle policy definition to register - -|=== - -=== ilm.removePolicy -[source,js] ----- -client.ilm.removePolicy([params] [, options] [, callback]) ----- -link:{ref}/ilm-remove-policy.html[Reference] -[cols=2*] -|=== -|`index` -|`string` - The name of the index to remove policy on - -|=== - -=== ilm.retry -[source,js] ----- -client.ilm.retry([params] [, options] [, callback]) ----- -link:{ref}/ilm-retry-policy.html[Reference] -[cols=2*] -|=== -|`index` -|`string` - The name of the indices (comma-separated) whose failed lifecycle step is to be retry - -|=== - -=== ilm.start -[source,js] ----- -client.ilm.start([params] [, options] [, callback]) ----- -link:{ref}/ilm-start.html[Reference] - - -=== ilm.stop -[source,js] ----- -client.ilm.stop([params] [, options] [, callback]) ----- -link:{ref}/ilm-stop.html[Reference] - - -=== indices.freeze -[source,js] ----- -client.indices.freeze([params] [, options] [, callback]) ----- -link:{ref}/freeze-index-api.html[Reference] -[cols=2*] -|=== -|`index` -|`string` - The name of the index to freeze - -|`timeout` -|`string` - Explicit operation timeout - -|`master_timeout` or `masterTimeout` -|`string` - Specify timeout for connection to master - -|`ignore_unavailable` or `ignoreUnavailable` -|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed) - -|`allow_no_indices` or `allowNoIndices` -|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - -|`expand_wildcards` or `expandWildcards` -|`'open', 'closed', 'none', 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. + -_Default:_ `closed` - -|`wait_for_active_shards` or `waitForActiveShards` -|`string` - Sets the number of active shards to wait for before the operation returns. - -|=== - -=== indices.unfreeze -[source,js] ----- -client.indices.unfreeze([params] [, options] [, callback]) ----- -link:{ref}/freeze-index-api.html[Reference] -[cols=2*] -|=== -|`index` -|`string` - The name of the index to unfreeze - -|`timeout` -|`string` - Explicit operation timeout - -|`master_timeout` or `masterTimeout` -|`string` - Specify timeout for connection to master - -|`ignore_unavailable` or `ignoreUnavailable` -|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed) - -|`allow_no_indices` or `allowNoIndices` -|`boolean` - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - -|`expand_wildcards` or `expandWildcards` -|`'open', 'closed', 'none', 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. + -_Default:_ `closed` - -|`wait_for_active_shards` or `waitForActiveShards` -|`string` - Sets the number of active shards to wait for before the operation returns. - -|=== - -=== license.delete -[source,js] ----- -client.license.delete([params] [, options] [, callback]) ----- -link:{ref}/delete-license.html[Reference] - - -=== license.get -[source,js] ----- -client.license.get([params] [, options] [, callback]) ----- -link:{ref}/get-license.html[Reference] -[cols=2*] -|=== -|`local` -|`boolean` - Return local information, do not retrieve the state from master node (default: false) - -|=== - -=== license.getBasicStatus -[source,js] ----- -client.license.getBasicStatus([params] [, options] [, callback]) ----- -link:{ref}/get-basic-status.html[Reference] - - -=== license.getTrialStatus -[source,js] ----- -client.license.getTrialStatus([params] [, options] [, callback]) ----- -link:{ref}/get-trial-status.html[Reference] - - -=== license.post -[source,js] ----- -client.license.post([params] [, options] [, callback]) ----- -link:{ref}/update-license.html[Reference] -[cols=2*] -|=== -|`acknowledge` -|`boolean` - whether the user has acknowledged acknowledge messages (default: false) - -|`body` -|`object` - licenses to be installed - -|=== - -=== license.postStartBasic -[source,js] ----- -client.license.postStartBasic([params] [, options] [, callback]) ----- -link:{ref}/start-basic.html[Reference] -[cols=2*] -|=== -|`acknowledge` -|`boolean` - whether the user has acknowledged acknowledge messages (default: false) - -|=== - -=== license.postStartTrial -[source,js] ----- -client.license.postStartTrial([params] [, options] [, callback]) ----- -link:{ref}/start-trial.html[Reference] -[cols=2*] -|=== -|`type` -|`string` - The type of trial license to generate (default: "trial") - -|`acknowledge` -|`boolean` - whether the user has acknowledged acknowledge messages (default: false) - -|=== - -=== migration.deprecations -[source,js] ----- -client.migration.deprecations([params] [, options] [, callback]) ----- -link:{ref}/migration-api-deprecation.html[Reference] -[cols=2*] -|=== -|`index` -|`string` - Index pattern - -|=== - -=== ml.closeJob -[source,js] ----- -client.ml.closeJob([params] [, options] [, callback]) ----- -link:{ref}/ml-close-job.html[Reference] -[cols=2*] -|=== -|`job_id` or `jobId` -|`string` - The name of the job to close - -|`allow_no_jobs` or `allowNoJobs` -|`boolean` - Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified) - -|`force` -|`boolean` - True if the job should be forcefully closed - -|`timeout` -|`string` - Controls the time to wait until a job has closed. Default to 30 minutes - -|`body` -|`object` - The URL params optionally sent in the body - -|=== - -=== ml.deleteCalendar -[source,js] ----- -client.ml.deleteCalendar([params] [, options] [, callback]) ----- -[cols=2*] -|=== -|`calendar_id` or `calendarId` -|`string` - The ID of the calendar to delete - -|=== - -=== ml.deleteCalendarEvent -[source,js] ----- -client.ml.deleteCalendarEvent([params] [, options] [, callback]) ----- -[cols=2*] -|=== -|`calendar_id` or `calendarId` -|`string` - The ID of the calendar to modify - -|`event_id` or `eventId` -|`string` - The ID of the event to remove from the calendar - -|=== - -=== ml.deleteCalendarJob -[source,js] ----- -client.ml.deleteCalendarJob([params] [, options] [, callback]) ----- -[cols=2*] -|=== -|`calendar_id` or `calendarId` -|`string` - The ID of the calendar to modify - -|`job_id` or `jobId` -|`string` - The ID of the job to remove from the calendar - -|=== - -=== ml.deleteDatafeed -[source,js] ----- -client.ml.deleteDatafeed([params] [, options] [, callback]) ----- -link:{ref}/ml-delete-datafeed.html[Reference] -[cols=2*] -|=== -|`datafeed_id` or `datafeedId` -|`string` - The ID of the datafeed to delete - -|`force` -|`boolean` - True if the datafeed should be forcefully deleted - -|=== - -=== ml.deleteExpiredData -[source,js] ----- -client.ml.deleteExpiredData([params] [, options] [, callback]) ----- - - -=== ml.deleteFilter -[source,js] ----- -client.ml.deleteFilter([params] [, options] [, callback]) ----- -[cols=2*] -|=== -|`filter_id` or `filterId` -|`string` - The ID of the filter to delete - -|=== - -=== ml.deleteForecast -[source,js] ----- -client.ml.deleteForecast([params] [, options] [, callback]) ----- -link:{ref}/ml-delete-forecast.html[Reference] -[cols=2*] -|=== -|`job_id` or `jobId` -|`string` - The ID of the job from which to delete forecasts - -|`forecast_id` or `forecastId` -|`string` - The ID of the forecast to delete, can be comma delimited list. Leaving blank implies `_all` - -|`allow_no_forecasts` or `allowNoForecasts` -|`boolean` - Whether to ignore if `_all` matches no forecasts - -|`timeout` -|`string` - Controls the time to wait until the forecast(s) are deleted. Default to 30 seconds - -|=== - -=== ml.deleteJob -[source,js] ----- -client.ml.deleteJob([params] [, options] [, callback]) ----- -link:{ref}/ml-delete-job.html[Reference] -[cols=2*] -|=== -|`job_id` or `jobId` -|`string` - The ID of the job to delete - -|`force` -|`boolean` - True if the job should be forcefully deleted - -|`wait_for_completion` or `waitForCompletion` -|`boolean` - Should this request wait until the operation has completed before returning + -_Default:_ `true` - -|=== - -=== ml.deleteModelSnapshot -[source,js] ----- -client.ml.deleteModelSnapshot([params] [, options] [, callback]) ----- -link:{ref}/ml-delete-snapshot.html[Reference] -[cols=2*] -|=== -|`job_id` or `jobId` -|`string` - The ID of the job to fetch - -|`snapshot_id` or `snapshotId` -|`string` - The ID of the snapshot to delete - -|=== - -=== ml.findFileStructure -[source,js] ----- -client.ml.findFileStructure([params] [, options] [, callback]) ----- -link:{ref}/ml-find-file-structure.html[Reference] -[cols=2*] -|=== -|`lines_to_sample` or `linesToSample` -|`number` - How many lines of the file should be included in the analysis + -_Default:_ `1000` - -|`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 - -|=== - -=== ml.flushJob -[source,js] ----- -client.ml.flushJob([params] [, options] [, callback]) ----- -link:{ref}/ml-flush-job.html[Reference] -[cols=2*] -|=== -|`job_id` or `jobId` -|`string` - The name of the job to flush - -|`calc_interim` or `calcInterim` -|`boolean` - Calculates interim results for the most recent bucket or all buckets within the latency period - -|`start` -|`string` - When used in conjunction with calc_interim, specifies the range of buckets on which to calculate interim results - -|`end` -|`string` - When used in conjunction with calc_interim, specifies the range of buckets on which to calculate interim results - -|`advance_time` or `advanceTime` -|`string` - Advances time to the given value generating results and updating the model for the advanced interval - -|`skip_time` or `skipTime` -|`string` - Skips time to the given value without generating results or updating the model for the skipped interval - -|`body` -|`object` - Flush parameters - -|=== - -=== ml.forecast -[source,js] ----- -client.ml.forecast([params] [, options] [, callback]) ----- -[cols=2*] -|=== -|`job_id` or `jobId` -|`string` - The ID of the job to forecast for - -|`duration` -|`string` - The duration of the forecast - -|`expires_in` or `expiresIn` -|`string` - The time interval after which the forecast expires. Expired forecasts will be deleted at the first opportunity. - -|=== - -=== ml.getBuckets -[source,js] ----- -client.ml.getBuckets([params] [, options] [, callback]) ----- -link:{ref}/ml-get-bucket.html[Reference] -[cols=2*] -|=== -|`job_id` or `jobId` -|`string` - ID of the job to get bucket results from - -|`timestamp` -|`string` - The timestamp of the desired single bucket result - -|`expand` -|`boolean` - Include anomaly records - -|`exclude_interim` or `excludeInterim` -|`boolean` - Exclude interim results - -|`from` -|`number` - skips a number of buckets - -|`size` -|`number` - specifies a max number of buckets to get - -|`start` -|`string` - Start time filter for buckets - -|`end` -|`string` - End time filter for buckets - -|`anomaly_score` or `anomalyScore` -|`number` - Filter for the most anomalous buckets - -|`sort` -|`string` - Sort buckets by a particular field - -|`desc` -|`boolean` - Set the sort direction - -|`body` -|`object` - Bucket selection details if not provided in URI - -|=== - -=== ml.getCalendarEvents -[source,js] ----- -client.ml.getCalendarEvents([params] [, options] [, callback]) ----- -[cols=2*] -|=== -|`calendar_id` or `calendarId` -|`string` - The ID of the calendar containing the events - -|`job_id` or `jobId` -|`string` - Get events for the job. When this option is used calendar_id must be '_all' - -|`start` -|`string` - Get events after this time - -|`end` -|`string` - Get events before this time - -|`from` -|`number` - Skips a number of events - -|`size` -|`number` - Specifies a max number of events to get - -|=== - -=== ml.getCalendars -[source,js] ----- -client.ml.getCalendars([params] [, options] [, callback]) ----- -[cols=2*] -|=== -|`calendar_id` or `calendarId` -|`string` - The ID of the calendar to fetch - -|`from` -|`number` - skips a number of calendars - -|`size` -|`number` - specifies a max number of calendars to get - -|`body` -|`object` - The from and size parameters optionally sent in the body - -|=== - -=== ml.getCategories -[source,js] ----- -client.ml.getCategories([params] [, options] [, callback]) ----- -link:{ref}/ml-get-category.html[Reference] -[cols=2*] -|=== -|`job_id` or `jobId` -|`string` - The name of the job - -|`category_id` or `categoryId` -|`number` - The identifier of the category definition of interest - -|`from` -|`number` - skips a number of categories - -|`size` -|`number` - specifies a max number of categories to get - -|`body` -|`object` - Category selection details if not provided in URI - -|=== - -=== ml.getDatafeedStats -[source,js] ----- -client.ml.getDatafeedStats([params] [, options] [, callback]) ----- -link:{ref}/ml-get-datafeed-stats.html[Reference] -[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) - -|=== - -=== ml.getDatafeeds -[source,js] ----- -client.ml.getDatafeeds([params] [, options] [, callback]) ----- -link:{ref}/ml-get-datafeed.html[Reference] -[cols=2*] -|=== -|`datafeed_id` or `datafeedId` -|`string` - The ID of the datafeeds to fetch - -|`allow_no_datafeeds` or `allowNoDatafeeds` -|`boolean` - Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified) - -|=== - -=== ml.getFilters -[source,js] ----- -client.ml.getFilters([params] [, options] [, callback]) ----- -[cols=2*] -|=== -|`filter_id` or `filterId` -|`string` - The ID of the filter to fetch - -|`from` -|`number` - skips a number of filters - -|`size` -|`number` - specifies a max number of filters to get - -|=== - -=== ml.getInfluencers -[source,js] ----- -client.ml.getInfluencers([params] [, options] [, callback]) ----- -link:{ref}/ml-get-influencer.html[Reference] -[cols=2*] -|=== -|`job_id` or `jobId` -|`string` - undefined - -|`exclude_interim` or `excludeInterim` -|`boolean` - Exclude interim results - -|`from` -|`number` - skips a number of influencers - -|`size` -|`number` - specifies a max number of influencers to get - -|`start` -|`string` - start timestamp for the requested influencers - -|`end` -|`string` - end timestamp for the requested influencers - -|`influencer_score` or `influencerScore` -|`number` - influencer score threshold for the requested influencers - -|`sort` -|`string` - sort field for the requested influencers - -|`desc` -|`boolean` - whether the results should be sorted in decending order - -|`body` -|`object` - Influencer selection criteria - -|=== - -=== ml.getJobStats -[source,js] ----- -client.ml.getJobStats([params] [, options] [, callback]) ----- -link:{ref}/ml-get-job-stats.html[Reference] -[cols=2*] -|=== -|`job_id` or `jobId` -|`string` - The ID of the jobs stats to fetch - -|`allow_no_jobs` or `allowNoJobs` -|`boolean` - Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified) - -|=== - -=== ml.getJobs -[source,js] ----- -client.ml.getJobs([params] [, options] [, callback]) ----- -link:{ref}/ml-get-job.html[Reference] -[cols=2*] -|=== -|`job_id` or `jobId` -|`string` - The ID of the jobs to fetch - -|`allow_no_jobs` or `allowNoJobs` -|`boolean` - Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified) - -|=== - -=== ml.getModelSnapshots -[source,js] ----- -client.ml.getModelSnapshots([params] [, options] [, callback]) ----- -link:{ref}/ml-get-snapshot.html[Reference] -[cols=2*] -|=== -|`job_id` or `jobId` -|`string` - The ID of the job to fetch - -|`snapshot_id` or `snapshotId` -|`string` - The ID of the snapshot to fetch - -|`from` -|`number` - Skips a number of documents - -|`size` -|`number` - The default number of documents returned in queries as a string. - -|`start` -|`string` - The filter 'start' query parameter - -|`end` -|`string` - The filter 'end' query parameter - -|`sort` -|`string` - Name of the field to sort on - -|`desc` -|`boolean` - True if the results should be sorted in descending order - -|`body` -|`object` - Model snapshot selection criteria - -|=== - -=== ml.getOverallBuckets -[source,js] ----- -client.ml.getOverallBuckets([params] [, options] [, callback]) ----- -link:{ref}/ml-get-overall-buckets.html[Reference] -[cols=2*] -|=== -|`job_id` or `jobId` -|`string` - The job IDs for which to calculate overall bucket results - -|`top_n` or `topN` -|`number` - The number of top job bucket scores to be used in the overall_score calculation - -|`bucket_span` or `bucketSpan` -|`string` - The span of the overall buckets. Defaults to the longest job bucket_span - -|`overall_score` or `overallScore` -|`number` - Returns overall buckets with overall scores higher than this value - -|`exclude_interim` or `excludeInterim` -|`boolean` - If true overall buckets that include interim buckets will be excluded - -|`start` -|`string` - Returns overall buckets with timestamps after this time - -|`end` -|`string` - Returns overall buckets with timestamps earlier than this time - -|`allow_no_jobs` or `allowNoJobs` -|`boolean` - Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified) - -|`body` -|`object` - Overall bucket selection details if not provided in URI - -|=== - -=== ml.getRecords -[source,js] ----- -client.ml.getRecords([params] [, options] [, callback]) ----- -link:{ref}/ml-get-record.html[Reference] -[cols=2*] -|=== -|`job_id` or `jobId` -|`string` - undefined - -|`exclude_interim` or `excludeInterim` -|`boolean` - Exclude interim results - -|`from` -|`number` - skips a number of records - -|`size` -|`number` - specifies a max number of records to get - -|`start` -|`string` - Start time filter for records - -|`end` -|`string` - End time filter for records - -|`record_score` or `recordScore` -|`number` - undefined - -|`sort` -|`string` - Sort records by a particular field - -|`desc` -|`boolean` - Set the sort direction - -|`body` -|`object` - Record selection criteria - -|=== - -=== ml.info -[source,js] ----- -client.ml.info([params] [, options] [, callback]) ----- - - -=== ml.openJob -[source,js] ----- -client.ml.openJob([params] [, options] [, callback]) ----- -link:{ref}/ml-open-job.html[Reference] -[cols=2*] -|=== -|`job_id` or `jobId` -|`string` - The ID of the job to open - -|`ignore_downtime` or `ignoreDowntime` -|`boolean` - Controls if gaps in data are treated as anomalous or as a maintenance window after a job re-start - -|`timeout` -|`string` - Controls the time to wait until a job has opened. Default to 30 minutes - -|=== - -=== ml.postCalendarEvents -[source,js] ----- -client.ml.postCalendarEvents([params] [, options] [, callback]) ----- -[cols=2*] -|=== -|`calendar_id` or `calendarId` -|`string` - The ID of the calendar to modify - -|`body` -|`object` - A list of events - -|=== - -=== ml.postData -[source,js] ----- -client.ml.postData([params] [, options] [, callback]) ----- -link:{ref}/ml-post-data.html[Reference] -[cols=2*] -|=== -|`job_id` or `jobId` -|`string` - The name of the job receiving the data - -|`reset_start` or `resetStart` -|`string` - Optional parameter to specify the start of the bucket resetting range - -|`reset_end` or `resetEnd` -|`string` - Optional parameter to specify the end of the bucket resetting range - -|`body` -|`object` - The data to process - -|=== - -=== ml.previewDatafeed -[source,js] ----- -client.ml.previewDatafeed([params] [, options] [, callback]) ----- -link:{ref}/ml-preview-datafeed.html[Reference] -[cols=2*] -|=== -|`datafeed_id` or `datafeedId` -|`string` - The ID of the datafeed to preview - -|=== - -=== ml.putCalendar -[source,js] ----- -client.ml.putCalendar([params] [, options] [, callback]) ----- -[cols=2*] -|=== -|`calendar_id` or `calendarId` -|`string` - The ID of the calendar to create - -|`body` -|`object` - The calendar details - -|=== - -=== ml.putCalendarJob -[source,js] ----- -client.ml.putCalendarJob([params] [, options] [, callback]) ----- -[cols=2*] -|=== -|`calendar_id` or `calendarId` -|`string` - The ID of the calendar to modify - -|`job_id` or `jobId` -|`string` - The ID of the job to add to the calendar - -|=== - -=== ml.putDatafeed -[source,js] ----- -client.ml.putDatafeed([params] [, options] [, callback]) ----- -link:{ref}/ml-put-datafeed.html[Reference] -[cols=2*] -|=== -|`datafeed_id` or `datafeedId` -|`string` - The ID of the datafeed to create - -|`body` -|`object` - The datafeed config - -|=== - -=== ml.putFilter -[source,js] ----- -client.ml.putFilter([params] [, options] [, callback]) ----- -[cols=2*] -|=== -|`filter_id` or `filterId` -|`string` - The ID of the filter to create - -|`body` -|`object` - The filter details - -|=== - -=== ml.putJob -[source,js] ----- -client.ml.putJob([params] [, options] [, callback]) ----- -link:{ref}/ml-put-job.html[Reference] -[cols=2*] -|=== -|`job_id` or `jobId` -|`string` - The ID of the job to create - -|`body` -|`object` - The job - -|=== - -=== ml.revertModelSnapshot -[source,js] ----- -client.ml.revertModelSnapshot([params] [, options] [, callback]) ----- -link:{ref}/ml-revert-snapshot.html[Reference] -[cols=2*] -|=== -|`job_id` or `jobId` -|`string` - The ID of the job to fetch - -|`snapshot_id` or `snapshotId` -|`string` - The ID of the snapshot to revert to - -|`delete_intervening_results` or `deleteInterveningResults` -|`boolean` - Should we reset the results back to the time of the snapshot? - -|`body` -|`object` - Reversion options - -|=== - -=== ml.setUpgradeMode -[source,js] ----- -client.ml.setUpgradeMode([params] [, options] [, callback]) ----- -link:{ref}/ml-set-upgrade-mode.html[Reference] -[cols=2*] -|=== -|`enabled` -|`boolean` - Whether to enable upgrade_mode ML setting or not. Defaults to false. - -|`timeout` -|`string` - Controls the time to wait before action times out. Defaults to 30 seconds - -|=== - -=== ml.startDatafeed -[source,js] ----- -client.ml.startDatafeed([params] [, options] [, callback]) ----- -link:{ref}/ml-start-datafeed.html[Reference] -[cols=2*] -|=== -|`datafeed_id` or `datafeedId` -|`string` - The ID of the datafeed to start - -|`start` -|`string` - The start time from where the datafeed should begin - -|`end` -|`string` - The end time when the datafeed should stop. When not set, the datafeed continues in real time - -|`timeout` -|`string` - Controls the time to wait until a datafeed has started. Default to 20 seconds - -|`body` -|`object` - The start datafeed parameters - -|=== - -=== ml.stopDatafeed -[source,js] ----- -client.ml.stopDatafeed([params] [, options] [, callback]) ----- -link:{ref}/ml-stop-datafeed.html[Reference] -[cols=2*] -|=== -|`datafeed_id` or `datafeedId` -|`string` - The ID of the datafeed to stop - -|`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) - -|`force` -|`boolean` - True if the datafeed should be forcefully stopped. - -|`timeout` -|`string` - Controls the time to wait until a datafeed has stopped. Default to 20 seconds - -|=== - -=== ml.updateDatafeed -[source,js] ----- -client.ml.updateDatafeed([params] [, options] [, callback]) ----- -link:{ref}/ml-update-datafeed.html[Reference] -[cols=2*] -|=== -|`datafeed_id` or `datafeedId` -|`string` - The ID of the datafeed to update - -|`body` -|`object` - The datafeed update settings - -|=== - -=== ml.updateFilter -[source,js] ----- -client.ml.updateFilter([params] [, options] [, callback]) ----- -[cols=2*] -|=== -|`filter_id` or `filterId` -|`string` - The ID of the filter to update - -|`body` -|`object` - The filter update - -|=== - -=== ml.updateJob -[source,js] ----- -client.ml.updateJob([params] [, options] [, callback]) ----- -link:{ref}/ml-update-job.html[Reference] -[cols=2*] -|=== -|`job_id` or `jobId` -|`string` - The ID of the job to create - -|`body` -|`object` - The job update settings - -|=== - -=== ml.updateModelSnapshot -[source,js] ----- -client.ml.updateModelSnapshot([params] [, options] [, callback]) ----- -link:{ref}/ml-update-snapshot.html[Reference] -[cols=2*] -|=== -|`job_id` or `jobId` -|`string` - The ID of the job to fetch - -|`snapshot_id` or `snapshotId` -|`string` - The ID of the snapshot to update - -|`body` -|`object` - The model snapshot properties to update - -|=== - -=== ml.validate -[source,js] ----- -client.ml.validate([params] [, options] [, callback]) ----- -[cols=2*] -|=== -|`body` -|`object` - The job config - -|=== - -=== ml.validateDetector -[source,js] ----- -client.ml.validateDetector([params] [, options] [, callback]) ----- -[cols=2*] -|=== -|`body` -|`object` - The detector - -|=== - -=== monitoring.bulk -[source,js] ----- -client.monitoring.bulk([params] [, options] [, callback]) ----- -link:{ref}/es-monitoring.html[Reference] -[cols=2*] -|=== -|`type` -|`string` - Default document type for items which don't provide one - -|`system_id` or `systemId` -|`string` - Identifier of the monitored system - -|`system_api_version` or `systemApiVersion` -|`string` - API Version of the monitored system - -|`interval` -|`string` - Collection interval (e.g., '10s' or '10000ms') of the payload - -|`body` -|`object` - The operation definition and data (action-data pairs), separated by newlines - -|=== - -=== rollup.deleteJob -[source,js] ----- -client.rollup.deleteJob([params] [, options] [, callback]) ----- -[cols=2*] -|=== -|`id` -|`string` - The ID of the job to delete - -|=== - -=== rollup.getJobs -[source,js] ----- -client.rollup.getJobs([params] [, options] [, callback]) ----- -[cols=2*] -|=== -|`id` -|`string` - The ID of the job(s) to fetch. Accepts glob patterns, or left blank for all jobs - -|=== - -=== rollup.getRollupCaps -[source,js] ----- -client.rollup.getRollupCaps([params] [, options] [, callback]) ----- -[cols=2*] -|=== -|`id` -|`string` - The ID of the index to check rollup capabilities on, or left blank for all jobs - -|=== - -=== rollup.getRollupIndexCaps -[source,js] ----- -client.rollup.getRollupIndexCaps([params] [, options] [, callback]) ----- -[cols=2*] -|=== -|`index` -|`string` - The rollup index or index pattern to obtain rollup capabilities from. - -|=== - -=== rollup.putJob -[source,js] ----- -client.rollup.putJob([params] [, options] [, callback]) ----- -[cols=2*] -|=== -|`id` -|`string` - The ID of the job to create - -|`body` -|`object` - The job configuration - -|=== - -=== rollup.rollupSearch -[source,js] ----- -client.rollup.rollupSearch([params] [, options] [, callback]) ----- -[cols=2*] -|=== -|`index` -|`string, string[]` - The indices or index-pattern(s) (containing rollup or regular data) that should be searched - -|`type` -|`string` - The doc type inside the index - -|`typed_keys` or `typedKeys` -|`boolean` - Specify whether aggregation and suggester names should be prefixed by their respective types in the response - -|`rest_total_hits_as_int` or `restTotalHitsAsInt` -|`boolean` - Indicates whether hits.total should be rendered as an integer or an object in the rest search response - -|`body` -|`object` - The search request body - -|=== - -=== rollup.startJob -[source,js] ----- -client.rollup.startJob([params] [, options] [, callback]) ----- -[cols=2*] -|=== -|`id` -|`string` - The ID of the job to start - -|=== - -=== rollup.stopJob -[source,js] ----- -client.rollup.stopJob([params] [, options] [, callback]) ----- -[cols=2*] -|=== -|`id` -|`string` - The ID of the job to stop - -|`wait_for_completion` or `waitForCompletion` -|`boolean` - True if the API should block until the job has fully stopped, false if should be executed async. Defaults to false. - -|`timeout` -|`string` - Block for (at maximum) the specified duration while waiting for the job to stop. Defaults to 30s. - -|=== - -=== security.authenticate -[source,js] ----- -client.security.authenticate([params] [, options] [, callback]) ----- -link:{ref}/security-api-authenticate.html[Reference] - - -=== security.changePassword -[source,js] ----- -client.security.changePassword([params] [, options] [, callback]) ----- -link:{ref}/security-api-change-password.html[Reference] -[cols=2*] -|=== -|`username` -|`string` - The username of the user to change the password for - -|`refresh` -|`'true', 'false', 'wait_for'` - If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. - -|`body` -|`object` - the new password for the user - -|=== - -=== security.clearCachedRealms -[source,js] ----- -client.security.clearCachedRealms([params] [, options] [, callback]) ----- -link:{ref}/security-api-clear-cache.html[Reference] -[cols=2*] -|=== -|`realms` -|`string, string[]` - Comma-separated list of realms to clear - -|`usernames` -|`string, string[]` - Comma-separated list of usernames to clear from the cache - -|=== - -=== security.clearCachedRoles -[source,js] ----- -client.security.clearCachedRoles([params] [, options] [, callback]) ----- -link:{ref}/security-api-clear-role-cache.html[Reference] -[cols=2*] -|=== -|`name` -|`string, string[]` - Role name - -|=== - -=== security.createApiKey -[source,js] ----- -client.security.createApiKey([params] [, options] [, callback]) ----- -link:{ref}/security-api-create-api-key.html[Reference] -[cols=2*] -|=== -|`refresh` -|`'true', 'false', 'wait_for'` - If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. - -|`body` -|`object` - The api key request to create an API key - -|=== - -=== security.deletePrivileges -[source,js] ----- -client.security.deletePrivileges([params] [, options] [, callback]) ----- -link:TODO[Reference] -[cols=2*] -|=== -|`application` -|`string` - Application name - -|`name` -|`string` - Privilege name - -|`refresh` -|`'true', 'false', 'wait_for'` - If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. - -|=== - -=== security.deleteRole -[source,js] ----- -client.security.deleteRole([params] [, options] [, callback]) ----- -link:{ref}/security-api-delete-role.html[Reference] -[cols=2*] -|=== -|`name` -|`string` - Role name - -|`refresh` -|`'true', 'false', 'wait_for'` - If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. - -|=== - -=== security.deleteRoleMapping -[source,js] ----- -client.security.deleteRoleMapping([params] [, options] [, callback]) ----- -link:{ref}/security-api-delete-role-mapping.html[Reference] -[cols=2*] -|=== -|`name` -|`string` - Role-mapping name - -|`refresh` -|`'true', 'false', 'wait_for'` - If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. - -|=== - -=== security.deleteUser -[source,js] ----- -client.security.deleteUser([params] [, options] [, callback]) ----- -link:{ref}/security-api-delete-user.html[Reference] -[cols=2*] -|=== -|`username` -|`string` - username - -|`refresh` -|`'true', 'false', 'wait_for'` - If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. - -|=== - -=== security.disableUser -[source,js] ----- -client.security.disableUser([params] [, options] [, callback]) ----- -link:{ref}/security-api-disable-user.html[Reference] -[cols=2*] -|=== -|`username` -|`string` - The username of the user to disable - -|`refresh` -|`'true', 'false', 'wait_for'` - If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. - -|=== - -=== security.enableUser -[source,js] ----- -client.security.enableUser([params] [, options] [, callback]) ----- -link:{ref}/security-api-enable-user.html[Reference] -[cols=2*] -|=== -|`username` -|`string` - The username of the user to enable - -|`refresh` -|`'true', 'false', 'wait_for'` - If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. - -|=== - -=== security.getApiKey -[source,js] ----- -client.security.getApiKey([params] [, options] [, callback]) ----- -link:{ref}/security-api-get-api-key.html[Reference] -[cols=2*] -|=== -|`id` -|`string` - API key id of the API key to be retrieved - -|`name` -|`string` - API key name of the API key to be retrieved - -|`username` -|`string` - user name of the user who created this API key to be retrieved - -|`realm_name` or `realmName` -|`string` - realm name of the user who created this API key to be retrieved - -|=== - -=== security.getPrivileges -[source,js] ----- -client.security.getPrivileges([params] [, options] [, callback]) ----- -link:TODO[Reference] -[cols=2*] -|=== -|`application` -|`string` - Application name - -|`name` -|`string` - Privilege name - -|=== - -=== security.getRole -[source,js] ----- -client.security.getRole([params] [, options] [, callback]) ----- -link:{ref}/security-api-get-role.html[Reference] -[cols=2*] -|=== -|`name` -|`string` - Role name - -|=== - -=== security.getRoleMapping -[source,js] ----- -client.security.getRoleMapping([params] [, options] [, callback]) ----- -link:{ref}/security-api-get-role-mapping.html[Reference] -[cols=2*] -|=== -|`name` -|`string` - Role-Mapping name - -|=== - -=== security.getToken -[source,js] ----- -client.security.getToken([params] [, options] [, callback]) ----- -link:{ref}/security-api-get-token.html[Reference] -[cols=2*] -|=== -|`body` -|`object` - The token request to get - -|=== - -=== security.getUser -[source,js] ----- -client.security.getUser([params] [, options] [, callback]) ----- -link:{ref}/security-api-get-user.html[Reference] -[cols=2*] -|=== -|`username` -|`string, string[]` - A comma-separated list of usernames - -|=== - -=== security.getUserPrivileges -[source,js] ----- -client.security.getUserPrivileges([params] [, options] [, callback]) ----- -link:{ref}/security-api-get-privileges.html[Reference] - - -=== security.hasPrivileges -[source,js] ----- -client.security.hasPrivileges([params] [, options] [, callback]) ----- -link:{ref}/security-api-has-privileges.html[Reference] -[cols=2*] -|=== -|`user` -|`string` - Username - -|`body` -|`object` - The privileges to test - -|=== - -=== security.invalidateApiKey -[source,js] ----- -client.security.invalidateApiKey([params] [, options] [, callback]) ----- -link:{ref}/security-api-invalidate-api-key.html[Reference] -[cols=2*] -|=== -|`body` -|`object` - The api key request to invalidate API key(s) - -|=== - -=== security.invalidateToken -[source,js] ----- -client.security.invalidateToken([params] [, options] [, callback]) ----- -link:{ref}/security-api-invalidate-token.html[Reference] -[cols=2*] -|=== -|`body` -|`object` - The token to invalidate - -|=== - -=== security.putPrivileges -[source,js] ----- -client.security.putPrivileges([params] [, options] [, callback]) ----- -link:TODO[Reference] -[cols=2*] -|=== -|`refresh` -|`'true', 'false', 'wait_for'` - If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. - -|`body` -|`object` - The privilege(s) to add - -|=== - -=== security.putRole -[source,js] ----- -client.security.putRole([params] [, options] [, callback]) ----- -link:{ref}/security-api-put-role.html[Reference] -[cols=2*] -|=== -|`name` -|`string` - Role name - -|`refresh` -|`'true', 'false', 'wait_for'` - If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. - -|`body` -|`object` - The role to add - -|=== - -=== security.putRoleMapping -[source,js] ----- -client.security.putRoleMapping([params] [, options] [, callback]) ----- -link:{ref}/security-api-put-role-mapping.html[Reference] -[cols=2*] -|=== -|`name` -|`string` - Role-mapping name - -|`refresh` -|`'true', 'false', 'wait_for'` - If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. - -|`body` -|`object` - The role mapping to add - -|=== - -=== security.putUser -[source,js] ----- -client.security.putUser([params] [, options] [, callback]) ----- -link:{ref}/security-api-put-user.html[Reference] -[cols=2*] -|=== -|`username` -|`string` - The username of the User - -|`refresh` -|`'true', 'false', 'wait_for'` - If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. - -|`body` -|`object` - The user to add - -|=== - -=== sql.clearCursor -[source,js] ----- -client.sql.clearCursor([params] [, options] [, callback]) ----- -link:Clear SQL cursor[Reference] -[cols=2*] -|=== -|`body` -|`object` - Specify the cursor value in the `cursor` element to clean the cursor. - -|=== - -=== sql.query -[source,js] ----- -client.sql.query([params] [, options] [, callback]) ----- -link:Execute SQL[Reference] -[cols=2*] -|=== -|`format` -|`string` - a short version of the Accept header, e.g. json, yaml - -|`body` -|`object` - Use the `query` element to start a query. Use the `cursor` element to continue a query. - -|=== - -=== sql.translate -[source,js] ----- -client.sql.translate([params] [, options] [, callback]) ----- -link:Translate SQL into Elasticsearch queries[Reference] -[cols=2*] -|=== -|`body` -|`object` - Specify the query in the `query` element. - -|=== - -=== ssl.certificates -[source,js] ----- -client.ssl.certificates([params] [, options] [, callback]) ----- -link:{ref}/security-api-ssl.html[Reference] - - -=== watcher.ackWatch -[source,js] ----- -client.watcher.ackWatch([params] [, options] [, callback]) ----- -link:{ref}/watcher-api-ack-watch.html[Reference] -[cols=2*] -|=== -|`watch_id` or `watchId` -|`string` - Watch ID - -|`action_id` or `actionId` -|`string, string[]` - A comma-separated list of the action ids to be acked - -|=== - -=== watcher.activateWatch -[source,js] ----- -client.watcher.activateWatch([params] [, options] [, callback]) ----- -link:{ref}/watcher-api-activate-watch.html[Reference] -[cols=2*] -|=== -|`watch_id` or `watchId` -|`string` - Watch ID - -|=== - -=== watcher.deactivateWatch -[source,js] ----- -client.watcher.deactivateWatch([params] [, options] [, callback]) ----- -link:{ref}/watcher-api-deactivate-watch.html[Reference] -[cols=2*] -|=== -|`watch_id` or `watchId` -|`string` - Watch ID - -|=== - -=== watcher.deleteWatch -[source,js] ----- -client.watcher.deleteWatch([params] [, options] [, callback]) ----- -link:{ref}/watcher-api-delete-watch.html[Reference] -[cols=2*] -|=== -|`id` -|`string` - Watch ID - -|=== - -=== watcher.executeWatch -[source,js] ----- -client.watcher.executeWatch([params] [, options] [, callback]) ----- -link:{ref}/watcher-api-execute-watch.html[Reference] -[cols=2*] -|=== -|`id` -|`string` - Watch ID - -|`debug` -|`boolean` - indicates whether the watch should execute in debug mode - -|`body` -|`object` - Execution control - -|=== - -=== watcher.getWatch -[source,js] ----- -client.watcher.getWatch([params] [, options] [, callback]) ----- -link:{ref}/watcher-api-get-watch.html[Reference] -[cols=2*] -|=== -|`id` -|`string` - Watch ID - -|=== - -=== watcher.putWatch -[source,js] ----- -client.watcher.putWatch([params] [, options] [, callback]) ----- -link:{ref}/watcher-api-put-watch.html[Reference] -[cols=2*] -|=== -|`id` -|`string` - Watch ID - -|`active` -|`boolean` - Specify whether the watch is in/active by default - -|`version` -|`number` - Explicit version number for concurrency control - -|`if_seq_no` or `ifSeqNo` -|`number` - only update the watch if the last operation that has changed the watch has the specified sequence number - -|`if_primary_term` or `ifPrimaryTerm` -|`number` - only update the watch if the last operation that has changed the watch has the specified primary term - -|`body` -|`object` - The watch - -|=== - -=== watcher.start -[source,js] ----- -client.watcher.start([params] [, options] [, callback]) ----- -link:{ref}/watcher-api-start.html[Reference] - - -=== watcher.stats -[source,js] ----- -client.watcher.stats([params] [, options] [, callback]) ----- -link:{ref}/watcher-api-stats.html[Reference] -[cols=2*] -|=== -|`metric` -|`string, string[]` - Controls what additional stat metrics should be include in the response - -|`metric` -|`string, string[]` - Controls what additional stat metrics should be include in the response - -|`emit_stacktraces` or `emitStacktraces` -|`boolean` - Emits stack traces of currently running watches - -|=== - -=== watcher.stop -[source,js] ----- -client.watcher.stop([params] [, options] [, callback]) ----- -link:{ref}/watcher-api-stop.html[Reference] - - -=== xpack.info -[source,js] ----- -client.xpack.info([params] [, options] [, callback]) ----- -link:{ref}/info-api.html[Reference] -[cols=2*] -|=== -|`categories` -|`string, string[]` - Comma-separated list of info categories. Can be any of: build, license, features - -|=== - -=== xpack.usage -[source,js] ----- -client.xpack.usage([params] [, options] [, callback]) ----- -link:Retrieve information about xpack features usage[Reference] -[cols=2*] -|=== -|`master_timeout` or `masterTimeout` -|`string` - Specify timeout for watch write operation - -|=== ->>>>>>> a21281f... Improve typings (#813)