Skip to content

Commit 395b782

Browse files
Auto-generated API code
1 parent 352f73e commit 395b782

File tree

13 files changed

+1202
-144
lines changed

13 files changed

+1202
-144
lines changed

docs/reference.asciidoc

Lines changed: 242 additions & 50 deletions
Large diffs are not rendered by default.

src/api/api/eql.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export default class Eql {
7171

7272
/**
7373
* Returns async results from previously executed Event Query Language (EQL) search
74-
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-eql-search-api.html | Elasticsearch API documentation}
74+
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-eql-search-api.html | Elasticsearch API documentation}
7575
*/
7676
async get<TEvent = unknown> (this: That, params: T.EqlGetRequest | TB.EqlGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.EqlGetResponse<TEvent>>
7777
async get<TEvent = unknown> (this: That, params: T.EqlGetRequest | TB.EqlGetRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.EqlGetResponse<TEvent>, unknown>>
@@ -97,7 +97,7 @@ export default class Eql {
9797

9898
/**
9999
* Returns the status of a previously submitted async or stored Event Query Language (EQL) search
100-
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-eql-status-api.html | Elasticsearch API documentation}
100+
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-eql-status-api.html | Elasticsearch API documentation}
101101
*/
102102
async getStatus (this: That, params: T.EqlGetStatusRequest | TB.EqlGetStatusRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.EqlGetStatusResponse>
103103
async getStatus (this: That, params: T.EqlGetStatusRequest | TB.EqlGetStatusRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.EqlGetStatusResponse, unknown>>

src/api/api/esql.ts

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
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+
/* eslint-disable import/export */
21+
/* eslint-disable @typescript-eslint/no-misused-new */
22+
/* eslint-disable @typescript-eslint/no-extraneous-class */
23+
/* eslint-disable @typescript-eslint/no-unused-vars */
24+
25+
// This file was automatically generated by elastic/elastic-client-generator-js
26+
// DO NOT MODIFY IT BY HAND. Instead, modify the source open api file,
27+
// and elastic/elastic-client-generator-js to regenerate this file again.
28+
29+
import {
30+
Transport,
31+
TransportRequestOptions,
32+
TransportRequestOptionsWithMeta,
33+
TransportRequestOptionsWithOutMeta,
34+
TransportResult
35+
} from '@elastic/transport'
36+
import * as T from '../types'
37+
import * as TB from '../typesWithBodyKey'
38+
interface That { transport: Transport }
39+
40+
export default class Esql {
41+
transport: Transport
42+
constructor (transport: Transport) {
43+
this.transport = transport
44+
}
45+
46+
/**
47+
* Executes an ESQL request
48+
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-rest.html | Elasticsearch API documentation}
49+
*/
50+
async query (this: That, params: T.EsqlQueryRequest | TB.EsqlQueryRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.EsqlQueryResponse>
51+
async query (this: That, params: T.EsqlQueryRequest | TB.EsqlQueryRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.EsqlQueryResponse, unknown>>
52+
async query (this: That, params: T.EsqlQueryRequest | TB.EsqlQueryRequest, options?: TransportRequestOptions): Promise<T.EsqlQueryResponse>
53+
async query (this: That, params: T.EsqlQueryRequest | TB.EsqlQueryRequest, options?: TransportRequestOptions): Promise<any> {
54+
const acceptedPath: string[] = []
55+
const acceptedBody: string[] = ['columnar', 'filter', 'locale', 'params', 'query']
56+
const querystring: Record<string, any> = {}
57+
// @ts-expect-error
58+
const userBody: any = params?.body
59+
let body: Record<string, any> | string
60+
if (typeof userBody === 'string') {
61+
body = userBody
62+
} else {
63+
body = userBody != null ? { ...userBody } : undefined
64+
}
65+
66+
for (const key in params) {
67+
if (acceptedBody.includes(key)) {
68+
body = body ?? {}
69+
// @ts-expect-error
70+
body[key] = params[key]
71+
} else if (acceptedPath.includes(key)) {
72+
continue
73+
} else if (key !== 'body') {
74+
// @ts-expect-error
75+
querystring[key] = params[key]
76+
}
77+
}
78+
79+
const method = 'POST'
80+
const path = '/_query'
81+
return await this.transport.request({ path, method, querystring, body }, options)
82+
}
83+
}

src/api/api/fleet.ts

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,56 @@ export default class Fleet {
4343
this.transport = transport
4444
}
4545

46+
/**
47+
* Deletes a secret stored by Fleet.
48+
*/
49+
async deleteSecret (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
50+
async deleteSecret (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
51+
async deleteSecret (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
52+
async deleteSecret (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
53+
const acceptedPath: string[] = ['id']
54+
const querystring: Record<string, any> = {}
55+
const body = undefined
56+
57+
params = params ?? {}
58+
for (const key in params) {
59+
if (acceptedPath.includes(key)) {
60+
continue
61+
} else if (key !== 'body') {
62+
querystring[key] = params[key]
63+
}
64+
}
65+
66+
const method = 'DELETE'
67+
const path = `/_fleet/secret/${encodeURIComponent(params.id.toString())}`
68+
return await this.transport.request({ path, method, querystring, body }, options)
69+
}
70+
71+
/**
72+
* Retrieves a secret stored by Fleet.
73+
*/
74+
async getSecret (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
75+
async getSecret (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
76+
async getSecret (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
77+
async getSecret (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
78+
const acceptedPath: string[] = ['id']
79+
const querystring: Record<string, any> = {}
80+
const body = undefined
81+
82+
params = params ?? {}
83+
for (const key in params) {
84+
if (acceptedPath.includes(key)) {
85+
continue
86+
} else if (key !== 'body') {
87+
querystring[key] = params[key]
88+
}
89+
}
90+
91+
const method = 'GET'
92+
const path = `/_fleet/secret/${encodeURIComponent(params.id.toString())}`
93+
return await this.transport.request({ path, method, querystring, body }, options)
94+
}
95+
4696
/**
4797
* Returns the current global checkpoints for an index. This API is design for internal use by the fleet server project.
4898
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-global-checkpoints.html | Elasticsearch API documentation}
@@ -106,6 +156,31 @@ export default class Fleet {
106156
return await this.transport.request({ path, method, querystring, bulkBody: body }, options)
107157
}
108158

159+
/**
160+
* Creates a secret stored by Fleet.
161+
*/
162+
async postSecret (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
163+
async postSecret (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
164+
async postSecret (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
165+
async postSecret (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
166+
const acceptedPath: string[] = []
167+
const querystring: Record<string, any> = {}
168+
const body = undefined
169+
170+
params = params ?? {}
171+
for (const key in params) {
172+
if (acceptedPath.includes(key)) {
173+
continue
174+
} else if (key !== 'body') {
175+
querystring[key] = params[key]
176+
}
177+
}
178+
179+
const method = 'POST'
180+
const path = '/_fleet/secret'
181+
return await this.transport.request({ path, method, querystring, body }, options)
182+
}
183+
109184
/**
110185
* Search API where the search will only be executed after specified checkpoints are available due to a refresh. This API is designed for internal use by the fleet server project.
111186
*/

src/api/api/indices.ts

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ export default class Indices {
424424

425425
/**
426426
* Deletes an index template.
427-
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html | Elasticsearch API documentation}
427+
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-delete-template.html | Elasticsearch API documentation}
428428
*/
429429
async deleteIndexTemplate (this: That, params: T.IndicesDeleteIndexTemplateRequest | TB.IndicesDeleteIndexTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesDeleteIndexTemplateResponse>
430430
async deleteIndexTemplate (this: That, params: T.IndicesDeleteIndexTemplateRequest | TB.IndicesDeleteIndexTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesDeleteIndexTemplateResponse, unknown>>
@@ -450,7 +450,7 @@ export default class Indices {
450450

451451
/**
452452
* Deletes an index template.
453-
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html | Elasticsearch API documentation}
453+
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-delete-template-v1.html | Elasticsearch API documentation}
454454
*/
455455
async deleteTemplate (this: That, params: T.IndicesDeleteTemplateRequest | TB.IndicesDeleteTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesDeleteTemplateResponse>
456456
async deleteTemplate (this: That, params: T.IndicesDeleteTemplateRequest | TB.IndicesDeleteTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesDeleteTemplateResponse, unknown>>
@@ -592,7 +592,7 @@ export default class Indices {
592592

593593
/**
594594
* Returns information about whether a particular index template exists.
595-
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html | Elasticsearch API documentation}
595+
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/index-templates.html | Elasticsearch API documentation}
596596
*/
597597
async existsIndexTemplate (this: That, params: T.IndicesExistsIndexTemplateRequest | TB.IndicesExistsIndexTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesExistsIndexTemplateResponse>
598598
async existsIndexTemplate (this: That, params: T.IndicesExistsIndexTemplateRequest | TB.IndicesExistsIndexTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesExistsIndexTemplateResponse, unknown>>
@@ -618,7 +618,7 @@ export default class Indices {
618618

619619
/**
620620
* Returns information about whether a particular index template exists.
621-
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html | Elasticsearch API documentation}
621+
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-template-exists-v1.html | Elasticsearch API documentation}
622622
*/
623623
async existsTemplate (this: That, params: T.IndicesExistsTemplateRequest | TB.IndicesExistsTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesExistsTemplateResponse>
624624
async existsTemplate (this: That, params: T.IndicesExistsTemplateRequest | TB.IndicesExistsTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesExistsTemplateResponse, unknown>>
@@ -923,7 +923,7 @@ export default class Indices {
923923

924924
/**
925925
* Returns an index template.
926-
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html | Elasticsearch API documentation}
926+
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-template.html | Elasticsearch API documentation}
927927
*/
928928
async getIndexTemplate (this: That, params?: T.IndicesGetIndexTemplateRequest | TB.IndicesGetIndexTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesGetIndexTemplateResponse>
929929
async getIndexTemplate (this: That, params?: T.IndicesGetIndexTemplateRequest | TB.IndicesGetIndexTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesGetIndexTemplateResponse, unknown>>
@@ -1031,7 +1031,7 @@ export default class Indices {
10311031

10321032
/**
10331033
* Returns an index template.
1034-
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html | Elasticsearch API documentation}
1034+
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-template-v1.html | Elasticsearch API documentation}
10351035
*/
10361036
async getTemplate (this: That, params?: T.IndicesGetTemplateRequest | TB.IndicesGetTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesGetTemplateResponse>
10371037
async getTemplate (this: That, params?: T.IndicesGetTemplateRequest | TB.IndicesGetTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesGetTemplateResponse, unknown>>
@@ -1264,7 +1264,7 @@ export default class Indices {
12641264

12651265
/**
12661266
* Creates or updates an index template.
1267-
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html | Elasticsearch API documentation}
1267+
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-put-template.html | Elasticsearch API documentation}
12681268
*/
12691269
async putIndexTemplate (this: That, params: T.IndicesPutIndexTemplateRequest | TB.IndicesPutIndexTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesPutIndexTemplateResponse>
12701270
async putIndexTemplate (this: That, params: T.IndicesPutIndexTemplateRequest | TB.IndicesPutIndexTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesPutIndexTemplateResponse, unknown>>
@@ -1378,7 +1378,7 @@ export default class Indices {
13781378

13791379
/**
13801380
* Creates or updates an index template.
1381-
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html | Elasticsearch API documentation}
1381+
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates-v1.html | Elasticsearch API documentation}
13821382
*/
13831383
async putTemplate (this: That, params: T.IndicesPutTemplateRequest | TB.IndicesPutTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesPutTemplateResponse>
13841384
async putTemplate (this: That, params: T.IndicesPutTemplateRequest | TB.IndicesPutTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesPutTemplateResponse, unknown>>
@@ -1508,6 +1508,32 @@ export default class Indices {
15081508
return await this.transport.request({ path, method, querystring, body }, options)
15091509
}
15101510

1511+
/**
1512+
* Resolves the specified index expressions to return information about each cluster, including the local cluster, if included.
1513+
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-resolve-cluster-api.html | Elasticsearch API documentation}
1514+
*/
1515+
async resolveCluster (this: That, params: T.IndicesResolveClusterRequest | TB.IndicesResolveClusterRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesResolveClusterResponse>
1516+
async resolveCluster (this: That, params: T.IndicesResolveClusterRequest | TB.IndicesResolveClusterRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesResolveClusterResponse, unknown>>
1517+
async resolveCluster (this: That, params: T.IndicesResolveClusterRequest | TB.IndicesResolveClusterRequest, options?: TransportRequestOptions): Promise<T.IndicesResolveClusterResponse>
1518+
async resolveCluster (this: That, params: T.IndicesResolveClusterRequest | TB.IndicesResolveClusterRequest, options?: TransportRequestOptions): Promise<any> {
1519+
const acceptedPath: string[] = ['name']
1520+
const querystring: Record<string, any> = {}
1521+
const body = undefined
1522+
1523+
for (const key in params) {
1524+
if (acceptedPath.includes(key)) {
1525+
continue
1526+
} else if (key !== 'body') {
1527+
// @ts-expect-error
1528+
querystring[key] = params[key]
1529+
}
1530+
}
1531+
1532+
const method = 'GET'
1533+
const path = `/_resolve/cluster/${encodeURIComponent(params.name.toString())}`
1534+
return await this.transport.request({ path, method, querystring, body }, options)
1535+
}
1536+
15111537
/**
15121538
* Returns information about any matching indices, aliases, and data streams
15131539
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-resolve-index-api.html | Elasticsearch API documentation}
@@ -1687,7 +1713,7 @@ export default class Indices {
16871713

16881714
/**
16891715
* Simulate matching the given index name against the index templates in the system
1690-
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html | Elasticsearch API documentation}
1716+
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-simulate-index.html | Elasticsearch API documentation}
16911717
*/
16921718
async simulateIndexTemplate (this: That, params: T.IndicesSimulateIndexTemplateRequest | TB.IndicesSimulateIndexTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesSimulateIndexTemplateResponse>
16931719
async simulateIndexTemplate (this: That, params: T.IndicesSimulateIndexTemplateRequest | TB.IndicesSimulateIndexTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesSimulateIndexTemplateResponse, unknown>>
@@ -1725,7 +1751,7 @@ export default class Indices {
17251751

17261752
/**
17271753
* Simulate resolving the given template name or body
1728-
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html | Elasticsearch API documentation}
1754+
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-simulate-template.html | Elasticsearch API documentation}
17291755
*/
17301756
async simulateTemplate (this: That, params: T.IndicesSimulateTemplateRequest | TB.IndicesSimulateTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesSimulateTemplateResponse>
17311757
async simulateTemplate (this: That, params: T.IndicesSimulateTemplateRequest | TB.IndicesSimulateTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesSimulateTemplateResponse, unknown>>

0 commit comments

Comments
 (0)