@@ -32,7 +32,6 @@ class Security extends AbstractEndpoint
3232 * Creates or updates the user profile on behalf of another user.
3333 *
3434 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-activate-user-profile.html
35- * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
3635 *
3736 * @param array{
3837 * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
@@ -96,6 +95,41 @@ public function authenticate(array $params = [])
9695 }
9796
9897
98+ /**
99+ * Updates the attributes of multiple existing API keys.
100+ *
101+ * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-bulk-update-api-keys.html
102+ *
103+ * @param array{
104+ * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
105+ * human: boolean, // Return human readable values for statistics. (DEFAULT: true)
106+ * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
107+ * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
108+ * filter_path: list, // A comma-separated list of filters used to reduce the response.
109+ * body: array, // (REQUIRED) The API key request to update the attributes of multiple API keys.
110+ * } $params
111+ *
112+ * @throws NoNodeAvailableException if all the hosts are offline
113+ * @throws ClientResponseException if the status code of response is 4xx
114+ * @throws ServerResponseException if the status code of response is 5xx
115+ *
116+ * @return Elasticsearch|Promise
117+ */
118+ public function bulkUpdateApiKeys (array $ params = [])
119+ {
120+ $ this ->checkRequiredParameters (['body ' ], $ params );
121+ $ url = '/_security/api_key/_bulk_update ' ;
122+ $ method = 'POST ' ;
123+
124+ $ url = $ this ->addQueryString ($ url , $ params , ['pretty ' ,'human ' ,'error_trace ' ,'source ' ,'filter_path ' ]);
125+ $ headers = [
126+ 'Accept ' => 'application/json ' ,
127+ 'Content-Type ' => 'application/json ' ,
128+ ];
129+ return $ this ->client ->sendRequest ($ this ->createRequest ($ method , $ url , $ headers , $ params ['body ' ] ?? null ));
130+ }
131+
132+
99133 /**
100134 * Changes the passwords of users in the native realm and built-in users.
101135 *
@@ -616,7 +650,6 @@ public function disableUser(array $params = [])
616650 * Disables a user profile so it's not visible in user profile searches.
617651 *
618652 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-disable-user-profile.html
619- * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
620653 *
621654 * @param array{
622655 * uid: string, // (REQUIRED) Unique identifier for the user profile
@@ -689,7 +722,6 @@ public function enableUser(array $params = [])
689722 * Enables a user profile so it's visible in user profile searches.
690723 *
691724 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-enable-user-profile.html
692- * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
693725 *
694726 * @param array{
695727 * uid: string, // (REQUIRED) An unique identifier of the user profile
@@ -799,6 +831,7 @@ public function enrollNode(array $params = [])
799831 * username: string, // user name of the user who created this API key to be retrieved
800832 * realm_name: string, // realm name of the user who created this API key to be retrieved
801833 * owner: boolean, // flag to query API keys owned by the currently authenticated user
834+ * with_limited_by: boolean, // flag to show the limited-by role descriptors of API Keys
802835 * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
803836 * human: boolean, // Return human readable values for statistics. (DEFAULT: true)
804837 * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
@@ -817,7 +850,7 @@ public function getApiKey(array $params = [])
817850 $ url = '/_security/api_key ' ;
818851 $ method = 'GET ' ;
819852
820- $ url = $ this ->addQueryString ($ url , $ params , ['id ' ,'name ' ,'username ' ,'realm_name ' ,'owner ' ,'pretty ' ,'human ' ,'error_trace ' ,'source ' ,'filter_path ' ]);
853+ $ url = $ this ->addQueryString ($ url , $ params , ['id ' ,'name ' ,'username ' ,'realm_name ' ,'owner ' ,'with_limited_by ' , ' pretty ' ,'human ' ,'error_trace ' ,'source ' ,'filter_path ' ]);
821854 $ headers = [
822855 'Accept ' => 'application/json ' ,
823856 ];
@@ -1091,6 +1124,7 @@ public function getToken(array $params = [])
10911124 *
10921125 * @param array{
10931126 * username: list, // A comma-separated list of usernames
1127+ * with_profile_uid: boolean, // flag to retrieve profile uid (if exists) associated to the user
10941128 * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
10951129 * human: boolean, // Return human readable values for statistics. (DEFAULT: true)
10961130 * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
@@ -1113,7 +1147,7 @@ public function getUser(array $params = [])
11131147 $ url = '/_security/user ' ;
11141148 $ method = 'GET ' ;
11151149 }
1116- $ url = $ this ->addQueryString ($ url , $ params , ['pretty ' ,'human ' ,'error_trace ' ,'source ' ,'filter_path ' ]);
1150+ $ url = $ this ->addQueryString ($ url , $ params , ['with_profile_uid ' , ' pretty ' ,'human ' ,'error_trace ' ,'source ' ,'filter_path ' ]);
11171151 $ headers = [
11181152 'Accept ' => 'application/json ' ,
11191153 ];
@@ -1154,13 +1188,12 @@ public function getUserPrivileges(array $params = [])
11541188
11551189
11561190 /**
1157- * Retrieves user profile for the given unique ID.
1191+ * Retrieves user profiles for the given unique ID(s) .
11581192 *
11591193 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user-profile.html
1160- * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
11611194 *
11621195 * @param array{
1163- * uid: string , // (REQUIRED) An unique identifier of the user profile
1196+ * uid: list , // (REQUIRED) A comma-separated list of unique identifier for user profiles
11641197 * data: list, // A comma-separated list of keys for which the corresponding application data are retrieved.
11651198 * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
11661199 * human: boolean, // Return human readable values for statistics. (DEFAULT: true)
@@ -1270,7 +1303,6 @@ public function hasPrivileges(array $params = [])
12701303 * Determines whether the users associated with the specified profile IDs have all the requested privileges.
12711304 *
12721305 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges-user-profile.html
1273- * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
12741306 *
12751307 * @param array{
12761308 * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
@@ -1633,6 +1665,7 @@ public function putUser(array $params = [])
16331665 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-api-key.html
16341666 *
16351667 * @param array{
1668+ * with_limited_by: boolean, // flag to show the limited-by role descriptors of API Keys
16361669 * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
16371670 * human: boolean, // Return human readable values for statistics. (DEFAULT: true)
16381671 * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
@@ -1652,7 +1685,7 @@ public function queryApiKeys(array $params = [])
16521685 $ url = '/_security/_query/api_key ' ;
16531686 $ method = empty ($ params ['body ' ]) ? 'GET ' : 'POST ' ;
16541687
1655- $ url = $ this ->addQueryString ($ url , $ params , ['pretty ' ,'human ' ,'error_trace ' ,'source ' ,'filter_path ' ]);
1688+ $ url = $ this ->addQueryString ($ url , $ params , ['with_limited_by ' , ' pretty ' ,'human ' ,'error_trace ' ,'source ' ,'filter_path ' ]);
16561689 $ headers = [
16571690 'Accept ' => 'application/json ' ,
16581691 'Content-Type ' => 'application/json ' ,
@@ -1876,7 +1909,6 @@ public function samlServiceProviderMetadata(array $params = [])
18761909 * Get suggestions for user profiles that match specified search criteria.
18771910 *
18781911 * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-suggest-user-profile.html
1879- * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
18801912 *
18811913 * @param array{
18821914 * data: list, // A comma-separated list of keys for which the corresponding application data are retrieved.
@@ -1949,7 +1981,6 @@ public function updateApiKey(array $params = [])
19491981 * Update application specific data for the user profile of the given unique ID.
19501982 *
19511983 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-user-profile-data.html
1952- * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
19531984 *
19541985 * @param array{
19551986 * uid: string, // (REQUIRED) An unique identifier of the user profile
0 commit comments