diff --git a/api/api/async_search.js b/api/api/async_search.js index 0a16b39da..d7f719305 100644 --- a/api/api/async_search.js +++ b/api/api/async_search.js @@ -85,6 +85,33 @@ AsyncSearchApi.prototype.get = function asyncSearchGetApi (params, options, call return this.transport.request(request, options, callback) } +AsyncSearchApi.prototype.status = function asyncSearchStatusApi (params, options, callback) { + ;[params, options, callback] = normalizeArguments(params, options, callback) + + // check required parameters + if (params['id'] == null) { + const err = new this[kConfigurationError]('Missing required parameter: id') + return handleError(err, callback) + } + + var { method, body, id, ...querystring } = params + querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) + + var path = '' + if (method == null) method = 'GET' + path = '/' + '_async_search' + '/' + 'status' + '/' + encodeURIComponent(id) + + // build request object + const request = { + method, + path, + body: null, + querystring + } + + return this.transport.request(request, options, callback) +} + AsyncSearchApi.prototype.submit = function asyncSearchSubmitApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) diff --git a/api/api/indices.js b/api/api/indices.js index 9436f6708..c26897e10 100644 --- a/api/api/indices.js +++ b/api/api/indices.js @@ -777,13 +777,8 @@ IndicesApi.prototype.getUpgrade = function indicesGetUpgradeApi (params, options querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) var path = '' - if ((index) != null) { - if (method == null) method = 'GET' - path = '/' + encodeURIComponent(index) + '/' + '_upgrade' - } else { - if (method == null) method = 'GET' - path = '/' + '_upgrade' - } + if (method == null) method = 'GET' + path = '/' + encodeURIComponent(index) + '/' + '_upgrade' // build request object const request = { @@ -1371,13 +1366,8 @@ IndicesApi.prototype.upgrade = function indicesUpgradeApi (params, options, call querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) var path = '' - if ((index) != null) { - if (method == null) method = 'POST' - path = '/' + encodeURIComponent(index) + '/' + '_upgrade' - } else { - if (method == null) method = 'POST' - path = '/' + '_upgrade' - } + if (method == null) method = 'POST' + path = '/' + encodeURIComponent(index) + '/' + '_upgrade' // build request object const request = { diff --git a/api/kibana.d.ts b/api/kibana.d.ts index 1d4f6ba57..ad78a0363 100644 --- a/api/kibana.d.ts +++ b/api/kibana.d.ts @@ -78,6 +78,7 @@ interface KibanaClient { asyncSearch: { delete, TContext = Context>(params?: RequestParams.AsyncSearchDelete, options?: TransportRequestOptions): TransportRequestPromise> get, TContext = Context>(params?: RequestParams.AsyncSearchGet, options?: TransportRequestOptions): TransportRequestPromise> + status, TContext = Context>(params?: RequestParams.AsyncSearchStatus, options?: TransportRequestOptions): TransportRequestPromise> submit, TRequestBody extends RequestBody = Record, TContext = Context>(params?: RequestParams.AsyncSearchSubmit, options?: TransportRequestOptions): TransportRequestPromise> } autoscaling: { diff --git a/api/requestParams.d.ts b/api/requestParams.d.ts index 5adf67476..7a4df07fe 100644 --- a/api/requestParams.d.ts +++ b/api/requestParams.d.ts @@ -39,6 +39,10 @@ export interface AsyncSearchGet extends Generic { typed_keys?: boolean; } +export interface AsyncSearchStatus extends Generic { + id: string; +} + export interface AsyncSearchSubmit extends Generic { index?: string | string[]; wait_for_completion_timeout?: string; @@ -978,6 +982,7 @@ export interface IndicesDeleteAlias extends Generic { export interface IndicesDeleteDataStream extends Generic { name: string | string[]; + expand_wildcards?: 'open' | 'closed' | 'hidden' | 'none' | 'all'; } export interface IndicesDeleteIndexTemplate extends Generic { @@ -1093,6 +1098,7 @@ export interface IndicesGetAlias extends Generic { export interface IndicesGetDataStream extends Generic { name?: string | string[]; + expand_wildcards?: 'open' | 'closed' | 'hidden' | 'none' | 'all'; } export interface IndicesGetFieldMapping extends Generic { diff --git a/docs/reference.asciidoc b/docs/reference.asciidoc index 6150ab345..fd9227c14 100644 --- a/docs/reference.asciidoc +++ b/docs/reference.asciidoc @@ -142,6 +142,23 @@ link:{ref}/async-search.html[Documentation] + |=== +[discrete] +=== asyncSearch.status + +[source,ts] +---- +client.asyncSearch.status({ + id: string +}) +---- +link:{ref}/async-search.html[Documentation] + +[cols=2*] +|=== +|`id` +|`string` - The async search ID + +|=== + [discrete] === asyncSearch.submit @@ -4047,7 +4064,8 @@ link:{ref}/indices-aliases.html[Documentation] + [source,ts] ---- client.indices.deleteDataStream({ - name: string | string[] + name: string | string[], + expand_wildcards: 'open' | 'closed' | 'hidden' | 'none' | 'all' }) ---- link:{ref}/data-streams.html[Documentation] + @@ -4056,6 +4074,10 @@ link:{ref}/data-streams.html[Documentation] + |`name` |`string \| string[]` - A comma-separated list of data streams to delete; use `*` to delete all data streams +|`expand_wildcards` or `expandWildcards` +|`'open' \| 'closed' \| 'hidden' \| 'none' \| 'all'` - Whether wildcard expressions should get expanded to open or closed indices (default: open) + +_Default:_ `open` + |=== [discrete] @@ -4530,7 +4552,8 @@ _Default:_ `all` [source,ts] ---- client.indices.getDataStream({ - name: string | string[] + name: string | string[], + expand_wildcards: 'open' | 'closed' | 'hidden' | 'none' | 'all' }) ---- link:{ref}/data-streams.html[Documentation] + @@ -4539,6 +4562,10 @@ link:{ref}/data-streams.html[Documentation] + |`name` |`string \| string[]` - A comma-separated list of data streams to get; use `*` to get all data streams +|`expand_wildcards` or `expandWildcards` +|`'open' \| 'closed' \| 'hidden' \| 'none' \| 'all'` - Whether wildcard expressions should get expanded to open or closed indices (default: open) + +_Default:_ `open` + |=== [discrete] diff --git a/index.d.ts b/index.d.ts index 40ecdfa97..c6848ee6b 100644 --- a/index.d.ts +++ b/index.d.ts @@ -148,6 +148,10 @@ declare class Client { get, TContext = Context>(callback: callbackFn): TransportRequestCallback get, TContext = Context>(params: RequestParams.AsyncSearchGet, callback: callbackFn): TransportRequestCallback get, TContext = Context>(params: RequestParams.AsyncSearchGet, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + status, TContext = Context>(params?: RequestParams.AsyncSearchStatus, options?: TransportRequestOptions): TransportRequestPromise> + status, TContext = Context>(callback: callbackFn): TransportRequestCallback + status, TContext = Context>(params: RequestParams.AsyncSearchStatus, callback: callbackFn): TransportRequestCallback + status, TContext = Context>(params: RequestParams.AsyncSearchStatus, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback submit, TRequestBody extends RequestBody = Record, TContext = Context>(params?: RequestParams.AsyncSearchSubmit, options?: TransportRequestOptions): TransportRequestPromise> submit, TRequestBody extends RequestBody = Record, TContext = Context>(callback: callbackFn): TransportRequestCallback submit, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.AsyncSearchSubmit, callback: callbackFn): TransportRequestCallback @@ -162,6 +166,10 @@ declare class Client { get, TContext = Context>(callback: callbackFn): TransportRequestCallback get, TContext = Context>(params: RequestParams.AsyncSearchGet, callback: callbackFn): TransportRequestCallback get, TContext = Context>(params: RequestParams.AsyncSearchGet, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + status, TContext = Context>(params?: RequestParams.AsyncSearchStatus, options?: TransportRequestOptions): TransportRequestPromise> + status, TContext = Context>(callback: callbackFn): TransportRequestCallback + status, TContext = Context>(params: RequestParams.AsyncSearchStatus, callback: callbackFn): TransportRequestCallback + status, TContext = Context>(params: RequestParams.AsyncSearchStatus, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback submit, TRequestBody extends RequestBody = Record, TContext = Context>(params?: RequestParams.AsyncSearchSubmit, options?: TransportRequestOptions): TransportRequestPromise> submit, TRequestBody extends RequestBody = Record, TContext = Context>(callback: callbackFn): TransportRequestCallback submit, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.AsyncSearchSubmit, callback: callbackFn): TransportRequestCallback