Skip to content

Commit b4e2b05

Browse files
committed
API generation
1 parent 92f31d4 commit b4e2b05

File tree

6 files changed

+155
-10
lines changed

6 files changed

+155
-10
lines changed

api/api/ml.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1725,6 +1725,43 @@ MlApi.prototype.updateModelSnapshot = function mlUpdateModelSnapshotApi (params,
17251725
return this.transport.request(request, options, callback)
17261726
}
17271727

1728+
MlApi.prototype.upgradeJobSnapshot = function mlUpgradeJobSnapshotApi (params, options, callback) {
1729+
;[params, options, callback] = normalizeArguments(params, options, callback)
1730+
1731+
// check required parameters
1732+
if (params['job_id'] == null && params['jobId'] == null) {
1733+
const err = new this[kConfigurationError]('Missing required parameter: job_id or jobId')
1734+
return handleError(err, callback)
1735+
}
1736+
if (params['snapshot_id'] == null && params['snapshotId'] == null) {
1737+
const err = new this[kConfigurationError]('Missing required parameter: snapshot_id or snapshotId')
1738+
return handleError(err, callback)
1739+
}
1740+
1741+
// check required url components
1742+
if ((params['snapshot_id'] != null || params['snapshotId'] != null) && ((params['job_id'] == null && params['jobId'] == null))) {
1743+
const err = new this[kConfigurationError]('Missing required parameter of the url: job_id')
1744+
return handleError(err, callback)
1745+
}
1746+
1747+
var { method, body, jobId, job_id, snapshotId, snapshot_id, ...querystring } = params
1748+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
1749+
1750+
var path = ''
1751+
if (method == null) method = 'POST'
1752+
path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'model_snapshots' + '/' + encodeURIComponent(snapshot_id || snapshotId) + '/' + '_upgrade'
1753+
1754+
// build request object
1755+
const request = {
1756+
method,
1757+
path,
1758+
body: body || '',
1759+
querystring
1760+
}
1761+
1762+
return this.transport.request(request, options, callback)
1763+
}
1764+
17281765
MlApi.prototype.validate = function mlValidateApi (params, options, callback) {
17291766
;[params, options, callback] = normalizeArguments(params, options, callback)
17301767

@@ -1836,6 +1873,7 @@ Object.defineProperties(MlApi.prototype, {
18361873
update_filter: { get () { return this.updateFilter } },
18371874
update_job: { get () { return this.updateJob } },
18381875
update_model_snapshot: { get () { return this.updateModelSnapshot } },
1876+
upgrade_job_snapshot: { get () { return this.upgradeJobSnapshot } },
18391877
validate_detector: { get () { return this.validateDetector } }
18401878
})
18411879

api/api/rollup.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,37 @@ RollupApi.prototype.putJob = function rollupPutJobApi (params, options, callback
168168
return this.transport.request(request, options, callback)
169169
}
170170

171+
RollupApi.prototype.rollup = function rollupRollupApi (params, options, callback) {
172+
;[params, options, callback] = normalizeArguments(params, options, callback)
173+
174+
// check required parameters
175+
if (params['index'] == null) {
176+
const err = new this[kConfigurationError]('Missing required parameter: index')
177+
return handleError(err, callback)
178+
}
179+
if (params['body'] == null) {
180+
const err = new this[kConfigurationError]('Missing required parameter: body')
181+
return handleError(err, callback)
182+
}
183+
184+
var { method, body, index, ...querystring } = params
185+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
186+
187+
var path = ''
188+
if (method == null) method = 'POST'
189+
path = '/' + encodeURIComponent(index) + '/' + '_rollup'
190+
191+
// build request object
192+
const request = {
193+
method,
194+
path,
195+
body: body || '',
196+
querystring
197+
}
198+
199+
return this.transport.request(request, options, callback)
200+
}
201+
171202
RollupApi.prototype.rollupSearch = function rollupRollupSearchApi (params, options, callback) {
172203
;[params, options, callback] = normalizeArguments(params, options, callback)
173204

api/kibana.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@ interface KibanaClient {
332332
updateFilter<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlUpdateFilter<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
333333
updateJob<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlUpdateJob<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
334334
updateModelSnapshot<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlUpdateModelSnapshot<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
335+
upgradeJobSnapshot<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MlUpgradeJobSnapshot, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
335336
validate<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlValidate<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
336337
validateDetector<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlValidateDetector<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
337338
}
@@ -361,6 +362,7 @@ interface KibanaClient {
361362
getRollupCaps<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.RollupGetRollupCaps, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
362363
getRollupIndexCaps<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.RollupGetRollupIndexCaps, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
363364
putJob<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.RollupPutJob<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
365+
rollup<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.RollupRollup<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
364366
rollupSearch<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.RollupRollupSearch<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
365367
startJob<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.RollupStartJob, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
366368
stopJob<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.RollupStopJob, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>

api/requestParams.d.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1848,6 +1848,13 @@ export interface MlUpdateModelSnapshot<T = RequestBody> extends Generic {
18481848
body: T;
18491849
}
18501850

1851+
export interface MlUpgradeJobSnapshot extends Generic {
1852+
job_id: string;
1853+
snapshot_id: string;
1854+
timeout?: string;
1855+
wait_for_completion?: boolean;
1856+
}
1857+
18511858
export interface MlValidate<T = RequestBody> extends Generic {
18521859
body: T;
18531860
}
@@ -2021,6 +2028,11 @@ export interface RollupPutJob<T = RequestBody> extends Generic {
20212028
body: T;
20222029
}
20232030

2031+
export interface RollupRollup<T = RequestBody> extends Generic {
2032+
index: string;
2033+
body: T;
2034+
}
2035+
20242036
export interface RollupRollupSearch<T = RequestBody> extends Generic {
20252037
index: string | string[];
20262038
type?: string;

docs/reference.asciidoc

Lines changed: 60 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1967,7 +1967,7 @@ link:{ref}/cluster-allocation-explain.html[Documentation] +
19671967

19681968
[discrete]
19691969
=== cluster.deleteComponentTemplate
1970-
*Stability:* experimental
1970+
19711971
[source,ts]
19721972
----
19731973
client.cluster.deleteComponentTemplate({
@@ -2010,7 +2010,7 @@ _Default:_ `true`
20102010

20112011
[discrete]
20122012
=== cluster.existsComponentTemplate
2013-
*Stability:* experimental
2013+
20142014
[source,ts]
20152015
----
20162016
client.cluster.existsComponentTemplate({
@@ -2035,7 +2035,7 @@ link:{ref}/indices-component-template.html[Documentation] +
20352035

20362036
[discrete]
20372037
=== cluster.getComponentTemplate
2038-
*Stability:* experimental
2038+
20392039
[source,ts]
20402040
----
20412041
client.cluster.getComponentTemplate({
@@ -2199,7 +2199,7 @@ _Default:_ `30s`
21992199

22002200
[discrete]
22012201
=== cluster.putComponentTemplate
2202-
*Stability:* experimental
2202+
22032203
[source,ts]
22042204
----
22052205
client.cluster.putComponentTemplate({
@@ -4082,7 +4082,7 @@ _Default:_ `open`
40824082

40834083
[discrete]
40844084
=== indices.deleteIndexTemplate
4085-
*Stability:* experimental
4085+
40864086
[source,ts]
40874087
----
40884088
client.indices.deleteIndexTemplate({
@@ -4212,7 +4212,7 @@ _Default:_ `all`
42124212

42134213
[discrete]
42144214
=== indices.existsIndexTemplate
4215-
*Stability:* experimental
4215+
42164216
[source,ts]
42174217
----
42184218
client.indices.existsIndexTemplate({
@@ -4622,7 +4622,7 @@ _Default:_ `open`
46224622

46234623
[discrete]
46244624
=== indices.getIndexTemplate
4625-
*Stability:* experimental
4625+
46264626
[source,ts]
46274627
----
46284628
client.indices.getIndexTemplate({
@@ -4889,7 +4889,7 @@ link:{ref}/indices-aliases.html[Documentation] +
48894889

48904890
[discrete]
48914891
=== indices.putIndexTemplate
4892-
*Stability:* experimental
4892+
48934893
[source,ts]
48944894
----
48954895
client.indices.putIndexTemplate({
@@ -5326,7 +5326,7 @@ link:{ref}/indices-shrink-index.html[Documentation] +
53265326

53275327
[discrete]
53285328
=== indices.simulateIndexTemplate
5329-
*Stability:* experimental
5329+
53305330
[source,ts]
53315331
----
53325332
client.indices.simulateIndexTemplate({
@@ -5359,7 +5359,7 @@ link:{ref}/indices-templates.html[Documentation] +
53595359

53605360
[discrete]
53615361
=== indices.simulateTemplate
5362-
*Stability:* experimental
5362+
53635363
[source,ts]
53645364
----
53655365
client.indices.simulateTemplate({
@@ -7699,6 +7699,35 @@ link:{ref}/ml-update-snapshot.html[Documentation] +
76997699

77007700
|===
77017701

7702+
[discrete]
7703+
=== ml.upgradeJobSnapshot
7704+
7705+
[source,ts]
7706+
----
7707+
client.ml.upgradeJobSnapshot({
7708+
job_id: string,
7709+
snapshot_id: string,
7710+
timeout: string,
7711+
wait_for_completion: boolean
7712+
})
7713+
----
7714+
link:{ref}/ml-upgrade-job-model-snapshot.html[Documentation] +
7715+
[cols=2*]
7716+
|===
7717+
|`job_id` or `jobId`
7718+
|`string` - The ID of the job
7719+
7720+
|`snapshot_id` or `snapshotId`
7721+
|`string` - The ID of the snapshot
7722+
7723+
|`timeout`
7724+
|`string` - How long should the API wait for the job to be opened and the old snapshot to be loaded.
7725+
7726+
|`wait_for_completion` or `waitForCompletion`
7727+
|`boolean` - Should the request wait until the task is complete before responding to the caller. Default is false.
7728+
7729+
|===
7730+
77027731
[discrete]
77037732
=== ml.validate
77047733

@@ -8429,6 +8458,27 @@ link:{ref}/rollup-put-job.html[Documentation] +
84298458

84308459
|===
84318460

8461+
[discrete]
8462+
=== rollup.rollup
8463+
8464+
[source,ts]
8465+
----
8466+
client.rollup.rollup({
8467+
index: string,
8468+
body: object
8469+
})
8470+
----
8471+
link:{ref}/rollup.html[Documentation] +
8472+
[cols=2*]
8473+
|===
8474+
|`index`
8475+
|`string` - The index to roll up
8476+
8477+
|`body`
8478+
|`object` - The rollup configuration
8479+
8480+
|===
8481+
84328482
[discrete]
84338483
=== rollup.rollupSearch
84348484
*Stability:* experimental

index.d.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1736,6 +1736,14 @@ declare class Client {
17361736
updateModelSnapshot<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
17371737
updateModelSnapshot<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.MlUpdateModelSnapshot<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
17381738
updateModelSnapshot<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.MlUpdateModelSnapshot<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1739+
upgrade_job_snapshot<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MlUpgradeJobSnapshot, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
1740+
upgrade_job_snapshot<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1741+
upgrade_job_snapshot<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.MlUpgradeJobSnapshot, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1742+
upgrade_job_snapshot<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.MlUpgradeJobSnapshot, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1743+
upgradeJobSnapshot<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MlUpgradeJobSnapshot, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
1744+
upgradeJobSnapshot<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1745+
upgradeJobSnapshot<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.MlUpgradeJobSnapshot, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1746+
upgradeJobSnapshot<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.MlUpgradeJobSnapshot, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
17391747
validate<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlValidate<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
17401748
validate<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
17411749
validate<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.MlValidate<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
@@ -1890,6 +1898,10 @@ declare class Client {
18901898
putJob<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
18911899
putJob<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.RollupPutJob<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
18921900
putJob<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.RollupPutJob<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1901+
rollup<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.RollupRollup<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
1902+
rollup<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1903+
rollup<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.RollupRollup<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1904+
rollup<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.RollupRollup<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
18931905
rollup_search<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.RollupRollupSearch<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
18941906
rollup_search<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
18951907
rollup_search<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.RollupRollupSearch<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback

0 commit comments

Comments
 (0)