API generation
This commit is contained in:
@ -1725,6 +1725,43 @@ MlApi.prototype.updateModelSnapshot = function mlUpdateModelSnapshotApi (params,
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
MlApi.prototype.upgradeJobSnapshot = function mlUpgradeJobSnapshotApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
// check required parameters
|
||||
if (params['job_id'] == null && params['jobId'] == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: job_id or jobId')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params['snapshot_id'] == null && params['snapshotId'] == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: snapshot_id or snapshotId')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// check required url components
|
||||
if ((params['snapshot_id'] != null || params['snapshotId'] != null) && ((params['job_id'] == null && params['jobId'] == null))) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter of the url: job_id')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var { method, body, jobId, job_id, snapshotId, snapshot_id, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
var path = ''
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'model_snapshots' + '/' + encodeURIComponent(snapshot_id || snapshotId) + '/' + '_upgrade'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
MlApi.prototype.validate = function mlValidateApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
@ -1836,6 +1873,7 @@ Object.defineProperties(MlApi.prototype, {
|
||||
update_filter: { get () { return this.updateFilter } },
|
||||
update_job: { get () { return this.updateJob } },
|
||||
update_model_snapshot: { get () { return this.updateModelSnapshot } },
|
||||
upgrade_job_snapshot: { get () { return this.upgradeJobSnapshot } },
|
||||
validate_detector: { get () { return this.validateDetector } }
|
||||
})
|
||||
|
||||
|
||||
@ -168,6 +168,37 @@ RollupApi.prototype.putJob = function rollupPutJobApi (params, options, callback
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
RollupApi.prototype.rollup = function rollupRollupApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
// check required parameters
|
||||
if (params['index'] == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: index')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params['body'] == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
var path = ''
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_rollup'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
RollupApi.prototype.rollupSearch = function rollupRollupSearchApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
|
||||
2
api/kibana.d.ts
vendored
2
api/kibana.d.ts
vendored
@ -332,6 +332,7 @@ interface KibanaClient {
|
||||
updateFilter<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlUpdateFilter<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
updateJob<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlUpdateJob<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
updateModelSnapshot<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlUpdateModelSnapshot<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
upgradeJobSnapshot<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MlUpgradeJobSnapshot, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
validate<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlValidate<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
validateDetector<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlValidateDetector<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
}
|
||||
@ -361,6 +362,7 @@ interface KibanaClient {
|
||||
getRollupCaps<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.RollupGetRollupCaps, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getRollupIndexCaps<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.RollupGetRollupIndexCaps, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
putJob<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.RollupPutJob<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
rollup<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.RollupRollup<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
rollupSearch<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.RollupRollupSearch<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
startJob<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.RollupStartJob, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
stopJob<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.RollupStopJob, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
|
||||
12
api/requestParams.d.ts
vendored
12
api/requestParams.d.ts
vendored
@ -1848,6 +1848,13 @@ export interface MlUpdateModelSnapshot<T = RequestBody> extends Generic {
|
||||
body: T;
|
||||
}
|
||||
|
||||
export interface MlUpgradeJobSnapshot extends Generic {
|
||||
job_id: string;
|
||||
snapshot_id: string;
|
||||
timeout?: string;
|
||||
wait_for_completion?: boolean;
|
||||
}
|
||||
|
||||
export interface MlValidate<T = RequestBody> extends Generic {
|
||||
body: T;
|
||||
}
|
||||
@ -2021,6 +2028,11 @@ export interface RollupPutJob<T = RequestBody> extends Generic {
|
||||
body: T;
|
||||
}
|
||||
|
||||
export interface RollupRollup<T = RequestBody> extends Generic {
|
||||
index: string;
|
||||
body: T;
|
||||
}
|
||||
|
||||
export interface RollupRollupSearch<T = RequestBody> extends Generic {
|
||||
index: string | string[];
|
||||
type?: string;
|
||||
|
||||
Reference in New Issue
Block a user