Skip to content

Commit 5682e68

Browse files
committed
API generation
1 parent aaeadee commit 5682e68

File tree

6 files changed

+88
-15
lines changed

6 files changed

+88
-15
lines changed

api/api/ml.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
/* eslint no-unused-vars: 0 */
2424

2525
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
26-
const acceptedQuerystring = ['allow_no_match', 'allow_no_jobs', 'force', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'requests_per_second', 'allow_no_forecasts', 'wait_for_completion', 'lines_to_sample', 'line_merge_size_limit', 'charset', 'format', 'has_header_row', 'column_names', 'delimiter', 'quote', 'should_trim_fields', 'grok_pattern', 'timestamp_field', 'timestamp_format', 'explain', 'calc_interim', 'start', 'end', 'advance_time', 'skip_time', 'duration', 'expires_in', 'max_model_memory', 'expand', 'exclude_interim', 'from', 'size', 'anomaly_score', 'sort', 'desc', 'job_id', 'partition_field_value', 'verbose', 'allow_no_datafeeds', 'influencer_score', 'top_n', 'bucket_span', 'overall_score', 'record_score', 'include', 'include_model_definition', 'decompress_definition', 'tags', 'for_export', 'reset_start', 'reset_end', 'ignore_unavailable', 'allow_no_indices', 'ignore_throttled', 'expand_wildcards', 'delete_intervening_results', 'enabled']
27-
const snakeCase = { allowNoMatch: 'allow_no_match', allowNoJobs: 'allow_no_jobs', errorTrace: 'error_trace', filterPath: 'filter_path', requestsPerSecond: 'requests_per_second', allowNoForecasts: 'allow_no_forecasts', waitForCompletion: 'wait_for_completion', linesToSample: 'lines_to_sample', lineMergeSizeLimit: 'line_merge_size_limit', hasHeaderRow: 'has_header_row', columnNames: 'column_names', shouldTrimFields: 'should_trim_fields', grokPattern: 'grok_pattern', timestampField: 'timestamp_field', timestampFormat: 'timestamp_format', calcInterim: 'calc_interim', advanceTime: 'advance_time', skipTime: 'skip_time', expiresIn: 'expires_in', maxModelMemory: 'max_model_memory', excludeInterim: 'exclude_interim', anomalyScore: 'anomaly_score', jobId: 'job_id', partitionFieldValue: 'partition_field_value', allowNoDatafeeds: 'allow_no_datafeeds', influencerScore: 'influencer_score', topN: 'top_n', bucketSpan: 'bucket_span', overallScore: 'overall_score', recordScore: 'record_score', includeModelDefinition: 'include_model_definition', decompressDefinition: 'decompress_definition', forExport: 'for_export', resetStart: 'reset_start', resetEnd: 'reset_end', ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices', ignoreThrottled: 'ignore_throttled', expandWildcards: 'expand_wildcards', deleteInterveningResults: 'delete_intervening_results' }
26+
const acceptedQuerystring = ['allow_no_match', 'allow_no_jobs', 'force', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'requests_per_second', 'allow_no_forecasts', 'wait_for_completion', 'lines_to_sample', 'line_merge_size_limit', 'charset', 'format', 'has_header_row', 'column_names', 'delimiter', 'quote', 'should_trim_fields', 'grok_pattern', 'timestamp_field', 'timestamp_format', 'explain', 'calc_interim', 'start', 'end', 'advance_time', 'skip_time', 'duration', 'expires_in', 'max_model_memory', 'expand', 'exclude_interim', 'from', 'size', 'anomaly_score', 'sort', 'desc', 'job_id', 'partition_field_value', 'for_export', 'verbose', 'allow_no_datafeeds', 'influencer_score', 'top_n', 'bucket_span', 'overall_score', 'record_score', 'include', 'include_model_definition', 'decompress_definition', 'tags', 'reset_start', 'reset_end', 'ignore_unavailable', 'allow_no_indices', 'ignore_throttled', 'expand_wildcards', 'delete_intervening_results', 'enabled']
27+
const snakeCase = { allowNoMatch: 'allow_no_match', allowNoJobs: 'allow_no_jobs', errorTrace: 'error_trace', filterPath: 'filter_path', requestsPerSecond: 'requests_per_second', allowNoForecasts: 'allow_no_forecasts', waitForCompletion: 'wait_for_completion', linesToSample: 'lines_to_sample', lineMergeSizeLimit: 'line_merge_size_limit', hasHeaderRow: 'has_header_row', columnNames: 'column_names', shouldTrimFields: 'should_trim_fields', grokPattern: 'grok_pattern', timestampField: 'timestamp_field', timestampFormat: 'timestamp_format', calcInterim: 'calc_interim', advanceTime: 'advance_time', skipTime: 'skip_time', expiresIn: 'expires_in', maxModelMemory: 'max_model_memory', excludeInterim: 'exclude_interim', anomalyScore: 'anomaly_score', jobId: 'job_id', partitionFieldValue: 'partition_field_value', forExport: 'for_export', allowNoDatafeeds: 'allow_no_datafeeds', influencerScore: 'influencer_score', topN: 'top_n', bucketSpan: 'bucket_span', overallScore: 'overall_score', recordScore: 'record_score', includeModelDefinition: 'include_model_definition', decompressDefinition: 'decompress_definition', resetStart: 'reset_start', resetEnd: 'reset_end', ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices', ignoreThrottled: 'ignore_throttled', expandWildcards: 'expand_wildcards', deleteInterveningResults: 'delete_intervening_results' }
2828

2929
function MlApi (transport, ConfigurationError) {
3030
this.transport = transport
@@ -382,7 +382,7 @@ MlApi.prototype.deleteTrainedModel = function mlDeleteTrainedModelApi (params, o
382382

383383
var path = ''
384384
if (method == null) method = 'DELETE'
385-
path = '/' + '_ml' + '/' + 'inference' + '/' + encodeURIComponent(model_id || modelId)
385+
path = '/' + '_ml' + '/' + 'trained_models' + '/' + encodeURIComponent(model_id || modelId)
386386

387387
// build request object
388388
const request = {
@@ -995,10 +995,10 @@ MlApi.prototype.getTrainedModels = function mlGetTrainedModelsApi (params, optio
995995
var path = ''
996996
if ((model_id || modelId) != null) {
997997
if (method == null) method = 'GET'
998-
path = '/' + '_ml' + '/' + 'inference' + '/' + encodeURIComponent(model_id || modelId)
998+
path = '/' + '_ml' + '/' + 'trained_models' + '/' + encodeURIComponent(model_id || modelId)
999999
} else {
10001000
if (method == null) method = 'GET'
1001-
path = '/' + '_ml' + '/' + 'inference'
1001+
path = '/' + '_ml' + '/' + 'trained_models'
10021002
}
10031003

10041004
// build request object
@@ -1021,10 +1021,10 @@ MlApi.prototype.getTrainedModelsStats = function mlGetTrainedModelsStatsApi (par
10211021
var path = ''
10221022
if ((model_id || modelId) != null) {
10231023
if (method == null) method = 'GET'
1024-
path = '/' + '_ml' + '/' + 'inference' + '/' + encodeURIComponent(model_id || modelId) + '/' + '_stats'
1024+
path = '/' + '_ml' + '/' + 'trained_models' + '/' + encodeURIComponent(model_id || modelId) + '/' + '_stats'
10251025
} else {
10261026
if (method == null) method = 'GET'
1027-
path = '/' + '_ml' + '/' + 'inference' + '/' + '_stats'
1027+
path = '/' + '_ml' + '/' + 'trained_models' + '/' + '_stats'
10281028
}
10291029

10301030
// build request object
@@ -1381,7 +1381,7 @@ MlApi.prototype.putTrainedModel = function mlPutTrainedModelApi (params, options
13811381

13821382
var path = ''
13831383
if (method == null) method = 'PUT'
1384-
path = '/' + '_ml' + '/' + 'inference' + '/' + encodeURIComponent(model_id || modelId)
1384+
path = '/' + '_ml' + '/' + 'trained_models' + '/' + encodeURIComponent(model_id || modelId)
13851385

13861386
// build request object
13871387
const request = {

api/api/security.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,33 @@ SecurityApi.prototype.changePassword = function securityChangePasswordApi (param
8484
return this.transport.request(request, options, callback)
8585
}
8686

87+
SecurityApi.prototype.clearApiKeyCache = function securityClearApiKeyCacheApi (params, options, callback) {
88+
;[params, options, callback] = normalizeArguments(params, options, callback)
89+
90+
// check required parameters
91+
if (params['ids'] == null) {
92+
const err = new this[kConfigurationError]('Missing required parameter: ids')
93+
return handleError(err, callback)
94+
}
95+
96+
var { method, body, ids, ...querystring } = params
97+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
98+
99+
var path = ''
100+
if (method == null) method = 'POST'
101+
path = '/' + '_security' + '/' + 'api_key' + '/' + encodeURIComponent(ids) + '/' + '_clear_cache'
102+
103+
// build request object
104+
const request = {
105+
method,
106+
path,
107+
body: body || '',
108+
querystring
109+
}
110+
111+
return this.transport.request(request, options, callback)
112+
}
113+
87114
SecurityApi.prototype.clearCachedPrivileges = function securityClearCachedPrivilegesApi (params, options, callback) {
88115
;[params, options, callback] = normalizeArguments(params, options, callback)
89116

@@ -775,6 +802,7 @@ SecurityApi.prototype.putUser = function securityPutUserApi (params, options, ca
775802

776803
Object.defineProperties(SecurityApi.prototype, {
777804
change_password: { get () { return this.changePassword } },
805+
clear_api_key_cache: { get () { return this.clearApiKeyCache } },
778806
clear_cached_privileges: { get () { return this.clearCachedPrivileges } },
779807
clear_cached_realms: { get () { return this.clearCachedRealms } },
780808
clear_cached_roles: { get () { return this.clearCachedRoles } },

api/kibana.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,7 @@ interface KibanaClient {
376376
security: {
377377
authenticate<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityAuthenticate, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
378378
changePassword<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityChangePassword<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
379+
clearApiKeyCache<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityClearApiKeyCache, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
379380
clearCachedPrivileges<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityClearCachedPrivileges, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
380381
clearCachedRealms<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityClearCachedRealms, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
381382
clearCachedRoles<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityClearCachedRoles, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>

api/requestParams.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1581,6 +1581,7 @@ export interface MlGetDataFrameAnalytics extends Generic {
15811581
allow_no_match?: boolean;
15821582
from?: number;
15831583
size?: number;
1584+
for_export?: boolean;
15841585
}
15851586

15861587
export interface MlGetDataFrameAnalyticsStats extends Generic {
@@ -1601,6 +1602,7 @@ export interface MlGetDatafeeds extends Generic {
16011602
datafeed_id?: string;
16021603
allow_no_match?: boolean;
16031604
allow_no_datafeeds?: boolean;
1605+
for_export?: boolean;
16041606
}
16051607

16061608
export interface MlGetFilters extends Generic {
@@ -1632,6 +1634,7 @@ export interface MlGetJobs extends Generic {
16321634
job_id?: string;
16331635
allow_no_match?: boolean;
16341636
allow_no_jobs?: boolean;
1637+
for_export?: boolean;
16351638
}
16361639

16371640
export interface MlGetModelSnapshots<T = RequestBody> extends Generic {
@@ -2130,6 +2133,10 @@ export interface SecurityChangePassword<T = RequestBody> extends Generic {
21302133
body: T;
21312134
}
21322135

2136+
export interface SecurityClearApiKeyCache extends Generic {
2137+
ids: string | string[];
2138+
}
2139+
21332140
export interface SecurityClearCachedPrivileges extends Generic {
21342141
application: string | string[];
21352142
}

docs/reference.asciidoc

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6079,7 +6079,7 @@ client.ml.deleteTrainedModel({
60796079
model_id: string
60806080
})
60816081
----
6082-
link:{ref}/delete-inference.html[Documentation] +
6082+
link:{ref}/delete-trained-models.html[Documentation] +
60836083
[cols=2*]
60846084
|===
60856085
|`model_id` or `modelId`
@@ -6461,7 +6461,8 @@ client.ml.getDataFrameAnalytics({
64616461
id: string,
64626462
allow_no_match: boolean,
64636463
from: number,
6464-
size: number
6464+
size: number,
6465+
for_export: boolean
64656466
})
64666467
----
64676468
link:{ref}/get-dfanalytics.html[Documentation] +
@@ -6481,6 +6482,9 @@ _Default:_ `true`
64816482
|`number` - specifies a max number of analytics to get +
64826483
_Default:_ `100`
64836484

6485+
|`for_export` or `forExport`
6486+
|`boolean` - Omits fields that are illegal to set on data frame analytics PUT
6487+
64846488
|===
64856489

64866490
[discrete]
@@ -6553,7 +6557,8 @@ WARNING: This parameter has been deprecated.
65536557
client.ml.getDatafeeds({
65546558
datafeed_id: string,
65556559
allow_no_match: boolean,
6556-
allow_no_datafeeds: boolean
6560+
allow_no_datafeeds: boolean,
6561+
for_export: boolean
65576562
})
65586563
----
65596564
link:{ref}/ml-get-datafeed.html[Documentation] +
@@ -6570,6 +6575,9 @@ link:{ref}/ml-get-datafeed.html[Documentation] +
65706575

65716576
WARNING: This parameter has been deprecated.
65726577

6578+
|`for_export` or `forExport`
6579+
|`boolean` - Omits fields that are illegal to set on datafeed PUT
6580+
65736581
|===
65746582

65756583
[discrete]
@@ -6685,7 +6693,8 @@ WARNING: This parameter has been deprecated.
66856693
client.ml.getJobs({
66866694
job_id: string,
66876695
allow_no_match: boolean,
6688-
allow_no_jobs: boolean
6696+
allow_no_jobs: boolean,
6697+
for_export: boolean
66896698
})
66906699
----
66916700
link:{ref}/ml-get-job.html[Documentation] +
@@ -6702,6 +6711,9 @@ link:{ref}/ml-get-job.html[Documentation] +
67026711

67036712
WARNING: This parameter has been deprecated.
67046713

6714+
|`for_export` or `forExport`
6715+
|`boolean` - Omits fields that are illegal to set on job PUT
6716+
67056717
|===
67066718

67076719
[discrete]
@@ -6878,7 +6890,7 @@ client.ml.getTrainedModels({
68786890
for_export: boolean
68796891
})
68806892
----
6881-
link:{ref}/get-inference.html[Documentation] +
6893+
link:{ref}/get-trained-models.html[Documentation] +
68826894
[cols=2*]
68836895
|===
68846896
|`model_id` or `modelId`
@@ -6927,7 +6939,7 @@ client.ml.getTrainedModelsStats({
69276939
size: number
69286940
})
69296941
----
6930-
link:{ref}/get-inference-stats.html[Documentation] +
6942+
link:{ref}/get-trained-models-stats.html[Documentation] +
69316943
[cols=2*]
69326944
|===
69336945
|`model_id` or `modelId`
@@ -7192,7 +7204,7 @@ client.ml.putTrainedModel({
71927204
body: object
71937205
})
71947206
----
7195-
link:{ref}/put-inference.html[Documentation] +
7207+
link:{ref}/put-trained-models.html[Documentation] +
71967208
[cols=2*]
71977209
|===
71987210
|`model_id` or `modelId`
@@ -8781,6 +8793,23 @@ link:{ref}/security-api-change-password.html[Documentation] +
87818793

87828794
|===
87838795

8796+
[discrete]
8797+
=== security.clearApiKeyCache
8798+
8799+
[source,ts]
8800+
----
8801+
client.security.clearApiKeyCache({
8802+
ids: string | string[]
8803+
})
8804+
----
8805+
link:{ref}/security-api-clear-api-key-cache.html[Documentation] +
8806+
[cols=2*]
8807+
|===
8808+
|`ids`
8809+
|`string \| string[]` - A comma-separated list of IDs of API keys to clear from the cache
8810+
8811+
|===
8812+
87848813
[discrete]
87858814
=== security.clearCachedPrivileges
87868815

index.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1980,6 +1980,14 @@ declare class Client {
19801980
changePassword<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
19811981
changePassword<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SecurityChangePassword<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
19821982
changePassword<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SecurityChangePassword<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1983+
clear_api_key_cache<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityClearApiKeyCache, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
1984+
clear_api_key_cache<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1985+
clear_api_key_cache<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityClearApiKeyCache, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1986+
clear_api_key_cache<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityClearApiKeyCache, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1987+
clearApiKeyCache<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityClearApiKeyCache, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
1988+
clearApiKeyCache<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1989+
clearApiKeyCache<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityClearApiKeyCache, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1990+
clearApiKeyCache<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityClearApiKeyCache, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
19831991
clear_cached_privileges<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityClearCachedPrivileges, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
19841992
clear_cached_privileges<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
19851993
clear_cached_privileges<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityClearCachedPrivileges, callback: callbackFn<TResponse, TContext>): TransportRequestCallback

0 commit comments

Comments
 (0)