Support for Elasticsearch 7.6 (#1075)
This commit is contained in:
committed by
GitHub
parent
d19313a72c
commit
8bd5c4c4ce
76
api/api/get_script_context.js
Normal file
76
api/api/get_script_context.js
Normal file
@ -0,0 +1,76 @@
|
||||
// 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 buildGetScriptContext (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
'source',
|
||||
'filter_path'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a get_script_context request
|
||||
* Returns all script contexts.
|
||||
*/
|
||||
return function getScriptContext (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// 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, ...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 = 'GET'
|
||||
path = '/' + '_script_context'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildGetScriptContext
|
||||
76
api/api/get_script_languages.js
Normal file
76
api/api/get_script_languages.js
Normal file
@ -0,0 +1,76 @@
|
||||
// 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 buildGetScriptLanguages (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
'source',
|
||||
'filter_path'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a get_script_languages request
|
||||
* Returns available script types, languages and contexts
|
||||
*/
|
||||
return function getScriptLanguages (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// 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, ...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 = 'GET'
|
||||
path = '/' + '_script_language'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildGetScriptLanguages
|
||||
@ -32,7 +32,7 @@ function buildIndicesFlushSynced (opts) {
|
||||
|
||||
/**
|
||||
* Perform a indices.flush_synced request
|
||||
* Performs a synced flush operation on one or more indices.
|
||||
* Performs a synced flush operation on one or more indices. Synced flush is deprecated and will be removed in 8.0. Use flush instead
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-synced-flush-api.html
|
||||
*/
|
||||
return function indicesFlushSynced (params, options, callback) {
|
||||
|
||||
@ -12,11 +12,12 @@ function buildLicenseGet (opts) {
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'local'
|
||||
'local',
|
||||
'accept_enterprise'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
|
||||
acceptEnterprise: 'accept_enterprise'
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -12,7 +12,7 @@ function buildMlDeleteDataFrameAnalytics (opts) {
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
|
||||
const acceptedQuerystring = [
|
||||
|
||||
'force'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
|
||||
77
api/api/ml.delete_trained_model.js
Normal file
77
api/api/ml.delete_trained_model.js
Normal file
@ -0,0 +1,77 @@
|
||||
// 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 buildMlDeleteTrainedModel (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
|
||||
const acceptedQuerystring = [
|
||||
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a ml.delete_trained_model request
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-inference.html
|
||||
*/
|
||||
return function mlDeleteTrainedModel (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['model_id'] == null && params['modelId'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: model_id or modelId')
|
||||
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, modelId, model_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 = 'DELETE'
|
||||
path = '/' + '_ml' + '/' + 'inference' + '/' + encodeURIComponent(model_id || modelId)
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildMlDeleteTrainedModel
|
||||
76
api/api/ml.explain_data_frame_analytics.js
Normal file
76
api/api/ml.explain_data_frame_analytics.js
Normal file
@ -0,0 +1,76 @@
|
||||
// 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 buildMlExplainDataFrameAnalytics (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
|
||||
const acceptedQuerystring = [
|
||||
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a ml.explain_data_frame_analytics request
|
||||
* http://www.elastic.co/guide/en/elasticsearch/reference/current/explain-dfanalytics.html
|
||||
*/
|
||||
return function mlExplainDataFrameAnalytics (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// 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 ((id) != null) {
|
||||
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
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildMlExplainDataFrameAnalytics
|
||||
83
api/api/ml.get_trained_models.js
Normal file
83
api/api/ml.get_trained_models.js
Normal file
@ -0,0 +1,83 @@
|
||||
// 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 buildMlGetTrainedModels (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'allow_no_match',
|
||||
'include_model_definition',
|
||||
'decompress_definition',
|
||||
'from',
|
||||
'size'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
allowNoMatch: 'allow_no_match',
|
||||
includeModelDefinition: 'include_model_definition',
|
||||
decompressDefinition: 'decompress_definition'
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a ml.get_trained_models request
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/current/get-inference.html
|
||||
*/
|
||||
return function mlGetTrainedModels (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// 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, modelId, model_id, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
if ((model_id || modelId) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_ml' + '/' + 'inference' + '/' + encodeURIComponent(model_id || modelId)
|
||||
} else {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_ml' + '/' + 'inference'
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildMlGetTrainedModels
|
||||
79
api/api/ml.get_trained_models_stats.js
Normal file
79
api/api/ml.get_trained_models_stats.js
Normal file
@ -0,0 +1,79 @@
|
||||
// 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 buildMlGetTrainedModelsStats (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'allow_no_match',
|
||||
'from',
|
||||
'size'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
allowNoMatch: 'allow_no_match'
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a ml.get_trained_models_stats request
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/current/get-inference-stats.html
|
||||
*/
|
||||
return function mlGetTrainedModelsStats (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// 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, modelId, model_id, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
if ((model_id || modelId) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_ml' + '/' + 'inference' + '/' + encodeURIComponent(model_id || modelId) + '/' + '_stats'
|
||||
} else {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_ml' + '/' + 'inference' + '/' + '_stats'
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildMlGetTrainedModelsStats
|
||||
@ -7,7 +7,7 @@
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
function buildMlEstimateMemoryUsage (opts) {
|
||||
function buildMlPutTrainedModel (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
|
||||
@ -20,10 +20,10 @@ function buildMlEstimateMemoryUsage (opts) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a ml.estimate_memory_usage request
|
||||
* http://www.elastic.co/guide/en/elasticsearch/reference/current/estimate-memory-usage-dfanalytics.html
|
||||
* Perform a ml.put_trained_model request
|
||||
* TODO
|
||||
*/
|
||||
return function mlEstimateMemoryUsage (params, options, callback) {
|
||||
return function mlPutTrainedModel (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
@ -36,6 +36,10 @@ function buildMlEstimateMemoryUsage (opts) {
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params['model_id'] == null && params['modelId'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: model_id or modelId')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params['body'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: body')
|
||||
return handleError(err, callback)
|
||||
@ -48,7 +52,7 @@ function buildMlEstimateMemoryUsage (opts) {
|
||||
}
|
||||
|
||||
var warnings = []
|
||||
var { method, body, ...querystring } = params
|
||||
var { method, body, modelId, model_id, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
var ignore = options.ignore
|
||||
@ -58,8 +62,8 @@ function buildMlEstimateMemoryUsage (opts) {
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + '_ml' + '/' + 'data_frame' + '/' + 'analytics' + '/' + '_estimate_memory_usage'
|
||||
if (method == null) method = 'PUT'
|
||||
path = '/' + '_ml' + '/' + 'inference' + '/' + encodeURIComponent(model_id || modelId)
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
@ -74,4 +78,4 @@ function buildMlEstimateMemoryUsage (opts) {
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildMlEstimateMemoryUsage
|
||||
module.exports = buildMlPutTrainedModel
|
||||
@ -15,6 +15,7 @@ function buildRankEval (opts) {
|
||||
'ignore_unavailable',
|
||||
'allow_no_indices',
|
||||
'expand_wildcards',
|
||||
'search_type',
|
||||
'pretty',
|
||||
'human',
|
||||
'error_trace',
|
||||
@ -26,6 +27,7 @@ function buildRankEval (opts) {
|
||||
ignoreUnavailable: 'ignore_unavailable',
|
||||
allowNoIndices: 'allow_no_indices',
|
||||
expandWildcards: 'expand_wildcards',
|
||||
searchType: 'search_type',
|
||||
errorTrace: 'error_trace',
|
||||
filterPath: 'filter_path'
|
||||
}
|
||||
|
||||
@ -21,7 +21,7 @@ function buildSlmDeleteLifecycle (opts) {
|
||||
|
||||
/**
|
||||
* Perform a slm.delete_lifecycle request
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-delete.html
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-delete-policy.html
|
||||
*/
|
||||
return function slmDeleteLifecycle (params, options, callback) {
|
||||
options = options || {}
|
||||
|
||||
@ -21,7 +21,7 @@ function buildSlmExecuteLifecycle (opts) {
|
||||
|
||||
/**
|
||||
* Perform a slm.execute_lifecycle request
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-execute.html
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-execute-policy.html
|
||||
*/
|
||||
return function slmExecuteLifecycle (params, options, callback) {
|
||||
options = options || {}
|
||||
|
||||
@ -21,7 +21,7 @@ function buildSlmGetLifecycle (opts) {
|
||||
|
||||
/**
|
||||
* Perform a slm.get_lifecycle request
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-get.html
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-get-policy.html
|
||||
*/
|
||||
return function slmGetLifecycle (params, options, callback) {
|
||||
options = options || {}
|
||||
|
||||
@ -21,7 +21,7 @@ function buildSlmGetStats (opts) {
|
||||
|
||||
/**
|
||||
* Perform a slm.get_stats request
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/slm-get-stats.html
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/master/slm-api-get-stats.html
|
||||
*/
|
||||
return function slmGetStats (params, options, callback) {
|
||||
options = options || {}
|
||||
|
||||
71
api/api/slm.get_status.js
Normal file
71
api/api/slm.get_status.js
Normal file
@ -0,0 +1,71 @@
|
||||
// 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 buildSlmGetStatus (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
|
||||
const acceptedQuerystring = [
|
||||
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a slm.get_status request
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-get-status.html
|
||||
*/
|
||||
return function slmGetStatus (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// 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, ...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 = 'GET'
|
||||
path = '/' + '_slm' + '/' + 'status'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildSlmGetStatus
|
||||
@ -21,7 +21,7 @@ function buildSlmPutLifecycle (opts) {
|
||||
|
||||
/**
|
||||
* Perform a slm.put_lifecycle request
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-put.html
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-put-policy.html
|
||||
*/
|
||||
return function slmPutLifecycle (params, options, callback) {
|
||||
options = options || {}
|
||||
|
||||
71
api/api/slm.start.js
Normal file
71
api/api/slm.start.js
Normal file
@ -0,0 +1,71 @@
|
||||
// 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 buildSlmStart (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
|
||||
const acceptedQuerystring = [
|
||||
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a slm.start request
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-start.html
|
||||
*/
|
||||
return function slmStart (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// 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, ...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 = '/' + '_slm' + '/' + 'start'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildSlmStart
|
||||
71
api/api/slm.stop.js
Normal file
71
api/api/slm.stop.js
Normal file
@ -0,0 +1,71 @@
|
||||
// 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 buildSlmStop (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
|
||||
const acceptedQuerystring = [
|
||||
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a slm.stop request
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-stop.html
|
||||
*/
|
||||
return function slmStop (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
if (typeof params === 'function' || params == null) {
|
||||
callback = params
|
||||
params = {}
|
||||
options = {}
|
||||
}
|
||||
|
||||
// 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, ...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 = '/' + '_slm' + '/' + 'stop'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildSlmStop
|
||||
@ -12,14 +12,17 @@ function buildTransformStopTransform (opts) {
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
|
||||
const acceptedQuerystring = [
|
||||
'force',
|
||||
'wait_for_completion',
|
||||
'timeout',
|
||||
'allow_no_match'
|
||||
'allow_no_match',
|
||||
'wait_for_checkpoint'
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
waitForCompletion: 'wait_for_completion',
|
||||
allowNoMatch: 'allow_no_match'
|
||||
allowNoMatch: 'allow_no_match',
|
||||
waitForCheckpoint: 'wait_for_checkpoint'
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
22
api/index.js
22
api/index.js
@ -113,6 +113,10 @@ function ESAPI (opts) {
|
||||
get: lazyLoad('get', opts),
|
||||
get_script: lazyLoad('get_script', opts),
|
||||
getScript: lazyLoad('get_script', opts),
|
||||
get_script_context: lazyLoad('get_script_context', opts),
|
||||
getScriptContext: lazyLoad('get_script_context', opts),
|
||||
get_script_languages: lazyLoad('get_script_languages', opts),
|
||||
getScriptLanguages: lazyLoad('get_script_languages', opts),
|
||||
get_source: lazyLoad('get_source', opts),
|
||||
getSource: lazyLoad('get_source', opts),
|
||||
graph: {
|
||||
@ -254,10 +258,12 @@ function ESAPI (opts) {
|
||||
deleteJob: lazyLoad('ml.delete_job', opts),
|
||||
delete_model_snapshot: lazyLoad('ml.delete_model_snapshot', opts),
|
||||
deleteModelSnapshot: lazyLoad('ml.delete_model_snapshot', opts),
|
||||
estimate_memory_usage: lazyLoad('ml.estimate_memory_usage', opts),
|
||||
estimateMemoryUsage: lazyLoad('ml.estimate_memory_usage', opts),
|
||||
delete_trained_model: lazyLoad('ml.delete_trained_model', opts),
|
||||
deleteTrainedModel: lazyLoad('ml.delete_trained_model', opts),
|
||||
evaluate_data_frame: 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),
|
||||
findFileStructure: lazyLoad('ml.find_file_structure', opts),
|
||||
flush_job: lazyLoad('ml.flush_job', opts),
|
||||
@ -293,6 +299,10 @@ function ESAPI (opts) {
|
||||
getOverallBuckets: lazyLoad('ml.get_overall_buckets', opts),
|
||||
get_records: lazyLoad('ml.get_records', opts),
|
||||
getRecords: lazyLoad('ml.get_records', opts),
|
||||
get_trained_models: lazyLoad('ml.get_trained_models', opts),
|
||||
getTrainedModels: lazyLoad('ml.get_trained_models', opts),
|
||||
get_trained_models_stats: lazyLoad('ml.get_trained_models_stats', opts),
|
||||
getTrainedModelsStats: lazyLoad('ml.get_trained_models_stats', opts),
|
||||
info: lazyLoad('ml.info', opts),
|
||||
open_job: lazyLoad('ml.open_job', opts),
|
||||
openJob: lazyLoad('ml.open_job', opts),
|
||||
@ -314,6 +324,8 @@ function ESAPI (opts) {
|
||||
putFilter: lazyLoad('ml.put_filter', opts),
|
||||
put_job: lazyLoad('ml.put_job', opts),
|
||||
putJob: lazyLoad('ml.put_job', opts),
|
||||
put_trained_model: lazyLoad('ml.put_trained_model', opts),
|
||||
putTrainedModel: lazyLoad('ml.put_trained_model', opts),
|
||||
revert_model_snapshot: lazyLoad('ml.revert_model_snapshot', opts),
|
||||
revertModelSnapshot: lazyLoad('ml.revert_model_snapshot', opts),
|
||||
set_upgrade_mode: lazyLoad('ml.set_upgrade_mode', opts),
|
||||
@ -454,8 +466,12 @@ function ESAPI (opts) {
|
||||
getLifecycle: lazyLoad('slm.get_lifecycle', opts),
|
||||
get_stats: lazyLoad('slm.get_stats', opts),
|
||||
getStats: lazyLoad('slm.get_stats', opts),
|
||||
get_status: lazyLoad('slm.get_status', opts),
|
||||
getStatus: lazyLoad('slm.get_status', opts),
|
||||
put_lifecycle: lazyLoad('slm.put_lifecycle', opts),
|
||||
putLifecycle: lazyLoad('slm.put_lifecycle', opts)
|
||||
putLifecycle: lazyLoad('slm.put_lifecycle', opts),
|
||||
start: lazyLoad('slm.start', opts),
|
||||
stop: lazyLoad('slm.stop', opts)
|
||||
},
|
||||
snapshot: {
|
||||
cleanup_repository: lazyLoad('snapshot.cleanup_repository', opts),
|
||||
|
||||
52
api/requestParams.d.ts
vendored
52
api/requestParams.d.ts
vendored
@ -87,7 +87,7 @@ export interface CatHelp extends Generic {
|
||||
export interface CatIndices extends Generic {
|
||||
index?: string | string[];
|
||||
format?: string;
|
||||
bytes?: 'b' | 'k' | 'm' | 'g';
|
||||
bytes?: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb';
|
||||
local?: boolean;
|
||||
master_timeout?: string;
|
||||
h?: string | string[];
|
||||
@ -512,6 +512,12 @@ export interface GetScript extends Generic {
|
||||
master_timeout?: string;
|
||||
}
|
||||
|
||||
export interface GetScriptContext extends Generic {
|
||||
}
|
||||
|
||||
export interface GetScriptLanguages extends Generic {
|
||||
}
|
||||
|
||||
export interface GetSource extends Generic {
|
||||
id: string;
|
||||
index: string;
|
||||
@ -1050,6 +1056,7 @@ export interface RankEval<T = any> extends Generic {
|
||||
ignore_unavailable?: boolean;
|
||||
allow_no_indices?: boolean;
|
||||
expand_wildcards?: 'open' | 'closed' | 'none' | 'all';
|
||||
search_type?: 'query_then_fetch' | 'dfs_query_then_fetch';
|
||||
body: T;
|
||||
}
|
||||
|
||||
@ -1501,6 +1508,7 @@ export interface LicenseDelete extends Generic {
|
||||
|
||||
export interface LicenseGet extends Generic {
|
||||
local?: boolean;
|
||||
accept_enterprise?: boolean;
|
||||
}
|
||||
|
||||
export interface LicenseGetBasicStatus extends Generic {
|
||||
@ -1551,6 +1559,7 @@ export interface MlDeleteCalendarJob extends Generic {
|
||||
|
||||
export interface MlDeleteDataFrameAnalytics extends Generic {
|
||||
id: string;
|
||||
force?: boolean;
|
||||
}
|
||||
|
||||
export interface MlDeleteDatafeed extends Generic {
|
||||
@ -1583,14 +1592,19 @@ export interface MlDeleteModelSnapshot extends Generic {
|
||||
snapshot_id: string;
|
||||
}
|
||||
|
||||
export interface MlEstimateMemoryUsage<T = any> extends Generic {
|
||||
body: T;
|
||||
export interface MlDeleteTrainedModel extends Generic {
|
||||
model_id: string;
|
||||
}
|
||||
|
||||
export interface MlEvaluateDataFrame<T = any> extends Generic {
|
||||
body: T;
|
||||
}
|
||||
|
||||
export interface MlExplainDataFrameAnalytics<T = any> extends Generic {
|
||||
id?: string;
|
||||
body?: T;
|
||||
}
|
||||
|
||||
export interface MlFindFileStructure<T = any> extends Generic {
|
||||
lines_to_sample?: number;
|
||||
line_merge_size_limit?: number;
|
||||
@ -1754,6 +1768,22 @@ export interface MlGetRecords<T = any> extends Generic {
|
||||
body?: T;
|
||||
}
|
||||
|
||||
export interface MlGetTrainedModels extends Generic {
|
||||
model_id?: string;
|
||||
allow_no_match?: boolean;
|
||||
include_model_definition?: boolean;
|
||||
decompress_definition?: boolean;
|
||||
from?: number;
|
||||
size?: number;
|
||||
}
|
||||
|
||||
export interface MlGetTrainedModelsStats extends Generic {
|
||||
model_id?: string;
|
||||
allow_no_match?: boolean;
|
||||
from?: number;
|
||||
size?: number;
|
||||
}
|
||||
|
||||
export interface MlInfo extends Generic {
|
||||
}
|
||||
|
||||
@ -1807,6 +1837,11 @@ export interface MlPutJob<T = any> extends Generic {
|
||||
body: T;
|
||||
}
|
||||
|
||||
export interface MlPutTrainedModel<T = any> extends Generic {
|
||||
model_id: string;
|
||||
body: T;
|
||||
}
|
||||
|
||||
export interface MlRevertModelSnapshot<T = any> extends Generic {
|
||||
job_id: string;
|
||||
snapshot_id: string;
|
||||
@ -2067,11 +2102,20 @@ export interface SlmGetLifecycle extends Generic {
|
||||
export interface SlmGetStats extends Generic {
|
||||
}
|
||||
|
||||
export interface SlmGetStatus extends Generic {
|
||||
}
|
||||
|
||||
export interface SlmPutLifecycle<T = any> extends Generic {
|
||||
policy_id: string;
|
||||
body?: T;
|
||||
}
|
||||
|
||||
export interface SlmStart extends Generic {
|
||||
}
|
||||
|
||||
export interface SlmStop extends Generic {
|
||||
}
|
||||
|
||||
export interface SqlClearCursor<T = any> extends Generic {
|
||||
body: T;
|
||||
}
|
||||
@ -2124,9 +2168,11 @@ export interface TransformStartTransform extends Generic {
|
||||
|
||||
export interface TransformStopTransform extends Generic {
|
||||
transform_id: string;
|
||||
force?: boolean;
|
||||
wait_for_completion?: boolean;
|
||||
timeout?: string;
|
||||
allow_no_match?: boolean;
|
||||
wait_for_checkpoint?: boolean;
|
||||
}
|
||||
|
||||
export interface TransformUpdateTransform<T = any> extends Generic {
|
||||
|
||||
Reference in New Issue
Block a user