From fbaa502cd377da4ffd39500ebd58c184c5a5523d Mon Sep 17 00:00:00 2001 From: delvedor Date: Wed, 9 Dec 2020 11:40:19 +0100 Subject: [PATCH] API generation --- api/api/indices.js | 28 +++++++++++++++++++++++++++ api/api/watcher.js | 24 ++++++++++++++++++++++- api/kibana.d.ts | 2 ++ api/requestParams.d.ts | 8 ++++++++ docs/reference.asciidoc | 42 +++++++++++++++++++++++++++++++++++++---- index.d.ts | 16 ++++++++++++++++ 6 files changed, 115 insertions(+), 5 deletions(-) diff --git a/api/api/indices.js b/api/api/indices.js index c26897e10..2e579feb5 100644 --- a/api/api/indices.js +++ b/api/api/indices.js @@ -1548,6 +1548,33 @@ IndicesApi.prototype.getDataStream = function indicesGetDataStreamApi (params, o return this.transport.request(request, options, callback) } +IndicesApi.prototype.promoteDataStream = function indicesPromoteDataStreamApi (params, options, callback) { + ;[params, options, callback] = normalizeArguments(params, options, callback) + + // check required parameters + if (params['name'] == null) { + const err = new this[kConfigurationError]('Missing required parameter: name') + return handleError(err, callback) + } + + var { method, body, name, ...querystring } = params + querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) + + var path = '' + if (method == null) method = 'POST' + path = '/' + '_data_stream' + '/' + '_promote' + '/' + encodeURIComponent(name) + + // build request object + const request = { + method, + path, + body: body || '', + querystring + } + + return this.transport.request(request, options, callback) +} + IndicesApi.prototype.reloadSearchAnalyzers = function indicesReloadSearchAnalyzersApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) @@ -1635,6 +1662,7 @@ Object.defineProperties(IndicesApi.prototype, { data_streams_stats: { get () { return this.dataStreamsStats } }, delete_data_stream: { get () { return this.deleteDataStream } }, get_data_stream: { get () { return this.getDataStream } }, + promote_data_stream: { get () { return this.promoteDataStream } }, reload_search_analyzers: { get () { return this.reloadSearchAnalyzers } } }) diff --git a/api/api/watcher.js b/api/api/watcher.js index ba1236e00..ae3e78dc4 100644 --- a/api/api/watcher.js +++ b/api/api/watcher.js @@ -230,6 +230,27 @@ WatcherApi.prototype.putWatch = function watcherPutWatchApi (params, options, ca return this.transport.request(request, options, callback) } +WatcherApi.prototype.queryWatches = function watcherQueryWatchesApi (params, options, callback) { + ;[params, options, callback] = normalizeArguments(params, options, callback) + + var { method, body, ...querystring } = params + querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) + + var path = '' + if (method == null) method = body == null ? 'GET' : 'POST' + path = '/' + '_watcher' + '/' + '_query' + '/' + 'watches' + + // build request object + const request = { + method, + path, + body: body || '', + querystring + } + + return this.transport.request(request, options, callback) +} + WatcherApi.prototype.start = function watcherStartApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) @@ -305,7 +326,8 @@ Object.defineProperties(WatcherApi.prototype, { delete_watch: { get () { return this.deleteWatch } }, execute_watch: { get () { return this.executeWatch } }, get_watch: { get () { return this.getWatch } }, - put_watch: { get () { return this.putWatch } } + put_watch: { get () { return this.putWatch } }, + query_watches: { get () { return this.queryWatches } } }) module.exports = WatcherApi diff --git a/api/kibana.d.ts b/api/kibana.d.ts index 34a05d3f5..3d11f5675 100644 --- a/api/kibana.d.ts +++ b/api/kibana.d.ts @@ -230,6 +230,7 @@ interface KibanaClient { getTemplate, TContext = Context>(params?: RequestParams.IndicesGetTemplate, options?: TransportRequestOptions): TransportRequestPromise> getUpgrade, TContext = Context>(params?: RequestParams.IndicesGetUpgrade, options?: TransportRequestOptions): TransportRequestPromise> open, TContext = Context>(params?: RequestParams.IndicesOpen, options?: TransportRequestOptions): TransportRequestPromise> + promoteDataStream, TContext = Context>(params?: RequestParams.IndicesPromoteDataStream, options?: TransportRequestOptions): TransportRequestPromise> putAlias, TRequestBody extends RequestBody = Record, TContext = Context>(params?: RequestParams.IndicesPutAlias, options?: TransportRequestOptions): TransportRequestPromise> putIndexTemplate, TRequestBody extends RequestBody = Record, TContext = Context>(params?: RequestParams.IndicesPutIndexTemplate, options?: TransportRequestOptions): TransportRequestPromise> putMapping, TRequestBody extends RequestBody = Record, TContext = Context>(params?: RequestParams.IndicesPutMapping, options?: TransportRequestOptions): TransportRequestPromise> @@ -468,6 +469,7 @@ interface KibanaClient { executeWatch, TRequestBody extends RequestBody = Record, TContext = Context>(params?: RequestParams.WatcherExecuteWatch, options?: TransportRequestOptions): TransportRequestPromise> getWatch, TContext = Context>(params?: RequestParams.WatcherGetWatch, options?: TransportRequestOptions): TransportRequestPromise> putWatch, TRequestBody extends RequestBody = Record, TContext = Context>(params?: RequestParams.WatcherPutWatch, options?: TransportRequestOptions): TransportRequestPromise> + queryWatches, TRequestBody extends RequestBody = Record, TContext = Context>(params?: RequestParams.WatcherQueryWatches, options?: TransportRequestOptions): TransportRequestPromise> start, TContext = Context>(params?: RequestParams.WatcherStart, options?: TransportRequestOptions): TransportRequestPromise> stats, TContext = Context>(params?: RequestParams.WatcherStats, options?: TransportRequestOptions): TransportRequestPromise> stop, TContext = Context>(params?: RequestParams.WatcherStop, options?: TransportRequestOptions): TransportRequestPromise> diff --git a/api/requestParams.d.ts b/api/requestParams.d.ts index 2a47d4006..a222ed5e2 100644 --- a/api/requestParams.d.ts +++ b/api/requestParams.d.ts @@ -1168,6 +1168,10 @@ export interface IndicesOpen extends Generic { wait_for_active_shards?: string; } +export interface IndicesPromoteDataStream extends Generic { + name: string; +} + export interface IndicesPutAlias extends Generic { index: string | string[]; name: string; @@ -2618,6 +2622,10 @@ export interface WatcherPutWatch extends Generic { body?: T; } +export interface WatcherQueryWatches extends Generic { + body?: T; +} + export interface WatcherStart extends Generic { } diff --git a/docs/reference.asciidoc b/docs/reference.asciidoc index 5eb3da657..7631118b8 100644 --- a/docs/reference.asciidoc +++ b/docs/reference.asciidoc @@ -4854,6 +4854,23 @@ _Default:_ `closed` |=== +[discrete] +=== indices.promoteDataStream + +[source,ts] +---- +client.indices.promoteDataStream({ + name: string +}) +---- +link:{ref}/data-streams.html[Documentation] + +[cols=2*] +|=== +|`name` +|`string` - The name of the data stream + +|=== + [discrete] === indices.putAlias @@ -8468,7 +8485,7 @@ client.rollup.rollup({ body: object }) ---- -link:{ref}/xpack-rollup.html[Documentation] + +link:{ref}/rollup-api.html[Documentation] + [cols=2*] |=== |`index` @@ -10105,7 +10122,7 @@ link:{ref}/security-api-ssl.html[Documentation] + [discrete] === tasks.cancel - +*Stability:* experimental [source,ts] ---- client.tasks.cancel({ @@ -10138,7 +10155,7 @@ link:{ref}/tasks.html[Documentation] + [discrete] === tasks.get - +*Stability:* experimental [source,ts] ---- client.tasks.get({ @@ -10163,7 +10180,7 @@ link:{ref}/tasks.html[Documentation] + [discrete] === tasks.list - +*Stability:* experimental [source,ts] ---- client.tasks.list({ @@ -10913,6 +10930,23 @@ link:{ref}/watcher-api-put-watch.html[Documentation] + |=== +[discrete] +=== watcher.queryWatches + +[source,ts] +---- +client.watcher.queryWatches({ + body: object +}) +---- +link:{ref}/watcher-api-query-watches.html[Documentation] + +[cols=2*] +|=== +|`body` +|`object` - From, size, query, sort and search_after + +|=== + [discrete] === watcher.start diff --git a/index.d.ts b/index.d.ts index 5ee9d6a0e..d46118fc1 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1048,6 +1048,14 @@ declare class Client { open, TContext = Context>(callback: callbackFn): TransportRequestCallback open, TContext = Context>(params: RequestParams.IndicesOpen, callback: callbackFn): TransportRequestCallback open, TContext = Context>(params: RequestParams.IndicesOpen, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + promote_data_stream, TContext = Context>(params?: RequestParams.IndicesPromoteDataStream, options?: TransportRequestOptions): TransportRequestPromise> + promote_data_stream, TContext = Context>(callback: callbackFn): TransportRequestCallback + promote_data_stream, TContext = Context>(params: RequestParams.IndicesPromoteDataStream, callback: callbackFn): TransportRequestCallback + promote_data_stream, TContext = Context>(params: RequestParams.IndicesPromoteDataStream, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + promoteDataStream, TContext = Context>(params?: RequestParams.IndicesPromoteDataStream, options?: TransportRequestOptions): TransportRequestPromise> + promoteDataStream, TContext = Context>(callback: callbackFn): TransportRequestCallback + promoteDataStream, TContext = Context>(params: RequestParams.IndicesPromoteDataStream, callback: callbackFn): TransportRequestCallback + promoteDataStream, TContext = Context>(params: RequestParams.IndicesPromoteDataStream, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback put_alias, TRequestBody extends RequestBody = Record, TContext = Context>(params?: RequestParams.IndicesPutAlias, options?: TransportRequestOptions): TransportRequestPromise> put_alias, TRequestBody extends RequestBody = Record, TContext = Context>(callback: callbackFn): TransportRequestCallback put_alias, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.IndicesPutAlias, callback: callbackFn): TransportRequestCallback @@ -2558,6 +2566,14 @@ declare class Client { putWatch, TRequestBody extends RequestBody = Record, TContext = Context>(callback: callbackFn): TransportRequestCallback putWatch, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.WatcherPutWatch, callback: callbackFn): TransportRequestCallback putWatch, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.WatcherPutWatch, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + query_watches, TRequestBody extends RequestBody = Record, TContext = Context>(params?: RequestParams.WatcherQueryWatches, options?: TransportRequestOptions): TransportRequestPromise> + query_watches, TRequestBody extends RequestBody = Record, TContext = Context>(callback: callbackFn): TransportRequestCallback + query_watches, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.WatcherQueryWatches, callback: callbackFn): TransportRequestCallback + query_watches, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.WatcherQueryWatches, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + queryWatches, TRequestBody extends RequestBody = Record, TContext = Context>(params?: RequestParams.WatcherQueryWatches, options?: TransportRequestOptions): TransportRequestPromise> + queryWatches, TRequestBody extends RequestBody = Record, TContext = Context>(callback: callbackFn): TransportRequestCallback + queryWatches, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.WatcherQueryWatches, callback: callbackFn): TransportRequestCallback + queryWatches, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.WatcherQueryWatches, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback start, TContext = Context>(params?: RequestParams.WatcherStart, options?: TransportRequestOptions): TransportRequestPromise> start, TContext = Context>(callback: callbackFn): TransportRequestCallback start, TContext = Context>(params: RequestParams.WatcherStart, callback: callbackFn): TransportRequestCallback