API generation

This commit is contained in:
delvedor
2020-01-07 11:08:28 +01:00
parent 59559f7200
commit 6cef0aff18
10 changed files with 32 additions and 25 deletions

View File

@ -15,7 +15,6 @@ function buildCatNodes (opts) {
'bytes',
'format',
'full_id',
'local',
'master_timeout',
'h',
'help',

View File

@ -79,10 +79,10 @@ function buildIndicesDeleteAlias (opts) {
if ((index) != null && (name) != null) {
if (method == null) method = 'DELETE'
path = '/' + encodeURIComponent(index) + '/' + '_aliases' + '/' + encodeURIComponent(name)
path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name)
} else {
if (method == null) method = 'DELETE'
path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name)
path = '/' + encodeURIComponent(index) + '/' + '_aliases' + '/' + encodeURIComponent(name)
}
// build request object

View File

@ -79,10 +79,10 @@ function buildIndicesPutAlias (opts) {
if ((index) != null && (name) != null) {
if (method == null) method = 'PUT'
path = '/' + encodeURIComponent(index) + '/' + '_aliases' + '/' + encodeURIComponent(name)
path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name)
} else {
if (method == null) method = 'PUT'
path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name)
path = '/' + encodeURIComponent(index) + '/' + '_aliases' + '/' + encodeURIComponent(name)
}
// build request object

View File

@ -12,7 +12,7 @@ function buildMlDeleteDataFrameAnalytics (opts) {
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'force'
]
const snakeCase = {

View File

@ -21,7 +21,7 @@ function buildMlDeleteTrainedModel (opts) {
/**
* Perform a ml.delete_trained_model request
* TODO
* https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-inference.html
*/
return function mlDeleteTrainedModel (params, options, callback) {
options = options || {}

View File

@ -14,19 +14,21 @@ function buildMlGetTrainedModels (opts) {
const acceptedQuerystring = [
'allow_no_match',
'include_model_definition',
'decompress_definition',
'from',
'size'
]
const snakeCase = {
allowNoMatch: 'allow_no_match',
includeModelDefinition: 'include_model_definition'
includeModelDefinition: 'include_model_definition',
decompressDefinition: 'decompress_definition'
}
/**
* Perform a ml.get_trained_models request
* TODO
* https://www.elastic.co/guide/en/elasticsearch/reference/current/get-inference.html
*/
return function mlGetTrainedModels (params, options, callback) {
options = options || {}

View File

@ -24,7 +24,7 @@ function buildMlGetTrainedModelsStats (opts) {
/**
* Perform a ml.get_trained_models_stats request
* TODO
* https://www.elastic.co/guide/en/elasticsearch/reference/current/get-inference-stats.html
*/
return function mlGetTrainedModelsStats (params, options, callback) {
options = options || {}

View File

@ -67,16 +67,16 @@ function buildNodesHotThreads (opts) {
if ((node_id || nodeId) != null) {
if (method == null) method = 'GET'
path = '/' + '_cluster' + '/' + 'nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hot_threads'
} else if ((node_id || nodeId) != null) {
if (method == null) method = 'GET'
path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hotthreads'
path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hot_threads'
} else if ((node_id || nodeId) != null) {
if (method == null) method = 'GET'
path = '/' + '_cluster' + '/' + 'nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hotthreads'
} else if ((node_id || nodeId) != null) {
if (method == null) method = 'GET'
path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hot_threads'
path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hotthreads'
} else if ((node_id || nodeId) != null) {
if (method == null) method = 'GET'
path = '/' + '_cluster' + '/' + 'nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hot_threads'
} else {
if (method == null) method = 'GET'
path = '/' + '_nodes' + '/' + 'hot_threads'

View File

@ -124,7 +124,6 @@ export interface CatNodes extends Generic {
bytes?: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb';
format?: string;
full_id?: boolean;
local?: boolean;
master_timeout?: string;
h?: string | string[];
help?: boolean;
@ -1578,6 +1577,7 @@ export interface MlDeleteCalendarJob extends Generic {
export interface MlDeleteDataFrameAnalytics extends Generic {
id: string;
force?: boolean;
}
export interface MlDeleteDatafeed extends Generic {
@ -1790,6 +1790,7 @@ export interface MlGetTrainedModels extends Generic {
model_id?: string;
allow_no_match?: boolean;
include_model_definition?: boolean;
decompress_definition?: boolean;
from?: number;
size?: number;
}