Skip to content

Commit 8f9ed67

Browse files
authored
Update APIs to 8.5.0-SNAPSHOT
1 parent 4ebffbc commit 8f9ed67

File tree

9 files changed

+2222
-2029
lines changed

9 files changed

+2222
-2029
lines changed

docs/reference.asciidoc

Lines changed: 20 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -2081,6 +2081,16 @@ client.migration.postFeatureUpgrade(...)
20812081

20822082
[discrete]
20832083
=== ml
2084+
[discrete]
2085+
==== clear_trained_model_deployment_cache
2086+
Clear the cached results from a trained model deployment
2087+
2088+
https://www.elastic.co/guide/en/elasticsearch/reference/master/clear-trained-model-deployment-cache.html[Endpoint documentation]
2089+
[source,ts]
2090+
----
2091+
client.ml.clearTrainedModelDeploymentCache(...)
2092+
----
2093+
20842094
[discrete]
20852095
==== close_job
20862096
Closes one or more anomaly detection jobs. A job can be opened and closed multiple times throughout its lifecycle.
@@ -2980,23 +2990,21 @@ client.searchableSnapshots.stats(...)
29802990
[discrete]
29812991
=== security
29822992
[discrete]
2983-
==== activate_user_profile
2984-
Creates or updates the user profile on behalf of another user.
2993+
==== authenticate
2994+
Enables authentication as a user and retrieve information about the authenticated user.
29852995

2986-
https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-activate-user-profile.html[Endpoint documentation]
2996+
https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-authenticate.html[Endpoint documentation]
29872997
[source,ts]
29882998
----
2989-
client.security.activateUserProfile(...)
2999+
client.security.authenticate(...)
29903000
----
29913001

29923002
[discrete]
2993-
==== authenticate
2994-
Enables authentication as a user and retrieve information about the authenticated user.
2995-
2996-
https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-authenticate.html[Endpoint documentation]
3003+
==== bulk_update_api_keys
3004+
Updates the attributes of multiple existing API keys.
29973005
[source,ts]
29983006
----
2999-
client.security.authenticate(...)
3007+
client.security.bulkUpdateApiKeys(...)
30003008
----
30013009

30023010
[discrete]
@@ -3139,16 +3147,6 @@ https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-dis
31393147
client.security.disableUser(...)
31403148
----
31413149

3142-
[discrete]
3143-
==== disable_user_profile
3144-
Disables a user profile so it's not visible in user profile searches.
3145-
3146-
https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-disable-user-profile.html[Endpoint documentation]
3147-
[source,ts]
3148-
----
3149-
client.security.disableUserProfile(...)
3150-
----
3151-
31523150
[discrete]
31533151
==== enable_user
31543152
Enables users in the native realm.
@@ -3159,16 +3157,6 @@ https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-ena
31593157
client.security.enableUser(...)
31603158
----
31613159

3162-
[discrete]
3163-
==== enable_user_profile
3164-
Enables a user profile so it's visible in user profile searches.
3165-
3166-
https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-enable-user-profile.html[Endpoint documentation]
3167-
[source,ts]
3168-
----
3169-
client.security.enableUserProfile(...)
3170-
----
3171-
31723160
[discrete]
31733161
==== enroll_kibana
31743162
Allows a kibana instance to configure itself to communicate with a secured elasticsearch cluster.
@@ -3289,16 +3277,6 @@ https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get
32893277
client.security.getUserPrivileges(...)
32903278
----
32913279

3292-
[discrete]
3293-
==== get_user_profile
3294-
Retrieves user profile for the given unique ID.
3295-
3296-
https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-get-user-profile.html[Endpoint documentation]
3297-
[source,ts]
3298-
----
3299-
client.security.getUserProfile(...)
3300-
----
3301-
33023280
[discrete]
33033281
==== grant_api_key
33043282
Creates an API key on behalf of another user.
@@ -3480,23 +3458,11 @@ client.security.samlServiceProviderMetadata(...)
34803458
----
34813459

34823460
[discrete]
3483-
==== suggest_user_profiles
3484-
Get suggestions for user profiles that match specified search criteria.
3485-
3486-
https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-suggest-user-profile.html[Endpoint documentation]
3487-
[source,ts]
3488-
----
3489-
client.security.suggestUserProfiles(...)
3490-
----
3491-
3492-
[discrete]
3493-
==== update_user_profile_data
3494-
Update application specific data for the user profile of the given unique ID.
3495-
3496-
https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-update-user-profile-data.html[Endpoint documentation]
3461+
==== update_api_key
3462+
Updates attributes of an existing API key.
34973463
[source,ts]
34983464
----
3499-
client.security.updateUserProfileData(...)
3465+
client.security.updateApiKey(...)
35003466
----
35013467

35023468
[discrete]

src/api/api/_internal.ts

Lines changed: 0 additions & 143 deletions
This file was deleted.

src/api/api/async_search.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export default class AsyncSearch {
114114
async submit<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params?: T.AsyncSearchSubmitRequest | TB.AsyncSearchSubmitRequest, options?: TransportRequestOptions): Promise<T.AsyncSearchSubmitResponse<TDocument, TAggregations>>
115115
async submit<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params?: T.AsyncSearchSubmitRequest | TB.AsyncSearchSubmitRequest, options?: TransportRequestOptions): Promise<any> {
116116
const acceptedPath: string[] = ['index']
117-
const acceptedBody: string[] = ['aggregations', 'aggs', 'collapse', 'explain', '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']
117+
const acceptedBody: string[] = ['aggregations', 'aggs', 'collapse', 'explain', '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']
118118
const querystring: Record<string, any> = {}
119119
// @ts-expect-error
120120
const userBody: any = params?.body
@@ -130,7 +130,8 @@ export default class AsyncSearch {
130130
if (acceptedBody.includes(key)) {
131131
body = body ?? {}
132132
// @ts-expect-error
133-
if (key === 'sort' && typeof params[key] === 'string' && params[key].includes(':')) {
133+
if (key === 'sort' && typeof params[key] === 'string' && params[key].includes(':')) { // eslint-disable-line
134+
// @ts-expect-error
134135
querystring[key] = params[key]
135136
} else {
136137
// @ts-expect-error

src/api/api/ml.ts

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,28 @@ export default class Ml {
4343
this.transport = transport
4444
}
4545

46+
async clearTrainedModelDeploymentCache (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
47+
async clearTrainedModelDeploymentCache (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
48+
async clearTrainedModelDeploymentCache (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
49+
async clearTrainedModelDeploymentCache (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
50+
const acceptedPath: string[] = ['model_id']
51+
const querystring: Record<string, any> = {}
52+
const body = undefined
53+
54+
params = params ?? {}
55+
for (const key in params) {
56+
if (acceptedPath.includes(key)) {
57+
continue
58+
} else if (key !== 'body') {
59+
querystring[key] = params[key]
60+
}
61+
}
62+
63+
const method = 'POST'
64+
const path = `/_ml/trained_models/${encodeURIComponent(params.model_id.toString())}/deployment/cache/_clear`
65+
return await this.transport.request({ path, method, querystring, body }, options)
66+
}
67+
4668
async closeJob (this: That, params: T.MlCloseJobRequest | TB.MlCloseJobRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.MlCloseJobResponse>
4769
async closeJob (this: That, params: T.MlCloseJobRequest | TB.MlCloseJobRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.MlCloseJobResponse, unknown>>
4870
async closeJob (this: That, params: T.MlCloseJobRequest | TB.MlCloseJobRequest, options?: TransportRequestOptions): Promise<T.MlCloseJobResponse>
@@ -967,19 +989,19 @@ export default class Ml {
967989
return await this.transport.request({ path, method, querystring, body }, options)
968990
}
969991

970-
async getModelSnapshotUpgradeStats (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
971-
async getModelSnapshotUpgradeStats (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
972-
async getModelSnapshotUpgradeStats (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
973-
async getModelSnapshotUpgradeStats (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
992+
async getModelSnapshotUpgradeStats (this: That, params: T.MlGetModelSnapshotUpgradeStatsRequest | TB.MlGetModelSnapshotUpgradeStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.MlGetModelSnapshotUpgradeStatsResponse>
993+
async getModelSnapshotUpgradeStats (this: That, params: T.MlGetModelSnapshotUpgradeStatsRequest | TB.MlGetModelSnapshotUpgradeStatsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.MlGetModelSnapshotUpgradeStatsResponse, unknown>>
994+
async getModelSnapshotUpgradeStats (this: That, params: T.MlGetModelSnapshotUpgradeStatsRequest | TB.MlGetModelSnapshotUpgradeStatsRequest, options?: TransportRequestOptions): Promise<T.MlGetModelSnapshotUpgradeStatsResponse>
995+
async getModelSnapshotUpgradeStats (this: That, params: T.MlGetModelSnapshotUpgradeStatsRequest | TB.MlGetModelSnapshotUpgradeStatsRequest, options?: TransportRequestOptions): Promise<any> {
974996
const acceptedPath: string[] = ['job_id', 'snapshot_id']
975997
const querystring: Record<string, any> = {}
976998
const body = undefined
977999

978-
params = params ?? {}
9791000
for (const key in params) {
9801001
if (acceptedPath.includes(key)) {
9811002
continue
9821003
} else if (key !== 'body') {
1004+
// @ts-expect-error
9831005
querystring[key] = params[key]
9841006
}
9851007
}

src/api/api/search.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export default async function SearchApi<TDocument = unknown, TAggregations = Rec
4242
export default async function SearchApi<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params?: T.SearchRequest | TB.SearchRequest, options?: TransportRequestOptions): Promise<T.SearchResponse<TDocument, TAggregations>>
4343
export default async function SearchApi<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params?: T.SearchRequest | TB.SearchRequest, options?: TransportRequestOptions): Promise<any> {
4444
const acceptedPath: string[] = ['index']
45-
const acceptedBody: string[] = ['aggregations', 'aggs', 'collapse', 'explain', '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']
45+
const acceptedBody: string[] = ['aggregations', 'aggs', 'collapse', 'explain', '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']
4646
const querystring: Record<string, any> = {}
4747
// @ts-expect-error
4848
const userBody: any = params?.body
@@ -58,7 +58,8 @@ export default async function SearchApi<TDocument = unknown, TAggregations = Rec
5858
if (acceptedBody.includes(key)) {
5959
body = body ?? {}
6060
// @ts-expect-error
61-
if (key === 'sort' && typeof params[key] === 'string' && params[key].includes(':')) {
61+
if (key === 'sort' && typeof params[key] === 'string' && params[key].includes(':')) { // eslint-disable-line
62+
// @ts-expect-error
6263
querystring[key] = params[key]
6364
} else {
6465
// @ts-expect-error

0 commit comments

Comments
 (0)