Skip to content

Commit e7c5b3d

Browse files
committed
API generation
1 parent 10277e2 commit e7c5b3d

File tree

6 files changed

+191
-71
lines changed

6 files changed

+191
-71
lines changed

src/api/api/ml.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -937,6 +937,35 @@ export default class Ml {
937937
return await this.transport.request({ path, method, querystring, body }, options)
938938
}
939939

940+
async getMemoryStats (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
941+
async getMemoryStats (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
942+
async getMemoryStats (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
943+
async getMemoryStats (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
944+
const acceptedPath: string[] = ['node_id']
945+
const querystring: Record<string, any> = {}
946+
const body = undefined
947+
948+
params = params ?? {}
949+
for (const key in params) {
950+
if (acceptedPath.includes(key)) {
951+
continue
952+
} else if (key !== 'body') {
953+
querystring[key] = params[key]
954+
}
955+
}
956+
957+
let method = ''
958+
let path = ''
959+
if (params.node_id != null) {
960+
method = 'GET'
961+
path = `/_ml/memory/${encodeURIComponent(params.node_id.toString())}/_stats`
962+
} else {
963+
method = 'GET'
964+
path = '/_ml/memory/_stats'
965+
}
966+
return await this.transport.request({ path, method, querystring, body }, options)
967+
}
968+
940969
async getModelSnapshotUpgradeStats (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
941970
async getModelSnapshotUpgradeStats (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
942971
async getModelSnapshotUpgradeStats (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>

src/api/api/security.ts

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -954,6 +954,72 @@ export default class Security {
954954
return await this.transport.request({ path, method, querystring, body }, options)
955955
}
956956

957+
async oidcAuthenticate (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
958+
async oidcAuthenticate (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
959+
async oidcAuthenticate (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
960+
async oidcAuthenticate (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
961+
const acceptedPath: string[] = []
962+
const querystring: Record<string, any> = {}
963+
const body = undefined
964+
965+
params = params ?? {}
966+
for (const key in params) {
967+
if (acceptedPath.includes(key)) {
968+
continue
969+
} else if (key !== 'body') {
970+
querystring[key] = params[key]
971+
}
972+
}
973+
974+
const method = 'POST'
975+
const path = '/_security/oidc/authenticate'
976+
return await this.transport.request({ path, method, querystring, body }, options)
977+
}
978+
979+
async oidcLogout (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
980+
async oidcLogout (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
981+
async oidcLogout (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
982+
async oidcLogout (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
983+
const acceptedPath: string[] = []
984+
const querystring: Record<string, any> = {}
985+
const body = undefined
986+
987+
params = params ?? {}
988+
for (const key in params) {
989+
if (acceptedPath.includes(key)) {
990+
continue
991+
} else if (key !== 'body') {
992+
querystring[key] = params[key]
993+
}
994+
}
995+
996+
const method = 'POST'
997+
const path = '/_security/oidc/logout'
998+
return await this.transport.request({ path, method, querystring, body }, options)
999+
}
1000+
1001+
async oidcPrepareAuthentication (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
1002+
async oidcPrepareAuthentication (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
1003+
async oidcPrepareAuthentication (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
1004+
async oidcPrepareAuthentication (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
1005+
const acceptedPath: string[] = []
1006+
const querystring: Record<string, any> = {}
1007+
const body = undefined
1008+
1009+
params = params ?? {}
1010+
for (const key in params) {
1011+
if (acceptedPath.includes(key)) {
1012+
continue
1013+
} else if (key !== 'body') {
1014+
querystring[key] = params[key]
1015+
}
1016+
}
1017+
1018+
const method = 'POST'
1019+
const path = '/_security/oidc/prepare'
1020+
return await this.transport.request({ path, method, querystring, body }, options)
1021+
}
1022+
9571023
async putPrivileges (this: That, params: T.SecurityPutPrivilegesRequest | TB.SecurityPutPrivilegesRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SecurityPutPrivilegesResponse>
9581024
async putPrivileges (this: That, params: T.SecurityPutPrivilegesRequest | TB.SecurityPutPrivilegesRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SecurityPutPrivilegesResponse, unknown>>
9591025
async putPrivileges (this: That, params: T.SecurityPutPrivilegesRequest | TB.SecurityPutPrivilegesRequest, options?: TransportRequestOptions): Promise<T.SecurityPutPrivilegesResponse>

src/api/kibana.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,7 @@ interface KibanaClient {
306306
getInfluencers: <TContext = unknown>(params: T.MlGetInfluencersRequest| TB.MlGetInfluencersRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlGetInfluencersResponse, TContext>>
307307
getJobStats: <TContext = unknown>(params?: T.MlGetJobStatsRequest| TB.MlGetJobStatsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlGetJobStatsResponse, TContext>>
308308
getJobs: <TContext = unknown>(params?: T.MlGetJobsRequest| TB.MlGetJobsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlGetJobsResponse, TContext>>
309+
getMemoryStats: <TContext = unknown>(params?: T.TODO, options?: TransportRequestOptions) => Promise<TransportResult<T.TODO, unknown>>
309310
getModelSnapshotUpgradeStats: <TContext = unknown>(params?: T.TODO, options?: TransportRequestOptions) => Promise<TransportResult<T.TODO, unknown>>
310311
getModelSnapshots: <TContext = unknown>(params: T.MlGetModelSnapshotsRequest| TB.MlGetModelSnapshotsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlGetModelSnapshotsResponse, TContext>>
311312
getOverallBuckets: <TContext = unknown>(params: T.MlGetOverallBucketsRequest| TB.MlGetOverallBucketsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlGetOverallBucketsResponse, TContext>>
@@ -427,6 +428,9 @@ interface KibanaClient {
427428
hasPrivileges: <TContext = unknown>(params?: T.SecurityHasPrivilegesRequest| TB.SecurityHasPrivilegesRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SecurityHasPrivilegesResponse, TContext>>
428429
invalidateApiKey: <TContext = unknown>(params?: T.SecurityInvalidateApiKeyRequest| TB.SecurityInvalidateApiKeyRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SecurityInvalidateApiKeyResponse, TContext>>
429430
invalidateToken: <TContext = unknown>(params?: T.SecurityInvalidateTokenRequest| TB.SecurityInvalidateTokenRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SecurityInvalidateTokenResponse, TContext>>
431+
oidcAuthenticate: <TContext = unknown>(params?: T.TODO, options?: TransportRequestOptions) => Promise<TransportResult<T.TODO, unknown>>
432+
oidcLogout: <TContext = unknown>(params?: T.TODO, options?: TransportRequestOptions) => Promise<TransportResult<T.TODO, unknown>>
433+
oidcPrepareAuthentication: <TContext = unknown>(params?: T.TODO, options?: TransportRequestOptions) => Promise<TransportResult<T.TODO, unknown>>
430434
putPrivileges: <TContext = unknown>(params?: T.SecurityPutPrivilegesRequest| TB.SecurityPutPrivilegesRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SecurityPutPrivilegesResponse, TContext>>
431435
putRole: <TContext = unknown>(params: T.SecurityPutRoleRequest| TB.SecurityPutRoleRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SecurityPutRoleResponse, TContext>>
432436
putRoleMapping: <TContext = unknown>(params: T.SecurityPutRoleMappingRequest| TB.SecurityPutRoleMappingRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SecurityPutRoleMappingResponse, TContext>>

src/api/types.ts

Lines changed: 46 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ export interface MgetResponse<TDocument = unknown> {
545545

546546
export type MgetResponseItem<TDocument = unknown> = GetGetResult<TDocument> | MgetMultiGetError
547547

548-
export interface MsearchMultiSearchItem<TDocument = unknown> extends SearchResponse<TDocument> {
548+
export interface MsearchMultiSearchItem<TDocument = unknown> extends SearchResponseBody<TDocument> {
549549
status?: integer
550550
}
551551

@@ -920,8 +920,7 @@ export interface ScrollRequest extends RequestBase {
920920
rest_total_hits_as_int?: boolean
921921
}
922922

923-
export interface ScrollResponse<TDocument = unknown, TAggregations = Record<AggregateName, AggregationsAggregate>> extends SearchResponse<TDocument, TAggregations> {
924-
}
923+
export type ScrollResponse<TDocument = unknown, TAggregations = Record<AggregateName, AggregationsAggregate>> = SearchResponseBody<TDocument>
925924

926925
export interface SearchRequest extends RequestBase {
927926
index?: Indices
@@ -987,12 +986,14 @@ export interface SearchRequest extends RequestBase {
987986
runtime_mappings?: MappingRuntimeFields
988987
}
989988

990-
export interface SearchResponse<TDocument = unknown, TAggregations = Record<AggregateName, AggregationsAggregate>> {
989+
export type SearchResponse<TDocument = unknown, TAggregations = Record<AggregateName, AggregationsAggregate>> = SearchResponseBody<TDocument>
990+
991+
export interface SearchResponseBody<TDocument = unknown> {
991992
took: long
992993
timed_out: boolean
993994
_shards: ShardStatistics
994995
hits: SearchHitsMetadata<TDocument>
995-
aggregations?: TAggregations
996+
aggregations?: Record<AggregateName, AggregationsAggregate>
996997
_clusters?: ClusterStatistics
997998
fields?: Record<string, any>
998999
max_score?: double
@@ -5809,6 +5810,10 @@ export type CatCatDfaColumns = CatCatDfaColumn | CatCatDfaColumn[]
58095810
export interface CatCatRequestBase extends RequestBase, SpecUtilsCommonCatQueryParameters {
58105811
}
58115812

5813+
export type CatCatTrainedModelsColumn = 'create_time' | 'ct' | 'created_by' | 'c' | 'createdBy' | 'data_frame_analytics_id' | 'df' | 'dataFrameAnalytics' | 'description' | 'd' | 'heap_size' | 'hs' | 'modelHeapSize' | 'id' | 'ingest.count' | 'ic' | 'ingestCount' | 'ingest.current' | 'icurr' | 'ingestCurrent' | 'ingest.failed' | 'if' | 'ingestFailed' | 'ingest.pipelines' | 'ip' | 'ingestPipelines' | 'ingest.time' | 'it' | 'ingestTime' | 'license' | 'l' | 'operations' | 'o' | 'modelOperations' | 'version' | 'v'
5814+
5815+
export type CatCatTrainedModelsColumns = CatCatTrainedModelsColumn | CatCatTrainedModelsColumn[]
5816+
58125817
export type CatCatTransformColumn = 'changes_last_detection_time' | 'cldt' | 'checkpoint' | 'cp' | 'checkpoint_duration_time_exp_avg' | 'cdtea' | 'checkpointTimeExpAvg' | 'checkpoint_progress' | 'c' | 'checkpointProgress' | 'create_time' | 'ct' | 'createTime' | 'delete_time' | 'dtime' | 'description' | 'd' | 'dest_index' | 'di' | 'destIndex' | 'documents_deleted' | 'docd' | 'documents_indexed' | 'doci' | 'docs_per_second' | 'dps' | 'documents_processed' | 'docp' | 'frequency' | 'f' | 'id' | 'index_failure' | 'if' | 'index_time' | 'itime' | 'index_total' | 'it' | 'indexed_documents_exp_avg' | 'idea' | 'last_search_time' | 'lst' | 'lastSearchTime' | 'max_page_search_size' | 'mpsz' | 'pages_processed' | 'pp' | 'pipeline' | 'p' | 'processed_documents_exp_avg' | 'pdea' | 'processing_time' | 'pt' | 'reason' | 'r' | 'search_failure' | 'sf' | 'search_time' | 'stime' | 'search_total' | 'st' | 'source_index' | 'si' | 'sourceIndex' | 'state' | 's' | 'transform_type' | 'tt' | 'trigger_count' | 'tc' | 'version' | 'v'
58135818

58145819
export type CatCatTransformColumns = CatCatTransformColumn | CatCatTransformColumn[]
@@ -6582,6 +6587,8 @@ export interface CatMlTrainedModelsRequest extends CatCatRequestBase {
65826587
model_id?: Id
65836588
allow_no_match?: boolean
65846589
bytes?: Bytes
6590+
h?: CatCatTrainedModelsColumns
6591+
s?: CatCatTrainedModelsColumns
65856592
from?: integer
65866593
size?: integer
65876594
}
@@ -9229,6 +9236,28 @@ export interface IndicesIndexState {
92299236
data_stream?: DataStreamName
92309237
}
92319238

9239+
export interface IndicesIndexTemplate {
9240+
index_patterns: Names
9241+
composed_of: Name[]
9242+
template?: IndicesIndexTemplateSummary
9243+
version?: VersionNumber
9244+
priority?: long
9245+
_meta?: Metadata
9246+
allow_auto_create?: boolean
9247+
data_stream?: IndicesIndexTemplateDataStreamConfiguration
9248+
}
9249+
9250+
export interface IndicesIndexTemplateDataStreamConfiguration {
9251+
hidden?: boolean
9252+
allow_custom_routing?: boolean
9253+
}
9254+
9255+
export interface IndicesIndexTemplateSummary {
9256+
aliases?: Record<IndexName, IndicesAlias>
9257+
mappings?: MappingTypeMapping
9258+
settings?: IndicesIndexSettings
9259+
}
9260+
92329261
export interface IndicesIndexVersioning {
92339262
created: VersionString
92349263
created_string?: VersionString
@@ -9787,26 +9816,9 @@ export interface IndicesGetFieldMappingTypeFieldMappings {
97879816
mappings: Partial<Record<Field, MappingFieldMapping>>
97889817
}
97899818

9790-
export interface IndicesGetIndexTemplateIndexTemplate {
9791-
index_patterns: Name[]
9792-
composed_of: Name[]
9793-
template?: IndicesGetIndexTemplateIndexTemplateSummary
9794-
version?: VersionNumber
9795-
priority?: long
9796-
_meta?: Metadata
9797-
allow_auto_create?: boolean
9798-
data_stream?: Record<string, any>
9799-
}
9800-
98019819
export interface IndicesGetIndexTemplateIndexTemplateItem {
98029820
name: Name
9803-
index_template: IndicesGetIndexTemplateIndexTemplate
9804-
}
9805-
9806-
export interface IndicesGetIndexTemplateIndexTemplateSummary {
9807-
aliases?: Record<IndexName, IndicesAlias>
9808-
mappings?: MappingTypeMapping
9809-
settings?: Record<string, any>
9821+
index_template: IndicesIndexTemplate
98109822
}
98119823

98129824
export interface IndicesGetIndexTemplateRequest extends RequestBase {
@@ -10300,18 +10312,18 @@ export interface IndicesSimulateTemplateRequest extends RequestBase {
1030010312
name?: Name
1030110313
create?: boolean
1030210314
master_timeout?: Time
10303-
template?: IndicesGetIndexTemplateIndexTemplate
10315+
template?: IndicesIndexTemplate
1030410316
}
1030510317

1030610318
export interface IndicesSimulateTemplateResponse {
10319+
overlapping?: IndicesSimulateTemplateOverlapping[]
1030710320
template: IndicesSimulateTemplateTemplate
1030810321
}
1030910322

1031010323
export interface IndicesSimulateTemplateTemplate {
1031110324
aliases: Record<IndexName, IndicesAlias>
1031210325
mappings: MappingTypeMapping
10313-
settings: Record<string, any>
10314-
overlapping: IndicesSimulateTemplateOverlapping[]
10326+
settings: IndicesIndexSettings
1031510327
}
1031610328

1031710329
export interface IndicesSplitRequest extends RequestBase {
@@ -11893,10 +11905,10 @@ export interface MlModelSizeStats {
1189311905
export interface MlModelSnapshot {
1189411906
description?: string
1189511907
job_id: Id
11896-
latest_record_time_stamp: integer
11897-
latest_result_time_stamp: integer
11908+
latest_record_time_stamp?: integer
11909+
latest_result_time_stamp?: integer
1189811910
min_version: VersionString
11899-
model_size_stats: MlModelSizeStats
11911+
model_size_stats?: MlModelSizeStats
1190011912
retain: boolean
1190111913
snapshot_doc_count: long
1190211914
snapshot_id: Id
@@ -12139,7 +12151,7 @@ export interface MlDeleteCalendarEventResponse extends AcknowledgedResponseBase
1213912151

1214012152
export interface MlDeleteCalendarJobRequest extends RequestBase {
1214112153
calendar_id: Id
12142-
job_id: Id
12154+
job_id: Ids
1214312155
}
1214412156

1214512157
export interface MlDeleteCalendarJobResponse {
@@ -12482,7 +12494,7 @@ export interface MlGetDatafeedsResponse {
1248212494
}
1248312495

1248412496
export interface MlGetFiltersRequest extends RequestBase {
12485-
filter_id?: Id
12497+
filter_id?: Ids
1248612498
from?: integer
1248712499
size?: integer
1248812500
}
@@ -12599,7 +12611,7 @@ export interface MlGetTrainedModelsResponse {
1259912611
}
1260012612

1260112613
export interface MlGetTrainedModelsStatsRequest extends RequestBase {
12602-
model_id?: Id
12614+
model_id?: Ids
1260312615
allow_no_match?: boolean
1260412616
from?: integer
1260512617
size?: integer
@@ -13718,7 +13730,6 @@ export interface NodesClearRepositoriesMeteringArchiveRequest extends RequestBas
1371813730
}
1371913731

1372013732
export interface NodesClearRepositoriesMeteringArchiveResponse extends NodesNodesResponseBase {
13721-
_nodes: NodeStatistics
1372213733
cluster_name: Name
1372313734
nodes: Record<string, NodesRepositoryMeteringInformation>
1372413735
}
@@ -13728,7 +13739,6 @@ export interface NodesGetRepositoriesMeteringInfoRequest extends RequestBase {
1372813739
}
1372913740

1373013741
export interface NodesGetRepositoriesMeteringInfoResponse extends NodesNodesResponseBase {
13731-
_nodes: NodeStatistics
1373213742
cluster_name: Name
1373313743
nodes: Record<string, NodesRepositoryMeteringInformation>
1373413744
}
@@ -15945,7 +15955,7 @@ export interface TransformDeleteTransformResponse extends AcknowledgedResponseBa
1594515955
}
1594615956

1594715957
export interface TransformGetTransformRequest extends RequestBase {
15948-
transform_id?: Name
15958+
transform_id?: Names
1594915959
allow_no_match?: boolean
1595015960
from?: integer
1595115961
size?: integer
@@ -16254,6 +16264,7 @@ export interface WatcherDataEmailAttachment {
1625416264
export type WatcherDay = 'sunday' | 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday'
1625516265

1625616266
export interface WatcherEmail {
16267+
id?: Id
1625716268
bcc?: string[]
1625816269
body?: WatcherEmailBody
1625916270
cc?: string[]

0 commit comments

Comments
 (0)