Skip to content

Commit e47967a

Browse files
feat: Latest serverless specification changes (#77)
Auto-generated API code
1 parent 5cb44a8 commit e47967a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+3683
-1167
lines changed

docs/reference.asciidoc

Lines changed: 741 additions & 209 deletions
Large diffs are not rendered by default.

src/api/api/async_search.ts

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
import {
3030
Transport,
31+
TransportRequestMetadata,
3132
TransportRequestOptions,
3233
TransportRequestOptionsWithMeta,
3334
TransportRequestOptionsWithOutMeta,
@@ -44,7 +45,7 @@ export default class AsyncSearch {
4445
}
4546

4647
/**
47-
* Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted.
48+
* Deletes an async search by identifier. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. If the Elasticsearch security features are enabled, the deletion of a specific async search is restricted to: the authenticated user that submitted the original search request; users that have the `cancel_task` cluster privilege.
4849
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/async-search.html | Elasticsearch API documentation}
4950
*/
5051
async delete (this: That, params: T.AsyncSearchDeleteRequest | TB.AsyncSearchDeleteRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.AsyncSearchDeleteResponse>
@@ -66,11 +67,17 @@ export default class AsyncSearch {
6667

6768
const method = 'DELETE'
6869
const path = `/_async_search/${encodeURIComponent(params.id.toString())}`
69-
return await this.transport.request({ path, method, querystring, body }, options)
70+
const meta: TransportRequestMetadata = {
71+
name: 'async_search.delete',
72+
pathParts: {
73+
id: params.id
74+
}
75+
}
76+
return await this.transport.request({ path, method, querystring, body, meta }, options)
7077
}
7178

7279
/**
73-
* Retrieves the results of a previously submitted async search request given its ID.
80+
* Retrieves the results of a previously submitted async search request given its identifier. If the Elasticsearch security features are enabled, access to the results of a specific async search is restricted to the user or API key that submitted it.
7481
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/async-search.html | Elasticsearch API documentation}
7582
*/
7683
async get<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params: T.AsyncSearchGetRequest | TB.AsyncSearchGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.AsyncSearchGetResponse<TDocument, TAggregations>>
@@ -92,11 +99,17 @@ export default class AsyncSearch {
9299

93100
const method = 'GET'
94101
const path = `/_async_search/${encodeURIComponent(params.id.toString())}`
95-
return await this.transport.request({ path, method, querystring, body }, options)
102+
const meta: TransportRequestMetadata = {
103+
name: 'async_search.get',
104+
pathParts: {
105+
id: params.id
106+
}
107+
}
108+
return await this.transport.request({ path, method, querystring, body, meta }, options)
96109
}
97110

98111
/**
99-
* Retrieves the status of a previously submitted async search request given its ID.
112+
* Get async search status Retrieves the status of a previously submitted async search request given its identifier, without retrieving search results. If the Elasticsearch security features are enabled, use of this API is restricted to the `monitoring_user` role.
100113
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/async-search.html | Elasticsearch API documentation}
101114
*/
102115
async status (this: That, params: T.AsyncSearchStatusRequest | TB.AsyncSearchStatusRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.AsyncSearchStatusResponse>
@@ -118,19 +131,25 @@ export default class AsyncSearch {
118131

119132
const method = 'GET'
120133
const path = `/_async_search/status/${encodeURIComponent(params.id.toString())}`
121-
return await this.transport.request({ path, method, querystring, body }, options)
134+
const meta: TransportRequestMetadata = {
135+
name: 'async_search.status',
136+
pathParts: {
137+
id: params.id
138+
}
139+
}
140+
return await this.transport.request({ path, method, querystring, body, meta }, options)
122141
}
123142

124143
/**
125-
* Executes a search request asynchronously.
144+
* Runs a search request asynchronously. When the primary sort of the results is an indexed field, shards get sorted based on minimum and maximum value that they hold for that field, hence partial results become available following the sort criteria that was requested. Warning: Async search does not support scroll nor search requests that only include the suggest section. By default, Elasticsearch doesn’t allow you to store an async search response larger than 10Mb and an attempt to do this results in an error. The maximum allowed size for a stored async search response can be set by changing the `search.max_async_search_response_size` cluster level setting.
126145
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/async-search.html | Elasticsearch API documentation}
127146
*/
128147
async submit<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params?: T.AsyncSearchSubmitRequest | TB.AsyncSearchSubmitRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.AsyncSearchSubmitResponse<TDocument, TAggregations>>
129148
async submit<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params?: T.AsyncSearchSubmitRequest | TB.AsyncSearchSubmitRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.AsyncSearchSubmitResponse<TDocument, TAggregations>, unknown>>
130149
async submit<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params?: T.AsyncSearchSubmitRequest | TB.AsyncSearchSubmitRequest, options?: TransportRequestOptions): Promise<T.AsyncSearchSubmitResponse<TDocument, TAggregations>>
131150
async submit<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params?: T.AsyncSearchSubmitRequest | TB.AsyncSearchSubmitRequest, options?: TransportRequestOptions): Promise<any> {
132151
const acceptedPath: string[] = ['index']
133-
const acceptedBody: string[] = ['aggregations', 'aggs', 'collapse', 'explain', 'ext', 'from', 'highlight', 'track_total_hits', 'indices_boost', 'docvalue_fields', 'min_score', 'post_filter', 'profile', 'query', 'rescore', 'script_fields', 'search_after', 'size', 'slice', 'sort', '_source', 'fields', 'suggest', 'terminate_after', 'timeout', 'track_scores', 'version', 'seq_no_primary_term', 'stored_fields', 'pit', 'runtime_mappings', 'stats']
152+
const acceptedBody: string[] = ['aggregations', 'aggs', 'collapse', 'explain', 'ext', 'from', 'highlight', 'track_total_hits', 'indices_boost', 'docvalue_fields', 'knn', 'min_score', 'post_filter', 'profile', 'query', 'rescore', 'script_fields', 'search_after', 'size', 'slice', 'sort', '_source', 'fields', 'suggest', 'terminate_after', 'timeout', 'track_scores', 'version', 'seq_no_primary_term', 'stored_fields', 'pit', 'runtime_mappings', 'stats']
134153
const querystring: Record<string, any> = {}
135154
// @ts-expect-error
136155
const userBody: any = params?.body
@@ -170,6 +189,12 @@ export default class AsyncSearch {
170189
method = 'POST'
171190
path = '/_async_search'
172191
}
173-
return await this.transport.request({ path, method, querystring, body }, options)
192+
const meta: TransportRequestMetadata = {
193+
name: 'async_search.submit',
194+
pathParts: {
195+
index: params.index
196+
}
197+
}
198+
return await this.transport.request({ path, method, querystring, body, meta }, options)
174199
}
175200
}

src/api/api/bulk.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
import {
3030
Transport,
31+
TransportRequestMetadata,
3132
TransportRequestOptions,
3233
TransportRequestOptionsWithMeta,
3334
TransportRequestOptionsWithOutMeta,
@@ -38,7 +39,7 @@ import * as TB from '../typesWithBodyKey'
3839
interface That { transport: Transport }
3940

4041
/**
41-
* Allows to perform multiple index/update/delete operations in a single request.
42+
* Bulk index or delete documents. Performs multiple indexing or delete operations in a single API call. This reduces overhead and can greatly increase indexing speed.
4243
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-bulk.html | Elasticsearch API documentation}
4344
*/
4445
export default async function BulkApi<TDocument = unknown, TPartialDocument = unknown> (this: That, params: T.BulkRequest<TDocument, TPartialDocument> | TB.BulkRequest<TDocument, TPartialDocument>, options?: TransportRequestOptionsWithOutMeta): Promise<T.BulkResponse>
@@ -72,5 +73,11 @@ export default async function BulkApi<TDocument = unknown, TPartialDocument = un
7273
method = 'POST'
7374
path = '/_bulk'
7475
}
75-
return await this.transport.request({ path, method, querystring, bulkBody: body }, options)
76+
const meta: TransportRequestMetadata = {
77+
name: 'bulk',
78+
pathParts: {
79+
index: params.index
80+
}
81+
}
82+
return await this.transport.request({ path, method, querystring, bulkBody: body, meta }, options)
7683
}

0 commit comments

Comments
 (0)