API generation
This commit is contained in:
82
api/api/ml.update_data_frame_analytics.js
Normal file
82
api/api/ml.update_data_frame_analytics.js
Normal file
@ -0,0 +1,82 @@
|
||||
// Licensed to Elasticsearch B.V under one or more agreements.
|
||||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
||||
// See the LICENSE file in the project root for more information
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildMlUpdateDataFrameAnalytics (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
|
||||
const acceptedQuerystring = [
|
||||
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a ml.update_data_frame_analytics request
|
||||
* Updates certain properties of a data frame analytics job.
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/current/update-dfanalytics.html
|
||||
*/
|
||||
return function mlUpdateDataFrameAnalytics (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params['id'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: id')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params['body'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// validate headers object
|
||||
if (options.headers != null && typeof options.headers !== 'object') {
|
||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, id, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + '_ml' + '/' + 'data_frame' + '/' + 'analytics' + '/' + encodeURIComponent(id) + '/' + '_update'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildMlUpdateDataFrameAnalytics
|
||||
@ -458,6 +458,8 @@ function ESAPI (opts) {
|
||||
stopDataFrameAnalytics: lazyLoad('ml.stop_data_frame_analytics', opts),
|
||||
stop_datafeed: lazyLoad('ml.stop_datafeed', opts),
|
||||
stopDatafeed: lazyLoad('ml.stop_datafeed', opts),
|
||||
update_data_frame_analytics: lazyLoad('ml.update_data_frame_analytics', opts),
|
||||
updateDataFrameAnalytics: lazyLoad('ml.update_data_frame_analytics', opts),
|
||||
update_datafeed: lazyLoad('ml.update_datafeed', opts),
|
||||
updateDatafeed: lazyLoad('ml.update_datafeed', opts),
|
||||
update_filter: lazyLoad('ml.update_filter', opts),
|
||||
|
||||
1
api/kibana.d.ts
vendored
1
api/kibana.d.ts
vendored
@ -317,6 +317,7 @@ interface KibanaClient {
|
||||
startDatafeed<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = unknown>(params?: RequestParams.MlStartDatafeed<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
stopDataFrameAnalytics<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = unknown>(params?: RequestParams.MlStopDataFrameAnalytics<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
stopDatafeed<TResponse = Record<string, any>, TContext = unknown>(params?: RequestParams.MlStopDatafeed, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
updateDataFrameAnalytics<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = unknown>(params?: RequestParams.MlUpdateDataFrameAnalytics<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
updateDatafeed<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = unknown>(params?: RequestParams.MlUpdateDatafeed<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
updateFilter<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = unknown>(params?: RequestParams.MlUpdateFilter<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
updateJob<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = unknown>(params?: RequestParams.MlUpdateJob<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
|
||||
9
api/requestParams.d.ts
vendored
9
api/requestParams.d.ts
vendored
@ -677,7 +677,7 @@ export interface IndicesDeleteAlias extends Generic {
|
||||
}
|
||||
|
||||
export interface IndicesDeleteDataStream extends Generic {
|
||||
name: string;
|
||||
name: string | string[];
|
||||
}
|
||||
|
||||
export interface IndicesDeleteIndexTemplate extends Generic {
|
||||
@ -774,7 +774,7 @@ export interface IndicesGetAlias extends Generic {
|
||||
}
|
||||
|
||||
export interface IndicesGetDataStream extends Generic {
|
||||
name?: string;
|
||||
name?: string | string[];
|
||||
}
|
||||
|
||||
export interface IndicesGetFieldMapping extends Generic {
|
||||
@ -2195,6 +2195,11 @@ export interface MlStopDatafeed extends Generic {
|
||||
timeout?: string;
|
||||
}
|
||||
|
||||
export interface MlUpdateDataFrameAnalytics<T = RequestBody> extends Generic {
|
||||
id: string;
|
||||
body: T;
|
||||
}
|
||||
|
||||
export interface MlUpdateDatafeed<T = RequestBody> extends Generic {
|
||||
datafeed_id: string;
|
||||
ignore_unavailable?: boolean;
|
||||
|
||||
Reference in New Issue
Block a user