1: | <?php |
2: | |
3: | declare(strict_types=1); |
4: | |
5: | /** |
6: | * SPDX-License-Identifier: Apache-2.0 |
7: | * |
8: | * The OpenSearch Contributors require contributions made to |
9: | * this file be licensed under the Apache-2.0 license or a |
10: | * compatible open source license. |
11: | * |
12: | * Modifications Copyright OpenSearch Contributors. See |
13: | * GitHub history for details. |
14: | */ |
15: | |
16: | namespace OpenSearch\Namespaces; |
17: | |
18: | use OpenSearch\Namespaces\AbstractNamespace; |
19: | |
20: | /** |
21: | * Class SecurityNamespace |
22: | * |
23: | * NOTE: This file is autogenerated using util/GenerateEndpoints.php |
24: | */ |
25: | class SecurityNamespace extends AbstractNamespace |
26: | { |
27: | /** |
28: | * Returns the authentication information. |
29: | * |
30: | * $params['auth_type'] = (string) The type of current authentication request. |
31: | * $params['verbose'] = (boolean) Indicates whether a verbose response should be returned. |
32: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
33: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
34: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
35: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
36: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
37: | * |
38: | * @param array $params Associative array of parameters |
39: | * @return array |
40: | */ |
41: | public function authinfo(array $params = []) |
42: | { |
43: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\Authinfo::class); |
44: | $endpoint->setParams($params); |
45: | |
46: | return $this->performRequest($endpoint); |
47: | } |
48: | |
49: | /** |
50: | * Returns the authorization token. |
51: | * |
52: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
53: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
54: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
55: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
56: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
57: | * |
58: | * @param array $params Associative array of parameters |
59: | * @return array |
60: | */ |
61: | public function authtoken(array $params = []) |
62: | { |
63: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\Authtoken::class); |
64: | $endpoint->setParams($params); |
65: | |
66: | return $this->performRequest($endpoint); |
67: | } |
68: | |
69: | /** |
70: | * Not supported for cache API. |
71: | * |
72: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
73: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
74: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
75: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
76: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
77: | * |
78: | * @param array $params Associative array of parameters |
79: | * @return array |
80: | */ |
81: | public function cache(array $params = []) |
82: | { |
83: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\Cache::class); |
84: | $endpoint->setParams($params); |
85: | |
86: | return $this->performRequest($endpoint); |
87: | } |
88: | |
89: | /** |
90: | * Check whether or not an upgrade can be performed and what resources can be updated. |
91: | * |
92: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
93: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
94: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
95: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
96: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
97: | * |
98: | * @param array $params Associative array of parameters |
99: | * @return array |
100: | */ |
101: | public function configUpgradeCheck(array $params = []) |
102: | { |
103: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\ConfigUpgradeCheck::class); |
104: | $endpoint->setParams($params); |
105: | |
106: | return $this->performRequest($endpoint); |
107: | } |
108: | |
109: | /** |
110: | * Helps cluster operator upgrade missing defaults and stale default definitions. |
111: | * |
112: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
113: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
114: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
115: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
116: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
117: | * |
118: | * @param array $params Associative array of parameters |
119: | * @return array |
120: | */ |
121: | public function configUpgradePerform(array $params = []) |
122: | { |
123: | $body = $this->extractArgument($params, 'body'); |
124: | |
125: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\ConfigUpgradePerform::class); |
126: | $endpoint->setParams($params); |
127: | $endpoint->setBody($body); |
128: | |
129: | return $this->performRequest($endpoint); |
130: | } |
131: | |
132: | /** |
133: | * Creates or replaces the permitted APIs. Accessible using Super Admin certificate or REST API permission. |
134: | * |
135: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
136: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
137: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
138: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
139: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
140: | * |
141: | * @param array $params Associative array of parameters |
142: | * @return array |
143: | */ |
144: | public function createAllowlist(array $params = []) |
145: | { |
146: | $body = $this->extractArgument($params, 'body'); |
147: | |
148: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\CreateAllowlist::class); |
149: | $endpoint->setParams($params); |
150: | $endpoint->setBody($body); |
151: | |
152: | return $this->performRequest($endpoint); |
153: | } |
154: | |
155: | /** |
156: | * Creates or replaces the multi-tenancy configuration. Only accessible to admins and users with REST API permissions. |
157: | * |
158: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
159: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
160: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
161: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
162: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
163: | * |
164: | * @param array $params Associative array of parameters |
165: | * @return array |
166: | */ |
167: | public function createUpdateTenancyConfig(array $params = []) |
168: | { |
169: | $body = $this->extractArgument($params, 'body'); |
170: | |
171: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\CreateUpdateTenancyConfig::class); |
172: | $endpoint->setParams($params); |
173: | $endpoint->setBody($body); |
174: | |
175: | return $this->performRequest($endpoint); |
176: | } |
177: | |
178: | /** |
179: | * Creates or replaces the specified user. Legacy API. |
180: | * |
181: | * $params['username'] = (string) The name of the user to be created. (Required) |
182: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
183: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
184: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
185: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
186: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
187: | * |
188: | * @param array $params Associative array of parameters |
189: | * @return array |
190: | */ |
191: | public function createUserLegacy(array $params = []) |
192: | { |
193: | $username = $this->extractArgument($params, 'username'); |
194: | $body = $this->extractArgument($params, 'body'); |
195: | |
196: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\CreateUserLegacy::class); |
197: | $endpoint->setParams($params); |
198: | $endpoint->setUsername($username); |
199: | $endpoint->setBody($body); |
200: | |
201: | return $this->performRequest($endpoint); |
202: | } |
203: | |
204: | /** |
205: | * Delete a specified action group. |
206: | * |
207: | * $params['action_group'] = (string) The name of the action group to delete. (Required) |
208: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
209: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
210: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
211: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
212: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
213: | * |
214: | * @param array $params Associative array of parameters |
215: | * @return array |
216: | */ |
217: | public function deleteActionGroup(array $params = []) |
218: | { |
219: | $action_group = $this->extractArgument($params, 'action_group'); |
220: | |
221: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\DeleteActionGroup::class); |
222: | $endpoint->setParams($params); |
223: | $endpoint->setActionGroup($action_group); |
224: | |
225: | return $this->performRequest($endpoint); |
226: | } |
227: | |
228: | /** |
229: | * Deletes all distinguished names in the specified cluster or node allow list. Only accessible to super-admins and with rest-api permissions when enabled. |
230: | * |
231: | * $params['cluster_name'] = (string) The cluster-name to delete from list of distinguished names. (Required) |
232: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
233: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
234: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
235: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
236: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
237: | * |
238: | * @param array $params Associative array of parameters |
239: | * @return array |
240: | */ |
241: | public function deleteDistinguishedName(array $params = []) |
242: | { |
243: | $cluster_name = $this->extractArgument($params, 'cluster_name'); |
244: | |
245: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\DeleteDistinguishedName::class); |
246: | $endpoint->setParams($params); |
247: | $endpoint->setClusterName($cluster_name); |
248: | |
249: | return $this->performRequest($endpoint); |
250: | } |
251: | |
252: | /** |
253: | * Delete the specified role. |
254: | * |
255: | * $params['role'] = (string) The name of the role to delete. (Required) |
256: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
257: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
258: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
259: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
260: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
261: | * |
262: | * @param array $params Associative array of parameters |
263: | * @return array |
264: | */ |
265: | public function deleteRole(array $params = []) |
266: | { |
267: | $role = $this->extractArgument($params, 'role'); |
268: | |
269: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\DeleteRole::class); |
270: | $endpoint->setParams($params); |
271: | $endpoint->setRole($role); |
272: | |
273: | return $this->performRequest($endpoint); |
274: | } |
275: | |
276: | /** |
277: | * Deletes the specified role mapping. |
278: | * |
279: | * $params['role'] = (string) The name of the role whose mapping needs to delete. (Required) |
280: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
281: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
282: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
283: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
284: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
285: | * |
286: | * @param array $params Associative array of parameters |
287: | * @return array |
288: | */ |
289: | public function deleteRoleMapping(array $params = []) |
290: | { |
291: | $role = $this->extractArgument($params, 'role'); |
292: | |
293: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\DeleteRoleMapping::class); |
294: | $endpoint->setParams($params); |
295: | $endpoint->setRole($role); |
296: | |
297: | return $this->performRequest($endpoint); |
298: | } |
299: | |
300: | /** |
301: | * Delete the specified tenant. |
302: | * |
303: | * $params['tenant'] = (string) The name of the tenant to delete. (Required) |
304: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
305: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
306: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
307: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
308: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
309: | * |
310: | * @param array $params Associative array of parameters |
311: | * @return array |
312: | */ |
313: | public function deleteTenant(array $params = []) |
314: | { |
315: | $tenant = $this->extractArgument($params, 'tenant'); |
316: | |
317: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\DeleteTenant::class); |
318: | $endpoint->setParams($params); |
319: | $endpoint->setTenant($tenant); |
320: | |
321: | return $this->performRequest($endpoint); |
322: | } |
323: | |
324: | /** |
325: | * Delete the specified user. |
326: | * |
327: | * $params['username'] = (string) The name of the user to delete. (Required) |
328: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
329: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
330: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
331: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
332: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
333: | * |
334: | * @param array $params Associative array of parameters |
335: | * @return array |
336: | */ |
337: | public function deleteUser(array $params = []) |
338: | { |
339: | $username = $this->extractArgument($params, 'username'); |
340: | |
341: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\DeleteUser::class); |
342: | $endpoint->setParams($params); |
343: | $endpoint->setUsername($username); |
344: | |
345: | return $this->performRequest($endpoint); |
346: | } |
347: | |
348: | /** |
349: | * Delete the specified user. Legacy API. |
350: | * |
351: | * $params['username'] = (string) The name of the user to delete. (Required) |
352: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
353: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
354: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
355: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
356: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
357: | * |
358: | * @param array $params Associative array of parameters |
359: | * @return array |
360: | */ |
361: | public function deleteUserLegacy(array $params = []) |
362: | { |
363: | $username = $this->extractArgument($params, 'username'); |
364: | |
365: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\DeleteUserLegacy::class); |
366: | $endpoint->setParams($params); |
367: | $endpoint->setUsername($username); |
368: | |
369: | return $this->performRequest($endpoint); |
370: | } |
371: | |
372: | /** |
373: | * Flushes the Security plugin user, authentication, and authorization cache. |
374: | * |
375: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
376: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
377: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
378: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
379: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
380: | * |
381: | * @param array $params Associative array of parameters |
382: | * @return array |
383: | */ |
384: | public function flushCache(array $params = []) |
385: | { |
386: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\FlushCache::class); |
387: | $endpoint->setParams($params); |
388: | |
389: | return $this->performRequest($endpoint); |
390: | } |
391: | |
392: | /** |
393: | * Generates On-Behalf-Of token for the current user. |
394: | * |
395: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
396: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
397: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
398: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
399: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
400: | * |
401: | * @param array $params Associative array of parameters |
402: | * @return array |
403: | */ |
404: | public function generateOboToken(array $params = []) |
405: | { |
406: | $body = $this->extractArgument($params, 'body'); |
407: | |
408: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\GenerateOboToken::class); |
409: | $endpoint->setParams($params); |
410: | $endpoint->setBody($body); |
411: | |
412: | return $this->performRequest($endpoint); |
413: | } |
414: | |
415: | /** |
416: | * Generates authorization token for the given user. |
417: | * |
418: | * $params['username'] = (string) The name of the user for whom an auth token is to be vended. (Required) |
419: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
420: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
421: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
422: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
423: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
424: | * |
425: | * @param array $params Associative array of parameters |
426: | * @return array |
427: | */ |
428: | public function generateUserToken(array $params = []) |
429: | { |
430: | $username = $this->extractArgument($params, 'username'); |
431: | |
432: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\GenerateUserToken::class); |
433: | $endpoint->setParams($params); |
434: | $endpoint->setUsername($username); |
435: | |
436: | return $this->performRequest($endpoint); |
437: | } |
438: | |
439: | /** |
440: | * Generates authorization token for the given user. Legacy API. Not Implemented. |
441: | * |
442: | * $params['username'] = (string) The name of the user for whom an auth token is to be vended. (Required) |
443: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
444: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
445: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
446: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
447: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
448: | * |
449: | * @param array $params Associative array of parameters |
450: | * @return array |
451: | */ |
452: | public function generateUserTokenLegacy(array $params = []) |
453: | { |
454: | $username = $this->extractArgument($params, 'username'); |
455: | |
456: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\GenerateUserTokenLegacy::class); |
457: | $endpoint->setParams($params); |
458: | $endpoint->setUsername($username); |
459: | |
460: | return $this->performRequest($endpoint); |
461: | } |
462: | |
463: | /** |
464: | * Returns account details for the current user. |
465: | * |
466: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
467: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
468: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
469: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
470: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
471: | * |
472: | * @param array $params Associative array of parameters |
473: | * @return array |
474: | */ |
475: | public function getAccountDetails(array $params = []) |
476: | { |
477: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\GetAccountDetails::class); |
478: | $endpoint->setParams($params); |
479: | |
480: | return $this->performRequest($endpoint); |
481: | } |
482: | |
483: | /** |
484: | * Retrieves one action group. |
485: | * |
486: | * $params['action_group'] = (string) The name of the action group to retrieve. (Required) |
487: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
488: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
489: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
490: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
491: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
492: | * |
493: | * @param array $params Associative array of parameters |
494: | * @return array |
495: | */ |
496: | public function getActionGroup(array $params = []) |
497: | { |
498: | $action_group = $this->extractArgument($params, 'action_group'); |
499: | |
500: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\GetActionGroup::class); |
501: | $endpoint->setParams($params); |
502: | $endpoint->setActionGroup($action_group); |
503: | |
504: | return $this->performRequest($endpoint); |
505: | } |
506: | |
507: | /** |
508: | * Retrieves the cluster security certificates. |
509: | * |
510: | * $params['cert_type'] = (string) The type of certificates (HTTP, TRANSPORT, ALL) to retrieve from all nodes. |
511: | * $params['timeout'] = (string) The maximum duration, in seconds, to be spent to retrieve certificates from all nodes. |
512: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
513: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
514: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
515: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
516: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
517: | * |
518: | * @param array $params Associative array of parameters |
519: | * @return array |
520: | */ |
521: | public function getAllCertificates(array $params = []) |
522: | { |
523: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\GetAllCertificates::class); |
524: | $endpoint->setParams($params); |
525: | |
526: | return $this->performRequest($endpoint); |
527: | } |
528: | |
529: | /** |
530: | * Retrieves the current list of allowed API accessible to normal user. |
531: | * |
532: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
533: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
534: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
535: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
536: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
537: | * |
538: | * @param array $params Associative array of parameters |
539: | * @return array |
540: | */ |
541: | public function getAllowlist(array $params = []) |
542: | { |
543: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\GetAllowlist::class); |
544: | $endpoint->setParams($params); |
545: | |
546: | return $this->performRequest($endpoint); |
547: | } |
548: | |
549: | /** |
550: | * Retrieves the audit configuration. |
551: | * |
552: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
553: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
554: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
555: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
556: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
557: | * |
558: | * @param array $params Associative array of parameters |
559: | * @return array |
560: | */ |
561: | public function getAuditConfiguration(array $params = []) |
562: | { |
563: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\GetAuditConfiguration::class); |
564: | $endpoint->setParams($params); |
565: | |
566: | return $this->performRequest($endpoint); |
567: | } |
568: | |
569: | /** |
570: | * Retrieves the cluster security certificates. |
571: | * |
572: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
573: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
574: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
575: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
576: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
577: | * |
578: | * @param array $params Associative array of parameters |
579: | * @return array |
580: | */ |
581: | public function getCertificates(array $params = []) |
582: | { |
583: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\GetCertificates::class); |
584: | $endpoint->setParams($params); |
585: | |
586: | return $this->performRequest($endpoint); |
587: | } |
588: | |
589: | /** |
590: | * Returns the current Security plugin configuration in JSON format. |
591: | * |
592: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
593: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
594: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
595: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
596: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
597: | * |
598: | * @param array $params Associative array of parameters |
599: | * @return array |
600: | */ |
601: | public function getConfiguration(array $params = []) |
602: | { |
603: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\GetConfiguration::class); |
604: | $endpoint->setParams($params); |
605: | |
606: | return $this->performRequest($endpoint); |
607: | } |
608: | |
609: | /** |
610: | * Retrieves the current security-dashboards plugin configuration. |
611: | * |
612: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
613: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
614: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
615: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
616: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
617: | * |
618: | * @param array $params Associative array of parameters |
619: | * @return array |
620: | */ |
621: | public function getDashboardsInfo(array $params = []) |
622: | { |
623: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\GetDashboardsInfo::class); |
624: | $endpoint->setParams($params); |
625: | |
626: | return $this->performRequest($endpoint); |
627: | } |
628: | |
629: | /** |
630: | * Retrieves distinguished names. Only accessible to super-admins and with rest-api permissions when enabled. |
631: | * |
632: | * $params['cluster_name'] = (string) The cluster-name to retrieve nodes DN setting for. (Required) |
633: | * $params['show_all'] = (boolean) A boolean flag to include/exclude static nodes DN from final result. |
634: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
635: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
636: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
637: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
638: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
639: | * |
640: | * @param array $params Associative array of parameters |
641: | * @return array |
642: | */ |
643: | public function getDistinguishedName(array $params = []) |
644: | { |
645: | $cluster_name = $this->extractArgument($params, 'cluster_name'); |
646: | |
647: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\GetDistinguishedName::class); |
648: | $endpoint->setParams($params); |
649: | $endpoint->setClusterName($cluster_name); |
650: | |
651: | return $this->performRequest($endpoint); |
652: | } |
653: | |
654: | /** |
655: | * Retrieves the given node's security certificates. |
656: | * |
657: | * $params['node_id'] = (string) The full-id of the node to retrieve certificates. |
658: | * $params['cert_type'] = (string) The type of certificates (HTTP, TRANSPORT, ALL) to retrieve for a node. |
659: | * $params['timeout'] = (string) The maximum duration, in seconds, to be spent to retrieve a node's certificates. |
660: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
661: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
662: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
663: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
664: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
665: | * |
666: | * @param array $params Associative array of parameters |
667: | * @return array |
668: | */ |
669: | public function getNodeCertificates(array $params = []) |
670: | { |
671: | $node_id = $this->extractArgument($params, 'node_id'); |
672: | |
673: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\GetNodeCertificates::class); |
674: | $endpoint->setParams($params); |
675: | $endpoint->setNodeId($node_id); |
676: | |
677: | return $this->performRequest($endpoint); |
678: | } |
679: | |
680: | /** |
681: | * Gets the evaluated REST API permissions for the currently logged in user. |
682: | * |
683: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
684: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
685: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
686: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
687: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
688: | * |
689: | * @param array $params Associative array of parameters |
690: | * @return array |
691: | */ |
692: | public function getPermissionsInfo(array $params = []) |
693: | { |
694: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\GetPermissionsInfo::class); |
695: | $endpoint->setParams($params); |
696: | |
697: | return $this->performRequest($endpoint); |
698: | } |
699: | |
700: | /** |
701: | * Retrieves one role. |
702: | * |
703: | * $params['role'] = (string) (Required) |
704: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
705: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
706: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
707: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
708: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
709: | * |
710: | * @param array $params Associative array of parameters |
711: | * @return array |
712: | */ |
713: | public function getRole(array $params = []) |
714: | { |
715: | $role = $this->extractArgument($params, 'role'); |
716: | |
717: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\GetRole::class); |
718: | $endpoint->setParams($params); |
719: | $endpoint->setRole($role); |
720: | |
721: | return $this->performRequest($endpoint); |
722: | } |
723: | |
724: | /** |
725: | * Retrieves one role mapping. |
726: | * |
727: | * $params['role'] = (string) (Required) |
728: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
729: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
730: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
731: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
732: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
733: | * |
734: | * @param array $params Associative array of parameters |
735: | * @return array |
736: | */ |
737: | public function getRoleMapping(array $params = []) |
738: | { |
739: | $role = $this->extractArgument($params, 'role'); |
740: | |
741: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\GetRoleMapping::class); |
742: | $endpoint->setParams($params); |
743: | $endpoint->setRole($role); |
744: | |
745: | return $this->performRequest($endpoint); |
746: | } |
747: | |
748: | /** |
749: | * Retrieves the SSL configuration information. |
750: | * |
751: | * $params['show_dn'] = (Array) A boolean flag to indicate whether all domain names should be returned. |
752: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
753: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
754: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
755: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
756: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
757: | * |
758: | * @param array $params Associative array of parameters |
759: | * @return array |
760: | */ |
761: | public function getSslinfo(array $params = []) |
762: | { |
763: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\GetSslinfo::class); |
764: | $endpoint->setParams($params); |
765: | |
766: | return $this->performRequest($endpoint); |
767: | } |
768: | |
769: | /** |
770: | * Retrieves multi-tenancy configuration. Only accessible to admins and users with REST API permissions. |
771: | * |
772: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
773: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
774: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
775: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
776: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
777: | * |
778: | * @param array $params Associative array of parameters |
779: | * @return array |
780: | */ |
781: | public function getTenancyConfig(array $params = []) |
782: | { |
783: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\GetTenancyConfig::class); |
784: | $endpoint->setParams($params); |
785: | |
786: | return $this->performRequest($endpoint); |
787: | } |
788: | |
789: | /** |
790: | * Retrieves one tenant. |
791: | * |
792: | * $params['tenant'] = (string) The name of the tenant to retrieve. (Required) |
793: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
794: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
795: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
796: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
797: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
798: | * |
799: | * @param array $params Associative array of parameters |
800: | * @return array |
801: | */ |
802: | public function getTenant(array $params = []) |
803: | { |
804: | $tenant = $this->extractArgument($params, 'tenant'); |
805: | |
806: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\GetTenant::class); |
807: | $endpoint->setParams($params); |
808: | $endpoint->setTenant($tenant); |
809: | |
810: | return $this->performRequest($endpoint); |
811: | } |
812: | |
813: | /** |
814: | * Retrieve one internal user. |
815: | * |
816: | * $params['username'] = (string) The name of the user to retrieve. (Required) |
817: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
818: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
819: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
820: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
821: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
822: | * |
823: | * @param array $params Associative array of parameters |
824: | * @return array |
825: | */ |
826: | public function getUser(array $params = []) |
827: | { |
828: | $username = $this->extractArgument($params, 'username'); |
829: | |
830: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\GetUser::class); |
831: | $endpoint->setParams($params); |
832: | $endpoint->setUsername($username); |
833: | |
834: | return $this->performRequest($endpoint); |
835: | } |
836: | |
837: | /** |
838: | * Retrieve one user. Legacy API. |
839: | * |
840: | * $params['username'] = (string) The name of the user to retrieve. (Required) |
841: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
842: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
843: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
844: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
845: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
846: | * |
847: | * @param array $params Associative array of parameters |
848: | * @return array |
849: | */ |
850: | public function getUserLegacy(array $params = []) |
851: | { |
852: | $username = $this->extractArgument($params, 'username'); |
853: | |
854: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\GetUserLegacy::class); |
855: | $endpoint->setParams($params); |
856: | $endpoint->setUsername($username); |
857: | |
858: | return $this->performRequest($endpoint); |
859: | } |
860: | |
861: | /** |
862: | * Retrieve all internal users. Legacy API. |
863: | * |
864: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
865: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
866: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
867: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
868: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
869: | * |
870: | * @param array $params Associative array of parameters |
871: | * @return array |
872: | */ |
873: | public function getUsersLegacy(array $params = []) |
874: | { |
875: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\GetUsersLegacy::class); |
876: | $endpoint->setParams($params); |
877: | |
878: | return $this->performRequest($endpoint); |
879: | } |
880: | |
881: | /** |
882: | * Checks to see if the Security plugin is up and running. |
883: | * |
884: | * $params['mode'] = (string) A flag to indicate whether service should consider security-plugin's status before returning health response. `strict` mode indicates service should check security plugin status. |
885: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
886: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
887: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
888: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
889: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
890: | * |
891: | * @param array $params Associative array of parameters |
892: | * @return array |
893: | */ |
894: | public function health(array $params = []) |
895: | { |
896: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\Health::class); |
897: | $endpoint->setParams($params); |
898: | |
899: | return $this->performRequest($endpoint); |
900: | } |
901: | |
902: | /** |
903: | * Migrates security configuration from v6 to v7. |
904: | * |
905: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
906: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
907: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
908: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
909: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
910: | * |
911: | * @param array $params Associative array of parameters |
912: | * @return array |
913: | */ |
914: | public function migrate(array $params = []) |
915: | { |
916: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\Migrate::class); |
917: | $endpoint->setParams($params); |
918: | |
919: | return $this->performRequest($endpoint); |
920: | } |
921: | |
922: | /** |
923: | * Updates individual attributes of an action group. |
924: | * |
925: | * $params['action_group'] = (string) The name of the action group to update. (Required) |
926: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
927: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
928: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
929: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
930: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
931: | * |
932: | * @param array $params Associative array of parameters |
933: | * @return array |
934: | */ |
935: | public function patchActionGroup(array $params = []) |
936: | { |
937: | $action_group = $this->extractArgument($params, 'action_group'); |
938: | $body = $this->extractArgument($params, 'body'); |
939: | |
940: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\PatchActionGroup::class); |
941: | $endpoint->setParams($params); |
942: | $endpoint->setActionGroup($action_group); |
943: | $endpoint->setBody($body); |
944: | |
945: | return $this->performRequest($endpoint); |
946: | } |
947: | |
948: | /** |
949: | * Updates the current list of allowed API accessible to normal user. |
950: | * |
951: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
952: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
953: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
954: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
955: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
956: | * |
957: | * @param array $params Associative array of parameters |
958: | * @return array |
959: | */ |
960: | public function patchAllowlist(array $params = []) |
961: | { |
962: | $body = $this->extractArgument($params, 'body'); |
963: | |
964: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\PatchAllowlist::class); |
965: | $endpoint->setParams($params); |
966: | $endpoint->setBody($body); |
967: | |
968: | return $this->performRequest($endpoint); |
969: | } |
970: | |
971: | /** |
972: | * A PATCH call is used to update specified fields in the audit configuration. |
973: | * |
974: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
975: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
976: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
977: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
978: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
979: | * |
980: | * @param array $params Associative array of parameters |
981: | * @return array |
982: | */ |
983: | public function patchAuditConfiguration(array $params = []) |
984: | { |
985: | $body = $this->extractArgument($params, 'body'); |
986: | |
987: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\PatchAuditConfiguration::class); |
988: | $endpoint->setParams($params); |
989: | $endpoint->setBody($body); |
990: | |
991: | return $this->performRequest($endpoint); |
992: | } |
993: | |
994: | /** |
995: | * A PATCH call is used to update the existing configuration using the REST API. Only accessible by admins and users with rest api access and only when put or patch is enabled. |
996: | * |
997: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
998: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
999: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
1000: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1001: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
1002: | * |
1003: | * @param array $params Associative array of parameters |
1004: | * @return array |
1005: | */ |
1006: | public function patchConfiguration(array $params = []) |
1007: | { |
1008: | $body = $this->extractArgument($params, 'body'); |
1009: | |
1010: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\PatchConfiguration::class); |
1011: | $endpoint->setParams($params); |
1012: | $endpoint->setBody($body); |
1013: | |
1014: | return $this->performRequest($endpoint); |
1015: | } |
1016: | |
1017: | /** |
1018: | * Updates a distinguished cluster name for a specific cluster. Only accessible to super-admins and with rest-api permissions when enabled. |
1019: | * |
1020: | * $params['cluster_name'] = (string) The cluster-name to update nodesDn value. (Required) |
1021: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
1022: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
1023: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
1024: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1025: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
1026: | * |
1027: | * @param array $params Associative array of parameters |
1028: | * @return array |
1029: | */ |
1030: | public function patchDistinguishedName(array $params = []) |
1031: | { |
1032: | $cluster_name = $this->extractArgument($params, 'cluster_name'); |
1033: | $body = $this->extractArgument($params, 'body'); |
1034: | |
1035: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\PatchDistinguishedName::class); |
1036: | $endpoint->setParams($params); |
1037: | $endpoint->setClusterName($cluster_name); |
1038: | $endpoint->setBody($body); |
1039: | |
1040: | return $this->performRequest($endpoint); |
1041: | } |
1042: | |
1043: | /** |
1044: | * Bulk update of distinguished names. Only accessible to super-admins and with rest-api permissions when enabled. |
1045: | * |
1046: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
1047: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
1048: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
1049: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1050: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
1051: | * |
1052: | * @param array $params Associative array of parameters |
1053: | * @return array |
1054: | */ |
1055: | public function patchDistinguishedNames(array $params = []) |
1056: | { |
1057: | $body = $this->extractArgument($params, 'body'); |
1058: | |
1059: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\PatchDistinguishedNames::class); |
1060: | $endpoint->setParams($params); |
1061: | $endpoint->setBody($body); |
1062: | |
1063: | return $this->performRequest($endpoint); |
1064: | } |
1065: | |
1066: | /** |
1067: | * Updates individual attributes of a role. |
1068: | * |
1069: | * $params['role'] = (string) The name of the role to update. (Required) |
1070: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
1071: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
1072: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
1073: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1074: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
1075: | * |
1076: | * @param array $params Associative array of parameters |
1077: | * @return array |
1078: | */ |
1079: | public function patchRole(array $params = []) |
1080: | { |
1081: | $role = $this->extractArgument($params, 'role'); |
1082: | $body = $this->extractArgument($params, 'body'); |
1083: | |
1084: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\PatchRole::class); |
1085: | $endpoint->setParams($params); |
1086: | $endpoint->setRole($role); |
1087: | $endpoint->setBody($body); |
1088: | |
1089: | return $this->performRequest($endpoint); |
1090: | } |
1091: | |
1092: | /** |
1093: | * Updates individual attributes of a role mapping. |
1094: | * |
1095: | * $params['role'] = (string) The name of the role to update role-mapping for. (Required) |
1096: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
1097: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
1098: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
1099: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1100: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
1101: | * |
1102: | * @param array $params Associative array of parameters |
1103: | * @return array |
1104: | */ |
1105: | public function patchRoleMapping(array $params = []) |
1106: | { |
1107: | $role = $this->extractArgument($params, 'role'); |
1108: | $body = $this->extractArgument($params, 'body'); |
1109: | |
1110: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\PatchRoleMapping::class); |
1111: | $endpoint->setParams($params); |
1112: | $endpoint->setRole($role); |
1113: | $endpoint->setBody($body); |
1114: | |
1115: | return $this->performRequest($endpoint); |
1116: | } |
1117: | |
1118: | /** |
1119: | * Add, delete, or modify a single tenant. |
1120: | * |
1121: | * $params['tenant'] = (string) The name of the tenant to update. (Required) |
1122: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
1123: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
1124: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
1125: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1126: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
1127: | * |
1128: | * @param array $params Associative array of parameters |
1129: | * @return array |
1130: | */ |
1131: | public function patchTenant(array $params = []) |
1132: | { |
1133: | $tenant = $this->extractArgument($params, 'tenant'); |
1134: | $body = $this->extractArgument($params, 'body'); |
1135: | |
1136: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\PatchTenant::class); |
1137: | $endpoint->setParams($params); |
1138: | $endpoint->setTenant($tenant); |
1139: | $endpoint->setBody($body); |
1140: | |
1141: | return $this->performRequest($endpoint); |
1142: | } |
1143: | |
1144: | /** |
1145: | * Updates individual attributes of an internal user. |
1146: | * |
1147: | * $params['username'] = (string) The name of the user to update. (Required) |
1148: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
1149: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
1150: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
1151: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1152: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
1153: | * |
1154: | * @param array $params Associative array of parameters |
1155: | * @return array |
1156: | */ |
1157: | public function patchUser(array $params = []) |
1158: | { |
1159: | $username = $this->extractArgument($params, 'username'); |
1160: | $body = $this->extractArgument($params, 'body'); |
1161: | |
1162: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\PatchUser::class); |
1163: | $endpoint->setParams($params); |
1164: | $endpoint->setUsername($username); |
1165: | $endpoint->setBody($body); |
1166: | |
1167: | return $this->performRequest($endpoint); |
1168: | } |
1169: | |
1170: | /** |
1171: | * Updates the current security-dashboards plugin configuration. |
1172: | * |
1173: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
1174: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
1175: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
1176: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1177: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
1178: | * |
1179: | * @param array $params Associative array of parameters |
1180: | * @return array |
1181: | */ |
1182: | public function postDashboardsInfo(array $params = []) |
1183: | { |
1184: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\PostDashboardsInfo::class); |
1185: | $endpoint->setParams($params); |
1186: | |
1187: | return $this->performRequest($endpoint); |
1188: | } |
1189: | |
1190: | /** |
1191: | * Reload HTTP layer communication certificates. |
1192: | * |
1193: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
1194: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
1195: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
1196: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1197: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
1198: | * |
1199: | * @param array $params Associative array of parameters |
1200: | * @return array |
1201: | */ |
1202: | public function reloadHttpCertificates(array $params = []) |
1203: | { |
1204: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\ReloadHttpCertificates::class); |
1205: | $endpoint->setParams($params); |
1206: | |
1207: | return $this->performRequest($endpoint); |
1208: | } |
1209: | |
1210: | /** |
1211: | * Reload Transport layer communication certificates. |
1212: | * |
1213: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
1214: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
1215: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
1216: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1217: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
1218: | * |
1219: | * @param array $params Associative array of parameters |
1220: | * @return array |
1221: | */ |
1222: | public function reloadTransportCertificates(array $params = []) |
1223: | { |
1224: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\ReloadTransportCertificates::class); |
1225: | $endpoint->setParams($params); |
1226: | |
1227: | return $this->performRequest($endpoint); |
1228: | } |
1229: | |
1230: | /** |
1231: | * Retrieves the tenant names if any exist. Only accessible to super admins or kibanaserver user. |
1232: | * |
1233: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
1234: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
1235: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
1236: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1237: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
1238: | * |
1239: | * @param array $params Associative array of parameters |
1240: | * @return array |
1241: | */ |
1242: | public function tenantInfo(array $params = []) |
1243: | { |
1244: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\TenantInfo::class); |
1245: | $endpoint->setParams($params); |
1246: | |
1247: | return $this->performRequest($endpoint); |
1248: | } |
1249: | |
1250: | /** |
1251: | * Updates the audit configuration. |
1252: | * |
1253: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
1254: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
1255: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
1256: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1257: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
1258: | * |
1259: | * @param array $params Associative array of parameters |
1260: | * @return array |
1261: | */ |
1262: | public function updateAuditConfiguration(array $params = []) |
1263: | { |
1264: | $body = $this->extractArgument($params, 'body'); |
1265: | |
1266: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\UpdateAuditConfiguration::class); |
1267: | $endpoint->setParams($params); |
1268: | $endpoint->setBody($body); |
1269: | |
1270: | return $this->performRequest($endpoint); |
1271: | } |
1272: | |
1273: | /** |
1274: | * Adds or updates the existing configuration using the REST API. Only accessible by admins and users with rest api access and only when put or patch is enabled. |
1275: | * |
1276: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
1277: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
1278: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
1279: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1280: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
1281: | * |
1282: | * @param array $params Associative array of parameters |
1283: | * @return array |
1284: | */ |
1285: | public function updateConfiguration(array $params = []) |
1286: | { |
1287: | $body = $this->extractArgument($params, 'body'); |
1288: | |
1289: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\UpdateConfiguration::class); |
1290: | $endpoint->setParams($params); |
1291: | $endpoint->setBody($body); |
1292: | |
1293: | return $this->performRequest($endpoint); |
1294: | } |
1295: | |
1296: | /** |
1297: | * Adds or updates the specified distinguished names in the cluster or node allow list. Only accessible to super-admins and with rest-api permissions when enabled. |
1298: | * |
1299: | * $params['cluster_name'] = (string) The cluster-name to create/update nodesDn value for. (Required) |
1300: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
1301: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
1302: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
1303: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1304: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
1305: | * |
1306: | * @param array $params Associative array of parameters |
1307: | * @return array |
1308: | */ |
1309: | public function updateDistinguishedName(array $params = []) |
1310: | { |
1311: | $cluster_name = $this->extractArgument($params, 'cluster_name'); |
1312: | $body = $this->extractArgument($params, 'body'); |
1313: | |
1314: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\UpdateDistinguishedName::class); |
1315: | $endpoint->setParams($params); |
1316: | $endpoint->setClusterName($cluster_name); |
1317: | $endpoint->setBody($body); |
1318: | |
1319: | return $this->performRequest($endpoint); |
1320: | } |
1321: | |
1322: | /** |
1323: | * Checks whether the v6 security configuration is valid and ready to be migrated to v7. |
1324: | * |
1325: | * $params['accept_invalid'] = (boolean) A boolean flag to indicate whether invalid v6 configuration should be allowed. |
1326: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
1327: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
1328: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
1329: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1330: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
1331: | * |
1332: | * @param array $params Associative array of parameters |
1333: | * @return array |
1334: | */ |
1335: | public function validate(array $params = []) |
1336: | { |
1337: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\Validate::class); |
1338: | $endpoint->setParams($params); |
1339: | |
1340: | return $this->performRequest($endpoint); |
1341: | } |
1342: | |
1343: | /** |
1344: | * Gets the user identity related information for currently logged in user. |
1345: | * |
1346: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
1347: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
1348: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
1349: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1350: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
1351: | * |
1352: | * @param array $params Associative array of parameters |
1353: | * @return array |
1354: | */ |
1355: | public function whoAmI(array $params = []) |
1356: | { |
1357: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\WhoAmI::class); |
1358: | $endpoint->setParams($params); |
1359: | |
1360: | return $this->performRequest($endpoint); |
1361: | } |
1362: | |
1363: | /** |
1364: | * Gets the user identity related information for currently logged in user. User needs to have access to this endpoint when authorization at REST layer is enabled. |
1365: | * |
1366: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
1367: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
1368: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
1369: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1370: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
1371: | * |
1372: | * @param array $params Associative array of parameters |
1373: | * @return array |
1374: | */ |
1375: | public function whoAmIProtected(array $params = []) |
1376: | { |
1377: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\WhoAmIProtected::class); |
1378: | $endpoint->setParams($params); |
1379: | |
1380: | return $this->performRequest($endpoint); |
1381: | } |
1382: | |
1383: | /** |
1384: | * Changes the password for the current user. |
1385: | * |
1386: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. |
1387: | * $params['human'] = (boolean) Whether to return human readable values for statistics. |
1388: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. |
1389: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1390: | * $params['filter_path'] = (any) Comma-separated list of filters used to reduce the response. |
1391: | * $params['current_password'] = (string) The current password |
1392: | * $params['password'] = (string) New password |
1393: | * |
1394: | * @param array $params Associative array of parameters |
1395: | * @return array |
1396: | */ |
1397: | public function changePassword(array $params = []) |
1398: | { |
1399: | $body = $this->extractArgument($params, 'body'); |
1400: | if ($body === null) { |
1401: | $body = [ |
1402: | 'current_password' => $this->extractArgument($params, 'current_password'), |
1403: | 'password' => $this->extractArgument($params, 'password'), |
1404: | ]; |
1405: | } |
1406: | |
1407: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\ChangePassword::class); |
1408: | $endpoint->setParams($params); |
1409: | $endpoint->setBody($body); |
1410: | |
1411: | return $this->performRequest($endpoint); |
1412: | } |
1413: | /** |
1414: | * Creates or replaces the specified action group. |
1415: | * |
1416: | * $params['action_group'] = (string) The name of the action group to create or replace. (Required) |
1417: | * $params['allowed_actions'] = (array) list of allowed actions |
1418: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. |
1419: | * $params['human'] = (boolean) Whether to return human readable values for statistics. |
1420: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. |
1421: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1422: | * $params['filter_path'] = (any) Comma-separated list of filters used to reduce the response. |
1423: | * |
1424: | * @param array $params Associative array of parameters |
1425: | * @return array |
1426: | */ |
1427: | public function createActionGroup(array $params = []) |
1428: | { |
1429: | $action_group = $this->extractArgument($params, 'action_group'); |
1430: | $body = $this->extractArgument($params, 'body'); |
1431: | if ($body === null) { |
1432: | $body = [ |
1433: | 'allowed_actions' => $this->extractArgument($params, 'allowed_actions'), |
1434: | ]; |
1435: | } |
1436: | |
1437: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\CreateActionGroup::class); |
1438: | $endpoint->setParams($params); |
1439: | $endpoint->setActionGroup($action_group); |
1440: | $endpoint->setBody($body); |
1441: | |
1442: | return $this->performRequest($endpoint); |
1443: | } |
1444: | /** |
1445: | * Creates or replaces the specified role mapping. |
1446: | * |
1447: | * $params['role'] = (string) (Required) |
1448: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. |
1449: | * $params['human'] = (boolean) Whether to return human readable values for statistics. |
1450: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. |
1451: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1452: | * $params['filter_path'] = (any) Comma-separated list of filters used to reduce the response. |
1453: | * $params['backend_roles'] = (array) |
1454: | * $params['hosts'] = (array) |
1455: | * $params['users'] = (array) |
1456: | * |
1457: | * @param array $params Associative array of parameters |
1458: | * @return array |
1459: | */ |
1460: | public function createRoleMapping(array $params = []) |
1461: | { |
1462: | $role = $this->extractArgument($params, 'role'); |
1463: | $body = $this->extractArgument($params, 'body'); |
1464: | if ($body === null) { |
1465: | $body = array_filter([ |
1466: | 'backend_roles' => $this->extractArgument($params, 'backend_roles'), |
1467: | 'hosts' => $this->extractArgument($params, 'hosts'), |
1468: | 'users' => $this->extractArgument($params, 'users'), |
1469: | ]); |
1470: | } |
1471: | |
1472: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\CreateRoleMapping::class); |
1473: | $endpoint->setParams($params); |
1474: | $endpoint->setRole($role); |
1475: | $endpoint->setBody($body); |
1476: | |
1477: | return $this->performRequest($endpoint); |
1478: | } |
1479: | /** |
1480: | * Creates or replaces the specified role. |
1481: | * |
1482: | * $params['role'] = (string) (Required) |
1483: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. |
1484: | * $params['human'] = (boolean) Whether to return human readable values for statistics. |
1485: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. |
1486: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1487: | * $params['filter_path'] = (any) Comma-separated list of filters used to reduce the response. |
1488: | * $params['cluster_permissions'] = (array) |
1489: | * $params['index_permissions'] = (array) |
1490: | * $params['tenant_permissions'] = (array) |
1491: | * |
1492: | * @param array $params Associative array of parameters |
1493: | * @return array |
1494: | */ |
1495: | public function createRole(array $params = []) |
1496: | { |
1497: | $role = $this->extractArgument($params, 'role'); |
1498: | $body = $this->extractArgument($params, 'body'); |
1499: | if ($body === null) { |
1500: | $body = array_filter([ |
1501: | 'cluster_permissions' => $this->extractArgument($params, 'cluster_permissions'), |
1502: | 'index_permissions' => $this->extractArgument($params, 'index_permissions'), |
1503: | 'tenant_permissions' => $this->extractArgument($params, 'tenant_permissions'), |
1504: | ]); |
1505: | } |
1506: | |
1507: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\CreateRole::class); |
1508: | $endpoint->setParams($params); |
1509: | $endpoint->setRole($role); |
1510: | $endpoint->setBody($body); |
1511: | |
1512: | return $this->performRequest($endpoint); |
1513: | } |
1514: | /** |
1515: | * Creates or replaces the specified tenant. |
1516: | * |
1517: | * $params['tenant'] = (string) The name of the tenant to create |
1518: | * $params['description'] = (string) Description of the tenant |
1519: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. |
1520: | * $params['human'] = (boolean) Whether to return human readable values for statistics. |
1521: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. |
1522: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1523: | * $params['filter_path'] = (any) Comma-separated list of filters used to reduce the response. |
1524: | * |
1525: | * @param array $params Associative array of parameters |
1526: | * @return array |
1527: | */ |
1528: | public function createTenant(array $params = []) |
1529: | { |
1530: | $tenant = $this->extractArgument($params, 'tenant'); |
1531: | $body = $this->extractArgument($params, 'body'); |
1532: | if ($body === null) { |
1533: | $body = [ |
1534: | 'description' => $this->extractArgument($params, 'description'), |
1535: | ]; |
1536: | } |
1537: | |
1538: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\CreateTenant::class); |
1539: | $endpoint->setParams($params); |
1540: | $endpoint->setTenant($tenant); |
1541: | $endpoint->setBody($body); |
1542: | |
1543: | return $this->performRequest($endpoint); |
1544: | } |
1545: | /** |
1546: | * Creates or replaces the specified user. |
1547: | * |
1548: | * $params['username'] = (string) (Required) |
1549: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. |
1550: | * $params['human'] = (boolean) Whether to return human readable values for statistics. |
1551: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. |
1552: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1553: | * $params['filter_path'] = (any) Comma-separated list of filters used to reduce the response. |
1554: | * $params['password'] = (string) |
1555: | * $params['opendistro_security_roles'] = (array) |
1556: | * $params['backend_roles'] = (array) |
1557: | * $params['attributes'] = (array) |
1558: | * |
1559: | * @param array $params Associative array of parameters |
1560: | * @return array |
1561: | */ |
1562: | public function createUser(array $params = []) |
1563: | { |
1564: | $username = $this->extractArgument($params, 'username'); |
1565: | $body = $this->extractArgument($params, 'body'); |
1566: | if ($body === null) { |
1567: | $body = array_filter([ |
1568: | 'password' => $this->extractArgument($params, 'password'), |
1569: | 'opendistro_security_roles' => $this->extractArgument($params, 'opendistro_security_roles'), |
1570: | 'backend_roles' => $this->extractArgument($params, 'backend_roles'), |
1571: | 'attributes' => $this->extractArgument($params, 'attributes'), |
1572: | ]); |
1573: | } |
1574: | |
1575: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\CreateUser::class); |
1576: | $endpoint->setParams($params); |
1577: | $endpoint->setUsername($username); |
1578: | $endpoint->setBody($body); |
1579: | |
1580: | return $this->performRequest($endpoint); |
1581: | } |
1582: | /** |
1583: | * Proxy function to deleteDistinguishedNames() to prevent BC break. |
1584: | * This API will be removed in a future version. Use 'deleteDistinguishedName' API instead. |
1585: | */ |
1586: | public function deleteDistinguishedNames(array $params = []) |
1587: | { |
1588: | return $this->deleteDistinguishedName($params); |
1589: | } |
1590: | /** |
1591: | * Proxy function to getAccount() to prevent BC break. |
1592: | * This API will be removed in a future version. Use 'getAccountDetails' API instead. |
1593: | */ |
1594: | public function getAccount(array $params = []) |
1595: | { |
1596: | return $this->getAccountDetails($params); |
1597: | } |
1598: | /** |
1599: | * Retrieves all action groups. |
1600: | * If 'action_group' is provided in $params, calls 'getActionGroup'. |
1601: | * |
1602: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. |
1603: | * $params['human'] = (boolean) Whether to return human readable values for statistics. |
1604: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. |
1605: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1606: | * $params['filter_path'] = (any) Comma-separated list of filters used to reduce the response. |
1607: | * |
1608: | * @param array $params Associative array of parameters |
1609: | * @return array |
1610: | */ |
1611: | public function getActionGroups(array $params = []) |
1612: | { |
1613: | if (isset($params['action_group'])) { |
1614: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\GetActionGroup::class); |
1615: | $action_group = $this->extractArgument($params, 'action_group'); |
1616: | $endpoint->setActionGroup($action_group); |
1617: | } else { |
1618: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\GetActionGroups::class); |
1619: | } |
1620: | $endpoint->setParams($params); |
1621: | |
1622: | return $this->performRequest($endpoint); |
1623: | } |
1624: | /** |
1625: | * Proxy function to getConfig() to prevent BC break. |
1626: | * This API will be removed in a future version. Use 'getConfiguration' API instead. |
1627: | */ |
1628: | public function getConfig(array $params = []) |
1629: | { |
1630: | return $this->getConfiguration($params); |
1631: | } |
1632: | /** |
1633: | * Retrieves distinguished names. Only accessible to super-admins and with rest-api permissions when enabled. |
1634: | * If 'cluster_name' is provided in $params, calls GetDistinguishedName. |
1635: | * |
1636: | * $params['cluster_name'] = (string) Name of the cluster. |
1637: | * $params['show_all'] = (boolean) Show all DN. |
1638: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. |
1639: | * $params['human'] = (boolean) Whether to return human readable values for statistics. |
1640: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. |
1641: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1642: | * $params['filter_path'] = (any) Comma-separated list of filters used to reduce the response. |
1643: | * |
1644: | * @param array $params Associative array of parameters |
1645: | * @return array |
1646: | */ |
1647: | public function getDistinguishedNames(array $params = []) |
1648: | { |
1649: | if (isset($params['cluster_name'])) { |
1650: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\GetDistinguishedName::class); |
1651: | $cluster_name = $this->extractArgument($params, 'cluster_name'); |
1652: | $endpoint->setClusterName($cluster_name); |
1653: | } else { |
1654: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\GetDistinguishedNames::class); |
1655: | } |
1656: | $endpoint->setParams($params); |
1657: | |
1658: | return $this->performRequest($endpoint); |
1659: | } |
1660: | /** |
1661: | * Retrieves role mappings. Only accessible to super-admins and with rest-api permissions when enabled. |
1662: | * If 'role' is provided in $params, calls GetRoleMapping. |
1663: | * |
1664: | * $params['role'] = (string) Name of the role. |
1665: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. |
1666: | * $params['human'] = (boolean) Whether to return human readable values for statistics. |
1667: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. |
1668: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1669: | * $params['filter_path'] = (any) Comma-separated list of filters used to reduce the response. |
1670: | * |
1671: | * @param array $params Associative array of parameters |
1672: | * @return array |
1673: | */ |
1674: | public function getRoleMappings(array $params = []) |
1675: | { |
1676: | if (isset($params['role'])) { |
1677: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\GetRoleMapping::class); |
1678: | $role = $this->extractArgument($params, 'role'); |
1679: | $endpoint->setRole($role); |
1680: | } else { |
1681: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\GetRoleMappings::class); |
1682: | } |
1683: | $endpoint->setParams($params); |
1684: | |
1685: | return $this->performRequest($endpoint); |
1686: | } |
1687: | /** |
1688: | * Retrieves roles. Only accessible to super-admins and with rest-api permissions when enabled. |
1689: | * If 'role' is provided in $params, calls getRole. |
1690: | * |
1691: | * $params['role'] = (string) Name of the role. |
1692: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. |
1693: | * $params['human'] = (boolean) Whether to return human readable values for statistics. |
1694: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. |
1695: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1696: | * $params['filter_path'] = (any) Comma-separated list of filters used to reduce the response. |
1697: | * |
1698: | * @param array $params Associative array of parameters |
1699: | * @return array |
1700: | */ |
1701: | public function getRoles(array $params = []) |
1702: | { |
1703: | if (isset($params['role'])) { |
1704: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\GetRole::class); |
1705: | $role = $this->extractArgument($params, 'role'); |
1706: | $endpoint->setRole($role); |
1707: | } else { |
1708: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\GetRoles::class); |
1709: | } |
1710: | $endpoint->setParams($params); |
1711: | |
1712: | return $this->performRequest($endpoint); |
1713: | } |
1714: | /** |
1715: | * Retrieves tenants. Only accessible to super-admins and with rest-api permissions when enabled. |
1716: | * If 'tenant' is provided in $params, calls GetTenant. |
1717: | * |
1718: | * $params['tenant'] = (string) Name of the tenant. |
1719: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. |
1720: | * $params['human'] = (boolean) Whether to return human readable values for statistics. |
1721: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. |
1722: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1723: | * $params['filter_path'] = (any) Comma-separated list of filters used to reduce the response. |
1724: | * |
1725: | * @param array $params Associative array of parameters |
1726: | * @return array |
1727: | */ |
1728: | public function getTenants(array $params = []) |
1729: | { |
1730: | if (isset($params['tenant'])) { |
1731: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\GetTenant::class); |
1732: | $tenant = $this->extractArgument($params, 'tenant'); |
1733: | $endpoint->setTenant($tenant); |
1734: | } else { |
1735: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\GetTenants::class); |
1736: | } |
1737: | $endpoint->setParams($params); |
1738: | |
1739: | return $this->performRequest($endpoint); |
1740: | } |
1741: | /** |
1742: | * Retrieve all internal users. |
1743: | * If 'username' is provided in $params, calls 'getUser'. |
1744: | * |
1745: | * $params['username'] = (string) The username of the user to fetch, omit to fetch all (optional). |
1746: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. |
1747: | * $params['human'] = (boolean) Whether to return human readable values for statistics. |
1748: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. |
1749: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1750: | * $params['filter_path'] = (any) Comma-separated list of filters used to reduce the response. |
1751: | * |
1752: | * @param array $params Associative array of parameters |
1753: | * @return array |
1754: | */ |
1755: | public function getUsers(array $params = []): array |
1756: | { |
1757: | $endpointBuilder = $this->endpoints; |
1758: | |
1759: | if (isset($params['username'])) { |
1760: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\GetUser::class); |
1761: | $username = $this->extractArgument($params, 'username'); |
1762: | $endpoint->setUsername($username); |
1763: | } else { |
1764: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\GetUsers::class); |
1765: | } |
1766: | |
1767: | $endpoint->setParams($params); |
1768: | |
1769: | return $this->performRequest($endpoint); |
1770: | } |
1771: | /** |
1772: | * Creates, updates, or deletes multiple action groups in a single call. |
1773: | * If 'action_group' is provided in $params, calls patchActionGroup. |
1774: | * |
1775: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. |
1776: | * $params['human'] = (boolean) Whether to return human readable values for statistics. |
1777: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. |
1778: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1779: | * $params['filter_path'] = (any) Comma-separated list of filters used to reduce the response. |
1780: | * |
1781: | * @param array $params Associative array of parameters |
1782: | * @return array |
1783: | */ |
1784: | public function patchActionGroups(array $params = []) |
1785: | { |
1786: | $body = $this->extractArgument($params, 'body'); |
1787: | |
1788: | if ($body === null) { |
1789: | $body = $this->extractArgument($params, 'ops') ?? []; |
1790: | } |
1791: | |
1792: | if (isset($params['action_group'])) { |
1793: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\PatchActionGroup::class); |
1794: | $action_group = $this->extractArgument($params, 'action_group'); |
1795: | $endpoint->setActionGroup($action_group); |
1796: | } else { |
1797: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\PatchActionGroups::class); |
1798: | } |
1799: | $endpoint->setParams($params); |
1800: | $endpoint->setBody($body); |
1801: | |
1802: | return $this->performRequest($endpoint); |
1803: | } |
1804: | /** |
1805: | * Proxy function to patchConfig() to prevent BC break. |
1806: | * This API will be removed in a future version. Use 'patchConfiguration' API instead. |
1807: | */ |
1808: | public function patchConfig(array $params = []) |
1809: | { |
1810: | $ops = $this->extractArgument($params, 'ops'); |
1811: | if ($ops !== null) { |
1812: | $params['body'] = $ops; |
1813: | } |
1814: | return $this->patchConfiguration($params); |
1815: | } |
1816: | /** |
1817: | * Creates or updates multiple role mappings in a single call. |
1818: | * If 'role' is provided in $params, calls patchRoleMappings. |
1819: | * |
1820: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. |
1821: | * $params['human'] = (boolean) Whether to return human readable values for statistics. |
1822: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. |
1823: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1824: | * $params['filter_path'] = (any) Comma-separated list of filters used to reduce the response. |
1825: | * |
1826: | * @param array $params Associative array of parameters |
1827: | * @return array |
1828: | */ |
1829: | public function patchRoleMappings(array $params = []) |
1830: | { |
1831: | $body = $this->extractArgument($params, 'body'); |
1832: | if ($body === null) { |
1833: | $body = $this->extractArgument($params, 'ops') ?? []; |
1834: | } |
1835: | |
1836: | if (isset($params['role'])) { |
1837: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\PatchRoleMapping::class); |
1838: | $role = $this->extractArgument($params, 'role'); |
1839: | $endpoint->setRole($role); |
1840: | } else { |
1841: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\PatchRoleMappings::class); |
1842: | } |
1843: | $endpoint->setParams($params); |
1844: | $endpoint->setBody($body); |
1845: | |
1846: | return $this->performRequest($endpoint); |
1847: | } |
1848: | /** |
1849: | * Creates, updates, or deletes multiple roles in a single call. |
1850: | * If 'role' is provided in $params, calls patchRole. |
1851: | * |
1852: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. |
1853: | * $params['human'] = (boolean) Whether to return human readable values for statistics. |
1854: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. |
1855: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1856: | * $params['filter_path'] = (any) Comma-separated list of filters used to reduce the response. |
1857: | * |
1858: | * @param array $params Associative array of parameters |
1859: | * @return array |
1860: | */ |
1861: | public function patchRoles(array $params = []) |
1862: | { |
1863: | $body = $this->extractArgument($params, 'body'); |
1864: | if ($body === null) { |
1865: | $body = $this->extractArgument($params, 'ops') ?? []; |
1866: | } |
1867: | |
1868: | if (isset($params['role'])) { |
1869: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\PatchRole::class); |
1870: | $role = $this->extractArgument($params, 'role'); |
1871: | $endpoint->setRole($role); |
1872: | } else { |
1873: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\PatchRoles::class); |
1874: | } |
1875: | |
1876: | $endpoint->setParams($params); |
1877: | $endpoint->setBody($body); |
1878: | |
1879: | return $this->performRequest($endpoint); |
1880: | } |
1881: | /** |
1882: | * Add, delete, or modify multiple tenants in a single call. |
1883: | * If 'tenant' is provided in $params, calls 'patchTenant'. |
1884: | * |
1885: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. |
1886: | * $params['human'] = (boolean) Whether to return human readable values for statistics. |
1887: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. |
1888: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1889: | * $params['filter_path'] = (any) Comma-separated list of filters used to reduce the response. |
1890: | * |
1891: | * @param array $params Associative array of parameters |
1892: | * @return array |
1893: | */ |
1894: | public function patchTenants(array $params = []) |
1895: | { |
1896: | $body = $this->extractArgument($params, 'body'); |
1897: | if ($body === null) { |
1898: | $body = $this->extractArgument($params, 'ops') ?? []; |
1899: | } |
1900: | |
1901: | if (isset($params['tenant'])) { |
1902: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\PatchTenant::class); |
1903: | $tenant = $this->extractArgument($params, 'tenant'); |
1904: | $endpoint->setTenant($tenant); |
1905: | } else { |
1906: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\PatchTenants::class); |
1907: | } |
1908: | |
1909: | $endpoint->setParams($params); |
1910: | $endpoint->setBody($body); |
1911: | |
1912: | return $this->performRequest($endpoint); |
1913: | } |
1914: | /** |
1915: | * Creates, updates, or deletes multiple internal users in a single call. |
1916: | * If 'username' is provided in $params, calls patchUser. |
1917: | * |
1918: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. |
1919: | * $params['human'] = (boolean) Whether to return human readable values for statistics. |
1920: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. |
1921: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1922: | * $params['filter_path'] = (any) Comma-separated list of filters used to reduce the response. |
1923: | * |
1924: | * @param array $params Associative array of parameters |
1925: | * @return array |
1926: | */ |
1927: | public function patchUsers(array $params = []) |
1928: | { |
1929: | $body = $this->extractArgument($params, 'body'); |
1930: | if ($body === null) { |
1931: | $body = $this->extractArgument($params, 'ops') ?? []; |
1932: | } |
1933: | |
1934: | if (isset($params['username'])) { |
1935: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\PatchUser::class); |
1936: | $username = $this->extractArgument($params, 'username'); |
1937: | $endpoint->setUsername($username); |
1938: | } else { |
1939: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Security\PatchUsers::class); |
1940: | } |
1941: | |
1942: | $endpoint->setParams($params); |
1943: | $endpoint->setBody($body); |
1944: | |
1945: | return $this->performRequest($endpoint); |
1946: | } |
1947: | /** |
1948: | * Proxy function to updateConfig() to prevent BC break. |
1949: | * This API will be removed in a future version. Use 'updateConfiguration' API instead. |
1950: | */ |
1951: | public function updateConfig(array $params = []) |
1952: | { |
1953: | $body = [ 'dynamic' => $this->extractArgument($params, 'dynamic')]; |
1954: | $params['body'] = $body; |
1955: | return $this->updateConfiguration($params); |
1956: | } |
1957: | /** |
1958: | * Proxy function to updateDistinguishedNames() to prevent BC break. |
1959: | * This API will be removed in a future version. Use 'updateDistinguishedName' API instead. |
1960: | */ |
1961: | public function updateDistinguishedNames(array $params = []) |
1962: | { |
1963: | $body = [ 'nodes_dn' => $this->extractArgument($params, 'nodes_dn')]; |
1964: | $params['body'] = $body; |
1965: | return $this->updateDistinguishedName($params); |
1966: | } |
1967: | } |
1968: |