API generation
This commit is contained in:
77
api/api/autoscaling.get_autoscaling_policy.js
Normal file
77
api/api/autoscaling.get_autoscaling_policy.js
Normal file
@ -0,0 +1,77 @@
|
||||
// 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 buildAutoscalingGetAutoscalingPolicy (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
|
||||
|
||||
const acceptedQuerystring = [
|
||||
|
||||
]
|
||||
|
||||
const snakeCase = {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a autoscaling.get_autoscaling_policy request
|
||||
* https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-get-autoscaling-policy.html
|
||||
*/
|
||||
return function autoscalingGetAutoscalingPolicy (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['name'] == null) {
|
||||
const err = new ConfigurationError('Missing required parameter: name')
|
||||
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, name, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||
|
||||
var ignore = options.ignore
|
||||
if (typeof ignore === 'number') {
|
||||
options.ignore = [ignore]
|
||||
}
|
||||
|
||||
var path = ''
|
||||
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_autoscaling' + '/' + 'policy' + '/' + encodeURIComponent(name)
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
options.warnings = warnings.length === 0 ? null : warnings
|
||||
return makeRequest(request, options, callback)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = buildAutoscalingGetAutoscalingPolicy
|
||||
@ -31,6 +31,8 @@ function ESAPI (opts) {
|
||||
deleteAutoscalingPolicy: lazyLoad('autoscaling.delete_autoscaling_policy', opts),
|
||||
get_autoscaling_decision: lazyLoad('autoscaling.get_autoscaling_decision', opts),
|
||||
getAutoscalingDecision: lazyLoad('autoscaling.get_autoscaling_decision', opts),
|
||||
get_autoscaling_policy: lazyLoad('autoscaling.get_autoscaling_policy', opts),
|
||||
getAutoscalingPolicy: lazyLoad('autoscaling.get_autoscaling_policy', opts),
|
||||
put_autoscaling_policy: lazyLoad('autoscaling.put_autoscaling_policy', opts),
|
||||
putAutoscalingPolicy: lazyLoad('autoscaling.put_autoscaling_policy', opts)
|
||||
},
|
||||
|
||||
6
api/requestParams.d.ts
vendored
6
api/requestParams.d.ts
vendored
@ -723,7 +723,7 @@ export interface IndicesGetAlias extends Generic {
|
||||
}
|
||||
|
||||
export interface IndicesGetDataStreams extends Generic {
|
||||
name?: string | string[];
|
||||
name?: string;
|
||||
}
|
||||
|
||||
export interface IndicesGetFieldMapping extends Generic {
|
||||
@ -1437,6 +1437,10 @@ export interface AutoscalingDeleteAutoscalingPolicy extends Generic {
|
||||
export interface AutoscalingGetAutoscalingDecision extends Generic {
|
||||
}
|
||||
|
||||
export interface AutoscalingGetAutoscalingPolicy extends Generic {
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface AutoscalingPutAutoscalingPolicy<T = RequestBody> extends Generic {
|
||||
name: string;
|
||||
body: T;
|
||||
|
||||
@ -2905,14 +2905,14 @@ _Default:_ `all`
|
||||
[source,ts]
|
||||
----
|
||||
client.indices.getDataStreams({
|
||||
name: string | string[]
|
||||
name: string
|
||||
})
|
||||
----
|
||||
link:{ref}/data-streams.html[Documentation] +
|
||||
[cols=2*]
|
||||
|===
|
||||
|`name`
|
||||
|`string \| string[]` - The comma separated names of data streams
|
||||
|`string` - The name or wildcard expression of the requested data streams
|
||||
|
||||
|===
|
||||
|
||||
@ -5779,6 +5779,22 @@ client.autoscaling.getAutoscalingDecision()
|
||||
link:{ref}/autoscaling-get-autoscaling-decision.html[Documentation] +
|
||||
|
||||
|
||||
=== autoscaling.getAutoscalingPolicy
|
||||
*Stability:* experimental
|
||||
[source,ts]
|
||||
----
|
||||
client.autoscaling.getAutoscalingPolicy({
|
||||
name: string
|
||||
})
|
||||
----
|
||||
link:{ref}/autoscaling-get-autoscaling-policy.html[Documentation] +
|
||||
[cols=2*]
|
||||
|===
|
||||
|`name`
|
||||
|`string` - the name of the autoscaling policy
|
||||
|
||||
|===
|
||||
|
||||
=== autoscaling.putAutoscalingPolicy
|
||||
*Stability:* experimental
|
||||
[source,ts]
|
||||
|
||||
8
index.d.ts
vendored
8
index.d.ts
vendored
@ -158,6 +158,14 @@ declare class Client extends EventEmitter {
|
||||
getAutoscalingDecision<TResponse = ResponseBody, TContext = unknown>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
getAutoscalingDecision<TResponse = ResponseBody, TContext = unknown>(params: RequestParams.AutoscalingGetAutoscalingDecision, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
getAutoscalingDecision<TResponse = ResponseBody, TContext = unknown>(params: RequestParams.AutoscalingGetAutoscalingDecision, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
get_autoscaling_policy<TResponse = ResponseBody, TContext = unknown>(params?: RequestParams.AutoscalingGetAutoscalingPolicy, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
get_autoscaling_policy<TResponse = ResponseBody, TContext = unknown>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
get_autoscaling_policy<TResponse = ResponseBody, TContext = unknown>(params: RequestParams.AutoscalingGetAutoscalingPolicy, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
get_autoscaling_policy<TResponse = ResponseBody, TContext = unknown>(params: RequestParams.AutoscalingGetAutoscalingPolicy, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
getAutoscalingPolicy<TResponse = ResponseBody, TContext = unknown>(params?: RequestParams.AutoscalingGetAutoscalingPolicy, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getAutoscalingPolicy<TResponse = ResponseBody, TContext = unknown>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
getAutoscalingPolicy<TResponse = ResponseBody, TContext = unknown>(params: RequestParams.AutoscalingGetAutoscalingPolicy, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
getAutoscalingPolicy<TResponse = ResponseBody, TContext = unknown>(params: RequestParams.AutoscalingGetAutoscalingPolicy, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
put_autoscaling_policy<TRequestBody extends RequestBody, TResponse = ResponseBody, TContext = unknown>(params?: RequestParams.AutoscalingPutAutoscalingPolicy<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
put_autoscaling_policy<TRequestBody extends RequestBody, TResponse = ResponseBody, TContext = unknown>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
put_autoscaling_policy<TRequestBody extends RequestBody, TResponse = ResponseBody, TContext = unknown>(params: RequestParams.AutoscalingPutAutoscalingPolicy<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
|
||||
Reference in New Issue
Block a user