Skip to content

Commit f4f7c73

Browse files
committed
API generation
1 parent 20b7e93 commit f4f7c73

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
@@ -271,6 +271,11 @@ interface KibanaClient {
271271
postStartBasic<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.LicensePostStartBasic, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
272272
postStartTrial<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.LicensePostStartTrial, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
273273
}
274+
logstash: {
275+
deletePipeline<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.LogstashDeletePipeline, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
276+
getPipeline<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.LogstashGetPipeline, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
277+
putPipeline<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.LogstashPutPipeline<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
278+
}
274279
mget<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.Mget<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
275280
migration: {
276281
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
@@ -1431,6 +1431,19 @@ export interface LicensePostStartTrial extends Generic {
14311431
acknowledge?: boolean;
14321432
}
14331433

1434+
export interface LogstashDeletePipeline extends Generic {
1435+
id: string;
1436+
}
1437+
1438+
export interface LogstashGetPipeline extends Generic {
1439+
id: string;
1440+
}
1441+
1442+
export interface LogstashPutPipeline<T = RequestBody> extends Generic {
1443+
id: string;
1444+
body: T;
1445+
}
1446+
14341447
export interface Mget<T = RequestBody> extends Generic {
14351448
index?: string;
14361449
type?: string;
@@ -2144,6 +2157,7 @@ export interface SearchableSnapshotsMount<T = RequestBody> extends Generic {
21442157
snapshot: string;
21452158
master_timeout?: string;
21462159
wait_for_completion?: boolean;
2160+
storage?: string;
21472161
body: T;
21482162
}
21492163

docs/reference.asciidoc

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

59465946
|===
59475947

5948+
[discrete]
5949+
=== logstash.deletePipeline
5950+
5951+
[source,ts]
5952+
----
5953+
client.logstash.deletePipeline({
5954+
id: string
5955+
})
5956+
----
5957+
link:{ref}/logstash-api-delete-pipeline.html[Documentation] +
5958+
[cols=2*]
5959+
|===
5960+
|`id`
5961+
|`string` - The ID of the Pipeline
5962+
5963+
|===
5964+
5965+
[discrete]
5966+
=== logstash.getPipeline
5967+
5968+
[source,ts]
5969+
----
5970+
client.logstash.getPipeline({
5971+
id: string
5972+
})
5973+
----
5974+
link:{ref}/logstash-api-get-pipeline.html[Documentation] +
5975+
[cols=2*]
5976+
|===
5977+
|`id`
5978+
|`string` - A comma-separated list of Pipeline IDs
5979+
5980+
|===
5981+
5982+
[discrete]
5983+
=== logstash.putPipeline
5984+
5985+
[source,ts]
5986+
----
5987+
client.logstash.putPipeline({
5988+
id: string,
5989+
body: object
5990+
})
5991+
----
5992+
link:{ref}/logstash-api-put-pipeline.html[Documentation] +
5993+
[cols=2*]
5994+
|===
5995+
|`id`
5996+
|`string` - The ID of the Pipeline
5997+
5998+
|`body`
5999+
|`object` - The Pipeline to add or update
6000+
6001+
|===
6002+
59486003
[discrete]
59496004
=== mget
59506005

@@ -8937,6 +8992,7 @@ client.searchableSnapshots.mount({
89378992
snapshot: string,
89388993
master_timeout: string,
89398994
wait_for_completion: boolean,
8995+
storage: string,
89408996
body: object
89418997
})
89428998
----
@@ -8955,6 +9011,9 @@ link:{ref}/searchable-snapshots-api-mount-snapshot.html[Documentation] +
89559011
|`wait_for_completion` or `waitForCompletion`
89569012
|`boolean` - Should this request wait until the operation has completed before returning
89579013

9014+
|`storage`
9015+
|`string` - Selects the kind of local storage used to accelerate searches. Experimental, and defaults to `full_copy`
9016+
89589017
|`body`
89599018
|`object` - The restore configuration for mounting the snapshot as searchable
89609019

index.d.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1286,6 +1286,32 @@ declare class Client {
12861286
postStartTrial<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.LicensePostStartTrial, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
12871287
postStartTrial<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.LicensePostStartTrial, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
12881288
}
1289+
logstash: {
1290+
delete_pipeline<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.LogstashDeletePipeline, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
1291+
delete_pipeline<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1292+
delete_pipeline<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.LogstashDeletePipeline, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1293+
delete_pipeline<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.LogstashDeletePipeline, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1294+
deletePipeline<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.LogstashDeletePipeline, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
1295+
deletePipeline<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1296+
deletePipeline<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.LogstashDeletePipeline, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1297+
deletePipeline<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.LogstashDeletePipeline, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1298+
get_pipeline<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.LogstashGetPipeline, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
1299+
get_pipeline<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1300+
get_pipeline<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.LogstashGetPipeline, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1301+
get_pipeline<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.LogstashGetPipeline, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1302+
getPipeline<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.LogstashGetPipeline, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
1303+
getPipeline<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1304+
getPipeline<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.LogstashGetPipeline, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1305+
getPipeline<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.LogstashGetPipeline, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1306+
put_pipeline<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.LogstashPutPipeline<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
1307+
put_pipeline<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1308+
put_pipeline<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.LogstashPutPipeline<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1309+
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
1310+
putPipeline<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.LogstashPutPipeline<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
1311+
putPipeline<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1312+
putPipeline<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.LogstashPutPipeline<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1313+
putPipeline<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.LogstashPutPipeline<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
1314+
}
12891315
mget<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.Mget<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
12901316
mget<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
12911317
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)