Skip to content

Commit

Permalink
API generation
Browse files Browse the repository at this point in the history
  • Loading branch information
delvedor committed Jan 7, 2020
1 parent 59559f7 commit 6cef0af
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 24 deletions.
1 change: 0 additions & 1 deletion api/api/cat.nodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ function buildCatNodes (opts) {
'bytes',
'format',
'full_id',
'local',
'master_timeout',
'h',
'help',
Expand Down
4 changes: 2 additions & 2 deletions api/api/indices.delete_alias.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions api/api/indices.put_alias.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion api/api/ml.delete_data_frame_analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function buildMlDeleteDataFrameAnalytics (opts) {
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts

const acceptedQuerystring = [

'force'
]

const snakeCase = {
Expand Down
2 changes: 1 addition & 1 deletion api/api/ml.delete_trained_model.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 || {}
Expand Down
6 changes: 4 additions & 2 deletions api/api/ml.get_trained_models.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 || {}
Expand Down
2 changes: 1 addition & 1 deletion api/api/ml.get_trained_models_stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 || {}
Expand Down
8 changes: 4 additions & 4 deletions api/api/nodes.hot_threads.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
path = '/' + '_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 = '/' + '_cluster' + '/' + 'nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hotthreads'
} else if ((node_id || nodeId) != null) {
if (method == null) method = 'GET'
path = '/' + '_cluster' + '/' + 'nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hotthreads'
path = '/' + '_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 = '/' + '_cluster' + '/' + 'nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hot_threads'
} else {
if (method == null) method = 'GET'
path = '/' + '_nodes' + '/' + 'hot_threads'
Expand Down
3 changes: 2 additions & 1 deletion api/requestParams.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -1578,6 +1577,7 @@ export interface MlDeleteCalendarJob extends Generic {

export interface MlDeleteDataFrameAnalytics extends Generic {
id: string;
force?: boolean;
}

export interface MlDeleteDatafeed extends Generic {
Expand Down Expand Up @@ -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;
}
Expand Down
23 changes: 14 additions & 9 deletions docs/reference.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,6 @@ client.cat.nodes({
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,
Expand All @@ -523,9 +522,6 @@ link:{ref}/cat-nodes.html[Reference]
|`full_id` or `fullId`
|`boolean` - Return the full node ID instead of the shortened version (default: false)

|`local`
|`boolean` - Return local information, do not retrieve the state from master node (default: false)

|`master_timeout` or `masterTimeout`
|`string` - Explicit operation timeout for connection to master node

Expand Down Expand Up @@ -6288,7 +6284,8 @@ client.ml.deleteCalendarJob({
[source,ts]
----
client.ml.deleteDataFrameAnalytics({
id: string
id: string,
force: boolean
})
----
link:{ref}/delete-dfanalytics.html[Reference]
Expand All @@ -6297,6 +6294,9 @@ link:{ref}/delete-dfanalytics.html[Reference]
|`id`
|`string` - The ID of the data frame analytics to delete

|`force`
|`boolean` - True if the job should be forcefully deleted

|===

=== ml.deleteDatafeed
Expand Down Expand Up @@ -6423,7 +6423,7 @@ client.ml.deleteTrainedModel({
model_id: string
})
----
link:TODO[Reference]
link:{ref}/delete-inference.html[Reference]
[cols=2*]
|===
|`model_id` or `modelId`
Expand Down Expand Up @@ -7130,11 +7130,12 @@ client.ml.getTrainedModels({
model_id: string,
allow_no_match: boolean,
include_model_definition: boolean,
decompress_definition: boolean,
from: number,
size: number
})
----
link:TODO[Reference]
link:{ref}/get-inference.html[Reference]
[cols=2*]
|===
|`model_id` or `modelId`
Expand All @@ -7145,7 +7146,11 @@ link:TODO[Reference]
_Default:_ `true`

|`include_model_definition` or `includeModelDefinition`
|`boolean` - Should the full model definition be included in the results. These definitions can be large
|`boolean` - Should the full model definition be included in the results. These definitions can be large. So be cautious when including them. Defaults to false.

|`decompress_definition` or `decompressDefinition`
|`boolean` - Should the model definition be decompressed into valid JSON or returned in a custom compressed format. Defaults to true. +
_Default:_ `true`

|`from`
|`number` - skips a number of trained models
Expand All @@ -7167,7 +7172,7 @@ client.ml.getTrainedModelsStats({
size: number
})
----
link:TODO[Reference]
link:{ref}/get-inference-stats.html[Reference]
[cols=2*]
|===
|`model_id` or `modelId`
Expand Down

0 comments on commit 6cef0af

Please sign in to comment.