Skip to content

Commit 79658b1

Browse files
committed
API generation
1 parent 19acc4f commit 79658b1

File tree

7 files changed

+121
-2
lines changed

7 files changed

+121
-2
lines changed

Diff for: api/api/eql.js

+31
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,33 @@ EqlApi.prototype.get = function eqlGetApi (params, options, callback) {
8585
return this.transport.request(request, options, callback)
8686
}
8787

88+
EqlApi.prototype.getStatus = function eqlGetStatusApi (params, options, callback) {
89+
;[params, options, callback] = normalizeArguments(params, options, callback)
90+
91+
// check required parameters
92+
if (params['id'] == null) {
93+
const err = new this[kConfigurationError]('Missing required parameter: id')
94+
return handleError(err, callback)
95+
}
96+
97+
var { method, body, id, ...querystring } = params
98+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
99+
100+
var path = ''
101+
if (method == null) method = 'GET'
102+
path = '/' + '_eql' + '/' + 'search' + '/' + 'status' + '/' + encodeURIComponent(id)
103+
104+
// build request object
105+
const request = {
106+
method,
107+
path,
108+
body: null,
109+
querystring
110+
}
111+
112+
return this.transport.request(request, options, callback)
113+
}
114+
88115
EqlApi.prototype.search = function eqlSearchApi (params, options, callback) {
89116
;[params, options, callback] = normalizeArguments(params, options, callback)
90117

@@ -116,4 +143,8 @@ EqlApi.prototype.search = function eqlSearchApi (params, options, callback) {
116143
return this.transport.request(request, options, callback)
117144
}
118145

146+
Object.defineProperties(EqlApi.prototype, {
147+
get_status: { get () { return this.getStatus } }
148+
})
149+
119150
module.exports = EqlApi

Diff for: api/api/searchable_snapshots.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
/* eslint no-unused-vars: 0 */
2424

2525
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
26-
const acceptedQuerystring = ['ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'index', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'master_timeout', 'wait_for_completion', 'storage']
26+
const acceptedQuerystring = ['ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'index', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'master_timeout', 'wait_for_completion', 'storage', 'level']
2727
const snakeCase = { ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices', expandWildcards: 'expand_wildcards', errorTrace: 'error_trace', filterPath: 'filter_path', masterTimeout: 'master_timeout', waitForCompletion: 'wait_for_completion' }
2828

2929
function SearchableSnapshotsApi (transport, ConfigurationError) {

Diff for: api/api/snapshot.js

+22
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,27 @@ SnapshotApi.prototype.get = function snapshotGetApi (params, options, callback)
275275
return this.transport.request(request, options, callback)
276276
}
277277

278+
SnapshotApi.prototype.getFeatures = function snapshotGetFeaturesApi (params, options, callback) {
279+
;[params, options, callback] = normalizeArguments(params, options, callback)
280+
281+
var { method, body, ...querystring } = params
282+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
283+
284+
var path = ''
285+
if (method == null) method = 'GET'
286+
path = '/' + '_snapshottable_features'
287+
288+
// build request object
289+
const request = {
290+
method,
291+
path,
292+
body: null,
293+
querystring
294+
}
295+
296+
return this.transport.request(request, options, callback)
297+
}
298+
278299
SnapshotApi.prototype.getRepository = function snapshotGetRepositoryApi (params, options, callback) {
279300
;[params, options, callback] = normalizeArguments(params, options, callback)
280301

@@ -404,6 +425,7 @@ Object.defineProperties(SnapshotApi.prototype, {
404425
cleanup_repository: { get () { return this.cleanupRepository } },
405426
create_repository: { get () { return this.createRepository } },
406427
delete_repository: { get () { return this.deleteRepository } },
428+
get_features: { get () { return this.getFeatures } },
407429
get_repository: { get () { return this.getRepository } },
408430
verify_repository: { get () { return this.verifyRepository } }
409431
})

Diff for: api/kibana.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ interface KibanaClient {
170170
eql: {
171171
delete<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.EqlDelete, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
172172
get<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.EqlGet, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
173+
getStatus<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.EqlGetStatus, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
173174
search<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.EqlSearch<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
174175
}
175176
exists<TResponse = boolean, TContext = Context>(params?: RequestParams.Exists, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
@@ -430,6 +431,7 @@ interface KibanaClient {
430431
delete<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SnapshotDelete, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
431432
deleteRepository<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SnapshotDeleteRepository, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
432433
get<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SnapshotGet, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
434+
getFeatures<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SnapshotGetFeatures, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
433435
getRepository<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SnapshotGetRepository, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
434436
restore<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.SnapshotRestore<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
435437
status<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SnapshotStatus, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>

Diff for: api/requestParams.d.ts

+9
Original file line numberDiff line numberDiff line change
@@ -726,6 +726,10 @@ export interface EqlGet extends Generic {
726726
keep_alive?: string;
727727
}
728728

729+
export interface EqlGetStatus extends Generic {
730+
id: string;
731+
}
732+
729733
export interface EqlSearch<T = RequestBody> extends Generic {
730734
index: string;
731735
wait_for_completion_timeout?: string;
@@ -2129,6 +2133,7 @@ export interface SearchableSnapshotsMount<T = RequestBody> extends Generic {
21292133

21302134
export interface SearchableSnapshotsStats extends Generic {
21312135
index?: string | string[];
2136+
level?: 'cluster' | 'indices' | 'shards';
21322137
}
21332138

21342139
export interface SecurityAuthenticate extends Generic {
@@ -2351,6 +2356,10 @@ export interface SnapshotGet extends Generic {
23512356
verbose?: boolean;
23522357
}
23532358

2359+
export interface SnapshotGetFeatures extends Generic {
2360+
master_timeout?: string;
2361+
}
2362+
23542363
export interface SnapshotGetRepository extends Generic {
23552364
repository?: string | string[];
23562365
master_timeout?: string;

Diff for: docs/reference.asciidoc

+40-1
Original file line numberDiff line numberDiff line change
@@ -2970,6 +2970,23 @@ _Default:_ `5d`
29702970

29712971
|===
29722972

2973+
[discrete]
2974+
=== eql.getStatus
2975+
2976+
[source,ts]
2977+
----
2978+
client.eql.getStatus({
2979+
id: string
2980+
})
2981+
----
2982+
link:{ref}/eql-search-api.html[Documentation] +
2983+
[cols=2*]
2984+
|===
2985+
|`id`
2986+
|`string` - The async search ID
2987+
2988+
|===
2989+
29732990
[discrete]
29742991
=== eql.search
29752992

@@ -8777,7 +8794,8 @@ link:{ref}/searchable-snapshots-api-mount-snapshot.html[Documentation] +
87778794
[source,ts]
87788795
----
87798796
client.searchableSnapshots.stats({
8780-
index: string | string[]
8797+
index: string | string[],
8798+
level: 'cluster' | 'indices' | 'shards'
87818799
})
87828800
----
87838801
link:{ref}/searchable-snapshots-apis.html[Documentation] +
@@ -8786,6 +8804,10 @@ link:{ref}/searchable-snapshots-apis.html[Documentation] +
87868804
|`index`
87878805
|`string \| string[]` - A comma-separated list of index names
87888806

8807+
|`level`
8808+
|`'cluster' \| 'indices' \| 'shards'` - Return stats aggregated at cluster, index or shard level +
8809+
_Default:_ `indices`
8810+
87898811
|===
87908812

87918813
[discrete]
@@ -9689,6 +9711,23 @@ link:{ref}/modules-snapshots.html[Documentation] +
96899711

96909712
|===
96919713

9714+
[discrete]
9715+
=== snapshot.getFeatures
9716+
9717+
[source,ts]
9718+
----
9719+
client.snapshot.getFeatures({
9720+
master_timeout: string
9721+
})
9722+
----
9723+
link:{ref}/modules-snapshots.html[Documentation] +
9724+
[cols=2*]
9725+
|===
9726+
|`master_timeout` or `masterTimeout`
9727+
|`string` - Explicit operation timeout for connection to master node
9728+
9729+
|===
9730+
96929731
[discrete]
96939732
=== snapshot.getRepository
96949733

Diff for: index.d.ts

+16
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,14 @@ declare class Client {
691691
get<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
692692
get<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.EqlGet, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
693693
get<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.EqlGet, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
694+
get_status<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.EqlGetStatus, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
695+
get_status<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
696+
get_status<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.EqlGetStatus, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
697+
get_status<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.EqlGetStatus, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
698+
getStatus<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.EqlGetStatus, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
699+
getStatus<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
700+
getStatus<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.EqlGetStatus, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
701+
getStatus<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.EqlGetStatus, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
694702
search<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.EqlSearch<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
695703
search<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
696704
search<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.EqlSearch<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
@@ -2347,6 +2355,14 @@ declare class Client {
23472355
get<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
23482356
get<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SnapshotGet, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
23492357
get<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SnapshotGet, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
2358+
get_features<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SnapshotGetFeatures, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
2359+
get_features<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
2360+
get_features<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SnapshotGetFeatures, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
2361+
get_features<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SnapshotGetFeatures, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
2362+
getFeatures<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SnapshotGetFeatures, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
2363+
getFeatures<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
2364+
getFeatures<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SnapshotGetFeatures, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
2365+
getFeatures<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SnapshotGetFeatures, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
23502366
get_repository<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SnapshotGetRepository, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
23512367
get_repository<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
23522368
get_repository<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SnapshotGetRepository, callback: callbackFn<TResponse, TContext>): TransportRequestCallback

0 commit comments

Comments
 (0)