@@ -25,452 +25,452 @@ |
||
25 | 25 | */ |
26 | 26 | class Snapshot extends AbstractEndpoint |
27 | 27 | { |
28 | - /** |
|
29 | - * Removes stale data from repository. |
|
30 | - * |
|
31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/clean-up-snapshot-repo-api.html |
|
32 | - * |
|
33 | - * @param array{ |
|
34 | - * repository: string, // (REQUIRED) A repository name |
|
35 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
36 | - * timeout: time, // Explicit operation timeout |
|
37 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
38 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
39 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
40 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
41 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
42 | - * } $params |
|
43 | - * |
|
44 | - * @throws MissingParameterException if a required parameter is missing |
|
45 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
46 | - * @throws ClientResponseException if the status code of response is 4xx |
|
47 | - * @throws ServerResponseException if the status code of response is 5xx |
|
48 | - * |
|
49 | - * @return Elasticsearch|Promise |
|
50 | - */ |
|
51 | - public function cleanupRepository(array $params = []) |
|
52 | - { |
|
53 | - $this->checkRequiredParameters(['repository'], $params); |
|
54 | - $url = '/_snapshot/' . $this->encode($params['repository']) . '/_cleanup'; |
|
55 | - $method = 'POST'; |
|
56 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
57 | - $headers = ['Accept' => 'application/json']; |
|
58 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
59 | - $request = $this->addOtelAttributes($params, ['repository'], $request, 'snapshot.cleanup_repository'); |
|
60 | - return $this->client->sendRequest($request); |
|
61 | - } |
|
62 | - /** |
|
63 | - * Clones indices from one snapshot into another snapshot in the same repository. |
|
64 | - * |
|
65 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html |
|
66 | - * |
|
67 | - * @param array{ |
|
68 | - * repository: string, // (REQUIRED) A repository name |
|
69 | - * snapshot: string, // (REQUIRED) The name of the snapshot to clone from |
|
70 | - * target_snapshot: string, // (REQUIRED) The name of the cloned snapshot to create |
|
71 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
72 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
73 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
74 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
75 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
76 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
77 | - * body: array, // (REQUIRED) The snapshot clone definition |
|
78 | - * } $params |
|
79 | - * |
|
80 | - * @throws MissingParameterException if a required parameter is missing |
|
81 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
82 | - * @throws ClientResponseException if the status code of response is 4xx |
|
83 | - * @throws ServerResponseException if the status code of response is 5xx |
|
84 | - * |
|
85 | - * @return Elasticsearch|Promise |
|
86 | - */ |
|
87 | - public function clone(array $params = []) |
|
88 | - { |
|
89 | - $this->checkRequiredParameters(['repository', 'snapshot', 'target_snapshot', 'body'], $params); |
|
90 | - $url = '/_snapshot/' . $this->encode($params['repository']) . '/' . $this->encode($params['snapshot']) . '/_clone/' . $this->encode($params['target_snapshot']); |
|
91 | - $method = 'PUT'; |
|
92 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
93 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
94 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
95 | - $request = $this->addOtelAttributes($params, ['repository', 'snapshot', 'target_snapshot'], $request, 'snapshot.clone'); |
|
96 | - return $this->client->sendRequest($request); |
|
97 | - } |
|
98 | - /** |
|
99 | - * Creates a snapshot in a repository. |
|
100 | - * |
|
101 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html |
|
102 | - * |
|
103 | - * @param array{ |
|
104 | - * repository: string, // (REQUIRED) A repository name |
|
105 | - * snapshot: string, // (REQUIRED) A snapshot name |
|
106 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
107 | - * wait_for_completion: boolean, // Should this request wait until the operation has completed before returning |
|
108 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
109 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
110 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
111 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
112 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
113 | - * body: array, // The snapshot definition |
|
114 | - * } $params |
|
115 | - * |
|
116 | - * @throws MissingParameterException if a required parameter is missing |
|
117 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
118 | - * @throws ClientResponseException if the status code of response is 4xx |
|
119 | - * @throws ServerResponseException if the status code of response is 5xx |
|
120 | - * |
|
121 | - * @return Elasticsearch|Promise |
|
122 | - */ |
|
123 | - public function create(array $params = []) |
|
124 | - { |
|
125 | - $this->checkRequiredParameters(['repository', 'snapshot'], $params); |
|
126 | - $url = '/_snapshot/' . $this->encode($params['repository']) . '/' . $this->encode($params['snapshot']); |
|
127 | - $method = 'PUT'; |
|
128 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'wait_for_completion', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
129 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
130 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
131 | - $request = $this->addOtelAttributes($params, ['repository', 'snapshot'], $request, 'snapshot.create'); |
|
132 | - return $this->client->sendRequest($request); |
|
133 | - } |
|
134 | - /** |
|
135 | - * Creates a repository. |
|
136 | - * |
|
137 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html |
|
138 | - * |
|
139 | - * @param array{ |
|
140 | - * repository: string, // (REQUIRED) A repository name |
|
141 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
142 | - * timeout: time, // Explicit operation timeout |
|
143 | - * verify: boolean, // Whether to verify the repository after creation |
|
144 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
145 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
146 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
147 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
148 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
149 | - * body: array, // (REQUIRED) The repository definition |
|
150 | - * } $params |
|
151 | - * |
|
152 | - * @throws MissingParameterException if a required parameter is missing |
|
153 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
154 | - * @throws ClientResponseException if the status code of response is 4xx |
|
155 | - * @throws ServerResponseException if the status code of response is 5xx |
|
156 | - * |
|
157 | - * @return Elasticsearch|Promise |
|
158 | - */ |
|
159 | - public function createRepository(array $params = []) |
|
160 | - { |
|
161 | - $this->checkRequiredParameters(['repository', 'body'], $params); |
|
162 | - $url = '/_snapshot/' . $this->encode($params['repository']); |
|
163 | - $method = 'PUT'; |
|
164 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', 'verify', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
165 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
166 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
167 | - $request = $this->addOtelAttributes($params, ['repository'], $request, 'snapshot.create_repository'); |
|
168 | - return $this->client->sendRequest($request); |
|
169 | - } |
|
170 | - /** |
|
171 | - * Deletes one or more snapshots. |
|
172 | - * |
|
173 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html |
|
174 | - * |
|
175 | - * @param array{ |
|
176 | - * repository: string, // (REQUIRED) A repository name |
|
177 | - * snapshot: list, // (REQUIRED) A comma-separated list of snapshot names |
|
178 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
179 | - * wait_for_completion: boolean, // Should this request wait until the operation has completed before returning |
|
180 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
181 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
182 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
183 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
184 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
185 | - * } $params |
|
186 | - * |
|
187 | - * @throws MissingParameterException if a required parameter is missing |
|
188 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
189 | - * @throws ClientResponseException if the status code of response is 4xx |
|
190 | - * @throws ServerResponseException if the status code of response is 5xx |
|
191 | - * |
|
192 | - * @return Elasticsearch|Promise |
|
193 | - */ |
|
194 | - public function delete(array $params = []) |
|
195 | - { |
|
196 | - $this->checkRequiredParameters(['repository', 'snapshot'], $params); |
|
197 | - $url = '/_snapshot/' . $this->encode($params['repository']) . '/' . $this->encode($params['snapshot']); |
|
198 | - $method = 'DELETE'; |
|
199 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'wait_for_completion', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
200 | - $headers = ['Accept' => 'application/json']; |
|
201 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
202 | - $request = $this->addOtelAttributes($params, ['repository', 'snapshot'], $request, 'snapshot.delete'); |
|
203 | - return $this->client->sendRequest($request); |
|
204 | - } |
|
205 | - /** |
|
206 | - * Deletes a repository. |
|
207 | - * |
|
208 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html |
|
209 | - * |
|
210 | - * @param array{ |
|
211 | - * repository: list, // (REQUIRED) Name of the snapshot repository to unregister. Wildcard (`*`) patterns are supported. |
|
212 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
213 | - * timeout: time, // Explicit operation timeout |
|
214 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
215 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
216 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
217 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
218 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
219 | - * } $params |
|
220 | - * |
|
221 | - * @throws MissingParameterException if a required parameter is missing |
|
222 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
223 | - * @throws ClientResponseException if the status code of response is 4xx |
|
224 | - * @throws ServerResponseException if the status code of response is 5xx |
|
225 | - * |
|
226 | - * @return Elasticsearch|Promise |
|
227 | - */ |
|
228 | - public function deleteRepository(array $params = []) |
|
229 | - { |
|
230 | - $this->checkRequiredParameters(['repository'], $params); |
|
231 | - $url = '/_snapshot/' . $this->encode($params['repository']); |
|
232 | - $method = 'DELETE'; |
|
233 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
234 | - $headers = ['Accept' => 'application/json']; |
|
235 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
236 | - $request = $this->addOtelAttributes($params, ['repository'], $request, 'snapshot.delete_repository'); |
|
237 | - return $this->client->sendRequest($request); |
|
238 | - } |
|
239 | - /** |
|
240 | - * Returns information about a snapshot. |
|
241 | - * |
|
242 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html |
|
243 | - * |
|
244 | - * @param array{ |
|
245 | - * repository: string, // (REQUIRED) A repository name |
|
246 | - * snapshot: list, // (REQUIRED) A comma-separated list of snapshot names |
|
247 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
248 | - * ignore_unavailable: boolean, // Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown |
|
249 | - * index_names: boolean, // Whether to include the name of each index in the snapshot. Defaults to true. |
|
250 | - * index_details: boolean, // Whether to include details of each index in the snapshot, if those details are available. Defaults to false. |
|
251 | - * include_repository: boolean, // Whether to include the repository name in the snapshot info. Defaults to true. |
|
252 | - * sort: enum, // Allows setting a sort order for the result. Defaults to start_time |
|
253 | - * size: integer, // Maximum number of snapshots to return. Defaults to 0 which means return all that match without limit. |
|
254 | - * order: enum, // Sort order |
|
255 | - * from_sort_value: string, // Value of the current sort column at which to start retrieval. |
|
256 | - * after: string, // Offset identifier to start pagination from as returned by the 'next' field in the response body. |
|
257 | - * offset: integer, // Numeric offset to start pagination based on the snapshots matching the request. Defaults to 0 |
|
258 | - * slm_policy_filter: string, // Filter snapshots by a comma-separated list of SLM policy names that snapshots belong to. Accepts wildcards. Use the special pattern '_none' to match snapshots without an SLM policy |
|
259 | - * verbose: boolean, // Whether to show verbose snapshot info or only show the basic info found in the repository index blob |
|
260 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
261 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
262 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
263 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
264 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
265 | - * } $params |
|
266 | - * |
|
267 | - * @throws MissingParameterException if a required parameter is missing |
|
268 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
269 | - * @throws ClientResponseException if the status code of response is 4xx |
|
270 | - * @throws ServerResponseException if the status code of response is 5xx |
|
271 | - * |
|
272 | - * @return Elasticsearch|Promise |
|
273 | - */ |
|
274 | - public function get(array $params = []) |
|
275 | - { |
|
276 | - $this->checkRequiredParameters(['repository', 'snapshot'], $params); |
|
277 | - $url = '/_snapshot/' . $this->encode($params['repository']) . '/' . $this->encode($params['snapshot']); |
|
278 | - $method = 'GET'; |
|
279 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'ignore_unavailable', 'index_names', 'index_details', 'include_repository', 'sort', 'size', 'order', 'from_sort_value', 'after', 'offset', 'slm_policy_filter', 'verbose', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
280 | - $headers = ['Accept' => 'application/json']; |
|
281 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
282 | - $request = $this->addOtelAttributes($params, ['repository', 'snapshot'], $request, 'snapshot.get'); |
|
283 | - return $this->client->sendRequest($request); |
|
284 | - } |
|
285 | - /** |
|
286 | - * Returns information about a repository. |
|
287 | - * |
|
288 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html |
|
289 | - * |
|
290 | - * @param array{ |
|
291 | - * repository: list, // A comma-separated list of repository names |
|
292 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
293 | - * local: boolean, // Return local information, do not retrieve the state from master node (default: false) |
|
294 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
295 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
296 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
297 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
298 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
299 | - * } $params |
|
300 | - * |
|
301 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
302 | - * @throws ClientResponseException if the status code of response is 4xx |
|
303 | - * @throws ServerResponseException if the status code of response is 5xx |
|
304 | - * |
|
305 | - * @return Elasticsearch|Promise |
|
306 | - */ |
|
307 | - public function getRepository(array $params = []) |
|
308 | - { |
|
309 | - if (isset($params['repository'])) { |
|
310 | - $url = '/_snapshot/' . $this->encode($params['repository']); |
|
311 | - $method = 'GET'; |
|
312 | - } else { |
|
313 | - $url = '/_snapshot'; |
|
314 | - $method = 'GET'; |
|
315 | - } |
|
316 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'local', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
317 | - $headers = ['Accept' => 'application/json']; |
|
318 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
319 | - $request = $this->addOtelAttributes($params, ['repository'], $request, 'snapshot.get_repository'); |
|
320 | - return $this->client->sendRequest($request); |
|
321 | - } |
|
322 | - /** |
|
323 | - * Analyzes a repository for correctness and performance |
|
324 | - * |
|
325 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html |
|
326 | - * |
|
327 | - * @param array{ |
|
328 | - * repository: string, // (REQUIRED) A repository name |
|
329 | - * blob_count: number, // Number of blobs to create during the test. Defaults to 100. |
|
330 | - * concurrency: number, // Number of operations to run concurrently during the test. Defaults to 10. |
|
331 | - * read_node_count: number, // Number of nodes on which to read a blob after writing. Defaults to 10. |
|
332 | - * early_read_node_count: number, // Number of nodes on which to perform an early read on a blob, i.e. before writing has completed. Early reads are rare actions so the 'rare_action_probability' parameter is also relevant. Defaults to 2. |
|
333 | - * seed: number, // Seed for the random number generator used to create the test workload. Defaults to a random value. |
|
334 | - * rare_action_probability: number, // Probability of taking a rare action such as an early read or an overwrite. Defaults to 0.02. |
|
335 | - * max_blob_size: string, // Maximum size of a blob to create during the test, e.g '1gb' or '100mb'. Defaults to '10mb'. |
|
336 | - * max_total_data_size: string, // Maximum total size of all blobs to create during the test, e.g '1tb' or '100gb'. Defaults to '1gb'. |
|
337 | - * timeout: time, // Explicit operation timeout. Defaults to '30s'. |
|
338 | - * detailed: boolean, // Whether to return detailed results or a summary. Defaults to 'false' so that only the summary is returned. |
|
339 | - * rarely_abort_writes: boolean, // Whether to rarely abort writes before they complete. Defaults to 'true'. |
|
340 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
341 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
342 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
343 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
344 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
345 | - * } $params |
|
346 | - * |
|
347 | - * @throws MissingParameterException if a required parameter is missing |
|
348 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
349 | - * @throws ClientResponseException if the status code of response is 4xx |
|
350 | - * @throws ServerResponseException if the status code of response is 5xx |
|
351 | - * |
|
352 | - * @return Elasticsearch|Promise |
|
353 | - */ |
|
354 | - public function repositoryAnalyze(array $params = []) |
|
355 | - { |
|
356 | - $this->checkRequiredParameters(['repository'], $params); |
|
357 | - $url = '/_snapshot/' . $this->encode($params['repository']) . '/_analyze'; |
|
358 | - $method = 'POST'; |
|
359 | - $url = $this->addQueryString($url, $params, ['blob_count', 'concurrency', 'read_node_count', 'early_read_node_count', 'seed', 'rare_action_probability', 'max_blob_size', 'max_total_data_size', 'timeout', 'detailed', 'rarely_abort_writes', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
360 | - $headers = ['Accept' => 'application/json']; |
|
361 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
362 | - $request = $this->addOtelAttributes($params, ['repository'], $request, 'snapshot.repository_analyze'); |
|
363 | - return $this->client->sendRequest($request); |
|
364 | - } |
|
365 | - /** |
|
366 | - * Restores a snapshot. |
|
367 | - * |
|
368 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html |
|
369 | - * |
|
370 | - * @param array{ |
|
371 | - * repository: string, // (REQUIRED) A repository name |
|
372 | - * snapshot: string, // (REQUIRED) A snapshot name |
|
373 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
374 | - * wait_for_completion: boolean, // Should this request wait until the operation has completed before returning |
|
375 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
376 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
377 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
378 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
379 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
380 | - * body: array, // Details of what to restore |
|
381 | - * } $params |
|
382 | - * |
|
383 | - * @throws MissingParameterException if a required parameter is missing |
|
384 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
385 | - * @throws ClientResponseException if the status code of response is 4xx |
|
386 | - * @throws ServerResponseException if the status code of response is 5xx |
|
387 | - * |
|
388 | - * @return Elasticsearch|Promise |
|
389 | - */ |
|
390 | - public function restore(array $params = []) |
|
391 | - { |
|
392 | - $this->checkRequiredParameters(['repository', 'snapshot'], $params); |
|
393 | - $url = '/_snapshot/' . $this->encode($params['repository']) . '/' . $this->encode($params['snapshot']) . '/_restore'; |
|
394 | - $method = 'POST'; |
|
395 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'wait_for_completion', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
396 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
397 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
398 | - $request = $this->addOtelAttributes($params, ['repository', 'snapshot'], $request, 'snapshot.restore'); |
|
399 | - return $this->client->sendRequest($request); |
|
400 | - } |
|
401 | - /** |
|
402 | - * Returns information about the status of a snapshot. |
|
403 | - * |
|
404 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html |
|
405 | - * |
|
406 | - * @param array{ |
|
407 | - * repository: string, // A repository name |
|
408 | - * snapshot: list, // A comma-separated list of snapshot names |
|
409 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
410 | - * ignore_unavailable: boolean, // Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown |
|
411 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
412 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
413 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
414 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
415 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
416 | - * } $params |
|
417 | - * |
|
418 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
419 | - * @throws ClientResponseException if the status code of response is 4xx |
|
420 | - * @throws ServerResponseException if the status code of response is 5xx |
|
421 | - * |
|
422 | - * @return Elasticsearch|Promise |
|
423 | - */ |
|
424 | - public function status(array $params = []) |
|
425 | - { |
|
426 | - if (isset($params['repository']) && isset($params['snapshot'])) { |
|
427 | - $url = '/_snapshot/' . $this->encode($params['repository']) . '/' . $this->encode($params['snapshot']) . '/_status'; |
|
428 | - $method = 'GET'; |
|
429 | - } elseif (isset($params['repository'])) { |
|
430 | - $url = '/_snapshot/' . $this->encode($params['repository']) . '/_status'; |
|
431 | - $method = 'GET'; |
|
432 | - } else { |
|
433 | - $url = '/_snapshot/_status'; |
|
434 | - $method = 'GET'; |
|
435 | - } |
|
436 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'ignore_unavailable', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
437 | - $headers = ['Accept' => 'application/json']; |
|
438 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
439 | - $request = $this->addOtelAttributes($params, ['repository', 'snapshot'], $request, 'snapshot.status'); |
|
440 | - return $this->client->sendRequest($request); |
|
441 | - } |
|
442 | - /** |
|
443 | - * Verifies a repository. |
|
444 | - * |
|
445 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html |
|
446 | - * |
|
447 | - * @param array{ |
|
448 | - * repository: string, // (REQUIRED) A repository name |
|
449 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
450 | - * timeout: time, // Explicit operation timeout |
|
451 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
452 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
453 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
454 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
455 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
456 | - * } $params |
|
457 | - * |
|
458 | - * @throws MissingParameterException if a required parameter is missing |
|
459 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
460 | - * @throws ClientResponseException if the status code of response is 4xx |
|
461 | - * @throws ServerResponseException if the status code of response is 5xx |
|
462 | - * |
|
463 | - * @return Elasticsearch|Promise |
|
464 | - */ |
|
465 | - public function verifyRepository(array $params = []) |
|
466 | - { |
|
467 | - $this->checkRequiredParameters(['repository'], $params); |
|
468 | - $url = '/_snapshot/' . $this->encode($params['repository']) . '/_verify'; |
|
469 | - $method = 'POST'; |
|
470 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
471 | - $headers = ['Accept' => 'application/json']; |
|
472 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
473 | - $request = $this->addOtelAttributes($params, ['repository'], $request, 'snapshot.verify_repository'); |
|
474 | - return $this->client->sendRequest($request); |
|
475 | - } |
|
28 | + /** |
|
29 | + * Removes stale data from repository. |
|
30 | + * |
|
31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/clean-up-snapshot-repo-api.html |
|
32 | + * |
|
33 | + * @param array{ |
|
34 | + * repository: string, // (REQUIRED) A repository name |
|
35 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
36 | + * timeout: time, // Explicit operation timeout |
|
37 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
38 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
39 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
40 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
41 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
42 | + * } $params |
|
43 | + * |
|
44 | + * @throws MissingParameterException if a required parameter is missing |
|
45 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
46 | + * @throws ClientResponseException if the status code of response is 4xx |
|
47 | + * @throws ServerResponseException if the status code of response is 5xx |
|
48 | + * |
|
49 | + * @return Elasticsearch|Promise |
|
50 | + */ |
|
51 | + public function cleanupRepository(array $params = []) |
|
52 | + { |
|
53 | + $this->checkRequiredParameters(['repository'], $params); |
|
54 | + $url = '/_snapshot/' . $this->encode($params['repository']) . '/_cleanup'; |
|
55 | + $method = 'POST'; |
|
56 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
57 | + $headers = ['Accept' => 'application/json']; |
|
58 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
59 | + $request = $this->addOtelAttributes($params, ['repository'], $request, 'snapshot.cleanup_repository'); |
|
60 | + return $this->client->sendRequest($request); |
|
61 | + } |
|
62 | + /** |
|
63 | + * Clones indices from one snapshot into another snapshot in the same repository. |
|
64 | + * |
|
65 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html |
|
66 | + * |
|
67 | + * @param array{ |
|
68 | + * repository: string, // (REQUIRED) A repository name |
|
69 | + * snapshot: string, // (REQUIRED) The name of the snapshot to clone from |
|
70 | + * target_snapshot: string, // (REQUIRED) The name of the cloned snapshot to create |
|
71 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
72 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
73 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
74 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
75 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
76 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
77 | + * body: array, // (REQUIRED) The snapshot clone definition |
|
78 | + * } $params |
|
79 | + * |
|
80 | + * @throws MissingParameterException if a required parameter is missing |
|
81 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
82 | + * @throws ClientResponseException if the status code of response is 4xx |
|
83 | + * @throws ServerResponseException if the status code of response is 5xx |
|
84 | + * |
|
85 | + * @return Elasticsearch|Promise |
|
86 | + */ |
|
87 | + public function clone(array $params = []) |
|
88 | + { |
|
89 | + $this->checkRequiredParameters(['repository', 'snapshot', 'target_snapshot', 'body'], $params); |
|
90 | + $url = '/_snapshot/' . $this->encode($params['repository']) . '/' . $this->encode($params['snapshot']) . '/_clone/' . $this->encode($params['target_snapshot']); |
|
91 | + $method = 'PUT'; |
|
92 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
93 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
94 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
95 | + $request = $this->addOtelAttributes($params, ['repository', 'snapshot', 'target_snapshot'], $request, 'snapshot.clone'); |
|
96 | + return $this->client->sendRequest($request); |
|
97 | + } |
|
98 | + /** |
|
99 | + * Creates a snapshot in a repository. |
|
100 | + * |
|
101 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html |
|
102 | + * |
|
103 | + * @param array{ |
|
104 | + * repository: string, // (REQUIRED) A repository name |
|
105 | + * snapshot: string, // (REQUIRED) A snapshot name |
|
106 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
107 | + * wait_for_completion: boolean, // Should this request wait until the operation has completed before returning |
|
108 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
109 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
110 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
111 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
112 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
113 | + * body: array, // The snapshot definition |
|
114 | + * } $params |
|
115 | + * |
|
116 | + * @throws MissingParameterException if a required parameter is missing |
|
117 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
118 | + * @throws ClientResponseException if the status code of response is 4xx |
|
119 | + * @throws ServerResponseException if the status code of response is 5xx |
|
120 | + * |
|
121 | + * @return Elasticsearch|Promise |
|
122 | + */ |
|
123 | + public function create(array $params = []) |
|
124 | + { |
|
125 | + $this->checkRequiredParameters(['repository', 'snapshot'], $params); |
|
126 | + $url = '/_snapshot/' . $this->encode($params['repository']) . '/' . $this->encode($params['snapshot']); |
|
127 | + $method = 'PUT'; |
|
128 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'wait_for_completion', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
129 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
130 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
131 | + $request = $this->addOtelAttributes($params, ['repository', 'snapshot'], $request, 'snapshot.create'); |
|
132 | + return $this->client->sendRequest($request); |
|
133 | + } |
|
134 | + /** |
|
135 | + * Creates a repository. |
|
136 | + * |
|
137 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html |
|
138 | + * |
|
139 | + * @param array{ |
|
140 | + * repository: string, // (REQUIRED) A repository name |
|
141 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
142 | + * timeout: time, // Explicit operation timeout |
|
143 | + * verify: boolean, // Whether to verify the repository after creation |
|
144 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
145 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
146 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
147 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
148 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
149 | + * body: array, // (REQUIRED) The repository definition |
|
150 | + * } $params |
|
151 | + * |
|
152 | + * @throws MissingParameterException if a required parameter is missing |
|
153 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
154 | + * @throws ClientResponseException if the status code of response is 4xx |
|
155 | + * @throws ServerResponseException if the status code of response is 5xx |
|
156 | + * |
|
157 | + * @return Elasticsearch|Promise |
|
158 | + */ |
|
159 | + public function createRepository(array $params = []) |
|
160 | + { |
|
161 | + $this->checkRequiredParameters(['repository', 'body'], $params); |
|
162 | + $url = '/_snapshot/' . $this->encode($params['repository']); |
|
163 | + $method = 'PUT'; |
|
164 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', 'verify', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
165 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
166 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
167 | + $request = $this->addOtelAttributes($params, ['repository'], $request, 'snapshot.create_repository'); |
|
168 | + return $this->client->sendRequest($request); |
|
169 | + } |
|
170 | + /** |
|
171 | + * Deletes one or more snapshots. |
|
172 | + * |
|
173 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html |
|
174 | + * |
|
175 | + * @param array{ |
|
176 | + * repository: string, // (REQUIRED) A repository name |
|
177 | + * snapshot: list, // (REQUIRED) A comma-separated list of snapshot names |
|
178 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
179 | + * wait_for_completion: boolean, // Should this request wait until the operation has completed before returning |
|
180 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
181 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
182 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
183 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
184 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
185 | + * } $params |
|
186 | + * |
|
187 | + * @throws MissingParameterException if a required parameter is missing |
|
188 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
189 | + * @throws ClientResponseException if the status code of response is 4xx |
|
190 | + * @throws ServerResponseException if the status code of response is 5xx |
|
191 | + * |
|
192 | + * @return Elasticsearch|Promise |
|
193 | + */ |
|
194 | + public function delete(array $params = []) |
|
195 | + { |
|
196 | + $this->checkRequiredParameters(['repository', 'snapshot'], $params); |
|
197 | + $url = '/_snapshot/' . $this->encode($params['repository']) . '/' . $this->encode($params['snapshot']); |
|
198 | + $method = 'DELETE'; |
|
199 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'wait_for_completion', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
200 | + $headers = ['Accept' => 'application/json']; |
|
201 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
202 | + $request = $this->addOtelAttributes($params, ['repository', 'snapshot'], $request, 'snapshot.delete'); |
|
203 | + return $this->client->sendRequest($request); |
|
204 | + } |
|
205 | + /** |
|
206 | + * Deletes a repository. |
|
207 | + * |
|
208 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html |
|
209 | + * |
|
210 | + * @param array{ |
|
211 | + * repository: list, // (REQUIRED) Name of the snapshot repository to unregister. Wildcard (`*`) patterns are supported. |
|
212 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
213 | + * timeout: time, // Explicit operation timeout |
|
214 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
215 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
216 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
217 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
218 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
219 | + * } $params |
|
220 | + * |
|
221 | + * @throws MissingParameterException if a required parameter is missing |
|
222 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
223 | + * @throws ClientResponseException if the status code of response is 4xx |
|
224 | + * @throws ServerResponseException if the status code of response is 5xx |
|
225 | + * |
|
226 | + * @return Elasticsearch|Promise |
|
227 | + */ |
|
228 | + public function deleteRepository(array $params = []) |
|
229 | + { |
|
230 | + $this->checkRequiredParameters(['repository'], $params); |
|
231 | + $url = '/_snapshot/' . $this->encode($params['repository']); |
|
232 | + $method = 'DELETE'; |
|
233 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
234 | + $headers = ['Accept' => 'application/json']; |
|
235 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
236 | + $request = $this->addOtelAttributes($params, ['repository'], $request, 'snapshot.delete_repository'); |
|
237 | + return $this->client->sendRequest($request); |
|
238 | + } |
|
239 | + /** |
|
240 | + * Returns information about a snapshot. |
|
241 | + * |
|
242 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html |
|
243 | + * |
|
244 | + * @param array{ |
|
245 | + * repository: string, // (REQUIRED) A repository name |
|
246 | + * snapshot: list, // (REQUIRED) A comma-separated list of snapshot names |
|
247 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
248 | + * ignore_unavailable: boolean, // Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown |
|
249 | + * index_names: boolean, // Whether to include the name of each index in the snapshot. Defaults to true. |
|
250 | + * index_details: boolean, // Whether to include details of each index in the snapshot, if those details are available. Defaults to false. |
|
251 | + * include_repository: boolean, // Whether to include the repository name in the snapshot info. Defaults to true. |
|
252 | + * sort: enum, // Allows setting a sort order for the result. Defaults to start_time |
|
253 | + * size: integer, // Maximum number of snapshots to return. Defaults to 0 which means return all that match without limit. |
|
254 | + * order: enum, // Sort order |
|
255 | + * from_sort_value: string, // Value of the current sort column at which to start retrieval. |
|
256 | + * after: string, // Offset identifier to start pagination from as returned by the 'next' field in the response body. |
|
257 | + * offset: integer, // Numeric offset to start pagination based on the snapshots matching the request. Defaults to 0 |
|
258 | + * slm_policy_filter: string, // Filter snapshots by a comma-separated list of SLM policy names that snapshots belong to. Accepts wildcards. Use the special pattern '_none' to match snapshots without an SLM policy |
|
259 | + * verbose: boolean, // Whether to show verbose snapshot info or only show the basic info found in the repository index blob |
|
260 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
261 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
262 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
263 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
264 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
265 | + * } $params |
|
266 | + * |
|
267 | + * @throws MissingParameterException if a required parameter is missing |
|
268 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
269 | + * @throws ClientResponseException if the status code of response is 4xx |
|
270 | + * @throws ServerResponseException if the status code of response is 5xx |
|
271 | + * |
|
272 | + * @return Elasticsearch|Promise |
|
273 | + */ |
|
274 | + public function get(array $params = []) |
|
275 | + { |
|
276 | + $this->checkRequiredParameters(['repository', 'snapshot'], $params); |
|
277 | + $url = '/_snapshot/' . $this->encode($params['repository']) . '/' . $this->encode($params['snapshot']); |
|
278 | + $method = 'GET'; |
|
279 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'ignore_unavailable', 'index_names', 'index_details', 'include_repository', 'sort', 'size', 'order', 'from_sort_value', 'after', 'offset', 'slm_policy_filter', 'verbose', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
280 | + $headers = ['Accept' => 'application/json']; |
|
281 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
282 | + $request = $this->addOtelAttributes($params, ['repository', 'snapshot'], $request, 'snapshot.get'); |
|
283 | + return $this->client->sendRequest($request); |
|
284 | + } |
|
285 | + /** |
|
286 | + * Returns information about a repository. |
|
287 | + * |
|
288 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html |
|
289 | + * |
|
290 | + * @param array{ |
|
291 | + * repository: list, // A comma-separated list of repository names |
|
292 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
293 | + * local: boolean, // Return local information, do not retrieve the state from master node (default: false) |
|
294 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
295 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
296 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
297 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
298 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
299 | + * } $params |
|
300 | + * |
|
301 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
302 | + * @throws ClientResponseException if the status code of response is 4xx |
|
303 | + * @throws ServerResponseException if the status code of response is 5xx |
|
304 | + * |
|
305 | + * @return Elasticsearch|Promise |
|
306 | + */ |
|
307 | + public function getRepository(array $params = []) |
|
308 | + { |
|
309 | + if (isset($params['repository'])) { |
|
310 | + $url = '/_snapshot/' . $this->encode($params['repository']); |
|
311 | + $method = 'GET'; |
|
312 | + } else { |
|
313 | + $url = '/_snapshot'; |
|
314 | + $method = 'GET'; |
|
315 | + } |
|
316 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'local', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
317 | + $headers = ['Accept' => 'application/json']; |
|
318 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
319 | + $request = $this->addOtelAttributes($params, ['repository'], $request, 'snapshot.get_repository'); |
|
320 | + return $this->client->sendRequest($request); |
|
321 | + } |
|
322 | + /** |
|
323 | + * Analyzes a repository for correctness and performance |
|
324 | + * |
|
325 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html |
|
326 | + * |
|
327 | + * @param array{ |
|
328 | + * repository: string, // (REQUIRED) A repository name |
|
329 | + * blob_count: number, // Number of blobs to create during the test. Defaults to 100. |
|
330 | + * concurrency: number, // Number of operations to run concurrently during the test. Defaults to 10. |
|
331 | + * read_node_count: number, // Number of nodes on which to read a blob after writing. Defaults to 10. |
|
332 | + * early_read_node_count: number, // Number of nodes on which to perform an early read on a blob, i.e. before writing has completed. Early reads are rare actions so the 'rare_action_probability' parameter is also relevant. Defaults to 2. |
|
333 | + * seed: number, // Seed for the random number generator used to create the test workload. Defaults to a random value. |
|
334 | + * rare_action_probability: number, // Probability of taking a rare action such as an early read or an overwrite. Defaults to 0.02. |
|
335 | + * max_blob_size: string, // Maximum size of a blob to create during the test, e.g '1gb' or '100mb'. Defaults to '10mb'. |
|
336 | + * max_total_data_size: string, // Maximum total size of all blobs to create during the test, e.g '1tb' or '100gb'. Defaults to '1gb'. |
|
337 | + * timeout: time, // Explicit operation timeout. Defaults to '30s'. |
|
338 | + * detailed: boolean, // Whether to return detailed results or a summary. Defaults to 'false' so that only the summary is returned. |
|
339 | + * rarely_abort_writes: boolean, // Whether to rarely abort writes before they complete. Defaults to 'true'. |
|
340 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
341 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
342 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
343 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
344 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
345 | + * } $params |
|
346 | + * |
|
347 | + * @throws MissingParameterException if a required parameter is missing |
|
348 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
349 | + * @throws ClientResponseException if the status code of response is 4xx |
|
350 | + * @throws ServerResponseException if the status code of response is 5xx |
|
351 | + * |
|
352 | + * @return Elasticsearch|Promise |
|
353 | + */ |
|
354 | + public function repositoryAnalyze(array $params = []) |
|
355 | + { |
|
356 | + $this->checkRequiredParameters(['repository'], $params); |
|
357 | + $url = '/_snapshot/' . $this->encode($params['repository']) . '/_analyze'; |
|
358 | + $method = 'POST'; |
|
359 | + $url = $this->addQueryString($url, $params, ['blob_count', 'concurrency', 'read_node_count', 'early_read_node_count', 'seed', 'rare_action_probability', 'max_blob_size', 'max_total_data_size', 'timeout', 'detailed', 'rarely_abort_writes', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
360 | + $headers = ['Accept' => 'application/json']; |
|
361 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
362 | + $request = $this->addOtelAttributes($params, ['repository'], $request, 'snapshot.repository_analyze'); |
|
363 | + return $this->client->sendRequest($request); |
|
364 | + } |
|
365 | + /** |
|
366 | + * Restores a snapshot. |
|
367 | + * |
|
368 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html |
|
369 | + * |
|
370 | + * @param array{ |
|
371 | + * repository: string, // (REQUIRED) A repository name |
|
372 | + * snapshot: string, // (REQUIRED) A snapshot name |
|
373 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
374 | + * wait_for_completion: boolean, // Should this request wait until the operation has completed before returning |
|
375 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
376 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
377 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
378 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
379 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
380 | + * body: array, // Details of what to restore |
|
381 | + * } $params |
|
382 | + * |
|
383 | + * @throws MissingParameterException if a required parameter is missing |
|
384 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
385 | + * @throws ClientResponseException if the status code of response is 4xx |
|
386 | + * @throws ServerResponseException if the status code of response is 5xx |
|
387 | + * |
|
388 | + * @return Elasticsearch|Promise |
|
389 | + */ |
|
390 | + public function restore(array $params = []) |
|
391 | + { |
|
392 | + $this->checkRequiredParameters(['repository', 'snapshot'], $params); |
|
393 | + $url = '/_snapshot/' . $this->encode($params['repository']) . '/' . $this->encode($params['snapshot']) . '/_restore'; |
|
394 | + $method = 'POST'; |
|
395 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'wait_for_completion', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
396 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
397 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
398 | + $request = $this->addOtelAttributes($params, ['repository', 'snapshot'], $request, 'snapshot.restore'); |
|
399 | + return $this->client->sendRequest($request); |
|
400 | + } |
|
401 | + /** |
|
402 | + * Returns information about the status of a snapshot. |
|
403 | + * |
|
404 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html |
|
405 | + * |
|
406 | + * @param array{ |
|
407 | + * repository: string, // A repository name |
|
408 | + * snapshot: list, // A comma-separated list of snapshot names |
|
409 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
410 | + * ignore_unavailable: boolean, // Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown |
|
411 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
412 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
413 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
414 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
415 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
416 | + * } $params |
|
417 | + * |
|
418 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
419 | + * @throws ClientResponseException if the status code of response is 4xx |
|
420 | + * @throws ServerResponseException if the status code of response is 5xx |
|
421 | + * |
|
422 | + * @return Elasticsearch|Promise |
|
423 | + */ |
|
424 | + public function status(array $params = []) |
|
425 | + { |
|
426 | + if (isset($params['repository']) && isset($params['snapshot'])) { |
|
427 | + $url = '/_snapshot/' . $this->encode($params['repository']) . '/' . $this->encode($params['snapshot']) . '/_status'; |
|
428 | + $method = 'GET'; |
|
429 | + } elseif (isset($params['repository'])) { |
|
430 | + $url = '/_snapshot/' . $this->encode($params['repository']) . '/_status'; |
|
431 | + $method = 'GET'; |
|
432 | + } else { |
|
433 | + $url = '/_snapshot/_status'; |
|
434 | + $method = 'GET'; |
|
435 | + } |
|
436 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'ignore_unavailable', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
437 | + $headers = ['Accept' => 'application/json']; |
|
438 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
439 | + $request = $this->addOtelAttributes($params, ['repository', 'snapshot'], $request, 'snapshot.status'); |
|
440 | + return $this->client->sendRequest($request); |
|
441 | + } |
|
442 | + /** |
|
443 | + * Verifies a repository. |
|
444 | + * |
|
445 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html |
|
446 | + * |
|
447 | + * @param array{ |
|
448 | + * repository: string, // (REQUIRED) A repository name |
|
449 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
450 | + * timeout: time, // Explicit operation timeout |
|
451 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
452 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
453 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
454 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
455 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
456 | + * } $params |
|
457 | + * |
|
458 | + * @throws MissingParameterException if a required parameter is missing |
|
459 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
460 | + * @throws ClientResponseException if the status code of response is 4xx |
|
461 | + * @throws ServerResponseException if the status code of response is 5xx |
|
462 | + * |
|
463 | + * @return Elasticsearch|Promise |
|
464 | + */ |
|
465 | + public function verifyRepository(array $params = []) |
|
466 | + { |
|
467 | + $this->checkRequiredParameters(['repository'], $params); |
|
468 | + $url = '/_snapshot/' . $this->encode($params['repository']) . '/_verify'; |
|
469 | + $method = 'POST'; |
|
470 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
471 | + $headers = ['Accept' => 'application/json']; |
|
472 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
473 | + $request = $this->addOtelAttributes($params, ['repository'], $request, 'snapshot.verify_repository'); |
|
474 | + return $this->client->sendRequest($request); |
|
475 | + } |
|
476 | 476 | } |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | * Elasticsearch B.V licenses this file to you under the MIT License. |
12 | 12 | * See the LICENSE file in the project root for more information. |
13 | 13 | */ |
14 | -declare (strict_types=1); |
|
14 | +declare(strict_types=1); |
|
15 | 15 | namespace OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Endpoints; |
16 | 16 | |
17 | 17 | use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Exception\ClientResponseException; |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | public function cleanupRepository(array $params = []) |
52 | 52 | { |
53 | 53 | $this->checkRequiredParameters(['repository'], $params); |
54 | - $url = '/_snapshot/' . $this->encode($params['repository']) . '/_cleanup'; |
|
54 | + $url = '/_snapshot/'.$this->encode($params['repository']).'/_cleanup'; |
|
55 | 55 | $method = 'POST'; |
56 | 56 | $url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
57 | 57 | $headers = ['Accept' => 'application/json']; |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | public function clone(array $params = []) |
88 | 88 | { |
89 | 89 | $this->checkRequiredParameters(['repository', 'snapshot', 'target_snapshot', 'body'], $params); |
90 | - $url = '/_snapshot/' . $this->encode($params['repository']) . '/' . $this->encode($params['snapshot']) . '/_clone/' . $this->encode($params['target_snapshot']); |
|
90 | + $url = '/_snapshot/'.$this->encode($params['repository']).'/'.$this->encode($params['snapshot']).'/_clone/'.$this->encode($params['target_snapshot']); |
|
91 | 91 | $method = 'PUT'; |
92 | 92 | $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
93 | 93 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | public function create(array $params = []) |
124 | 124 | { |
125 | 125 | $this->checkRequiredParameters(['repository', 'snapshot'], $params); |
126 | - $url = '/_snapshot/' . $this->encode($params['repository']) . '/' . $this->encode($params['snapshot']); |
|
126 | + $url = '/_snapshot/'.$this->encode($params['repository']).'/'.$this->encode($params['snapshot']); |
|
127 | 127 | $method = 'PUT'; |
128 | 128 | $url = $this->addQueryString($url, $params, ['master_timeout', 'wait_for_completion', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
129 | 129 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | public function createRepository(array $params = []) |
160 | 160 | { |
161 | 161 | $this->checkRequiredParameters(['repository', 'body'], $params); |
162 | - $url = '/_snapshot/' . $this->encode($params['repository']); |
|
162 | + $url = '/_snapshot/'.$this->encode($params['repository']); |
|
163 | 163 | $method = 'PUT'; |
164 | 164 | $url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', 'verify', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
165 | 165 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | public function delete(array $params = []) |
195 | 195 | { |
196 | 196 | $this->checkRequiredParameters(['repository', 'snapshot'], $params); |
197 | - $url = '/_snapshot/' . $this->encode($params['repository']) . '/' . $this->encode($params['snapshot']); |
|
197 | + $url = '/_snapshot/'.$this->encode($params['repository']).'/'.$this->encode($params['snapshot']); |
|
198 | 198 | $method = 'DELETE'; |
199 | 199 | $url = $this->addQueryString($url, $params, ['master_timeout', 'wait_for_completion', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
200 | 200 | $headers = ['Accept' => 'application/json']; |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | public function deleteRepository(array $params = []) |
229 | 229 | { |
230 | 230 | $this->checkRequiredParameters(['repository'], $params); |
231 | - $url = '/_snapshot/' . $this->encode($params['repository']); |
|
231 | + $url = '/_snapshot/'.$this->encode($params['repository']); |
|
232 | 232 | $method = 'DELETE'; |
233 | 233 | $url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
234 | 234 | $headers = ['Accept' => 'application/json']; |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | public function get(array $params = []) |
275 | 275 | { |
276 | 276 | $this->checkRequiredParameters(['repository', 'snapshot'], $params); |
277 | - $url = '/_snapshot/' . $this->encode($params['repository']) . '/' . $this->encode($params['snapshot']); |
|
277 | + $url = '/_snapshot/'.$this->encode($params['repository']).'/'.$this->encode($params['snapshot']); |
|
278 | 278 | $method = 'GET'; |
279 | 279 | $url = $this->addQueryString($url, $params, ['master_timeout', 'ignore_unavailable', 'index_names', 'index_details', 'include_repository', 'sort', 'size', 'order', 'from_sort_value', 'after', 'offset', 'slm_policy_filter', 'verbose', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
280 | 280 | $headers = ['Accept' => 'application/json']; |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | public function getRepository(array $params = []) |
308 | 308 | { |
309 | 309 | if (isset($params['repository'])) { |
310 | - $url = '/_snapshot/' . $this->encode($params['repository']); |
|
310 | + $url = '/_snapshot/'.$this->encode($params['repository']); |
|
311 | 311 | $method = 'GET'; |
312 | 312 | } else { |
313 | 313 | $url = '/_snapshot'; |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | public function repositoryAnalyze(array $params = []) |
355 | 355 | { |
356 | 356 | $this->checkRequiredParameters(['repository'], $params); |
357 | - $url = '/_snapshot/' . $this->encode($params['repository']) . '/_analyze'; |
|
357 | + $url = '/_snapshot/'.$this->encode($params['repository']).'/_analyze'; |
|
358 | 358 | $method = 'POST'; |
359 | 359 | $url = $this->addQueryString($url, $params, ['blob_count', 'concurrency', 'read_node_count', 'early_read_node_count', 'seed', 'rare_action_probability', 'max_blob_size', 'max_total_data_size', 'timeout', 'detailed', 'rarely_abort_writes', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
360 | 360 | $headers = ['Accept' => 'application/json']; |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | public function restore(array $params = []) |
391 | 391 | { |
392 | 392 | $this->checkRequiredParameters(['repository', 'snapshot'], $params); |
393 | - $url = '/_snapshot/' . $this->encode($params['repository']) . '/' . $this->encode($params['snapshot']) . '/_restore'; |
|
393 | + $url = '/_snapshot/'.$this->encode($params['repository']).'/'.$this->encode($params['snapshot']).'/_restore'; |
|
394 | 394 | $method = 'POST'; |
395 | 395 | $url = $this->addQueryString($url, $params, ['master_timeout', 'wait_for_completion', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
396 | 396 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -424,10 +424,10 @@ discard block |
||
424 | 424 | public function status(array $params = []) |
425 | 425 | { |
426 | 426 | if (isset($params['repository']) && isset($params['snapshot'])) { |
427 | - $url = '/_snapshot/' . $this->encode($params['repository']) . '/' . $this->encode($params['snapshot']) . '/_status'; |
|
427 | + $url = '/_snapshot/'.$this->encode($params['repository']).'/'.$this->encode($params['snapshot']).'/_status'; |
|
428 | 428 | $method = 'GET'; |
429 | 429 | } elseif (isset($params['repository'])) { |
430 | - $url = '/_snapshot/' . $this->encode($params['repository']) . '/_status'; |
|
430 | + $url = '/_snapshot/'.$this->encode($params['repository']).'/_status'; |
|
431 | 431 | $method = 'GET'; |
432 | 432 | } else { |
433 | 433 | $url = '/_snapshot/_status'; |
@@ -465,7 +465,7 @@ discard block |
||
465 | 465 | public function verifyRepository(array $params = []) |
466 | 466 | { |
467 | 467 | $this->checkRequiredParameters(['repository'], $params); |
468 | - $url = '/_snapshot/' . $this->encode($params['repository']) . '/_verify'; |
|
468 | + $url = '/_snapshot/'.$this->encode($params['repository']).'/_verify'; |
|
469 | 469 | $method = 'POST'; |
470 | 470 | $url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
471 | 471 | $headers = ['Accept' => 'application/json']; |
@@ -25,285 +25,285 @@ |
||
25 | 25 | */ |
26 | 26 | class Slm extends AbstractEndpoint |
27 | 27 | { |
28 | - /** |
|
29 | - * Deletes an existing snapshot lifecycle policy. |
|
30 | - * |
|
31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-delete-policy.html |
|
32 | - * |
|
33 | - * @param array{ |
|
34 | - * policy_id: string, // (REQUIRED) The id of the snapshot lifecycle policy to remove |
|
35 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
36 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
37 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
38 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
39 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
40 | - * } $params |
|
41 | - * |
|
42 | - * @throws MissingParameterException if a required parameter is missing |
|
43 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
44 | - * @throws ClientResponseException if the status code of response is 4xx |
|
45 | - * @throws ServerResponseException if the status code of response is 5xx |
|
46 | - * |
|
47 | - * @return Elasticsearch|Promise |
|
48 | - */ |
|
49 | - public function deleteLifecycle(array $params = []) |
|
50 | - { |
|
51 | - $this->checkRequiredParameters(['policy_id'], $params); |
|
52 | - $url = '/_slm/policy/' . $this->encode($params['policy_id']); |
|
53 | - $method = 'DELETE'; |
|
54 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
55 | - $headers = ['Accept' => 'application/json']; |
|
56 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
57 | - $request = $this->addOtelAttributes($params, ['policy_id'], $request, 'slm.delete_lifecycle'); |
|
58 | - return $this->client->sendRequest($request); |
|
59 | - } |
|
60 | - /** |
|
61 | - * Immediately creates a snapshot according to the lifecycle policy, without waiting for the scheduled time. |
|
62 | - * |
|
63 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-execute-lifecycle.html |
|
64 | - * |
|
65 | - * @param array{ |
|
66 | - * policy_id: string, // (REQUIRED) The id of the snapshot lifecycle policy to be executed |
|
67 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
68 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
69 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
70 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
71 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
72 | - * } $params |
|
73 | - * |
|
74 | - * @throws MissingParameterException if a required parameter is missing |
|
75 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
76 | - * @throws ClientResponseException if the status code of response is 4xx |
|
77 | - * @throws ServerResponseException if the status code of response is 5xx |
|
78 | - * |
|
79 | - * @return Elasticsearch|Promise |
|
80 | - */ |
|
81 | - public function executeLifecycle(array $params = []) |
|
82 | - { |
|
83 | - $this->checkRequiredParameters(['policy_id'], $params); |
|
84 | - $url = '/_slm/policy/' . $this->encode($params['policy_id']) . '/_execute'; |
|
85 | - $method = 'PUT'; |
|
86 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
87 | - $headers = ['Accept' => 'application/json']; |
|
88 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
89 | - $request = $this->addOtelAttributes($params, ['policy_id'], $request, 'slm.execute_lifecycle'); |
|
90 | - return $this->client->sendRequest($request); |
|
91 | - } |
|
92 | - /** |
|
93 | - * Deletes any snapshots that are expired according to the policy's retention rules. |
|
94 | - * |
|
95 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-execute-retention.html |
|
96 | - * |
|
97 | - * @param array{ |
|
98 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
99 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
100 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
101 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
102 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
103 | - * } $params |
|
104 | - * |
|
105 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
106 | - * @throws ClientResponseException if the status code of response is 4xx |
|
107 | - * @throws ServerResponseException if the status code of response is 5xx |
|
108 | - * |
|
109 | - * @return Elasticsearch|Promise |
|
110 | - */ |
|
111 | - public function executeRetention(array $params = []) |
|
112 | - { |
|
113 | - $url = '/_slm/_execute_retention'; |
|
114 | - $method = 'POST'; |
|
115 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
116 | - $headers = ['Accept' => 'application/json']; |
|
117 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
118 | - $request = $this->addOtelAttributes($params, [], $request, 'slm.execute_retention'); |
|
119 | - return $this->client->sendRequest($request); |
|
120 | - } |
|
121 | - /** |
|
122 | - * Retrieves one or more snapshot lifecycle policy definitions and information about the latest snapshot attempts. |
|
123 | - * |
|
124 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-get-policy.html |
|
125 | - * |
|
126 | - * @param array{ |
|
127 | - * policy_id: list, // Comma-separated list of snapshot lifecycle policies to retrieve |
|
128 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
129 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
130 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
131 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
132 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
133 | - * } $params |
|
134 | - * |
|
135 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
136 | - * @throws ClientResponseException if the status code of response is 4xx |
|
137 | - * @throws ServerResponseException if the status code of response is 5xx |
|
138 | - * |
|
139 | - * @return Elasticsearch|Promise |
|
140 | - */ |
|
141 | - public function getLifecycle(array $params = []) |
|
142 | - { |
|
143 | - if (isset($params['policy_id'])) { |
|
144 | - $url = '/_slm/policy/' . $this->encode($params['policy_id']); |
|
145 | - $method = 'GET'; |
|
146 | - } else { |
|
147 | - $url = '/_slm/policy'; |
|
148 | - $method = 'GET'; |
|
149 | - } |
|
150 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
151 | - $headers = ['Accept' => 'application/json']; |
|
152 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
153 | - $request = $this->addOtelAttributes($params, ['policy_id'], $request, 'slm.get_lifecycle'); |
|
154 | - return $this->client->sendRequest($request); |
|
155 | - } |
|
156 | - /** |
|
157 | - * Returns global and policy-level statistics about actions taken by snapshot lifecycle management. |
|
158 | - * |
|
159 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/slm-api-get-stats.html |
|
160 | - * |
|
161 | - * @param array{ |
|
162 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
163 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
164 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
165 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
166 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
167 | - * } $params |
|
168 | - * |
|
169 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
170 | - * @throws ClientResponseException if the status code of response is 4xx |
|
171 | - * @throws ServerResponseException if the status code of response is 5xx |
|
172 | - * |
|
173 | - * @return Elasticsearch|Promise |
|
174 | - */ |
|
175 | - public function getStats(array $params = []) |
|
176 | - { |
|
177 | - $url = '/_slm/stats'; |
|
178 | - $method = 'GET'; |
|
179 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
180 | - $headers = ['Accept' => 'application/json']; |
|
181 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
182 | - $request = $this->addOtelAttributes($params, [], $request, 'slm.get_stats'); |
|
183 | - return $this->client->sendRequest($request); |
|
184 | - } |
|
185 | - /** |
|
186 | - * Retrieves the status of snapshot lifecycle management (SLM). |
|
187 | - * |
|
188 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-get-status.html |
|
189 | - * |
|
190 | - * @param array{ |
|
191 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
192 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
193 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
194 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
195 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
196 | - * } $params |
|
197 | - * |
|
198 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
199 | - * @throws ClientResponseException if the status code of response is 4xx |
|
200 | - * @throws ServerResponseException if the status code of response is 5xx |
|
201 | - * |
|
202 | - * @return Elasticsearch|Promise |
|
203 | - */ |
|
204 | - public function getStatus(array $params = []) |
|
205 | - { |
|
206 | - $url = '/_slm/status'; |
|
207 | - $method = 'GET'; |
|
208 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
209 | - $headers = ['Accept' => 'application/json']; |
|
210 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
211 | - $request = $this->addOtelAttributes($params, [], $request, 'slm.get_status'); |
|
212 | - return $this->client->sendRequest($request); |
|
213 | - } |
|
214 | - /** |
|
215 | - * Creates or updates a snapshot lifecycle policy. |
|
216 | - * |
|
217 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-put-policy.html |
|
218 | - * |
|
219 | - * @param array{ |
|
220 | - * policy_id: string, // (REQUIRED) The id of the snapshot lifecycle policy |
|
221 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
222 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
223 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
224 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
225 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
226 | - * body: array, // The snapshot lifecycle policy definition to register |
|
227 | - * } $params |
|
228 | - * |
|
229 | - * @throws MissingParameterException if a required parameter is missing |
|
230 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
231 | - * @throws ClientResponseException if the status code of response is 4xx |
|
232 | - * @throws ServerResponseException if the status code of response is 5xx |
|
233 | - * |
|
234 | - * @return Elasticsearch|Promise |
|
235 | - */ |
|
236 | - public function putLifecycle(array $params = []) |
|
237 | - { |
|
238 | - $this->checkRequiredParameters(['policy_id'], $params); |
|
239 | - $url = '/_slm/policy/' . $this->encode($params['policy_id']); |
|
240 | - $method = 'PUT'; |
|
241 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
242 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
243 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
244 | - $request = $this->addOtelAttributes($params, ['policy_id'], $request, 'slm.put_lifecycle'); |
|
245 | - return $this->client->sendRequest($request); |
|
246 | - } |
|
247 | - /** |
|
248 | - * Turns on snapshot lifecycle management (SLM). |
|
249 | - * |
|
250 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-start.html |
|
251 | - * |
|
252 | - * @param array{ |
|
253 | - * master_timeout: time, // Timeout for processing on master node |
|
254 | - * timeout: time, // Timeout for acknowledgement of update from all nodes in cluster |
|
255 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
256 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
257 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
258 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
259 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
260 | - * } $params |
|
261 | - * |
|
262 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
263 | - * @throws ClientResponseException if the status code of response is 4xx |
|
264 | - * @throws ServerResponseException if the status code of response is 5xx |
|
265 | - * |
|
266 | - * @return Elasticsearch|Promise |
|
267 | - */ |
|
268 | - public function start(array $params = []) |
|
269 | - { |
|
270 | - $url = '/_slm/start'; |
|
271 | - $method = 'POST'; |
|
272 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
273 | - $headers = ['Accept' => 'application/json']; |
|
274 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
275 | - $request = $this->addOtelAttributes($params, [], $request, 'slm.start'); |
|
276 | - return $this->client->sendRequest($request); |
|
277 | - } |
|
278 | - /** |
|
279 | - * Turns off snapshot lifecycle management (SLM). |
|
280 | - * |
|
281 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-stop.html |
|
282 | - * |
|
283 | - * @param array{ |
|
284 | - * master_timeout: time, // Timeout for processing on master node |
|
285 | - * timeout: time, // Timeout for acknowledgement of update from all nodes in cluster |
|
286 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
287 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
288 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
289 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
290 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
291 | - * } $params |
|
292 | - * |
|
293 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
294 | - * @throws ClientResponseException if the status code of response is 4xx |
|
295 | - * @throws ServerResponseException if the status code of response is 5xx |
|
296 | - * |
|
297 | - * @return Elasticsearch|Promise |
|
298 | - */ |
|
299 | - public function stop(array $params = []) |
|
300 | - { |
|
301 | - $url = '/_slm/stop'; |
|
302 | - $method = 'POST'; |
|
303 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
304 | - $headers = ['Accept' => 'application/json']; |
|
305 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
306 | - $request = $this->addOtelAttributes($params, [], $request, 'slm.stop'); |
|
307 | - return $this->client->sendRequest($request); |
|
308 | - } |
|
28 | + /** |
|
29 | + * Deletes an existing snapshot lifecycle policy. |
|
30 | + * |
|
31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-delete-policy.html |
|
32 | + * |
|
33 | + * @param array{ |
|
34 | + * policy_id: string, // (REQUIRED) The id of the snapshot lifecycle policy to remove |
|
35 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
36 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
37 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
38 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
39 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
40 | + * } $params |
|
41 | + * |
|
42 | + * @throws MissingParameterException if a required parameter is missing |
|
43 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
44 | + * @throws ClientResponseException if the status code of response is 4xx |
|
45 | + * @throws ServerResponseException if the status code of response is 5xx |
|
46 | + * |
|
47 | + * @return Elasticsearch|Promise |
|
48 | + */ |
|
49 | + public function deleteLifecycle(array $params = []) |
|
50 | + { |
|
51 | + $this->checkRequiredParameters(['policy_id'], $params); |
|
52 | + $url = '/_slm/policy/' . $this->encode($params['policy_id']); |
|
53 | + $method = 'DELETE'; |
|
54 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
55 | + $headers = ['Accept' => 'application/json']; |
|
56 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
57 | + $request = $this->addOtelAttributes($params, ['policy_id'], $request, 'slm.delete_lifecycle'); |
|
58 | + return $this->client->sendRequest($request); |
|
59 | + } |
|
60 | + /** |
|
61 | + * Immediately creates a snapshot according to the lifecycle policy, without waiting for the scheduled time. |
|
62 | + * |
|
63 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-execute-lifecycle.html |
|
64 | + * |
|
65 | + * @param array{ |
|
66 | + * policy_id: string, // (REQUIRED) The id of the snapshot lifecycle policy to be executed |
|
67 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
68 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
69 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
70 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
71 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
72 | + * } $params |
|
73 | + * |
|
74 | + * @throws MissingParameterException if a required parameter is missing |
|
75 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
76 | + * @throws ClientResponseException if the status code of response is 4xx |
|
77 | + * @throws ServerResponseException if the status code of response is 5xx |
|
78 | + * |
|
79 | + * @return Elasticsearch|Promise |
|
80 | + */ |
|
81 | + public function executeLifecycle(array $params = []) |
|
82 | + { |
|
83 | + $this->checkRequiredParameters(['policy_id'], $params); |
|
84 | + $url = '/_slm/policy/' . $this->encode($params['policy_id']) . '/_execute'; |
|
85 | + $method = 'PUT'; |
|
86 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
87 | + $headers = ['Accept' => 'application/json']; |
|
88 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
89 | + $request = $this->addOtelAttributes($params, ['policy_id'], $request, 'slm.execute_lifecycle'); |
|
90 | + return $this->client->sendRequest($request); |
|
91 | + } |
|
92 | + /** |
|
93 | + * Deletes any snapshots that are expired according to the policy's retention rules. |
|
94 | + * |
|
95 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-execute-retention.html |
|
96 | + * |
|
97 | + * @param array{ |
|
98 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
99 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
100 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
101 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
102 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
103 | + * } $params |
|
104 | + * |
|
105 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
106 | + * @throws ClientResponseException if the status code of response is 4xx |
|
107 | + * @throws ServerResponseException if the status code of response is 5xx |
|
108 | + * |
|
109 | + * @return Elasticsearch|Promise |
|
110 | + */ |
|
111 | + public function executeRetention(array $params = []) |
|
112 | + { |
|
113 | + $url = '/_slm/_execute_retention'; |
|
114 | + $method = 'POST'; |
|
115 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
116 | + $headers = ['Accept' => 'application/json']; |
|
117 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
118 | + $request = $this->addOtelAttributes($params, [], $request, 'slm.execute_retention'); |
|
119 | + return $this->client->sendRequest($request); |
|
120 | + } |
|
121 | + /** |
|
122 | + * Retrieves one or more snapshot lifecycle policy definitions and information about the latest snapshot attempts. |
|
123 | + * |
|
124 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-get-policy.html |
|
125 | + * |
|
126 | + * @param array{ |
|
127 | + * policy_id: list, // Comma-separated list of snapshot lifecycle policies to retrieve |
|
128 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
129 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
130 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
131 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
132 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
133 | + * } $params |
|
134 | + * |
|
135 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
136 | + * @throws ClientResponseException if the status code of response is 4xx |
|
137 | + * @throws ServerResponseException if the status code of response is 5xx |
|
138 | + * |
|
139 | + * @return Elasticsearch|Promise |
|
140 | + */ |
|
141 | + public function getLifecycle(array $params = []) |
|
142 | + { |
|
143 | + if (isset($params['policy_id'])) { |
|
144 | + $url = '/_slm/policy/' . $this->encode($params['policy_id']); |
|
145 | + $method = 'GET'; |
|
146 | + } else { |
|
147 | + $url = '/_slm/policy'; |
|
148 | + $method = 'GET'; |
|
149 | + } |
|
150 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
151 | + $headers = ['Accept' => 'application/json']; |
|
152 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
153 | + $request = $this->addOtelAttributes($params, ['policy_id'], $request, 'slm.get_lifecycle'); |
|
154 | + return $this->client->sendRequest($request); |
|
155 | + } |
|
156 | + /** |
|
157 | + * Returns global and policy-level statistics about actions taken by snapshot lifecycle management. |
|
158 | + * |
|
159 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/slm-api-get-stats.html |
|
160 | + * |
|
161 | + * @param array{ |
|
162 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
163 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
164 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
165 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
166 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
167 | + * } $params |
|
168 | + * |
|
169 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
170 | + * @throws ClientResponseException if the status code of response is 4xx |
|
171 | + * @throws ServerResponseException if the status code of response is 5xx |
|
172 | + * |
|
173 | + * @return Elasticsearch|Promise |
|
174 | + */ |
|
175 | + public function getStats(array $params = []) |
|
176 | + { |
|
177 | + $url = '/_slm/stats'; |
|
178 | + $method = 'GET'; |
|
179 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
180 | + $headers = ['Accept' => 'application/json']; |
|
181 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
182 | + $request = $this->addOtelAttributes($params, [], $request, 'slm.get_stats'); |
|
183 | + return $this->client->sendRequest($request); |
|
184 | + } |
|
185 | + /** |
|
186 | + * Retrieves the status of snapshot lifecycle management (SLM). |
|
187 | + * |
|
188 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-get-status.html |
|
189 | + * |
|
190 | + * @param array{ |
|
191 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
192 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
193 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
194 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
195 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
196 | + * } $params |
|
197 | + * |
|
198 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
199 | + * @throws ClientResponseException if the status code of response is 4xx |
|
200 | + * @throws ServerResponseException if the status code of response is 5xx |
|
201 | + * |
|
202 | + * @return Elasticsearch|Promise |
|
203 | + */ |
|
204 | + public function getStatus(array $params = []) |
|
205 | + { |
|
206 | + $url = '/_slm/status'; |
|
207 | + $method = 'GET'; |
|
208 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
209 | + $headers = ['Accept' => 'application/json']; |
|
210 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
211 | + $request = $this->addOtelAttributes($params, [], $request, 'slm.get_status'); |
|
212 | + return $this->client->sendRequest($request); |
|
213 | + } |
|
214 | + /** |
|
215 | + * Creates or updates a snapshot lifecycle policy. |
|
216 | + * |
|
217 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-put-policy.html |
|
218 | + * |
|
219 | + * @param array{ |
|
220 | + * policy_id: string, // (REQUIRED) The id of the snapshot lifecycle policy |
|
221 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
222 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
223 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
224 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
225 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
226 | + * body: array, // The snapshot lifecycle policy definition to register |
|
227 | + * } $params |
|
228 | + * |
|
229 | + * @throws MissingParameterException if a required parameter is missing |
|
230 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
231 | + * @throws ClientResponseException if the status code of response is 4xx |
|
232 | + * @throws ServerResponseException if the status code of response is 5xx |
|
233 | + * |
|
234 | + * @return Elasticsearch|Promise |
|
235 | + */ |
|
236 | + public function putLifecycle(array $params = []) |
|
237 | + { |
|
238 | + $this->checkRequiredParameters(['policy_id'], $params); |
|
239 | + $url = '/_slm/policy/' . $this->encode($params['policy_id']); |
|
240 | + $method = 'PUT'; |
|
241 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
242 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
243 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
244 | + $request = $this->addOtelAttributes($params, ['policy_id'], $request, 'slm.put_lifecycle'); |
|
245 | + return $this->client->sendRequest($request); |
|
246 | + } |
|
247 | + /** |
|
248 | + * Turns on snapshot lifecycle management (SLM). |
|
249 | + * |
|
250 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-start.html |
|
251 | + * |
|
252 | + * @param array{ |
|
253 | + * master_timeout: time, // Timeout for processing on master node |
|
254 | + * timeout: time, // Timeout for acknowledgement of update from all nodes in cluster |
|
255 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
256 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
257 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
258 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
259 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
260 | + * } $params |
|
261 | + * |
|
262 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
263 | + * @throws ClientResponseException if the status code of response is 4xx |
|
264 | + * @throws ServerResponseException if the status code of response is 5xx |
|
265 | + * |
|
266 | + * @return Elasticsearch|Promise |
|
267 | + */ |
|
268 | + public function start(array $params = []) |
|
269 | + { |
|
270 | + $url = '/_slm/start'; |
|
271 | + $method = 'POST'; |
|
272 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
273 | + $headers = ['Accept' => 'application/json']; |
|
274 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
275 | + $request = $this->addOtelAttributes($params, [], $request, 'slm.start'); |
|
276 | + return $this->client->sendRequest($request); |
|
277 | + } |
|
278 | + /** |
|
279 | + * Turns off snapshot lifecycle management (SLM). |
|
280 | + * |
|
281 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-stop.html |
|
282 | + * |
|
283 | + * @param array{ |
|
284 | + * master_timeout: time, // Timeout for processing on master node |
|
285 | + * timeout: time, // Timeout for acknowledgement of update from all nodes in cluster |
|
286 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
287 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
288 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
289 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
290 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
291 | + * } $params |
|
292 | + * |
|
293 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
294 | + * @throws ClientResponseException if the status code of response is 4xx |
|
295 | + * @throws ServerResponseException if the status code of response is 5xx |
|
296 | + * |
|
297 | + * @return Elasticsearch|Promise |
|
298 | + */ |
|
299 | + public function stop(array $params = []) |
|
300 | + { |
|
301 | + $url = '/_slm/stop'; |
|
302 | + $method = 'POST'; |
|
303 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
304 | + $headers = ['Accept' => 'application/json']; |
|
305 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
306 | + $request = $this->addOtelAttributes($params, [], $request, 'slm.stop'); |
|
307 | + return $this->client->sendRequest($request); |
|
308 | + } |
|
309 | 309 | } |
@@ -25,2063 +25,2063 @@ |
||
25 | 25 | */ |
26 | 26 | class Security extends AbstractEndpoint |
27 | 27 | { |
28 | - /** |
|
29 | - * Creates or updates the user profile on behalf of another user. |
|
30 | - * |
|
31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-activate-user-profile.html |
|
32 | - * |
|
33 | - * @param array{ |
|
34 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
35 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
36 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
37 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
38 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
39 | - * body: array, // (REQUIRED) The grant type and user's credential |
|
40 | - * } $params |
|
41 | - * |
|
42 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
43 | - * @throws ClientResponseException if the status code of response is 4xx |
|
44 | - * @throws ServerResponseException if the status code of response is 5xx |
|
45 | - * |
|
46 | - * @return Elasticsearch|Promise |
|
47 | - */ |
|
48 | - public function activateUserProfile(array $params = []) |
|
49 | - { |
|
50 | - $this->checkRequiredParameters(['body'], $params); |
|
51 | - $url = '/_security/profile/_activate'; |
|
52 | - $method = 'POST'; |
|
53 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
54 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
55 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
56 | - $request = $this->addOtelAttributes($params, [], $request, 'security.activate_user_profile'); |
|
57 | - return $this->client->sendRequest($request); |
|
58 | - } |
|
59 | - /** |
|
60 | - * Enables authentication as a user and retrieve information about the authenticated user. |
|
61 | - * |
|
62 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-authenticate.html |
|
63 | - * |
|
64 | - * @param array{ |
|
65 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
66 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
67 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
68 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
69 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
70 | - * } $params |
|
71 | - * |
|
72 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
73 | - * @throws ClientResponseException if the status code of response is 4xx |
|
74 | - * @throws ServerResponseException if the status code of response is 5xx |
|
75 | - * |
|
76 | - * @return Elasticsearch|Promise |
|
77 | - */ |
|
78 | - public function authenticate(array $params = []) |
|
79 | - { |
|
80 | - $url = '/_security/_authenticate'; |
|
81 | - $method = 'GET'; |
|
82 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
83 | - $headers = ['Accept' => 'application/json']; |
|
84 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
85 | - $request = $this->addOtelAttributes($params, [], $request, 'security.authenticate'); |
|
86 | - return $this->client->sendRequest($request); |
|
87 | - } |
|
88 | - /** |
|
89 | - * Bulk delete roles in the native realm. |
|
90 | - * |
|
91 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-bulk-delete-role.html |
|
92 | - * |
|
93 | - * @param array{ |
|
94 | - * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
95 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
96 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
97 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
98 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
99 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
100 | - * body: array, // (REQUIRED) The roles to delete |
|
101 | - * } $params |
|
102 | - * |
|
103 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
104 | - * @throws ClientResponseException if the status code of response is 4xx |
|
105 | - * @throws ServerResponseException if the status code of response is 5xx |
|
106 | - * |
|
107 | - * @return Elasticsearch|Promise |
|
108 | - */ |
|
109 | - public function bulkDeleteRole(array $params = []) |
|
110 | - { |
|
111 | - $this->checkRequiredParameters(['body'], $params); |
|
112 | - $url = '/_security/role'; |
|
113 | - $method = 'DELETE'; |
|
114 | - $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
115 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
116 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
117 | - $request = $this->addOtelAttributes($params, [], $request, 'security.bulk_delete_role'); |
|
118 | - return $this->client->sendRequest($request); |
|
119 | - } |
|
120 | - /** |
|
121 | - * Bulk adds and updates roles in the native realm. |
|
122 | - * |
|
123 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-bulk-put-role.html |
|
124 | - * |
|
125 | - * @param array{ |
|
126 | - * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
127 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
128 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
129 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
130 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
131 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
132 | - * body: array, // (REQUIRED) The roles to add |
|
133 | - * } $params |
|
134 | - * |
|
135 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
136 | - * @throws ClientResponseException if the status code of response is 4xx |
|
137 | - * @throws ServerResponseException if the status code of response is 5xx |
|
138 | - * |
|
139 | - * @return Elasticsearch|Promise |
|
140 | - */ |
|
141 | - public function bulkPutRole(array $params = []) |
|
142 | - { |
|
143 | - $this->checkRequiredParameters(['body'], $params); |
|
144 | - $url = '/_security/role'; |
|
145 | - $method = 'POST'; |
|
146 | - $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
147 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
148 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
149 | - $request = $this->addOtelAttributes($params, [], $request, 'security.bulk_put_role'); |
|
150 | - return $this->client->sendRequest($request); |
|
151 | - } |
|
152 | - /** |
|
153 | - * Updates the attributes of multiple existing API keys. |
|
154 | - * |
|
155 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-bulk-update-api-keys.html |
|
156 | - * |
|
157 | - * @param array{ |
|
158 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
159 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
160 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
161 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
162 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
163 | - * body: array, // (REQUIRED) The API key request to update the attributes of multiple API keys. |
|
164 | - * } $params |
|
165 | - * |
|
166 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
167 | - * @throws ClientResponseException if the status code of response is 4xx |
|
168 | - * @throws ServerResponseException if the status code of response is 5xx |
|
169 | - * |
|
170 | - * @return Elasticsearch|Promise |
|
171 | - */ |
|
172 | - public function bulkUpdateApiKeys(array $params = []) |
|
173 | - { |
|
174 | - $this->checkRequiredParameters(['body'], $params); |
|
175 | - $url = '/_security/api_key/_bulk_update'; |
|
176 | - $method = 'POST'; |
|
177 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
178 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
179 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
180 | - $request = $this->addOtelAttributes($params, [], $request, 'security.bulk_update_api_keys'); |
|
181 | - return $this->client->sendRequest($request); |
|
182 | - } |
|
183 | - /** |
|
184 | - * Changes the passwords of users in the native realm and built-in users. |
|
185 | - * |
|
186 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-change-password.html |
|
187 | - * |
|
188 | - * @param array{ |
|
189 | - * username: string, // The username of the user to change the password for |
|
190 | - * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
191 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
192 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
193 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
194 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
195 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
196 | - * body: array, // (REQUIRED) the new password for the user |
|
197 | - * } $params |
|
198 | - * |
|
199 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
200 | - * @throws ClientResponseException if the status code of response is 4xx |
|
201 | - * @throws ServerResponseException if the status code of response is 5xx |
|
202 | - * |
|
203 | - * @return Elasticsearch|Promise |
|
204 | - */ |
|
205 | - public function changePassword(array $params = []) |
|
206 | - { |
|
207 | - $this->checkRequiredParameters(['body'], $params); |
|
208 | - if (isset($params['username'])) { |
|
209 | - $url = '/_security/user/' . $this->encode($params['username']) . '/_password'; |
|
210 | - $method = 'PUT'; |
|
211 | - } else { |
|
212 | - $url = '/_security/user/_password'; |
|
213 | - $method = 'PUT'; |
|
214 | - } |
|
215 | - $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
216 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
217 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
218 | - $request = $this->addOtelAttributes($params, ['username'], $request, 'security.change_password'); |
|
219 | - return $this->client->sendRequest($request); |
|
220 | - } |
|
221 | - /** |
|
222 | - * Clear a subset or all entries from the API key cache. |
|
223 | - * |
|
224 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-api-key-cache.html |
|
225 | - * |
|
226 | - * @param array{ |
|
227 | - * ids: list, // (REQUIRED) A comma-separated list of IDs of API keys to clear from the cache |
|
228 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
229 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
230 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
231 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
232 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
233 | - * } $params |
|
234 | - * |
|
235 | - * @throws MissingParameterException if a required parameter is missing |
|
236 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
237 | - * @throws ClientResponseException if the status code of response is 4xx |
|
238 | - * @throws ServerResponseException if the status code of response is 5xx |
|
239 | - * |
|
240 | - * @return Elasticsearch|Promise |
|
241 | - */ |
|
242 | - public function clearApiKeyCache(array $params = []) |
|
243 | - { |
|
244 | - $this->checkRequiredParameters(['ids'], $params); |
|
245 | - $url = '/_security/api_key/' . $this->encode($params['ids']) . '/_clear_cache'; |
|
246 | - $method = 'POST'; |
|
247 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
248 | - $headers = ['Accept' => 'application/json']; |
|
249 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
250 | - $request = $this->addOtelAttributes($params, ['ids'], $request, 'security.clear_api_key_cache'); |
|
251 | - return $this->client->sendRequest($request); |
|
252 | - } |
|
253 | - /** |
|
254 | - * Evicts application privileges from the native application privileges cache. |
|
255 | - * |
|
256 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-privilege-cache.html |
|
257 | - * |
|
258 | - * @param array{ |
|
259 | - * application: list, // (REQUIRED) A comma-separated list of application names |
|
260 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
261 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
262 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
263 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
264 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
265 | - * } $params |
|
266 | - * |
|
267 | - * @throws MissingParameterException if a required parameter is missing |
|
268 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
269 | - * @throws ClientResponseException if the status code of response is 4xx |
|
270 | - * @throws ServerResponseException if the status code of response is 5xx |
|
271 | - * |
|
272 | - * @return Elasticsearch|Promise |
|
273 | - */ |
|
274 | - public function clearCachedPrivileges(array $params = []) |
|
275 | - { |
|
276 | - $this->checkRequiredParameters(['application'], $params); |
|
277 | - $url = '/_security/privilege/' . $this->encode($params['application']) . '/_clear_cache'; |
|
278 | - $method = 'POST'; |
|
279 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
280 | - $headers = ['Accept' => 'application/json']; |
|
281 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
282 | - $request = $this->addOtelAttributes($params, ['application'], $request, 'security.clear_cached_privileges'); |
|
283 | - return $this->client->sendRequest($request); |
|
284 | - } |
|
285 | - /** |
|
286 | - * Evicts users from the user cache. Can completely clear the cache or evict specific users. |
|
287 | - * |
|
288 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-cache.html |
|
289 | - * |
|
290 | - * @param array{ |
|
291 | - * realms: list, // (REQUIRED) Comma-separated list of realms to clear |
|
292 | - * usernames: list, // Comma-separated list of usernames to clear from the cache |
|
293 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
294 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
295 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
296 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
297 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
298 | - * } $params |
|
299 | - * |
|
300 | - * @throws MissingParameterException if a required parameter is missing |
|
301 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
302 | - * @throws ClientResponseException if the status code of response is 4xx |
|
303 | - * @throws ServerResponseException if the status code of response is 5xx |
|
304 | - * |
|
305 | - * @return Elasticsearch|Promise |
|
306 | - */ |
|
307 | - public function clearCachedRealms(array $params = []) |
|
308 | - { |
|
309 | - $this->checkRequiredParameters(['realms'], $params); |
|
310 | - $url = '/_security/realm/' . $this->encode($params['realms']) . '/_clear_cache'; |
|
311 | - $method = 'POST'; |
|
312 | - $url = $this->addQueryString($url, $params, ['usernames', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
313 | - $headers = ['Accept' => 'application/json']; |
|
314 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
315 | - $request = $this->addOtelAttributes($params, ['realms'], $request, 'security.clear_cached_realms'); |
|
316 | - return $this->client->sendRequest($request); |
|
317 | - } |
|
318 | - /** |
|
319 | - * Evicts roles from the native role cache. |
|
320 | - * |
|
321 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-role-cache.html |
|
322 | - * |
|
323 | - * @param array{ |
|
324 | - * name: list, // (REQUIRED) Role name |
|
325 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
326 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
327 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
328 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
329 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
330 | - * } $params |
|
331 | - * |
|
332 | - * @throws MissingParameterException if a required parameter is missing |
|
333 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
334 | - * @throws ClientResponseException if the status code of response is 4xx |
|
335 | - * @throws ServerResponseException if the status code of response is 5xx |
|
336 | - * |
|
337 | - * @return Elasticsearch|Promise |
|
338 | - */ |
|
339 | - public function clearCachedRoles(array $params = []) |
|
340 | - { |
|
341 | - $this->checkRequiredParameters(['name'], $params); |
|
342 | - $url = '/_security/role/' . $this->encode($params['name']) . '/_clear_cache'; |
|
343 | - $method = 'POST'; |
|
344 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
345 | - $headers = ['Accept' => 'application/json']; |
|
346 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
347 | - $request = $this->addOtelAttributes($params, ['name'], $request, 'security.clear_cached_roles'); |
|
348 | - return $this->client->sendRequest($request); |
|
349 | - } |
|
350 | - /** |
|
351 | - * Evicts tokens from the service account token caches. |
|
352 | - * |
|
353 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-service-token-caches.html |
|
354 | - * |
|
355 | - * @param array{ |
|
356 | - * namespace: string, // (REQUIRED) An identifier for the namespace |
|
357 | - * service: string, // (REQUIRED) An identifier for the service name |
|
358 | - * name: list, // (REQUIRED) A comma-separated list of service token names |
|
359 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
360 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
361 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
362 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
363 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
364 | - * } $params |
|
365 | - * |
|
366 | - * @throws MissingParameterException if a required parameter is missing |
|
367 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
368 | - * @throws ClientResponseException if the status code of response is 4xx |
|
369 | - * @throws ServerResponseException if the status code of response is 5xx |
|
370 | - * |
|
371 | - * @return Elasticsearch|Promise |
|
372 | - */ |
|
373 | - public function clearCachedServiceTokens(array $params = []) |
|
374 | - { |
|
375 | - $this->checkRequiredParameters(['namespace', 'service', 'name'], $params); |
|
376 | - $url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']) . '/credential/token/' . $this->encode($params['name']) . '/_clear_cache'; |
|
377 | - $method = 'POST'; |
|
378 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
379 | - $headers = ['Accept' => 'application/json']; |
|
380 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
381 | - $request = $this->addOtelAttributes($params, ['namespace', 'service', 'name'], $request, 'security.clear_cached_service_tokens'); |
|
382 | - return $this->client->sendRequest($request); |
|
383 | - } |
|
384 | - /** |
|
385 | - * Creates an API key for access without requiring basic authentication. |
|
386 | - * |
|
387 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html |
|
388 | - * |
|
389 | - * @param array{ |
|
390 | - * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
391 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
392 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
393 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
394 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
395 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
396 | - * body: array, // (REQUIRED) The api key request to create an API key |
|
397 | - * } $params |
|
398 | - * |
|
399 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
400 | - * @throws ClientResponseException if the status code of response is 4xx |
|
401 | - * @throws ServerResponseException if the status code of response is 5xx |
|
402 | - * |
|
403 | - * @return Elasticsearch|Promise |
|
404 | - */ |
|
405 | - public function createApiKey(array $params = []) |
|
406 | - { |
|
407 | - $this->checkRequiredParameters(['body'], $params); |
|
408 | - $url = '/_security/api_key'; |
|
409 | - $method = 'PUT'; |
|
410 | - $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
411 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
412 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
413 | - $request = $this->addOtelAttributes($params, [], $request, 'security.create_api_key'); |
|
414 | - return $this->client->sendRequest($request); |
|
415 | - } |
|
416 | - /** |
|
417 | - * Creates a cross-cluster API key for API key based remote cluster access. |
|
418 | - * |
|
419 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-cross-cluster-api-key.html |
|
420 | - * |
|
421 | - * @param array{ |
|
422 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
423 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
424 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
425 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
426 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
427 | - * body: array, // (REQUIRED) The request to create a cross-cluster API key |
|
428 | - * } $params |
|
429 | - * |
|
430 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
431 | - * @throws ClientResponseException if the status code of response is 4xx |
|
432 | - * @throws ServerResponseException if the status code of response is 5xx |
|
433 | - * |
|
434 | - * @return Elasticsearch|Promise |
|
435 | - */ |
|
436 | - public function createCrossClusterApiKey(array $params = []) |
|
437 | - { |
|
438 | - $this->checkRequiredParameters(['body'], $params); |
|
439 | - $url = '/_security/cross_cluster/api_key'; |
|
440 | - $method = 'POST'; |
|
441 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
442 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
443 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
444 | - $request = $this->addOtelAttributes($params, [], $request, 'security.create_cross_cluster_api_key'); |
|
445 | - return $this->client->sendRequest($request); |
|
446 | - } |
|
447 | - /** |
|
448 | - * Creates a service account token for access without requiring basic authentication. |
|
449 | - * |
|
450 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-service-token.html |
|
451 | - * |
|
452 | - * @param array{ |
|
453 | - * namespace: string, // (REQUIRED) An identifier for the namespace |
|
454 | - * service: string, // (REQUIRED) An identifier for the service name |
|
455 | - * name: string, // An identifier for the token name |
|
456 | - * refresh: enum, // If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` (the default) then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
457 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
458 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
459 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
460 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
461 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
462 | - * } $params |
|
463 | - * |
|
464 | - * @throws MissingParameterException if a required parameter is missing |
|
465 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
466 | - * @throws ClientResponseException if the status code of response is 4xx |
|
467 | - * @throws ServerResponseException if the status code of response is 5xx |
|
468 | - * |
|
469 | - * @return Elasticsearch|Promise |
|
470 | - */ |
|
471 | - public function createServiceToken(array $params = []) |
|
472 | - { |
|
473 | - $this->checkRequiredParameters(['namespace', 'service'], $params); |
|
474 | - if (isset($params['name'])) { |
|
475 | - $url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']) . '/credential/token/' . $this->encode($params['name']); |
|
476 | - $method = 'PUT'; |
|
477 | - } else { |
|
478 | - $url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']) . '/credential/token'; |
|
479 | - $method = 'POST'; |
|
480 | - } |
|
481 | - $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
482 | - $headers = ['Accept' => 'application/json']; |
|
483 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
484 | - $request = $this->addOtelAttributes($params, ['namespace', 'service', 'name'], $request, 'security.create_service_token'); |
|
485 | - return $this->client->sendRequest($request); |
|
486 | - } |
|
487 | - /** |
|
488 | - * Removes application privileges. |
|
489 | - * |
|
490 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-privilege.html |
|
491 | - * |
|
492 | - * @param array{ |
|
493 | - * application: string, // (REQUIRED) Application name |
|
494 | - * name: string, // (REQUIRED) Privilege name |
|
495 | - * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
496 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
497 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
498 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
499 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
500 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
501 | - * } $params |
|
502 | - * |
|
503 | - * @throws MissingParameterException if a required parameter is missing |
|
504 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
505 | - * @throws ClientResponseException if the status code of response is 4xx |
|
506 | - * @throws ServerResponseException if the status code of response is 5xx |
|
507 | - * |
|
508 | - * @return Elasticsearch|Promise |
|
509 | - */ |
|
510 | - public function deletePrivileges(array $params = []) |
|
511 | - { |
|
512 | - $this->checkRequiredParameters(['application', 'name'], $params); |
|
513 | - $url = '/_security/privilege/' . $this->encode($params['application']) . '/' . $this->encode($params['name']); |
|
514 | - $method = 'DELETE'; |
|
515 | - $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
516 | - $headers = ['Accept' => 'application/json']; |
|
517 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
518 | - $request = $this->addOtelAttributes($params, ['application', 'name'], $request, 'security.delete_privileges'); |
|
519 | - return $this->client->sendRequest($request); |
|
520 | - } |
|
521 | - /** |
|
522 | - * Removes roles in the native realm. |
|
523 | - * |
|
524 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role.html |
|
525 | - * |
|
526 | - * @param array{ |
|
527 | - * name: string, // (REQUIRED) Role name |
|
528 | - * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
529 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
530 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
531 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
532 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
533 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
534 | - * } $params |
|
535 | - * |
|
536 | - * @throws MissingParameterException if a required parameter is missing |
|
537 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
538 | - * @throws ClientResponseException if the status code of response is 4xx |
|
539 | - * @throws ServerResponseException if the status code of response is 5xx |
|
540 | - * |
|
541 | - * @return Elasticsearch|Promise |
|
542 | - */ |
|
543 | - public function deleteRole(array $params = []) |
|
544 | - { |
|
545 | - $this->checkRequiredParameters(['name'], $params); |
|
546 | - $url = '/_security/role/' . $this->encode($params['name']); |
|
547 | - $method = 'DELETE'; |
|
548 | - $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
549 | - $headers = ['Accept' => 'application/json']; |
|
550 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
551 | - $request = $this->addOtelAttributes($params, ['name'], $request, 'security.delete_role'); |
|
552 | - return $this->client->sendRequest($request); |
|
553 | - } |
|
554 | - /** |
|
555 | - * Removes role mappings. |
|
556 | - * |
|
557 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role-mapping.html |
|
558 | - * |
|
559 | - * @param array{ |
|
560 | - * name: string, // (REQUIRED) Role-mapping name |
|
561 | - * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
562 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
563 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
564 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
565 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
566 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
567 | - * } $params |
|
568 | - * |
|
569 | - * @throws MissingParameterException if a required parameter is missing |
|
570 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
571 | - * @throws ClientResponseException if the status code of response is 4xx |
|
572 | - * @throws ServerResponseException if the status code of response is 5xx |
|
573 | - * |
|
574 | - * @return Elasticsearch|Promise |
|
575 | - */ |
|
576 | - public function deleteRoleMapping(array $params = []) |
|
577 | - { |
|
578 | - $this->checkRequiredParameters(['name'], $params); |
|
579 | - $url = '/_security/role_mapping/' . $this->encode($params['name']); |
|
580 | - $method = 'DELETE'; |
|
581 | - $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
582 | - $headers = ['Accept' => 'application/json']; |
|
583 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
584 | - $request = $this->addOtelAttributes($params, ['name'], $request, 'security.delete_role_mapping'); |
|
585 | - return $this->client->sendRequest($request); |
|
586 | - } |
|
587 | - /** |
|
588 | - * Deletes a service account token. |
|
589 | - * |
|
590 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-service-token.html |
|
591 | - * |
|
592 | - * @param array{ |
|
593 | - * namespace: string, // (REQUIRED) An identifier for the namespace |
|
594 | - * service: string, // (REQUIRED) An identifier for the service name |
|
595 | - * name: string, // (REQUIRED) An identifier for the token name |
|
596 | - * refresh: enum, // If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` (the default) then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
597 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
598 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
599 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
600 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
601 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
602 | - * } $params |
|
603 | - * |
|
604 | - * @throws MissingParameterException if a required parameter is missing |
|
605 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
606 | - * @throws ClientResponseException if the status code of response is 4xx |
|
607 | - * @throws ServerResponseException if the status code of response is 5xx |
|
608 | - * |
|
609 | - * @return Elasticsearch|Promise |
|
610 | - */ |
|
611 | - public function deleteServiceToken(array $params = []) |
|
612 | - { |
|
613 | - $this->checkRequiredParameters(['namespace', 'service', 'name'], $params); |
|
614 | - $url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']) . '/credential/token/' . $this->encode($params['name']); |
|
615 | - $method = 'DELETE'; |
|
616 | - $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
617 | - $headers = ['Accept' => 'application/json']; |
|
618 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
619 | - $request = $this->addOtelAttributes($params, ['namespace', 'service', 'name'], $request, 'security.delete_service_token'); |
|
620 | - return $this->client->sendRequest($request); |
|
621 | - } |
|
622 | - /** |
|
623 | - * Deletes users from the native realm. |
|
624 | - * |
|
625 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-user.html |
|
626 | - * |
|
627 | - * @param array{ |
|
628 | - * username: string, // (REQUIRED) username |
|
629 | - * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
630 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
631 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
632 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
633 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
634 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
635 | - * } $params |
|
636 | - * |
|
637 | - * @throws MissingParameterException if a required parameter is missing |
|
638 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
639 | - * @throws ClientResponseException if the status code of response is 4xx |
|
640 | - * @throws ServerResponseException if the status code of response is 5xx |
|
641 | - * |
|
642 | - * @return Elasticsearch|Promise |
|
643 | - */ |
|
644 | - public function deleteUser(array $params = []) |
|
645 | - { |
|
646 | - $this->checkRequiredParameters(['username'], $params); |
|
647 | - $url = '/_security/user/' . $this->encode($params['username']); |
|
648 | - $method = 'DELETE'; |
|
649 | - $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
650 | - $headers = ['Accept' => 'application/json']; |
|
651 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
652 | - $request = $this->addOtelAttributes($params, ['username'], $request, 'security.delete_user'); |
|
653 | - return $this->client->sendRequest($request); |
|
654 | - } |
|
655 | - /** |
|
656 | - * Disables users in the native realm. |
|
657 | - * |
|
658 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-disable-user.html |
|
659 | - * |
|
660 | - * @param array{ |
|
661 | - * username: string, // (REQUIRED) The username of the user to disable |
|
662 | - * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
663 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
664 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
665 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
666 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
667 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
668 | - * } $params |
|
669 | - * |
|
670 | - * @throws MissingParameterException if a required parameter is missing |
|
671 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
672 | - * @throws ClientResponseException if the status code of response is 4xx |
|
673 | - * @throws ServerResponseException if the status code of response is 5xx |
|
674 | - * |
|
675 | - * @return Elasticsearch|Promise |
|
676 | - */ |
|
677 | - public function disableUser(array $params = []) |
|
678 | - { |
|
679 | - $this->checkRequiredParameters(['username'], $params); |
|
680 | - $url = '/_security/user/' . $this->encode($params['username']) . '/_disable'; |
|
681 | - $method = 'PUT'; |
|
682 | - $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
683 | - $headers = ['Accept' => 'application/json']; |
|
684 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
685 | - $request = $this->addOtelAttributes($params, ['username'], $request, 'security.disable_user'); |
|
686 | - return $this->client->sendRequest($request); |
|
687 | - } |
|
688 | - /** |
|
689 | - * Disables a user profile so it's not visible in user profile searches. |
|
690 | - * |
|
691 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-disable-user-profile.html |
|
692 | - * |
|
693 | - * @param array{ |
|
694 | - * uid: string, // (REQUIRED) Unique identifier for the user profile |
|
695 | - * refresh: enum, // If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` (the default) then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
696 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
697 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
698 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
699 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
700 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
701 | - * } $params |
|
702 | - * |
|
703 | - * @throws MissingParameterException if a required parameter is missing |
|
704 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
705 | - * @throws ClientResponseException if the status code of response is 4xx |
|
706 | - * @throws ServerResponseException if the status code of response is 5xx |
|
707 | - * |
|
708 | - * @return Elasticsearch|Promise |
|
709 | - */ |
|
710 | - public function disableUserProfile(array $params = []) |
|
711 | - { |
|
712 | - $this->checkRequiredParameters(['uid'], $params); |
|
713 | - $url = '/_security/profile/' . $this->encode($params['uid']) . '/_disable'; |
|
714 | - $method = 'PUT'; |
|
715 | - $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
716 | - $headers = ['Accept' => 'application/json']; |
|
717 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
718 | - $request = $this->addOtelAttributes($params, ['uid'], $request, 'security.disable_user_profile'); |
|
719 | - return $this->client->sendRequest($request); |
|
720 | - } |
|
721 | - /** |
|
722 | - * Enables users in the native realm. |
|
723 | - * |
|
724 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-enable-user.html |
|
725 | - * |
|
726 | - * @param array{ |
|
727 | - * username: string, // (REQUIRED) The username of the user to enable |
|
728 | - * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
729 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
730 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
731 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
732 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
733 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
734 | - * } $params |
|
735 | - * |
|
736 | - * @throws MissingParameterException if a required parameter is missing |
|
737 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
738 | - * @throws ClientResponseException if the status code of response is 4xx |
|
739 | - * @throws ServerResponseException if the status code of response is 5xx |
|
740 | - * |
|
741 | - * @return Elasticsearch|Promise |
|
742 | - */ |
|
743 | - public function enableUser(array $params = []) |
|
744 | - { |
|
745 | - $this->checkRequiredParameters(['username'], $params); |
|
746 | - $url = '/_security/user/' . $this->encode($params['username']) . '/_enable'; |
|
747 | - $method = 'PUT'; |
|
748 | - $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
749 | - $headers = ['Accept' => 'application/json']; |
|
750 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
751 | - $request = $this->addOtelAttributes($params, ['username'], $request, 'security.enable_user'); |
|
752 | - return $this->client->sendRequest($request); |
|
753 | - } |
|
754 | - /** |
|
755 | - * Enables a user profile so it's visible in user profile searches. |
|
756 | - * |
|
757 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-enable-user-profile.html |
|
758 | - * |
|
759 | - * @param array{ |
|
760 | - * uid: string, // (REQUIRED) An unique identifier of the user profile |
|
761 | - * refresh: enum, // If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` (the default) then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
762 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
763 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
764 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
765 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
766 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
767 | - * } $params |
|
768 | - * |
|
769 | - * @throws MissingParameterException if a required parameter is missing |
|
770 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
771 | - * @throws ClientResponseException if the status code of response is 4xx |
|
772 | - * @throws ServerResponseException if the status code of response is 5xx |
|
773 | - * |
|
774 | - * @return Elasticsearch|Promise |
|
775 | - */ |
|
776 | - public function enableUserProfile(array $params = []) |
|
777 | - { |
|
778 | - $this->checkRequiredParameters(['uid'], $params); |
|
779 | - $url = '/_security/profile/' . $this->encode($params['uid']) . '/_enable'; |
|
780 | - $method = 'PUT'; |
|
781 | - $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
782 | - $headers = ['Accept' => 'application/json']; |
|
783 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
784 | - $request = $this->addOtelAttributes($params, ['uid'], $request, 'security.enable_user_profile'); |
|
785 | - return $this->client->sendRequest($request); |
|
786 | - } |
|
787 | - /** |
|
788 | - * Allows a kibana instance to configure itself to communicate with a secured elasticsearch cluster. |
|
789 | - * |
|
790 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-kibana-enrollment.html |
|
791 | - * |
|
792 | - * @param array{ |
|
793 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
794 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
795 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
796 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
797 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
798 | - * } $params |
|
799 | - * |
|
800 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
801 | - * @throws ClientResponseException if the status code of response is 4xx |
|
802 | - * @throws ServerResponseException if the status code of response is 5xx |
|
803 | - * |
|
804 | - * @return Elasticsearch|Promise |
|
805 | - */ |
|
806 | - public function enrollKibana(array $params = []) |
|
807 | - { |
|
808 | - $url = '/_security/enroll/kibana'; |
|
809 | - $method = 'GET'; |
|
810 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
811 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
812 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
813 | - $request = $this->addOtelAttributes($params, [], $request, 'security.enroll_kibana'); |
|
814 | - return $this->client->sendRequest($request); |
|
815 | - } |
|
816 | - /** |
|
817 | - * Allows a new node to enroll to an existing cluster with security enabled. |
|
818 | - * |
|
819 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-node-enrollment.html |
|
820 | - * |
|
821 | - * @param array{ |
|
822 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
823 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
824 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
825 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
826 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
827 | - * } $params |
|
828 | - * |
|
829 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
830 | - * @throws ClientResponseException if the status code of response is 4xx |
|
831 | - * @throws ServerResponseException if the status code of response is 5xx |
|
832 | - * |
|
833 | - * @return Elasticsearch|Promise |
|
834 | - */ |
|
835 | - public function enrollNode(array $params = []) |
|
836 | - { |
|
837 | - $url = '/_security/enroll/node'; |
|
838 | - $method = 'GET'; |
|
839 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
840 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
841 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
842 | - $request = $this->addOtelAttributes($params, [], $request, 'security.enroll_node'); |
|
843 | - return $this->client->sendRequest($request); |
|
844 | - } |
|
845 | - /** |
|
846 | - * Retrieves information for one or more API keys. |
|
847 | - * |
|
848 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-api-key.html |
|
849 | - * |
|
850 | - * @param array{ |
|
851 | - * id: string, // API key id of the API key to be retrieved |
|
852 | - * name: string, // API key name of the API key to be retrieved |
|
853 | - * username: string, // user name of the user who created this API key to be retrieved |
|
854 | - * realm_name: string, // realm name of the user who created this API key to be retrieved |
|
855 | - * owner: boolean, // flag to query API keys owned by the currently authenticated user |
|
856 | - * with_limited_by: boolean, // flag to show the limited-by role descriptors of API Keys |
|
857 | - * with_profile_uid: boolean, // flag to also retrieve the API Key's owner profile uid, if it exists |
|
858 | - * active_only: boolean, // flag to limit response to only active (not invalidated or expired) API keys |
|
859 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
860 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
861 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
862 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
863 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
864 | - * } $params |
|
865 | - * |
|
866 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
867 | - * @throws ClientResponseException if the status code of response is 4xx |
|
868 | - * @throws ServerResponseException if the status code of response is 5xx |
|
869 | - * |
|
870 | - * @return Elasticsearch|Promise |
|
871 | - */ |
|
872 | - public function getApiKey(array $params = []) |
|
873 | - { |
|
874 | - $url = '/_security/api_key'; |
|
875 | - $method = 'GET'; |
|
876 | - $url = $this->addQueryString($url, $params, ['id', 'name', 'username', 'realm_name', 'owner', 'with_limited_by', 'with_profile_uid', 'active_only', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
877 | - $headers = ['Accept' => 'application/json']; |
|
878 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
879 | - $request = $this->addOtelAttributes($params, [], $request, 'security.get_api_key'); |
|
880 | - return $this->client->sendRequest($request); |
|
881 | - } |
|
882 | - /** |
|
883 | - * Retrieves the list of cluster privileges and index privileges that are available in this version of Elasticsearch. |
|
884 | - * |
|
885 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-builtin-privileges.html |
|
886 | - * |
|
887 | - * @param array{ |
|
888 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
889 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
890 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
891 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
892 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
893 | - * } $params |
|
894 | - * |
|
895 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
896 | - * @throws ClientResponseException if the status code of response is 4xx |
|
897 | - * @throws ServerResponseException if the status code of response is 5xx |
|
898 | - * |
|
899 | - * @return Elasticsearch|Promise |
|
900 | - */ |
|
901 | - public function getBuiltinPrivileges(array $params = []) |
|
902 | - { |
|
903 | - $url = '/_security/privilege/_builtin'; |
|
904 | - $method = 'GET'; |
|
905 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
906 | - $headers = ['Accept' => 'application/json']; |
|
907 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
908 | - $request = $this->addOtelAttributes($params, [], $request, 'security.get_builtin_privileges'); |
|
909 | - return $this->client->sendRequest($request); |
|
910 | - } |
|
911 | - /** |
|
912 | - * Retrieves application privileges. |
|
913 | - * |
|
914 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-privileges.html |
|
915 | - * |
|
916 | - * @param array{ |
|
917 | - * application: string, // Application name |
|
918 | - * name: string, // Privilege name |
|
919 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
920 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
921 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
922 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
923 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
924 | - * } $params |
|
925 | - * |
|
926 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
927 | - * @throws ClientResponseException if the status code of response is 4xx |
|
928 | - * @throws ServerResponseException if the status code of response is 5xx |
|
929 | - * |
|
930 | - * @return Elasticsearch|Promise |
|
931 | - */ |
|
932 | - public function getPrivileges(array $params = []) |
|
933 | - { |
|
934 | - if (isset($params['application']) && isset($params['name'])) { |
|
935 | - $url = '/_security/privilege/' . $this->encode($params['application']) . '/' . $this->encode($params['name']); |
|
936 | - $method = 'GET'; |
|
937 | - } elseif (isset($params['application'])) { |
|
938 | - $url = '/_security/privilege/' . $this->encode($params['application']); |
|
939 | - $method = 'GET'; |
|
940 | - } else { |
|
941 | - $url = '/_security/privilege'; |
|
942 | - $method = 'GET'; |
|
943 | - } |
|
944 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
945 | - $headers = ['Accept' => 'application/json']; |
|
946 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
947 | - $request = $this->addOtelAttributes($params, ['application', 'name'], $request, 'security.get_privileges'); |
|
948 | - return $this->client->sendRequest($request); |
|
949 | - } |
|
950 | - /** |
|
951 | - * Retrieves roles in the native realm. |
|
952 | - * |
|
953 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role.html |
|
954 | - * |
|
955 | - * @param array{ |
|
956 | - * name: list, // A comma-separated list of role names |
|
957 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
958 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
959 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
960 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
961 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
962 | - * } $params |
|
963 | - * |
|
964 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
965 | - * @throws ClientResponseException if the status code of response is 4xx |
|
966 | - * @throws ServerResponseException if the status code of response is 5xx |
|
967 | - * |
|
968 | - * @return Elasticsearch|Promise |
|
969 | - */ |
|
970 | - public function getRole(array $params = []) |
|
971 | - { |
|
972 | - if (isset($params['name'])) { |
|
973 | - $url = '/_security/role/' . $this->encode($params['name']); |
|
974 | - $method = 'GET'; |
|
975 | - } else { |
|
976 | - $url = '/_security/role'; |
|
977 | - $method = 'GET'; |
|
978 | - } |
|
979 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
980 | - $headers = ['Accept' => 'application/json']; |
|
981 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
982 | - $request = $this->addOtelAttributes($params, ['name'], $request, 'security.get_role'); |
|
983 | - return $this->client->sendRequest($request); |
|
984 | - } |
|
985 | - /** |
|
986 | - * Retrieves role mappings. |
|
987 | - * |
|
988 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role-mapping.html |
|
989 | - * |
|
990 | - * @param array{ |
|
991 | - * name: list, // A comma-separated list of role-mapping names |
|
992 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
993 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
994 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
995 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
996 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
997 | - * } $params |
|
998 | - * |
|
999 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1000 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1001 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1002 | - * |
|
1003 | - * @return Elasticsearch|Promise |
|
1004 | - */ |
|
1005 | - public function getRoleMapping(array $params = []) |
|
1006 | - { |
|
1007 | - if (isset($params['name'])) { |
|
1008 | - $url = '/_security/role_mapping/' . $this->encode($params['name']); |
|
1009 | - $method = 'GET'; |
|
1010 | - } else { |
|
1011 | - $url = '/_security/role_mapping'; |
|
1012 | - $method = 'GET'; |
|
1013 | - } |
|
1014 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1015 | - $headers = ['Accept' => 'application/json']; |
|
1016 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1017 | - $request = $this->addOtelAttributes($params, ['name'], $request, 'security.get_role_mapping'); |
|
1018 | - return $this->client->sendRequest($request); |
|
1019 | - } |
|
1020 | - /** |
|
1021 | - * Retrieves information about service accounts. |
|
1022 | - * |
|
1023 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-service-accounts.html |
|
1024 | - * |
|
1025 | - * @param array{ |
|
1026 | - * namespace: string, // An identifier for the namespace |
|
1027 | - * service: string, // An identifier for the service name |
|
1028 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1029 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1030 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1031 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1032 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1033 | - * } $params |
|
1034 | - * |
|
1035 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1036 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1037 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1038 | - * |
|
1039 | - * @return Elasticsearch|Promise |
|
1040 | - */ |
|
1041 | - public function getServiceAccounts(array $params = []) |
|
1042 | - { |
|
1043 | - if (isset($params['namespace']) && isset($params['service'])) { |
|
1044 | - $url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']); |
|
1045 | - $method = 'GET'; |
|
1046 | - } elseif (isset($params['namespace'])) { |
|
1047 | - $url = '/_security/service/' . $this->encode($params['namespace']); |
|
1048 | - $method = 'GET'; |
|
1049 | - } else { |
|
1050 | - $url = '/_security/service'; |
|
1051 | - $method = 'GET'; |
|
1052 | - } |
|
1053 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1054 | - $headers = ['Accept' => 'application/json']; |
|
1055 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1056 | - $request = $this->addOtelAttributes($params, ['namespace', 'service'], $request, 'security.get_service_accounts'); |
|
1057 | - return $this->client->sendRequest($request); |
|
1058 | - } |
|
1059 | - /** |
|
1060 | - * Retrieves information of all service credentials for a service account. |
|
1061 | - * |
|
1062 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-service-credentials.html |
|
1063 | - * |
|
1064 | - * @param array{ |
|
1065 | - * namespace: string, // (REQUIRED) An identifier for the namespace |
|
1066 | - * service: string, // (REQUIRED) An identifier for the service name |
|
1067 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1068 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1069 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1070 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1071 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1072 | - * } $params |
|
1073 | - * |
|
1074 | - * @throws MissingParameterException if a required parameter is missing |
|
1075 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1076 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1077 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1078 | - * |
|
1079 | - * @return Elasticsearch|Promise |
|
1080 | - */ |
|
1081 | - public function getServiceCredentials(array $params = []) |
|
1082 | - { |
|
1083 | - $this->checkRequiredParameters(['namespace', 'service'], $params); |
|
1084 | - $url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']) . '/credential'; |
|
1085 | - $method = 'GET'; |
|
1086 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1087 | - $headers = ['Accept' => 'application/json']; |
|
1088 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1089 | - $request = $this->addOtelAttributes($params, ['namespace', 'service'], $request, 'security.get_service_credentials'); |
|
1090 | - return $this->client->sendRequest($request); |
|
1091 | - } |
|
1092 | - /** |
|
1093 | - * Retrieve settings for the security system indices |
|
1094 | - * |
|
1095 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-settings.html |
|
1096 | - * |
|
1097 | - * @param array{ |
|
1098 | - * master_timeout: time, // Timeout for connection to master |
|
1099 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1100 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1101 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1102 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1103 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1104 | - * } $params |
|
1105 | - * |
|
1106 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1107 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1108 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1109 | - * |
|
1110 | - * @return Elasticsearch|Promise |
|
1111 | - */ |
|
1112 | - public function getSettings(array $params = []) |
|
1113 | - { |
|
1114 | - $url = '/_security/settings'; |
|
1115 | - $method = 'GET'; |
|
1116 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1117 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1118 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1119 | - $request = $this->addOtelAttributes($params, [], $request, 'security.get_settings'); |
|
1120 | - return $this->client->sendRequest($request); |
|
1121 | - } |
|
1122 | - /** |
|
1123 | - * Creates a bearer token for access without requiring basic authentication. |
|
1124 | - * |
|
1125 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-token.html |
|
1126 | - * |
|
1127 | - * @param array{ |
|
1128 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1129 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1130 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1131 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1132 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1133 | - * body: array, // (REQUIRED) The token request to get |
|
1134 | - * } $params |
|
1135 | - * |
|
1136 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1137 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1138 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1139 | - * |
|
1140 | - * @return Elasticsearch|Promise |
|
1141 | - */ |
|
1142 | - public function getToken(array $params = []) |
|
1143 | - { |
|
1144 | - $this->checkRequiredParameters(['body'], $params); |
|
1145 | - $url = '/_security/oauth2/token'; |
|
1146 | - $method = 'POST'; |
|
1147 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1148 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1149 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1150 | - $request = $this->addOtelAttributes($params, [], $request, 'security.get_token'); |
|
1151 | - return $this->client->sendRequest($request); |
|
1152 | - } |
|
1153 | - /** |
|
1154 | - * Retrieves information about users in the native realm and built-in users. |
|
1155 | - * |
|
1156 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user.html |
|
1157 | - * |
|
1158 | - * @param array{ |
|
1159 | - * username: list, // A comma-separated list of usernames |
|
1160 | - * with_profile_uid: boolean, // flag to retrieve profile uid (if exists) associated to the user |
|
1161 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1162 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1163 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1164 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1165 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1166 | - * } $params |
|
1167 | - * |
|
1168 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1169 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1170 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1171 | - * |
|
1172 | - * @return Elasticsearch|Promise |
|
1173 | - */ |
|
1174 | - public function getUser(array $params = []) |
|
1175 | - { |
|
1176 | - if (isset($params['username'])) { |
|
1177 | - $url = '/_security/user/' . $this->encode($params['username']); |
|
1178 | - $method = 'GET'; |
|
1179 | - } else { |
|
1180 | - $url = '/_security/user'; |
|
1181 | - $method = 'GET'; |
|
1182 | - } |
|
1183 | - $url = $this->addQueryString($url, $params, ['with_profile_uid', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1184 | - $headers = ['Accept' => 'application/json']; |
|
1185 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1186 | - $request = $this->addOtelAttributes($params, ['username'], $request, 'security.get_user'); |
|
1187 | - return $this->client->sendRequest($request); |
|
1188 | - } |
|
1189 | - /** |
|
1190 | - * Retrieves security privileges for the logged in user. |
|
1191 | - * |
|
1192 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user-privileges.html |
|
1193 | - * |
|
1194 | - * @param array{ |
|
1195 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1196 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1197 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1198 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1199 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1200 | - * } $params |
|
1201 | - * |
|
1202 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1203 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1204 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1205 | - * |
|
1206 | - * @return Elasticsearch|Promise |
|
1207 | - */ |
|
1208 | - public function getUserPrivileges(array $params = []) |
|
1209 | - { |
|
1210 | - $url = '/_security/user/_privileges'; |
|
1211 | - $method = 'GET'; |
|
1212 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1213 | - $headers = ['Accept' => 'application/json']; |
|
1214 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1215 | - $request = $this->addOtelAttributes($params, [], $request, 'security.get_user_privileges'); |
|
1216 | - return $this->client->sendRequest($request); |
|
1217 | - } |
|
1218 | - /** |
|
1219 | - * Retrieves user profiles for the given unique ID(s). |
|
1220 | - * |
|
1221 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user-profile.html |
|
1222 | - * |
|
1223 | - * @param array{ |
|
1224 | - * uid: list, // (REQUIRED) A comma-separated list of unique identifier for user profiles |
|
1225 | - * data: list, // A comma-separated list of keys for which the corresponding application data are retrieved. |
|
1226 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1227 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1228 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1229 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1230 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1231 | - * } $params |
|
1232 | - * |
|
1233 | - * @throws MissingParameterException if a required parameter is missing |
|
1234 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1235 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1236 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1237 | - * |
|
1238 | - * @return Elasticsearch|Promise |
|
1239 | - */ |
|
1240 | - public function getUserProfile(array $params = []) |
|
1241 | - { |
|
1242 | - $this->checkRequiredParameters(['uid'], $params); |
|
1243 | - $url = '/_security/profile/' . $this->encode($params['uid']); |
|
1244 | - $method = 'GET'; |
|
1245 | - $url = $this->addQueryString($url, $params, ['data', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1246 | - $headers = ['Accept' => 'application/json']; |
|
1247 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1248 | - $request = $this->addOtelAttributes($params, ['uid'], $request, 'security.get_user_profile'); |
|
1249 | - return $this->client->sendRequest($request); |
|
1250 | - } |
|
1251 | - /** |
|
1252 | - * Creates an API key on behalf of another user. |
|
1253 | - * |
|
1254 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-grant-api-key.html |
|
1255 | - * |
|
1256 | - * @param array{ |
|
1257 | - * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
1258 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1259 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1260 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1261 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1262 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1263 | - * body: array, // (REQUIRED) The api key request to create an API key |
|
1264 | - * } $params |
|
1265 | - * |
|
1266 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1267 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1268 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1269 | - * |
|
1270 | - * @return Elasticsearch|Promise |
|
1271 | - */ |
|
1272 | - public function grantApiKey(array $params = []) |
|
1273 | - { |
|
1274 | - $this->checkRequiredParameters(['body'], $params); |
|
1275 | - $url = '/_security/api_key/grant'; |
|
1276 | - $method = 'POST'; |
|
1277 | - $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1278 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1279 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1280 | - $request = $this->addOtelAttributes($params, [], $request, 'security.grant_api_key'); |
|
1281 | - return $this->client->sendRequest($request); |
|
1282 | - } |
|
1283 | - /** |
|
1284 | - * Determines whether the specified user has a specified list of privileges. |
|
1285 | - * |
|
1286 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges.html |
|
1287 | - * |
|
1288 | - * @param array{ |
|
1289 | - * user: string, // Username |
|
1290 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1291 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1292 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1293 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1294 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1295 | - * body: array, // (REQUIRED) The privileges to test |
|
1296 | - * } $params |
|
1297 | - * |
|
1298 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1299 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1300 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1301 | - * |
|
1302 | - * @return Elasticsearch|Promise |
|
1303 | - */ |
|
1304 | - public function hasPrivileges(array $params = []) |
|
1305 | - { |
|
1306 | - $this->checkRequiredParameters(['body'], $params); |
|
1307 | - if (isset($params['user'])) { |
|
1308 | - $url = '/_security/user/' . $this->encode($params['user']) . '/_has_privileges'; |
|
1309 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
1310 | - } else { |
|
1311 | - $url = '/_security/user/_has_privileges'; |
|
1312 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
1313 | - } |
|
1314 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1315 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1316 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1317 | - $request = $this->addOtelAttributes($params, ['user'], $request, 'security.has_privileges'); |
|
1318 | - return $this->client->sendRequest($request); |
|
1319 | - } |
|
1320 | - /** |
|
1321 | - * Determines whether the users associated with the specified profile IDs have all the requested privileges. |
|
1322 | - * |
|
1323 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges-user-profile.html |
|
1324 | - * |
|
1325 | - * @param array{ |
|
1326 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1327 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1328 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1329 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1330 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1331 | - * body: array, // (REQUIRED) The privileges to check and the list of profile IDs |
|
1332 | - * } $params |
|
1333 | - * |
|
1334 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1335 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1336 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1337 | - * |
|
1338 | - * @return Elasticsearch|Promise |
|
1339 | - */ |
|
1340 | - public function hasPrivilegesUserProfile(array $params = []) |
|
1341 | - { |
|
1342 | - $this->checkRequiredParameters(['body'], $params); |
|
1343 | - $url = '/_security/profile/_has_privileges'; |
|
1344 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
1345 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1346 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1347 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1348 | - $request = $this->addOtelAttributes($params, [], $request, 'security.has_privileges_user_profile'); |
|
1349 | - return $this->client->sendRequest($request); |
|
1350 | - } |
|
1351 | - /** |
|
1352 | - * Invalidates one or more API keys. |
|
1353 | - * |
|
1354 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-api-key.html |
|
1355 | - * |
|
1356 | - * @param array{ |
|
1357 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1358 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1359 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1360 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1361 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1362 | - * body: array, // (REQUIRED) The api key request to invalidate API key(s) |
|
1363 | - * } $params |
|
1364 | - * |
|
1365 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1366 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1367 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1368 | - * |
|
1369 | - * @return Elasticsearch|Promise |
|
1370 | - */ |
|
1371 | - public function invalidateApiKey(array $params = []) |
|
1372 | - { |
|
1373 | - $this->checkRequiredParameters(['body'], $params); |
|
1374 | - $url = '/_security/api_key'; |
|
1375 | - $method = 'DELETE'; |
|
1376 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1377 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1378 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1379 | - $request = $this->addOtelAttributes($params, [], $request, 'security.invalidate_api_key'); |
|
1380 | - return $this->client->sendRequest($request); |
|
1381 | - } |
|
1382 | - /** |
|
1383 | - * Invalidates one or more access tokens or refresh tokens. |
|
1384 | - * |
|
1385 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-token.html |
|
1386 | - * |
|
1387 | - * @param array{ |
|
1388 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1389 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1390 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1391 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1392 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1393 | - * body: array, // (REQUIRED) The token to invalidate |
|
1394 | - * } $params |
|
1395 | - * |
|
1396 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1397 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1398 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1399 | - * |
|
1400 | - * @return Elasticsearch|Promise |
|
1401 | - */ |
|
1402 | - public function invalidateToken(array $params = []) |
|
1403 | - { |
|
1404 | - $this->checkRequiredParameters(['body'], $params); |
|
1405 | - $url = '/_security/oauth2/token'; |
|
1406 | - $method = 'DELETE'; |
|
1407 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1408 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1409 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1410 | - $request = $this->addOtelAttributes($params, [], $request, 'security.invalidate_token'); |
|
1411 | - return $this->client->sendRequest($request); |
|
1412 | - } |
|
1413 | - /** |
|
1414 | - * Exchanges an OpenID Connection authentication response message for an Elasticsearch access token and refresh token pair |
|
1415 | - * |
|
1416 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-oidc-authenticate.html |
|
1417 | - * |
|
1418 | - * @param array{ |
|
1419 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1420 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1421 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1422 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1423 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1424 | - * body: array, // (REQUIRED) The OpenID Connect response to authenticate |
|
1425 | - * } $params |
|
1426 | - * |
|
1427 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1428 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1429 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1430 | - * |
|
1431 | - * @return Elasticsearch|Promise |
|
1432 | - */ |
|
1433 | - public function oidcAuthenticate(array $params = []) |
|
1434 | - { |
|
1435 | - $this->checkRequiredParameters(['body'], $params); |
|
1436 | - $url = '/_security/oidc/authenticate'; |
|
1437 | - $method = 'POST'; |
|
1438 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1439 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1440 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1441 | - $request = $this->addOtelAttributes($params, [], $request, 'security.oidc_authenticate'); |
|
1442 | - return $this->client->sendRequest($request); |
|
1443 | - } |
|
1444 | - /** |
|
1445 | - * Invalidates a refresh token and access token that was generated from the OpenID Connect Authenticate API |
|
1446 | - * |
|
1447 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-oidc-logout.html |
|
1448 | - * |
|
1449 | - * @param array{ |
|
1450 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1451 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1452 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1453 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1454 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1455 | - * body: array, // (REQUIRED) Access token and refresh token to invalidate |
|
1456 | - * } $params |
|
1457 | - * |
|
1458 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1459 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1460 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1461 | - * |
|
1462 | - * @return Elasticsearch|Promise |
|
1463 | - */ |
|
1464 | - public function oidcLogout(array $params = []) |
|
1465 | - { |
|
1466 | - $this->checkRequiredParameters(['body'], $params); |
|
1467 | - $url = '/_security/oidc/logout'; |
|
1468 | - $method = 'POST'; |
|
1469 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1470 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1471 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1472 | - $request = $this->addOtelAttributes($params, [], $request, 'security.oidc_logout'); |
|
1473 | - return $this->client->sendRequest($request); |
|
1474 | - } |
|
1475 | - /** |
|
1476 | - * Creates an OAuth 2.0 authentication request as a URL string |
|
1477 | - * |
|
1478 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-oidc-prepare-authentication.html |
|
1479 | - * |
|
1480 | - * @param array{ |
|
1481 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1482 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1483 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1484 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1485 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1486 | - * body: array, // (REQUIRED) The OpenID Connect authentication realm configuration |
|
1487 | - * } $params |
|
1488 | - * |
|
1489 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1490 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1491 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1492 | - * |
|
1493 | - * @return Elasticsearch|Promise |
|
1494 | - */ |
|
1495 | - public function oidcPrepareAuthentication(array $params = []) |
|
1496 | - { |
|
1497 | - $this->checkRequiredParameters(['body'], $params); |
|
1498 | - $url = '/_security/oidc/prepare'; |
|
1499 | - $method = 'POST'; |
|
1500 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1501 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1502 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1503 | - $request = $this->addOtelAttributes($params, [], $request, 'security.oidc_prepare_authentication'); |
|
1504 | - return $this->client->sendRequest($request); |
|
1505 | - } |
|
1506 | - /** |
|
1507 | - * Adds or updates application privileges. |
|
1508 | - * |
|
1509 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-privileges.html |
|
1510 | - * |
|
1511 | - * @param array{ |
|
1512 | - * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
1513 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1514 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1515 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1516 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1517 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1518 | - * body: array, // (REQUIRED) The privilege(s) to add |
|
1519 | - * } $params |
|
1520 | - * |
|
1521 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1522 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1523 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1524 | - * |
|
1525 | - * @return Elasticsearch|Promise |
|
1526 | - */ |
|
1527 | - public function putPrivileges(array $params = []) |
|
1528 | - { |
|
1529 | - $this->checkRequiredParameters(['body'], $params); |
|
1530 | - $url = '/_security/privilege'; |
|
1531 | - $method = 'PUT'; |
|
1532 | - $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1533 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1534 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1535 | - $request = $this->addOtelAttributes($params, [], $request, 'security.put_privileges'); |
|
1536 | - return $this->client->sendRequest($request); |
|
1537 | - } |
|
1538 | - /** |
|
1539 | - * Adds and updates roles in the native realm. |
|
1540 | - * |
|
1541 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role.html |
|
1542 | - * |
|
1543 | - * @param array{ |
|
1544 | - * name: string, // (REQUIRED) Role name |
|
1545 | - * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
1546 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1547 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1548 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1549 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1550 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1551 | - * body: array, // (REQUIRED) The role to add |
|
1552 | - * } $params |
|
1553 | - * |
|
1554 | - * @throws MissingParameterException if a required parameter is missing |
|
1555 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1556 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1557 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1558 | - * |
|
1559 | - * @return Elasticsearch|Promise |
|
1560 | - */ |
|
1561 | - public function putRole(array $params = []) |
|
1562 | - { |
|
1563 | - $this->checkRequiredParameters(['name', 'body'], $params); |
|
1564 | - $url = '/_security/role/' . $this->encode($params['name']); |
|
1565 | - $method = 'PUT'; |
|
1566 | - $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1567 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1568 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1569 | - $request = $this->addOtelAttributes($params, ['name'], $request, 'security.put_role'); |
|
1570 | - return $this->client->sendRequest($request); |
|
1571 | - } |
|
1572 | - /** |
|
1573 | - * Creates and updates role mappings. |
|
1574 | - * |
|
1575 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role-mapping.html |
|
1576 | - * |
|
1577 | - * @param array{ |
|
1578 | - * name: string, // (REQUIRED) Role-mapping name |
|
1579 | - * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
1580 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1581 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1582 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1583 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1584 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1585 | - * body: array, // (REQUIRED) The role mapping to add |
|
1586 | - * } $params |
|
1587 | - * |
|
1588 | - * @throws MissingParameterException if a required parameter is missing |
|
1589 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1590 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1591 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1592 | - * |
|
1593 | - * @return Elasticsearch|Promise |
|
1594 | - */ |
|
1595 | - public function putRoleMapping(array $params = []) |
|
1596 | - { |
|
1597 | - $this->checkRequiredParameters(['name', 'body'], $params); |
|
1598 | - $url = '/_security/role_mapping/' . $this->encode($params['name']); |
|
1599 | - $method = 'PUT'; |
|
1600 | - $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1601 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1602 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1603 | - $request = $this->addOtelAttributes($params, ['name'], $request, 'security.put_role_mapping'); |
|
1604 | - return $this->client->sendRequest($request); |
|
1605 | - } |
|
1606 | - /** |
|
1607 | - * Adds and updates users in the native realm. These users are commonly referred to as native users. |
|
1608 | - * |
|
1609 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-user.html |
|
1610 | - * |
|
1611 | - * @param array{ |
|
1612 | - * username: string, // (REQUIRED) The username of the User |
|
1613 | - * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
1614 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1615 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1616 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1617 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1618 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1619 | - * body: array, // (REQUIRED) The user to add |
|
1620 | - * } $params |
|
1621 | - * |
|
1622 | - * @throws MissingParameterException if a required parameter is missing |
|
1623 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1624 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1625 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1626 | - * |
|
1627 | - * @return Elasticsearch|Promise |
|
1628 | - */ |
|
1629 | - public function putUser(array $params = []) |
|
1630 | - { |
|
1631 | - $this->checkRequiredParameters(['username', 'body'], $params); |
|
1632 | - $url = '/_security/user/' . $this->encode($params['username']); |
|
1633 | - $method = 'PUT'; |
|
1634 | - $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1635 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1636 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1637 | - $request = $this->addOtelAttributes($params, ['username'], $request, 'security.put_user'); |
|
1638 | - return $this->client->sendRequest($request); |
|
1639 | - } |
|
1640 | - /** |
|
1641 | - * Retrieves information for API keys using a subset of query DSL |
|
1642 | - * |
|
1643 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-api-key.html |
|
1644 | - * |
|
1645 | - * @param array{ |
|
1646 | - * with_limited_by: boolean, // flag to show the limited-by role descriptors of API Keys |
|
1647 | - * with_profile_uid: boolean, // flag to also retrieve the API Key's owner profile uid, if it exists |
|
1648 | - * typed_keys: boolean, // flag to prefix aggregation names by their respective types in the response |
|
1649 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1650 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1651 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1652 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1653 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1654 | - * body: array, // From, size, query, sort and search_after |
|
1655 | - * } $params |
|
1656 | - * |
|
1657 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1658 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1659 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1660 | - * |
|
1661 | - * @return Elasticsearch|Promise |
|
1662 | - */ |
|
1663 | - public function queryApiKeys(array $params = []) |
|
1664 | - { |
|
1665 | - $url = '/_security/_query/api_key'; |
|
1666 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
1667 | - $url = $this->addQueryString($url, $params, ['with_limited_by', 'with_profile_uid', 'typed_keys', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1668 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1669 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1670 | - $request = $this->addOtelAttributes($params, [], $request, 'security.query_api_keys'); |
|
1671 | - return $this->client->sendRequest($request); |
|
1672 | - } |
|
1673 | - /** |
|
1674 | - * Retrieves information for Roles using a subset of query DSL |
|
1675 | - * |
|
1676 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-role.html |
|
1677 | - * |
|
1678 | - * @param array{ |
|
1679 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1680 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1681 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1682 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1683 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1684 | - * body: array, // From, size, query, sort and search_after |
|
1685 | - * } $params |
|
1686 | - * |
|
1687 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1688 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1689 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1690 | - * |
|
1691 | - * @return Elasticsearch|Promise |
|
1692 | - */ |
|
1693 | - public function queryRole(array $params = []) |
|
1694 | - { |
|
1695 | - $url = '/_security/_query/role'; |
|
1696 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
1697 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1698 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1699 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1700 | - $request = $this->addOtelAttributes($params, [], $request, 'security.query_role'); |
|
1701 | - return $this->client->sendRequest($request); |
|
1702 | - } |
|
1703 | - /** |
|
1704 | - * Retrieves information for Users using a subset of query DSL |
|
1705 | - * |
|
1706 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-user.html |
|
1707 | - * |
|
1708 | - * @param array{ |
|
1709 | - * with_profile_uid: boolean, // flag to retrieve profile uid (if exists) associated with the user |
|
1710 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1711 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1712 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1713 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1714 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1715 | - * body: array, // From, size, query, sort and search_after |
|
1716 | - * } $params |
|
1717 | - * |
|
1718 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1719 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1720 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1721 | - * |
|
1722 | - * @return Elasticsearch|Promise |
|
1723 | - */ |
|
1724 | - public function queryUser(array $params = []) |
|
1725 | - { |
|
1726 | - $url = '/_security/_query/user'; |
|
1727 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
1728 | - $url = $this->addQueryString($url, $params, ['with_profile_uid', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1729 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1730 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1731 | - $request = $this->addOtelAttributes($params, [], $request, 'security.query_user'); |
|
1732 | - return $this->client->sendRequest($request); |
|
1733 | - } |
|
1734 | - /** |
|
1735 | - * Exchanges a SAML Response message for an Elasticsearch access token and refresh token pair |
|
1736 | - * |
|
1737 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-authenticate.html |
|
1738 | - * |
|
1739 | - * @param array{ |
|
1740 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1741 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1742 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1743 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1744 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1745 | - * body: array, // (REQUIRED) The SAML response to authenticate |
|
1746 | - * } $params |
|
1747 | - * |
|
1748 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1749 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1750 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1751 | - * |
|
1752 | - * @return Elasticsearch|Promise |
|
1753 | - */ |
|
1754 | - public function samlAuthenticate(array $params = []) |
|
1755 | - { |
|
1756 | - $this->checkRequiredParameters(['body'], $params); |
|
1757 | - $url = '/_security/saml/authenticate'; |
|
1758 | - $method = 'POST'; |
|
1759 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1760 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1761 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1762 | - $request = $this->addOtelAttributes($params, [], $request, 'security.saml_authenticate'); |
|
1763 | - return $this->client->sendRequest($request); |
|
1764 | - } |
|
1765 | - /** |
|
1766 | - * Verifies the logout response sent from the SAML IdP |
|
1767 | - * |
|
1768 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-complete-logout.html |
|
1769 | - * |
|
1770 | - * @param array{ |
|
1771 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1772 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1773 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1774 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1775 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1776 | - * body: array, // (REQUIRED) The logout response to verify |
|
1777 | - * } $params |
|
1778 | - * |
|
1779 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1780 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1781 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1782 | - * |
|
1783 | - * @return Elasticsearch|Promise |
|
1784 | - */ |
|
1785 | - public function samlCompleteLogout(array $params = []) |
|
1786 | - { |
|
1787 | - $this->checkRequiredParameters(['body'], $params); |
|
1788 | - $url = '/_security/saml/complete_logout'; |
|
1789 | - $method = 'POST'; |
|
1790 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1791 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1792 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1793 | - $request = $this->addOtelAttributes($params, [], $request, 'security.saml_complete_logout'); |
|
1794 | - return $this->client->sendRequest($request); |
|
1795 | - } |
|
1796 | - /** |
|
1797 | - * Consumes a SAML LogoutRequest |
|
1798 | - * |
|
1799 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-invalidate.html |
|
1800 | - * |
|
1801 | - * @param array{ |
|
1802 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1803 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1804 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1805 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1806 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1807 | - * body: array, // (REQUIRED) The LogoutRequest message |
|
1808 | - * } $params |
|
1809 | - * |
|
1810 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1811 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1812 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1813 | - * |
|
1814 | - * @return Elasticsearch|Promise |
|
1815 | - */ |
|
1816 | - public function samlInvalidate(array $params = []) |
|
1817 | - { |
|
1818 | - $this->checkRequiredParameters(['body'], $params); |
|
1819 | - $url = '/_security/saml/invalidate'; |
|
1820 | - $method = 'POST'; |
|
1821 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1822 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1823 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1824 | - $request = $this->addOtelAttributes($params, [], $request, 'security.saml_invalidate'); |
|
1825 | - return $this->client->sendRequest($request); |
|
1826 | - } |
|
1827 | - /** |
|
1828 | - * Invalidates an access token and a refresh token that were generated via the SAML Authenticate API |
|
1829 | - * |
|
1830 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-logout.html |
|
1831 | - * |
|
1832 | - * @param array{ |
|
1833 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1834 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1835 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1836 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1837 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1838 | - * body: array, // (REQUIRED) The tokens to invalidate |
|
1839 | - * } $params |
|
1840 | - * |
|
1841 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1842 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1843 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1844 | - * |
|
1845 | - * @return Elasticsearch|Promise |
|
1846 | - */ |
|
1847 | - public function samlLogout(array $params = []) |
|
1848 | - { |
|
1849 | - $this->checkRequiredParameters(['body'], $params); |
|
1850 | - $url = '/_security/saml/logout'; |
|
1851 | - $method = 'POST'; |
|
1852 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1853 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1854 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1855 | - $request = $this->addOtelAttributes($params, [], $request, 'security.saml_logout'); |
|
1856 | - return $this->client->sendRequest($request); |
|
1857 | - } |
|
1858 | - /** |
|
1859 | - * Creates a SAML authentication request |
|
1860 | - * |
|
1861 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-prepare-authentication.html |
|
1862 | - * |
|
1863 | - * @param array{ |
|
1864 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1865 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1866 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1867 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1868 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1869 | - * body: array, // (REQUIRED) The realm for which to create the authentication request, identified by either its name or the ACS URL |
|
1870 | - * } $params |
|
1871 | - * |
|
1872 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1873 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1874 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1875 | - * |
|
1876 | - * @return Elasticsearch|Promise |
|
1877 | - */ |
|
1878 | - public function samlPrepareAuthentication(array $params = []) |
|
1879 | - { |
|
1880 | - $this->checkRequiredParameters(['body'], $params); |
|
1881 | - $url = '/_security/saml/prepare'; |
|
1882 | - $method = 'POST'; |
|
1883 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1884 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1885 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1886 | - $request = $this->addOtelAttributes($params, [], $request, 'security.saml_prepare_authentication'); |
|
1887 | - return $this->client->sendRequest($request); |
|
1888 | - } |
|
1889 | - /** |
|
1890 | - * Generates SAML metadata for the Elastic stack SAML 2.0 Service Provider |
|
1891 | - * |
|
1892 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-sp-metadata.html |
|
1893 | - * |
|
1894 | - * @param array{ |
|
1895 | - * realm_name: string, // (REQUIRED) The name of the SAML realm to get the metadata for |
|
1896 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1897 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1898 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1899 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1900 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1901 | - * } $params |
|
1902 | - * |
|
1903 | - * @throws MissingParameterException if a required parameter is missing |
|
1904 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1905 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1906 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1907 | - * |
|
1908 | - * @return Elasticsearch|Promise |
|
1909 | - */ |
|
1910 | - public function samlServiceProviderMetadata(array $params = []) |
|
1911 | - { |
|
1912 | - $this->checkRequiredParameters(['realm_name'], $params); |
|
1913 | - $url = '/_security/saml/metadata/' . $this->encode($params['realm_name']); |
|
1914 | - $method = 'GET'; |
|
1915 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1916 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1917 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1918 | - $request = $this->addOtelAttributes($params, ['realm_name'], $request, 'security.saml_service_provider_metadata'); |
|
1919 | - return $this->client->sendRequest($request); |
|
1920 | - } |
|
1921 | - /** |
|
1922 | - * Get suggestions for user profiles that match specified search criteria. |
|
1923 | - * |
|
1924 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-suggest-user-profile.html |
|
1925 | - * |
|
1926 | - * @param array{ |
|
1927 | - * data: list, // A comma-separated list of keys for which the corresponding application data are retrieved. |
|
1928 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1929 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1930 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1931 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1932 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1933 | - * body: array, // The suggestion definition for user profiles |
|
1934 | - * } $params |
|
1935 | - * |
|
1936 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1937 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1938 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1939 | - * |
|
1940 | - * @return Elasticsearch|Promise |
|
1941 | - */ |
|
1942 | - public function suggestUserProfiles(array $params = []) |
|
1943 | - { |
|
1944 | - $url = '/_security/profile/_suggest'; |
|
1945 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
1946 | - $url = $this->addQueryString($url, $params, ['data', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1947 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1948 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1949 | - $request = $this->addOtelAttributes($params, [], $request, 'security.suggest_user_profiles'); |
|
1950 | - return $this->client->sendRequest($request); |
|
1951 | - } |
|
1952 | - /** |
|
1953 | - * Updates attributes of an existing API key. |
|
1954 | - * |
|
1955 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-api-key.html |
|
1956 | - * |
|
1957 | - * @param array{ |
|
1958 | - * id: string, // (REQUIRED) The ID of the API key to update |
|
1959 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1960 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1961 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1962 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1963 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1964 | - * body: array, // The API key request to update attributes of an API key. |
|
1965 | - * } $params |
|
1966 | - * |
|
1967 | - * @throws MissingParameterException if a required parameter is missing |
|
1968 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
1969 | - * @throws ClientResponseException if the status code of response is 4xx |
|
1970 | - * @throws ServerResponseException if the status code of response is 5xx |
|
1971 | - * |
|
1972 | - * @return Elasticsearch|Promise |
|
1973 | - */ |
|
1974 | - public function updateApiKey(array $params = []) |
|
1975 | - { |
|
1976 | - $this->checkRequiredParameters(['id'], $params); |
|
1977 | - $url = '/_security/api_key/' . $this->encode($params['id']); |
|
1978 | - $method = 'PUT'; |
|
1979 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1980 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1981 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1982 | - $request = $this->addOtelAttributes($params, ['id'], $request, 'security.update_api_key'); |
|
1983 | - return $this->client->sendRequest($request); |
|
1984 | - } |
|
1985 | - /** |
|
1986 | - * Updates attributes of an existing cross-cluster API key. |
|
1987 | - * |
|
1988 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-cross-cluster-api-key.html |
|
1989 | - * |
|
1990 | - * @param array{ |
|
1991 | - * id: string, // (REQUIRED) The ID of the cross-cluster API key to update |
|
1992 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1993 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1994 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1995 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1996 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1997 | - * body: array, // (REQUIRED) The request to update attributes of a cross-cluster API key. |
|
1998 | - * } $params |
|
1999 | - * |
|
2000 | - * @throws MissingParameterException if a required parameter is missing |
|
2001 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
2002 | - * @throws ClientResponseException if the status code of response is 4xx |
|
2003 | - * @throws ServerResponseException if the status code of response is 5xx |
|
2004 | - * |
|
2005 | - * @return Elasticsearch|Promise |
|
2006 | - */ |
|
2007 | - public function updateCrossClusterApiKey(array $params = []) |
|
2008 | - { |
|
2009 | - $this->checkRequiredParameters(['id', 'body'], $params); |
|
2010 | - $url = '/_security/cross_cluster/api_key/' . $this->encode($params['id']); |
|
2011 | - $method = 'PUT'; |
|
2012 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
2013 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
2014 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
2015 | - $request = $this->addOtelAttributes($params, ['id'], $request, 'security.update_cross_cluster_api_key'); |
|
2016 | - return $this->client->sendRequest($request); |
|
2017 | - } |
|
2018 | - /** |
|
2019 | - * Update settings for the security system index |
|
2020 | - * |
|
2021 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-settings.html |
|
2022 | - * |
|
2023 | - * @param array{ |
|
2024 | - * master_timeout: time, // Timeout for connection to master |
|
2025 | - * timeout: time, // Timeout for acknowledgements from all nodes |
|
2026 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
2027 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
2028 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
2029 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
2030 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
2031 | - * body: array, // (REQUIRED) An object with the new settings for each index, if any |
|
2032 | - * } $params |
|
2033 | - * |
|
2034 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
2035 | - * @throws ClientResponseException if the status code of response is 4xx |
|
2036 | - * @throws ServerResponseException if the status code of response is 5xx |
|
2037 | - * |
|
2038 | - * @return Elasticsearch|Promise |
|
2039 | - */ |
|
2040 | - public function updateSettings(array $params = []) |
|
2041 | - { |
|
2042 | - $this->checkRequiredParameters(['body'], $params); |
|
2043 | - $url = '/_security/settings'; |
|
2044 | - $method = 'PUT'; |
|
2045 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
2046 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
2047 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
2048 | - $request = $this->addOtelAttributes($params, [], $request, 'security.update_settings'); |
|
2049 | - return $this->client->sendRequest($request); |
|
2050 | - } |
|
2051 | - /** |
|
2052 | - * Update application specific data for the user profile of the given unique ID. |
|
2053 | - * |
|
2054 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-user-profile-data.html |
|
2055 | - * |
|
2056 | - * @param array{ |
|
2057 | - * uid: string, // (REQUIRED) An unique identifier of the user profile |
|
2058 | - * if_seq_no: number, // only perform the update operation if the last operation that has changed the document has the specified sequence number |
|
2059 | - * if_primary_term: number, // only perform the update operation if the last operation that has changed the document has the specified primary term |
|
2060 | - * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
2061 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
2062 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
2063 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
2064 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
2065 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
2066 | - * body: array, // (REQUIRED) The application data to update |
|
2067 | - * } $params |
|
2068 | - * |
|
2069 | - * @throws MissingParameterException if a required parameter is missing |
|
2070 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
2071 | - * @throws ClientResponseException if the status code of response is 4xx |
|
2072 | - * @throws ServerResponseException if the status code of response is 5xx |
|
2073 | - * |
|
2074 | - * @return Elasticsearch|Promise |
|
2075 | - */ |
|
2076 | - public function updateUserProfileData(array $params = []) |
|
2077 | - { |
|
2078 | - $this->checkRequiredParameters(['uid', 'body'], $params); |
|
2079 | - $url = '/_security/profile/' . $this->encode($params['uid']) . '/_data'; |
|
2080 | - $method = 'PUT'; |
|
2081 | - $url = $this->addQueryString($url, $params, ['if_seq_no', 'if_primary_term', 'refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
2082 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
2083 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
2084 | - $request = $this->addOtelAttributes($params, ['uid'], $request, 'security.update_user_profile_data'); |
|
2085 | - return $this->client->sendRequest($request); |
|
2086 | - } |
|
28 | + /** |
|
29 | + * Creates or updates the user profile on behalf of another user. |
|
30 | + * |
|
31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-activate-user-profile.html |
|
32 | + * |
|
33 | + * @param array{ |
|
34 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
35 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
36 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
37 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
38 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
39 | + * body: array, // (REQUIRED) The grant type and user's credential |
|
40 | + * } $params |
|
41 | + * |
|
42 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
43 | + * @throws ClientResponseException if the status code of response is 4xx |
|
44 | + * @throws ServerResponseException if the status code of response is 5xx |
|
45 | + * |
|
46 | + * @return Elasticsearch|Promise |
|
47 | + */ |
|
48 | + public function activateUserProfile(array $params = []) |
|
49 | + { |
|
50 | + $this->checkRequiredParameters(['body'], $params); |
|
51 | + $url = '/_security/profile/_activate'; |
|
52 | + $method = 'POST'; |
|
53 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
54 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
55 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
56 | + $request = $this->addOtelAttributes($params, [], $request, 'security.activate_user_profile'); |
|
57 | + return $this->client->sendRequest($request); |
|
58 | + } |
|
59 | + /** |
|
60 | + * Enables authentication as a user and retrieve information about the authenticated user. |
|
61 | + * |
|
62 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-authenticate.html |
|
63 | + * |
|
64 | + * @param array{ |
|
65 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
66 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
67 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
68 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
69 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
70 | + * } $params |
|
71 | + * |
|
72 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
73 | + * @throws ClientResponseException if the status code of response is 4xx |
|
74 | + * @throws ServerResponseException if the status code of response is 5xx |
|
75 | + * |
|
76 | + * @return Elasticsearch|Promise |
|
77 | + */ |
|
78 | + public function authenticate(array $params = []) |
|
79 | + { |
|
80 | + $url = '/_security/_authenticate'; |
|
81 | + $method = 'GET'; |
|
82 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
83 | + $headers = ['Accept' => 'application/json']; |
|
84 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
85 | + $request = $this->addOtelAttributes($params, [], $request, 'security.authenticate'); |
|
86 | + return $this->client->sendRequest($request); |
|
87 | + } |
|
88 | + /** |
|
89 | + * Bulk delete roles in the native realm. |
|
90 | + * |
|
91 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-bulk-delete-role.html |
|
92 | + * |
|
93 | + * @param array{ |
|
94 | + * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
95 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
96 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
97 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
98 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
99 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
100 | + * body: array, // (REQUIRED) The roles to delete |
|
101 | + * } $params |
|
102 | + * |
|
103 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
104 | + * @throws ClientResponseException if the status code of response is 4xx |
|
105 | + * @throws ServerResponseException if the status code of response is 5xx |
|
106 | + * |
|
107 | + * @return Elasticsearch|Promise |
|
108 | + */ |
|
109 | + public function bulkDeleteRole(array $params = []) |
|
110 | + { |
|
111 | + $this->checkRequiredParameters(['body'], $params); |
|
112 | + $url = '/_security/role'; |
|
113 | + $method = 'DELETE'; |
|
114 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
115 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
116 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
117 | + $request = $this->addOtelAttributes($params, [], $request, 'security.bulk_delete_role'); |
|
118 | + return $this->client->sendRequest($request); |
|
119 | + } |
|
120 | + /** |
|
121 | + * Bulk adds and updates roles in the native realm. |
|
122 | + * |
|
123 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-bulk-put-role.html |
|
124 | + * |
|
125 | + * @param array{ |
|
126 | + * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
127 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
128 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
129 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
130 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
131 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
132 | + * body: array, // (REQUIRED) The roles to add |
|
133 | + * } $params |
|
134 | + * |
|
135 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
136 | + * @throws ClientResponseException if the status code of response is 4xx |
|
137 | + * @throws ServerResponseException if the status code of response is 5xx |
|
138 | + * |
|
139 | + * @return Elasticsearch|Promise |
|
140 | + */ |
|
141 | + public function bulkPutRole(array $params = []) |
|
142 | + { |
|
143 | + $this->checkRequiredParameters(['body'], $params); |
|
144 | + $url = '/_security/role'; |
|
145 | + $method = 'POST'; |
|
146 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
147 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
148 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
149 | + $request = $this->addOtelAttributes($params, [], $request, 'security.bulk_put_role'); |
|
150 | + return $this->client->sendRequest($request); |
|
151 | + } |
|
152 | + /** |
|
153 | + * Updates the attributes of multiple existing API keys. |
|
154 | + * |
|
155 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-bulk-update-api-keys.html |
|
156 | + * |
|
157 | + * @param array{ |
|
158 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
159 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
160 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
161 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
162 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
163 | + * body: array, // (REQUIRED) The API key request to update the attributes of multiple API keys. |
|
164 | + * } $params |
|
165 | + * |
|
166 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
167 | + * @throws ClientResponseException if the status code of response is 4xx |
|
168 | + * @throws ServerResponseException if the status code of response is 5xx |
|
169 | + * |
|
170 | + * @return Elasticsearch|Promise |
|
171 | + */ |
|
172 | + public function bulkUpdateApiKeys(array $params = []) |
|
173 | + { |
|
174 | + $this->checkRequiredParameters(['body'], $params); |
|
175 | + $url = '/_security/api_key/_bulk_update'; |
|
176 | + $method = 'POST'; |
|
177 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
178 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
179 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
180 | + $request = $this->addOtelAttributes($params, [], $request, 'security.bulk_update_api_keys'); |
|
181 | + return $this->client->sendRequest($request); |
|
182 | + } |
|
183 | + /** |
|
184 | + * Changes the passwords of users in the native realm and built-in users. |
|
185 | + * |
|
186 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-change-password.html |
|
187 | + * |
|
188 | + * @param array{ |
|
189 | + * username: string, // The username of the user to change the password for |
|
190 | + * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
191 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
192 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
193 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
194 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
195 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
196 | + * body: array, // (REQUIRED) the new password for the user |
|
197 | + * } $params |
|
198 | + * |
|
199 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
200 | + * @throws ClientResponseException if the status code of response is 4xx |
|
201 | + * @throws ServerResponseException if the status code of response is 5xx |
|
202 | + * |
|
203 | + * @return Elasticsearch|Promise |
|
204 | + */ |
|
205 | + public function changePassword(array $params = []) |
|
206 | + { |
|
207 | + $this->checkRequiredParameters(['body'], $params); |
|
208 | + if (isset($params['username'])) { |
|
209 | + $url = '/_security/user/' . $this->encode($params['username']) . '/_password'; |
|
210 | + $method = 'PUT'; |
|
211 | + } else { |
|
212 | + $url = '/_security/user/_password'; |
|
213 | + $method = 'PUT'; |
|
214 | + } |
|
215 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
216 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
217 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
218 | + $request = $this->addOtelAttributes($params, ['username'], $request, 'security.change_password'); |
|
219 | + return $this->client->sendRequest($request); |
|
220 | + } |
|
221 | + /** |
|
222 | + * Clear a subset or all entries from the API key cache. |
|
223 | + * |
|
224 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-api-key-cache.html |
|
225 | + * |
|
226 | + * @param array{ |
|
227 | + * ids: list, // (REQUIRED) A comma-separated list of IDs of API keys to clear from the cache |
|
228 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
229 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
230 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
231 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
232 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
233 | + * } $params |
|
234 | + * |
|
235 | + * @throws MissingParameterException if a required parameter is missing |
|
236 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
237 | + * @throws ClientResponseException if the status code of response is 4xx |
|
238 | + * @throws ServerResponseException if the status code of response is 5xx |
|
239 | + * |
|
240 | + * @return Elasticsearch|Promise |
|
241 | + */ |
|
242 | + public function clearApiKeyCache(array $params = []) |
|
243 | + { |
|
244 | + $this->checkRequiredParameters(['ids'], $params); |
|
245 | + $url = '/_security/api_key/' . $this->encode($params['ids']) . '/_clear_cache'; |
|
246 | + $method = 'POST'; |
|
247 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
248 | + $headers = ['Accept' => 'application/json']; |
|
249 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
250 | + $request = $this->addOtelAttributes($params, ['ids'], $request, 'security.clear_api_key_cache'); |
|
251 | + return $this->client->sendRequest($request); |
|
252 | + } |
|
253 | + /** |
|
254 | + * Evicts application privileges from the native application privileges cache. |
|
255 | + * |
|
256 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-privilege-cache.html |
|
257 | + * |
|
258 | + * @param array{ |
|
259 | + * application: list, // (REQUIRED) A comma-separated list of application names |
|
260 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
261 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
262 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
263 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
264 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
265 | + * } $params |
|
266 | + * |
|
267 | + * @throws MissingParameterException if a required parameter is missing |
|
268 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
269 | + * @throws ClientResponseException if the status code of response is 4xx |
|
270 | + * @throws ServerResponseException if the status code of response is 5xx |
|
271 | + * |
|
272 | + * @return Elasticsearch|Promise |
|
273 | + */ |
|
274 | + public function clearCachedPrivileges(array $params = []) |
|
275 | + { |
|
276 | + $this->checkRequiredParameters(['application'], $params); |
|
277 | + $url = '/_security/privilege/' . $this->encode($params['application']) . '/_clear_cache'; |
|
278 | + $method = 'POST'; |
|
279 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
280 | + $headers = ['Accept' => 'application/json']; |
|
281 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
282 | + $request = $this->addOtelAttributes($params, ['application'], $request, 'security.clear_cached_privileges'); |
|
283 | + return $this->client->sendRequest($request); |
|
284 | + } |
|
285 | + /** |
|
286 | + * Evicts users from the user cache. Can completely clear the cache or evict specific users. |
|
287 | + * |
|
288 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-cache.html |
|
289 | + * |
|
290 | + * @param array{ |
|
291 | + * realms: list, // (REQUIRED) Comma-separated list of realms to clear |
|
292 | + * usernames: list, // Comma-separated list of usernames to clear from the cache |
|
293 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
294 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
295 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
296 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
297 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
298 | + * } $params |
|
299 | + * |
|
300 | + * @throws MissingParameterException if a required parameter is missing |
|
301 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
302 | + * @throws ClientResponseException if the status code of response is 4xx |
|
303 | + * @throws ServerResponseException if the status code of response is 5xx |
|
304 | + * |
|
305 | + * @return Elasticsearch|Promise |
|
306 | + */ |
|
307 | + public function clearCachedRealms(array $params = []) |
|
308 | + { |
|
309 | + $this->checkRequiredParameters(['realms'], $params); |
|
310 | + $url = '/_security/realm/' . $this->encode($params['realms']) . '/_clear_cache'; |
|
311 | + $method = 'POST'; |
|
312 | + $url = $this->addQueryString($url, $params, ['usernames', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
313 | + $headers = ['Accept' => 'application/json']; |
|
314 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
315 | + $request = $this->addOtelAttributes($params, ['realms'], $request, 'security.clear_cached_realms'); |
|
316 | + return $this->client->sendRequest($request); |
|
317 | + } |
|
318 | + /** |
|
319 | + * Evicts roles from the native role cache. |
|
320 | + * |
|
321 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-role-cache.html |
|
322 | + * |
|
323 | + * @param array{ |
|
324 | + * name: list, // (REQUIRED) Role name |
|
325 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
326 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
327 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
328 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
329 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
330 | + * } $params |
|
331 | + * |
|
332 | + * @throws MissingParameterException if a required parameter is missing |
|
333 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
334 | + * @throws ClientResponseException if the status code of response is 4xx |
|
335 | + * @throws ServerResponseException if the status code of response is 5xx |
|
336 | + * |
|
337 | + * @return Elasticsearch|Promise |
|
338 | + */ |
|
339 | + public function clearCachedRoles(array $params = []) |
|
340 | + { |
|
341 | + $this->checkRequiredParameters(['name'], $params); |
|
342 | + $url = '/_security/role/' . $this->encode($params['name']) . '/_clear_cache'; |
|
343 | + $method = 'POST'; |
|
344 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
345 | + $headers = ['Accept' => 'application/json']; |
|
346 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
347 | + $request = $this->addOtelAttributes($params, ['name'], $request, 'security.clear_cached_roles'); |
|
348 | + return $this->client->sendRequest($request); |
|
349 | + } |
|
350 | + /** |
|
351 | + * Evicts tokens from the service account token caches. |
|
352 | + * |
|
353 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-service-token-caches.html |
|
354 | + * |
|
355 | + * @param array{ |
|
356 | + * namespace: string, // (REQUIRED) An identifier for the namespace |
|
357 | + * service: string, // (REQUIRED) An identifier for the service name |
|
358 | + * name: list, // (REQUIRED) A comma-separated list of service token names |
|
359 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
360 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
361 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
362 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
363 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
364 | + * } $params |
|
365 | + * |
|
366 | + * @throws MissingParameterException if a required parameter is missing |
|
367 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
368 | + * @throws ClientResponseException if the status code of response is 4xx |
|
369 | + * @throws ServerResponseException if the status code of response is 5xx |
|
370 | + * |
|
371 | + * @return Elasticsearch|Promise |
|
372 | + */ |
|
373 | + public function clearCachedServiceTokens(array $params = []) |
|
374 | + { |
|
375 | + $this->checkRequiredParameters(['namespace', 'service', 'name'], $params); |
|
376 | + $url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']) . '/credential/token/' . $this->encode($params['name']) . '/_clear_cache'; |
|
377 | + $method = 'POST'; |
|
378 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
379 | + $headers = ['Accept' => 'application/json']; |
|
380 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
381 | + $request = $this->addOtelAttributes($params, ['namespace', 'service', 'name'], $request, 'security.clear_cached_service_tokens'); |
|
382 | + return $this->client->sendRequest($request); |
|
383 | + } |
|
384 | + /** |
|
385 | + * Creates an API key for access without requiring basic authentication. |
|
386 | + * |
|
387 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html |
|
388 | + * |
|
389 | + * @param array{ |
|
390 | + * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
391 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
392 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
393 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
394 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
395 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
396 | + * body: array, // (REQUIRED) The api key request to create an API key |
|
397 | + * } $params |
|
398 | + * |
|
399 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
400 | + * @throws ClientResponseException if the status code of response is 4xx |
|
401 | + * @throws ServerResponseException if the status code of response is 5xx |
|
402 | + * |
|
403 | + * @return Elasticsearch|Promise |
|
404 | + */ |
|
405 | + public function createApiKey(array $params = []) |
|
406 | + { |
|
407 | + $this->checkRequiredParameters(['body'], $params); |
|
408 | + $url = '/_security/api_key'; |
|
409 | + $method = 'PUT'; |
|
410 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
411 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
412 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
413 | + $request = $this->addOtelAttributes($params, [], $request, 'security.create_api_key'); |
|
414 | + return $this->client->sendRequest($request); |
|
415 | + } |
|
416 | + /** |
|
417 | + * Creates a cross-cluster API key for API key based remote cluster access. |
|
418 | + * |
|
419 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-cross-cluster-api-key.html |
|
420 | + * |
|
421 | + * @param array{ |
|
422 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
423 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
424 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
425 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
426 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
427 | + * body: array, // (REQUIRED) The request to create a cross-cluster API key |
|
428 | + * } $params |
|
429 | + * |
|
430 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
431 | + * @throws ClientResponseException if the status code of response is 4xx |
|
432 | + * @throws ServerResponseException if the status code of response is 5xx |
|
433 | + * |
|
434 | + * @return Elasticsearch|Promise |
|
435 | + */ |
|
436 | + public function createCrossClusterApiKey(array $params = []) |
|
437 | + { |
|
438 | + $this->checkRequiredParameters(['body'], $params); |
|
439 | + $url = '/_security/cross_cluster/api_key'; |
|
440 | + $method = 'POST'; |
|
441 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
442 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
443 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
444 | + $request = $this->addOtelAttributes($params, [], $request, 'security.create_cross_cluster_api_key'); |
|
445 | + return $this->client->sendRequest($request); |
|
446 | + } |
|
447 | + /** |
|
448 | + * Creates a service account token for access without requiring basic authentication. |
|
449 | + * |
|
450 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-service-token.html |
|
451 | + * |
|
452 | + * @param array{ |
|
453 | + * namespace: string, // (REQUIRED) An identifier for the namespace |
|
454 | + * service: string, // (REQUIRED) An identifier for the service name |
|
455 | + * name: string, // An identifier for the token name |
|
456 | + * refresh: enum, // If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` (the default) then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
457 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
458 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
459 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
460 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
461 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
462 | + * } $params |
|
463 | + * |
|
464 | + * @throws MissingParameterException if a required parameter is missing |
|
465 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
466 | + * @throws ClientResponseException if the status code of response is 4xx |
|
467 | + * @throws ServerResponseException if the status code of response is 5xx |
|
468 | + * |
|
469 | + * @return Elasticsearch|Promise |
|
470 | + */ |
|
471 | + public function createServiceToken(array $params = []) |
|
472 | + { |
|
473 | + $this->checkRequiredParameters(['namespace', 'service'], $params); |
|
474 | + if (isset($params['name'])) { |
|
475 | + $url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']) . '/credential/token/' . $this->encode($params['name']); |
|
476 | + $method = 'PUT'; |
|
477 | + } else { |
|
478 | + $url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']) . '/credential/token'; |
|
479 | + $method = 'POST'; |
|
480 | + } |
|
481 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
482 | + $headers = ['Accept' => 'application/json']; |
|
483 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
484 | + $request = $this->addOtelAttributes($params, ['namespace', 'service', 'name'], $request, 'security.create_service_token'); |
|
485 | + return $this->client->sendRequest($request); |
|
486 | + } |
|
487 | + /** |
|
488 | + * Removes application privileges. |
|
489 | + * |
|
490 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-privilege.html |
|
491 | + * |
|
492 | + * @param array{ |
|
493 | + * application: string, // (REQUIRED) Application name |
|
494 | + * name: string, // (REQUIRED) Privilege name |
|
495 | + * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
496 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
497 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
498 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
499 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
500 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
501 | + * } $params |
|
502 | + * |
|
503 | + * @throws MissingParameterException if a required parameter is missing |
|
504 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
505 | + * @throws ClientResponseException if the status code of response is 4xx |
|
506 | + * @throws ServerResponseException if the status code of response is 5xx |
|
507 | + * |
|
508 | + * @return Elasticsearch|Promise |
|
509 | + */ |
|
510 | + public function deletePrivileges(array $params = []) |
|
511 | + { |
|
512 | + $this->checkRequiredParameters(['application', 'name'], $params); |
|
513 | + $url = '/_security/privilege/' . $this->encode($params['application']) . '/' . $this->encode($params['name']); |
|
514 | + $method = 'DELETE'; |
|
515 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
516 | + $headers = ['Accept' => 'application/json']; |
|
517 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
518 | + $request = $this->addOtelAttributes($params, ['application', 'name'], $request, 'security.delete_privileges'); |
|
519 | + return $this->client->sendRequest($request); |
|
520 | + } |
|
521 | + /** |
|
522 | + * Removes roles in the native realm. |
|
523 | + * |
|
524 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role.html |
|
525 | + * |
|
526 | + * @param array{ |
|
527 | + * name: string, // (REQUIRED) Role name |
|
528 | + * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
529 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
530 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
531 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
532 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
533 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
534 | + * } $params |
|
535 | + * |
|
536 | + * @throws MissingParameterException if a required parameter is missing |
|
537 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
538 | + * @throws ClientResponseException if the status code of response is 4xx |
|
539 | + * @throws ServerResponseException if the status code of response is 5xx |
|
540 | + * |
|
541 | + * @return Elasticsearch|Promise |
|
542 | + */ |
|
543 | + public function deleteRole(array $params = []) |
|
544 | + { |
|
545 | + $this->checkRequiredParameters(['name'], $params); |
|
546 | + $url = '/_security/role/' . $this->encode($params['name']); |
|
547 | + $method = 'DELETE'; |
|
548 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
549 | + $headers = ['Accept' => 'application/json']; |
|
550 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
551 | + $request = $this->addOtelAttributes($params, ['name'], $request, 'security.delete_role'); |
|
552 | + return $this->client->sendRequest($request); |
|
553 | + } |
|
554 | + /** |
|
555 | + * Removes role mappings. |
|
556 | + * |
|
557 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role-mapping.html |
|
558 | + * |
|
559 | + * @param array{ |
|
560 | + * name: string, // (REQUIRED) Role-mapping name |
|
561 | + * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
562 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
563 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
564 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
565 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
566 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
567 | + * } $params |
|
568 | + * |
|
569 | + * @throws MissingParameterException if a required parameter is missing |
|
570 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
571 | + * @throws ClientResponseException if the status code of response is 4xx |
|
572 | + * @throws ServerResponseException if the status code of response is 5xx |
|
573 | + * |
|
574 | + * @return Elasticsearch|Promise |
|
575 | + */ |
|
576 | + public function deleteRoleMapping(array $params = []) |
|
577 | + { |
|
578 | + $this->checkRequiredParameters(['name'], $params); |
|
579 | + $url = '/_security/role_mapping/' . $this->encode($params['name']); |
|
580 | + $method = 'DELETE'; |
|
581 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
582 | + $headers = ['Accept' => 'application/json']; |
|
583 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
584 | + $request = $this->addOtelAttributes($params, ['name'], $request, 'security.delete_role_mapping'); |
|
585 | + return $this->client->sendRequest($request); |
|
586 | + } |
|
587 | + /** |
|
588 | + * Deletes a service account token. |
|
589 | + * |
|
590 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-service-token.html |
|
591 | + * |
|
592 | + * @param array{ |
|
593 | + * namespace: string, // (REQUIRED) An identifier for the namespace |
|
594 | + * service: string, // (REQUIRED) An identifier for the service name |
|
595 | + * name: string, // (REQUIRED) An identifier for the token name |
|
596 | + * refresh: enum, // If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` (the default) then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
597 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
598 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
599 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
600 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
601 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
602 | + * } $params |
|
603 | + * |
|
604 | + * @throws MissingParameterException if a required parameter is missing |
|
605 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
606 | + * @throws ClientResponseException if the status code of response is 4xx |
|
607 | + * @throws ServerResponseException if the status code of response is 5xx |
|
608 | + * |
|
609 | + * @return Elasticsearch|Promise |
|
610 | + */ |
|
611 | + public function deleteServiceToken(array $params = []) |
|
612 | + { |
|
613 | + $this->checkRequiredParameters(['namespace', 'service', 'name'], $params); |
|
614 | + $url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']) . '/credential/token/' . $this->encode($params['name']); |
|
615 | + $method = 'DELETE'; |
|
616 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
617 | + $headers = ['Accept' => 'application/json']; |
|
618 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
619 | + $request = $this->addOtelAttributes($params, ['namespace', 'service', 'name'], $request, 'security.delete_service_token'); |
|
620 | + return $this->client->sendRequest($request); |
|
621 | + } |
|
622 | + /** |
|
623 | + * Deletes users from the native realm. |
|
624 | + * |
|
625 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-user.html |
|
626 | + * |
|
627 | + * @param array{ |
|
628 | + * username: string, // (REQUIRED) username |
|
629 | + * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
630 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
631 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
632 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
633 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
634 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
635 | + * } $params |
|
636 | + * |
|
637 | + * @throws MissingParameterException if a required parameter is missing |
|
638 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
639 | + * @throws ClientResponseException if the status code of response is 4xx |
|
640 | + * @throws ServerResponseException if the status code of response is 5xx |
|
641 | + * |
|
642 | + * @return Elasticsearch|Promise |
|
643 | + */ |
|
644 | + public function deleteUser(array $params = []) |
|
645 | + { |
|
646 | + $this->checkRequiredParameters(['username'], $params); |
|
647 | + $url = '/_security/user/' . $this->encode($params['username']); |
|
648 | + $method = 'DELETE'; |
|
649 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
650 | + $headers = ['Accept' => 'application/json']; |
|
651 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
652 | + $request = $this->addOtelAttributes($params, ['username'], $request, 'security.delete_user'); |
|
653 | + return $this->client->sendRequest($request); |
|
654 | + } |
|
655 | + /** |
|
656 | + * Disables users in the native realm. |
|
657 | + * |
|
658 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-disable-user.html |
|
659 | + * |
|
660 | + * @param array{ |
|
661 | + * username: string, // (REQUIRED) The username of the user to disable |
|
662 | + * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
663 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
664 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
665 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
666 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
667 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
668 | + * } $params |
|
669 | + * |
|
670 | + * @throws MissingParameterException if a required parameter is missing |
|
671 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
672 | + * @throws ClientResponseException if the status code of response is 4xx |
|
673 | + * @throws ServerResponseException if the status code of response is 5xx |
|
674 | + * |
|
675 | + * @return Elasticsearch|Promise |
|
676 | + */ |
|
677 | + public function disableUser(array $params = []) |
|
678 | + { |
|
679 | + $this->checkRequiredParameters(['username'], $params); |
|
680 | + $url = '/_security/user/' . $this->encode($params['username']) . '/_disable'; |
|
681 | + $method = 'PUT'; |
|
682 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
683 | + $headers = ['Accept' => 'application/json']; |
|
684 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
685 | + $request = $this->addOtelAttributes($params, ['username'], $request, 'security.disable_user'); |
|
686 | + return $this->client->sendRequest($request); |
|
687 | + } |
|
688 | + /** |
|
689 | + * Disables a user profile so it's not visible in user profile searches. |
|
690 | + * |
|
691 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-disable-user-profile.html |
|
692 | + * |
|
693 | + * @param array{ |
|
694 | + * uid: string, // (REQUIRED) Unique identifier for the user profile |
|
695 | + * refresh: enum, // If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` (the default) then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
696 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
697 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
698 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
699 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
700 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
701 | + * } $params |
|
702 | + * |
|
703 | + * @throws MissingParameterException if a required parameter is missing |
|
704 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
705 | + * @throws ClientResponseException if the status code of response is 4xx |
|
706 | + * @throws ServerResponseException if the status code of response is 5xx |
|
707 | + * |
|
708 | + * @return Elasticsearch|Promise |
|
709 | + */ |
|
710 | + public function disableUserProfile(array $params = []) |
|
711 | + { |
|
712 | + $this->checkRequiredParameters(['uid'], $params); |
|
713 | + $url = '/_security/profile/' . $this->encode($params['uid']) . '/_disable'; |
|
714 | + $method = 'PUT'; |
|
715 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
716 | + $headers = ['Accept' => 'application/json']; |
|
717 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
718 | + $request = $this->addOtelAttributes($params, ['uid'], $request, 'security.disable_user_profile'); |
|
719 | + return $this->client->sendRequest($request); |
|
720 | + } |
|
721 | + /** |
|
722 | + * Enables users in the native realm. |
|
723 | + * |
|
724 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-enable-user.html |
|
725 | + * |
|
726 | + * @param array{ |
|
727 | + * username: string, // (REQUIRED) The username of the user to enable |
|
728 | + * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
729 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
730 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
731 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
732 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
733 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
734 | + * } $params |
|
735 | + * |
|
736 | + * @throws MissingParameterException if a required parameter is missing |
|
737 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
738 | + * @throws ClientResponseException if the status code of response is 4xx |
|
739 | + * @throws ServerResponseException if the status code of response is 5xx |
|
740 | + * |
|
741 | + * @return Elasticsearch|Promise |
|
742 | + */ |
|
743 | + public function enableUser(array $params = []) |
|
744 | + { |
|
745 | + $this->checkRequiredParameters(['username'], $params); |
|
746 | + $url = '/_security/user/' . $this->encode($params['username']) . '/_enable'; |
|
747 | + $method = 'PUT'; |
|
748 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
749 | + $headers = ['Accept' => 'application/json']; |
|
750 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
751 | + $request = $this->addOtelAttributes($params, ['username'], $request, 'security.enable_user'); |
|
752 | + return $this->client->sendRequest($request); |
|
753 | + } |
|
754 | + /** |
|
755 | + * Enables a user profile so it's visible in user profile searches. |
|
756 | + * |
|
757 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-enable-user-profile.html |
|
758 | + * |
|
759 | + * @param array{ |
|
760 | + * uid: string, // (REQUIRED) An unique identifier of the user profile |
|
761 | + * refresh: enum, // If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` (the default) then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
762 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
763 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
764 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
765 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
766 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
767 | + * } $params |
|
768 | + * |
|
769 | + * @throws MissingParameterException if a required parameter is missing |
|
770 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
771 | + * @throws ClientResponseException if the status code of response is 4xx |
|
772 | + * @throws ServerResponseException if the status code of response is 5xx |
|
773 | + * |
|
774 | + * @return Elasticsearch|Promise |
|
775 | + */ |
|
776 | + public function enableUserProfile(array $params = []) |
|
777 | + { |
|
778 | + $this->checkRequiredParameters(['uid'], $params); |
|
779 | + $url = '/_security/profile/' . $this->encode($params['uid']) . '/_enable'; |
|
780 | + $method = 'PUT'; |
|
781 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
782 | + $headers = ['Accept' => 'application/json']; |
|
783 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
784 | + $request = $this->addOtelAttributes($params, ['uid'], $request, 'security.enable_user_profile'); |
|
785 | + return $this->client->sendRequest($request); |
|
786 | + } |
|
787 | + /** |
|
788 | + * Allows a kibana instance to configure itself to communicate with a secured elasticsearch cluster. |
|
789 | + * |
|
790 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-kibana-enrollment.html |
|
791 | + * |
|
792 | + * @param array{ |
|
793 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
794 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
795 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
796 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
797 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
798 | + * } $params |
|
799 | + * |
|
800 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
801 | + * @throws ClientResponseException if the status code of response is 4xx |
|
802 | + * @throws ServerResponseException if the status code of response is 5xx |
|
803 | + * |
|
804 | + * @return Elasticsearch|Promise |
|
805 | + */ |
|
806 | + public function enrollKibana(array $params = []) |
|
807 | + { |
|
808 | + $url = '/_security/enroll/kibana'; |
|
809 | + $method = 'GET'; |
|
810 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
811 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
812 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
813 | + $request = $this->addOtelAttributes($params, [], $request, 'security.enroll_kibana'); |
|
814 | + return $this->client->sendRequest($request); |
|
815 | + } |
|
816 | + /** |
|
817 | + * Allows a new node to enroll to an existing cluster with security enabled. |
|
818 | + * |
|
819 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-node-enrollment.html |
|
820 | + * |
|
821 | + * @param array{ |
|
822 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
823 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
824 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
825 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
826 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
827 | + * } $params |
|
828 | + * |
|
829 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
830 | + * @throws ClientResponseException if the status code of response is 4xx |
|
831 | + * @throws ServerResponseException if the status code of response is 5xx |
|
832 | + * |
|
833 | + * @return Elasticsearch|Promise |
|
834 | + */ |
|
835 | + public function enrollNode(array $params = []) |
|
836 | + { |
|
837 | + $url = '/_security/enroll/node'; |
|
838 | + $method = 'GET'; |
|
839 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
840 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
841 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
842 | + $request = $this->addOtelAttributes($params, [], $request, 'security.enroll_node'); |
|
843 | + return $this->client->sendRequest($request); |
|
844 | + } |
|
845 | + /** |
|
846 | + * Retrieves information for one or more API keys. |
|
847 | + * |
|
848 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-api-key.html |
|
849 | + * |
|
850 | + * @param array{ |
|
851 | + * id: string, // API key id of the API key to be retrieved |
|
852 | + * name: string, // API key name of the API key to be retrieved |
|
853 | + * username: string, // user name of the user who created this API key to be retrieved |
|
854 | + * realm_name: string, // realm name of the user who created this API key to be retrieved |
|
855 | + * owner: boolean, // flag to query API keys owned by the currently authenticated user |
|
856 | + * with_limited_by: boolean, // flag to show the limited-by role descriptors of API Keys |
|
857 | + * with_profile_uid: boolean, // flag to also retrieve the API Key's owner profile uid, if it exists |
|
858 | + * active_only: boolean, // flag to limit response to only active (not invalidated or expired) API keys |
|
859 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
860 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
861 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
862 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
863 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
864 | + * } $params |
|
865 | + * |
|
866 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
867 | + * @throws ClientResponseException if the status code of response is 4xx |
|
868 | + * @throws ServerResponseException if the status code of response is 5xx |
|
869 | + * |
|
870 | + * @return Elasticsearch|Promise |
|
871 | + */ |
|
872 | + public function getApiKey(array $params = []) |
|
873 | + { |
|
874 | + $url = '/_security/api_key'; |
|
875 | + $method = 'GET'; |
|
876 | + $url = $this->addQueryString($url, $params, ['id', 'name', 'username', 'realm_name', 'owner', 'with_limited_by', 'with_profile_uid', 'active_only', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
877 | + $headers = ['Accept' => 'application/json']; |
|
878 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
879 | + $request = $this->addOtelAttributes($params, [], $request, 'security.get_api_key'); |
|
880 | + return $this->client->sendRequest($request); |
|
881 | + } |
|
882 | + /** |
|
883 | + * Retrieves the list of cluster privileges and index privileges that are available in this version of Elasticsearch. |
|
884 | + * |
|
885 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-builtin-privileges.html |
|
886 | + * |
|
887 | + * @param array{ |
|
888 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
889 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
890 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
891 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
892 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
893 | + * } $params |
|
894 | + * |
|
895 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
896 | + * @throws ClientResponseException if the status code of response is 4xx |
|
897 | + * @throws ServerResponseException if the status code of response is 5xx |
|
898 | + * |
|
899 | + * @return Elasticsearch|Promise |
|
900 | + */ |
|
901 | + public function getBuiltinPrivileges(array $params = []) |
|
902 | + { |
|
903 | + $url = '/_security/privilege/_builtin'; |
|
904 | + $method = 'GET'; |
|
905 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
906 | + $headers = ['Accept' => 'application/json']; |
|
907 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
908 | + $request = $this->addOtelAttributes($params, [], $request, 'security.get_builtin_privileges'); |
|
909 | + return $this->client->sendRequest($request); |
|
910 | + } |
|
911 | + /** |
|
912 | + * Retrieves application privileges. |
|
913 | + * |
|
914 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-privileges.html |
|
915 | + * |
|
916 | + * @param array{ |
|
917 | + * application: string, // Application name |
|
918 | + * name: string, // Privilege name |
|
919 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
920 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
921 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
922 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
923 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
924 | + * } $params |
|
925 | + * |
|
926 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
927 | + * @throws ClientResponseException if the status code of response is 4xx |
|
928 | + * @throws ServerResponseException if the status code of response is 5xx |
|
929 | + * |
|
930 | + * @return Elasticsearch|Promise |
|
931 | + */ |
|
932 | + public function getPrivileges(array $params = []) |
|
933 | + { |
|
934 | + if (isset($params['application']) && isset($params['name'])) { |
|
935 | + $url = '/_security/privilege/' . $this->encode($params['application']) . '/' . $this->encode($params['name']); |
|
936 | + $method = 'GET'; |
|
937 | + } elseif (isset($params['application'])) { |
|
938 | + $url = '/_security/privilege/' . $this->encode($params['application']); |
|
939 | + $method = 'GET'; |
|
940 | + } else { |
|
941 | + $url = '/_security/privilege'; |
|
942 | + $method = 'GET'; |
|
943 | + } |
|
944 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
945 | + $headers = ['Accept' => 'application/json']; |
|
946 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
947 | + $request = $this->addOtelAttributes($params, ['application', 'name'], $request, 'security.get_privileges'); |
|
948 | + return $this->client->sendRequest($request); |
|
949 | + } |
|
950 | + /** |
|
951 | + * Retrieves roles in the native realm. |
|
952 | + * |
|
953 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role.html |
|
954 | + * |
|
955 | + * @param array{ |
|
956 | + * name: list, // A comma-separated list of role names |
|
957 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
958 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
959 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
960 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
961 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
962 | + * } $params |
|
963 | + * |
|
964 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
965 | + * @throws ClientResponseException if the status code of response is 4xx |
|
966 | + * @throws ServerResponseException if the status code of response is 5xx |
|
967 | + * |
|
968 | + * @return Elasticsearch|Promise |
|
969 | + */ |
|
970 | + public function getRole(array $params = []) |
|
971 | + { |
|
972 | + if (isset($params['name'])) { |
|
973 | + $url = '/_security/role/' . $this->encode($params['name']); |
|
974 | + $method = 'GET'; |
|
975 | + } else { |
|
976 | + $url = '/_security/role'; |
|
977 | + $method = 'GET'; |
|
978 | + } |
|
979 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
980 | + $headers = ['Accept' => 'application/json']; |
|
981 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
982 | + $request = $this->addOtelAttributes($params, ['name'], $request, 'security.get_role'); |
|
983 | + return $this->client->sendRequest($request); |
|
984 | + } |
|
985 | + /** |
|
986 | + * Retrieves role mappings. |
|
987 | + * |
|
988 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role-mapping.html |
|
989 | + * |
|
990 | + * @param array{ |
|
991 | + * name: list, // A comma-separated list of role-mapping names |
|
992 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
993 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
994 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
995 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
996 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
997 | + * } $params |
|
998 | + * |
|
999 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1000 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1001 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1002 | + * |
|
1003 | + * @return Elasticsearch|Promise |
|
1004 | + */ |
|
1005 | + public function getRoleMapping(array $params = []) |
|
1006 | + { |
|
1007 | + if (isset($params['name'])) { |
|
1008 | + $url = '/_security/role_mapping/' . $this->encode($params['name']); |
|
1009 | + $method = 'GET'; |
|
1010 | + } else { |
|
1011 | + $url = '/_security/role_mapping'; |
|
1012 | + $method = 'GET'; |
|
1013 | + } |
|
1014 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1015 | + $headers = ['Accept' => 'application/json']; |
|
1016 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1017 | + $request = $this->addOtelAttributes($params, ['name'], $request, 'security.get_role_mapping'); |
|
1018 | + return $this->client->sendRequest($request); |
|
1019 | + } |
|
1020 | + /** |
|
1021 | + * Retrieves information about service accounts. |
|
1022 | + * |
|
1023 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-service-accounts.html |
|
1024 | + * |
|
1025 | + * @param array{ |
|
1026 | + * namespace: string, // An identifier for the namespace |
|
1027 | + * service: string, // An identifier for the service name |
|
1028 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1029 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1030 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1031 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1032 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1033 | + * } $params |
|
1034 | + * |
|
1035 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1036 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1037 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1038 | + * |
|
1039 | + * @return Elasticsearch|Promise |
|
1040 | + */ |
|
1041 | + public function getServiceAccounts(array $params = []) |
|
1042 | + { |
|
1043 | + if (isset($params['namespace']) && isset($params['service'])) { |
|
1044 | + $url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']); |
|
1045 | + $method = 'GET'; |
|
1046 | + } elseif (isset($params['namespace'])) { |
|
1047 | + $url = '/_security/service/' . $this->encode($params['namespace']); |
|
1048 | + $method = 'GET'; |
|
1049 | + } else { |
|
1050 | + $url = '/_security/service'; |
|
1051 | + $method = 'GET'; |
|
1052 | + } |
|
1053 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1054 | + $headers = ['Accept' => 'application/json']; |
|
1055 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1056 | + $request = $this->addOtelAttributes($params, ['namespace', 'service'], $request, 'security.get_service_accounts'); |
|
1057 | + return $this->client->sendRequest($request); |
|
1058 | + } |
|
1059 | + /** |
|
1060 | + * Retrieves information of all service credentials for a service account. |
|
1061 | + * |
|
1062 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-service-credentials.html |
|
1063 | + * |
|
1064 | + * @param array{ |
|
1065 | + * namespace: string, // (REQUIRED) An identifier for the namespace |
|
1066 | + * service: string, // (REQUIRED) An identifier for the service name |
|
1067 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1068 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1069 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1070 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1071 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1072 | + * } $params |
|
1073 | + * |
|
1074 | + * @throws MissingParameterException if a required parameter is missing |
|
1075 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1076 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1077 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1078 | + * |
|
1079 | + * @return Elasticsearch|Promise |
|
1080 | + */ |
|
1081 | + public function getServiceCredentials(array $params = []) |
|
1082 | + { |
|
1083 | + $this->checkRequiredParameters(['namespace', 'service'], $params); |
|
1084 | + $url = '/_security/service/' . $this->encode($params['namespace']) . '/' . $this->encode($params['service']) . '/credential'; |
|
1085 | + $method = 'GET'; |
|
1086 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1087 | + $headers = ['Accept' => 'application/json']; |
|
1088 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1089 | + $request = $this->addOtelAttributes($params, ['namespace', 'service'], $request, 'security.get_service_credentials'); |
|
1090 | + return $this->client->sendRequest($request); |
|
1091 | + } |
|
1092 | + /** |
|
1093 | + * Retrieve settings for the security system indices |
|
1094 | + * |
|
1095 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-settings.html |
|
1096 | + * |
|
1097 | + * @param array{ |
|
1098 | + * master_timeout: time, // Timeout for connection to master |
|
1099 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1100 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1101 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1102 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1103 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1104 | + * } $params |
|
1105 | + * |
|
1106 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1107 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1108 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1109 | + * |
|
1110 | + * @return Elasticsearch|Promise |
|
1111 | + */ |
|
1112 | + public function getSettings(array $params = []) |
|
1113 | + { |
|
1114 | + $url = '/_security/settings'; |
|
1115 | + $method = 'GET'; |
|
1116 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1117 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1118 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1119 | + $request = $this->addOtelAttributes($params, [], $request, 'security.get_settings'); |
|
1120 | + return $this->client->sendRequest($request); |
|
1121 | + } |
|
1122 | + /** |
|
1123 | + * Creates a bearer token for access without requiring basic authentication. |
|
1124 | + * |
|
1125 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-token.html |
|
1126 | + * |
|
1127 | + * @param array{ |
|
1128 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1129 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1130 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1131 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1132 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1133 | + * body: array, // (REQUIRED) The token request to get |
|
1134 | + * } $params |
|
1135 | + * |
|
1136 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1137 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1138 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1139 | + * |
|
1140 | + * @return Elasticsearch|Promise |
|
1141 | + */ |
|
1142 | + public function getToken(array $params = []) |
|
1143 | + { |
|
1144 | + $this->checkRequiredParameters(['body'], $params); |
|
1145 | + $url = '/_security/oauth2/token'; |
|
1146 | + $method = 'POST'; |
|
1147 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1148 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1149 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1150 | + $request = $this->addOtelAttributes($params, [], $request, 'security.get_token'); |
|
1151 | + return $this->client->sendRequest($request); |
|
1152 | + } |
|
1153 | + /** |
|
1154 | + * Retrieves information about users in the native realm and built-in users. |
|
1155 | + * |
|
1156 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user.html |
|
1157 | + * |
|
1158 | + * @param array{ |
|
1159 | + * username: list, // A comma-separated list of usernames |
|
1160 | + * with_profile_uid: boolean, // flag to retrieve profile uid (if exists) associated to the user |
|
1161 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1162 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1163 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1164 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1165 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1166 | + * } $params |
|
1167 | + * |
|
1168 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1169 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1170 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1171 | + * |
|
1172 | + * @return Elasticsearch|Promise |
|
1173 | + */ |
|
1174 | + public function getUser(array $params = []) |
|
1175 | + { |
|
1176 | + if (isset($params['username'])) { |
|
1177 | + $url = '/_security/user/' . $this->encode($params['username']); |
|
1178 | + $method = 'GET'; |
|
1179 | + } else { |
|
1180 | + $url = '/_security/user'; |
|
1181 | + $method = 'GET'; |
|
1182 | + } |
|
1183 | + $url = $this->addQueryString($url, $params, ['with_profile_uid', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1184 | + $headers = ['Accept' => 'application/json']; |
|
1185 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1186 | + $request = $this->addOtelAttributes($params, ['username'], $request, 'security.get_user'); |
|
1187 | + return $this->client->sendRequest($request); |
|
1188 | + } |
|
1189 | + /** |
|
1190 | + * Retrieves security privileges for the logged in user. |
|
1191 | + * |
|
1192 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user-privileges.html |
|
1193 | + * |
|
1194 | + * @param array{ |
|
1195 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1196 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1197 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1198 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1199 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1200 | + * } $params |
|
1201 | + * |
|
1202 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1203 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1204 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1205 | + * |
|
1206 | + * @return Elasticsearch|Promise |
|
1207 | + */ |
|
1208 | + public function getUserPrivileges(array $params = []) |
|
1209 | + { |
|
1210 | + $url = '/_security/user/_privileges'; |
|
1211 | + $method = 'GET'; |
|
1212 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1213 | + $headers = ['Accept' => 'application/json']; |
|
1214 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1215 | + $request = $this->addOtelAttributes($params, [], $request, 'security.get_user_privileges'); |
|
1216 | + return $this->client->sendRequest($request); |
|
1217 | + } |
|
1218 | + /** |
|
1219 | + * Retrieves user profiles for the given unique ID(s). |
|
1220 | + * |
|
1221 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user-profile.html |
|
1222 | + * |
|
1223 | + * @param array{ |
|
1224 | + * uid: list, // (REQUIRED) A comma-separated list of unique identifier for user profiles |
|
1225 | + * data: list, // A comma-separated list of keys for which the corresponding application data are retrieved. |
|
1226 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1227 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1228 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1229 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1230 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1231 | + * } $params |
|
1232 | + * |
|
1233 | + * @throws MissingParameterException if a required parameter is missing |
|
1234 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1235 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1236 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1237 | + * |
|
1238 | + * @return Elasticsearch|Promise |
|
1239 | + */ |
|
1240 | + public function getUserProfile(array $params = []) |
|
1241 | + { |
|
1242 | + $this->checkRequiredParameters(['uid'], $params); |
|
1243 | + $url = '/_security/profile/' . $this->encode($params['uid']); |
|
1244 | + $method = 'GET'; |
|
1245 | + $url = $this->addQueryString($url, $params, ['data', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1246 | + $headers = ['Accept' => 'application/json']; |
|
1247 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1248 | + $request = $this->addOtelAttributes($params, ['uid'], $request, 'security.get_user_profile'); |
|
1249 | + return $this->client->sendRequest($request); |
|
1250 | + } |
|
1251 | + /** |
|
1252 | + * Creates an API key on behalf of another user. |
|
1253 | + * |
|
1254 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-grant-api-key.html |
|
1255 | + * |
|
1256 | + * @param array{ |
|
1257 | + * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
1258 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1259 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1260 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1261 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1262 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1263 | + * body: array, // (REQUIRED) The api key request to create an API key |
|
1264 | + * } $params |
|
1265 | + * |
|
1266 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1267 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1268 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1269 | + * |
|
1270 | + * @return Elasticsearch|Promise |
|
1271 | + */ |
|
1272 | + public function grantApiKey(array $params = []) |
|
1273 | + { |
|
1274 | + $this->checkRequiredParameters(['body'], $params); |
|
1275 | + $url = '/_security/api_key/grant'; |
|
1276 | + $method = 'POST'; |
|
1277 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1278 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1279 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1280 | + $request = $this->addOtelAttributes($params, [], $request, 'security.grant_api_key'); |
|
1281 | + return $this->client->sendRequest($request); |
|
1282 | + } |
|
1283 | + /** |
|
1284 | + * Determines whether the specified user has a specified list of privileges. |
|
1285 | + * |
|
1286 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges.html |
|
1287 | + * |
|
1288 | + * @param array{ |
|
1289 | + * user: string, // Username |
|
1290 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1291 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1292 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1293 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1294 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1295 | + * body: array, // (REQUIRED) The privileges to test |
|
1296 | + * } $params |
|
1297 | + * |
|
1298 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1299 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1300 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1301 | + * |
|
1302 | + * @return Elasticsearch|Promise |
|
1303 | + */ |
|
1304 | + public function hasPrivileges(array $params = []) |
|
1305 | + { |
|
1306 | + $this->checkRequiredParameters(['body'], $params); |
|
1307 | + if (isset($params['user'])) { |
|
1308 | + $url = '/_security/user/' . $this->encode($params['user']) . '/_has_privileges'; |
|
1309 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
1310 | + } else { |
|
1311 | + $url = '/_security/user/_has_privileges'; |
|
1312 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
1313 | + } |
|
1314 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1315 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1316 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1317 | + $request = $this->addOtelAttributes($params, ['user'], $request, 'security.has_privileges'); |
|
1318 | + return $this->client->sendRequest($request); |
|
1319 | + } |
|
1320 | + /** |
|
1321 | + * Determines whether the users associated with the specified profile IDs have all the requested privileges. |
|
1322 | + * |
|
1323 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges-user-profile.html |
|
1324 | + * |
|
1325 | + * @param array{ |
|
1326 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1327 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1328 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1329 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1330 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1331 | + * body: array, // (REQUIRED) The privileges to check and the list of profile IDs |
|
1332 | + * } $params |
|
1333 | + * |
|
1334 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1335 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1336 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1337 | + * |
|
1338 | + * @return Elasticsearch|Promise |
|
1339 | + */ |
|
1340 | + public function hasPrivilegesUserProfile(array $params = []) |
|
1341 | + { |
|
1342 | + $this->checkRequiredParameters(['body'], $params); |
|
1343 | + $url = '/_security/profile/_has_privileges'; |
|
1344 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
1345 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1346 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1347 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1348 | + $request = $this->addOtelAttributes($params, [], $request, 'security.has_privileges_user_profile'); |
|
1349 | + return $this->client->sendRequest($request); |
|
1350 | + } |
|
1351 | + /** |
|
1352 | + * Invalidates one or more API keys. |
|
1353 | + * |
|
1354 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-api-key.html |
|
1355 | + * |
|
1356 | + * @param array{ |
|
1357 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1358 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1359 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1360 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1361 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1362 | + * body: array, // (REQUIRED) The api key request to invalidate API key(s) |
|
1363 | + * } $params |
|
1364 | + * |
|
1365 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1366 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1367 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1368 | + * |
|
1369 | + * @return Elasticsearch|Promise |
|
1370 | + */ |
|
1371 | + public function invalidateApiKey(array $params = []) |
|
1372 | + { |
|
1373 | + $this->checkRequiredParameters(['body'], $params); |
|
1374 | + $url = '/_security/api_key'; |
|
1375 | + $method = 'DELETE'; |
|
1376 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1377 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1378 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1379 | + $request = $this->addOtelAttributes($params, [], $request, 'security.invalidate_api_key'); |
|
1380 | + return $this->client->sendRequest($request); |
|
1381 | + } |
|
1382 | + /** |
|
1383 | + * Invalidates one or more access tokens or refresh tokens. |
|
1384 | + * |
|
1385 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-token.html |
|
1386 | + * |
|
1387 | + * @param array{ |
|
1388 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1389 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1390 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1391 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1392 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1393 | + * body: array, // (REQUIRED) The token to invalidate |
|
1394 | + * } $params |
|
1395 | + * |
|
1396 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1397 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1398 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1399 | + * |
|
1400 | + * @return Elasticsearch|Promise |
|
1401 | + */ |
|
1402 | + public function invalidateToken(array $params = []) |
|
1403 | + { |
|
1404 | + $this->checkRequiredParameters(['body'], $params); |
|
1405 | + $url = '/_security/oauth2/token'; |
|
1406 | + $method = 'DELETE'; |
|
1407 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1408 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1409 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1410 | + $request = $this->addOtelAttributes($params, [], $request, 'security.invalidate_token'); |
|
1411 | + return $this->client->sendRequest($request); |
|
1412 | + } |
|
1413 | + /** |
|
1414 | + * Exchanges an OpenID Connection authentication response message for an Elasticsearch access token and refresh token pair |
|
1415 | + * |
|
1416 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-oidc-authenticate.html |
|
1417 | + * |
|
1418 | + * @param array{ |
|
1419 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1420 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1421 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1422 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1423 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1424 | + * body: array, // (REQUIRED) The OpenID Connect response to authenticate |
|
1425 | + * } $params |
|
1426 | + * |
|
1427 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1428 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1429 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1430 | + * |
|
1431 | + * @return Elasticsearch|Promise |
|
1432 | + */ |
|
1433 | + public function oidcAuthenticate(array $params = []) |
|
1434 | + { |
|
1435 | + $this->checkRequiredParameters(['body'], $params); |
|
1436 | + $url = '/_security/oidc/authenticate'; |
|
1437 | + $method = 'POST'; |
|
1438 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1439 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1440 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1441 | + $request = $this->addOtelAttributes($params, [], $request, 'security.oidc_authenticate'); |
|
1442 | + return $this->client->sendRequest($request); |
|
1443 | + } |
|
1444 | + /** |
|
1445 | + * Invalidates a refresh token and access token that was generated from the OpenID Connect Authenticate API |
|
1446 | + * |
|
1447 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-oidc-logout.html |
|
1448 | + * |
|
1449 | + * @param array{ |
|
1450 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1451 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1452 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1453 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1454 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1455 | + * body: array, // (REQUIRED) Access token and refresh token to invalidate |
|
1456 | + * } $params |
|
1457 | + * |
|
1458 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1459 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1460 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1461 | + * |
|
1462 | + * @return Elasticsearch|Promise |
|
1463 | + */ |
|
1464 | + public function oidcLogout(array $params = []) |
|
1465 | + { |
|
1466 | + $this->checkRequiredParameters(['body'], $params); |
|
1467 | + $url = '/_security/oidc/logout'; |
|
1468 | + $method = 'POST'; |
|
1469 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1470 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1471 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1472 | + $request = $this->addOtelAttributes($params, [], $request, 'security.oidc_logout'); |
|
1473 | + return $this->client->sendRequest($request); |
|
1474 | + } |
|
1475 | + /** |
|
1476 | + * Creates an OAuth 2.0 authentication request as a URL string |
|
1477 | + * |
|
1478 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-oidc-prepare-authentication.html |
|
1479 | + * |
|
1480 | + * @param array{ |
|
1481 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1482 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1483 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1484 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1485 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1486 | + * body: array, // (REQUIRED) The OpenID Connect authentication realm configuration |
|
1487 | + * } $params |
|
1488 | + * |
|
1489 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1490 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1491 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1492 | + * |
|
1493 | + * @return Elasticsearch|Promise |
|
1494 | + */ |
|
1495 | + public function oidcPrepareAuthentication(array $params = []) |
|
1496 | + { |
|
1497 | + $this->checkRequiredParameters(['body'], $params); |
|
1498 | + $url = '/_security/oidc/prepare'; |
|
1499 | + $method = 'POST'; |
|
1500 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1501 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1502 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1503 | + $request = $this->addOtelAttributes($params, [], $request, 'security.oidc_prepare_authentication'); |
|
1504 | + return $this->client->sendRequest($request); |
|
1505 | + } |
|
1506 | + /** |
|
1507 | + * Adds or updates application privileges. |
|
1508 | + * |
|
1509 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-privileges.html |
|
1510 | + * |
|
1511 | + * @param array{ |
|
1512 | + * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
1513 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1514 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1515 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1516 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1517 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1518 | + * body: array, // (REQUIRED) The privilege(s) to add |
|
1519 | + * } $params |
|
1520 | + * |
|
1521 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1522 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1523 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1524 | + * |
|
1525 | + * @return Elasticsearch|Promise |
|
1526 | + */ |
|
1527 | + public function putPrivileges(array $params = []) |
|
1528 | + { |
|
1529 | + $this->checkRequiredParameters(['body'], $params); |
|
1530 | + $url = '/_security/privilege'; |
|
1531 | + $method = 'PUT'; |
|
1532 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1533 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1534 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1535 | + $request = $this->addOtelAttributes($params, [], $request, 'security.put_privileges'); |
|
1536 | + return $this->client->sendRequest($request); |
|
1537 | + } |
|
1538 | + /** |
|
1539 | + * Adds and updates roles in the native realm. |
|
1540 | + * |
|
1541 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role.html |
|
1542 | + * |
|
1543 | + * @param array{ |
|
1544 | + * name: string, // (REQUIRED) Role name |
|
1545 | + * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
1546 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1547 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1548 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1549 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1550 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1551 | + * body: array, // (REQUIRED) The role to add |
|
1552 | + * } $params |
|
1553 | + * |
|
1554 | + * @throws MissingParameterException if a required parameter is missing |
|
1555 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1556 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1557 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1558 | + * |
|
1559 | + * @return Elasticsearch|Promise |
|
1560 | + */ |
|
1561 | + public function putRole(array $params = []) |
|
1562 | + { |
|
1563 | + $this->checkRequiredParameters(['name', 'body'], $params); |
|
1564 | + $url = '/_security/role/' . $this->encode($params['name']); |
|
1565 | + $method = 'PUT'; |
|
1566 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1567 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1568 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1569 | + $request = $this->addOtelAttributes($params, ['name'], $request, 'security.put_role'); |
|
1570 | + return $this->client->sendRequest($request); |
|
1571 | + } |
|
1572 | + /** |
|
1573 | + * Creates and updates role mappings. |
|
1574 | + * |
|
1575 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role-mapping.html |
|
1576 | + * |
|
1577 | + * @param array{ |
|
1578 | + * name: string, // (REQUIRED) Role-mapping name |
|
1579 | + * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
1580 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1581 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1582 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1583 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1584 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1585 | + * body: array, // (REQUIRED) The role mapping to add |
|
1586 | + * } $params |
|
1587 | + * |
|
1588 | + * @throws MissingParameterException if a required parameter is missing |
|
1589 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1590 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1591 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1592 | + * |
|
1593 | + * @return Elasticsearch|Promise |
|
1594 | + */ |
|
1595 | + public function putRoleMapping(array $params = []) |
|
1596 | + { |
|
1597 | + $this->checkRequiredParameters(['name', 'body'], $params); |
|
1598 | + $url = '/_security/role_mapping/' . $this->encode($params['name']); |
|
1599 | + $method = 'PUT'; |
|
1600 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1601 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1602 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1603 | + $request = $this->addOtelAttributes($params, ['name'], $request, 'security.put_role_mapping'); |
|
1604 | + return $this->client->sendRequest($request); |
|
1605 | + } |
|
1606 | + /** |
|
1607 | + * Adds and updates users in the native realm. These users are commonly referred to as native users. |
|
1608 | + * |
|
1609 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-user.html |
|
1610 | + * |
|
1611 | + * @param array{ |
|
1612 | + * username: string, // (REQUIRED) The username of the User |
|
1613 | + * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
1614 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1615 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1616 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1617 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1618 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1619 | + * body: array, // (REQUIRED) The user to add |
|
1620 | + * } $params |
|
1621 | + * |
|
1622 | + * @throws MissingParameterException if a required parameter is missing |
|
1623 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1624 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1625 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1626 | + * |
|
1627 | + * @return Elasticsearch|Promise |
|
1628 | + */ |
|
1629 | + public function putUser(array $params = []) |
|
1630 | + { |
|
1631 | + $this->checkRequiredParameters(['username', 'body'], $params); |
|
1632 | + $url = '/_security/user/' . $this->encode($params['username']); |
|
1633 | + $method = 'PUT'; |
|
1634 | + $url = $this->addQueryString($url, $params, ['refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1635 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1636 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1637 | + $request = $this->addOtelAttributes($params, ['username'], $request, 'security.put_user'); |
|
1638 | + return $this->client->sendRequest($request); |
|
1639 | + } |
|
1640 | + /** |
|
1641 | + * Retrieves information for API keys using a subset of query DSL |
|
1642 | + * |
|
1643 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-api-key.html |
|
1644 | + * |
|
1645 | + * @param array{ |
|
1646 | + * with_limited_by: boolean, // flag to show the limited-by role descriptors of API Keys |
|
1647 | + * with_profile_uid: boolean, // flag to also retrieve the API Key's owner profile uid, if it exists |
|
1648 | + * typed_keys: boolean, // flag to prefix aggregation names by their respective types in the response |
|
1649 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1650 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1651 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1652 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1653 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1654 | + * body: array, // From, size, query, sort and search_after |
|
1655 | + * } $params |
|
1656 | + * |
|
1657 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1658 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1659 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1660 | + * |
|
1661 | + * @return Elasticsearch|Promise |
|
1662 | + */ |
|
1663 | + public function queryApiKeys(array $params = []) |
|
1664 | + { |
|
1665 | + $url = '/_security/_query/api_key'; |
|
1666 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
1667 | + $url = $this->addQueryString($url, $params, ['with_limited_by', 'with_profile_uid', 'typed_keys', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1668 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1669 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1670 | + $request = $this->addOtelAttributes($params, [], $request, 'security.query_api_keys'); |
|
1671 | + return $this->client->sendRequest($request); |
|
1672 | + } |
|
1673 | + /** |
|
1674 | + * Retrieves information for Roles using a subset of query DSL |
|
1675 | + * |
|
1676 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-role.html |
|
1677 | + * |
|
1678 | + * @param array{ |
|
1679 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1680 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1681 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1682 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1683 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1684 | + * body: array, // From, size, query, sort and search_after |
|
1685 | + * } $params |
|
1686 | + * |
|
1687 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1688 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1689 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1690 | + * |
|
1691 | + * @return Elasticsearch|Promise |
|
1692 | + */ |
|
1693 | + public function queryRole(array $params = []) |
|
1694 | + { |
|
1695 | + $url = '/_security/_query/role'; |
|
1696 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
1697 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1698 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1699 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1700 | + $request = $this->addOtelAttributes($params, [], $request, 'security.query_role'); |
|
1701 | + return $this->client->sendRequest($request); |
|
1702 | + } |
|
1703 | + /** |
|
1704 | + * Retrieves information for Users using a subset of query DSL |
|
1705 | + * |
|
1706 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-user.html |
|
1707 | + * |
|
1708 | + * @param array{ |
|
1709 | + * with_profile_uid: boolean, // flag to retrieve profile uid (if exists) associated with the user |
|
1710 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1711 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1712 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1713 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1714 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1715 | + * body: array, // From, size, query, sort and search_after |
|
1716 | + * } $params |
|
1717 | + * |
|
1718 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1719 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1720 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1721 | + * |
|
1722 | + * @return Elasticsearch|Promise |
|
1723 | + */ |
|
1724 | + public function queryUser(array $params = []) |
|
1725 | + { |
|
1726 | + $url = '/_security/_query/user'; |
|
1727 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
1728 | + $url = $this->addQueryString($url, $params, ['with_profile_uid', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1729 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1730 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1731 | + $request = $this->addOtelAttributes($params, [], $request, 'security.query_user'); |
|
1732 | + return $this->client->sendRequest($request); |
|
1733 | + } |
|
1734 | + /** |
|
1735 | + * Exchanges a SAML Response message for an Elasticsearch access token and refresh token pair |
|
1736 | + * |
|
1737 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-authenticate.html |
|
1738 | + * |
|
1739 | + * @param array{ |
|
1740 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1741 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1742 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1743 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1744 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1745 | + * body: array, // (REQUIRED) The SAML response to authenticate |
|
1746 | + * } $params |
|
1747 | + * |
|
1748 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1749 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1750 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1751 | + * |
|
1752 | + * @return Elasticsearch|Promise |
|
1753 | + */ |
|
1754 | + public function samlAuthenticate(array $params = []) |
|
1755 | + { |
|
1756 | + $this->checkRequiredParameters(['body'], $params); |
|
1757 | + $url = '/_security/saml/authenticate'; |
|
1758 | + $method = 'POST'; |
|
1759 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1760 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1761 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1762 | + $request = $this->addOtelAttributes($params, [], $request, 'security.saml_authenticate'); |
|
1763 | + return $this->client->sendRequest($request); |
|
1764 | + } |
|
1765 | + /** |
|
1766 | + * Verifies the logout response sent from the SAML IdP |
|
1767 | + * |
|
1768 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-complete-logout.html |
|
1769 | + * |
|
1770 | + * @param array{ |
|
1771 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1772 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1773 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1774 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1775 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1776 | + * body: array, // (REQUIRED) The logout response to verify |
|
1777 | + * } $params |
|
1778 | + * |
|
1779 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1780 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1781 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1782 | + * |
|
1783 | + * @return Elasticsearch|Promise |
|
1784 | + */ |
|
1785 | + public function samlCompleteLogout(array $params = []) |
|
1786 | + { |
|
1787 | + $this->checkRequiredParameters(['body'], $params); |
|
1788 | + $url = '/_security/saml/complete_logout'; |
|
1789 | + $method = 'POST'; |
|
1790 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1791 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1792 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1793 | + $request = $this->addOtelAttributes($params, [], $request, 'security.saml_complete_logout'); |
|
1794 | + return $this->client->sendRequest($request); |
|
1795 | + } |
|
1796 | + /** |
|
1797 | + * Consumes a SAML LogoutRequest |
|
1798 | + * |
|
1799 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-invalidate.html |
|
1800 | + * |
|
1801 | + * @param array{ |
|
1802 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1803 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1804 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1805 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1806 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1807 | + * body: array, // (REQUIRED) The LogoutRequest message |
|
1808 | + * } $params |
|
1809 | + * |
|
1810 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1811 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1812 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1813 | + * |
|
1814 | + * @return Elasticsearch|Promise |
|
1815 | + */ |
|
1816 | + public function samlInvalidate(array $params = []) |
|
1817 | + { |
|
1818 | + $this->checkRequiredParameters(['body'], $params); |
|
1819 | + $url = '/_security/saml/invalidate'; |
|
1820 | + $method = 'POST'; |
|
1821 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1822 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1823 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1824 | + $request = $this->addOtelAttributes($params, [], $request, 'security.saml_invalidate'); |
|
1825 | + return $this->client->sendRequest($request); |
|
1826 | + } |
|
1827 | + /** |
|
1828 | + * Invalidates an access token and a refresh token that were generated via the SAML Authenticate API |
|
1829 | + * |
|
1830 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-logout.html |
|
1831 | + * |
|
1832 | + * @param array{ |
|
1833 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1834 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1835 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1836 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1837 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1838 | + * body: array, // (REQUIRED) The tokens to invalidate |
|
1839 | + * } $params |
|
1840 | + * |
|
1841 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1842 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1843 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1844 | + * |
|
1845 | + * @return Elasticsearch|Promise |
|
1846 | + */ |
|
1847 | + public function samlLogout(array $params = []) |
|
1848 | + { |
|
1849 | + $this->checkRequiredParameters(['body'], $params); |
|
1850 | + $url = '/_security/saml/logout'; |
|
1851 | + $method = 'POST'; |
|
1852 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1853 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1854 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1855 | + $request = $this->addOtelAttributes($params, [], $request, 'security.saml_logout'); |
|
1856 | + return $this->client->sendRequest($request); |
|
1857 | + } |
|
1858 | + /** |
|
1859 | + * Creates a SAML authentication request |
|
1860 | + * |
|
1861 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-prepare-authentication.html |
|
1862 | + * |
|
1863 | + * @param array{ |
|
1864 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1865 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1866 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1867 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1868 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1869 | + * body: array, // (REQUIRED) The realm for which to create the authentication request, identified by either its name or the ACS URL |
|
1870 | + * } $params |
|
1871 | + * |
|
1872 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1873 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1874 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1875 | + * |
|
1876 | + * @return Elasticsearch|Promise |
|
1877 | + */ |
|
1878 | + public function samlPrepareAuthentication(array $params = []) |
|
1879 | + { |
|
1880 | + $this->checkRequiredParameters(['body'], $params); |
|
1881 | + $url = '/_security/saml/prepare'; |
|
1882 | + $method = 'POST'; |
|
1883 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1884 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1885 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1886 | + $request = $this->addOtelAttributes($params, [], $request, 'security.saml_prepare_authentication'); |
|
1887 | + return $this->client->sendRequest($request); |
|
1888 | + } |
|
1889 | + /** |
|
1890 | + * Generates SAML metadata for the Elastic stack SAML 2.0 Service Provider |
|
1891 | + * |
|
1892 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-sp-metadata.html |
|
1893 | + * |
|
1894 | + * @param array{ |
|
1895 | + * realm_name: string, // (REQUIRED) The name of the SAML realm to get the metadata for |
|
1896 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1897 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1898 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1899 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1900 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1901 | + * } $params |
|
1902 | + * |
|
1903 | + * @throws MissingParameterException if a required parameter is missing |
|
1904 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1905 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1906 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1907 | + * |
|
1908 | + * @return Elasticsearch|Promise |
|
1909 | + */ |
|
1910 | + public function samlServiceProviderMetadata(array $params = []) |
|
1911 | + { |
|
1912 | + $this->checkRequiredParameters(['realm_name'], $params); |
|
1913 | + $url = '/_security/saml/metadata/' . $this->encode($params['realm_name']); |
|
1914 | + $method = 'GET'; |
|
1915 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1916 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1917 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1918 | + $request = $this->addOtelAttributes($params, ['realm_name'], $request, 'security.saml_service_provider_metadata'); |
|
1919 | + return $this->client->sendRequest($request); |
|
1920 | + } |
|
1921 | + /** |
|
1922 | + * Get suggestions for user profiles that match specified search criteria. |
|
1923 | + * |
|
1924 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-suggest-user-profile.html |
|
1925 | + * |
|
1926 | + * @param array{ |
|
1927 | + * data: list, // A comma-separated list of keys for which the corresponding application data are retrieved. |
|
1928 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1929 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1930 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1931 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1932 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1933 | + * body: array, // The suggestion definition for user profiles |
|
1934 | + * } $params |
|
1935 | + * |
|
1936 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1937 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1938 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1939 | + * |
|
1940 | + * @return Elasticsearch|Promise |
|
1941 | + */ |
|
1942 | + public function suggestUserProfiles(array $params = []) |
|
1943 | + { |
|
1944 | + $url = '/_security/profile/_suggest'; |
|
1945 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
1946 | + $url = $this->addQueryString($url, $params, ['data', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1947 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1948 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1949 | + $request = $this->addOtelAttributes($params, [], $request, 'security.suggest_user_profiles'); |
|
1950 | + return $this->client->sendRequest($request); |
|
1951 | + } |
|
1952 | + /** |
|
1953 | + * Updates attributes of an existing API key. |
|
1954 | + * |
|
1955 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-api-key.html |
|
1956 | + * |
|
1957 | + * @param array{ |
|
1958 | + * id: string, // (REQUIRED) The ID of the API key to update |
|
1959 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1960 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1961 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1962 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1963 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1964 | + * body: array, // The API key request to update attributes of an API key. |
|
1965 | + * } $params |
|
1966 | + * |
|
1967 | + * @throws MissingParameterException if a required parameter is missing |
|
1968 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
1969 | + * @throws ClientResponseException if the status code of response is 4xx |
|
1970 | + * @throws ServerResponseException if the status code of response is 5xx |
|
1971 | + * |
|
1972 | + * @return Elasticsearch|Promise |
|
1973 | + */ |
|
1974 | + public function updateApiKey(array $params = []) |
|
1975 | + { |
|
1976 | + $this->checkRequiredParameters(['id'], $params); |
|
1977 | + $url = '/_security/api_key/' . $this->encode($params['id']); |
|
1978 | + $method = 'PUT'; |
|
1979 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
1980 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
1981 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
1982 | + $request = $this->addOtelAttributes($params, ['id'], $request, 'security.update_api_key'); |
|
1983 | + return $this->client->sendRequest($request); |
|
1984 | + } |
|
1985 | + /** |
|
1986 | + * Updates attributes of an existing cross-cluster API key. |
|
1987 | + * |
|
1988 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-cross-cluster-api-key.html |
|
1989 | + * |
|
1990 | + * @param array{ |
|
1991 | + * id: string, // (REQUIRED) The ID of the cross-cluster API key to update |
|
1992 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
1993 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
1994 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
1995 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
1996 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
1997 | + * body: array, // (REQUIRED) The request to update attributes of a cross-cluster API key. |
|
1998 | + * } $params |
|
1999 | + * |
|
2000 | + * @throws MissingParameterException if a required parameter is missing |
|
2001 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
2002 | + * @throws ClientResponseException if the status code of response is 4xx |
|
2003 | + * @throws ServerResponseException if the status code of response is 5xx |
|
2004 | + * |
|
2005 | + * @return Elasticsearch|Promise |
|
2006 | + */ |
|
2007 | + public function updateCrossClusterApiKey(array $params = []) |
|
2008 | + { |
|
2009 | + $this->checkRequiredParameters(['id', 'body'], $params); |
|
2010 | + $url = '/_security/cross_cluster/api_key/' . $this->encode($params['id']); |
|
2011 | + $method = 'PUT'; |
|
2012 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
2013 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
2014 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
2015 | + $request = $this->addOtelAttributes($params, ['id'], $request, 'security.update_cross_cluster_api_key'); |
|
2016 | + return $this->client->sendRequest($request); |
|
2017 | + } |
|
2018 | + /** |
|
2019 | + * Update settings for the security system index |
|
2020 | + * |
|
2021 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-settings.html |
|
2022 | + * |
|
2023 | + * @param array{ |
|
2024 | + * master_timeout: time, // Timeout for connection to master |
|
2025 | + * timeout: time, // Timeout for acknowledgements from all nodes |
|
2026 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
2027 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
2028 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
2029 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
2030 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
2031 | + * body: array, // (REQUIRED) An object with the new settings for each index, if any |
|
2032 | + * } $params |
|
2033 | + * |
|
2034 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
2035 | + * @throws ClientResponseException if the status code of response is 4xx |
|
2036 | + * @throws ServerResponseException if the status code of response is 5xx |
|
2037 | + * |
|
2038 | + * @return Elasticsearch|Promise |
|
2039 | + */ |
|
2040 | + public function updateSettings(array $params = []) |
|
2041 | + { |
|
2042 | + $this->checkRequiredParameters(['body'], $params); |
|
2043 | + $url = '/_security/settings'; |
|
2044 | + $method = 'PUT'; |
|
2045 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
2046 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
2047 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
2048 | + $request = $this->addOtelAttributes($params, [], $request, 'security.update_settings'); |
|
2049 | + return $this->client->sendRequest($request); |
|
2050 | + } |
|
2051 | + /** |
|
2052 | + * Update application specific data for the user profile of the given unique ID. |
|
2053 | + * |
|
2054 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-user-profile-data.html |
|
2055 | + * |
|
2056 | + * @param array{ |
|
2057 | + * uid: string, // (REQUIRED) An unique identifier of the user profile |
|
2058 | + * if_seq_no: number, // only perform the update operation if the last operation that has changed the document has the specified sequence number |
|
2059 | + * if_primary_term: number, // only perform the update operation if the last operation that has changed the document has the specified primary term |
|
2060 | + * refresh: enum, // If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. |
|
2061 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
2062 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
2063 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
2064 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
2065 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
2066 | + * body: array, // (REQUIRED) The application data to update |
|
2067 | + * } $params |
|
2068 | + * |
|
2069 | + * @throws MissingParameterException if a required parameter is missing |
|
2070 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
2071 | + * @throws ClientResponseException if the status code of response is 4xx |
|
2072 | + * @throws ServerResponseException if the status code of response is 5xx |
|
2073 | + * |
|
2074 | + * @return Elasticsearch|Promise |
|
2075 | + */ |
|
2076 | + public function updateUserProfileData(array $params = []) |
|
2077 | + { |
|
2078 | + $this->checkRequiredParameters(['uid', 'body'], $params); |
|
2079 | + $url = '/_security/profile/' . $this->encode($params['uid']) . '/_data'; |
|
2080 | + $method = 'PUT'; |
|
2081 | + $url = $this->addQueryString($url, $params, ['if_seq_no', 'if_primary_term', 'refresh', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
2082 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
2083 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
2084 | + $request = $this->addOtelAttributes($params, ['uid'], $request, 'security.update_user_profile_data'); |
|
2085 | + return $this->client->sendRequest($request); |
|
2086 | + } |
|
2087 | 2087 | } |
@@ -25,222 +25,222 @@ |
||
25 | 25 | */ |
26 | 26 | class License extends AbstractEndpoint |
27 | 27 | { |
28 | - /** |
|
29 | - * Deletes licensing information for the cluster |
|
30 | - * |
|
31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-license.html |
|
32 | - * |
|
33 | - * @param array{ |
|
34 | - * master_timeout: time, // Timeout for processing on master node |
|
35 | - * timeout: time, // Timeout for acknowledgement of update from all nodes in cluster |
|
36 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
37 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
38 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
39 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
40 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
41 | - * } $params |
|
42 | - * |
|
43 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
44 | - * @throws ClientResponseException if the status code of response is 4xx |
|
45 | - * @throws ServerResponseException if the status code of response is 5xx |
|
46 | - * |
|
47 | - * @return Elasticsearch|Promise |
|
48 | - */ |
|
49 | - public function delete(array $params = []) |
|
50 | - { |
|
51 | - $url = '/_license'; |
|
52 | - $method = 'DELETE'; |
|
53 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
54 | - $headers = ['Accept' => 'application/json']; |
|
55 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
56 | - $request = $this->addOtelAttributes($params, [], $request, 'license.delete'); |
|
57 | - return $this->client->sendRequest($request); |
|
58 | - } |
|
59 | - /** |
|
60 | - * Retrieves licensing information for the cluster |
|
61 | - * |
|
62 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-license.html |
|
63 | - * |
|
64 | - * @param array{ |
|
65 | - * local: boolean, // Return local information, do not retrieve the state from master node (default: false) |
|
66 | - * accept_enterprise: boolean, // Supported for backwards compatibility with 7.x. If this param is used it must be set to true |
|
67 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
68 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
69 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
70 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
71 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
72 | - * } $params |
|
73 | - * |
|
74 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
75 | - * @throws ClientResponseException if the status code of response is 4xx |
|
76 | - * @throws ServerResponseException if the status code of response is 5xx |
|
77 | - * |
|
78 | - * @return Elasticsearch|Promise |
|
79 | - */ |
|
80 | - public function get(array $params = []) |
|
81 | - { |
|
82 | - $url = '/_license'; |
|
83 | - $method = 'GET'; |
|
84 | - $url = $this->addQueryString($url, $params, ['local', 'accept_enterprise', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
85 | - $headers = ['Accept' => 'application/json']; |
|
86 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
87 | - $request = $this->addOtelAttributes($params, [], $request, 'license.get'); |
|
88 | - return $this->client->sendRequest($request); |
|
89 | - } |
|
90 | - /** |
|
91 | - * Retrieves information about the status of the basic license. |
|
92 | - * |
|
93 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-basic-status.html |
|
94 | - * |
|
95 | - * @param array{ |
|
96 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
97 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
98 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
99 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
100 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
101 | - * } $params |
|
102 | - * |
|
103 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
104 | - * @throws ClientResponseException if the status code of response is 4xx |
|
105 | - * @throws ServerResponseException if the status code of response is 5xx |
|
106 | - * |
|
107 | - * @return Elasticsearch|Promise |
|
108 | - */ |
|
109 | - public function getBasicStatus(array $params = []) |
|
110 | - { |
|
111 | - $url = '/_license/basic_status'; |
|
112 | - $method = 'GET'; |
|
113 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
114 | - $headers = ['Accept' => 'application/json']; |
|
115 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
116 | - $request = $this->addOtelAttributes($params, [], $request, 'license.get_basic_status'); |
|
117 | - return $this->client->sendRequest($request); |
|
118 | - } |
|
119 | - /** |
|
120 | - * Retrieves information about the status of the trial license. |
|
121 | - * |
|
122 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-trial-status.html |
|
123 | - * |
|
124 | - * @param array{ |
|
125 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
126 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
127 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
128 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
129 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
130 | - * } $params |
|
131 | - * |
|
132 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
133 | - * @throws ClientResponseException if the status code of response is 4xx |
|
134 | - * @throws ServerResponseException if the status code of response is 5xx |
|
135 | - * |
|
136 | - * @return Elasticsearch|Promise |
|
137 | - */ |
|
138 | - public function getTrialStatus(array $params = []) |
|
139 | - { |
|
140 | - $url = '/_license/trial_status'; |
|
141 | - $method = 'GET'; |
|
142 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
143 | - $headers = ['Accept' => 'application/json']; |
|
144 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
145 | - $request = $this->addOtelAttributes($params, [], $request, 'license.get_trial_status'); |
|
146 | - return $this->client->sendRequest($request); |
|
147 | - } |
|
148 | - /** |
|
149 | - * Updates the license for the cluster. |
|
150 | - * |
|
151 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-license.html |
|
152 | - * |
|
153 | - * @param array{ |
|
154 | - * acknowledge: boolean, // whether the user has acknowledged acknowledge messages (default: false) |
|
155 | - * master_timeout: time, // Timeout for processing on master node |
|
156 | - * timeout: time, // Timeout for acknowledgement of update from all nodes in cluster |
|
157 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
158 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
159 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
160 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
161 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
162 | - * body: array, // licenses to be installed |
|
163 | - * } $params |
|
164 | - * |
|
165 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
166 | - * @throws ClientResponseException if the status code of response is 4xx |
|
167 | - * @throws ServerResponseException if the status code of response is 5xx |
|
168 | - * |
|
169 | - * @return Elasticsearch|Promise |
|
170 | - */ |
|
171 | - public function post(array $params = []) |
|
172 | - { |
|
173 | - $url = '/_license'; |
|
174 | - $method = 'PUT'; |
|
175 | - $url = $this->addQueryString($url, $params, ['acknowledge', 'master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
176 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
177 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
178 | - $request = $this->addOtelAttributes($params, [], $request, 'license.post'); |
|
179 | - return $this->client->sendRequest($request); |
|
180 | - } |
|
181 | - /** |
|
182 | - * Starts an indefinite basic license. |
|
183 | - * |
|
184 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/start-basic.html |
|
185 | - * |
|
186 | - * @param array{ |
|
187 | - * acknowledge: boolean, // whether the user has acknowledged acknowledge messages (default: false) |
|
188 | - * master_timeout: time, // Timeout for processing on master node |
|
189 | - * timeout: time, // Timeout for acknowledgement of update from all nodes in cluster |
|
190 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
191 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
192 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
193 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
194 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
195 | - * } $params |
|
196 | - * |
|
197 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
198 | - * @throws ClientResponseException if the status code of response is 4xx |
|
199 | - * @throws ServerResponseException if the status code of response is 5xx |
|
200 | - * |
|
201 | - * @return Elasticsearch|Promise |
|
202 | - */ |
|
203 | - public function postStartBasic(array $params = []) |
|
204 | - { |
|
205 | - $url = '/_license/start_basic'; |
|
206 | - $method = 'POST'; |
|
207 | - $url = $this->addQueryString($url, $params, ['acknowledge', 'master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
208 | - $headers = ['Accept' => 'application/json']; |
|
209 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
210 | - $request = $this->addOtelAttributes($params, [], $request, 'license.post_start_basic'); |
|
211 | - return $this->client->sendRequest($request); |
|
212 | - } |
|
213 | - /** |
|
214 | - * starts a limited time trial license. |
|
215 | - * |
|
216 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/start-trial.html |
|
217 | - * |
|
218 | - * @param array{ |
|
219 | - * type: string, // The type of trial license to generate (default: "trial") |
|
220 | - * acknowledge: boolean, // whether the user has acknowledged acknowledge messages (default: false) |
|
221 | - * master_timeout: time, // Timeout for processing on master node |
|
222 | - * timeout: time, // Timeout for acknowledgement of update from all nodes in cluster |
|
223 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
224 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
225 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
226 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
227 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
228 | - * } $params |
|
229 | - * |
|
230 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
231 | - * @throws ClientResponseException if the status code of response is 4xx |
|
232 | - * @throws ServerResponseException if the status code of response is 5xx |
|
233 | - * |
|
234 | - * @return Elasticsearch|Promise |
|
235 | - */ |
|
236 | - public function postStartTrial(array $params = []) |
|
237 | - { |
|
238 | - $url = '/_license/start_trial'; |
|
239 | - $method = 'POST'; |
|
240 | - $url = $this->addQueryString($url, $params, ['type', 'acknowledge', 'master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
241 | - $headers = ['Accept' => 'application/json']; |
|
242 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
243 | - $request = $this->addOtelAttributes($params, [], $request, 'license.post_start_trial'); |
|
244 | - return $this->client->sendRequest($request); |
|
245 | - } |
|
28 | + /** |
|
29 | + * Deletes licensing information for the cluster |
|
30 | + * |
|
31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-license.html |
|
32 | + * |
|
33 | + * @param array{ |
|
34 | + * master_timeout: time, // Timeout for processing on master node |
|
35 | + * timeout: time, // Timeout for acknowledgement of update from all nodes in cluster |
|
36 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
37 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
38 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
39 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
40 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
41 | + * } $params |
|
42 | + * |
|
43 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
44 | + * @throws ClientResponseException if the status code of response is 4xx |
|
45 | + * @throws ServerResponseException if the status code of response is 5xx |
|
46 | + * |
|
47 | + * @return Elasticsearch|Promise |
|
48 | + */ |
|
49 | + public function delete(array $params = []) |
|
50 | + { |
|
51 | + $url = '/_license'; |
|
52 | + $method = 'DELETE'; |
|
53 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
54 | + $headers = ['Accept' => 'application/json']; |
|
55 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
56 | + $request = $this->addOtelAttributes($params, [], $request, 'license.delete'); |
|
57 | + return $this->client->sendRequest($request); |
|
58 | + } |
|
59 | + /** |
|
60 | + * Retrieves licensing information for the cluster |
|
61 | + * |
|
62 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-license.html |
|
63 | + * |
|
64 | + * @param array{ |
|
65 | + * local: boolean, // Return local information, do not retrieve the state from master node (default: false) |
|
66 | + * accept_enterprise: boolean, // Supported for backwards compatibility with 7.x. If this param is used it must be set to true |
|
67 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
68 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
69 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
70 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
71 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
72 | + * } $params |
|
73 | + * |
|
74 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
75 | + * @throws ClientResponseException if the status code of response is 4xx |
|
76 | + * @throws ServerResponseException if the status code of response is 5xx |
|
77 | + * |
|
78 | + * @return Elasticsearch|Promise |
|
79 | + */ |
|
80 | + public function get(array $params = []) |
|
81 | + { |
|
82 | + $url = '/_license'; |
|
83 | + $method = 'GET'; |
|
84 | + $url = $this->addQueryString($url, $params, ['local', 'accept_enterprise', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
85 | + $headers = ['Accept' => 'application/json']; |
|
86 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
87 | + $request = $this->addOtelAttributes($params, [], $request, 'license.get'); |
|
88 | + return $this->client->sendRequest($request); |
|
89 | + } |
|
90 | + /** |
|
91 | + * Retrieves information about the status of the basic license. |
|
92 | + * |
|
93 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-basic-status.html |
|
94 | + * |
|
95 | + * @param array{ |
|
96 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
97 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
98 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
99 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
100 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
101 | + * } $params |
|
102 | + * |
|
103 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
104 | + * @throws ClientResponseException if the status code of response is 4xx |
|
105 | + * @throws ServerResponseException if the status code of response is 5xx |
|
106 | + * |
|
107 | + * @return Elasticsearch|Promise |
|
108 | + */ |
|
109 | + public function getBasicStatus(array $params = []) |
|
110 | + { |
|
111 | + $url = '/_license/basic_status'; |
|
112 | + $method = 'GET'; |
|
113 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
114 | + $headers = ['Accept' => 'application/json']; |
|
115 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
116 | + $request = $this->addOtelAttributes($params, [], $request, 'license.get_basic_status'); |
|
117 | + return $this->client->sendRequest($request); |
|
118 | + } |
|
119 | + /** |
|
120 | + * Retrieves information about the status of the trial license. |
|
121 | + * |
|
122 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-trial-status.html |
|
123 | + * |
|
124 | + * @param array{ |
|
125 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
126 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
127 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
128 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
129 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
130 | + * } $params |
|
131 | + * |
|
132 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
133 | + * @throws ClientResponseException if the status code of response is 4xx |
|
134 | + * @throws ServerResponseException if the status code of response is 5xx |
|
135 | + * |
|
136 | + * @return Elasticsearch|Promise |
|
137 | + */ |
|
138 | + public function getTrialStatus(array $params = []) |
|
139 | + { |
|
140 | + $url = '/_license/trial_status'; |
|
141 | + $method = 'GET'; |
|
142 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
143 | + $headers = ['Accept' => 'application/json']; |
|
144 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
145 | + $request = $this->addOtelAttributes($params, [], $request, 'license.get_trial_status'); |
|
146 | + return $this->client->sendRequest($request); |
|
147 | + } |
|
148 | + /** |
|
149 | + * Updates the license for the cluster. |
|
150 | + * |
|
151 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-license.html |
|
152 | + * |
|
153 | + * @param array{ |
|
154 | + * acknowledge: boolean, // whether the user has acknowledged acknowledge messages (default: false) |
|
155 | + * master_timeout: time, // Timeout for processing on master node |
|
156 | + * timeout: time, // Timeout for acknowledgement of update from all nodes in cluster |
|
157 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
158 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
159 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
160 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
161 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
162 | + * body: array, // licenses to be installed |
|
163 | + * } $params |
|
164 | + * |
|
165 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
166 | + * @throws ClientResponseException if the status code of response is 4xx |
|
167 | + * @throws ServerResponseException if the status code of response is 5xx |
|
168 | + * |
|
169 | + * @return Elasticsearch|Promise |
|
170 | + */ |
|
171 | + public function post(array $params = []) |
|
172 | + { |
|
173 | + $url = '/_license'; |
|
174 | + $method = 'PUT'; |
|
175 | + $url = $this->addQueryString($url, $params, ['acknowledge', 'master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
176 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
177 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
178 | + $request = $this->addOtelAttributes($params, [], $request, 'license.post'); |
|
179 | + return $this->client->sendRequest($request); |
|
180 | + } |
|
181 | + /** |
|
182 | + * Starts an indefinite basic license. |
|
183 | + * |
|
184 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/start-basic.html |
|
185 | + * |
|
186 | + * @param array{ |
|
187 | + * acknowledge: boolean, // whether the user has acknowledged acknowledge messages (default: false) |
|
188 | + * master_timeout: time, // Timeout for processing on master node |
|
189 | + * timeout: time, // Timeout for acknowledgement of update from all nodes in cluster |
|
190 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
191 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
192 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
193 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
194 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
195 | + * } $params |
|
196 | + * |
|
197 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
198 | + * @throws ClientResponseException if the status code of response is 4xx |
|
199 | + * @throws ServerResponseException if the status code of response is 5xx |
|
200 | + * |
|
201 | + * @return Elasticsearch|Promise |
|
202 | + */ |
|
203 | + public function postStartBasic(array $params = []) |
|
204 | + { |
|
205 | + $url = '/_license/start_basic'; |
|
206 | + $method = 'POST'; |
|
207 | + $url = $this->addQueryString($url, $params, ['acknowledge', 'master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
208 | + $headers = ['Accept' => 'application/json']; |
|
209 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
210 | + $request = $this->addOtelAttributes($params, [], $request, 'license.post_start_basic'); |
|
211 | + return $this->client->sendRequest($request); |
|
212 | + } |
|
213 | + /** |
|
214 | + * starts a limited time trial license. |
|
215 | + * |
|
216 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/start-trial.html |
|
217 | + * |
|
218 | + * @param array{ |
|
219 | + * type: string, // The type of trial license to generate (default: "trial") |
|
220 | + * acknowledge: boolean, // whether the user has acknowledged acknowledge messages (default: false) |
|
221 | + * master_timeout: time, // Timeout for processing on master node |
|
222 | + * timeout: time, // Timeout for acknowledgement of update from all nodes in cluster |
|
223 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
224 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
225 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
226 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
227 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
228 | + * } $params |
|
229 | + * |
|
230 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
231 | + * @throws ClientResponseException if the status code of response is 4xx |
|
232 | + * @throws ServerResponseException if the status code of response is 5xx |
|
233 | + * |
|
234 | + * @return Elasticsearch|Promise |
|
235 | + */ |
|
236 | + public function postStartTrial(array $params = []) |
|
237 | + { |
|
238 | + $url = '/_license/start_trial'; |
|
239 | + $method = 'POST'; |
|
240 | + $url = $this->addQueryString($url, $params, ['type', 'acknowledge', 'master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
241 | + $headers = ['Accept' => 'application/json']; |
|
242 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
243 | + $request = $this->addOtelAttributes($params, [], $request, 'license.post_start_trial'); |
|
244 | + return $this->client->sendRequest($request); |
|
245 | + } |
|
246 | 246 | } |
@@ -25,113 +25,113 @@ |
||
25 | 25 | */ |
26 | 26 | class Fleet extends AbstractEndpoint |
27 | 27 | { |
28 | - /** |
|
29 | - * Returns the current global checkpoints for an index. This API is design for internal use by the fleet server project. |
|
30 | - * |
|
31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-global-checkpoints.html |
|
32 | - * |
|
33 | - * @param array{ |
|
34 | - * index: string, // (REQUIRED) The name of the index. |
|
35 | - * wait_for_advance: boolean, // Whether to wait for the global checkpoint to advance past the specified current checkpoints |
|
36 | - * wait_for_index: boolean, // Whether to wait for the target index to exist and all primary shards be active |
|
37 | - * checkpoints: list, // Comma separated list of checkpoints |
|
38 | - * timeout: time, // Timeout to wait for global checkpoint to advance |
|
39 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
40 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
41 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
42 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
43 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
44 | - * } $params |
|
45 | - * |
|
46 | - * @throws MissingParameterException if a required parameter is missing |
|
47 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
48 | - * @throws ClientResponseException if the status code of response is 4xx |
|
49 | - * @throws ServerResponseException if the status code of response is 5xx |
|
50 | - * |
|
51 | - * @return Elasticsearch|Promise |
|
52 | - */ |
|
53 | - public function globalCheckpoints(array $params = []) |
|
54 | - { |
|
55 | - $this->checkRequiredParameters(['index'], $params); |
|
56 | - $url = '/' . $this->encode($params['index']) . '/_fleet/global_checkpoints'; |
|
57 | - $method = 'GET'; |
|
58 | - $url = $this->addQueryString($url, $params, ['wait_for_advance', 'wait_for_index', 'checkpoints', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
59 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
60 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
61 | - $request = $this->addOtelAttributes($params, ['index'], $request, 'fleet.global_checkpoints'); |
|
62 | - return $this->client->sendRequest($request); |
|
63 | - } |
|
64 | - /** |
|
65 | - * Multi Search API where the search will only be executed after specified checkpoints are available due to a refresh. This API is designed for internal use by the fleet server project. |
|
66 | - * |
|
67 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
68 | - * |
|
69 | - * @param array{ |
|
70 | - * index: string, // The index name to use as the default |
|
71 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
72 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
73 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
74 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
75 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
76 | - * body: array, // (REQUIRED) The request definitions (metadata-fleet search request definition pairs), separated by newlines |
|
77 | - * } $params |
|
78 | - * |
|
79 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
80 | - * @throws ClientResponseException if the status code of response is 4xx |
|
81 | - * @throws ServerResponseException if the status code of response is 5xx |
|
82 | - * |
|
83 | - * @return Elasticsearch|Promise |
|
84 | - */ |
|
85 | - public function msearch(array $params = []) |
|
86 | - { |
|
87 | - $this->checkRequiredParameters(['body'], $params); |
|
88 | - if (isset($params['index'])) { |
|
89 | - $url = '/' . $this->encode($params['index']) . '/_fleet/_fleet_msearch'; |
|
90 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
91 | - } else { |
|
92 | - $url = '/_fleet/_fleet_msearch'; |
|
93 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
94 | - } |
|
95 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
96 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/x-ndjson']; |
|
97 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
98 | - $request = $this->addOtelAttributes($params, ['index'], $request, 'fleet.msearch'); |
|
99 | - return $this->client->sendRequest($request); |
|
100 | - } |
|
101 | - /** |
|
102 | - * Search API where the search will only be executed after specified checkpoints are available due to a refresh. This API is designed for internal use by the fleet server project. |
|
103 | - * |
|
104 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
105 | - * |
|
106 | - * @param array{ |
|
107 | - * index: string, // (REQUIRED) The index name to search. |
|
108 | - * wait_for_checkpoints: list, // Comma separated list of checkpoints, one per shard |
|
109 | - * wait_for_checkpoints_timeout: time, // Explicit wait_for_checkpoints timeout |
|
110 | - * allow_partial_search_results: boolean, // Indicate if an error should be returned if there is a partial search failure or timeout |
|
111 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
112 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
113 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
114 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
115 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
116 | - * body: array, // The search definition using the Query DSL |
|
117 | - * } $params |
|
118 | - * |
|
119 | - * @throws MissingParameterException if a required parameter is missing |
|
120 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
121 | - * @throws ClientResponseException if the status code of response is 4xx |
|
122 | - * @throws ServerResponseException if the status code of response is 5xx |
|
123 | - * |
|
124 | - * @return Elasticsearch|Promise |
|
125 | - */ |
|
126 | - public function search(array $params = []) |
|
127 | - { |
|
128 | - $this->checkRequiredParameters(['index'], $params); |
|
129 | - $url = '/' . $this->encode($params['index']) . '/_fleet/_fleet_search'; |
|
130 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
131 | - $url = $this->addQueryString($url, $params, ['wait_for_checkpoints', 'wait_for_checkpoints_timeout', 'allow_partial_search_results', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
132 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
133 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
134 | - $request = $this->addOtelAttributes($params, ['index'], $request, 'fleet.search'); |
|
135 | - return $this->client->sendRequest($request); |
|
136 | - } |
|
28 | + /** |
|
29 | + * Returns the current global checkpoints for an index. This API is design for internal use by the fleet server project. |
|
30 | + * |
|
31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-global-checkpoints.html |
|
32 | + * |
|
33 | + * @param array{ |
|
34 | + * index: string, // (REQUIRED) The name of the index. |
|
35 | + * wait_for_advance: boolean, // Whether to wait for the global checkpoint to advance past the specified current checkpoints |
|
36 | + * wait_for_index: boolean, // Whether to wait for the target index to exist and all primary shards be active |
|
37 | + * checkpoints: list, // Comma separated list of checkpoints |
|
38 | + * timeout: time, // Timeout to wait for global checkpoint to advance |
|
39 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
40 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
41 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
42 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
43 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
44 | + * } $params |
|
45 | + * |
|
46 | + * @throws MissingParameterException if a required parameter is missing |
|
47 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
48 | + * @throws ClientResponseException if the status code of response is 4xx |
|
49 | + * @throws ServerResponseException if the status code of response is 5xx |
|
50 | + * |
|
51 | + * @return Elasticsearch|Promise |
|
52 | + */ |
|
53 | + public function globalCheckpoints(array $params = []) |
|
54 | + { |
|
55 | + $this->checkRequiredParameters(['index'], $params); |
|
56 | + $url = '/' . $this->encode($params['index']) . '/_fleet/global_checkpoints'; |
|
57 | + $method = 'GET'; |
|
58 | + $url = $this->addQueryString($url, $params, ['wait_for_advance', 'wait_for_index', 'checkpoints', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
59 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
60 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
61 | + $request = $this->addOtelAttributes($params, ['index'], $request, 'fleet.global_checkpoints'); |
|
62 | + return $this->client->sendRequest($request); |
|
63 | + } |
|
64 | + /** |
|
65 | + * Multi Search API where the search will only be executed after specified checkpoints are available due to a refresh. This API is designed for internal use by the fleet server project. |
|
66 | + * |
|
67 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
68 | + * |
|
69 | + * @param array{ |
|
70 | + * index: string, // The index name to use as the default |
|
71 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
72 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
73 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
74 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
75 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
76 | + * body: array, // (REQUIRED) The request definitions (metadata-fleet search request definition pairs), separated by newlines |
|
77 | + * } $params |
|
78 | + * |
|
79 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
80 | + * @throws ClientResponseException if the status code of response is 4xx |
|
81 | + * @throws ServerResponseException if the status code of response is 5xx |
|
82 | + * |
|
83 | + * @return Elasticsearch|Promise |
|
84 | + */ |
|
85 | + public function msearch(array $params = []) |
|
86 | + { |
|
87 | + $this->checkRequiredParameters(['body'], $params); |
|
88 | + if (isset($params['index'])) { |
|
89 | + $url = '/' . $this->encode($params['index']) . '/_fleet/_fleet_msearch'; |
|
90 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
91 | + } else { |
|
92 | + $url = '/_fleet/_fleet_msearch'; |
|
93 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
94 | + } |
|
95 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
96 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/x-ndjson']; |
|
97 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
98 | + $request = $this->addOtelAttributes($params, ['index'], $request, 'fleet.msearch'); |
|
99 | + return $this->client->sendRequest($request); |
|
100 | + } |
|
101 | + /** |
|
102 | + * Search API where the search will only be executed after specified checkpoints are available due to a refresh. This API is designed for internal use by the fleet server project. |
|
103 | + * |
|
104 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
105 | + * |
|
106 | + * @param array{ |
|
107 | + * index: string, // (REQUIRED) The index name to search. |
|
108 | + * wait_for_checkpoints: list, // Comma separated list of checkpoints, one per shard |
|
109 | + * wait_for_checkpoints_timeout: time, // Explicit wait_for_checkpoints timeout |
|
110 | + * allow_partial_search_results: boolean, // Indicate if an error should be returned if there is a partial search failure or timeout |
|
111 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
112 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
113 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
114 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
115 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
116 | + * body: array, // The search definition using the Query DSL |
|
117 | + * } $params |
|
118 | + * |
|
119 | + * @throws MissingParameterException if a required parameter is missing |
|
120 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
121 | + * @throws ClientResponseException if the status code of response is 4xx |
|
122 | + * @throws ServerResponseException if the status code of response is 5xx |
|
123 | + * |
|
124 | + * @return Elasticsearch|Promise |
|
125 | + */ |
|
126 | + public function search(array $params = []) |
|
127 | + { |
|
128 | + $this->checkRequiredParameters(['index'], $params); |
|
129 | + $url = '/' . $this->encode($params['index']) . '/_fleet/_fleet_search'; |
|
130 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
131 | + $url = $this->addQueryString($url, $params, ['wait_for_checkpoints', 'wait_for_checkpoints_timeout', 'allow_partial_search_results', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
132 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
133 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
134 | + $request = $this->addOtelAttributes($params, ['index'], $request, 'fleet.search'); |
|
135 | + return $this->client->sendRequest($request); |
|
136 | + } |
|
137 | 137 | } |
@@ -25,136 +25,136 @@ |
||
25 | 25 | */ |
26 | 26 | class Autoscaling extends AbstractEndpoint |
27 | 27 | { |
28 | - /** |
|
29 | - * Deletes an autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. |
|
30 | - * |
|
31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-delete-autoscaling-policy.html |
|
32 | - * |
|
33 | - * @param array{ |
|
34 | - * name: string, // (REQUIRED) the name of the autoscaling policy |
|
35 | - * master_timeout: time, // Timeout for processing on master node |
|
36 | - * timeout: time, // Timeout for acknowledgement of update from all nodes in cluster |
|
37 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
38 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
39 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
40 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
41 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
42 | - * } $params |
|
43 | - * |
|
44 | - * @throws MissingParameterException if a required parameter is missing |
|
45 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
46 | - * @throws ClientResponseException if the status code of response is 4xx |
|
47 | - * @throws ServerResponseException if the status code of response is 5xx |
|
48 | - * |
|
49 | - * @return Elasticsearch|Promise |
|
50 | - */ |
|
51 | - public function deleteAutoscalingPolicy(array $params = []) |
|
52 | - { |
|
53 | - $this->checkRequiredParameters(['name'], $params); |
|
54 | - $url = '/_autoscaling/policy/' . $this->encode($params['name']); |
|
55 | - $method = 'DELETE'; |
|
56 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
57 | - $headers = ['Accept' => 'application/json']; |
|
58 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
59 | - $request = $this->addOtelAttributes($params, ['name'], $request, 'autoscaling.delete_autoscaling_policy'); |
|
60 | - return $this->client->sendRequest($request); |
|
61 | - } |
|
62 | - /** |
|
63 | - * Gets the current autoscaling capacity based on the configured autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. |
|
64 | - * |
|
65 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-get-autoscaling-capacity.html |
|
66 | - * |
|
67 | - * @param array{ |
|
68 | - * master_timeout: time, // Timeout for processing on master node |
|
69 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
70 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
71 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
72 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
73 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
74 | - * } $params |
|
75 | - * |
|
76 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
77 | - * @throws ClientResponseException if the status code of response is 4xx |
|
78 | - * @throws ServerResponseException if the status code of response is 5xx |
|
79 | - * |
|
80 | - * @return Elasticsearch|Promise |
|
81 | - */ |
|
82 | - public function getAutoscalingCapacity(array $params = []) |
|
83 | - { |
|
84 | - $url = '/_autoscaling/capacity'; |
|
85 | - $method = 'GET'; |
|
86 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
87 | - $headers = ['Accept' => 'application/json']; |
|
88 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
89 | - $request = $this->addOtelAttributes($params, [], $request, 'autoscaling.get_autoscaling_capacity'); |
|
90 | - return $this->client->sendRequest($request); |
|
91 | - } |
|
92 | - /** |
|
93 | - * Retrieves an autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. |
|
94 | - * |
|
95 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-get-autoscaling-policy.html |
|
96 | - * |
|
97 | - * @param array{ |
|
98 | - * name: string, // (REQUIRED) the name of the autoscaling policy |
|
99 | - * master_timeout: time, // Timeout for processing on master node |
|
100 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
101 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
102 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
103 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
104 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
105 | - * } $params |
|
106 | - * |
|
107 | - * @throws MissingParameterException if a required parameter is missing |
|
108 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
109 | - * @throws ClientResponseException if the status code of response is 4xx |
|
110 | - * @throws ServerResponseException if the status code of response is 5xx |
|
111 | - * |
|
112 | - * @return Elasticsearch|Promise |
|
113 | - */ |
|
114 | - public function getAutoscalingPolicy(array $params = []) |
|
115 | - { |
|
116 | - $this->checkRequiredParameters(['name'], $params); |
|
117 | - $url = '/_autoscaling/policy/' . $this->encode($params['name']); |
|
118 | - $method = 'GET'; |
|
119 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
120 | - $headers = ['Accept' => 'application/json']; |
|
121 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
122 | - $request = $this->addOtelAttributes($params, ['name'], $request, 'autoscaling.get_autoscaling_policy'); |
|
123 | - return $this->client->sendRequest($request); |
|
124 | - } |
|
125 | - /** |
|
126 | - * Creates a new autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. |
|
127 | - * |
|
128 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-put-autoscaling-policy.html |
|
129 | - * |
|
130 | - * @param array{ |
|
131 | - * name: string, // (REQUIRED) the name of the autoscaling policy |
|
132 | - * master_timeout: time, // Timeout for processing on master node |
|
133 | - * timeout: time, // Timeout for acknowledgement of update from all nodes in cluster |
|
134 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
135 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
136 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
137 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
138 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
139 | - * body: array, // (REQUIRED) the specification of the autoscaling policy |
|
140 | - * } $params |
|
141 | - * |
|
142 | - * @throws MissingParameterException if a required parameter is missing |
|
143 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
144 | - * @throws ClientResponseException if the status code of response is 4xx |
|
145 | - * @throws ServerResponseException if the status code of response is 5xx |
|
146 | - * |
|
147 | - * @return Elasticsearch|Promise |
|
148 | - */ |
|
149 | - public function putAutoscalingPolicy(array $params = []) |
|
150 | - { |
|
151 | - $this->checkRequiredParameters(['name', 'body'], $params); |
|
152 | - $url = '/_autoscaling/policy/' . $this->encode($params['name']); |
|
153 | - $method = 'PUT'; |
|
154 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
155 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
156 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
157 | - $request = $this->addOtelAttributes($params, ['name'], $request, 'autoscaling.put_autoscaling_policy'); |
|
158 | - return $this->client->sendRequest($request); |
|
159 | - } |
|
28 | + /** |
|
29 | + * Deletes an autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. |
|
30 | + * |
|
31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-delete-autoscaling-policy.html |
|
32 | + * |
|
33 | + * @param array{ |
|
34 | + * name: string, // (REQUIRED) the name of the autoscaling policy |
|
35 | + * master_timeout: time, // Timeout for processing on master node |
|
36 | + * timeout: time, // Timeout for acknowledgement of update from all nodes in cluster |
|
37 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
38 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
39 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
40 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
41 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
42 | + * } $params |
|
43 | + * |
|
44 | + * @throws MissingParameterException if a required parameter is missing |
|
45 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
46 | + * @throws ClientResponseException if the status code of response is 4xx |
|
47 | + * @throws ServerResponseException if the status code of response is 5xx |
|
48 | + * |
|
49 | + * @return Elasticsearch|Promise |
|
50 | + */ |
|
51 | + public function deleteAutoscalingPolicy(array $params = []) |
|
52 | + { |
|
53 | + $this->checkRequiredParameters(['name'], $params); |
|
54 | + $url = '/_autoscaling/policy/' . $this->encode($params['name']); |
|
55 | + $method = 'DELETE'; |
|
56 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
57 | + $headers = ['Accept' => 'application/json']; |
|
58 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
59 | + $request = $this->addOtelAttributes($params, ['name'], $request, 'autoscaling.delete_autoscaling_policy'); |
|
60 | + return $this->client->sendRequest($request); |
|
61 | + } |
|
62 | + /** |
|
63 | + * Gets the current autoscaling capacity based on the configured autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. |
|
64 | + * |
|
65 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-get-autoscaling-capacity.html |
|
66 | + * |
|
67 | + * @param array{ |
|
68 | + * master_timeout: time, // Timeout for processing on master node |
|
69 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
70 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
71 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
72 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
73 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
74 | + * } $params |
|
75 | + * |
|
76 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
77 | + * @throws ClientResponseException if the status code of response is 4xx |
|
78 | + * @throws ServerResponseException if the status code of response is 5xx |
|
79 | + * |
|
80 | + * @return Elasticsearch|Promise |
|
81 | + */ |
|
82 | + public function getAutoscalingCapacity(array $params = []) |
|
83 | + { |
|
84 | + $url = '/_autoscaling/capacity'; |
|
85 | + $method = 'GET'; |
|
86 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
87 | + $headers = ['Accept' => 'application/json']; |
|
88 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
89 | + $request = $this->addOtelAttributes($params, [], $request, 'autoscaling.get_autoscaling_capacity'); |
|
90 | + return $this->client->sendRequest($request); |
|
91 | + } |
|
92 | + /** |
|
93 | + * Retrieves an autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. |
|
94 | + * |
|
95 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-get-autoscaling-policy.html |
|
96 | + * |
|
97 | + * @param array{ |
|
98 | + * name: string, // (REQUIRED) the name of the autoscaling policy |
|
99 | + * master_timeout: time, // Timeout for processing on master node |
|
100 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
101 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
102 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
103 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
104 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
105 | + * } $params |
|
106 | + * |
|
107 | + * @throws MissingParameterException if a required parameter is missing |
|
108 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
109 | + * @throws ClientResponseException if the status code of response is 4xx |
|
110 | + * @throws ServerResponseException if the status code of response is 5xx |
|
111 | + * |
|
112 | + * @return Elasticsearch|Promise |
|
113 | + */ |
|
114 | + public function getAutoscalingPolicy(array $params = []) |
|
115 | + { |
|
116 | + $this->checkRequiredParameters(['name'], $params); |
|
117 | + $url = '/_autoscaling/policy/' . $this->encode($params['name']); |
|
118 | + $method = 'GET'; |
|
119 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
120 | + $headers = ['Accept' => 'application/json']; |
|
121 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
122 | + $request = $this->addOtelAttributes($params, ['name'], $request, 'autoscaling.get_autoscaling_policy'); |
|
123 | + return $this->client->sendRequest($request); |
|
124 | + } |
|
125 | + /** |
|
126 | + * Creates a new autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. |
|
127 | + * |
|
128 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-put-autoscaling-policy.html |
|
129 | + * |
|
130 | + * @param array{ |
|
131 | + * name: string, // (REQUIRED) the name of the autoscaling policy |
|
132 | + * master_timeout: time, // Timeout for processing on master node |
|
133 | + * timeout: time, // Timeout for acknowledgement of update from all nodes in cluster |
|
134 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
135 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
136 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
137 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
138 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
139 | + * body: array, // (REQUIRED) the specification of the autoscaling policy |
|
140 | + * } $params |
|
141 | + * |
|
142 | + * @throws MissingParameterException if a required parameter is missing |
|
143 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
144 | + * @throws ClientResponseException if the status code of response is 4xx |
|
145 | + * @throws ServerResponseException if the status code of response is 5xx |
|
146 | + * |
|
147 | + * @return Elasticsearch|Promise |
|
148 | + */ |
|
149 | + public function putAutoscalingPolicy(array $params = []) |
|
150 | + { |
|
151 | + $this->checkRequiredParameters(['name', 'body'], $params); |
|
152 | + $url = '/_autoscaling/policy/' . $this->encode($params['name']); |
|
153 | + $method = 'PUT'; |
|
154 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
155 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
156 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
157 | + $request = $this->addOtelAttributes($params, ['name'], $request, 'autoscaling.put_autoscaling_policy'); |
|
158 | + return $this->client->sendRequest($request); |
|
159 | + } |
|
160 | 160 | } |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | * Elasticsearch B.V licenses this file to you under the MIT License. |
12 | 12 | * See the LICENSE file in the project root for more information. |
13 | 13 | */ |
14 | -declare (strict_types=1); |
|
14 | +declare(strict_types=1); |
|
15 | 15 | namespace OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Endpoints; |
16 | 16 | |
17 | 17 | use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Exception\ClientResponseException; |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | public function deleteAutoscalingPolicy(array $params = []) |
52 | 52 | { |
53 | 53 | $this->checkRequiredParameters(['name'], $params); |
54 | - $url = '/_autoscaling/policy/' . $this->encode($params['name']); |
|
54 | + $url = '/_autoscaling/policy/'.$this->encode($params['name']); |
|
55 | 55 | $method = 'DELETE'; |
56 | 56 | $url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
57 | 57 | $headers = ['Accept' => 'application/json']; |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | public function getAutoscalingPolicy(array $params = []) |
115 | 115 | { |
116 | 116 | $this->checkRequiredParameters(['name'], $params); |
117 | - $url = '/_autoscaling/policy/' . $this->encode($params['name']); |
|
117 | + $url = '/_autoscaling/policy/'.$this->encode($params['name']); |
|
118 | 118 | $method = 'GET'; |
119 | 119 | $url = $this->addQueryString($url, $params, ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
120 | 120 | $headers = ['Accept' => 'application/json']; |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | public function putAutoscalingPolicy(array $params = []) |
150 | 150 | { |
151 | 151 | $this->checkRequiredParameters(['name', 'body'], $params); |
152 | - $url = '/_autoscaling/policy/' . $this->encode($params['name']); |
|
152 | + $url = '/_autoscaling/policy/'.$this->encode($params['name']); |
|
153 | 153 | $method = 'PUT'; |
154 | 154 | $url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
155 | 155 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -25,234 +25,234 @@ |
||
25 | 25 | */ |
26 | 26 | class Synonyms extends AbstractEndpoint |
27 | 27 | { |
28 | - /** |
|
29 | - * Deletes a synonym set |
|
30 | - * |
|
31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-synonyms-set.html |
|
32 | - * |
|
33 | - * @param array{ |
|
34 | - * id: string, // (REQUIRED) The id of the synonyms set to be deleted |
|
35 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
36 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
37 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
38 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
39 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
40 | - * } $params |
|
41 | - * |
|
42 | - * @throws MissingParameterException if a required parameter is missing |
|
43 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
44 | - * @throws ClientResponseException if the status code of response is 4xx |
|
45 | - * @throws ServerResponseException if the status code of response is 5xx |
|
46 | - * |
|
47 | - * @return Elasticsearch|Promise |
|
48 | - */ |
|
49 | - public function deleteSynonym(array $params = []) |
|
50 | - { |
|
51 | - $this->checkRequiredParameters(['id'], $params); |
|
52 | - $url = '/_synonyms/' . $this->encode($params['id']); |
|
53 | - $method = 'DELETE'; |
|
54 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
55 | - $headers = ['Accept' => 'application/json']; |
|
56 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
57 | - $request = $this->addOtelAttributes($params, ['id'], $request, 'synonyms.delete_synonym'); |
|
58 | - return $this->client->sendRequest($request); |
|
59 | - } |
|
60 | - /** |
|
61 | - * Deletes a synonym rule in a synonym set |
|
62 | - * |
|
63 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-synonym-rule.html |
|
64 | - * |
|
65 | - * @param array{ |
|
66 | - * set_id: string, // (REQUIRED) The id of the synonym set to be updated |
|
67 | - * rule_id: string, // (REQUIRED) The id of the synonym rule to be deleted |
|
68 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
69 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
70 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
71 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
72 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
73 | - * } $params |
|
74 | - * |
|
75 | - * @throws MissingParameterException if a required parameter is missing |
|
76 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
77 | - * @throws ClientResponseException if the status code of response is 4xx |
|
78 | - * @throws ServerResponseException if the status code of response is 5xx |
|
79 | - * |
|
80 | - * @return Elasticsearch|Promise |
|
81 | - */ |
|
82 | - public function deleteSynonymRule(array $params = []) |
|
83 | - { |
|
84 | - $this->checkRequiredParameters(['set_id', 'rule_id'], $params); |
|
85 | - $url = '/_synonyms/' . $this->encode($params['set_id']) . '/' . $this->encode($params['rule_id']); |
|
86 | - $method = 'DELETE'; |
|
87 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
88 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
89 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
90 | - $request = $this->addOtelAttributes($params, ['set_id', 'rule_id'], $request, 'synonyms.delete_synonym_rule'); |
|
91 | - return $this->client->sendRequest($request); |
|
92 | - } |
|
93 | - /** |
|
94 | - * Retrieves a synonym set |
|
95 | - * |
|
96 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-synonyms-set.html |
|
97 | - * |
|
98 | - * @param array{ |
|
99 | - * id: string, // (REQUIRED) The name of the synonyms set to be retrieved |
|
100 | - * from: int, // Starting offset |
|
101 | - * size: int, // specifies a max number of results to get |
|
102 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
103 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
104 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
105 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
106 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
107 | - * } $params |
|
108 | - * |
|
109 | - * @throws MissingParameterException if a required parameter is missing |
|
110 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
111 | - * @throws ClientResponseException if the status code of response is 4xx |
|
112 | - * @throws ServerResponseException if the status code of response is 5xx |
|
113 | - * |
|
114 | - * @return Elasticsearch|Promise |
|
115 | - */ |
|
116 | - public function getSynonym(array $params = []) |
|
117 | - { |
|
118 | - $this->checkRequiredParameters(['id'], $params); |
|
119 | - $url = '/_synonyms/' . $this->encode($params['id']); |
|
120 | - $method = 'GET'; |
|
121 | - $url = $this->addQueryString($url, $params, ['from', 'size', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
122 | - $headers = ['Accept' => 'application/json']; |
|
123 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
124 | - $request = $this->addOtelAttributes($params, ['id'], $request, 'synonyms.get_synonym'); |
|
125 | - return $this->client->sendRequest($request); |
|
126 | - } |
|
127 | - /** |
|
128 | - * Retrieves a synonym rule from a synonym set |
|
129 | - * |
|
130 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-synonym-rule.html |
|
131 | - * |
|
132 | - * @param array{ |
|
133 | - * set_id: string, // (REQUIRED) The id of the synonym set to retrieve the synonym rule from |
|
134 | - * rule_id: string, // (REQUIRED) The id of the synonym rule to retrieve |
|
135 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
136 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
137 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
138 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
139 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
140 | - * } $params |
|
141 | - * |
|
142 | - * @throws MissingParameterException if a required parameter is missing |
|
143 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
144 | - * @throws ClientResponseException if the status code of response is 4xx |
|
145 | - * @throws ServerResponseException if the status code of response is 5xx |
|
146 | - * |
|
147 | - * @return Elasticsearch|Promise |
|
148 | - */ |
|
149 | - public function getSynonymRule(array $params = []) |
|
150 | - { |
|
151 | - $this->checkRequiredParameters(['set_id', 'rule_id'], $params); |
|
152 | - $url = '/_synonyms/' . $this->encode($params['set_id']) . '/' . $this->encode($params['rule_id']); |
|
153 | - $method = 'GET'; |
|
154 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
155 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
156 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
157 | - $request = $this->addOtelAttributes($params, ['set_id', 'rule_id'], $request, 'synonyms.get_synonym_rule'); |
|
158 | - return $this->client->sendRequest($request); |
|
159 | - } |
|
160 | - /** |
|
161 | - * Retrieves a summary of all defined synonym sets |
|
162 | - * |
|
163 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/list-synonyms-sets.html |
|
164 | - * |
|
165 | - * @param array{ |
|
166 | - * from: int, // Starting offset |
|
167 | - * size: int, // specifies a max number of results to get |
|
168 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
169 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
170 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
171 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
172 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
173 | - * } $params |
|
174 | - * |
|
175 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
176 | - * @throws ClientResponseException if the status code of response is 4xx |
|
177 | - * @throws ServerResponseException if the status code of response is 5xx |
|
178 | - * |
|
179 | - * @return Elasticsearch|Promise |
|
180 | - */ |
|
181 | - public function getSynonymsSets(array $params = []) |
|
182 | - { |
|
183 | - $url = '/_synonyms'; |
|
184 | - $method = 'GET'; |
|
185 | - $url = $this->addQueryString($url, $params, ['from', 'size', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
186 | - $headers = ['Accept' => 'application/json']; |
|
187 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
188 | - $request = $this->addOtelAttributes($params, [], $request, 'synonyms.get_synonyms_sets'); |
|
189 | - return $this->client->sendRequest($request); |
|
190 | - } |
|
191 | - /** |
|
192 | - * Creates or updates a synonyms set |
|
193 | - * |
|
194 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/put-synonyms-set.html |
|
195 | - * |
|
196 | - * @param array{ |
|
197 | - * id: string, // (REQUIRED) The id of the synonyms set to be created or updated |
|
198 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
199 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
200 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
201 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
202 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
203 | - * body: array, // (REQUIRED) Synonyms set rules |
|
204 | - * } $params |
|
205 | - * |
|
206 | - * @throws MissingParameterException if a required parameter is missing |
|
207 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
208 | - * @throws ClientResponseException if the status code of response is 4xx |
|
209 | - * @throws ServerResponseException if the status code of response is 5xx |
|
210 | - * |
|
211 | - * @return Elasticsearch|Promise |
|
212 | - */ |
|
213 | - public function putSynonym(array $params = []) |
|
214 | - { |
|
215 | - $this->checkRequiredParameters(['id', 'body'], $params); |
|
216 | - $url = '/_synonyms/' . $this->encode($params['id']); |
|
217 | - $method = 'PUT'; |
|
218 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
219 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
220 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
221 | - $request = $this->addOtelAttributes($params, ['id'], $request, 'synonyms.put_synonym'); |
|
222 | - return $this->client->sendRequest($request); |
|
223 | - } |
|
224 | - /** |
|
225 | - * Creates or updates a synonym rule in a synonym set |
|
226 | - * |
|
227 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/put-synonym-rule.html |
|
228 | - * |
|
229 | - * @param array{ |
|
230 | - * set_id: string, // (REQUIRED) The id of the synonym set to be updated with the synonym rule |
|
231 | - * rule_id: string, // (REQUIRED) The id of the synonym rule to be updated or created |
|
232 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
233 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
234 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
235 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
236 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
237 | - * body: array, // (REQUIRED) Synonym rule |
|
238 | - * } $params |
|
239 | - * |
|
240 | - * @throws MissingParameterException if a required parameter is missing |
|
241 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
242 | - * @throws ClientResponseException if the status code of response is 4xx |
|
243 | - * @throws ServerResponseException if the status code of response is 5xx |
|
244 | - * |
|
245 | - * @return Elasticsearch|Promise |
|
246 | - */ |
|
247 | - public function putSynonymRule(array $params = []) |
|
248 | - { |
|
249 | - $this->checkRequiredParameters(['set_id', 'rule_id', 'body'], $params); |
|
250 | - $url = '/_synonyms/' . $this->encode($params['set_id']) . '/' . $this->encode($params['rule_id']); |
|
251 | - $method = 'PUT'; |
|
252 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
253 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
254 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
255 | - $request = $this->addOtelAttributes($params, ['set_id', 'rule_id'], $request, 'synonyms.put_synonym_rule'); |
|
256 | - return $this->client->sendRequest($request); |
|
257 | - } |
|
28 | + /** |
|
29 | + * Deletes a synonym set |
|
30 | + * |
|
31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-synonyms-set.html |
|
32 | + * |
|
33 | + * @param array{ |
|
34 | + * id: string, // (REQUIRED) The id of the synonyms set to be deleted |
|
35 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
36 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
37 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
38 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
39 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
40 | + * } $params |
|
41 | + * |
|
42 | + * @throws MissingParameterException if a required parameter is missing |
|
43 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
44 | + * @throws ClientResponseException if the status code of response is 4xx |
|
45 | + * @throws ServerResponseException if the status code of response is 5xx |
|
46 | + * |
|
47 | + * @return Elasticsearch|Promise |
|
48 | + */ |
|
49 | + public function deleteSynonym(array $params = []) |
|
50 | + { |
|
51 | + $this->checkRequiredParameters(['id'], $params); |
|
52 | + $url = '/_synonyms/' . $this->encode($params['id']); |
|
53 | + $method = 'DELETE'; |
|
54 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
55 | + $headers = ['Accept' => 'application/json']; |
|
56 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
57 | + $request = $this->addOtelAttributes($params, ['id'], $request, 'synonyms.delete_synonym'); |
|
58 | + return $this->client->sendRequest($request); |
|
59 | + } |
|
60 | + /** |
|
61 | + * Deletes a synonym rule in a synonym set |
|
62 | + * |
|
63 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-synonym-rule.html |
|
64 | + * |
|
65 | + * @param array{ |
|
66 | + * set_id: string, // (REQUIRED) The id of the synonym set to be updated |
|
67 | + * rule_id: string, // (REQUIRED) The id of the synonym rule to be deleted |
|
68 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
69 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
70 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
71 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
72 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
73 | + * } $params |
|
74 | + * |
|
75 | + * @throws MissingParameterException if a required parameter is missing |
|
76 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
77 | + * @throws ClientResponseException if the status code of response is 4xx |
|
78 | + * @throws ServerResponseException if the status code of response is 5xx |
|
79 | + * |
|
80 | + * @return Elasticsearch|Promise |
|
81 | + */ |
|
82 | + public function deleteSynonymRule(array $params = []) |
|
83 | + { |
|
84 | + $this->checkRequiredParameters(['set_id', 'rule_id'], $params); |
|
85 | + $url = '/_synonyms/' . $this->encode($params['set_id']) . '/' . $this->encode($params['rule_id']); |
|
86 | + $method = 'DELETE'; |
|
87 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
88 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
89 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
90 | + $request = $this->addOtelAttributes($params, ['set_id', 'rule_id'], $request, 'synonyms.delete_synonym_rule'); |
|
91 | + return $this->client->sendRequest($request); |
|
92 | + } |
|
93 | + /** |
|
94 | + * Retrieves a synonym set |
|
95 | + * |
|
96 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-synonyms-set.html |
|
97 | + * |
|
98 | + * @param array{ |
|
99 | + * id: string, // (REQUIRED) The name of the synonyms set to be retrieved |
|
100 | + * from: int, // Starting offset |
|
101 | + * size: int, // specifies a max number of results to get |
|
102 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
103 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
104 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
105 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
106 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
107 | + * } $params |
|
108 | + * |
|
109 | + * @throws MissingParameterException if a required parameter is missing |
|
110 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
111 | + * @throws ClientResponseException if the status code of response is 4xx |
|
112 | + * @throws ServerResponseException if the status code of response is 5xx |
|
113 | + * |
|
114 | + * @return Elasticsearch|Promise |
|
115 | + */ |
|
116 | + public function getSynonym(array $params = []) |
|
117 | + { |
|
118 | + $this->checkRequiredParameters(['id'], $params); |
|
119 | + $url = '/_synonyms/' . $this->encode($params['id']); |
|
120 | + $method = 'GET'; |
|
121 | + $url = $this->addQueryString($url, $params, ['from', 'size', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
122 | + $headers = ['Accept' => 'application/json']; |
|
123 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
124 | + $request = $this->addOtelAttributes($params, ['id'], $request, 'synonyms.get_synonym'); |
|
125 | + return $this->client->sendRequest($request); |
|
126 | + } |
|
127 | + /** |
|
128 | + * Retrieves a synonym rule from a synonym set |
|
129 | + * |
|
130 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-synonym-rule.html |
|
131 | + * |
|
132 | + * @param array{ |
|
133 | + * set_id: string, // (REQUIRED) The id of the synonym set to retrieve the synonym rule from |
|
134 | + * rule_id: string, // (REQUIRED) The id of the synonym rule to retrieve |
|
135 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
136 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
137 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
138 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
139 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
140 | + * } $params |
|
141 | + * |
|
142 | + * @throws MissingParameterException if a required parameter is missing |
|
143 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
144 | + * @throws ClientResponseException if the status code of response is 4xx |
|
145 | + * @throws ServerResponseException if the status code of response is 5xx |
|
146 | + * |
|
147 | + * @return Elasticsearch|Promise |
|
148 | + */ |
|
149 | + public function getSynonymRule(array $params = []) |
|
150 | + { |
|
151 | + $this->checkRequiredParameters(['set_id', 'rule_id'], $params); |
|
152 | + $url = '/_synonyms/' . $this->encode($params['set_id']) . '/' . $this->encode($params['rule_id']); |
|
153 | + $method = 'GET'; |
|
154 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
155 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
156 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
157 | + $request = $this->addOtelAttributes($params, ['set_id', 'rule_id'], $request, 'synonyms.get_synonym_rule'); |
|
158 | + return $this->client->sendRequest($request); |
|
159 | + } |
|
160 | + /** |
|
161 | + * Retrieves a summary of all defined synonym sets |
|
162 | + * |
|
163 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/list-synonyms-sets.html |
|
164 | + * |
|
165 | + * @param array{ |
|
166 | + * from: int, // Starting offset |
|
167 | + * size: int, // specifies a max number of results to get |
|
168 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
169 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
170 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
171 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
172 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
173 | + * } $params |
|
174 | + * |
|
175 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
176 | + * @throws ClientResponseException if the status code of response is 4xx |
|
177 | + * @throws ServerResponseException if the status code of response is 5xx |
|
178 | + * |
|
179 | + * @return Elasticsearch|Promise |
|
180 | + */ |
|
181 | + public function getSynonymsSets(array $params = []) |
|
182 | + { |
|
183 | + $url = '/_synonyms'; |
|
184 | + $method = 'GET'; |
|
185 | + $url = $this->addQueryString($url, $params, ['from', 'size', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
186 | + $headers = ['Accept' => 'application/json']; |
|
187 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
188 | + $request = $this->addOtelAttributes($params, [], $request, 'synonyms.get_synonyms_sets'); |
|
189 | + return $this->client->sendRequest($request); |
|
190 | + } |
|
191 | + /** |
|
192 | + * Creates or updates a synonyms set |
|
193 | + * |
|
194 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/put-synonyms-set.html |
|
195 | + * |
|
196 | + * @param array{ |
|
197 | + * id: string, // (REQUIRED) The id of the synonyms set to be created or updated |
|
198 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
199 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
200 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
201 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
202 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
203 | + * body: array, // (REQUIRED) Synonyms set rules |
|
204 | + * } $params |
|
205 | + * |
|
206 | + * @throws MissingParameterException if a required parameter is missing |
|
207 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
208 | + * @throws ClientResponseException if the status code of response is 4xx |
|
209 | + * @throws ServerResponseException if the status code of response is 5xx |
|
210 | + * |
|
211 | + * @return Elasticsearch|Promise |
|
212 | + */ |
|
213 | + public function putSynonym(array $params = []) |
|
214 | + { |
|
215 | + $this->checkRequiredParameters(['id', 'body'], $params); |
|
216 | + $url = '/_synonyms/' . $this->encode($params['id']); |
|
217 | + $method = 'PUT'; |
|
218 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
219 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
220 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
221 | + $request = $this->addOtelAttributes($params, ['id'], $request, 'synonyms.put_synonym'); |
|
222 | + return $this->client->sendRequest($request); |
|
223 | + } |
|
224 | + /** |
|
225 | + * Creates or updates a synonym rule in a synonym set |
|
226 | + * |
|
227 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/put-synonym-rule.html |
|
228 | + * |
|
229 | + * @param array{ |
|
230 | + * set_id: string, // (REQUIRED) The id of the synonym set to be updated with the synonym rule |
|
231 | + * rule_id: string, // (REQUIRED) The id of the synonym rule to be updated or created |
|
232 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
233 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
234 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
235 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
236 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
237 | + * body: array, // (REQUIRED) Synonym rule |
|
238 | + * } $params |
|
239 | + * |
|
240 | + * @throws MissingParameterException if a required parameter is missing |
|
241 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
242 | + * @throws ClientResponseException if the status code of response is 4xx |
|
243 | + * @throws ServerResponseException if the status code of response is 5xx |
|
244 | + * |
|
245 | + * @return Elasticsearch|Promise |
|
246 | + */ |
|
247 | + public function putSynonymRule(array $params = []) |
|
248 | + { |
|
249 | + $this->checkRequiredParameters(['set_id', 'rule_id', 'body'], $params); |
|
250 | + $url = '/_synonyms/' . $this->encode($params['set_id']) . '/' . $this->encode($params['rule_id']); |
|
251 | + $method = 'PUT'; |
|
252 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
253 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
254 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
255 | + $request = $this->addOtelAttributes($params, ['set_id', 'rule_id'], $request, 'synonyms.put_synonym_rule'); |
|
256 | + return $this->client->sendRequest($request); |
|
257 | + } |
|
258 | 258 | } |
@@ -25,152 +25,152 @@ |
||
25 | 25 | */ |
26 | 26 | class SearchableSnapshots extends AbstractEndpoint |
27 | 27 | { |
28 | - /** |
|
29 | - * Retrieve node-level cache statistics about searchable snapshots. |
|
30 | - * |
|
31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-apis.html |
|
32 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
33 | - * |
|
34 | - * @param array{ |
|
35 | - * node_id: list, // A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes |
|
36 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
37 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
38 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
39 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
40 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
41 | - * } $params |
|
42 | - * |
|
43 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
44 | - * @throws ClientResponseException if the status code of response is 4xx |
|
45 | - * @throws ServerResponseException if the status code of response is 5xx |
|
46 | - * |
|
47 | - * @return Elasticsearch|Promise |
|
48 | - */ |
|
49 | - public function cacheStats(array $params = []) |
|
50 | - { |
|
51 | - if (isset($params['node_id'])) { |
|
52 | - $url = '/_searchable_snapshots/' . $this->encode($params['node_id']) . '/cache/stats'; |
|
53 | - $method = 'GET'; |
|
54 | - } else { |
|
55 | - $url = '/_searchable_snapshots/cache/stats'; |
|
56 | - $method = 'GET'; |
|
57 | - } |
|
58 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
59 | - $headers = ['Accept' => 'application/json']; |
|
60 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
61 | - $request = $this->addOtelAttributes($params, ['node_id'], $request, 'searchable_snapshots.cache_stats'); |
|
62 | - return $this->client->sendRequest($request); |
|
63 | - } |
|
64 | - /** |
|
65 | - * Clear the cache of searchable snapshots. |
|
66 | - * |
|
67 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-apis.html |
|
68 | - * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
69 | - * |
|
70 | - * @param array{ |
|
71 | - * index: list, // A comma-separated list of index names |
|
72 | - * ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed) |
|
73 | - * allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) |
|
74 | - * expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both. |
|
75 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
76 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
77 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
78 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
79 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
80 | - * } $params |
|
81 | - * |
|
82 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
83 | - * @throws ClientResponseException if the status code of response is 4xx |
|
84 | - * @throws ServerResponseException if the status code of response is 5xx |
|
85 | - * |
|
86 | - * @return Elasticsearch|Promise |
|
87 | - */ |
|
88 | - public function clearCache(array $params = []) |
|
89 | - { |
|
90 | - if (isset($params['index'])) { |
|
91 | - $url = '/' . $this->encode($params['index']) . '/_searchable_snapshots/cache/clear'; |
|
92 | - $method = 'POST'; |
|
93 | - } else { |
|
94 | - $url = '/_searchable_snapshots/cache/clear'; |
|
95 | - $method = 'POST'; |
|
96 | - } |
|
97 | - $url = $this->addQueryString($url, $params, ['ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
98 | - $headers = ['Accept' => 'application/json']; |
|
99 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
100 | - $request = $this->addOtelAttributes($params, ['index'], $request, 'searchable_snapshots.clear_cache'); |
|
101 | - return $this->client->sendRequest($request); |
|
102 | - } |
|
103 | - /** |
|
104 | - * Mount a snapshot as a searchable index. |
|
105 | - * |
|
106 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-api-mount-snapshot.html |
|
107 | - * |
|
108 | - * @param array{ |
|
109 | - * repository: string, // (REQUIRED) The name of the repository containing the snapshot of the index to mount |
|
110 | - * snapshot: string, // (REQUIRED) The name of the snapshot of the index to mount |
|
111 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
112 | - * wait_for_completion: boolean, // Should this request wait until the operation has completed before returning |
|
113 | - * storage: string, // Selects the kind of local storage used to accelerate searches. Experimental, and defaults to `full_copy` |
|
114 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
115 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
116 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
117 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
118 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
119 | - * body: array, // (REQUIRED) The restore configuration for mounting the snapshot as searchable |
|
120 | - * } $params |
|
121 | - * |
|
122 | - * @throws MissingParameterException if a required parameter is missing |
|
123 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
124 | - * @throws ClientResponseException if the status code of response is 4xx |
|
125 | - * @throws ServerResponseException if the status code of response is 5xx |
|
126 | - * |
|
127 | - * @return Elasticsearch|Promise |
|
128 | - */ |
|
129 | - public function mount(array $params = []) |
|
130 | - { |
|
131 | - $this->checkRequiredParameters(['repository', 'snapshot', 'body'], $params); |
|
132 | - $url = '/_snapshot/' . $this->encode($params['repository']) . '/' . $this->encode($params['snapshot']) . '/_mount'; |
|
133 | - $method = 'POST'; |
|
134 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'wait_for_completion', 'storage', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
135 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
136 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
137 | - $request = $this->addOtelAttributes($params, ['repository', 'snapshot'], $request, 'searchable_snapshots.mount'); |
|
138 | - return $this->client->sendRequest($request); |
|
139 | - } |
|
140 | - /** |
|
141 | - * Retrieve shard-level statistics about searchable snapshots. |
|
142 | - * |
|
143 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-apis.html |
|
144 | - * |
|
145 | - * @param array{ |
|
146 | - * index: list, // A comma-separated list of index names |
|
147 | - * level: enum, // Return stats aggregated at cluster, index or shard level |
|
148 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
149 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
150 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
151 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
152 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
153 | - * } $params |
|
154 | - * |
|
155 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
156 | - * @throws ClientResponseException if the status code of response is 4xx |
|
157 | - * @throws ServerResponseException if the status code of response is 5xx |
|
158 | - * |
|
159 | - * @return Elasticsearch|Promise |
|
160 | - */ |
|
161 | - public function stats(array $params = []) |
|
162 | - { |
|
163 | - if (isset($params['index'])) { |
|
164 | - $url = '/' . $this->encode($params['index']) . '/_searchable_snapshots/stats'; |
|
165 | - $method = 'GET'; |
|
166 | - } else { |
|
167 | - $url = '/_searchable_snapshots/stats'; |
|
168 | - $method = 'GET'; |
|
169 | - } |
|
170 | - $url = $this->addQueryString($url, $params, ['level', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
171 | - $headers = ['Accept' => 'application/json']; |
|
172 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
173 | - $request = $this->addOtelAttributes($params, ['index'], $request, 'searchable_snapshots.stats'); |
|
174 | - return $this->client->sendRequest($request); |
|
175 | - } |
|
28 | + /** |
|
29 | + * Retrieve node-level cache statistics about searchable snapshots. |
|
30 | + * |
|
31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-apis.html |
|
32 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
33 | + * |
|
34 | + * @param array{ |
|
35 | + * node_id: list, // A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes |
|
36 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
37 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
38 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
39 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
40 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
41 | + * } $params |
|
42 | + * |
|
43 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
44 | + * @throws ClientResponseException if the status code of response is 4xx |
|
45 | + * @throws ServerResponseException if the status code of response is 5xx |
|
46 | + * |
|
47 | + * @return Elasticsearch|Promise |
|
48 | + */ |
|
49 | + public function cacheStats(array $params = []) |
|
50 | + { |
|
51 | + if (isset($params['node_id'])) { |
|
52 | + $url = '/_searchable_snapshots/' . $this->encode($params['node_id']) . '/cache/stats'; |
|
53 | + $method = 'GET'; |
|
54 | + } else { |
|
55 | + $url = '/_searchable_snapshots/cache/stats'; |
|
56 | + $method = 'GET'; |
|
57 | + } |
|
58 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
59 | + $headers = ['Accept' => 'application/json']; |
|
60 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
61 | + $request = $this->addOtelAttributes($params, ['node_id'], $request, 'searchable_snapshots.cache_stats'); |
|
62 | + return $this->client->sendRequest($request); |
|
63 | + } |
|
64 | + /** |
|
65 | + * Clear the cache of searchable snapshots. |
|
66 | + * |
|
67 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-apis.html |
|
68 | + * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release |
|
69 | + * |
|
70 | + * @param array{ |
|
71 | + * index: list, // A comma-separated list of index names |
|
72 | + * ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed) |
|
73 | + * allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) |
|
74 | + * expand_wildcards: enum, // Whether to expand wildcard expression to concrete indices that are open, closed or both. |
|
75 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
76 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
77 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
78 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
79 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
80 | + * } $params |
|
81 | + * |
|
82 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
83 | + * @throws ClientResponseException if the status code of response is 4xx |
|
84 | + * @throws ServerResponseException if the status code of response is 5xx |
|
85 | + * |
|
86 | + * @return Elasticsearch|Promise |
|
87 | + */ |
|
88 | + public function clearCache(array $params = []) |
|
89 | + { |
|
90 | + if (isset($params['index'])) { |
|
91 | + $url = '/' . $this->encode($params['index']) . '/_searchable_snapshots/cache/clear'; |
|
92 | + $method = 'POST'; |
|
93 | + } else { |
|
94 | + $url = '/_searchable_snapshots/cache/clear'; |
|
95 | + $method = 'POST'; |
|
96 | + } |
|
97 | + $url = $this->addQueryString($url, $params, ['ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
98 | + $headers = ['Accept' => 'application/json']; |
|
99 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
100 | + $request = $this->addOtelAttributes($params, ['index'], $request, 'searchable_snapshots.clear_cache'); |
|
101 | + return $this->client->sendRequest($request); |
|
102 | + } |
|
103 | + /** |
|
104 | + * Mount a snapshot as a searchable index. |
|
105 | + * |
|
106 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-api-mount-snapshot.html |
|
107 | + * |
|
108 | + * @param array{ |
|
109 | + * repository: string, // (REQUIRED) The name of the repository containing the snapshot of the index to mount |
|
110 | + * snapshot: string, // (REQUIRED) The name of the snapshot of the index to mount |
|
111 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
112 | + * wait_for_completion: boolean, // Should this request wait until the operation has completed before returning |
|
113 | + * storage: string, // Selects the kind of local storage used to accelerate searches. Experimental, and defaults to `full_copy` |
|
114 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
115 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
116 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
117 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
118 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
119 | + * body: array, // (REQUIRED) The restore configuration for mounting the snapshot as searchable |
|
120 | + * } $params |
|
121 | + * |
|
122 | + * @throws MissingParameterException if a required parameter is missing |
|
123 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
124 | + * @throws ClientResponseException if the status code of response is 4xx |
|
125 | + * @throws ServerResponseException if the status code of response is 5xx |
|
126 | + * |
|
127 | + * @return Elasticsearch|Promise |
|
128 | + */ |
|
129 | + public function mount(array $params = []) |
|
130 | + { |
|
131 | + $this->checkRequiredParameters(['repository', 'snapshot', 'body'], $params); |
|
132 | + $url = '/_snapshot/' . $this->encode($params['repository']) . '/' . $this->encode($params['snapshot']) . '/_mount'; |
|
133 | + $method = 'POST'; |
|
134 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'wait_for_completion', 'storage', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
135 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
136 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
137 | + $request = $this->addOtelAttributes($params, ['repository', 'snapshot'], $request, 'searchable_snapshots.mount'); |
|
138 | + return $this->client->sendRequest($request); |
|
139 | + } |
|
140 | + /** |
|
141 | + * Retrieve shard-level statistics about searchable snapshots. |
|
142 | + * |
|
143 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-apis.html |
|
144 | + * |
|
145 | + * @param array{ |
|
146 | + * index: list, // A comma-separated list of index names |
|
147 | + * level: enum, // Return stats aggregated at cluster, index or shard level |
|
148 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
149 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
150 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
151 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
152 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
153 | + * } $params |
|
154 | + * |
|
155 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
156 | + * @throws ClientResponseException if the status code of response is 4xx |
|
157 | + * @throws ServerResponseException if the status code of response is 5xx |
|
158 | + * |
|
159 | + * @return Elasticsearch|Promise |
|
160 | + */ |
|
161 | + public function stats(array $params = []) |
|
162 | + { |
|
163 | + if (isset($params['index'])) { |
|
164 | + $url = '/' . $this->encode($params['index']) . '/_searchable_snapshots/stats'; |
|
165 | + $method = 'GET'; |
|
166 | + } else { |
|
167 | + $url = '/_searchable_snapshots/stats'; |
|
168 | + $method = 'GET'; |
|
169 | + } |
|
170 | + $url = $this->addQueryString($url, $params, ['level', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
171 | + $headers = ['Accept' => 'application/json']; |
|
172 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
173 | + $request = $this->addOtelAttributes($params, ['index'], $request, 'searchable_snapshots.stats'); |
|
174 | + return $this->client->sendRequest($request); |
|
175 | + } |
|
176 | 176 | } |
@@ -25,407 +25,407 @@ |
||
25 | 25 | */ |
26 | 26 | class Ingest extends AbstractEndpoint |
27 | 27 | { |
28 | - /** |
|
29 | - * Deletes a geoip database configuration |
|
30 | - * |
|
31 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-geoip-database-api.html |
|
32 | - * |
|
33 | - * @param array{ |
|
34 | - * id: list, // (REQUIRED) A comma-separated list of geoip database configurations to delete |
|
35 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
36 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
37 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
38 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
39 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
40 | - * } $params |
|
41 | - * |
|
42 | - * @throws MissingParameterException if a required parameter is missing |
|
43 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
44 | - * @throws ClientResponseException if the status code of response is 4xx |
|
45 | - * @throws ServerResponseException if the status code of response is 5xx |
|
46 | - * |
|
47 | - * @return Elasticsearch|Promise |
|
48 | - */ |
|
49 | - public function deleteGeoipDatabase(array $params = []) |
|
50 | - { |
|
51 | - $this->checkRequiredParameters(['id'], $params); |
|
52 | - $url = '/_ingest/geoip/database/' . $this->encode($params['id']); |
|
53 | - $method = 'DELETE'; |
|
54 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
55 | - $headers = ['Accept' => 'application/json']; |
|
56 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
57 | - $request = $this->addOtelAttributes($params, ['id'], $request, 'ingest.delete_geoip_database'); |
|
58 | - return $this->client->sendRequest($request); |
|
59 | - } |
|
60 | - /** |
|
61 | - * Deletes an ip location database configuration |
|
62 | - * |
|
63 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-ip-location-database-api.html |
|
64 | - * |
|
65 | - * @param array{ |
|
66 | - * id: list, // (REQUIRED) A comma-separated list of ip location database configurations to delete |
|
67 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
68 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
69 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
70 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
71 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
72 | - * } $params |
|
73 | - * |
|
74 | - * @throws MissingParameterException if a required parameter is missing |
|
75 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
76 | - * @throws ClientResponseException if the status code of response is 4xx |
|
77 | - * @throws ServerResponseException if the status code of response is 5xx |
|
78 | - * |
|
79 | - * @return Elasticsearch|Promise |
|
80 | - */ |
|
81 | - public function deleteIpLocationDatabase(array $params = []) |
|
82 | - { |
|
83 | - $this->checkRequiredParameters(['id'], $params); |
|
84 | - $url = '/_ingest/ip_location/database/' . $this->encode($params['id']); |
|
85 | - $method = 'DELETE'; |
|
86 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
87 | - $headers = ['Accept' => 'application/json']; |
|
88 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
89 | - $request = $this->addOtelAttributes($params, ['id'], $request, 'ingest.delete_ip_location_database'); |
|
90 | - return $this->client->sendRequest($request); |
|
91 | - } |
|
92 | - /** |
|
93 | - * Deletes a pipeline. |
|
94 | - * |
|
95 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-pipeline-api.html |
|
96 | - * |
|
97 | - * @param array{ |
|
98 | - * id: string, // (REQUIRED) Pipeline ID |
|
99 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
100 | - * timeout: time, // Explicit operation timeout |
|
101 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
102 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
103 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
104 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
105 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
106 | - * } $params |
|
107 | - * |
|
108 | - * @throws MissingParameterException if a required parameter is missing |
|
109 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
110 | - * @throws ClientResponseException if the status code of response is 4xx |
|
111 | - * @throws ServerResponseException if the status code of response is 5xx |
|
112 | - * |
|
113 | - * @return Elasticsearch|Promise |
|
114 | - */ |
|
115 | - public function deletePipeline(array $params = []) |
|
116 | - { |
|
117 | - $this->checkRequiredParameters(['id'], $params); |
|
118 | - $url = '/_ingest/pipeline/' . $this->encode($params['id']); |
|
119 | - $method = 'DELETE'; |
|
120 | - $url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
121 | - $headers = ['Accept' => 'application/json']; |
|
122 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
123 | - $request = $this->addOtelAttributes($params, ['id'], $request, 'ingest.delete_pipeline'); |
|
124 | - return $this->client->sendRequest($request); |
|
125 | - } |
|
126 | - /** |
|
127 | - * Returns statistical information about geoip databases |
|
128 | - * |
|
129 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/geoip-stats-api.html |
|
130 | - * |
|
131 | - * @param array{ |
|
132 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
133 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
134 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
135 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
136 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
137 | - * } $params |
|
138 | - * |
|
139 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
140 | - * @throws ClientResponseException if the status code of response is 4xx |
|
141 | - * @throws ServerResponseException if the status code of response is 5xx |
|
142 | - * |
|
143 | - * @return Elasticsearch|Promise |
|
144 | - */ |
|
145 | - public function geoIpStats(array $params = []) |
|
146 | - { |
|
147 | - $url = '/_ingest/geoip/stats'; |
|
148 | - $method = 'GET'; |
|
149 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
150 | - $headers = ['Accept' => 'application/json']; |
|
151 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
152 | - $request = $this->addOtelAttributes($params, [], $request, 'ingest.geo_ip_stats'); |
|
153 | - return $this->client->sendRequest($request); |
|
154 | - } |
|
155 | - /** |
|
156 | - * Returns geoip database configuration. |
|
157 | - * |
|
158 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-geoip-database-api.html |
|
159 | - * |
|
160 | - * @param array{ |
|
161 | - * id: list, // A comma-separated list of geoip database configurations to get; use `*` to get all geoip database configurations |
|
162 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
163 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
164 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
165 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
166 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
167 | - * } $params |
|
168 | - * |
|
169 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
170 | - * @throws ClientResponseException if the status code of response is 4xx |
|
171 | - * @throws ServerResponseException if the status code of response is 5xx |
|
172 | - * |
|
173 | - * @return Elasticsearch|Promise |
|
174 | - */ |
|
175 | - public function getGeoipDatabase(array $params = []) |
|
176 | - { |
|
177 | - if (isset($params['id'])) { |
|
178 | - $url = '/_ingest/geoip/database/' . $this->encode($params['id']); |
|
179 | - $method = 'GET'; |
|
180 | - } else { |
|
181 | - $url = '/_ingest/geoip/database'; |
|
182 | - $method = 'GET'; |
|
183 | - } |
|
184 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
185 | - $headers = ['Accept' => 'application/json']; |
|
186 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
187 | - $request = $this->addOtelAttributes($params, ['id'], $request, 'ingest.get_geoip_database'); |
|
188 | - return $this->client->sendRequest($request); |
|
189 | - } |
|
190 | - /** |
|
191 | - * Returns the specified ip location database configuration |
|
192 | - * |
|
193 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-ip-location-database-api.html |
|
194 | - * |
|
195 | - * @param array{ |
|
196 | - * id: list, // A comma-separated list of ip location database configurations to get; use `*` to get all ip location database configurations |
|
197 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
198 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
199 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
200 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
201 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
202 | - * } $params |
|
203 | - * |
|
204 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
205 | - * @throws ClientResponseException if the status code of response is 4xx |
|
206 | - * @throws ServerResponseException if the status code of response is 5xx |
|
207 | - * |
|
208 | - * @return Elasticsearch|Promise |
|
209 | - */ |
|
210 | - public function getIpLocationDatabase(array $params = []) |
|
211 | - { |
|
212 | - if (isset($params['id'])) { |
|
213 | - $url = '/_ingest/ip_location/database/' . $this->encode($params['id']); |
|
214 | - $method = 'GET'; |
|
215 | - } else { |
|
216 | - $url = '/_ingest/ip_location/database'; |
|
217 | - $method = 'GET'; |
|
218 | - } |
|
219 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
220 | - $headers = ['Accept' => 'application/json']; |
|
221 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
222 | - $request = $this->addOtelAttributes($params, ['id'], $request, 'ingest.get_ip_location_database'); |
|
223 | - return $this->client->sendRequest($request); |
|
224 | - } |
|
225 | - /** |
|
226 | - * Returns a pipeline. |
|
227 | - * |
|
228 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-pipeline-api.html |
|
229 | - * |
|
230 | - * @param array{ |
|
231 | - * id: string, // Comma separated list of pipeline ids. Wildcards supported |
|
232 | - * summary: boolean, // Return pipelines without their definitions (default: false) |
|
233 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
234 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
235 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
236 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
237 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
238 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
239 | - * } $params |
|
240 | - * |
|
241 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
242 | - * @throws ClientResponseException if the status code of response is 4xx |
|
243 | - * @throws ServerResponseException if the status code of response is 5xx |
|
244 | - * |
|
245 | - * @return Elasticsearch|Promise |
|
246 | - */ |
|
247 | - public function getPipeline(array $params = []) |
|
248 | - { |
|
249 | - if (isset($params['id'])) { |
|
250 | - $url = '/_ingest/pipeline/' . $this->encode($params['id']); |
|
251 | - $method = 'GET'; |
|
252 | - } else { |
|
253 | - $url = '/_ingest/pipeline'; |
|
254 | - $method = 'GET'; |
|
255 | - } |
|
256 | - $url = $this->addQueryString($url, $params, ['summary', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
257 | - $headers = ['Accept' => 'application/json']; |
|
258 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
259 | - $request = $this->addOtelAttributes($params, ['id'], $request, 'ingest.get_pipeline'); |
|
260 | - return $this->client->sendRequest($request); |
|
261 | - } |
|
262 | - /** |
|
263 | - * Returns a list of the built-in patterns. |
|
264 | - * |
|
265 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/grok-processor.html#grok-processor-rest-get |
|
266 | - * |
|
267 | - * @param array{ |
|
268 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
269 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
270 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
271 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
272 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
273 | - * } $params |
|
274 | - * |
|
275 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
276 | - * @throws ClientResponseException if the status code of response is 4xx |
|
277 | - * @throws ServerResponseException if the status code of response is 5xx |
|
278 | - * |
|
279 | - * @return Elasticsearch|Promise |
|
280 | - */ |
|
281 | - public function processorGrok(array $params = []) |
|
282 | - { |
|
283 | - $url = '/_ingest/processor/grok'; |
|
284 | - $method = 'GET'; |
|
285 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
286 | - $headers = ['Accept' => 'application/json']; |
|
287 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
288 | - $request = $this->addOtelAttributes($params, [], $request, 'ingest.processor_grok'); |
|
289 | - return $this->client->sendRequest($request); |
|
290 | - } |
|
291 | - /** |
|
292 | - * Puts the configuration for a geoip database to be downloaded |
|
293 | - * |
|
294 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/put-geoip-database-api.html |
|
295 | - * |
|
296 | - * @param array{ |
|
297 | - * id: string, // (REQUIRED) The id of the database configuration |
|
298 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
299 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
300 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
301 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
302 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
303 | - * body: array, // (REQUIRED) The database configuration definition |
|
304 | - * } $params |
|
305 | - * |
|
306 | - * @throws MissingParameterException if a required parameter is missing |
|
307 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
308 | - * @throws ClientResponseException if the status code of response is 4xx |
|
309 | - * @throws ServerResponseException if the status code of response is 5xx |
|
310 | - * |
|
311 | - * @return Elasticsearch|Promise |
|
312 | - */ |
|
313 | - public function putGeoipDatabase(array $params = []) |
|
314 | - { |
|
315 | - $this->checkRequiredParameters(['id', 'body'], $params); |
|
316 | - $url = '/_ingest/geoip/database/' . $this->encode($params['id']); |
|
317 | - $method = 'PUT'; |
|
318 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
319 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
320 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
321 | - $request = $this->addOtelAttributes($params, ['id'], $request, 'ingest.put_geoip_database'); |
|
322 | - return $this->client->sendRequest($request); |
|
323 | - } |
|
324 | - /** |
|
325 | - * Puts the configuration for a ip location database to be downloaded |
|
326 | - * |
|
327 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/put-ip-location-database-api.html |
|
328 | - * |
|
329 | - * @param array{ |
|
330 | - * id: string, // (REQUIRED) The id of the database configuration |
|
331 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
332 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
333 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
334 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
335 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
336 | - * body: array, // (REQUIRED) The database configuration definition |
|
337 | - * } $params |
|
338 | - * |
|
339 | - * @throws MissingParameterException if a required parameter is missing |
|
340 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
341 | - * @throws ClientResponseException if the status code of response is 4xx |
|
342 | - * @throws ServerResponseException if the status code of response is 5xx |
|
343 | - * |
|
344 | - * @return Elasticsearch|Promise |
|
345 | - */ |
|
346 | - public function putIpLocationDatabase(array $params = []) |
|
347 | - { |
|
348 | - $this->checkRequiredParameters(['id', 'body'], $params); |
|
349 | - $url = '/_ingest/ip_location/database/' . $this->encode($params['id']); |
|
350 | - $method = 'PUT'; |
|
351 | - $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
352 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
353 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
354 | - $request = $this->addOtelAttributes($params, ['id'], $request, 'ingest.put_ip_location_database'); |
|
355 | - return $this->client->sendRequest($request); |
|
356 | - } |
|
357 | - /** |
|
358 | - * Creates or updates a pipeline. |
|
359 | - * |
|
360 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/put-pipeline-api.html |
|
361 | - * |
|
362 | - * @param array{ |
|
363 | - * id: string, // (REQUIRED) Pipeline ID |
|
364 | - * if_version: int, // Required version for optimistic concurrency control for pipeline updates |
|
365 | - * master_timeout: time, // Explicit operation timeout for connection to master node |
|
366 | - * timeout: time, // Explicit operation timeout |
|
367 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
368 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
369 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
370 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
371 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
372 | - * body: array, // (REQUIRED) The ingest definition |
|
373 | - * } $params |
|
374 | - * |
|
375 | - * @throws MissingParameterException if a required parameter is missing |
|
376 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
377 | - * @throws ClientResponseException if the status code of response is 4xx |
|
378 | - * @throws ServerResponseException if the status code of response is 5xx |
|
379 | - * |
|
380 | - * @return Elasticsearch|Promise |
|
381 | - */ |
|
382 | - public function putPipeline(array $params = []) |
|
383 | - { |
|
384 | - $this->checkRequiredParameters(['id', 'body'], $params); |
|
385 | - $url = '/_ingest/pipeline/' . $this->encode($params['id']); |
|
386 | - $method = 'PUT'; |
|
387 | - $url = $this->addQueryString($url, $params, ['if_version', 'master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
388 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
389 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
390 | - $request = $this->addOtelAttributes($params, ['id'], $request, 'ingest.put_pipeline'); |
|
391 | - return $this->client->sendRequest($request); |
|
392 | - } |
|
393 | - /** |
|
394 | - * Allows to simulate a pipeline with example documents. |
|
395 | - * |
|
396 | - * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/simulate-pipeline-api.html |
|
397 | - * |
|
398 | - * @param array{ |
|
399 | - * id: string, // Pipeline ID |
|
400 | - * verbose: boolean, // Verbose mode. Display data output for each processor in executed pipeline |
|
401 | - * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
402 | - * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
403 | - * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
404 | - * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
405 | - * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
406 | - * body: array, // (REQUIRED) The simulate definition |
|
407 | - * } $params |
|
408 | - * |
|
409 | - * @throws NoNodeAvailableException if all the hosts are offline |
|
410 | - * @throws ClientResponseException if the status code of response is 4xx |
|
411 | - * @throws ServerResponseException if the status code of response is 5xx |
|
412 | - * |
|
413 | - * @return Elasticsearch|Promise |
|
414 | - */ |
|
415 | - public function simulate(array $params = []) |
|
416 | - { |
|
417 | - $this->checkRequiredParameters(['body'], $params); |
|
418 | - if (isset($params['id'])) { |
|
419 | - $url = '/_ingest/pipeline/' . $this->encode($params['id']) . '/_simulate'; |
|
420 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
421 | - } else { |
|
422 | - $url = '/_ingest/pipeline/_simulate'; |
|
423 | - $method = empty($params['body']) ? 'GET' : 'POST'; |
|
424 | - } |
|
425 | - $url = $this->addQueryString($url, $params, ['verbose', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
426 | - $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
427 | - $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
428 | - $request = $this->addOtelAttributes($params, ['id'], $request, 'ingest.simulate'); |
|
429 | - return $this->client->sendRequest($request); |
|
430 | - } |
|
28 | + /** |
|
29 | + * Deletes a geoip database configuration |
|
30 | + * |
|
31 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-geoip-database-api.html |
|
32 | + * |
|
33 | + * @param array{ |
|
34 | + * id: list, // (REQUIRED) A comma-separated list of geoip database configurations to delete |
|
35 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
36 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
37 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
38 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
39 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
40 | + * } $params |
|
41 | + * |
|
42 | + * @throws MissingParameterException if a required parameter is missing |
|
43 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
44 | + * @throws ClientResponseException if the status code of response is 4xx |
|
45 | + * @throws ServerResponseException if the status code of response is 5xx |
|
46 | + * |
|
47 | + * @return Elasticsearch|Promise |
|
48 | + */ |
|
49 | + public function deleteGeoipDatabase(array $params = []) |
|
50 | + { |
|
51 | + $this->checkRequiredParameters(['id'], $params); |
|
52 | + $url = '/_ingest/geoip/database/' . $this->encode($params['id']); |
|
53 | + $method = 'DELETE'; |
|
54 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
55 | + $headers = ['Accept' => 'application/json']; |
|
56 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
57 | + $request = $this->addOtelAttributes($params, ['id'], $request, 'ingest.delete_geoip_database'); |
|
58 | + return $this->client->sendRequest($request); |
|
59 | + } |
|
60 | + /** |
|
61 | + * Deletes an ip location database configuration |
|
62 | + * |
|
63 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-ip-location-database-api.html |
|
64 | + * |
|
65 | + * @param array{ |
|
66 | + * id: list, // (REQUIRED) A comma-separated list of ip location database configurations to delete |
|
67 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
68 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
69 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
70 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
71 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
72 | + * } $params |
|
73 | + * |
|
74 | + * @throws MissingParameterException if a required parameter is missing |
|
75 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
76 | + * @throws ClientResponseException if the status code of response is 4xx |
|
77 | + * @throws ServerResponseException if the status code of response is 5xx |
|
78 | + * |
|
79 | + * @return Elasticsearch|Promise |
|
80 | + */ |
|
81 | + public function deleteIpLocationDatabase(array $params = []) |
|
82 | + { |
|
83 | + $this->checkRequiredParameters(['id'], $params); |
|
84 | + $url = '/_ingest/ip_location/database/' . $this->encode($params['id']); |
|
85 | + $method = 'DELETE'; |
|
86 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
87 | + $headers = ['Accept' => 'application/json']; |
|
88 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
89 | + $request = $this->addOtelAttributes($params, ['id'], $request, 'ingest.delete_ip_location_database'); |
|
90 | + return $this->client->sendRequest($request); |
|
91 | + } |
|
92 | + /** |
|
93 | + * Deletes a pipeline. |
|
94 | + * |
|
95 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-pipeline-api.html |
|
96 | + * |
|
97 | + * @param array{ |
|
98 | + * id: string, // (REQUIRED) Pipeline ID |
|
99 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
100 | + * timeout: time, // Explicit operation timeout |
|
101 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
102 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
103 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
104 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
105 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
106 | + * } $params |
|
107 | + * |
|
108 | + * @throws MissingParameterException if a required parameter is missing |
|
109 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
110 | + * @throws ClientResponseException if the status code of response is 4xx |
|
111 | + * @throws ServerResponseException if the status code of response is 5xx |
|
112 | + * |
|
113 | + * @return Elasticsearch|Promise |
|
114 | + */ |
|
115 | + public function deletePipeline(array $params = []) |
|
116 | + { |
|
117 | + $this->checkRequiredParameters(['id'], $params); |
|
118 | + $url = '/_ingest/pipeline/' . $this->encode($params['id']); |
|
119 | + $method = 'DELETE'; |
|
120 | + $url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
121 | + $headers = ['Accept' => 'application/json']; |
|
122 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
123 | + $request = $this->addOtelAttributes($params, ['id'], $request, 'ingest.delete_pipeline'); |
|
124 | + return $this->client->sendRequest($request); |
|
125 | + } |
|
126 | + /** |
|
127 | + * Returns statistical information about geoip databases |
|
128 | + * |
|
129 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/geoip-stats-api.html |
|
130 | + * |
|
131 | + * @param array{ |
|
132 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
133 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
134 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
135 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
136 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
137 | + * } $params |
|
138 | + * |
|
139 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
140 | + * @throws ClientResponseException if the status code of response is 4xx |
|
141 | + * @throws ServerResponseException if the status code of response is 5xx |
|
142 | + * |
|
143 | + * @return Elasticsearch|Promise |
|
144 | + */ |
|
145 | + public function geoIpStats(array $params = []) |
|
146 | + { |
|
147 | + $url = '/_ingest/geoip/stats'; |
|
148 | + $method = 'GET'; |
|
149 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
150 | + $headers = ['Accept' => 'application/json']; |
|
151 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
152 | + $request = $this->addOtelAttributes($params, [], $request, 'ingest.geo_ip_stats'); |
|
153 | + return $this->client->sendRequest($request); |
|
154 | + } |
|
155 | + /** |
|
156 | + * Returns geoip database configuration. |
|
157 | + * |
|
158 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-geoip-database-api.html |
|
159 | + * |
|
160 | + * @param array{ |
|
161 | + * id: list, // A comma-separated list of geoip database configurations to get; use `*` to get all geoip database configurations |
|
162 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
163 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
164 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
165 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
166 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
167 | + * } $params |
|
168 | + * |
|
169 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
170 | + * @throws ClientResponseException if the status code of response is 4xx |
|
171 | + * @throws ServerResponseException if the status code of response is 5xx |
|
172 | + * |
|
173 | + * @return Elasticsearch|Promise |
|
174 | + */ |
|
175 | + public function getGeoipDatabase(array $params = []) |
|
176 | + { |
|
177 | + if (isset($params['id'])) { |
|
178 | + $url = '/_ingest/geoip/database/' . $this->encode($params['id']); |
|
179 | + $method = 'GET'; |
|
180 | + } else { |
|
181 | + $url = '/_ingest/geoip/database'; |
|
182 | + $method = 'GET'; |
|
183 | + } |
|
184 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
185 | + $headers = ['Accept' => 'application/json']; |
|
186 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
187 | + $request = $this->addOtelAttributes($params, ['id'], $request, 'ingest.get_geoip_database'); |
|
188 | + return $this->client->sendRequest($request); |
|
189 | + } |
|
190 | + /** |
|
191 | + * Returns the specified ip location database configuration |
|
192 | + * |
|
193 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-ip-location-database-api.html |
|
194 | + * |
|
195 | + * @param array{ |
|
196 | + * id: list, // A comma-separated list of ip location database configurations to get; use `*` to get all ip location database configurations |
|
197 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
198 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
199 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
200 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
201 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
202 | + * } $params |
|
203 | + * |
|
204 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
205 | + * @throws ClientResponseException if the status code of response is 4xx |
|
206 | + * @throws ServerResponseException if the status code of response is 5xx |
|
207 | + * |
|
208 | + * @return Elasticsearch|Promise |
|
209 | + */ |
|
210 | + public function getIpLocationDatabase(array $params = []) |
|
211 | + { |
|
212 | + if (isset($params['id'])) { |
|
213 | + $url = '/_ingest/ip_location/database/' . $this->encode($params['id']); |
|
214 | + $method = 'GET'; |
|
215 | + } else { |
|
216 | + $url = '/_ingest/ip_location/database'; |
|
217 | + $method = 'GET'; |
|
218 | + } |
|
219 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
220 | + $headers = ['Accept' => 'application/json']; |
|
221 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
222 | + $request = $this->addOtelAttributes($params, ['id'], $request, 'ingest.get_ip_location_database'); |
|
223 | + return $this->client->sendRequest($request); |
|
224 | + } |
|
225 | + /** |
|
226 | + * Returns a pipeline. |
|
227 | + * |
|
228 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-pipeline-api.html |
|
229 | + * |
|
230 | + * @param array{ |
|
231 | + * id: string, // Comma separated list of pipeline ids. Wildcards supported |
|
232 | + * summary: boolean, // Return pipelines without their definitions (default: false) |
|
233 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
234 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
235 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
236 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
237 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
238 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
239 | + * } $params |
|
240 | + * |
|
241 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
242 | + * @throws ClientResponseException if the status code of response is 4xx |
|
243 | + * @throws ServerResponseException if the status code of response is 5xx |
|
244 | + * |
|
245 | + * @return Elasticsearch|Promise |
|
246 | + */ |
|
247 | + public function getPipeline(array $params = []) |
|
248 | + { |
|
249 | + if (isset($params['id'])) { |
|
250 | + $url = '/_ingest/pipeline/' . $this->encode($params['id']); |
|
251 | + $method = 'GET'; |
|
252 | + } else { |
|
253 | + $url = '/_ingest/pipeline'; |
|
254 | + $method = 'GET'; |
|
255 | + } |
|
256 | + $url = $this->addQueryString($url, $params, ['summary', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
257 | + $headers = ['Accept' => 'application/json']; |
|
258 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
259 | + $request = $this->addOtelAttributes($params, ['id'], $request, 'ingest.get_pipeline'); |
|
260 | + return $this->client->sendRequest($request); |
|
261 | + } |
|
262 | + /** |
|
263 | + * Returns a list of the built-in patterns. |
|
264 | + * |
|
265 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/grok-processor.html#grok-processor-rest-get |
|
266 | + * |
|
267 | + * @param array{ |
|
268 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
269 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
270 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
271 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
272 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
273 | + * } $params |
|
274 | + * |
|
275 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
276 | + * @throws ClientResponseException if the status code of response is 4xx |
|
277 | + * @throws ServerResponseException if the status code of response is 5xx |
|
278 | + * |
|
279 | + * @return Elasticsearch|Promise |
|
280 | + */ |
|
281 | + public function processorGrok(array $params = []) |
|
282 | + { |
|
283 | + $url = '/_ingest/processor/grok'; |
|
284 | + $method = 'GET'; |
|
285 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
286 | + $headers = ['Accept' => 'application/json']; |
|
287 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
288 | + $request = $this->addOtelAttributes($params, [], $request, 'ingest.processor_grok'); |
|
289 | + return $this->client->sendRequest($request); |
|
290 | + } |
|
291 | + /** |
|
292 | + * Puts the configuration for a geoip database to be downloaded |
|
293 | + * |
|
294 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/put-geoip-database-api.html |
|
295 | + * |
|
296 | + * @param array{ |
|
297 | + * id: string, // (REQUIRED) The id of the database configuration |
|
298 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
299 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
300 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
301 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
302 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
303 | + * body: array, // (REQUIRED) The database configuration definition |
|
304 | + * } $params |
|
305 | + * |
|
306 | + * @throws MissingParameterException if a required parameter is missing |
|
307 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
308 | + * @throws ClientResponseException if the status code of response is 4xx |
|
309 | + * @throws ServerResponseException if the status code of response is 5xx |
|
310 | + * |
|
311 | + * @return Elasticsearch|Promise |
|
312 | + */ |
|
313 | + public function putGeoipDatabase(array $params = []) |
|
314 | + { |
|
315 | + $this->checkRequiredParameters(['id', 'body'], $params); |
|
316 | + $url = '/_ingest/geoip/database/' . $this->encode($params['id']); |
|
317 | + $method = 'PUT'; |
|
318 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
319 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
320 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
321 | + $request = $this->addOtelAttributes($params, ['id'], $request, 'ingest.put_geoip_database'); |
|
322 | + return $this->client->sendRequest($request); |
|
323 | + } |
|
324 | + /** |
|
325 | + * Puts the configuration for a ip location database to be downloaded |
|
326 | + * |
|
327 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/put-ip-location-database-api.html |
|
328 | + * |
|
329 | + * @param array{ |
|
330 | + * id: string, // (REQUIRED) The id of the database configuration |
|
331 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
332 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
333 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
334 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
335 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
336 | + * body: array, // (REQUIRED) The database configuration definition |
|
337 | + * } $params |
|
338 | + * |
|
339 | + * @throws MissingParameterException if a required parameter is missing |
|
340 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
341 | + * @throws ClientResponseException if the status code of response is 4xx |
|
342 | + * @throws ServerResponseException if the status code of response is 5xx |
|
343 | + * |
|
344 | + * @return Elasticsearch|Promise |
|
345 | + */ |
|
346 | + public function putIpLocationDatabase(array $params = []) |
|
347 | + { |
|
348 | + $this->checkRequiredParameters(['id', 'body'], $params); |
|
349 | + $url = '/_ingest/ip_location/database/' . $this->encode($params['id']); |
|
350 | + $method = 'PUT'; |
|
351 | + $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
352 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
353 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
354 | + $request = $this->addOtelAttributes($params, ['id'], $request, 'ingest.put_ip_location_database'); |
|
355 | + return $this->client->sendRequest($request); |
|
356 | + } |
|
357 | + /** |
|
358 | + * Creates or updates a pipeline. |
|
359 | + * |
|
360 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/put-pipeline-api.html |
|
361 | + * |
|
362 | + * @param array{ |
|
363 | + * id: string, // (REQUIRED) Pipeline ID |
|
364 | + * if_version: int, // Required version for optimistic concurrency control for pipeline updates |
|
365 | + * master_timeout: time, // Explicit operation timeout for connection to master node |
|
366 | + * timeout: time, // Explicit operation timeout |
|
367 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
368 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
369 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
370 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
371 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
372 | + * body: array, // (REQUIRED) The ingest definition |
|
373 | + * } $params |
|
374 | + * |
|
375 | + * @throws MissingParameterException if a required parameter is missing |
|
376 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
377 | + * @throws ClientResponseException if the status code of response is 4xx |
|
378 | + * @throws ServerResponseException if the status code of response is 5xx |
|
379 | + * |
|
380 | + * @return Elasticsearch|Promise |
|
381 | + */ |
|
382 | + public function putPipeline(array $params = []) |
|
383 | + { |
|
384 | + $this->checkRequiredParameters(['id', 'body'], $params); |
|
385 | + $url = '/_ingest/pipeline/' . $this->encode($params['id']); |
|
386 | + $method = 'PUT'; |
|
387 | + $url = $this->addQueryString($url, $params, ['if_version', 'master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
388 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
389 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
390 | + $request = $this->addOtelAttributes($params, ['id'], $request, 'ingest.put_pipeline'); |
|
391 | + return $this->client->sendRequest($request); |
|
392 | + } |
|
393 | + /** |
|
394 | + * Allows to simulate a pipeline with example documents. |
|
395 | + * |
|
396 | + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/simulate-pipeline-api.html |
|
397 | + * |
|
398 | + * @param array{ |
|
399 | + * id: string, // Pipeline ID |
|
400 | + * verbose: boolean, // Verbose mode. Display data output for each processor in executed pipeline |
|
401 | + * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) |
|
402 | + * human: boolean, // Return human readable values for statistics. (DEFAULT: true) |
|
403 | + * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) |
|
404 | + * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
|
405 | + * filter_path: list, // A comma-separated list of filters used to reduce the response. |
|
406 | + * body: array, // (REQUIRED) The simulate definition |
|
407 | + * } $params |
|
408 | + * |
|
409 | + * @throws NoNodeAvailableException if all the hosts are offline |
|
410 | + * @throws ClientResponseException if the status code of response is 4xx |
|
411 | + * @throws ServerResponseException if the status code of response is 5xx |
|
412 | + * |
|
413 | + * @return Elasticsearch|Promise |
|
414 | + */ |
|
415 | + public function simulate(array $params = []) |
|
416 | + { |
|
417 | + $this->checkRequiredParameters(['body'], $params); |
|
418 | + if (isset($params['id'])) { |
|
419 | + $url = '/_ingest/pipeline/' . $this->encode($params['id']) . '/_simulate'; |
|
420 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
421 | + } else { |
|
422 | + $url = '/_ingest/pipeline/_simulate'; |
|
423 | + $method = empty($params['body']) ? 'GET' : 'POST'; |
|
424 | + } |
|
425 | + $url = $this->addQueryString($url, $params, ['verbose', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
|
426 | + $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
|
427 | + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); |
|
428 | + $request = $this->addOtelAttributes($params, ['id'], $request, 'ingest.simulate'); |
|
429 | + return $this->client->sendRequest($request); |
|
430 | + } |
|
431 | 431 | } |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | * Elasticsearch B.V licenses this file to you under the MIT License. |
12 | 12 | * See the LICENSE file in the project root for more information. |
13 | 13 | */ |
14 | -declare (strict_types=1); |
|
14 | +declare(strict_types=1); |
|
15 | 15 | namespace OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Endpoints; |
16 | 16 | |
17 | 17 | use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Exception\ClientResponseException; |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | public function deleteGeoipDatabase(array $params = []) |
50 | 50 | { |
51 | 51 | $this->checkRequiredParameters(['id'], $params); |
52 | - $url = '/_ingest/geoip/database/' . $this->encode($params['id']); |
|
52 | + $url = '/_ingest/geoip/database/'.$this->encode($params['id']); |
|
53 | 53 | $method = 'DELETE'; |
54 | 54 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
55 | 55 | $headers = ['Accept' => 'application/json']; |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | public function deleteIpLocationDatabase(array $params = []) |
82 | 82 | { |
83 | 83 | $this->checkRequiredParameters(['id'], $params); |
84 | - $url = '/_ingest/ip_location/database/' . $this->encode($params['id']); |
|
84 | + $url = '/_ingest/ip_location/database/'.$this->encode($params['id']); |
|
85 | 85 | $method = 'DELETE'; |
86 | 86 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
87 | 87 | $headers = ['Accept' => 'application/json']; |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | public function deletePipeline(array $params = []) |
116 | 116 | { |
117 | 117 | $this->checkRequiredParameters(['id'], $params); |
118 | - $url = '/_ingest/pipeline/' . $this->encode($params['id']); |
|
118 | + $url = '/_ingest/pipeline/'.$this->encode($params['id']); |
|
119 | 119 | $method = 'DELETE'; |
120 | 120 | $url = $this->addQueryString($url, $params, ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
121 | 121 | $headers = ['Accept' => 'application/json']; |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | public function getGeoipDatabase(array $params = []) |
176 | 176 | { |
177 | 177 | if (isset($params['id'])) { |
178 | - $url = '/_ingest/geoip/database/' . $this->encode($params['id']); |
|
178 | + $url = '/_ingest/geoip/database/'.$this->encode($params['id']); |
|
179 | 179 | $method = 'GET'; |
180 | 180 | } else { |
181 | 181 | $url = '/_ingest/geoip/database'; |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | public function getIpLocationDatabase(array $params = []) |
211 | 211 | { |
212 | 212 | if (isset($params['id'])) { |
213 | - $url = '/_ingest/ip_location/database/' . $this->encode($params['id']); |
|
213 | + $url = '/_ingest/ip_location/database/'.$this->encode($params['id']); |
|
214 | 214 | $method = 'GET'; |
215 | 215 | } else { |
216 | 216 | $url = '/_ingest/ip_location/database'; |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | public function getPipeline(array $params = []) |
248 | 248 | { |
249 | 249 | if (isset($params['id'])) { |
250 | - $url = '/_ingest/pipeline/' . $this->encode($params['id']); |
|
250 | + $url = '/_ingest/pipeline/'.$this->encode($params['id']); |
|
251 | 251 | $method = 'GET'; |
252 | 252 | } else { |
253 | 253 | $url = '/_ingest/pipeline'; |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | public function putGeoipDatabase(array $params = []) |
314 | 314 | { |
315 | 315 | $this->checkRequiredParameters(['id', 'body'], $params); |
316 | - $url = '/_ingest/geoip/database/' . $this->encode($params['id']); |
|
316 | + $url = '/_ingest/geoip/database/'.$this->encode($params['id']); |
|
317 | 317 | $method = 'PUT'; |
318 | 318 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
319 | 319 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | public function putIpLocationDatabase(array $params = []) |
347 | 347 | { |
348 | 348 | $this->checkRequiredParameters(['id', 'body'], $params); |
349 | - $url = '/_ingest/ip_location/database/' . $this->encode($params['id']); |
|
349 | + $url = '/_ingest/ip_location/database/'.$this->encode($params['id']); |
|
350 | 350 | $method = 'PUT'; |
351 | 351 | $url = $this->addQueryString($url, $params, ['pretty', 'human', 'error_trace', 'source', 'filter_path']); |
352 | 352 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | public function putPipeline(array $params = []) |
383 | 383 | { |
384 | 384 | $this->checkRequiredParameters(['id', 'body'], $params); |
385 | - $url = '/_ingest/pipeline/' . $this->encode($params['id']); |
|
385 | + $url = '/_ingest/pipeline/'.$this->encode($params['id']); |
|
386 | 386 | $method = 'PUT'; |
387 | 387 | $url = $this->addQueryString($url, $params, ['if_version', 'master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']); |
388 | 388 | $headers = ['Accept' => 'application/json', 'Content-Type' => 'application/json']; |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | { |
417 | 417 | $this->checkRequiredParameters(['body'], $params); |
418 | 418 | if (isset($params['id'])) { |
419 | - $url = '/_ingest/pipeline/' . $this->encode($params['id']) . '/_simulate'; |
|
419 | + $url = '/_ingest/pipeline/'.$this->encode($params['id']).'/_simulate'; |
|
420 | 420 | $method = empty($params['body']) ? 'GET' : 'POST'; |
421 | 421 | } else { |
422 | 422 | $url = '/_ingest/pipeline/_simulate'; |
@@ -23,8 +23,7 @@ |
||
23 | 23 | /** |
24 | 24 | * @generated This file is generated, please do not edit |
25 | 25 | */ |
26 | -class Ingest extends AbstractEndpoint |
|
27 | -{ |
|
26 | +class Ingest extends AbstractEndpoint { |
|
28 | 27 | /** |
29 | 28 | * Deletes a geoip database configuration |
30 | 29 | * |