API generation

This commit is contained in:
delvedor
2020-06-08 09:30:11 +02:00
parent 3efb63b34e
commit 59ab125f48
5 changed files with 42 additions and 8 deletions

View File

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

View File

@ -12,10 +12,12 @@ function buildMlDeleteExpiredData (opts) {
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [
'requests_per_second',
'timeout'
]
const snakeCase = {
requestsPerSecond: 'requests_per_second'
}
@ -43,7 +45,7 @@ function buildMlDeleteExpiredData (opts) {
}
var warnings = []
var { method, body, ...querystring } = params
var { method, body, jobId, job_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
var ignore = options.ignore
@ -53,8 +55,13 @@ function buildMlDeleteExpiredData (opts) {
var path = ''
if (method == null) method = 'DELETE'
path = '/' + '_ml' + '/' + '_delete_expired_data'
if ((job_id || jobId) != null) {
if (method == null) method = 'DELETE'
path = '/' + '_ml' + '/' + '_delete_expired_data' + '/' + encodeURIComponent(job_id || jobId)
} else {
if (method == null) method = 'DELETE'
path = '/' + '_ml' + '/' + '_delete_expired_data'
}
// build request object
const request = {

View File

@ -13,11 +13,12 @@ function buildMlGetCategories (opts) {
const acceptedQuerystring = [
'from',
'size'
'size',
'partition_field_value'
]
const snakeCase = {
partitionFieldValue: 'partition_field_value'
}
/**

View File

@ -1809,6 +1809,7 @@ export interface MlDeleteCalendarJob extends Generic {
export interface MlDeleteDataFrameAnalytics extends Generic {
id: string;
force?: boolean;
timeout?: string;
}
export interface MlDeleteDatafeed extends Generic {
@ -1817,6 +1818,9 @@ export interface MlDeleteDatafeed extends Generic {
}
export interface MlDeleteExpiredData<T = RequestBody> extends Generic {
job_id?: string;
requests_per_second?: number;
timeout?: string;
body?: T;
}
@ -1930,6 +1934,7 @@ export interface MlGetCategories<T = RequestBody> extends Generic {
category_id?: number;
from?: number;
size?: number;
partition_field_value?: string;
body?: T;
}

View File

@ -7250,7 +7250,8 @@ link:{ref}/ml-delete-calendar-job.html[Documentation] +
----
client.ml.deleteDataFrameAnalytics({
id: string,
force: boolean
force: boolean,
timeout: string
})
----
link:{ref}/delete-dfanalytics.html[Documentation] +
@ -7262,6 +7263,9 @@ link:{ref}/delete-dfanalytics.html[Documentation] +
|`force`
|`boolean` - True if the job should be forcefully deleted
|`timeout`
|`string` - Controls the time to wait until a job is deleted. Defaults to 1 minute
|===
=== ml.deleteDatafeed
@ -7289,12 +7293,24 @@ link:{ref}/ml-delete-datafeed.html[Documentation] +
[source,ts]
----
client.ml.deleteExpiredData({
job_id: string,
requests_per_second: number,
timeout: string,
body: object
})
----
link:{ref}/ml-delete-expired-data.html[Documentation] +
[cols=2*]
|===
|`job_id` or `jobId`
|`string` - The ID of the job(s) to perform expired data hygiene for
|`requests_per_second` or `requestsPerSecond`
|`number` - The desired requests per second for the deletion processes.
|`timeout`
|`string` - How long can the underlying delete processes run until they are canceled
|`body`
|`object` - deleting expired data parameters
@ -7733,6 +7749,7 @@ client.ml.getCategories({
category_id: number,
from: number,
size: number,
partition_field_value: string,
body: object
})
----
@ -7751,6 +7768,9 @@ link:{ref}/ml-get-category.html[Documentation] +
|`size`
|`number` - specifies a max number of categories to get
|`partition_field_value` or `partitionFieldValue`
|`string` - Specifies the partition to retrieve categories for. This is optional, and should never be used for jobs where per-partition categorization is disabled.
|`body`
|`object` - Category selection details if not provided in URI