API generation

This commit is contained in:
delvedor
2020-03-04 09:19:06 +01:00
parent 32f3fef14f
commit 6d50c9fa30
7 changed files with 62 additions and 10 deletions

View File

@ -28,7 +28,7 @@ function buildCatMlDatafeeds (opts) {
/** /**
* Perform a cat.ml_datafeeds request * Perform a cat.ml_datafeeds request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed-stats.html * http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-datafeeds.html
*/ */
return function catMlDatafeeds (params, options, callback) { return function catMlDatafeeds (params, options, callback) {
options = options || {} options = options || {}

View File

@ -29,7 +29,7 @@ function buildCatMlJobs (opts) {
/** /**
* Perform a cat.ml_jobs request * Perform a cat.ml_jobs request
* http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-stats.html * http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-anomaly-detectors.html
*/ */
return function catMlJobs (params, options, callback) { return function catMlJobs (params, options, callback) {
options = options || {} options = options || {}

View File

@ -31,7 +31,7 @@ function buildCatMlTrainedModels (opts) {
/** /**
* Perform a cat.ml_trained_models request * Perform a cat.ml_trained_models request
* https://www.elastic.co/guide/en/elasticsearch/reference/current/get-inference-stats.html * https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-trained-model.html
*/ */
return function catMlTrainedModels (params, options, callback) { return function catMlTrainedModels (params, options, callback) {
options = options || {} options = options || {}

View File

@ -12,11 +12,17 @@ function buildMlPutDatafeed (opts) {
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [ const acceptedQuerystring = [
'ignore_unavailable',
'allow_no_indices',
'ignore_throttled',
'expand_wildcards'
] ]
const snakeCase = { const snakeCase = {
ignoreUnavailable: 'ignore_unavailable',
allowNoIndices: 'allow_no_indices',
ignoreThrottled: 'ignore_throttled',
expandWildcards: 'expand_wildcards'
} }
/** /**

View File

@ -12,11 +12,17 @@ function buildMlUpdateDatafeed (opts) {
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [ const acceptedQuerystring = [
'ignore_unavailable',
'allow_no_indices',
'ignore_throttled',
'expand_wildcards'
] ]
const snakeCase = { const snakeCase = {
ignoreUnavailable: 'ignore_unavailable',
allowNoIndices: 'allow_no_indices',
ignoreThrottled: 'ignore_throttled',
expandWildcards: 'expand_wildcards'
} }
/** /**

View File

@ -1893,6 +1893,10 @@ export interface MlPutDataFrameAnalytics<T = any> extends Generic {
export interface MlPutDatafeed<T = any> extends Generic { export interface MlPutDatafeed<T = any> extends Generic {
datafeed_id: string; datafeed_id: string;
ignore_unavailable?: boolean;
allow_no_indices?: boolean;
ignore_throttled?: boolean;
expand_wildcards?: 'open' | 'closed' | 'hidden' | 'none' | 'all';
body: T; body: T;
} }
@ -1954,6 +1958,10 @@ export interface MlStopDatafeed extends Generic {
export interface MlUpdateDatafeed<T = any> extends Generic { export interface MlUpdateDatafeed<T = any> extends Generic {
datafeed_id: string; datafeed_id: string;
ignore_unavailable?: boolean;
allow_no_indices?: boolean;
ignore_throttled?: boolean;
expand_wildcards?: 'open' | 'closed' | 'hidden' | 'none' | 'all';
body: T; body: T;
} }

View File

@ -5370,7 +5370,7 @@ client.cat.mlDatafeeds({
v: boolean v: boolean
}) })
---- ----
link:{ref}/ml-get-datafeed-stats.html[Documentation] + link:{ref}/cat-datafeeds.html[Documentation] +
[cols=2*] [cols=2*]
|=== |===
|`datafeed_id` or `datafeedId` |`datafeed_id` or `datafeedId`
@ -5415,7 +5415,7 @@ client.cat.mlJobs({
v: boolean v: boolean
}) })
---- ----
link:{ref}/ml-get-job-stats.html[Documentation] + link:{ref}/cat-anomaly-detectors.html[Documentation] +
[cols=2*] [cols=2*]
|=== |===
|`job_id` or `jobId` |`job_id` or `jobId`
@ -5465,7 +5465,7 @@ client.cat.mlTrainedModels({
v: boolean v: boolean
}) })
---- ----
link:{ref}/get-inference-stats.html[Documentation] + link:{ref}/cat-trained-model.html[Documentation] +
[cols=2*] [cols=2*]
|=== |===
|`model_id` or `modelId` |`model_id` or `modelId`
@ -7584,6 +7584,10 @@ link:{ref}/put-dfanalytics.html[Documentation] +
---- ----
client.ml.putDatafeed({ client.ml.putDatafeed({
datafeed_id: string, datafeed_id: string,
ignore_unavailable: boolean,
allow_no_indices: boolean,
ignore_throttled: boolean,
expand_wildcards: 'open' | 'closed' | 'hidden' | 'none' | 'all',
body: object body: object
}) })
---- ----
@ -7593,6 +7597,18 @@ link:{ref}/ml-put-datafeed.html[Documentation] +
|`datafeed_id` or `datafeedId` |`datafeed_id` or `datafeedId`
|`string` - The ID of the datafeed to create |`string` - The ID of the datafeed to create
|`ignore_unavailable` or `ignoreUnavailable`
|`boolean` - Ignore unavailable indexes (default: false)
|`allow_no_indices` or `allowNoIndices`
|`boolean` - Ignore if the source indices expressions resolves to no concrete indices (default: true)
|`ignore_throttled` or `ignoreThrottled`
|`boolean` - Ignore indices that are marked as throttled (default: true)
|`expand_wildcards` or `expandWildcards`
|`'open' \| 'closed' \| 'hidden' \| 'none' \| 'all'` - Whether source index expressions should get expanded to open or closed indices (default: open)
|`body` |`body`
|`object` - The datafeed config |`object` - The datafeed config
@ -7827,6 +7843,10 @@ link:{ref}/ml-stop-datafeed.html[Documentation] +
---- ----
client.ml.updateDatafeed({ client.ml.updateDatafeed({
datafeed_id: string, datafeed_id: string,
ignore_unavailable: boolean,
allow_no_indices: boolean,
ignore_throttled: boolean,
expand_wildcards: 'open' | 'closed' | 'hidden' | 'none' | 'all',
body: object body: object
}) })
---- ----
@ -7836,6 +7856,18 @@ link:{ref}/ml-update-datafeed.html[Documentation] +
|`datafeed_id` or `datafeedId` |`datafeed_id` or `datafeedId`
|`string` - The ID of the datafeed to update |`string` - The ID of the datafeed to update
|`ignore_unavailable` or `ignoreUnavailable`
|`boolean` - Ignore unavailable indexes (default: false)
|`allow_no_indices` or `allowNoIndices`
|`boolean` - Ignore if the source indices expressions resolves to no concrete indices (default: true)
|`ignore_throttled` or `ignoreThrottled`
|`boolean` - Ignore indices that are marked as throttled (default: true)
|`expand_wildcards` or `expandWildcards`
|`'open' \| 'closed' \| 'hidden' \| 'none' \| 'all'` - Whether source index expressions should get expanded to open or closed indices (default: open)
|`body` |`body`
|`object` - The datafeed update settings |`object` - The datafeed update settings