Skip to content

Commit 9fea1ae

Browse files
committed
API generation
1 parent 1398086 commit 9fea1ae

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
@@ -1481,6 +1481,33 @@ IndicesApi.prototype.migrateToDataStream = function indicesMigrateToDataStreamAp
14811481
return this.transport.request(request, options, callback)
14821482
}
14831483

1484+
IndicesApi.prototype.promoteDataStream = function indicesPromoteDataStreamApi (params, options, callback) {
1485+
;[params, options, callback] = normalizeArguments(params, options, callback)
1486+
1487+
// check required parameters
1488+
if (params['name'] == null) {
1489+
const err = new this[kConfigurationError]('Missing required parameter: name')
1490+
return handleError(err, callback)
1491+
}
1492+
1493+
var { method, body, name, ...querystring } = params
1494+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
1495+
1496+
var path = ''
1497+
if (method == null) method = 'POST'
1498+
path = '/' + '_data_stream' + '/' + '_promote' + '/' + encodeURIComponent(name)
1499+
1500+
// build request object
1501+
const request = {
1502+
method,
1503+
path,
1504+
body: body || '',
1505+
querystring
1506+
}
1507+
1508+
return this.transport.request(request, options, callback)
1509+
}
1510+
14841511
IndicesApi.prototype.reloadSearchAnalyzers = function indicesReloadSearchAnalyzersApi (params, options, callback) {
14851512
;[params, options, callback] = normalizeArguments(params, options, callback)
14861513

@@ -1567,6 +1594,7 @@ Object.defineProperties(IndicesApi.prototype, {
15671594
delete_data_stream: { get () { return this.deleteDataStream } },
15681595
get_data_stream: { get () { return this.getDataStream } },
15691596
migrate_to_data_stream: { get () { return this.migrateToDataStream } },
1597+
promote_data_stream: { get () { return this.promoteDataStream } },
15701598
reload_search_analyzers: { get () { return this.reloadSearchAnalyzers } }
15711599
})
15721600

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
@@ -229,6 +229,7 @@ interface KibanaClient {
229229
getTemplate<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesGetTemplate, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
230230
migrateToDataStream<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesMigrateToDataStream, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
231231
open<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesOpen, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
232+
promoteDataStream<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesPromoteDataStream, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
232233
putAlias<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesPutAlias<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
233234
putIndexTemplate<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesPutIndexTemplate<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
234235
putMapping<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesPutMapping<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
@@ -465,6 +466,7 @@ interface KibanaClient {
465466
executeWatch<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.WatcherExecuteWatch<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
466467
getWatch<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.WatcherGetWatch, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
467468
putWatch<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.WatcherPutWatch<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
469+
queryWatches<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.WatcherQueryWatches<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
468470
start<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.WatcherStart, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
469471
stats<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.WatcherStats, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
470472
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
@@ -1155,6 +1155,10 @@ export interface IndicesOpen extends Generic {
11551155
wait_for_active_shards?: string;
11561156
}
11571157

1158+
export interface IndicesPromoteDataStream extends Generic {
1159+
name: string;
1160+
}
1161+
11581162
export interface IndicesPutAlias<T = RequestBody> extends Generic {
11591163
index: string | string[];
11601164
name: string;
@@ -2585,6 +2589,10 @@ export interface WatcherPutWatch<T = RequestBody> extends Generic {
25852589
body?: T;
25862590
}
25872591

2592+
export interface WatcherQueryWatches<T = RequestBody> extends Generic {
2593+
body?: T;
2594+
}
2595+
25882596
export interface WatcherStart extends Generic {
25892597
}
25902598

docs/reference.asciidoc

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

47124712
|===
47134713

4714+
[discrete]
4715+
=== indices.promoteDataStream
4716+
4717+
[source,ts]
4718+
----
4719+
client.indices.promoteDataStream({
4720+
name: string
4721+
})
4722+
----
4723+
link:{ref}/data-streams.html[Documentation] +
4724+
[cols=2*]
4725+
|===
4726+
|`name`
4727+
|`string` - The name of the data stream
4728+
4729+
|===
4730+
47144731
[discrete]
47154732
=== indices.putAlias
47164733

@@ -8245,7 +8262,7 @@ client.rollup.rollup({
82458262
body: object
82468263
})
82478264
----
8248-
link:{ref}/xpack-rollup.html[Documentation] +
8265+
link:{ref}/rollup-api.html[Documentation] +
82498266
[cols=2*]
82508267
|===
82518268
|`index`
@@ -9857,7 +9874,7 @@ link:{ref}/security-api-ssl.html[Documentation] +
98579874

98589875
[discrete]
98599876
=== tasks.cancel
9860-
9877+
*Stability:* experimental
98619878
[source,ts]
98629879
----
98639880
client.tasks.cancel({
@@ -9890,7 +9907,7 @@ link:{ref}/tasks.html[Documentation] +
98909907

98919908
[discrete]
98929909
=== tasks.get
9893-
9910+
*Stability:* experimental
98949911
[source,ts]
98959912
----
98969913
client.tasks.get({
@@ -9915,7 +9932,7 @@ link:{ref}/tasks.html[Documentation] +
99159932

99169933
[discrete]
99179934
=== tasks.list
9918-
9935+
*Stability:* experimental
99199936
[source,ts]
99209937
----
99219938
client.tasks.list({
@@ -10653,6 +10670,23 @@ link:{ref}/watcher-api-put-watch.html[Documentation] +
1065310670

1065410671
|===
1065510672

10673+
[discrete]
10674+
=== watcher.queryWatches
10675+
10676+
[source,ts]
10677+
----
10678+
client.watcher.queryWatches({
10679+
body: object
10680+
})
10681+
----
10682+
link:{ref}/watcher-api-query-watches.html[Documentation] +
10683+
[cols=2*]
10684+
|===
10685+
|`body`
10686+
|`object` - From, size, query, sort and search_after
10687+
10688+
|===
10689+
1065610690
[discrete]
1065710691
=== watcher.start
1065810692

index.d.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,6 +1040,14 @@ declare class Client {
10401040
open<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
10411041
open<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.IndicesOpen, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
10421042
open<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.IndicesOpen, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1043+
promote_data_stream<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesPromoteDataStream, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
1044+
promote_data_stream<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1045+
promote_data_stream<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.IndicesPromoteDataStream, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1046+
promote_data_stream<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.IndicesPromoteDataStream, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1047+
promoteDataStream<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesPromoteDataStream, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
1048+
promoteDataStream<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1049+
promoteDataStream<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.IndicesPromoteDataStream, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1050+
promoteDataStream<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.IndicesPromoteDataStream, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
10431051
put_alias<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesPutAlias<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
10441052
put_alias<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
10451053
put_alias<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.IndicesPutAlias<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
@@ -2530,6 +2538,14 @@ declare class Client {
25302538
putWatch<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
25312539
putWatch<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.WatcherPutWatch<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
25322540
putWatch<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.WatcherPutWatch<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
2541+
query_watches<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.WatcherQueryWatches<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
2542+
query_watches<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
2543+
query_watches<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.WatcherQueryWatches<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
2544+
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
2545+
queryWatches<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.WatcherQueryWatches<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
2546+
queryWatches<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
2547+
queryWatches<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.WatcherQueryWatches<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
2548+
queryWatches<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.WatcherQueryWatches<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
25332549
start<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.WatcherStart, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
25342550
start<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
25352551
start<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.WatcherStart, callback: callbackFn<TResponse, TContext>): TransportRequestCallback

0 commit comments

Comments
 (0)