elasticsearch 8.17.0__py3-none-any.whl → 8.17.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. elasticsearch/_async/client/__init__.py +153 -51
  2. elasticsearch/_async/client/cat.py +64 -195
  3. elasticsearch/_async/client/cluster.py +19 -19
  4. elasticsearch/_async/client/connector.py +337 -0
  5. elasticsearch/_async/client/dangling_indices.py +3 -3
  6. elasticsearch/_async/client/ilm.py +6 -6
  7. elasticsearch/_async/client/indices.py +360 -81
  8. elasticsearch/_async/client/inference.py +94 -1
  9. elasticsearch/_async/client/ingest.py +175 -2
  10. elasticsearch/_async/client/logstash.py +9 -6
  11. elasticsearch/_async/client/migration.py +16 -7
  12. elasticsearch/_async/client/ml.py +12 -6
  13. elasticsearch/_async/client/monitoring.py +2 -1
  14. elasticsearch/_async/client/nodes.py +3 -3
  15. elasticsearch/_async/client/query_rules.py +33 -12
  16. elasticsearch/_async/client/rollup.py +88 -13
  17. elasticsearch/_async/client/search_application.py +130 -1
  18. elasticsearch/_async/client/searchable_snapshots.py +32 -23
  19. elasticsearch/_async/client/security.py +676 -55
  20. elasticsearch/_async/client/shutdown.py +38 -15
  21. elasticsearch/_async/client/simulate.py +151 -0
  22. elasticsearch/_async/client/slm.py +138 -19
  23. elasticsearch/_async/client/snapshot.py +307 -23
  24. elasticsearch/_async/client/sql.py +66 -46
  25. elasticsearch/_async/client/synonyms.py +39 -19
  26. elasticsearch/_async/client/tasks.py +68 -28
  27. elasticsearch/_async/client/text_structure.py +466 -46
  28. elasticsearch/_async/client/transform.py +9 -2
  29. elasticsearch/_async/client/watcher.py +207 -41
  30. elasticsearch/_async/client/xpack.py +11 -6
  31. elasticsearch/_sync/client/__init__.py +153 -51
  32. elasticsearch/_sync/client/cat.py +64 -195
  33. elasticsearch/_sync/client/cluster.py +19 -19
  34. elasticsearch/_sync/client/connector.py +337 -0
  35. elasticsearch/_sync/client/dangling_indices.py +3 -3
  36. elasticsearch/_sync/client/ilm.py +6 -6
  37. elasticsearch/_sync/client/indices.py +360 -81
  38. elasticsearch/_sync/client/inference.py +94 -1
  39. elasticsearch/_sync/client/ingest.py +175 -2
  40. elasticsearch/_sync/client/logstash.py +9 -6
  41. elasticsearch/_sync/client/migration.py +16 -7
  42. elasticsearch/_sync/client/ml.py +12 -6
  43. elasticsearch/_sync/client/monitoring.py +2 -1
  44. elasticsearch/_sync/client/nodes.py +3 -3
  45. elasticsearch/_sync/client/query_rules.py +33 -12
  46. elasticsearch/_sync/client/rollup.py +88 -13
  47. elasticsearch/_sync/client/search_application.py +130 -1
  48. elasticsearch/_sync/client/searchable_snapshots.py +32 -23
  49. elasticsearch/_sync/client/security.py +676 -55
  50. elasticsearch/_sync/client/shutdown.py +38 -15
  51. elasticsearch/_sync/client/simulate.py +151 -0
  52. elasticsearch/_sync/client/slm.py +138 -19
  53. elasticsearch/_sync/client/snapshot.py +307 -23
  54. elasticsearch/_sync/client/sql.py +66 -46
  55. elasticsearch/_sync/client/synonyms.py +39 -19
  56. elasticsearch/_sync/client/tasks.py +68 -28
  57. elasticsearch/_sync/client/text_structure.py +466 -46
  58. elasticsearch/_sync/client/transform.py +9 -2
  59. elasticsearch/_sync/client/watcher.py +207 -41
  60. elasticsearch/_sync/client/xpack.py +11 -6
  61. elasticsearch/_version.py +1 -1
  62. elasticsearch/client.py +2 -0
  63. {elasticsearch-8.17.0.dist-info → elasticsearch-8.17.1.dist-info}/METADATA +1 -1
  64. elasticsearch-8.17.1.dist-info/RECORD +119 -0
  65. elasticsearch-8.17.0.dist-info/RECORD +0 -117
  66. {elasticsearch-8.17.0.dist-info → elasticsearch-8.17.1.dist-info}/WHEEL +0 -0
  67. {elasticsearch-8.17.0.dist-info → elasticsearch-8.17.1.dist-info}/licenses/LICENSE +0 -0
  68. {elasticsearch-8.17.0.dist-info → elasticsearch-8.17.1.dist-info}/licenses/NOTICE +0 -0
@@ -45,14 +45,33 @@ class SecurityClient(NamespacedClient):
45
45
  ) -> ObjectApiResponse[t.Any]:
46
46
  """
47
47
  Activate a user profile. Create or update a user profile on behalf of another
48
- user.
48
+ user. NOTE: The user profile feature is designed only for use by Kibana and Elastic's
49
+ Observability, Enterprise Search, and Elastic Security solutions. Individual
50
+ users and external applications should not call this API directly. The calling
51
+ application must have either an `access_token` or a combination of `username`
52
+ and `password` for the user that the profile document is intended for. Elastic
53
+ reserves the right to change or remove this feature in future releases without
54
+ prior notice. This API creates or updates a profile document for end users with
55
+ information that is extracted from the user's authentication object including
56
+ `username`, `full_name,` `roles`, and the authentication realm. For example,
57
+ in the JWT `access_token` case, the profile user's `username` is extracted from
58
+ the JWT token claim pointed to by the `claims.principal` setting of the JWT realm
59
+ that authenticated the token. When updating a profile document, the API enables
60
+ the document if it was disabled. Any updates do not change existing content for
61
+ either the `labels` or `data` fields.
49
62
 
50
63
  `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-activate-user-profile.html>`_
51
64
 
52
- :param grant_type:
53
- :param access_token:
54
- :param password:
55
- :param username:
65
+ :param grant_type: The type of grant.
66
+ :param access_token: The user's Elasticsearch access token or JWT. Both `access`
67
+ and `id` JWT token types are supported and they depend on the underlying
68
+ JWT realm configuration. If you specify the `access_token` grant type, this
69
+ parameter is required. It is not valid with other grant types.
70
+ :param password: The user's password. If you specify the `password` grant type,
71
+ this parameter is required. It is not valid with other grant types.
72
+ :param username: The username that identifies the user. If you specify the `password`
73
+ grant type, this parameter is required. It is not valid with other grant
74
+ types.
56
75
  """
57
76
  if grant_type is None and body is None:
58
77
  raise ValueError("Empty value passed for parameter 'grant_type'")
@@ -244,6 +263,94 @@ class SecurityClient(NamespacedClient):
244
263
  path_parts=__path_parts,
245
264
  )
246
265
 
266
+ @_rewrite_parameters(
267
+ body_fields=("ids", "expiration", "metadata", "role_descriptors"),
268
+ )
269
+ def bulk_update_api_keys(
270
+ self,
271
+ *,
272
+ ids: t.Optional[t.Union[str, t.Sequence[str]]] = None,
273
+ error_trace: t.Optional[bool] = None,
274
+ expiration: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
275
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
276
+ human: t.Optional[bool] = None,
277
+ metadata: t.Optional[t.Mapping[str, t.Any]] = None,
278
+ pretty: t.Optional[bool] = None,
279
+ role_descriptors: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
280
+ body: t.Optional[t.Dict[str, t.Any]] = None,
281
+ ) -> ObjectApiResponse[t.Any]:
282
+ """
283
+ Bulk update API keys. Update the attributes for multiple API keys. IMPORTANT:
284
+ It is not possible to use an API key as the authentication credential for this
285
+ API. To update API keys, the owner user's credentials are required. This API
286
+ is similar to the update API key API but enables you to apply the same update
287
+ to multiple API keys in one API call. This operation can greatly improve performance
288
+ over making individual updates. It is not possible to update expired or invalidated
289
+ API keys. This API supports updates to API key access scope, metadata and expiration.
290
+ The access scope of each API key is derived from the `role_descriptors` you specify
291
+ in the request and a snapshot of the owner user's permissions at the time of
292
+ the request. The snapshot of the owner's permissions is updated automatically
293
+ on every call. IMPORTANT: If you don't specify `role_descriptors` in the request,
294
+ a call to this API might still change an API key's access scope. This change
295
+ can occur if the owner user's permissions have changed since the API key was
296
+ created or last modified. A successful request returns a JSON structure that
297
+ contains the IDs of all updated API keys, the IDs of API keys that already had
298
+ the requested changes and did not require an update, and error details for any
299
+ failed update.
300
+
301
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-bulk-update-api-keys.html>`_
302
+
303
+ :param ids: The API key identifiers.
304
+ :param expiration: Expiration time for the API keys. By default, API keys never
305
+ expire. This property can be omitted to leave the value unchanged.
306
+ :param metadata: Arbitrary nested metadata to associate with the API keys. Within
307
+ the `metadata` object, top-level keys beginning with an underscore (`_`)
308
+ are reserved for system usage. Any information specified with this parameter
309
+ fully replaces metadata previously associated with the API key.
310
+ :param role_descriptors: The role descriptors to assign to the API keys. An API
311
+ key's effective permissions are an intersection of its assigned privileges
312
+ and the point-in-time snapshot of permissions of the owner user. You can
313
+ assign new privileges by specifying them in this parameter. To remove assigned
314
+ privileges, supply the `role_descriptors` parameter as an empty object `{}`.
315
+ If an API key has no assigned privileges, it inherits the owner user's full
316
+ permissions. The snapshot of the owner's permissions is always updated, whether
317
+ you supply the `role_descriptors` parameter. The structure of a role descriptor
318
+ is the same as the request for the create API keys API.
319
+ """
320
+ if ids is None and body is None:
321
+ raise ValueError("Empty value passed for parameter 'ids'")
322
+ __path_parts: t.Dict[str, str] = {}
323
+ __path = "/_security/api_key/_bulk_update"
324
+ __query: t.Dict[str, t.Any] = {}
325
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
326
+ if error_trace is not None:
327
+ __query["error_trace"] = error_trace
328
+ if filter_path is not None:
329
+ __query["filter_path"] = filter_path
330
+ if human is not None:
331
+ __query["human"] = human
332
+ if pretty is not None:
333
+ __query["pretty"] = pretty
334
+ if not __body:
335
+ if ids is not None:
336
+ __body["ids"] = ids
337
+ if expiration is not None:
338
+ __body["expiration"] = expiration
339
+ if metadata is not None:
340
+ __body["metadata"] = metadata
341
+ if role_descriptors is not None:
342
+ __body["role_descriptors"] = role_descriptors
343
+ __headers = {"accept": "application/json", "content-type": "application/json"}
344
+ return self.perform_request( # type: ignore[return-value]
345
+ "POST",
346
+ __path,
347
+ params=__query,
348
+ headers=__headers,
349
+ body=__body,
350
+ endpoint_id="security.bulk_update_api_keys",
351
+ path_parts=__path_parts,
352
+ )
353
+
247
354
  @_rewrite_parameters(
248
355
  body_fields=("password", "password_hash"),
249
356
  )
@@ -773,6 +880,74 @@ class SecurityClient(NamespacedClient):
773
880
  path_parts=__path_parts,
774
881
  )
775
882
 
883
+ @_rewrite_parameters(
884
+ body_fields=("x509_certificate_chain",),
885
+ )
886
+ def delegate_pki(
887
+ self,
888
+ *,
889
+ x509_certificate_chain: t.Optional[t.Sequence[str]] = None,
890
+ error_trace: t.Optional[bool] = None,
891
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
892
+ human: t.Optional[bool] = None,
893
+ pretty: t.Optional[bool] = None,
894
+ body: t.Optional[t.Dict[str, t.Any]] = None,
895
+ ) -> ObjectApiResponse[t.Any]:
896
+ """
897
+ Delegate PKI authentication. This API implements the exchange of an X509Certificate
898
+ chain for an Elasticsearch access token. The certificate chain is validated,
899
+ according to RFC 5280, by sequentially considering the trust configuration of
900
+ every installed PKI realm that has `delegation.enabled` set to `true`. A successfully
901
+ trusted client certificate is also subject to the validation of the subject distinguished
902
+ name according to thw `username_pattern` of the respective realm. This API is
903
+ called by smart and trusted proxies, such as Kibana, which terminate the user's
904
+ TLS session but still want to authenticate the user by using a PKI realm—-​as
905
+ if the user connected directly to Elasticsearch. IMPORTANT: The association between
906
+ the subject public key in the target certificate and the corresponding private
907
+ key is not validated. This is part of the TLS authentication process and it is
908
+ delegated to the proxy that calls this API. The proxy is trusted to have performed
909
+ the TLS authentication and this API translates that authentication into an Elasticsearch
910
+ access token.
911
+
912
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-delegate-pki-authentication.html>`_
913
+
914
+ :param x509_certificate_chain: The X509Certificate chain, which is represented
915
+ as an ordered string array. Each string in the array is a base64-encoded
916
+ (Section 4 of RFC4648 - not base64url-encoded) of the certificate's DER encoding.
917
+ The first element is the target certificate that contains the subject distinguished
918
+ name that is requesting access. This may be followed by additional certificates;
919
+ each subsequent certificate is used to certify the previous one.
920
+ """
921
+ if x509_certificate_chain is None and body is None:
922
+ raise ValueError(
923
+ "Empty value passed for parameter 'x509_certificate_chain'"
924
+ )
925
+ __path_parts: t.Dict[str, str] = {}
926
+ __path = "/_security/delegate_pki"
927
+ __query: t.Dict[str, t.Any] = {}
928
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
929
+ if error_trace is not None:
930
+ __query["error_trace"] = error_trace
931
+ if filter_path is not None:
932
+ __query["filter_path"] = filter_path
933
+ if human is not None:
934
+ __query["human"] = human
935
+ if pretty is not None:
936
+ __query["pretty"] = pretty
937
+ if not __body:
938
+ if x509_certificate_chain is not None:
939
+ __body["x509_certificate_chain"] = x509_certificate_chain
940
+ __headers = {"accept": "application/json", "content-type": "application/json"}
941
+ return self.perform_request( # type: ignore[return-value]
942
+ "POST",
943
+ __path,
944
+ params=__query,
945
+ headers=__headers,
946
+ body=__body,
947
+ endpoint_id="security.delegate_pki",
948
+ path_parts=__path_parts,
949
+ )
950
+
776
951
  @_rewrite_parameters()
777
952
  def delete_privileges(
778
953
  self,
@@ -1098,14 +1273,21 @@ class SecurityClient(NamespacedClient):
1098
1273
  ) -> ObjectApiResponse[t.Any]:
1099
1274
  """
1100
1275
  Disable a user profile. Disable user profiles so that they are not visible in
1101
- user profile searches.
1276
+ user profile searches. NOTE: The user profile feature is designed only for use
1277
+ by Kibana and Elastic's Observability, Enterprise Search, and Elastic Security
1278
+ solutions. Individual users and external applications should not call this API
1279
+ directly. Elastic reserves the right to change or remove this feature in future
1280
+ releases without prior notice. When you activate a user profile, its automatically
1281
+ enabled and visible in user profile searches. You can use the disable user profile
1282
+ API to disable a user profile so it’s not visible in these searches. To re-enable
1283
+ a disabled user profile, use the enable user profile API .
1102
1284
 
1103
1285
  `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-disable-user-profile.html>`_
1104
1286
 
1105
1287
  :param uid: Unique identifier for the user profile.
1106
1288
  :param refresh: If 'true', Elasticsearch refreshes the affected shards to make
1107
- this operation visible to search, if 'wait_for' then wait for a refresh to
1108
- make this operation visible to search, if 'false' do nothing with refreshes.
1289
+ this operation visible to search. If 'wait_for', it waits for a refresh to
1290
+ make this operation visible to search. If 'false', it does nothing with refreshes.
1109
1291
  """
1110
1292
  if uid in SKIP_IN_PATH:
1111
1293
  raise ValueError("Empty value passed for parameter 'uid'")
@@ -1195,14 +1377,20 @@ class SecurityClient(NamespacedClient):
1195
1377
  ) -> ObjectApiResponse[t.Any]:
1196
1378
  """
1197
1379
  Enable a user profile. Enable user profiles to make them visible in user profile
1198
- searches.
1380
+ searches. NOTE: The user profile feature is designed only for use by Kibana and
1381
+ Elastic's Observability, Enterprise Search, and Elastic Security solutions. Individual
1382
+ users and external applications should not call this API directly. Elastic reserves
1383
+ the right to change or remove this feature in future releases without prior notice.
1384
+ When you activate a user profile, it's automatically enabled and visible in user
1385
+ profile searches. If you later disable the user profile, you can use the enable
1386
+ user profile API to make the profile visible in these searches again.
1199
1387
 
1200
1388
  `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-enable-user-profile.html>`_
1201
1389
 
1202
- :param uid: Unique identifier for the user profile.
1390
+ :param uid: A unique identifier for the user profile.
1203
1391
  :param refresh: If 'true', Elasticsearch refreshes the affected shards to make
1204
- this operation visible to search, if 'wait_for' then wait for a refresh to
1205
- make this operation visible to search, if 'false' do nothing with refreshes.
1392
+ this operation visible to search. If 'wait_for', it waits for a refresh to
1393
+ make this operation visible to search. If 'false', nothing is done with refreshes.
1206
1394
  """
1207
1395
  if uid in SKIP_IN_PATH:
1208
1396
  raise ValueError("Empty value passed for parameter 'uid'")
@@ -1667,6 +1855,49 @@ class SecurityClient(NamespacedClient):
1667
1855
  path_parts=__path_parts,
1668
1856
  )
1669
1857
 
1858
+ @_rewrite_parameters()
1859
+ def get_settings(
1860
+ self,
1861
+ *,
1862
+ error_trace: t.Optional[bool] = None,
1863
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1864
+ human: t.Optional[bool] = None,
1865
+ master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
1866
+ pretty: t.Optional[bool] = None,
1867
+ ) -> ObjectApiResponse[t.Any]:
1868
+ """
1869
+ Get security index settings. Get the user-configurable settings for the security
1870
+ internal index (`.security` and associated indices).
1871
+
1872
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-get-settings.html>`_
1873
+
1874
+ :param master_timeout: Period to wait for a connection to the master node. If
1875
+ no response is received before the timeout expires, the request fails and
1876
+ returns an error.
1877
+ """
1878
+ __path_parts: t.Dict[str, str] = {}
1879
+ __path = "/_security/settings"
1880
+ __query: t.Dict[str, t.Any] = {}
1881
+ if error_trace is not None:
1882
+ __query["error_trace"] = error_trace
1883
+ if filter_path is not None:
1884
+ __query["filter_path"] = filter_path
1885
+ if human is not None:
1886
+ __query["human"] = human
1887
+ if master_timeout is not None:
1888
+ __query["master_timeout"] = master_timeout
1889
+ if pretty is not None:
1890
+ __query["pretty"] = pretty
1891
+ __headers = {"accept": "application/json"}
1892
+ return self.perform_request( # type: ignore[return-value]
1893
+ "GET",
1894
+ __path,
1895
+ params=__query,
1896
+ headers=__headers,
1897
+ endpoint_id="security.get_settings",
1898
+ path_parts=__path_parts,
1899
+ )
1900
+
1670
1901
  @_rewrite_parameters(
1671
1902
  body_fields=(
1672
1903
  "grant_type",
@@ -1860,15 +2091,19 @@ class SecurityClient(NamespacedClient):
1860
2091
  pretty: t.Optional[bool] = None,
1861
2092
  ) -> ObjectApiResponse[t.Any]:
1862
2093
  """
1863
- Get a user profile. Get a user's profile using the unique profile ID.
2094
+ Get a user profile. Get a user's profile using the unique profile ID. NOTE: The
2095
+ user profile feature is designed only for use by Kibana and Elastic's Observability,
2096
+ Enterprise Search, and Elastic Security solutions. Individual users and external
2097
+ applications should not call this API directly. Elastic reserves the right to
2098
+ change or remove this feature in future releases without prior notice.
1864
2099
 
1865
2100
  `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-get-user-profile.html>`_
1866
2101
 
1867
2102
  :param uid: A unique identifier for the user profile.
1868
- :param data: List of filters for the `data` field of the profile document. To
1869
- return all content use `data=*`. To return a subset of content use `data=<key>`
1870
- to retrieve content nested under the specified `<key>`. By default returns
1871
- no `data` content.
2103
+ :param data: A comma-separated list of filters for the `data` field of the profile
2104
+ document. To return all content use `data=*`. To return a subset of content
2105
+ use `data=<key>` to retrieve content nested under the specified `<key>`.
2106
+ By default returns no `data` content.
1872
2107
  """
1873
2108
  if uid in SKIP_IN_PATH:
1874
2109
  raise ValueError("Empty value passed for parameter 'uid'")
@@ -2140,11 +2375,15 @@ class SecurityClient(NamespacedClient):
2140
2375
  ) -> ObjectApiResponse[t.Any]:
2141
2376
  """
2142
2377
  Check user profile privileges. Determine whether the users associated with the
2143
- specified user profile IDs have all the requested privileges.
2378
+ specified user profile IDs have all the requested privileges. NOTE: The user
2379
+ profile feature is designed only for use by Kibana and Elastic's Observability,
2380
+ Enterprise Search, and Elastic Security solutions. Individual users and external
2381
+ applications should not call this API directly. Elastic reserves the right to
2382
+ change or remove this feature in future releases without prior notice.
2144
2383
 
2145
2384
  `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-has-privileges-user-profile.html>`_
2146
2385
 
2147
- :param privileges:
2386
+ :param privileges: An object containing all the privileges to be checked.
2148
2387
  :param uids: A list of profile IDs. The privileges are checked for associated
2149
2388
  users of the profiles.
2150
2389
  """
@@ -2326,6 +2565,230 @@ class SecurityClient(NamespacedClient):
2326
2565
  path_parts=__path_parts,
2327
2566
  )
2328
2567
 
2568
+ @_rewrite_parameters(
2569
+ body_fields=("nonce", "redirect_uri", "state", "realm"),
2570
+ )
2571
+ def oidc_authenticate(
2572
+ self,
2573
+ *,
2574
+ nonce: t.Optional[str] = None,
2575
+ redirect_uri: t.Optional[str] = None,
2576
+ state: t.Optional[str] = None,
2577
+ error_trace: t.Optional[bool] = None,
2578
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2579
+ human: t.Optional[bool] = None,
2580
+ pretty: t.Optional[bool] = None,
2581
+ realm: t.Optional[str] = None,
2582
+ body: t.Optional[t.Dict[str, t.Any]] = None,
2583
+ ) -> ObjectApiResponse[t.Any]:
2584
+ """
2585
+ Authenticate OpenID Connect. Exchange an OpenID Connect authentication response
2586
+ message for an Elasticsearch internal access token and refresh token that can
2587
+ be subsequently used for authentication. Elasticsearch exposes all the necessary
2588
+ OpenID Connect related functionality with the OpenID Connect APIs. These APIs
2589
+ are used internally by Kibana in order to provide OpenID Connect based authentication,
2590
+ but can also be used by other, custom web applications or other clients.
2591
+
2592
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-oidc-authenticate.html>`_
2593
+
2594
+ :param nonce: Associate a client session with an ID token and mitigate replay
2595
+ attacks. This value needs to be the same as the one that was provided to
2596
+ the `/_security/oidc/prepare` API or the one that was generated by Elasticsearch
2597
+ and included in the response to that call.
2598
+ :param redirect_uri: The URL to which the OpenID Connect Provider redirected
2599
+ the User Agent in response to an authentication request after a successful
2600
+ authentication. This URL must be provided as-is (URL encoded), taken from
2601
+ the body of the response or as the value of a location header in the response
2602
+ from the OpenID Connect Provider.
2603
+ :param state: Maintain state between the authentication request and the response.
2604
+ This value needs to be the same as the one that was provided to the `/_security/oidc/prepare`
2605
+ API or the one that was generated by Elasticsearch and included in the response
2606
+ to that call.
2607
+ :param realm: The name of the OpenID Connect realm. This property is useful in
2608
+ cases where multiple realms are defined.
2609
+ """
2610
+ if nonce is None and body is None:
2611
+ raise ValueError("Empty value passed for parameter 'nonce'")
2612
+ if redirect_uri is None and body is None:
2613
+ raise ValueError("Empty value passed for parameter 'redirect_uri'")
2614
+ if state is None and body is None:
2615
+ raise ValueError("Empty value passed for parameter 'state'")
2616
+ __path_parts: t.Dict[str, str] = {}
2617
+ __path = "/_security/oidc/authenticate"
2618
+ __query: t.Dict[str, t.Any] = {}
2619
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
2620
+ if error_trace is not None:
2621
+ __query["error_trace"] = error_trace
2622
+ if filter_path is not None:
2623
+ __query["filter_path"] = filter_path
2624
+ if human is not None:
2625
+ __query["human"] = human
2626
+ if pretty is not None:
2627
+ __query["pretty"] = pretty
2628
+ if not __body:
2629
+ if nonce is not None:
2630
+ __body["nonce"] = nonce
2631
+ if redirect_uri is not None:
2632
+ __body["redirect_uri"] = redirect_uri
2633
+ if state is not None:
2634
+ __body["state"] = state
2635
+ if realm is not None:
2636
+ __body["realm"] = realm
2637
+ __headers = {"accept": "application/json", "content-type": "application/json"}
2638
+ return self.perform_request( # type: ignore[return-value]
2639
+ "POST",
2640
+ __path,
2641
+ params=__query,
2642
+ headers=__headers,
2643
+ body=__body,
2644
+ endpoint_id="security.oidc_authenticate",
2645
+ path_parts=__path_parts,
2646
+ )
2647
+
2648
+ @_rewrite_parameters(
2649
+ body_fields=("access_token", "refresh_token"),
2650
+ )
2651
+ def oidc_logout(
2652
+ self,
2653
+ *,
2654
+ access_token: t.Optional[str] = None,
2655
+ error_trace: t.Optional[bool] = None,
2656
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2657
+ human: t.Optional[bool] = None,
2658
+ pretty: t.Optional[bool] = None,
2659
+ refresh_token: t.Optional[str] = None,
2660
+ body: t.Optional[t.Dict[str, t.Any]] = None,
2661
+ ) -> ObjectApiResponse[t.Any]:
2662
+ """
2663
+ Logout of OpenID Connect. Invalidate an access token and a refresh token that
2664
+ were generated as a response to the `/_security/oidc/authenticate` API. If the
2665
+ OpenID Connect authentication realm in Elasticsearch is accordingly configured,
2666
+ the response to this call will contain a URI pointing to the end session endpoint
2667
+ of the OpenID Connect Provider in order to perform single logout. Elasticsearch
2668
+ exposes all the necessary OpenID Connect related functionality with the OpenID
2669
+ Connect APIs. These APIs are used internally by Kibana in order to provide OpenID
2670
+ Connect based authentication, but can also be used by other, custom web applications
2671
+ or other clients.
2672
+
2673
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-oidc-logout.html>`_
2674
+
2675
+ :param access_token: The access token to be invalidated.
2676
+ :param refresh_token: The refresh token to be invalidated.
2677
+ """
2678
+ if access_token is None and body is None:
2679
+ raise ValueError("Empty value passed for parameter 'access_token'")
2680
+ __path_parts: t.Dict[str, str] = {}
2681
+ __path = "/_security/oidc/logout"
2682
+ __query: t.Dict[str, t.Any] = {}
2683
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
2684
+ if error_trace is not None:
2685
+ __query["error_trace"] = error_trace
2686
+ if filter_path is not None:
2687
+ __query["filter_path"] = filter_path
2688
+ if human is not None:
2689
+ __query["human"] = human
2690
+ if pretty is not None:
2691
+ __query["pretty"] = pretty
2692
+ if not __body:
2693
+ if access_token is not None:
2694
+ __body["access_token"] = access_token
2695
+ if refresh_token is not None:
2696
+ __body["refresh_token"] = refresh_token
2697
+ __headers = {"accept": "application/json", "content-type": "application/json"}
2698
+ return self.perform_request( # type: ignore[return-value]
2699
+ "POST",
2700
+ __path,
2701
+ params=__query,
2702
+ headers=__headers,
2703
+ body=__body,
2704
+ endpoint_id="security.oidc_logout",
2705
+ path_parts=__path_parts,
2706
+ )
2707
+
2708
+ @_rewrite_parameters(
2709
+ body_fields=("iss", "login_hint", "nonce", "realm", "state"),
2710
+ )
2711
+ def oidc_prepare_authentication(
2712
+ self,
2713
+ *,
2714
+ error_trace: t.Optional[bool] = None,
2715
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2716
+ human: t.Optional[bool] = None,
2717
+ iss: t.Optional[str] = None,
2718
+ login_hint: t.Optional[str] = None,
2719
+ nonce: t.Optional[str] = None,
2720
+ pretty: t.Optional[bool] = None,
2721
+ realm: t.Optional[str] = None,
2722
+ state: t.Optional[str] = None,
2723
+ body: t.Optional[t.Dict[str, t.Any]] = None,
2724
+ ) -> ObjectApiResponse[t.Any]:
2725
+ """
2726
+ Prepare OpenID connect authentication. Create an oAuth 2.0 authentication request
2727
+ as a URL string based on the configuration of the OpenID Connect authentication
2728
+ realm in Elasticsearch. The response of this API is a URL pointing to the Authorization
2729
+ Endpoint of the configured OpenID Connect Provider, which can be used to redirect
2730
+ the browser of the user in order to continue the authentication process. Elasticsearch
2731
+ exposes all the necessary OpenID Connect related functionality with the OpenID
2732
+ Connect APIs. These APIs are used internally by Kibana in order to provide OpenID
2733
+ Connect based authentication, but can also be used by other, custom web applications
2734
+ or other clients.
2735
+
2736
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-oidc-prepare-authentication.html>`_
2737
+
2738
+ :param iss: In the case of a third party initiated single sign on, this is the
2739
+ issuer identifier for the OP that the RP is to send the authentication request
2740
+ to. It cannot be specified when *realm* is specified. One of *realm* or *iss*
2741
+ is required.
2742
+ :param login_hint: In the case of a third party initiated single sign on, it
2743
+ is a string value that is included in the authentication request as the *login_hint*
2744
+ parameter. This parameter is not valid when *realm* is specified.
2745
+ :param nonce: The value used to associate a client session with an ID token and
2746
+ to mitigate replay attacks. If the caller of the API does not provide a value,
2747
+ Elasticsearch will generate one with sufficient entropy and return it in
2748
+ the response.
2749
+ :param realm: The name of the OpenID Connect realm in Elasticsearch the configuration
2750
+ of which should be used in order to generate the authentication request.
2751
+ It cannot be specified when *iss* is specified. One of *realm* or *iss* is
2752
+ required.
2753
+ :param state: The value used to maintain state between the authentication request
2754
+ and the response, typically used as a Cross-Site Request Forgery mitigation.
2755
+ If the caller of the API does not provide a value, Elasticsearch will generate
2756
+ one with sufficient entropy and return it in the response.
2757
+ """
2758
+ __path_parts: t.Dict[str, str] = {}
2759
+ __path = "/_security/oidc/prepare"
2760
+ __query: t.Dict[str, t.Any] = {}
2761
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
2762
+ if error_trace is not None:
2763
+ __query["error_trace"] = error_trace
2764
+ if filter_path is not None:
2765
+ __query["filter_path"] = filter_path
2766
+ if human is not None:
2767
+ __query["human"] = human
2768
+ if pretty is not None:
2769
+ __query["pretty"] = pretty
2770
+ if not __body:
2771
+ if iss is not None:
2772
+ __body["iss"] = iss
2773
+ if login_hint is not None:
2774
+ __body["login_hint"] = login_hint
2775
+ if nonce is not None:
2776
+ __body["nonce"] = nonce
2777
+ if realm is not None:
2778
+ __body["realm"] = realm
2779
+ if state is not None:
2780
+ __body["state"] = state
2781
+ __headers = {"accept": "application/json", "content-type": "application/json"}
2782
+ return self.perform_request( # type: ignore[return-value]
2783
+ "POST",
2784
+ __path,
2785
+ params=__query,
2786
+ headers=__headers,
2787
+ body=__body,
2788
+ endpoint_id="security.oidc_prepare_authentication",
2789
+ path_parts=__path_parts,
2790
+ )
2791
+
2329
2792
  @_rewrite_parameters(
2330
2793
  body_name="privileges",
2331
2794
  )
@@ -3088,13 +3551,25 @@ class SecurityClient(NamespacedClient):
3088
3551
  body: t.Optional[t.Dict[str, t.Any]] = None,
3089
3552
  ) -> ObjectApiResponse[t.Any]:
3090
3553
  """
3091
- Authenticate SAML. Submits a SAML response message to Elasticsearch for consumption.
3554
+ Authenticate SAML. Submit a SAML response message to Elasticsearch for consumption.
3555
+ NOTE: This API is intended for use by custom web applications other than Kibana.
3556
+ If you are using Kibana, refer to the documentation for configuring SAML single-sign-on
3557
+ on the Elastic Stack. The SAML message that is submitted can be: * A response
3558
+ to a SAML authentication request that was previously created using the SAML prepare
3559
+ authentication API. * An unsolicited SAML message in the case of an IdP-initiated
3560
+ single sign-on (SSO) flow. In either case, the SAML message needs to be a base64
3561
+ encoded XML document with a root element of `<Response>`. After successful validation,
3562
+ Elasticsearch responds with an Elasticsearch internal access token and refresh
3563
+ token that can be subsequently used for authentication. This API endpoint essentially
3564
+ exchanges SAML responses that indicate successful authentication in the IdP for
3565
+ Elasticsearch access and refresh tokens, which can be used for authentication
3566
+ against Elasticsearch.
3092
3567
 
3093
3568
  `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-saml-authenticate.html>`_
3094
3569
 
3095
- :param content: The SAML response as it was sent by the users browser, usually
3570
+ :param content: The SAML response as it was sent by the user's browser, usually
3096
3571
  a Base64 encoded XML document.
3097
- :param ids: A json array with all the valid SAML Request Ids that the caller
3572
+ :param ids: A JSON array with all the valid SAML Request Ids that the caller
3098
3573
  of the API has for the current user.
3099
3574
  :param realm: The name of the realm that should authenticate the SAML response.
3100
3575
  Useful in cases where many SAML realms are defined.
@@ -3151,10 +3626,19 @@ class SecurityClient(NamespacedClient):
3151
3626
  ) -> ObjectApiResponse[t.Any]:
3152
3627
  """
3153
3628
  Logout of SAML completely. Verifies the logout response sent from the SAML IdP.
3629
+ NOTE: This API is intended for use by custom web applications other than Kibana.
3630
+ If you are using Kibana, refer to the documentation for configuring SAML single-sign-on
3631
+ on the Elastic Stack. The SAML IdP may send a logout response back to the SP
3632
+ after handling the SP-initiated SAML Single Logout. This API verifies the response
3633
+ by ensuring the content is relevant and validating its signature. An empty response
3634
+ is returned if the verification process is successful. The response can be sent
3635
+ by the IdP with either the HTTP-Redirect or the HTTP-Post binding. The caller
3636
+ of this API must prepare the request accordingly so that this API can handle
3637
+ either of them.
3154
3638
 
3155
3639
  `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-saml-complete-logout.html>`_
3156
3640
 
3157
- :param ids: A json array with all the valid SAML Request Ids that the caller
3641
+ :param ids: A JSON array with all the valid SAML Request Ids that the caller
3158
3642
  of the API has for the current user.
3159
3643
  :param realm: The name of the SAML realm in Elasticsearch for which the configuration
3160
3644
  is used to verify the logout response.
@@ -3216,25 +3700,33 @@ class SecurityClient(NamespacedClient):
3216
3700
  body: t.Optional[t.Dict[str, t.Any]] = None,
3217
3701
  ) -> ObjectApiResponse[t.Any]:
3218
3702
  """
3219
- Invalidate SAML. Submits a SAML LogoutRequest message to Elasticsearch for consumption.
3703
+ Invalidate SAML. Submit a SAML LogoutRequest message to Elasticsearch for consumption.
3704
+ NOTE: This API is intended for use by custom web applications other than Kibana.
3705
+ If you are using Kibana, refer to the documentation for configuring SAML single-sign-on
3706
+ on the Elastic Stack. The logout request comes from the SAML IdP during an IdP
3707
+ initiated Single Logout. The custom web application can use this API to have
3708
+ Elasticsearch process the `LogoutRequest`. After successful validation of the
3709
+ request, Elasticsearch invalidates the access token and refresh token that corresponds
3710
+ to that specific SAML principal and provides a URL that contains a SAML LogoutResponse
3711
+ message. Thus the user can be redirected back to their IdP.
3220
3712
 
3221
3713
  `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-saml-invalidate.html>`_
3222
3714
 
3223
3715
  :param query_string: The query part of the URL that the user was redirected to
3224
3716
  by the SAML IdP to initiate the Single Logout. This query should include
3225
- a single parameter named SAMLRequest that contains a SAML logout request
3717
+ a single parameter named `SAMLRequest` that contains a SAML logout request
3226
3718
  that is deflated and Base64 encoded. If the SAML IdP has signed the logout
3227
- request, the URL should include two extra parameters named SigAlg and Signature
3719
+ request, the URL should include two extra parameters named `SigAlg` and `Signature`
3228
3720
  that contain the algorithm used for the signature and the signature value
3229
- itself. In order for Elasticsearch to be able to verify the IdPs signature,
3230
- the value of the query_string field must be an exact match to the string
3721
+ itself. In order for Elasticsearch to be able to verify the IdP's signature,
3722
+ the value of the `query_string` field must be an exact match to the string
3231
3723
  provided by the browser. The client application must not attempt to parse
3232
3724
  or process the string in any way.
3233
3725
  :param acs: The Assertion Consumer Service URL that matches the one of the SAML
3234
3726
  realm in Elasticsearch that should be used. You must specify either this
3235
- parameter or the realm parameter.
3727
+ parameter or the `realm` parameter.
3236
3728
  :param realm: The name of the SAML realm in Elasticsearch the configuration.
3237
- You must specify either this parameter or the acs parameter.
3729
+ You must specify either this parameter or the `acs` parameter.
3238
3730
  """
3239
3731
  if query_string is None and body is None:
3240
3732
  raise ValueError("Empty value passed for parameter 'query_string'")
@@ -3284,12 +3776,19 @@ class SecurityClient(NamespacedClient):
3284
3776
  ) -> ObjectApiResponse[t.Any]:
3285
3777
  """
3286
3778
  Logout of SAML. Submits a request to invalidate an access token and refresh token.
3779
+ NOTE: This API is intended for use by custom web applications other than Kibana.
3780
+ If you are using Kibana, refer to the documentation for configuring SAML single-sign-on
3781
+ on the Elastic Stack. This API invalidates the tokens that were generated for
3782
+ a user by the SAML authenticate API. If the SAML realm in Elasticsearch is configured
3783
+ accordingly and the SAML IdP supports this, the Elasticsearch response contains
3784
+ a URL to redirect the user to the IdP that contains a SAML logout request (starting
3785
+ an SP-initiated SAML Single Logout).
3287
3786
 
3288
3787
  `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-saml-logout.html>`_
3289
3788
 
3290
3789
  :param token: The access token that was returned as a response to calling the
3291
3790
  SAML authenticate API. Alternatively, the most recent token that was received
3292
- after refreshing the original one by using a refresh_token.
3791
+ after refreshing the original one by using a `refresh_token`.
3293
3792
  :param refresh_token: The refresh token that was returned as a response to calling
3294
3793
  the SAML authenticate API. Alternatively, the most recent refresh token that
3295
3794
  was received after refreshing the original access token.
@@ -3340,19 +3839,31 @@ class SecurityClient(NamespacedClient):
3340
3839
  body: t.Optional[t.Dict[str, t.Any]] = None,
3341
3840
  ) -> ObjectApiResponse[t.Any]:
3342
3841
  """
3343
- Prepare SAML authentication. Creates a SAML authentication request (`<AuthnRequest>`)
3344
- as a URL string, based on the configuration of the respective SAML realm in Elasticsearch.
3842
+ Prepare SAML authentication. Create a SAML authentication request (`<AuthnRequest>`)
3843
+ as a URL string based on the configuration of the respective SAML realm in Elasticsearch.
3844
+ NOTE: This API is intended for use by custom web applications other than Kibana.
3845
+ If you are using Kibana, refer to the documentation for configuring SAML single-sign-on
3846
+ on the Elastic Stack. This API returns a URL pointing to the SAML Identity Provider.
3847
+ You can use the URL to redirect the browser of the user in order to continue
3848
+ the authentication process. The URL includes a single parameter named `SAMLRequest`,
3849
+ which contains a SAML Authentication request that is deflated and Base64 encoded.
3850
+ If the configuration dictates that SAML authentication requests should be signed,
3851
+ the URL has two extra parameters named `SigAlg` and `Signature`. These parameters
3852
+ contain the algorithm used for the signature and the signature value itself.
3853
+ It also returns a random string that uniquely identifies this SAML Authentication
3854
+ request. The caller of this API needs to store this identifier as it needs to
3855
+ be used in a following step of the authentication process.
3345
3856
 
3346
3857
  `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-saml-prepare-authentication.html>`_
3347
3858
 
3348
3859
  :param acs: The Assertion Consumer Service URL that matches the one of the SAML
3349
3860
  realms in Elasticsearch. The realm is used to generate the authentication
3350
- request. You must specify either this parameter or the realm parameter.
3861
+ request. You must specify either this parameter or the `realm` parameter.
3351
3862
  :param realm: The name of the SAML realm in Elasticsearch for which the configuration
3352
3863
  is used to generate the authentication request. You must specify either this
3353
- parameter or the acs parameter.
3864
+ parameter or the `acs` parameter.
3354
3865
  :param relay_state: A string that will be included in the redirect URL that this
3355
- API returns as the RelayState query parameter. If the Authentication Request
3866
+ API returns as the `RelayState` query parameter. If the Authentication Request
3356
3867
  is signed, this value is used as part of the signature computation.
3357
3868
  """
3358
3869
  __path_parts: t.Dict[str, str] = {}
@@ -3397,7 +3908,10 @@ class SecurityClient(NamespacedClient):
3397
3908
  ) -> ObjectApiResponse[t.Any]:
3398
3909
  """
3399
3910
  Create SAML service provider metadata. Generate SAML metadata for a SAML 2.0
3400
- Service Provider.
3911
+ Service Provider. The SAML 2.0 specification provides a mechanism for Service
3912
+ Providers to describe their capabilities and configuration using a metadata file.
3913
+ This API generates Service Provider metadata based on the configuration of a
3914
+ SAML realm in Elasticsearch.
3401
3915
 
3402
3916
  `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-saml-sp-metadata.html>`_
3403
3917
 
@@ -3444,21 +3958,27 @@ class SecurityClient(NamespacedClient):
3444
3958
  ) -> ObjectApiResponse[t.Any]:
3445
3959
  """
3446
3960
  Suggest a user profile. Get suggestions for user profiles that match specified
3447
- search criteria.
3961
+ search criteria. NOTE: The user profile feature is designed only for use by Kibana
3962
+ and Elastic's Observability, Enterprise Search, and Elastic Security solutions.
3963
+ Individual users and external applications should not call this API directly.
3964
+ Elastic reserves the right to change or remove this feature in future releases
3965
+ without prior notice.
3448
3966
 
3449
3967
  `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-suggest-user-profile.html>`_
3450
3968
 
3451
- :param data: List of filters for the `data` field of the profile document. To
3452
- return all content use `data=*`. To return a subset of content use `data=<key>`
3453
- to retrieve content nested under the specified `<key>`. By default returns
3454
- no `data` content.
3969
+ :param data: A comma-separated list of filters for the `data` field of the profile
3970
+ document. To return all content use `data=*`. To return a subset of content,
3971
+ use `data=<key>` to retrieve content nested under the specified `<key>`.
3972
+ By default, the API returns no `data` content. It is an error to specify
3973
+ `data` as both the query parameter and the request body field.
3455
3974
  :param hint: Extra search criteria to improve relevance of the suggestion result.
3456
3975
  Profiles matching the spcified hint are ranked higher in the response. Profiles
3457
- not matching the hint don't exclude the profile from the response as long
3458
- as the profile matches the `name` field query.
3459
- :param name: Query string used to match name-related fields in user profile documents.
3460
- Name-related fields are the user's `username`, `full_name`, and `email`.
3461
- :param size: Number of profiles to return.
3976
+ not matching the hint aren't excluded from the response as long as the profile
3977
+ matches the `name` field query.
3978
+ :param name: A query string used to match name-related fields in user profile
3979
+ documents. Name-related fields are the user's `username`, `full_name`, and
3980
+ `email`.
3981
+ :param size: The number of profiles to return.
3462
3982
  """
3463
3983
  __path_parts: t.Dict[str, str] = {}
3464
3984
  __path = "/_security/profile/_suggest"
@@ -3600,7 +4120,18 @@ class SecurityClient(NamespacedClient):
3600
4120
  ) -> ObjectApiResponse[t.Any]:
3601
4121
  """
3602
4122
  Update a cross-cluster API key. Update the attributes of an existing cross-cluster
3603
- API key, which is used for API key based remote cluster access.
4123
+ API key, which is used for API key based remote cluster access. To use this API,
4124
+ you must have at least the `manage_security` cluster privilege. Users can only
4125
+ update API keys that they created. To update another user's API key, use the
4126
+ `run_as` feature to submit a request on behalf of another user. IMPORTANT: It's
4127
+ not possible to use an API key as the authentication credential for this API.
4128
+ To update an API key, the owner user's credentials are required. It's not possible
4129
+ to update expired API keys, or API keys that have been invalidated by the invalidate
4130
+ API key API. This API supports updates to an API key's access scope, metadata,
4131
+ and expiration. The owner user's information, such as the `username` and `realm`,
4132
+ is also updated automatically on every call. NOTE: This API cannot update REST
4133
+ API keys, which should be updated by either the update API key or bulk update
4134
+ API keys API.
3604
4135
 
3605
4136
  `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-update-cross-cluster-api-key.html>`_
3606
4137
 
@@ -3609,8 +4140,8 @@ class SecurityClient(NamespacedClient):
3609
4140
  of permissions for cross cluster search and cross cluster replication. At
3610
4141
  least one of them must be specified. When specified, the new access assignment
3611
4142
  fully replaces the previously assigned access.
3612
- :param expiration: Expiration time for the API key. By default, API keys never
3613
- expire. This property can be omitted to leave the value unchanged.
4143
+ :param expiration: The expiration time for the API key. By default, API keys
4144
+ never expire. This property can be omitted to leave the value unchanged.
3614
4145
  :param metadata: Arbitrary metadata that you want to associate with the API key.
3615
4146
  It supports nested data structure. Within the metadata object, keys beginning
3616
4147
  with `_` are reserved for system usage. When specified, this information
@@ -3650,6 +4181,81 @@ class SecurityClient(NamespacedClient):
3650
4181
  path_parts=__path_parts,
3651
4182
  )
3652
4183
 
4184
+ @_rewrite_parameters(
4185
+ body_fields=("security", "security_profile", "security_tokens"),
4186
+ parameter_aliases={
4187
+ "security-profile": "security_profile",
4188
+ "security-tokens": "security_tokens",
4189
+ },
4190
+ )
4191
+ def update_settings(
4192
+ self,
4193
+ *,
4194
+ error_trace: t.Optional[bool] = None,
4195
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
4196
+ human: t.Optional[bool] = None,
4197
+ master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
4198
+ pretty: t.Optional[bool] = None,
4199
+ security: t.Optional[t.Mapping[str, t.Any]] = None,
4200
+ security_profile: t.Optional[t.Mapping[str, t.Any]] = None,
4201
+ security_tokens: t.Optional[t.Mapping[str, t.Any]] = None,
4202
+ timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
4203
+ body: t.Optional[t.Dict[str, t.Any]] = None,
4204
+ ) -> ObjectApiResponse[t.Any]:
4205
+ """
4206
+ Update security index settings. Update the user-configurable settings for the
4207
+ security internal index (`.security` and associated indices). Only a subset of
4208
+ settings are allowed to be modified, for example `index.auto_expand_replicas`
4209
+ and `index.number_of_replicas`. If a specific index is not in use on the system
4210
+ and settings are provided for it, the request will be rejected. This API does
4211
+ not yet support configuring the settings for indices before they are in use.
4212
+
4213
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-update-settings.html>`_
4214
+
4215
+ :param master_timeout: The period to wait for a connection to the master node.
4216
+ If no response is received before the timeout expires, the request fails
4217
+ and returns an error.
4218
+ :param security: Settings for the index used for most security configuration,
4219
+ including native realm users and roles configured with the API.
4220
+ :param security_profile: Settings for the index used to store profile information.
4221
+ :param security_tokens: Settings for the index used to store tokens.
4222
+ :param timeout: The period to wait for a response. If no response is received
4223
+ before the timeout expires, the request fails and returns an error.
4224
+ """
4225
+ __path_parts: t.Dict[str, str] = {}
4226
+ __path = "/_security/settings"
4227
+ __query: t.Dict[str, t.Any] = {}
4228
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
4229
+ if error_trace is not None:
4230
+ __query["error_trace"] = error_trace
4231
+ if filter_path is not None:
4232
+ __query["filter_path"] = filter_path
4233
+ if human is not None:
4234
+ __query["human"] = human
4235
+ if master_timeout is not None:
4236
+ __query["master_timeout"] = master_timeout
4237
+ if pretty is not None:
4238
+ __query["pretty"] = pretty
4239
+ if timeout is not None:
4240
+ __query["timeout"] = timeout
4241
+ if not __body:
4242
+ if security is not None:
4243
+ __body["security"] = security
4244
+ if security_profile is not None:
4245
+ __body["security-profile"] = security_profile
4246
+ if security_tokens is not None:
4247
+ __body["security-tokens"] = security_tokens
4248
+ __headers = {"accept": "application/json", "content-type": "application/json"}
4249
+ return self.perform_request( # type: ignore[return-value]
4250
+ "PUT",
4251
+ __path,
4252
+ params=__query,
4253
+ headers=__headers,
4254
+ body=__body,
4255
+ endpoint_id="security.update_settings",
4256
+ path_parts=__path_parts,
4257
+ )
4258
+
3653
4259
  @_rewrite_parameters(
3654
4260
  body_fields=("data", "labels"),
3655
4261
  )
@@ -3672,22 +4278,37 @@ class SecurityClient(NamespacedClient):
3672
4278
  ) -> ObjectApiResponse[t.Any]:
3673
4279
  """
3674
4280
  Update user profile data. Update specific data for the user profile that is associated
3675
- with a unique ID.
4281
+ with a unique ID. NOTE: The user profile feature is designed only for use by
4282
+ Kibana and Elastic's Observability, Enterprise Search, and Elastic Security solutions.
4283
+ Individual users and external applications should not call this API directly.
4284
+ Elastic reserves the right to change or remove this feature in future releases
4285
+ without prior notice. To use this API, you must have one of the following privileges:
4286
+ * The `manage_user_profile` cluster privilege. * The `update_profile_data` global
4287
+ privilege for the namespaces that are referenced in the request. This API updates
4288
+ the `labels` and `data` fields of an existing user profile document with JSON
4289
+ objects. New keys and their values are added to the profile document and conflicting
4290
+ keys are replaced by data that's included in the request. For both labels and
4291
+ data, content is namespaced by the top-level fields. The `update_profile_data`
4292
+ global privilege grants privileges for updating only the allowed namespaces.
3676
4293
 
3677
4294
  `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-update-user-profile-data.html>`_
3678
4295
 
3679
4296
  :param uid: A unique identifier for the user profile.
3680
4297
  :param data: Non-searchable data that you want to associate with the user profile.
3681
- This field supports a nested data structure.
4298
+ This field supports a nested data structure. Within the `data` object, top-level
4299
+ keys cannot begin with an underscore (`_`) or contain a period (`.`). The
4300
+ data object is not searchable, but can be retrieved with the get user profile
4301
+ API.
3682
4302
  :param if_primary_term: Only perform the operation if the document has this primary
3683
4303
  term.
3684
4304
  :param if_seq_no: Only perform the operation if the document has this sequence
3685
4305
  number.
3686
4306
  :param labels: Searchable data that you want to associate with the user profile.
3687
- This field supports a nested data structure.
4307
+ This field supports a nested data structure. Within the labels object, top-level
4308
+ keys cannot begin with an underscore (`_`) or contain a period (`.`).
3688
4309
  :param refresh: If 'true', Elasticsearch refreshes the affected shards to make
3689
- this operation visible to search, if 'wait_for' then wait for a refresh to
3690
- make this operation visible to search, if 'false' do nothing with refreshes.
4310
+ this operation visible to search. If 'wait_for', it waits for a refresh to
4311
+ make this operation visible to search. If 'false', nothing is done with refreshes.
3691
4312
  """
3692
4313
  if uid in SKIP_IN_PATH:
3693
4314
  raise ValueError("Empty value passed for parameter 'uid'")