Skip to content

Commit fbaa502

Browse files
committed
API generation
1 parent afc6249 commit fbaa502

File tree

6 files changed

+115
-5
lines changed

6 files changed

+115
-5
lines changed

api/api/indices.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1548,6 +1548,33 @@ IndicesApi.prototype.getDataStream = function indicesGetDataStreamApi (params, o
15481548
return this.transport.request(request, options, callback)
15491549
}
15501550

1551+
IndicesApi.prototype.promoteDataStream = function indicesPromoteDataStreamApi (params, options, callback) {
1552+
;[params, options, callback] = normalizeArguments(params, options, callback)
1553+
1554+
// check required parameters
1555+
if (params['name'] == null) {
1556+
const err = new this[kConfigurationError]('Missing required parameter: name')
1557+
return handleError(err, callback)
1558+
}
1559+
1560+
var { method, body, name, ...querystring } = params
1561+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
1562+
1563+
var path = ''
1564+
if (method == null) method = 'POST'
1565+
path = '/' + '_data_stream' + '/' + '_promote' + '/' + encodeURIComponent(name)
1566+
1567+
// build request object
1568+
const request = {
1569+
method,
1570+
path,
1571+
body: body || '',
1572+
querystring
1573+
}
1574+
1575+
return this.transport.request(request, options, callback)
1576+
}
1577+
15511578
IndicesApi.prototype.reloadSearchAnalyzers = function indicesReloadSearchAnalyzersApi (params, options, callback) {
15521579
;[params, options, callback] = normalizeArguments(params, options, callback)
15531580

@@ -1635,6 +1662,7 @@ Object.defineProperties(IndicesApi.prototype, {
16351662
data_streams_stats: { get () { return this.dataStreamsStats } },
16361663
delete_data_stream: { get () { return this.deleteDataStream } },
16371664
get_data_stream: { get () { return this.getDataStream } },
1665+
promote_data_stream: { get () { return this.promoteDataStream } },
16381666
reload_search_analyzers: { get () { return this.reloadSearchAnalyzers } }
16391667
})
16401668

api/api/watcher.js

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,27 @@ WatcherApi.prototype.putWatch = function watcherPutWatchApi (params, options, ca
230230
return this.transport.request(request, options, callback)
231231
}
232232

233+
WatcherApi.prototype.queryWatches = function watcherQueryWatchesApi (params, options, callback) {
234+
;[params, options, callback] = normalizeArguments(params, options, callback)
235+
236+
var { method, body, ...querystring } = params
237+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
238+
239+
var path = ''
240+
if (method == null) method = body == null ? 'GET' : 'POST'
241+
path = '/' + '_watcher' + '/' + '_query' + '/' + 'watches'
242+
243+
// build request object
244+
const request = {
245+
method,
246+
path,
247+
body: body || '',
248+
querystring
249+
}
250+
251+
return this.transport.request(request, options, callback)
252+
}
253+
233254
WatcherApi.prototype.start = function watcherStartApi (params, options, callback) {
234255
;[params, options, callback] = normalizeArguments(params, options, callback)
235256

@@ -305,7 +326,8 @@ Object.defineProperties(WatcherApi.prototype, {
305326
delete_watch: { get () { return this.deleteWatch } },
306327
execute_watch: { get () { return this.executeWatch } },
307328
get_watch: { get () { return this.getWatch } },
308-
put_watch: { get () { return this.putWatch } }
329+
put_watch: { get () { return this.putWatch } },
330+
query_watches: { get () { return this.queryWatches } }
309331
})
310332

311333
module.exports = WatcherApi

api/kibana.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ interface KibanaClient {
230230
getTemplate<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesGetTemplate, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
231231
getUpgrade<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesGetUpgrade, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
232232
open<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesOpen, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
233+
promoteDataStream<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesPromoteDataStream, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
233234
putAlias<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesPutAlias<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
234235
putIndexTemplate<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesPutIndexTemplate<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
235236
putMapping<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesPutMapping<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
@@ -468,6 +469,7 @@ interface KibanaClient {
468469
executeWatch<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.WatcherExecuteWatch<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
469470
getWatch<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.WatcherGetWatch, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
470471
putWatch<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.WatcherPutWatch<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
472+
queryWatches<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.WatcherQueryWatches<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
471473
start<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.WatcherStart, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
472474
stats<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.WatcherStats, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
473475
stop<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.WatcherStop, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>

api/requestParams.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1168,6 +1168,10 @@ export interface IndicesOpen extends Generic {
11681168
wait_for_active_shards?: string;
11691169
}
11701170

1171+
export interface IndicesPromoteDataStream extends Generic {
1172+
name: string;
1173+
}
1174+
11711175
export interface IndicesPutAlias<T = RequestBody> extends Generic {
11721176
index: string | string[];
11731177
name: string;
@@ -2618,6 +2622,10 @@ export interface WatcherPutWatch<T = RequestBody> extends Generic {
26182622
body?: T;
26192623
}
26202624

2625+
export interface WatcherQueryWatches<T = RequestBody> extends Generic {
2626+
body?: T;
2627+
}
2628+
26212629
export interface WatcherStart extends Generic {
26222630
}
26232631

docs/reference.asciidoc

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4854,6 +4854,23 @@ _Default:_ `closed`
48544854

48554855
|===
48564856

4857+
[discrete]
4858+
=== indices.promoteDataStream
4859+
4860+
[source,ts]
4861+
----
4862+
client.indices.promoteDataStream({
4863+
name: string
4864+
})
4865+
----
4866+
link:{ref}/data-streams.html[Documentation] +
4867+
[cols=2*]
4868+
|===
4869+
|`name`
4870+
|`string` - The name of the data stream
4871+
4872+
|===
4873+
48574874
[discrete]
48584875
=== indices.putAlias
48594876

@@ -8468,7 +8485,7 @@ client.rollup.rollup({
84688485
body: object
84698486
})
84708487
----
8471-
link:{ref}/xpack-rollup.html[Documentation] +
8488+
link:{ref}/rollup-api.html[Documentation] +
84728489
[cols=2*]
84738490
|===
84748491
|`index`
@@ -10105,7 +10122,7 @@ link:{ref}/security-api-ssl.html[Documentation] +
1010510122

1010610123
[discrete]
1010710124
=== tasks.cancel
10108-
10125+
*Stability:* experimental
1010910126
[source,ts]
1011010127
----
1011110128
client.tasks.cancel({
@@ -10138,7 +10155,7 @@ link:{ref}/tasks.html[Documentation] +
1013810155

1013910156
[discrete]
1014010157
=== tasks.get
10141-
10158+
*Stability:* experimental
1014210159
[source,ts]
1014310160
----
1014410161
client.tasks.get({
@@ -10163,7 +10180,7 @@ link:{ref}/tasks.html[Documentation] +
1016310180

1016410181
[discrete]
1016510182
=== tasks.list
10166-
10183+
*Stability:* experimental
1016710184
[source,ts]
1016810185
----
1016910186
client.tasks.list({
@@ -10913,6 +10930,23 @@ link:{ref}/watcher-api-put-watch.html[Documentation] +
1091310930

1091410931
|===
1091510932

10933+
[discrete]
10934+
=== watcher.queryWatches
10935+
10936+
[source,ts]
10937+
----
10938+
client.watcher.queryWatches({
10939+
body: object
10940+
})
10941+
----
10942+
link:{ref}/watcher-api-query-watches.html[Documentation] +
10943+
[cols=2*]
10944+
|===
10945+
|`body`
10946+
|`object` - From, size, query, sort and search_after
10947+
10948+
|===
10949+
1091610950
[discrete]
1091710951
=== watcher.start
1091810952

index.d.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,6 +1048,14 @@ declare class Client {
10481048
open<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
10491049
open<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.IndicesOpen, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
10501050
open<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.IndicesOpen, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1051+
promote_data_stream<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesPromoteDataStream, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
1052+
promote_data_stream<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1053+
promote_data_stream<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.IndicesPromoteDataStream, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1054+
promote_data_stream<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.IndicesPromoteDataStream, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1055+
promoteDataStream<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesPromoteDataStream, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
1056+
promoteDataStream<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1057+
promoteDataStream<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.IndicesPromoteDataStream, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1058+
promoteDataStream<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.IndicesPromoteDataStream, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
10511059
put_alias<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesPutAlias<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
10521060
put_alias<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
10531061
put_alias<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.IndicesPutAlias<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
@@ -2558,6 +2566,14 @@ declare class Client {
25582566
putWatch<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
25592567
putWatch<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.WatcherPutWatch<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
25602568
putWatch<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.WatcherPutWatch<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
2569+
query_watches<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.WatcherQueryWatches<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
2570+
query_watches<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
2571+
query_watches<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.WatcherQueryWatches<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
2572+
query_watches<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.WatcherQueryWatches<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
2573+
queryWatches<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.WatcherQueryWatches<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
2574+
queryWatches<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
2575+
queryWatches<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.WatcherQueryWatches<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
2576+
queryWatches<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.WatcherQueryWatches<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
25612577
start<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.WatcherStart, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
25622578
start<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
25632579
start<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.WatcherStart, callback: callbackFn<TResponse, TContext>): TransportRequestCallback

0 commit comments

Comments
 (0)