Skip to content

Commit d5904a8

Browse files
committed
Update APIs to 8.8.0
1 parent 41cc5fa commit d5904a8

17 files changed

+2465
-816
lines changed

docs/reference.asciidoc

Lines changed: 559 additions & 389 deletions
Large diffs are not rendered by default.

src/api/api/cluster.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ export default class Cluster {
279279
async putComponentTemplate (this: That, params: T.ClusterPutComponentTemplateRequest | TB.ClusterPutComponentTemplateRequest, options?: TransportRequestOptions): Promise<T.ClusterPutComponentTemplateResponse>
280280
async putComponentTemplate (this: That, params: T.ClusterPutComponentTemplateRequest | TB.ClusterPutComponentTemplateRequest, options?: TransportRequestOptions): Promise<any> {
281281
const acceptedPath: string[] = ['name']
282-
const acceptedBody: string[] = ['template', 'aliases', 'mappings', 'settings', 'version', '_meta']
282+
const acceptedBody: string[] = ['template', 'version', '_meta', 'allow_auto_create']
283283
const querystring: Record<string, any> = {}
284284
// @ts-expect-error
285285
const userBody: any = params?.body

src/api/api/field_caps.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ import * as T from '../types'
3737
import * as TB from '../typesWithBodyKey'
3838
interface That { transport: Transport }
3939

40-
export default async function FieldCapsApi (this: That, params: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.FieldCapsResponse>
41-
export default async function FieldCapsApi (this: That, params: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.FieldCapsResponse, unknown>>
42-
export default async function FieldCapsApi (this: That, params: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptions): Promise<T.FieldCapsResponse>
43-
export default async function FieldCapsApi (this: That, params: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptions): Promise<any> {
40+
export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.FieldCapsResponse>
41+
export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.FieldCapsResponse, unknown>>
42+
export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptions): Promise<T.FieldCapsResponse>
43+
export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptions): Promise<any> {
4444
const acceptedPath: string[] = ['index']
45-
const acceptedBody: string[] = ['index_filter', 'runtime_mappings']
45+
const acceptedBody: string[] = ['fields', 'index_filter', 'runtime_mappings']
4646
const querystring: Record<string, any> = {}
4747
// @ts-expect-error
4848
const userBody: any = params?.body
@@ -53,6 +53,7 @@ export default async function FieldCapsApi (this: That, params: T.FieldCapsReque
5353
body = userBody != null ? { ...userBody } : undefined
5454
}
5555

56+
params = params ?? {}
5657
for (const key in params) {
5758
if (acceptedBody.includes(key)) {
5859
body = body ?? {}

src/api/api/health_report.ts

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
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 async function HealthReportApi (this: That, params?: T.HealthReportRequest | TB.HealthReportRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.HealthReportResponse>
41+
export default async function HealthReportApi (this: That, params?: T.HealthReportRequest | TB.HealthReportRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.HealthReportResponse, unknown>>
42+
export default async function HealthReportApi (this: That, params?: T.HealthReportRequest | TB.HealthReportRequest, options?: TransportRequestOptions): Promise<T.HealthReportResponse>
43+
export default async function HealthReportApi (this: That, params?: T.HealthReportRequest | TB.HealthReportRequest, options?: TransportRequestOptions): Promise<any> {
44+
const acceptedPath: string[] = ['feature']
45+
const querystring: Record<string, any> = {}
46+
const body = undefined
47+
48+
params = params ?? {}
49+
for (const key in params) {
50+
if (acceptedPath.includes(key)) {
51+
continue
52+
} else if (key !== 'body') {
53+
// @ts-expect-error
54+
querystring[key] = params[key]
55+
}
56+
}
57+
58+
let method = ''
59+
let path = ''
60+
if (params.feature != null) {
61+
method = 'GET'
62+
path = `/_health_report/${encodeURIComponent(params.feature.toString())}`
63+
} else {
64+
method = 'GET'
65+
path = '/_health_report'
66+
}
67+
return await this.transport.request({ path, method, querystring, body }, options)
68+
}

src/api/api/indices.ts

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,35 @@ export default class Indices {
330330
return await this.transport.request({ path, method, querystring, body }, options)
331331
}
332332

333+
async deleteDataLifecycle (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
334+
async deleteDataLifecycle (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
335+
async deleteDataLifecycle (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
336+
async deleteDataLifecycle (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
337+
const acceptedPath: string[] = ['name']
338+
const querystring: Record<string, any> = {}
339+
const body = undefined
340+
341+
params = params ?? {}
342+
for (const key in params) {
343+
if (acceptedPath.includes(key)) {
344+
continue
345+
} else if (key !== 'body') {
346+
querystring[key] = params[key]
347+
}
348+
}
349+
350+
let method = ''
351+
let path = ''
352+
if (params.name != null) {
353+
method = 'DELETE'
354+
path = `/_data_stream/${encodeURIComponent(params.name.toString())}/_lifecycle`
355+
} else {
356+
method = 'DELETE'
357+
path = '/_data_stream/_lifecycle'
358+
}
359+
return await this.transport.request({ path, method, querystring, body }, options)
360+
}
361+
333362
async deleteDataStream (this: That, params: T.IndicesDeleteDataStreamRequest | TB.IndicesDeleteDataStreamRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesDeleteDataStreamResponse>
334363
async deleteDataStream (this: That, params: T.IndicesDeleteDataStreamRequest | TB.IndicesDeleteDataStreamRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesDeleteDataStreamResponse, unknown>>
335364
async deleteDataStream (this: That, params: T.IndicesDeleteDataStreamRequest | TB.IndicesDeleteDataStreamRequest, options?: TransportRequestOptions): Promise<T.IndicesDeleteDataStreamResponse>
@@ -540,6 +569,28 @@ export default class Indices {
540569
return await this.transport.request({ path, method, querystring, body }, options)
541570
}
542571

572+
async explainDataLifecycle (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
573+
async explainDataLifecycle (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
574+
async explainDataLifecycle (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
575+
async explainDataLifecycle (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
576+
const acceptedPath: string[] = ['index']
577+
const querystring: Record<string, any> = {}
578+
const body = undefined
579+
580+
params = params ?? {}
581+
for (const key in params) {
582+
if (acceptedPath.includes(key)) {
583+
continue
584+
} else if (key !== 'body') {
585+
querystring[key] = params[key]
586+
}
587+
}
588+
589+
const method = 'POST'
590+
const path = `/${encodeURIComponent(params.index.toString())}/_lifecycle/explain`
591+
return await this.transport.request({ path, method, querystring, body }, options)
592+
}
593+
543594
async fieldUsageStats (this: That, params: T.IndicesFieldUsageStatsRequest | TB.IndicesFieldUsageStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesFieldUsageStatsResponse>
544595
async fieldUsageStats (this: That, params: T.IndicesFieldUsageStatsRequest | TB.IndicesFieldUsageStatsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesFieldUsageStatsResponse, unknown>>
545596
async fieldUsageStats (this: That, params: T.IndicesFieldUsageStatsRequest | TB.IndicesFieldUsageStatsRequest, options?: TransportRequestOptions): Promise<T.IndicesFieldUsageStatsResponse>
@@ -680,6 +731,35 @@ export default class Indices {
680731
return await this.transport.request({ path, method, querystring, body }, options)
681732
}
682733

734+
async getDataLifecycle (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
735+
async getDataLifecycle (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
736+
async getDataLifecycle (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
737+
async getDataLifecycle (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
738+
const acceptedPath: string[] = ['name']
739+
const querystring: Record<string, any> = {}
740+
const body = undefined
741+
742+
params = params ?? {}
743+
for (const key in params) {
744+
if (acceptedPath.includes(key)) {
745+
continue
746+
} else if (key !== 'body') {
747+
querystring[key] = params[key]
748+
}
749+
}
750+
751+
let method = ''
752+
let path = ''
753+
if (params.name != null) {
754+
method = 'GET'
755+
path = `/_data_stream/${encodeURIComponent(params.name.toString())}/_lifecycle`
756+
} else {
757+
method = 'GET'
758+
path = '/_data_stream/_lifecycle'
759+
}
760+
return await this.transport.request({ path, method, querystring, body }, options)
761+
}
762+
683763
async getDataStream (this: That, params?: T.IndicesGetDataStreamRequest | TB.IndicesGetDataStreamRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesGetDataStreamResponse>
684764
async getDataStream (this: That, params?: T.IndicesGetDataStreamRequest | TB.IndicesGetDataStreamRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesGetDataStreamResponse, unknown>>
685765
async getDataStream (this: That, params?: T.IndicesGetDataStreamRequest | TB.IndicesGetDataStreamRequest, options?: TransportRequestOptions): Promise<T.IndicesGetDataStreamResponse>
@@ -1006,6 +1086,35 @@ export default class Indices {
10061086
return await this.transport.request({ path, method, querystring, body }, options)
10071087
}
10081088

1089+
async putDataLifecycle (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
1090+
async putDataLifecycle (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
1091+
async putDataLifecycle (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
1092+
async putDataLifecycle (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
1093+
const acceptedPath: string[] = ['name']
1094+
const querystring: Record<string, any> = {}
1095+
const body = undefined
1096+
1097+
params = params ?? {}
1098+
for (const key in params) {
1099+
if (acceptedPath.includes(key)) {
1100+
continue
1101+
} else if (key !== 'body') {
1102+
querystring[key] = params[key]
1103+
}
1104+
}
1105+
1106+
let method = ''
1107+
let path = ''
1108+
if (params.name != null) {
1109+
method = 'PUT'
1110+
path = `/_data_stream/${encodeURIComponent(params.name.toString())}/_lifecycle`
1111+
} else {
1112+
method = 'PUT'
1113+
path = '/_data_stream/_lifecycle'
1114+
}
1115+
return await this.transport.request({ path, method, querystring, body }, options)
1116+
}
1117+
10091118
async putIndexTemplate (this: That, params: T.IndicesPutIndexTemplateRequest | TB.IndicesPutIndexTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesPutIndexTemplateResponse>
10101119
async putIndexTemplate (this: That, params: T.IndicesPutIndexTemplateRequest | TB.IndicesPutIndexTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesPutIndexTemplateResponse, unknown>>
10111120
async putIndexTemplate (this: That, params: T.IndicesPutIndexTemplateRequest | TB.IndicesPutIndexTemplateRequest, options?: TransportRequestOptions): Promise<T.IndicesPutIndexTemplateResponse>

src/api/api/license.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,10 @@ export default class License {
135135
return await this.transport.request({ path, method, querystring, body }, options)
136136
}
137137

138-
async post (this: That, params: T.LicensePostRequest | TB.LicensePostRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.LicensePostResponse>
139-
async post (this: That, params: T.LicensePostRequest | TB.LicensePostRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.LicensePostResponse, unknown>>
140-
async post (this: That, params: T.LicensePostRequest | TB.LicensePostRequest, options?: TransportRequestOptions): Promise<T.LicensePostResponse>
141-
async post (this: That, params: T.LicensePostRequest | TB.LicensePostRequest, options?: TransportRequestOptions): Promise<any> {
138+
async post (this: That, params?: T.LicensePostRequest | TB.LicensePostRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.LicensePostResponse>
139+
async post (this: That, params?: T.LicensePostRequest | TB.LicensePostRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.LicensePostResponse, unknown>>
140+
async post (this: That, params?: T.LicensePostRequest | TB.LicensePostRequest, options?: TransportRequestOptions): Promise<T.LicensePostResponse>
141+
async post (this: That, params?: T.LicensePostRequest | TB.LicensePostRequest, options?: TransportRequestOptions): Promise<any> {
142142
const acceptedPath: string[] = []
143143
const acceptedBody: string[] = ['license', 'licenses']
144144
const querystring: Record<string, any> = {}
@@ -151,6 +151,7 @@ export default class License {
151151
body = userBody != null ? { ...userBody } : undefined
152152
}
153153

154+
params = params ?? {}
154155
for (const key in params) {
155156
if (acceptedBody.includes(key)) {
156157
body = body ?? {}

src/api/api/logstash.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,15 @@ export default class Logstash {
8282
}
8383
}
8484

85-
const method = 'GET'
86-
const path = `/_logstash/pipeline/${encodeURIComponent(params.id.toString())}`
85+
let method = ''
86+
let path = ''
87+
if (params.id != null) {
88+
method = 'GET'
89+
path = `/_logstash/pipeline/${encodeURIComponent(params.id.toString())}`
90+
} else {
91+
method = 'GET'
92+
path = '/_logstash/pipeline'
93+
}
8794
return await this.transport.request({ path, method, querystring, body }, options)
8895
}
8996

0 commit comments

Comments
 (0)