Skip to content

Commit 19acc4f

Browse files
committed
API generation
1 parent 2409bd0 commit 19acc4f

File tree

7 files changed

+241
-1
lines changed

7 files changed

+241
-1
lines changed

api/api/logstash.js

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
'use strict'
21+
22+
/* eslint camelcase: 0 */
23+
/* eslint no-unused-vars: 0 */
24+
25+
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
26+
const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path']
27+
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }
28+
29+
function LogstashApi (transport, ConfigurationError) {
30+
this.transport = transport
31+
this[kConfigurationError] = ConfigurationError
32+
}
33+
34+
LogstashApi.prototype.deletePipeline = function logstashDeletePipelineApi (params, options, callback) {
35+
;[params, options, callback] = normalizeArguments(params, options, callback)
36+
37+
// check required parameters
38+
if (params['id'] == null) {
39+
const err = new this[kConfigurationError]('Missing required parameter: id')
40+
return handleError(err, callback)
41+
}
42+
43+
var { method, body, id, ...querystring } = params
44+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
45+
46+
var path = ''
47+
if (method == null) method = 'DELETE'
48+
path = '/' + '_logstash' + '/' + 'pipeline' + '/' + encodeURIComponent(id)
49+
50+
// build request object
51+
const request = {
52+
method,
53+
path,
54+
body: body || '',
55+
querystring
56+
}
57+
58+
return this.transport.request(request, options, callback)
59+
}
60+
61+
LogstashApi.prototype.getPipeline = function logstashGetPipelineApi (params, options, callback) {
62+
;[params, options, callback] = normalizeArguments(params, options, callback)
63+
64+
// check required parameters
65+
if (params['id'] == null) {
66+
const err = new this[kConfigurationError]('Missing required parameter: id')
67+
return handleError(err, callback)
68+
}
69+
70+
var { method, body, id, ...querystring } = params
71+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
72+
73+
var path = ''
74+
if (method == null) method = 'GET'
75+
path = '/' + '_logstash' + '/' + 'pipeline' + '/' + encodeURIComponent(id)
76+
77+
// build request object
78+
const request = {
79+
method,
80+
path,
81+
body: null,
82+
querystring
83+
}
84+
85+
return this.transport.request(request, options, callback)
86+
}
87+
88+
LogstashApi.prototype.putPipeline = function logstashPutPipelineApi (params, options, callback) {
89+
;[params, options, callback] = normalizeArguments(params, options, callback)
90+
91+
// check required parameters
92+
if (params['id'] == null) {
93+
const err = new this[kConfigurationError]('Missing required parameter: id')
94+
return handleError(err, callback)
95+
}
96+
if (params['body'] == null) {
97+
const err = new this[kConfigurationError]('Missing required parameter: body')
98+
return handleError(err, callback)
99+
}
100+
101+
var { method, body, id, ...querystring } = params
102+
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
103+
104+
var path = ''
105+
if (method == null) method = 'PUT'
106+
path = '/' + '_logstash' + '/' + 'pipeline' + '/' + encodeURIComponent(id)
107+
108+
// build request object
109+
const request = {
110+
method,
111+
path,
112+
body: body || '',
113+
querystring
114+
}
115+
116+
return this.transport.request(request, options, callback)
117+
}
118+
119+
Object.defineProperties(LogstashApi.prototype, {
120+
delete_pipeline: { get () { return this.deletePipeline } },
121+
get_pipeline: { get () { return this.getPipeline } },
122+
put_pipeline: { get () { return this.putPipeline } }
123+
})
124+
125+
module.exports = LogstashApi

api/api/searchable_snapshots.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
/* eslint no-unused-vars: 0 */
2424

2525
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
26-
const acceptedQuerystring = ['ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'index', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'master_timeout', 'wait_for_completion']
26+
const acceptedQuerystring = ['ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'index', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'master_timeout', 'wait_for_completion', 'storage']
2727
const snakeCase = { ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices', expandWildcards: 'expand_wildcards', errorTrace: 'error_trace', filterPath: 'filter_path', masterTimeout: 'master_timeout', waitForCompletion: 'wait_for_completion' }
2828

2929
function SearchableSnapshotsApi (transport, ConfigurationError) {

api/index.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ const EqlApi = require('./api/eql')
7474
const GraphApi = require('./api/graph')
7575
const IlmApi = require('./api/ilm')
7676
const LicenseApi = require('./api/license')
77+
const LogstashApi = require('./api/logstash')
7778
const MigrationApi = require('./api/migration')
7879
const MlApi = require('./api/ml')
7980
const MonitoringApi = require('./api/monitoring')
@@ -106,6 +107,7 @@ const kEql = Symbol('Eql')
106107
const kGraph = Symbol('Graph')
107108
const kIlm = Symbol('Ilm')
108109
const kLicense = Symbol('License')
110+
const kLogstash = Symbol('Logstash')
109111
const kMigration = Symbol('Migration')
110112
const kMl = Symbol('Ml')
111113
const kMonitoring = Symbol('Monitoring')
@@ -138,6 +140,7 @@ function ESAPI (opts) {
138140
this[kGraph] = null
139141
this[kIlm] = null
140142
this[kLicense] = null
143+
this[kLogstash] = null
141144
this[kMigration] = null
142145
this[kMl] = null
143146
this[kMonitoring] = null
@@ -346,6 +349,14 @@ Object.defineProperties(ESAPI.prototype, {
346349
return this[kLicense]
347350
}
348351
},
352+
logstash: {
353+
get () {
354+
if (this[kLogstash] === null) {
355+
this[kLogstash] = new LogstashApi(this.transport, this[kConfigurationError])
356+
}
357+
return this[kLogstash]
358+
}
359+
},
349360
migration: {
350361
get () {
351362
if (this[kMigration] === null) {

api/kibana.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,11 @@ interface KibanaClient {
268268
postStartBasic<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.LicensePostStartBasic, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
269269
postStartTrial<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.LicensePostStartTrial, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
270270
}
271+
logstash: {
272+
deletePipeline<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.LogstashDeletePipeline, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
273+
getPipeline<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.LogstashGetPipeline, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
274+
putPipeline<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.LogstashPutPipeline<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
275+
}
271276
mget<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.Mget<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
272277
migration: {
273278
deprecations<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MigrationDeprecations, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>

api/requestParams.d.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1399,6 +1399,19 @@ export interface LicensePostStartTrial extends Generic {
13991399
acknowledge?: boolean;
14001400
}
14011401

1402+
export interface LogstashDeletePipeline extends Generic {
1403+
id: string;
1404+
}
1405+
1406+
export interface LogstashGetPipeline extends Generic {
1407+
id: string;
1408+
}
1409+
1410+
export interface LogstashPutPipeline<T = RequestBody> extends Generic {
1411+
id: string;
1412+
body: T;
1413+
}
1414+
14021415
export interface Mget<T = RequestBody> extends Generic {
14031416
index?: string;
14041417
_source_exclude?: string | string[];
@@ -2110,6 +2123,7 @@ export interface SearchableSnapshotsMount<T = RequestBody> extends Generic {
21102123
snapshot: string;
21112124
master_timeout?: string;
21122125
wait_for_completion?: boolean;
2126+
storage?: string;
21132127
body: T;
21142128
}
21152129

docs/reference.asciidoc

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5723,6 +5723,61 @@ link:{ref}/start-trial.html[Documentation] +
57235723

57245724
|===
57255725

5726+
[discrete]
5727+
=== logstash.deletePipeline
5728+
5729+
[source,ts]
5730+
----
5731+
client.logstash.deletePipeline({
5732+
id: string
5733+
})
5734+
----
5735+
link:{ref}/logstash-api-delete-pipeline.html[Documentation] +
5736+
[cols=2*]
5737+
|===
5738+
|`id`
5739+
|`string` - The ID of the Pipeline
5740+
5741+
|===
5742+
5743+
[discrete]
5744+
=== logstash.getPipeline
5745+
5746+
[source,ts]
5747+
----
5748+
client.logstash.getPipeline({
5749+
id: string
5750+
})
5751+
----
5752+
link:{ref}/logstash-api-get-pipeline.html[Documentation] +
5753+
[cols=2*]
5754+
|===
5755+
|`id`
5756+
|`string` - A comma-separated list of Pipeline IDs
5757+
5758+
|===
5759+
5760+
[discrete]
5761+
=== logstash.putPipeline
5762+
5763+
[source,ts]
5764+
----
5765+
client.logstash.putPipeline({
5766+
id: string,
5767+
body: object
5768+
})
5769+
----
5770+
link:{ref}/logstash-api-put-pipeline.html[Documentation] +
5771+
[cols=2*]
5772+
|===
5773+
|`id`
5774+
|`string` - The ID of the Pipeline
5775+
5776+
|`body`
5777+
|`object` - The Pipeline to add or update
5778+
5779+
|===
5780+
57265781
[discrete]
57275782
=== mget
57285783

@@ -8689,6 +8744,7 @@ client.searchableSnapshots.mount({
86898744
snapshot: string,
86908745
master_timeout: string,
86918746
wait_for_completion: boolean,
8747+
storage: string,
86928748
body: object
86938749
})
86948750
----
@@ -8707,6 +8763,9 @@ link:{ref}/searchable-snapshots-api-mount-snapshot.html[Documentation] +
87078763
|`wait_for_completion` or `waitForCompletion`
87088764
|`boolean` - Should this request wait until the operation has completed before returning
87098765

8766+
|`storage`
8767+
|`string` - Selects the kind of local storage used to accelerate searches. Experimental, and defaults to `full_copy`
8768+
87108769
|`body`
87118770
|`object` - The restore configuration for mounting the snapshot as searchable
87128771

index.d.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1266,6 +1266,32 @@ declare class Client {
12661266
postStartTrial<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.LicensePostStartTrial, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
12671267
postStartTrial<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.LicensePostStartTrial, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
12681268
}
1269+
logstash: {
1270+
delete_pipeline<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.LogstashDeletePipeline, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
1271+
delete_pipeline<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1272+
delete_pipeline<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.LogstashDeletePipeline, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1273+
delete_pipeline<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.LogstashDeletePipeline, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1274+
deletePipeline<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.LogstashDeletePipeline, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
1275+
deletePipeline<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1276+
deletePipeline<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.LogstashDeletePipeline, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1277+
deletePipeline<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.LogstashDeletePipeline, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1278+
get_pipeline<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.LogstashGetPipeline, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
1279+
get_pipeline<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1280+
get_pipeline<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.LogstashGetPipeline, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1281+
get_pipeline<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.LogstashGetPipeline, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1282+
getPipeline<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.LogstashGetPipeline, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
1283+
getPipeline<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1284+
getPipeline<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.LogstashGetPipeline, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1285+
getPipeline<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.LogstashGetPipeline, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1286+
put_pipeline<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.LogstashPutPipeline<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
1287+
put_pipeline<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1288+
put_pipeline<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.LogstashPutPipeline<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1289+
put_pipeline<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.LogstashPutPipeline<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1290+
putPipeline<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.LogstashPutPipeline<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
1291+
putPipeline<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1292+
putPipeline<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.LogstashPutPipeline<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1293+
putPipeline<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.LogstashPutPipeline<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1294+
}
12691295
mget<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.Mget<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
12701296
mget<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
12711297
mget<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.Mget<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback

0 commit comments

Comments
 (0)