API generation
This commit is contained in:
@ -7,7 +7,7 @@
|
|||||||
/* eslint camelcase: 0 */
|
/* eslint camelcase: 0 */
|
||||||
/* eslint no-unused-vars: 0 */
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
function buildMlEstimateMemoryUsage (opts) {
|
function buildMlExplainDataFrameAnalytics (opts) {
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||||
|
|
||||||
@ -20,10 +20,10 @@ function buildMlEstimateMemoryUsage (opts) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Perform a ml.estimate_memory_usage request
|
* Perform a ml.explain_data_frame_analytics request
|
||||||
* http://www.elastic.co/guide/en/elasticsearch/reference/current/estimate-memory-usage-dfanalytics.html
|
* http://www.elastic.co/guide/en/elasticsearch/reference/current/explain-dfanalytics.html
|
||||||
*/
|
*/
|
||||||
return function mlEstimateMemoryUsage (params, options, callback) {
|
return function mlExplainDataFrameAnalytics (params, options, callback) {
|
||||||
options = options || {}
|
options = options || {}
|
||||||
if (typeof options === 'function') {
|
if (typeof options === 'function') {
|
||||||
callback = options
|
callback = options
|
||||||
@ -35,12 +35,6 @@ function buildMlEstimateMemoryUsage (opts) {
|
|||||||
options = {}
|
options = {}
|
||||||
}
|
}
|
||||||
|
|
||||||
// check required parameters
|
|
||||||
if (params['body'] == null) {
|
|
||||||
const err = new ConfigurationError('Missing required parameter: body')
|
|
||||||
return handleError(err, callback)
|
|
||||||
}
|
|
||||||
|
|
||||||
// validate headers object
|
// validate headers object
|
||||||
if (options.headers != null && typeof options.headers !== 'object') {
|
if (options.headers != null && typeof options.headers !== 'object') {
|
||||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||||
@ -48,7 +42,7 @@ function buildMlEstimateMemoryUsage (opts) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var warnings = []
|
var warnings = []
|
||||||
var { method, body, ...querystring } = params
|
var { method, body, id, ...querystring } = params
|
||||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||||
|
|
||||||
var ignore = options.ignore
|
var ignore = options.ignore
|
||||||
@ -58,8 +52,13 @@ function buildMlEstimateMemoryUsage (opts) {
|
|||||||
|
|
||||||
var path = ''
|
var path = ''
|
||||||
|
|
||||||
if (method == null) method = 'POST'
|
if ((id) != null) {
|
||||||
path = '/' + '_ml' + '/' + 'data_frame' + '/' + 'analytics' + '/' + '_estimate_memory_usage'
|
if (method == null) method = body == null ? 'GET' : 'POST'
|
||||||
|
path = '/' + '_ml' + '/' + 'data_frame' + '/' + 'analytics' + '/' + encodeURIComponent(id) + '/' + '_explain'
|
||||||
|
} else {
|
||||||
|
if (method == null) method = body == null ? 'GET' : 'POST'
|
||||||
|
path = '/' + '_ml' + '/' + 'data_frame' + '/' + 'analytics' + '/' + '_explain'
|
||||||
|
}
|
||||||
|
|
||||||
// build request object
|
// build request object
|
||||||
const request = {
|
const request = {
|
||||||
@ -74,4 +73,4 @@ function buildMlEstimateMemoryUsage (opts) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = buildMlEstimateMemoryUsage
|
module.exports = buildMlExplainDataFrameAnalytics
|
||||||
@ -294,10 +294,10 @@ function ESAPI (opts) {
|
|||||||
deleteModelSnapshot: lazyLoad('ml.delete_model_snapshot', opts),
|
deleteModelSnapshot: lazyLoad('ml.delete_model_snapshot', opts),
|
||||||
delete_trained_model: lazyLoad('ml.delete_trained_model', opts),
|
delete_trained_model: lazyLoad('ml.delete_trained_model', opts),
|
||||||
deleteTrainedModel: lazyLoad('ml.delete_trained_model', opts),
|
deleteTrainedModel: lazyLoad('ml.delete_trained_model', opts),
|
||||||
estimate_memory_usage: lazyLoad('ml.estimate_memory_usage', opts),
|
|
||||||
estimateMemoryUsage: lazyLoad('ml.estimate_memory_usage', opts),
|
|
||||||
evaluate_data_frame: lazyLoad('ml.evaluate_data_frame', opts),
|
evaluate_data_frame: lazyLoad('ml.evaluate_data_frame', opts),
|
||||||
evaluateDataFrame: lazyLoad('ml.evaluate_data_frame', opts),
|
evaluateDataFrame: lazyLoad('ml.evaluate_data_frame', opts),
|
||||||
|
explain_data_frame_analytics: lazyLoad('ml.explain_data_frame_analytics', opts),
|
||||||
|
explainDataFrameAnalytics: lazyLoad('ml.explain_data_frame_analytics', opts),
|
||||||
find_file_structure: lazyLoad('ml.find_file_structure', opts),
|
find_file_structure: lazyLoad('ml.find_file_structure', opts),
|
||||||
findFileStructure: lazyLoad('ml.find_file_structure', opts),
|
findFileStructure: lazyLoad('ml.find_file_structure', opts),
|
||||||
flush_job: lazyLoad('ml.flush_job', opts),
|
flush_job: lazyLoad('ml.flush_job', opts),
|
||||||
|
|||||||
7
api/requestParams.d.ts
vendored
7
api/requestParams.d.ts
vendored
@ -1610,12 +1610,13 @@ export interface MlDeleteTrainedModel extends Generic {
|
|||||||
model_id: string;
|
model_id: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface MlEstimateMemoryUsage<T = any> extends Generic {
|
export interface MlEvaluateDataFrame<T = any> extends Generic {
|
||||||
body: T;
|
body: T;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface MlEvaluateDataFrame<T = any> extends Generic {
|
export interface MlExplainDataFrameAnalytics<T = any> extends Generic {
|
||||||
body: T;
|
id?: string;
|
||||||
|
body?: T;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface MlFindFileStructure<T = any> extends Generic {
|
export interface MlFindFileStructure<T = any> extends Generic {
|
||||||
|
|||||||
@ -6433,6 +6433,26 @@ link:{ref}/evaluate-dfanalytics.html[Reference]
|
|||||||
|
|
||||||
|===
|
|===
|
||||||
|
|
||||||
|
=== ml.explainDataFrameAnalytics
|
||||||
|
*Stability:* experimental
|
||||||
|
[source,ts]
|
||||||
|
----
|
||||||
|
client.ml.explainDataFrameAnalytics({
|
||||||
|
id: string,
|
||||||
|
body: object
|
||||||
|
})
|
||||||
|
----
|
||||||
|
link:{ref}/explain-dfanalytics.html[Reference]
|
||||||
|
[cols=2*]
|
||||||
|
|===
|
||||||
|
|`id`
|
||||||
|
|`string` - The ID of the data frame analytics to explain
|
||||||
|
|
||||||
|
|`body`
|
||||||
|
|`object` - The data frame analytics config to explain
|
||||||
|
|
||||||
|
|===
|
||||||
|
|
||||||
=== ml.findFileStructure
|
=== ml.findFileStructure
|
||||||
*Stability:* experimental
|
*Stability:* experimental
|
||||||
[source,ts]
|
[source,ts]
|
||||||
|
|||||||
4
index.d.ts
vendored
4
index.d.ts
vendored
@ -392,10 +392,10 @@ declare class Client extends EventEmitter {
|
|||||||
deleteModelSnapshot: ApiMethod<RequestParams.MlDeleteModelSnapshot>
|
deleteModelSnapshot: ApiMethod<RequestParams.MlDeleteModelSnapshot>
|
||||||
delete_trained_model: ApiMethod<RequestParams.MlDeleteTrainedModel>
|
delete_trained_model: ApiMethod<RequestParams.MlDeleteTrainedModel>
|
||||||
deleteTrainedModel: ApiMethod<RequestParams.MlDeleteTrainedModel>
|
deleteTrainedModel: ApiMethod<RequestParams.MlDeleteTrainedModel>
|
||||||
estimate_memory_usage: ApiMethod<RequestParams.MlEstimateMemoryUsage>
|
|
||||||
estimateMemoryUsage: ApiMethod<RequestParams.MlEstimateMemoryUsage>
|
|
||||||
evaluate_data_frame: ApiMethod<RequestParams.MlEvaluateDataFrame>
|
evaluate_data_frame: ApiMethod<RequestParams.MlEvaluateDataFrame>
|
||||||
evaluateDataFrame: ApiMethod<RequestParams.MlEvaluateDataFrame>
|
evaluateDataFrame: ApiMethod<RequestParams.MlEvaluateDataFrame>
|
||||||
|
explain_data_frame_analytics: ApiMethod<RequestParams.MlExplainDataFrameAnalytics>
|
||||||
|
explainDataFrameAnalytics: ApiMethod<RequestParams.MlExplainDataFrameAnalytics>
|
||||||
find_file_structure: ApiMethod<RequestParams.MlFindFileStructure>
|
find_file_structure: ApiMethod<RequestParams.MlFindFileStructure>
|
||||||
findFileStructure: ApiMethod<RequestParams.MlFindFileStructure>
|
findFileStructure: ApiMethod<RequestParams.MlFindFileStructure>
|
||||||
flush_job: ApiMethod<RequestParams.MlFlushJob>
|
flush_job: ApiMethod<RequestParams.MlFlushJob>
|
||||||
|
|||||||
Reference in New Issue
Block a user