Revert "API generation"

This reverts commit 7c5992131b.
This commit is contained in:
delvedor
2019-07-24 14:12:47 +02:00
parent 7c5992131b
commit 0039fad487
13 changed files with 9 additions and 434 deletions

View File

@ -11,7 +11,7 @@ function buildClearScroll (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [clear_scroll](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-body.html#request-body-search-scroll) request
* Perform a [clear_scroll](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-body.html#search-request-scroll) request
*
* @param {list} scroll_id - A comma-separated list of scroll IDs to clear
* @param {object} body - A comma-separated list of scroll IDs to clear if none was specified via the scroll_id parameter

View File

@ -14,11 +14,10 @@ function buildDataFrameDeleteDataFrameTransform (opts) {
* Perform a [data_frame.delete_data_frame_transform](https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-data-frame-transform.html) request
*
* @param {string} transform_id - The id of the transform to delete
* @param {boolean} force - When `true`, the transform is deleted regardless of its current state. The default value is `false`, meaning that the transform must be `stopped` before it can be deleted.
*/
const acceptedQuerystring = [
'force'
]
const snakeCase = {

View File

@ -14,16 +14,15 @@ function buildDataFramePutDataFrameTransform (opts) {
* Perform a [data_frame.put_data_frame_transform](https://www.elastic.co/guide/en/elasticsearch/reference/current/put-data-frame-transform.html) request
*
* @param {string} transform_id - The id of the new transform.
* @param {boolean} defer_validation - If validations should be deferred until data frame transform starts, defaults to false.
* @param {object} body - The data frame transform definition
*/
const acceptedQuerystring = [
'defer_validation'
]
const snakeCase = {
deferValidation: 'defer_validation'
}
return function dataFramePutDataFrameTransform (params, options, callback) {

View File

@ -11,7 +11,7 @@ function buildIndicesFlushSynced (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [indices.flush_synced](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-flush.html#synced-flush-api) request
* Perform a [indices.flush_synced](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-synced-flush.html) request
*
* @param {list} index - A comma-separated list of index names; use `_all` or empty string for all indices
* @param {boolean} ignore_unavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)

View File

@ -11,7 +11,7 @@ function buildScroll (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [scroll](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-body.html#request-body-search-scroll) request
* Perform a [scroll](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-body.html#search-request-scroll) request
*
* @param {string} scroll_id - The scroll ID
* @param {time} scroll - Specify how long a consistent view of the index should be maintained for scrolled search

View File

@ -1,81 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildSlmDeleteLifecycle (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [slm.delete_lifecycle](https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api.html) request
*
* @param {string} policy - The id of the snapshot lifecycle policy to remove
*/
const acceptedQuerystring = [
]
const snakeCase = {
}
return function slmDeleteLifecycle (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// check required parameters
if (params.body != null) {
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, policy, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
if (method == null) {
method = 'DELETE'
}
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
path = '/' + '_slm' + '/' + 'policy' + '/' + encodeURIComponent(policy_id || policyId)
// build request object
const request = {
method,
path,
body: '',
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildSlmDeleteLifecycle

View File

@ -1,81 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildSlmExecuteLifecycle (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [slm.execute_lifecycle](https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api.html) request
*
* @param {string} policy_id - The id of the snapshot lifecycle policy to be executed
*/
const acceptedQuerystring = [
]
const snakeCase = {
}
return function slmExecuteLifecycle (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// check required parameters
if (params.body != null) {
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, policyId, policy_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
if (method == null) {
method = 'PUT'
}
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
path = '/' + '_slm' + '/' + 'policy' + '/' + encodeURIComponent(policy_id || policyId) + '/' + '_execute'
// build request object
const request = {
method,
path,
body: '',
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildSlmExecuteLifecycle

View File

@ -1,85 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildSlmGetLifecycle (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [slm.get_lifecycle](https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api.html) request
*
* @param {string} policy_id - Comma-separated list of snapshot lifecycle policies to retrieve
*/
const acceptedQuerystring = [
]
const snakeCase = {
}
return function slmGetLifecycle (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// check required parameters
if (params.body != null) {
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, policyId, policy_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
if (method == null) {
method = 'GET'
}
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
if ((policy_id || policyId) != null) {
path = '/' + '_slm' + '/' + 'policy' + '/' + encodeURIComponent(policy_id || policyId)
} else {
path = '/' + '_slm' + '/' + 'policy'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildSlmGetLifecycle

View File

@ -1,76 +0,0 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildSlmPutLifecycle (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [slm.put_lifecycle](https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api.html) request
*
* @param {string} policy_id - The id of the snapshot lifecycle policy
* @param {object} body - The snapshot lifecycle policy definition to register
*/
const acceptedQuerystring = [
]
const snakeCase = {
}
return function slmPutLifecycle (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = []
var { method, body, policyId, policy_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
if (method == null) {
method = 'PUT'
}
var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}
var path = ''
path = '/' + '_slm' + '/' + 'policy' + '/' + encodeURIComponent(policy_id || policyId)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}
module.exports = buildSlmPutLifecycle

View File

@ -457,16 +457,6 @@ function ESAPI (opts) {
put_user: lazyLoad('security.put_user', opts),
putUser: lazyLoad('security.put_user', opts)
},
slm: {
delete_lifecycle: lazyLoad('slm.delete_lifecycle', opts),
deleteLifecycle: lazyLoad('slm.delete_lifecycle', opts),
execute_lifecycle: lazyLoad('slm.execute_lifecycle', opts),
executeLifecycle: lazyLoad('slm.execute_lifecycle', opts),
get_lifecycle: lazyLoad('slm.get_lifecycle', opts),
getLifecycle: lazyLoad('slm.get_lifecycle', opts),
put_lifecycle: lazyLoad('slm.put_lifecycle', opts),
putLifecycle: lazyLoad('slm.put_lifecycle', opts)
},
snapshot: {
create: lazyLoad('snapshot.create', opts),
create_repository: lazyLoad('snapshot.create_repository', opts),

View File

@ -1365,7 +1365,6 @@ export interface CcrUnfollow extends Generic {
export interface DataFrameDeleteDataFrameTransform extends Generic {
transform_id: string;
force?: boolean;
}
export interface DataFrameGetDataFrameTransform extends Generic {
@ -1388,7 +1387,6 @@ export interface DataFramePreviewDataFrameTransform<T = any> extends Generic {
export interface DataFramePutDataFrameTransform<T = any> extends Generic {
transform_id: string;
defer_validation?: boolean;
body: T;
}
@ -2028,23 +2026,6 @@ export interface SecurityPutUser<T = any> extends Generic {
body: T;
}
export interface SlmDeleteLifecycle extends Generic {
policy?: string;
}
export interface SlmExecuteLifecycle extends Generic {
policy_id?: string;
}
export interface SlmGetLifecycle extends Generic {
policy_id?: string;
}
export interface SlmPutLifecycle<T = any> extends Generic {
policy_id?: string;
body?: T;
}
export interface SqlClearCursor<T = any> extends Generic {
body: T;
}