elasticsearch 8.14.0__py3-none-any.whl → 8.15.0__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.
- elasticsearch/_async/client/__init__.py +196 -168
- elasticsearch/_async/client/async_search.py +35 -20
- elasticsearch/_async/client/autoscaling.py +4 -4
- elasticsearch/_async/client/cat.py +785 -180
- elasticsearch/_async/client/ccr.py +20 -32
- elasticsearch/_async/client/cluster.py +87 -79
- elasticsearch/_async/client/connector.py +1470 -0
- elasticsearch/_async/client/dangling_indices.py +7 -11
- elasticsearch/_async/client/enrich.py +8 -8
- elasticsearch/_async/client/eql.py +17 -16
- elasticsearch/_async/client/esql.py +2 -2
- elasticsearch/_async/client/features.py +2 -2
- elasticsearch/_async/client/fleet.py +18 -17
- elasticsearch/_async/client/graph.py +4 -4
- elasticsearch/_async/client/ilm.py +36 -44
- elasticsearch/_async/client/indices.py +282 -317
- elasticsearch/_async/client/inference.py +42 -33
- elasticsearch/_async/client/ingest.py +22 -23
- elasticsearch/_async/client/license.py +18 -10
- elasticsearch/_async/client/logstash.py +6 -6
- elasticsearch/_async/client/migration.py +3 -3
- elasticsearch/_async/client/ml.py +383 -176
- elasticsearch/_async/client/monitoring.py +2 -2
- elasticsearch/_async/client/nodes.py +32 -32
- elasticsearch/_async/client/query_rules.py +384 -0
- elasticsearch/_async/client/rollup.py +13 -13
- elasticsearch/_async/client/search_application.py +10 -10
- elasticsearch/_async/client/searchable_snapshots.py +9 -13
- elasticsearch/_async/client/security.py +577 -104
- elasticsearch/_async/client/shutdown.py +7 -7
- elasticsearch/_async/client/slm.py +11 -13
- elasticsearch/_async/client/snapshot.py +39 -52
- elasticsearch/_async/client/sql.py +12 -14
- elasticsearch/_async/client/ssl.py +1 -1
- elasticsearch/_async/client/synonyms.py +8 -8
- elasticsearch/_async/client/tasks.py +9 -10
- elasticsearch/_async/client/text_structure.py +3 -3
- elasticsearch/_async/client/transform.py +89 -34
- elasticsearch/_async/client/watcher.py +30 -15
- elasticsearch/_async/client/xpack.py +6 -7
- elasticsearch/_otel.py +2 -6
- elasticsearch/_sync/client/__init__.py +196 -168
- elasticsearch/_sync/client/async_search.py +35 -20
- elasticsearch/_sync/client/autoscaling.py +4 -4
- elasticsearch/_sync/client/cat.py +785 -180
- elasticsearch/_sync/client/ccr.py +20 -32
- elasticsearch/_sync/client/cluster.py +87 -79
- elasticsearch/_sync/client/connector.py +1470 -0
- elasticsearch/_sync/client/dangling_indices.py +7 -11
- elasticsearch/_sync/client/enrich.py +8 -8
- elasticsearch/_sync/client/eql.py +17 -16
- elasticsearch/_sync/client/esql.py +2 -2
- elasticsearch/_sync/client/features.py +2 -2
- elasticsearch/_sync/client/fleet.py +18 -17
- elasticsearch/_sync/client/graph.py +4 -4
- elasticsearch/_sync/client/ilm.py +36 -44
- elasticsearch/_sync/client/indices.py +282 -317
- elasticsearch/_sync/client/inference.py +42 -33
- elasticsearch/_sync/client/ingest.py +22 -23
- elasticsearch/_sync/client/license.py +18 -10
- elasticsearch/_sync/client/logstash.py +6 -6
- elasticsearch/_sync/client/migration.py +3 -3
- elasticsearch/_sync/client/ml.py +383 -176
- elasticsearch/_sync/client/monitoring.py +2 -2
- elasticsearch/_sync/client/nodes.py +32 -32
- elasticsearch/_sync/client/query_rules.py +384 -0
- elasticsearch/_sync/client/rollup.py +13 -13
- elasticsearch/_sync/client/search_application.py +10 -10
- elasticsearch/_sync/client/searchable_snapshots.py +9 -13
- elasticsearch/_sync/client/security.py +577 -104
- elasticsearch/_sync/client/shutdown.py +7 -7
- elasticsearch/_sync/client/slm.py +11 -13
- elasticsearch/_sync/client/snapshot.py +39 -52
- elasticsearch/_sync/client/sql.py +12 -14
- elasticsearch/_sync/client/ssl.py +1 -1
- elasticsearch/_sync/client/synonyms.py +8 -8
- elasticsearch/_sync/client/tasks.py +9 -10
- elasticsearch/_sync/client/text_structure.py +3 -3
- elasticsearch/_sync/client/transform.py +89 -34
- elasticsearch/_sync/client/watcher.py +30 -15
- elasticsearch/_sync/client/xpack.py +6 -7
- elasticsearch/_version.py +1 -1
- elasticsearch/client.py +3 -3
- elasticsearch/helpers/vectorstore/_async/vectorstore.py +36 -6
- elasticsearch/helpers/vectorstore/_sync/vectorstore.py +36 -6
- elasticsearch/serializer.py +34 -0
- elasticsearch-8.15.0.dist-info/METADATA +177 -0
- elasticsearch-8.15.0.dist-info/RECORD +117 -0
- {elasticsearch-8.14.0.dist-info → elasticsearch-8.15.0.dist-info}/WHEEL +1 -2
- elasticsearch/_async/client/query_ruleset.py +0 -205
- elasticsearch/_sync/client/query_ruleset.py +0 -205
- elasticsearch-8.14.0.dist-info/METADATA +0 -161
- elasticsearch-8.14.0.dist-info/RECORD +0 -116
- elasticsearch-8.14.0.dist-info/top_level.txt +0 -1
- {elasticsearch-8.14.0.dist-info → elasticsearch-8.15.0.dist-info/licenses}/LICENSE +0 -0
- {elasticsearch-8.14.0.dist-info → elasticsearch-8.15.0.dist-info/licenses}/NOTICE +0 -0
|
@@ -32,7 +32,7 @@ class SecurityClient(NamespacedClient):
|
|
|
32
32
|
self,
|
|
33
33
|
*,
|
|
34
34
|
grant_type: t.Optional[
|
|
35
|
-
t.Union[
|
|
35
|
+
t.Union[str, t.Literal["access_token", "password"]]
|
|
36
36
|
] = None,
|
|
37
37
|
access_token: t.Optional[str] = None,
|
|
38
38
|
error_trace: t.Optional[bool] = None,
|
|
@@ -44,9 +44,9 @@ class SecurityClient(NamespacedClient):
|
|
|
44
44
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
45
45
|
) -> ObjectApiResponse[t.Any]:
|
|
46
46
|
"""
|
|
47
|
-
Creates or updates
|
|
47
|
+
Creates or updates a user profile on behalf of another user.
|
|
48
48
|
|
|
49
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
49
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-activate-user-profile.html>`_
|
|
50
50
|
|
|
51
51
|
:param grant_type:
|
|
52
52
|
:param access_token:
|
|
@@ -97,10 +97,14 @@ class SecurityClient(NamespacedClient):
|
|
|
97
97
|
pretty: t.Optional[bool] = None,
|
|
98
98
|
) -> ObjectApiResponse[t.Any]:
|
|
99
99
|
"""
|
|
100
|
-
Enables
|
|
101
|
-
user.
|
|
100
|
+
Enables you to submit a request with a basic auth header to authenticate a user
|
|
101
|
+
and retrieve information about the authenticated user. A successful call returns
|
|
102
|
+
a JSON structure that shows user information such as their username, the roles
|
|
103
|
+
that are assigned to the user, any assigned metadata, and information about the
|
|
104
|
+
realms that authenticated and authorized the user. If the user cannot be authenticated,
|
|
105
|
+
this API returns a 401 status code.
|
|
102
106
|
|
|
103
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
107
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-authenticate.html>`_
|
|
104
108
|
"""
|
|
105
109
|
__path_parts: t.Dict[str, str] = {}
|
|
106
110
|
__path = "/_security/_authenticate"
|
|
@@ -123,6 +127,122 @@ class SecurityClient(NamespacedClient):
|
|
|
123
127
|
path_parts=__path_parts,
|
|
124
128
|
)
|
|
125
129
|
|
|
130
|
+
@_rewrite_parameters(
|
|
131
|
+
body_fields=("names",),
|
|
132
|
+
)
|
|
133
|
+
def bulk_delete_role(
|
|
134
|
+
self,
|
|
135
|
+
*,
|
|
136
|
+
names: t.Optional[t.Sequence[str]] = None,
|
|
137
|
+
error_trace: t.Optional[bool] = None,
|
|
138
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
139
|
+
human: t.Optional[bool] = None,
|
|
140
|
+
pretty: t.Optional[bool] = None,
|
|
141
|
+
refresh: t.Optional[
|
|
142
|
+
t.Union[bool, str, t.Literal["false", "true", "wait_for"]]
|
|
143
|
+
] = None,
|
|
144
|
+
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
145
|
+
) -> ObjectApiResponse[t.Any]:
|
|
146
|
+
"""
|
|
147
|
+
The role management APIs are generally the preferred way to manage roles, rather
|
|
148
|
+
than using file-based role management. The bulk delete roles API cannot delete
|
|
149
|
+
roles that are defined in roles files.
|
|
150
|
+
|
|
151
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-bulk-delete-role.html>`_
|
|
152
|
+
|
|
153
|
+
:param names: An array of role names to delete
|
|
154
|
+
:param refresh: If `true` (the default) then refresh the affected shards to make
|
|
155
|
+
this operation visible to search, if `wait_for` then wait for a refresh to
|
|
156
|
+
make this operation visible to search, if `false` then do nothing with refreshes.
|
|
157
|
+
"""
|
|
158
|
+
if names is None and body is None:
|
|
159
|
+
raise ValueError("Empty value passed for parameter 'names'")
|
|
160
|
+
__path_parts: t.Dict[str, str] = {}
|
|
161
|
+
__path = "/_security/role"
|
|
162
|
+
__query: t.Dict[str, t.Any] = {}
|
|
163
|
+
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
164
|
+
if error_trace is not None:
|
|
165
|
+
__query["error_trace"] = error_trace
|
|
166
|
+
if filter_path is not None:
|
|
167
|
+
__query["filter_path"] = filter_path
|
|
168
|
+
if human is not None:
|
|
169
|
+
__query["human"] = human
|
|
170
|
+
if pretty is not None:
|
|
171
|
+
__query["pretty"] = pretty
|
|
172
|
+
if refresh is not None:
|
|
173
|
+
__query["refresh"] = refresh
|
|
174
|
+
if not __body:
|
|
175
|
+
if names is not None:
|
|
176
|
+
__body["names"] = names
|
|
177
|
+
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
178
|
+
return self.perform_request( # type: ignore[return-value]
|
|
179
|
+
"DELETE",
|
|
180
|
+
__path,
|
|
181
|
+
params=__query,
|
|
182
|
+
headers=__headers,
|
|
183
|
+
body=__body,
|
|
184
|
+
endpoint_id="security.bulk_delete_role",
|
|
185
|
+
path_parts=__path_parts,
|
|
186
|
+
)
|
|
187
|
+
|
|
188
|
+
@_rewrite_parameters(
|
|
189
|
+
body_fields=("roles",),
|
|
190
|
+
)
|
|
191
|
+
def bulk_put_role(
|
|
192
|
+
self,
|
|
193
|
+
*,
|
|
194
|
+
roles: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
|
|
195
|
+
error_trace: t.Optional[bool] = None,
|
|
196
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
197
|
+
human: t.Optional[bool] = None,
|
|
198
|
+
pretty: t.Optional[bool] = None,
|
|
199
|
+
refresh: t.Optional[
|
|
200
|
+
t.Union[bool, str, t.Literal["false", "true", "wait_for"]]
|
|
201
|
+
] = None,
|
|
202
|
+
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
203
|
+
) -> ObjectApiResponse[t.Any]:
|
|
204
|
+
"""
|
|
205
|
+
The role management APIs are generally the preferred way to manage roles, rather
|
|
206
|
+
than using file-based role management. The bulk create or update roles API cannot
|
|
207
|
+
update roles that are defined in roles files.
|
|
208
|
+
|
|
209
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-bulk-put-role.html>`_
|
|
210
|
+
|
|
211
|
+
:param roles: A dictionary of role name to RoleDescriptor objects to add or update
|
|
212
|
+
:param refresh: If `true` (the default) then refresh the affected shards to make
|
|
213
|
+
this operation visible to search, if `wait_for` then wait for a refresh to
|
|
214
|
+
make this operation visible to search, if `false` then do nothing with refreshes.
|
|
215
|
+
"""
|
|
216
|
+
if roles is None and body is None:
|
|
217
|
+
raise ValueError("Empty value passed for parameter 'roles'")
|
|
218
|
+
__path_parts: t.Dict[str, str] = {}
|
|
219
|
+
__path = "/_security/role"
|
|
220
|
+
__query: t.Dict[str, t.Any] = {}
|
|
221
|
+
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
222
|
+
if error_trace is not None:
|
|
223
|
+
__query["error_trace"] = error_trace
|
|
224
|
+
if filter_path is not None:
|
|
225
|
+
__query["filter_path"] = filter_path
|
|
226
|
+
if human is not None:
|
|
227
|
+
__query["human"] = human
|
|
228
|
+
if pretty is not None:
|
|
229
|
+
__query["pretty"] = pretty
|
|
230
|
+
if refresh is not None:
|
|
231
|
+
__query["refresh"] = refresh
|
|
232
|
+
if not __body:
|
|
233
|
+
if roles is not None:
|
|
234
|
+
__body["roles"] = roles
|
|
235
|
+
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
236
|
+
return self.perform_request( # type: ignore[return-value]
|
|
237
|
+
"POST",
|
|
238
|
+
__path,
|
|
239
|
+
params=__query,
|
|
240
|
+
headers=__headers,
|
|
241
|
+
body=__body,
|
|
242
|
+
endpoint_id="security.bulk_put_role",
|
|
243
|
+
path_parts=__path_parts,
|
|
244
|
+
)
|
|
245
|
+
|
|
126
246
|
@_rewrite_parameters(
|
|
127
247
|
body_fields=("password", "password_hash"),
|
|
128
248
|
)
|
|
@@ -137,14 +257,14 @@ class SecurityClient(NamespacedClient):
|
|
|
137
257
|
password_hash: t.Optional[str] = None,
|
|
138
258
|
pretty: t.Optional[bool] = None,
|
|
139
259
|
refresh: t.Optional[
|
|
140
|
-
t.Union[
|
|
260
|
+
t.Union[bool, str, t.Literal["false", "true", "wait_for"]]
|
|
141
261
|
] = None,
|
|
142
262
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
143
263
|
) -> ObjectApiResponse[t.Any]:
|
|
144
264
|
"""
|
|
145
265
|
Changes the passwords of users in the native realm and built-in users.
|
|
146
266
|
|
|
147
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
267
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-change-password.html>`_
|
|
148
268
|
|
|
149
269
|
:param username: The user whose password you want to change. If you do not specify
|
|
150
270
|
this parameter, the password is changed for the current user.
|
|
@@ -204,9 +324,10 @@ class SecurityClient(NamespacedClient):
|
|
|
204
324
|
pretty: t.Optional[bool] = None,
|
|
205
325
|
) -> ObjectApiResponse[t.Any]:
|
|
206
326
|
"""
|
|
207
|
-
|
|
327
|
+
Evicts a subset of all entries from the API key cache. The cache is also automatically
|
|
328
|
+
cleared on state changes of the security index.
|
|
208
329
|
|
|
209
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
330
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-clear-api-key-cache.html>`_
|
|
210
331
|
|
|
211
332
|
:param ids: Comma-separated list of API key IDs to evict from the API key cache.
|
|
212
333
|
To evict all API keys, use `*`. Does not support other wildcard patterns.
|
|
@@ -247,7 +368,7 @@ class SecurityClient(NamespacedClient):
|
|
|
247
368
|
"""
|
|
248
369
|
Evicts application privileges from the native application privileges cache.
|
|
249
370
|
|
|
250
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
371
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-clear-privilege-cache.html>`_
|
|
251
372
|
|
|
252
373
|
:param application: A comma-separated list of application names
|
|
253
374
|
"""
|
|
@@ -289,7 +410,7 @@ class SecurityClient(NamespacedClient):
|
|
|
289
410
|
Evicts users from the user cache. Can completely clear the cache or evict specific
|
|
290
411
|
users.
|
|
291
412
|
|
|
292
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
413
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-clear-cache.html>`_
|
|
293
414
|
|
|
294
415
|
:param realms: Comma-separated list of realms to clear
|
|
295
416
|
:param usernames: Comma-separated list of usernames to clear from the cache
|
|
@@ -332,7 +453,7 @@ class SecurityClient(NamespacedClient):
|
|
|
332
453
|
"""
|
|
333
454
|
Evicts roles from the native role cache.
|
|
334
455
|
|
|
335
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
456
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-clear-role-cache.html>`_
|
|
336
457
|
|
|
337
458
|
:param name: Role name
|
|
338
459
|
"""
|
|
@@ -374,7 +495,7 @@ class SecurityClient(NamespacedClient):
|
|
|
374
495
|
"""
|
|
375
496
|
Evicts tokens from the service account token caches.
|
|
376
497
|
|
|
377
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
498
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-clear-service-token-caches.html>`_
|
|
378
499
|
|
|
379
500
|
:param namespace: An identifier for the namespace
|
|
380
501
|
:param service: An identifier for the service name
|
|
@@ -418,22 +539,26 @@ class SecurityClient(NamespacedClient):
|
|
|
418
539
|
self,
|
|
419
540
|
*,
|
|
420
541
|
error_trace: t.Optional[bool] = None,
|
|
421
|
-
expiration: t.Optional[t.Union[
|
|
542
|
+
expiration: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
422
543
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
423
544
|
human: t.Optional[bool] = None,
|
|
424
545
|
metadata: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
425
546
|
name: t.Optional[str] = None,
|
|
426
547
|
pretty: t.Optional[bool] = None,
|
|
427
548
|
refresh: t.Optional[
|
|
428
|
-
t.Union[
|
|
549
|
+
t.Union[bool, str, t.Literal["false", "true", "wait_for"]]
|
|
429
550
|
] = None,
|
|
430
551
|
role_descriptors: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
|
|
431
552
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
432
553
|
) -> ObjectApiResponse[t.Any]:
|
|
433
554
|
"""
|
|
434
|
-
Creates an API key for access without requiring basic authentication.
|
|
555
|
+
Creates an API key for access without requiring basic authentication. A successful
|
|
556
|
+
request returns a JSON structure that contains the API key, its unique id, and
|
|
557
|
+
its name. If applicable, it also returns expiration information for the API key
|
|
558
|
+
in milliseconds. NOTE: By default, API keys never expire. You can specify expiration
|
|
559
|
+
information when you create the API keys.
|
|
435
560
|
|
|
436
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
561
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-create-api-key.html>`_
|
|
437
562
|
|
|
438
563
|
:param expiration: Expiration time for the API key. By default, API keys never
|
|
439
564
|
expire.
|
|
@@ -499,13 +624,13 @@ class SecurityClient(NamespacedClient):
|
|
|
499
624
|
human: t.Optional[bool] = None,
|
|
500
625
|
pretty: t.Optional[bool] = None,
|
|
501
626
|
refresh: t.Optional[
|
|
502
|
-
t.Union[
|
|
627
|
+
t.Union[bool, str, t.Literal["false", "true", "wait_for"]]
|
|
503
628
|
] = None,
|
|
504
629
|
) -> ObjectApiResponse[t.Any]:
|
|
505
630
|
"""
|
|
506
|
-
Creates a service
|
|
631
|
+
Creates a service accounts token for access without requiring basic authentication.
|
|
507
632
|
|
|
508
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
633
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-create-service-token.html>`_
|
|
509
634
|
|
|
510
635
|
:param namespace: An identifier for the namespace
|
|
511
636
|
:param service: An identifier for the service name
|
|
@@ -569,13 +694,13 @@ class SecurityClient(NamespacedClient):
|
|
|
569
694
|
human: t.Optional[bool] = None,
|
|
570
695
|
pretty: t.Optional[bool] = None,
|
|
571
696
|
refresh: t.Optional[
|
|
572
|
-
t.Union[
|
|
697
|
+
t.Union[bool, str, t.Literal["false", "true", "wait_for"]]
|
|
573
698
|
] = None,
|
|
574
699
|
) -> ObjectApiResponse[t.Any]:
|
|
575
700
|
"""
|
|
576
701
|
Removes application privileges.
|
|
577
702
|
|
|
578
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
703
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-delete-privilege.html>`_
|
|
579
704
|
|
|
580
705
|
:param application: Application name
|
|
581
706
|
:param name: Privilege name
|
|
@@ -625,13 +750,13 @@ class SecurityClient(NamespacedClient):
|
|
|
625
750
|
human: t.Optional[bool] = None,
|
|
626
751
|
pretty: t.Optional[bool] = None,
|
|
627
752
|
refresh: t.Optional[
|
|
628
|
-
t.Union[
|
|
753
|
+
t.Union[bool, str, t.Literal["false", "true", "wait_for"]]
|
|
629
754
|
] = None,
|
|
630
755
|
) -> ObjectApiResponse[t.Any]:
|
|
631
756
|
"""
|
|
632
757
|
Removes roles in the native realm.
|
|
633
758
|
|
|
634
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
759
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-delete-role.html>`_
|
|
635
760
|
|
|
636
761
|
:param name: Role name
|
|
637
762
|
:param refresh: If `true` (the default) then refresh the affected shards to make
|
|
@@ -673,13 +798,13 @@ class SecurityClient(NamespacedClient):
|
|
|
673
798
|
human: t.Optional[bool] = None,
|
|
674
799
|
pretty: t.Optional[bool] = None,
|
|
675
800
|
refresh: t.Optional[
|
|
676
|
-
t.Union[
|
|
801
|
+
t.Union[bool, str, t.Literal["false", "true", "wait_for"]]
|
|
677
802
|
] = None,
|
|
678
803
|
) -> ObjectApiResponse[t.Any]:
|
|
679
804
|
"""
|
|
680
805
|
Removes role mappings.
|
|
681
806
|
|
|
682
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
807
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-delete-role-mapping.html>`_
|
|
683
808
|
|
|
684
809
|
:param name: Role-mapping name
|
|
685
810
|
:param refresh: If `true` (the default) then refresh the affected shards to make
|
|
@@ -723,13 +848,13 @@ class SecurityClient(NamespacedClient):
|
|
|
723
848
|
human: t.Optional[bool] = None,
|
|
724
849
|
pretty: t.Optional[bool] = None,
|
|
725
850
|
refresh: t.Optional[
|
|
726
|
-
t.Union[
|
|
851
|
+
t.Union[bool, str, t.Literal["false", "true", "wait_for"]]
|
|
727
852
|
] = None,
|
|
728
853
|
) -> ObjectApiResponse[t.Any]:
|
|
729
854
|
"""
|
|
730
855
|
Deletes a service account token.
|
|
731
856
|
|
|
732
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
857
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-delete-service-token.html>`_
|
|
733
858
|
|
|
734
859
|
:param namespace: An identifier for the namespace
|
|
735
860
|
:param service: An identifier for the service name
|
|
@@ -781,13 +906,13 @@ class SecurityClient(NamespacedClient):
|
|
|
781
906
|
human: t.Optional[bool] = None,
|
|
782
907
|
pretty: t.Optional[bool] = None,
|
|
783
908
|
refresh: t.Optional[
|
|
784
|
-
t.Union[
|
|
909
|
+
t.Union[bool, str, t.Literal["false", "true", "wait_for"]]
|
|
785
910
|
] = None,
|
|
786
911
|
) -> ObjectApiResponse[t.Any]:
|
|
787
912
|
"""
|
|
788
913
|
Deletes users from the native realm.
|
|
789
914
|
|
|
790
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
915
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-delete-user.html>`_
|
|
791
916
|
|
|
792
917
|
:param username: username
|
|
793
918
|
:param refresh: If `true` (the default) then refresh the affected shards to make
|
|
@@ -829,13 +954,13 @@ class SecurityClient(NamespacedClient):
|
|
|
829
954
|
human: t.Optional[bool] = None,
|
|
830
955
|
pretty: t.Optional[bool] = None,
|
|
831
956
|
refresh: t.Optional[
|
|
832
|
-
t.Union[
|
|
957
|
+
t.Union[bool, str, t.Literal["false", "true", "wait_for"]]
|
|
833
958
|
] = None,
|
|
834
959
|
) -> ObjectApiResponse[t.Any]:
|
|
835
960
|
"""
|
|
836
961
|
Disables users in the native realm.
|
|
837
962
|
|
|
838
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
963
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-disable-user.html>`_
|
|
839
964
|
|
|
840
965
|
:param username: The username of the user to disable
|
|
841
966
|
:param refresh: If `true` (the default) then refresh the affected shards to make
|
|
@@ -877,13 +1002,13 @@ class SecurityClient(NamespacedClient):
|
|
|
877
1002
|
human: t.Optional[bool] = None,
|
|
878
1003
|
pretty: t.Optional[bool] = None,
|
|
879
1004
|
refresh: t.Optional[
|
|
880
|
-
t.Union[
|
|
1005
|
+
t.Union[bool, str, t.Literal["false", "true", "wait_for"]]
|
|
881
1006
|
] = None,
|
|
882
1007
|
) -> ObjectApiResponse[t.Any]:
|
|
883
1008
|
"""
|
|
884
1009
|
Disables a user profile so it's not visible in user profile searches.
|
|
885
1010
|
|
|
886
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1011
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-disable-user-profile.html>`_
|
|
887
1012
|
|
|
888
1013
|
:param uid: Unique identifier for the user profile.
|
|
889
1014
|
:param refresh: If 'true', Elasticsearch refreshes the affected shards to make
|
|
@@ -925,13 +1050,13 @@ class SecurityClient(NamespacedClient):
|
|
|
925
1050
|
human: t.Optional[bool] = None,
|
|
926
1051
|
pretty: t.Optional[bool] = None,
|
|
927
1052
|
refresh: t.Optional[
|
|
928
|
-
t.Union[
|
|
1053
|
+
t.Union[bool, str, t.Literal["false", "true", "wait_for"]]
|
|
929
1054
|
] = None,
|
|
930
1055
|
) -> ObjectApiResponse[t.Any]:
|
|
931
1056
|
"""
|
|
932
1057
|
Enables users in the native realm.
|
|
933
1058
|
|
|
934
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1059
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-enable-user.html>`_
|
|
935
1060
|
|
|
936
1061
|
:param username: The username of the user to enable
|
|
937
1062
|
:param refresh: If `true` (the default) then refresh the affected shards to make
|
|
@@ -973,13 +1098,13 @@ class SecurityClient(NamespacedClient):
|
|
|
973
1098
|
human: t.Optional[bool] = None,
|
|
974
1099
|
pretty: t.Optional[bool] = None,
|
|
975
1100
|
refresh: t.Optional[
|
|
976
|
-
t.Union[
|
|
1101
|
+
t.Union[bool, str, t.Literal["false", "true", "wait_for"]]
|
|
977
1102
|
] = None,
|
|
978
1103
|
) -> ObjectApiResponse[t.Any]:
|
|
979
1104
|
"""
|
|
980
1105
|
Enables a user profile so it's visible in user profile searches.
|
|
981
1106
|
|
|
982
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1107
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-enable-user-profile.html>`_
|
|
983
1108
|
|
|
984
1109
|
:param uid: Unique identifier for the user profile.
|
|
985
1110
|
:param refresh: If 'true', Elasticsearch refreshes the affected shards to make
|
|
@@ -1021,10 +1146,10 @@ class SecurityClient(NamespacedClient):
|
|
|
1021
1146
|
pretty: t.Optional[bool] = None,
|
|
1022
1147
|
) -> ObjectApiResponse[t.Any]:
|
|
1023
1148
|
"""
|
|
1024
|
-
|
|
1025
|
-
cluster.
|
|
1149
|
+
Enables a Kibana instance to configure itself for communication with a secured
|
|
1150
|
+
Elasticsearch cluster.
|
|
1026
1151
|
|
|
1027
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1152
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-kibana-enrollment.html>`_
|
|
1028
1153
|
"""
|
|
1029
1154
|
__path_parts: t.Dict[str, str] = {}
|
|
1030
1155
|
__path = "/_security/enroll/kibana"
|
|
@@ -1057,9 +1182,9 @@ class SecurityClient(NamespacedClient):
|
|
|
1057
1182
|
pretty: t.Optional[bool] = None,
|
|
1058
1183
|
) -> ObjectApiResponse[t.Any]:
|
|
1059
1184
|
"""
|
|
1060
|
-
Allows a new node to
|
|
1185
|
+
Allows a new node to join an existing cluster with security features enabled.
|
|
1061
1186
|
|
|
1062
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1187
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-node-enrollment.html>`_
|
|
1063
1188
|
"""
|
|
1064
1189
|
__path_parts: t.Dict[str, str] = {}
|
|
1065
1190
|
__path = "/_security/enroll/node"
|
|
@@ -1100,9 +1225,12 @@ class SecurityClient(NamespacedClient):
|
|
|
1100
1225
|
with_profile_uid: t.Optional[bool] = None,
|
|
1101
1226
|
) -> ObjectApiResponse[t.Any]:
|
|
1102
1227
|
"""
|
|
1103
|
-
Retrieves information for one or more API keys.
|
|
1228
|
+
Retrieves information for one or more API keys. NOTE: If you have only the `manage_own_api_key`
|
|
1229
|
+
privilege, this API returns only the API keys that you own. If you have `read_security`,
|
|
1230
|
+
`manage_api_key` or greater privileges (including `manage_security`), this API
|
|
1231
|
+
returns all API keys regardless of ownership.
|
|
1104
1232
|
|
|
1105
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1233
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-get-api-key.html>`_
|
|
1106
1234
|
|
|
1107
1235
|
:param active_only: A boolean flag that can be used to query API keys that are
|
|
1108
1236
|
currently active. An API key is considered active if it is neither invalidated,
|
|
@@ -1177,7 +1305,7 @@ class SecurityClient(NamespacedClient):
|
|
|
1177
1305
|
Retrieves the list of cluster privileges and index privileges that are available
|
|
1178
1306
|
in this version of Elasticsearch.
|
|
1179
1307
|
|
|
1180
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1308
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-get-builtin-privileges.html>`_
|
|
1181
1309
|
"""
|
|
1182
1310
|
__path_parts: t.Dict[str, str] = {}
|
|
1183
1311
|
__path = "/_security/privilege/_builtin"
|
|
@@ -1214,7 +1342,7 @@ class SecurityClient(NamespacedClient):
|
|
|
1214
1342
|
"""
|
|
1215
1343
|
Retrieves application privileges.
|
|
1216
1344
|
|
|
1217
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1345
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-get-privileges.html>`_
|
|
1218
1346
|
|
|
1219
1347
|
:param application: Application name
|
|
1220
1348
|
:param name: Privilege name
|
|
@@ -1259,9 +1387,11 @@ class SecurityClient(NamespacedClient):
|
|
|
1259
1387
|
pretty: t.Optional[bool] = None,
|
|
1260
1388
|
) -> ObjectApiResponse[t.Any]:
|
|
1261
1389
|
"""
|
|
1262
|
-
|
|
1390
|
+
The role management APIs are generally the preferred way to manage roles, rather
|
|
1391
|
+
than using file-based role management. The get roles API cannot retrieve roles
|
|
1392
|
+
that are defined in roles files.
|
|
1263
1393
|
|
|
1264
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1394
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-get-role.html>`_
|
|
1265
1395
|
|
|
1266
1396
|
:param name: The name of the role. You can specify multiple roles as a comma-separated
|
|
1267
1397
|
list. If you do not specify this parameter, the API returns information about
|
|
@@ -1306,7 +1436,7 @@ class SecurityClient(NamespacedClient):
|
|
|
1306
1436
|
"""
|
|
1307
1437
|
Retrieves role mappings.
|
|
1308
1438
|
|
|
1309
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1439
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-get-role-mapping.html>`_
|
|
1310
1440
|
|
|
1311
1441
|
:param name: The distinct name that identifies the role mapping. The name is
|
|
1312
1442
|
used solely as an identifier to facilitate interaction via the API; it does
|
|
@@ -1352,9 +1482,9 @@ class SecurityClient(NamespacedClient):
|
|
|
1352
1482
|
pretty: t.Optional[bool] = None,
|
|
1353
1483
|
) -> ObjectApiResponse[t.Any]:
|
|
1354
1484
|
"""
|
|
1355
|
-
|
|
1485
|
+
This API returns a list of service accounts that match the provided path parameter(s).
|
|
1356
1486
|
|
|
1357
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1487
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-get-service-accounts.html>`_
|
|
1358
1488
|
|
|
1359
1489
|
:param namespace: Name of the namespace. Omit this parameter to retrieve information
|
|
1360
1490
|
about all service accounts. If you omit this parameter, you must also omit
|
|
@@ -1405,7 +1535,7 @@ class SecurityClient(NamespacedClient):
|
|
|
1405
1535
|
"""
|
|
1406
1536
|
Retrieves information of all service credentials for a service account.
|
|
1407
1537
|
|
|
1408
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1538
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-get-service-credentials.html>`_
|
|
1409
1539
|
|
|
1410
1540
|
:param namespace: Name of the namespace.
|
|
1411
1541
|
:param service: Name of the service name.
|
|
@@ -1455,8 +1585,10 @@ class SecurityClient(NamespacedClient):
|
|
|
1455
1585
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
1456
1586
|
grant_type: t.Optional[
|
|
1457
1587
|
t.Union[
|
|
1458
|
-
"t.Literal['_kerberos', 'client_credentials', 'password', 'refresh_token']",
|
|
1459
1588
|
str,
|
|
1589
|
+
t.Literal[
|
|
1590
|
+
"_kerberos", "client_credentials", "password", "refresh_token"
|
|
1591
|
+
],
|
|
1460
1592
|
]
|
|
1461
1593
|
] = None,
|
|
1462
1594
|
human: t.Optional[bool] = None,
|
|
@@ -1471,7 +1603,7 @@ class SecurityClient(NamespacedClient):
|
|
|
1471
1603
|
"""
|
|
1472
1604
|
Creates a bearer token for access without requiring basic authentication.
|
|
1473
1605
|
|
|
1474
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1606
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-get-token.html>`_
|
|
1475
1607
|
|
|
1476
1608
|
:param grant_type:
|
|
1477
1609
|
:param kerberos_ticket:
|
|
@@ -1530,7 +1662,7 @@ class SecurityClient(NamespacedClient):
|
|
|
1530
1662
|
"""
|
|
1531
1663
|
Retrieves information about users in the native realm and built-in users.
|
|
1532
1664
|
|
|
1533
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1665
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-get-user.html>`_
|
|
1534
1666
|
|
|
1535
1667
|
:param username: An identifier for the user. You can specify multiple usernames
|
|
1536
1668
|
as a comma-separated list. If you omit this parameter, the API retrieves
|
|
@@ -1581,7 +1713,7 @@ class SecurityClient(NamespacedClient):
|
|
|
1581
1713
|
"""
|
|
1582
1714
|
Retrieves security privileges for the logged in user.
|
|
1583
1715
|
|
|
1584
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1716
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-get-user-privileges.html>`_
|
|
1585
1717
|
|
|
1586
1718
|
:param application: The name of the application. Application privileges are always
|
|
1587
1719
|
associated with exactly one application. If you do not specify this parameter,
|
|
@@ -1629,9 +1761,9 @@ class SecurityClient(NamespacedClient):
|
|
|
1629
1761
|
pretty: t.Optional[bool] = None,
|
|
1630
1762
|
) -> ObjectApiResponse[t.Any]:
|
|
1631
1763
|
"""
|
|
1632
|
-
Retrieves user
|
|
1764
|
+
Retrieves a user's profile using the unique profile ID.
|
|
1633
1765
|
|
|
1634
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1766
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-get-user-profile.html>`_
|
|
1635
1767
|
|
|
1636
1768
|
:param uid: A unique identifier for the user profile.
|
|
1637
1769
|
:param data: List of filters for the `data` field of the profile document. To
|
|
@@ -1680,7 +1812,7 @@ class SecurityClient(NamespacedClient):
|
|
|
1680
1812
|
*,
|
|
1681
1813
|
api_key: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
1682
1814
|
grant_type: t.Optional[
|
|
1683
|
-
t.Union[
|
|
1815
|
+
t.Union[str, t.Literal["access_token", "password"]]
|
|
1684
1816
|
] = None,
|
|
1685
1817
|
access_token: t.Optional[str] = None,
|
|
1686
1818
|
error_trace: t.Optional[bool] = None,
|
|
@@ -1693,9 +1825,23 @@ class SecurityClient(NamespacedClient):
|
|
|
1693
1825
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
1694
1826
|
) -> ObjectApiResponse[t.Any]:
|
|
1695
1827
|
"""
|
|
1696
|
-
Creates an API key on behalf of another user.
|
|
1697
|
-
|
|
1698
|
-
|
|
1828
|
+
Creates an API key on behalf of another user. This API is similar to Create API
|
|
1829
|
+
keys, however it creates the API key for a user that is different than the user
|
|
1830
|
+
that runs the API. The caller must have authentication credentials (either an
|
|
1831
|
+
access token, or a username and password) for the user on whose behalf the API
|
|
1832
|
+
key will be created. It is not possible to use this API to create an API key
|
|
1833
|
+
without that user’s credentials. The user, for whom the authentication credentials
|
|
1834
|
+
is provided, can optionally "run as" (impersonate) another user. In this case,
|
|
1835
|
+
the API key will be created on behalf of the impersonated user. This API is intended
|
|
1836
|
+
be used by applications that need to create and manage API keys for end users,
|
|
1837
|
+
but cannot guarantee that those users have permission to create API keys on their
|
|
1838
|
+
own behalf. A successful grant API key API call returns a JSON structure that
|
|
1839
|
+
contains the API key, its unique id, and its name. If applicable, it also returns
|
|
1840
|
+
expiration information for the API key in milliseconds. By default, API keys
|
|
1841
|
+
never expire. You can specify expiration information when you create the API
|
|
1842
|
+
keys.
|
|
1843
|
+
|
|
1844
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-grant-api-key.html>`_
|
|
1699
1845
|
|
|
1700
1846
|
:param api_key: Defines the API key.
|
|
1701
1847
|
:param grant_type: The type of grant. Supported grant types are: `access_token`,
|
|
@@ -1761,8 +1907,68 @@ class SecurityClient(NamespacedClient):
|
|
|
1761
1907
|
cluster: t.Optional[
|
|
1762
1908
|
t.Sequence[
|
|
1763
1909
|
t.Union[
|
|
1764
|
-
"t.Literal['all', 'cancel_task', 'create_snapshot', 'cross_cluster_replication', 'cross_cluster_search', 'delegate_pki', 'grant_api_key', 'manage', 'manage_api_key', 'manage_autoscaling', 'manage_behavioral_analytics', 'manage_ccr', 'manage_data_frame_transforms', 'manage_data_stream_global_retention', 'manage_enrich', 'manage_ilm', 'manage_index_templates', 'manage_inference', 'manage_ingest_pipelines', 'manage_logstash_pipelines', 'manage_ml', 'manage_oidc', 'manage_own_api_key', 'manage_pipeline', 'manage_rollup', 'manage_saml', 'manage_search_application', 'manage_search_query_rules', 'manage_search_synonyms', 'manage_security', 'manage_service_account', 'manage_slm', 'manage_token', 'manage_transform', 'manage_user_profile', 'manage_watcher', 'monitor', 'monitor_data_frame_transforms', 'monitor_data_stream_global_retention', 'monitor_enrich', 'monitor_inference', 'monitor_ml', 'monitor_rollup', 'monitor_snapshot', 'monitor_text_structure', 'monitor_transform', 'monitor_watcher', 'none', 'post_behavioral_analytics_event', 'read_ccr', 'read_connector_secrets', 'read_fleet_secrets', 'read_ilm', 'read_pipeline', 'read_security', 'read_slm', 'transport_client', 'write_connector_secrets', 'write_fleet_secrets']",
|
|
1765
1910
|
str,
|
|
1911
|
+
t.Literal[
|
|
1912
|
+
"all",
|
|
1913
|
+
"cancel_task",
|
|
1914
|
+
"create_snapshot",
|
|
1915
|
+
"cross_cluster_replication",
|
|
1916
|
+
"cross_cluster_search",
|
|
1917
|
+
"delegate_pki",
|
|
1918
|
+
"grant_api_key",
|
|
1919
|
+
"manage",
|
|
1920
|
+
"manage_api_key",
|
|
1921
|
+
"manage_autoscaling",
|
|
1922
|
+
"manage_behavioral_analytics",
|
|
1923
|
+
"manage_ccr",
|
|
1924
|
+
"manage_data_frame_transforms",
|
|
1925
|
+
"manage_data_stream_global_retention",
|
|
1926
|
+
"manage_enrich",
|
|
1927
|
+
"manage_ilm",
|
|
1928
|
+
"manage_index_templates",
|
|
1929
|
+
"manage_inference",
|
|
1930
|
+
"manage_ingest_pipelines",
|
|
1931
|
+
"manage_logstash_pipelines",
|
|
1932
|
+
"manage_ml",
|
|
1933
|
+
"manage_oidc",
|
|
1934
|
+
"manage_own_api_key",
|
|
1935
|
+
"manage_pipeline",
|
|
1936
|
+
"manage_rollup",
|
|
1937
|
+
"manage_saml",
|
|
1938
|
+
"manage_search_application",
|
|
1939
|
+
"manage_search_query_rules",
|
|
1940
|
+
"manage_search_synonyms",
|
|
1941
|
+
"manage_security",
|
|
1942
|
+
"manage_service_account",
|
|
1943
|
+
"manage_slm",
|
|
1944
|
+
"manage_token",
|
|
1945
|
+
"manage_transform",
|
|
1946
|
+
"manage_user_profile",
|
|
1947
|
+
"manage_watcher",
|
|
1948
|
+
"monitor",
|
|
1949
|
+
"monitor_data_frame_transforms",
|
|
1950
|
+
"monitor_data_stream_global_retention",
|
|
1951
|
+
"monitor_enrich",
|
|
1952
|
+
"monitor_inference",
|
|
1953
|
+
"monitor_ml",
|
|
1954
|
+
"monitor_rollup",
|
|
1955
|
+
"monitor_snapshot",
|
|
1956
|
+
"monitor_text_structure",
|
|
1957
|
+
"monitor_transform",
|
|
1958
|
+
"monitor_watcher",
|
|
1959
|
+
"none",
|
|
1960
|
+
"post_behavioral_analytics_event",
|
|
1961
|
+
"read_ccr",
|
|
1962
|
+
"read_connector_secrets",
|
|
1963
|
+
"read_fleet_secrets",
|
|
1964
|
+
"read_ilm",
|
|
1965
|
+
"read_pipeline",
|
|
1966
|
+
"read_security",
|
|
1967
|
+
"read_slm",
|
|
1968
|
+
"transport_client",
|
|
1969
|
+
"write_connector_secrets",
|
|
1970
|
+
"write_fleet_secrets",
|
|
1971
|
+
],
|
|
1766
1972
|
]
|
|
1767
1973
|
]
|
|
1768
1974
|
] = None,
|
|
@@ -1776,7 +1982,7 @@ class SecurityClient(NamespacedClient):
|
|
|
1776
1982
|
"""
|
|
1777
1983
|
Determines whether the specified user has a specified list of privileges.
|
|
1778
1984
|
|
|
1779
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1985
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-has-privileges.html>`_
|
|
1780
1986
|
|
|
1781
1987
|
:param user: Username
|
|
1782
1988
|
:param application:
|
|
@@ -1836,7 +2042,7 @@ class SecurityClient(NamespacedClient):
|
|
|
1836
2042
|
Determines whether the users associated with the specified profile IDs have all
|
|
1837
2043
|
the requested privileges.
|
|
1838
2044
|
|
|
1839
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2045
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-has-privileges-user-profile.html>`_
|
|
1840
2046
|
|
|
1841
2047
|
:param privileges:
|
|
1842
2048
|
:param uids: A list of profile IDs. The privileges are checked for associated
|
|
@@ -1893,9 +2099,15 @@ class SecurityClient(NamespacedClient):
|
|
|
1893
2099
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
1894
2100
|
) -> ObjectApiResponse[t.Any]:
|
|
1895
2101
|
"""
|
|
1896
|
-
Invalidates one or more API keys.
|
|
2102
|
+
Invalidates one or more API keys. The `manage_api_key` privilege allows deleting
|
|
2103
|
+
any API keys. The `manage_own_api_key` only allows deleting API keys that are
|
|
2104
|
+
owned by the user. In addition, with the `manage_own_api_key` privilege, an invalidation
|
|
2105
|
+
request must be issued in one of the three formats: - Set the parameter `owner=true`.
|
|
2106
|
+
- Or, set both `username` and `realm_name` to match the user’s identity. - Or,
|
|
2107
|
+
if the request is issued by an API key, i.e. an API key invalidates itself, specify
|
|
2108
|
+
its ID in the `ids` field.
|
|
1897
2109
|
|
|
1898
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2110
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-invalidate-api-key.html>`_
|
|
1899
2111
|
|
|
1900
2112
|
:param id:
|
|
1901
2113
|
:param ids: A list of API key ids. This parameter cannot be used with any of
|
|
@@ -1966,7 +2178,7 @@ class SecurityClient(NamespacedClient):
|
|
|
1966
2178
|
"""
|
|
1967
2179
|
Invalidates one or more access tokens or refresh tokens.
|
|
1968
2180
|
|
|
1969
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2181
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-invalidate-token.html>`_
|
|
1970
2182
|
|
|
1971
2183
|
:param realm_name:
|
|
1972
2184
|
:param refresh_token:
|
|
@@ -2020,13 +2232,13 @@ class SecurityClient(NamespacedClient):
|
|
|
2020
2232
|
human: t.Optional[bool] = None,
|
|
2021
2233
|
pretty: t.Optional[bool] = None,
|
|
2022
2234
|
refresh: t.Optional[
|
|
2023
|
-
t.Union[
|
|
2235
|
+
t.Union[bool, str, t.Literal["false", "true", "wait_for"]]
|
|
2024
2236
|
] = None,
|
|
2025
2237
|
) -> ObjectApiResponse[t.Any]:
|
|
2026
2238
|
"""
|
|
2027
2239
|
Adds or updates application privileges.
|
|
2028
2240
|
|
|
2029
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2241
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-put-privileges.html>`_
|
|
2030
2242
|
|
|
2031
2243
|
:param privileges:
|
|
2032
2244
|
:param refresh: If `true` (the default) then refresh the affected shards to make
|
|
@@ -2068,6 +2280,7 @@ class SecurityClient(NamespacedClient):
|
|
|
2068
2280
|
body_fields=(
|
|
2069
2281
|
"applications",
|
|
2070
2282
|
"cluster",
|
|
2283
|
+
"description",
|
|
2071
2284
|
"global_",
|
|
2072
2285
|
"indices",
|
|
2073
2286
|
"metadata",
|
|
@@ -2084,11 +2297,72 @@ class SecurityClient(NamespacedClient):
|
|
|
2084
2297
|
cluster: t.Optional[
|
|
2085
2298
|
t.Sequence[
|
|
2086
2299
|
t.Union[
|
|
2087
|
-
"t.Literal['all', 'cancel_task', 'create_snapshot', 'cross_cluster_replication', 'cross_cluster_search', 'delegate_pki', 'grant_api_key', 'manage', 'manage_api_key', 'manage_autoscaling', 'manage_behavioral_analytics', 'manage_ccr', 'manage_data_frame_transforms', 'manage_data_stream_global_retention', 'manage_enrich', 'manage_ilm', 'manage_index_templates', 'manage_inference', 'manage_ingest_pipelines', 'manage_logstash_pipelines', 'manage_ml', 'manage_oidc', 'manage_own_api_key', 'manage_pipeline', 'manage_rollup', 'manage_saml', 'manage_search_application', 'manage_search_query_rules', 'manage_search_synonyms', 'manage_security', 'manage_service_account', 'manage_slm', 'manage_token', 'manage_transform', 'manage_user_profile', 'manage_watcher', 'monitor', 'monitor_data_frame_transforms', 'monitor_data_stream_global_retention', 'monitor_enrich', 'monitor_inference', 'monitor_ml', 'monitor_rollup', 'monitor_snapshot', 'monitor_text_structure', 'monitor_transform', 'monitor_watcher', 'none', 'post_behavioral_analytics_event', 'read_ccr', 'read_connector_secrets', 'read_fleet_secrets', 'read_ilm', 'read_pipeline', 'read_security', 'read_slm', 'transport_client', 'write_connector_secrets', 'write_fleet_secrets']",
|
|
2088
2300
|
str,
|
|
2301
|
+
t.Literal[
|
|
2302
|
+
"all",
|
|
2303
|
+
"cancel_task",
|
|
2304
|
+
"create_snapshot",
|
|
2305
|
+
"cross_cluster_replication",
|
|
2306
|
+
"cross_cluster_search",
|
|
2307
|
+
"delegate_pki",
|
|
2308
|
+
"grant_api_key",
|
|
2309
|
+
"manage",
|
|
2310
|
+
"manage_api_key",
|
|
2311
|
+
"manage_autoscaling",
|
|
2312
|
+
"manage_behavioral_analytics",
|
|
2313
|
+
"manage_ccr",
|
|
2314
|
+
"manage_data_frame_transforms",
|
|
2315
|
+
"manage_data_stream_global_retention",
|
|
2316
|
+
"manage_enrich",
|
|
2317
|
+
"manage_ilm",
|
|
2318
|
+
"manage_index_templates",
|
|
2319
|
+
"manage_inference",
|
|
2320
|
+
"manage_ingest_pipelines",
|
|
2321
|
+
"manage_logstash_pipelines",
|
|
2322
|
+
"manage_ml",
|
|
2323
|
+
"manage_oidc",
|
|
2324
|
+
"manage_own_api_key",
|
|
2325
|
+
"manage_pipeline",
|
|
2326
|
+
"manage_rollup",
|
|
2327
|
+
"manage_saml",
|
|
2328
|
+
"manage_search_application",
|
|
2329
|
+
"manage_search_query_rules",
|
|
2330
|
+
"manage_search_synonyms",
|
|
2331
|
+
"manage_security",
|
|
2332
|
+
"manage_service_account",
|
|
2333
|
+
"manage_slm",
|
|
2334
|
+
"manage_token",
|
|
2335
|
+
"manage_transform",
|
|
2336
|
+
"manage_user_profile",
|
|
2337
|
+
"manage_watcher",
|
|
2338
|
+
"monitor",
|
|
2339
|
+
"monitor_data_frame_transforms",
|
|
2340
|
+
"monitor_data_stream_global_retention",
|
|
2341
|
+
"monitor_enrich",
|
|
2342
|
+
"monitor_inference",
|
|
2343
|
+
"monitor_ml",
|
|
2344
|
+
"monitor_rollup",
|
|
2345
|
+
"monitor_snapshot",
|
|
2346
|
+
"monitor_text_structure",
|
|
2347
|
+
"monitor_transform",
|
|
2348
|
+
"monitor_watcher",
|
|
2349
|
+
"none",
|
|
2350
|
+
"post_behavioral_analytics_event",
|
|
2351
|
+
"read_ccr",
|
|
2352
|
+
"read_connector_secrets",
|
|
2353
|
+
"read_fleet_secrets",
|
|
2354
|
+
"read_ilm",
|
|
2355
|
+
"read_pipeline",
|
|
2356
|
+
"read_security",
|
|
2357
|
+
"read_slm",
|
|
2358
|
+
"transport_client",
|
|
2359
|
+
"write_connector_secrets",
|
|
2360
|
+
"write_fleet_secrets",
|
|
2361
|
+
],
|
|
2089
2362
|
]
|
|
2090
2363
|
]
|
|
2091
2364
|
] = None,
|
|
2365
|
+
description: t.Optional[str] = None,
|
|
2092
2366
|
error_trace: t.Optional[bool] = None,
|
|
2093
2367
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
2094
2368
|
global_: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
@@ -2097,21 +2371,24 @@ class SecurityClient(NamespacedClient):
|
|
|
2097
2371
|
metadata: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
2098
2372
|
pretty: t.Optional[bool] = None,
|
|
2099
2373
|
refresh: t.Optional[
|
|
2100
|
-
t.Union[
|
|
2374
|
+
t.Union[bool, str, t.Literal["false", "true", "wait_for"]]
|
|
2101
2375
|
] = None,
|
|
2102
2376
|
run_as: t.Optional[t.Sequence[str]] = None,
|
|
2103
2377
|
transient_metadata: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
2104
2378
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
2105
2379
|
) -> ObjectApiResponse[t.Any]:
|
|
2106
2380
|
"""
|
|
2107
|
-
|
|
2381
|
+
The role management APIs are generally the preferred way to manage roles, rather
|
|
2382
|
+
than using file-based role management. The create or update roles API cannot
|
|
2383
|
+
update roles that are defined in roles files.
|
|
2108
2384
|
|
|
2109
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2385
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-put-role.html>`_
|
|
2110
2386
|
|
|
2111
2387
|
:param name: The name of the role.
|
|
2112
2388
|
:param applications: A list of application privilege entries.
|
|
2113
2389
|
:param cluster: A list of cluster privileges. These privileges define the cluster-level
|
|
2114
2390
|
actions for users with this role.
|
|
2391
|
+
:param description: Optional description of the role descriptor
|
|
2115
2392
|
:param global_: An object defining global privileges. A global privilege is a
|
|
2116
2393
|
form of cluster privilege that is request-aware. Support for global privileges
|
|
2117
2394
|
is currently limited to the management of application privileges.
|
|
@@ -2122,6 +2399,9 @@ class SecurityClient(NamespacedClient):
|
|
|
2122
2399
|
this operation visible to search, if `wait_for` then wait for a refresh to
|
|
2123
2400
|
make this operation visible to search, if `false` then do nothing with refreshes.
|
|
2124
2401
|
:param run_as: A list of users that the owners of this role can impersonate.
|
|
2402
|
+
*Note*: in Serverless, the run-as feature is disabled. For API compatibility,
|
|
2403
|
+
you can still specify an empty `run_as` field, but a non-empty list will
|
|
2404
|
+
be rejected.
|
|
2125
2405
|
:param transient_metadata: Indicates roles that might be incompatible with the
|
|
2126
2406
|
current cluster license, specifically roles with document and field level
|
|
2127
2407
|
security. When the cluster license doesn’t allow certain features for a given
|
|
@@ -2150,6 +2430,8 @@ class SecurityClient(NamespacedClient):
|
|
|
2150
2430
|
__body["applications"] = applications
|
|
2151
2431
|
if cluster is not None:
|
|
2152
2432
|
__body["cluster"] = cluster
|
|
2433
|
+
if description is not None:
|
|
2434
|
+
__body["description"] = description
|
|
2153
2435
|
if global_ is not None:
|
|
2154
2436
|
__body["global"] = global_
|
|
2155
2437
|
if indices is not None:
|
|
@@ -2192,7 +2474,7 @@ class SecurityClient(NamespacedClient):
|
|
|
2192
2474
|
metadata: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
2193
2475
|
pretty: t.Optional[bool] = None,
|
|
2194
2476
|
refresh: t.Optional[
|
|
2195
|
-
t.Union[
|
|
2477
|
+
t.Union[bool, str, t.Literal["false", "true", "wait_for"]]
|
|
2196
2478
|
] = None,
|
|
2197
2479
|
role_templates: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None,
|
|
2198
2480
|
roles: t.Optional[t.Sequence[str]] = None,
|
|
@@ -2203,7 +2485,7 @@ class SecurityClient(NamespacedClient):
|
|
|
2203
2485
|
"""
|
|
2204
2486
|
Creates and updates role mappings.
|
|
2205
2487
|
|
|
2206
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2488
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-put-role-mapping.html>`_
|
|
2207
2489
|
|
|
2208
2490
|
:param name: Role-mapping name
|
|
2209
2491
|
:param enabled:
|
|
@@ -2282,7 +2564,7 @@ class SecurityClient(NamespacedClient):
|
|
|
2282
2564
|
password_hash: t.Optional[str] = None,
|
|
2283
2565
|
pretty: t.Optional[bool] = None,
|
|
2284
2566
|
refresh: t.Optional[
|
|
2285
|
-
t.Union[
|
|
2567
|
+
t.Union[bool, str, t.Literal["false", "true", "wait_for"]]
|
|
2286
2568
|
] = None,
|
|
2287
2569
|
roles: t.Optional[t.Sequence[str]] = None,
|
|
2288
2570
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
@@ -2291,7 +2573,7 @@ class SecurityClient(NamespacedClient):
|
|
|
2291
2573
|
Adds and updates users in the native realm. These users are commonly referred
|
|
2292
2574
|
to as native users.
|
|
2293
2575
|
|
|
2294
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2576
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-put-user.html>`_
|
|
2295
2577
|
|
|
2296
2578
|
:param username: The username of the User
|
|
2297
2579
|
:param email:
|
|
@@ -2386,9 +2668,10 @@ class SecurityClient(NamespacedClient):
|
|
|
2386
2668
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
2387
2669
|
) -> ObjectApiResponse[t.Any]:
|
|
2388
2670
|
"""
|
|
2389
|
-
Retrieves information for API keys
|
|
2671
|
+
Retrieves information for API keys in a paginated manner. You can optionally
|
|
2672
|
+
filter the results with a query.
|
|
2390
2673
|
|
|
2391
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2674
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-query-api-key.html>`_
|
|
2392
2675
|
|
|
2393
2676
|
:param aggregations: Any aggregations to run over the corpus of returned API
|
|
2394
2677
|
keys. Aggregations and queries work together. Aggregations are computed only
|
|
@@ -2486,6 +2769,181 @@ class SecurityClient(NamespacedClient):
|
|
|
2486
2769
|
path_parts=__path_parts,
|
|
2487
2770
|
)
|
|
2488
2771
|
|
|
2772
|
+
@_rewrite_parameters(
|
|
2773
|
+
body_fields=("from_", "query", "search_after", "size", "sort"),
|
|
2774
|
+
parameter_aliases={"from": "from_"},
|
|
2775
|
+
)
|
|
2776
|
+
def query_role(
|
|
2777
|
+
self,
|
|
2778
|
+
*,
|
|
2779
|
+
error_trace: t.Optional[bool] = None,
|
|
2780
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
2781
|
+
from_: t.Optional[int] = None,
|
|
2782
|
+
human: t.Optional[bool] = None,
|
|
2783
|
+
pretty: t.Optional[bool] = None,
|
|
2784
|
+
query: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
2785
|
+
search_after: t.Optional[
|
|
2786
|
+
t.Sequence[t.Union[None, bool, float, int, str, t.Any]]
|
|
2787
|
+
] = None,
|
|
2788
|
+
size: t.Optional[int] = None,
|
|
2789
|
+
sort: t.Optional[
|
|
2790
|
+
t.Union[
|
|
2791
|
+
t.Sequence[t.Union[str, t.Mapping[str, t.Any]]],
|
|
2792
|
+
t.Union[str, t.Mapping[str, t.Any]],
|
|
2793
|
+
]
|
|
2794
|
+
] = None,
|
|
2795
|
+
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
2796
|
+
) -> ObjectApiResponse[t.Any]:
|
|
2797
|
+
"""
|
|
2798
|
+
Retrieves roles in a paginated manner. You can optionally filter the results
|
|
2799
|
+
with a query.
|
|
2800
|
+
|
|
2801
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-query-role.html>`_
|
|
2802
|
+
|
|
2803
|
+
:param from_: Starting document offset. By default, you cannot page through more
|
|
2804
|
+
than 10,000 hits using the from and size parameters. To page through more
|
|
2805
|
+
hits, use the `search_after` parameter.
|
|
2806
|
+
:param query: A query to filter which roles to return. If the query parameter
|
|
2807
|
+
is missing, it is equivalent to a `match_all` query. The query supports a
|
|
2808
|
+
subset of query types, including `match_all`, `bool`, `term`, `terms`, `match`,
|
|
2809
|
+
`ids`, `prefix`, `wildcard`, `exists`, `range`, and `simple_query_string`.
|
|
2810
|
+
You can query the following information associated with roles: `name`, `description`,
|
|
2811
|
+
`metadata`, `applications.application`, `applications.privileges`, `applications.resources`.
|
|
2812
|
+
:param search_after: Search after definition
|
|
2813
|
+
:param size: The number of hits to return. By default, you cannot page through
|
|
2814
|
+
more than 10,000 hits using the `from` and `size` parameters. To page through
|
|
2815
|
+
more hits, use the `search_after` parameter.
|
|
2816
|
+
:param sort: All public fields of a role are eligible for sorting. In addition,
|
|
2817
|
+
sort can also be applied to the `_doc` field to sort by index order.
|
|
2818
|
+
"""
|
|
2819
|
+
__path_parts: t.Dict[str, str] = {}
|
|
2820
|
+
__path = "/_security/_query/role"
|
|
2821
|
+
__query: t.Dict[str, t.Any] = {}
|
|
2822
|
+
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
2823
|
+
if error_trace is not None:
|
|
2824
|
+
__query["error_trace"] = error_trace
|
|
2825
|
+
if filter_path is not None:
|
|
2826
|
+
__query["filter_path"] = filter_path
|
|
2827
|
+
if human is not None:
|
|
2828
|
+
__query["human"] = human
|
|
2829
|
+
if pretty is not None:
|
|
2830
|
+
__query["pretty"] = pretty
|
|
2831
|
+
if not __body:
|
|
2832
|
+
if from_ is not None:
|
|
2833
|
+
__body["from"] = from_
|
|
2834
|
+
if query is not None:
|
|
2835
|
+
__body["query"] = query
|
|
2836
|
+
if search_after is not None:
|
|
2837
|
+
__body["search_after"] = search_after
|
|
2838
|
+
if size is not None:
|
|
2839
|
+
__body["size"] = size
|
|
2840
|
+
if sort is not None:
|
|
2841
|
+
__body["sort"] = sort
|
|
2842
|
+
if not __body:
|
|
2843
|
+
__body = None # type: ignore[assignment]
|
|
2844
|
+
__headers = {"accept": "application/json"}
|
|
2845
|
+
if __body is not None:
|
|
2846
|
+
__headers["content-type"] = "application/json"
|
|
2847
|
+
return self.perform_request( # type: ignore[return-value]
|
|
2848
|
+
"POST",
|
|
2849
|
+
__path,
|
|
2850
|
+
params=__query,
|
|
2851
|
+
headers=__headers,
|
|
2852
|
+
body=__body,
|
|
2853
|
+
endpoint_id="security.query_role",
|
|
2854
|
+
path_parts=__path_parts,
|
|
2855
|
+
)
|
|
2856
|
+
|
|
2857
|
+
@_rewrite_parameters(
|
|
2858
|
+
body_fields=("from_", "query", "search_after", "size", "sort"),
|
|
2859
|
+
parameter_aliases={"from": "from_"},
|
|
2860
|
+
)
|
|
2861
|
+
def query_user(
|
|
2862
|
+
self,
|
|
2863
|
+
*,
|
|
2864
|
+
error_trace: t.Optional[bool] = None,
|
|
2865
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
2866
|
+
from_: t.Optional[int] = None,
|
|
2867
|
+
human: t.Optional[bool] = None,
|
|
2868
|
+
pretty: t.Optional[bool] = None,
|
|
2869
|
+
query: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
2870
|
+
search_after: t.Optional[
|
|
2871
|
+
t.Sequence[t.Union[None, bool, float, int, str, t.Any]]
|
|
2872
|
+
] = None,
|
|
2873
|
+
size: t.Optional[int] = None,
|
|
2874
|
+
sort: t.Optional[
|
|
2875
|
+
t.Union[
|
|
2876
|
+
t.Sequence[t.Union[str, t.Mapping[str, t.Any]]],
|
|
2877
|
+
t.Union[str, t.Mapping[str, t.Any]],
|
|
2878
|
+
]
|
|
2879
|
+
] = None,
|
|
2880
|
+
with_profile_uid: t.Optional[bool] = None,
|
|
2881
|
+
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
2882
|
+
) -> ObjectApiResponse[t.Any]:
|
|
2883
|
+
"""
|
|
2884
|
+
Retrieves information for Users in a paginated manner. You can optionally filter
|
|
2885
|
+
the results with a query.
|
|
2886
|
+
|
|
2887
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-query-user.html>`_
|
|
2888
|
+
|
|
2889
|
+
:param from_: Starting document offset. By default, you cannot page through more
|
|
2890
|
+
than 10,000 hits using the from and size parameters. To page through more
|
|
2891
|
+
hits, use the `search_after` parameter.
|
|
2892
|
+
:param query: A query to filter which users to return. If the query parameter
|
|
2893
|
+
is missing, it is equivalent to a `match_all` query. The query supports a
|
|
2894
|
+
subset of query types, including `match_all`, `bool`, `term`, `terms`, `match`,
|
|
2895
|
+
`ids`, `prefix`, `wildcard`, `exists`, `range`, and `simple_query_string`.
|
|
2896
|
+
You can query the following information associated with user: `username`,
|
|
2897
|
+
`roles`, `enabled`
|
|
2898
|
+
:param search_after: Search after definition
|
|
2899
|
+
:param size: The number of hits to return. By default, you cannot page through
|
|
2900
|
+
more than 10,000 hits using the `from` and `size` parameters. To page through
|
|
2901
|
+
more hits, use the `search_after` parameter.
|
|
2902
|
+
:param sort: Fields eligible for sorting are: username, roles, enabled In addition,
|
|
2903
|
+
sort can also be applied to the `_doc` field to sort by index order.
|
|
2904
|
+
:param with_profile_uid: If true will return the User Profile ID for the users
|
|
2905
|
+
in the query result, if any.
|
|
2906
|
+
"""
|
|
2907
|
+
__path_parts: t.Dict[str, str] = {}
|
|
2908
|
+
__path = "/_security/_query/user"
|
|
2909
|
+
__query: t.Dict[str, t.Any] = {}
|
|
2910
|
+
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
2911
|
+
if error_trace is not None:
|
|
2912
|
+
__query["error_trace"] = error_trace
|
|
2913
|
+
if filter_path is not None:
|
|
2914
|
+
__query["filter_path"] = filter_path
|
|
2915
|
+
if human is not None:
|
|
2916
|
+
__query["human"] = human
|
|
2917
|
+
if pretty is not None:
|
|
2918
|
+
__query["pretty"] = pretty
|
|
2919
|
+
if with_profile_uid is not None:
|
|
2920
|
+
__query["with_profile_uid"] = with_profile_uid
|
|
2921
|
+
if not __body:
|
|
2922
|
+
if from_ is not None:
|
|
2923
|
+
__body["from"] = from_
|
|
2924
|
+
if query is not None:
|
|
2925
|
+
__body["query"] = query
|
|
2926
|
+
if search_after is not None:
|
|
2927
|
+
__body["search_after"] = search_after
|
|
2928
|
+
if size is not None:
|
|
2929
|
+
__body["size"] = size
|
|
2930
|
+
if sort is not None:
|
|
2931
|
+
__body["sort"] = sort
|
|
2932
|
+
if not __body:
|
|
2933
|
+
__body = None # type: ignore[assignment]
|
|
2934
|
+
__headers = {"accept": "application/json"}
|
|
2935
|
+
if __body is not None:
|
|
2936
|
+
__headers["content-type"] = "application/json"
|
|
2937
|
+
return self.perform_request( # type: ignore[return-value]
|
|
2938
|
+
"POST",
|
|
2939
|
+
__path,
|
|
2940
|
+
params=__query,
|
|
2941
|
+
headers=__headers,
|
|
2942
|
+
body=__body,
|
|
2943
|
+
endpoint_id="security.query_user",
|
|
2944
|
+
path_parts=__path_parts,
|
|
2945
|
+
)
|
|
2946
|
+
|
|
2489
2947
|
@_rewrite_parameters(
|
|
2490
2948
|
body_fields=("content", "ids", "realm"),
|
|
2491
2949
|
)
|
|
@@ -2502,10 +2960,9 @@ class SecurityClient(NamespacedClient):
|
|
|
2502
2960
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
2503
2961
|
) -> ObjectApiResponse[t.Any]:
|
|
2504
2962
|
"""
|
|
2505
|
-
|
|
2506
|
-
token pair
|
|
2963
|
+
Submits a SAML Response message to Elasticsearch for consumption.
|
|
2507
2964
|
|
|
2508
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2965
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-saml-authenticate.html>`_
|
|
2509
2966
|
|
|
2510
2967
|
:param content: The SAML response as it was sent by the user’s browser, usually
|
|
2511
2968
|
a Base64 encoded XML document.
|
|
@@ -2565,9 +3022,9 @@ class SecurityClient(NamespacedClient):
|
|
|
2565
3022
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
2566
3023
|
) -> ObjectApiResponse[t.Any]:
|
|
2567
3024
|
"""
|
|
2568
|
-
Verifies the logout response sent from the SAML IdP
|
|
3025
|
+
Verifies the logout response sent from the SAML IdP.
|
|
2569
3026
|
|
|
2570
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3027
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-saml-complete-logout.html>`_
|
|
2571
3028
|
|
|
2572
3029
|
:param ids: A json array with all the valid SAML Request Ids that the caller
|
|
2573
3030
|
of the API has for the current user.
|
|
@@ -2631,9 +3088,9 @@ class SecurityClient(NamespacedClient):
|
|
|
2631
3088
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
2632
3089
|
) -> ObjectApiResponse[t.Any]:
|
|
2633
3090
|
"""
|
|
2634
|
-
|
|
3091
|
+
Submits a SAML LogoutRequest message to Elasticsearch for consumption.
|
|
2635
3092
|
|
|
2636
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3093
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-saml-invalidate.html>`_
|
|
2637
3094
|
|
|
2638
3095
|
:param query_string: The query part of the URL that the user was redirected to
|
|
2639
3096
|
by the SAML IdP to initiate the Single Logout. This query should include
|
|
@@ -2698,10 +3155,9 @@ class SecurityClient(NamespacedClient):
|
|
|
2698
3155
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
2699
3156
|
) -> ObjectApiResponse[t.Any]:
|
|
2700
3157
|
"""
|
|
2701
|
-
|
|
2702
|
-
Authenticate API
|
|
3158
|
+
Submits a request to invalidate an access token and refresh token.
|
|
2703
3159
|
|
|
2704
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3160
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-saml-logout.html>`_
|
|
2705
3161
|
|
|
2706
3162
|
:param token: The access token that was returned as a response to calling the
|
|
2707
3163
|
SAML authenticate API. Alternatively, the most recent token that was received
|
|
@@ -2756,9 +3212,10 @@ class SecurityClient(NamespacedClient):
|
|
|
2756
3212
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
2757
3213
|
) -> ObjectApiResponse[t.Any]:
|
|
2758
3214
|
"""
|
|
2759
|
-
Creates a SAML authentication request
|
|
3215
|
+
Creates a SAML authentication request (<AuthnRequest>) as a URL string, based
|
|
3216
|
+
on the configuration of the respective SAML realm in Elasticsearch.
|
|
2760
3217
|
|
|
2761
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3218
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-saml-prepare-authentication.html>`_
|
|
2762
3219
|
|
|
2763
3220
|
:param acs: The Assertion Consumer Service URL that matches the one of the SAML
|
|
2764
3221
|
realms in Elasticsearch. The realm is used to generate the authentication
|
|
@@ -2811,9 +3268,9 @@ class SecurityClient(NamespacedClient):
|
|
|
2811
3268
|
pretty: t.Optional[bool] = None,
|
|
2812
3269
|
) -> ObjectApiResponse[t.Any]:
|
|
2813
3270
|
"""
|
|
2814
|
-
|
|
3271
|
+
Generate SAML metadata for a SAML 2.0 Service Provider.
|
|
2815
3272
|
|
|
2816
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3273
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-saml-sp-metadata.html>`_
|
|
2817
3274
|
|
|
2818
3275
|
:param realm_name: The name of the SAML realm in Elasticsearch.
|
|
2819
3276
|
"""
|
|
@@ -2859,7 +3316,7 @@ class SecurityClient(NamespacedClient):
|
|
|
2859
3316
|
"""
|
|
2860
3317
|
Get suggestions for user profiles that match specified search criteria.
|
|
2861
3318
|
|
|
2862
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3319
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-suggest-user-profile.html>`_
|
|
2863
3320
|
|
|
2864
3321
|
:param data: List of filters for the `data` field of the profile document. To
|
|
2865
3322
|
return all content use `data=*`. To return a subset of content use `data=<key>`
|
|
@@ -2917,7 +3374,7 @@ class SecurityClient(NamespacedClient):
|
|
|
2917
3374
|
*,
|
|
2918
3375
|
id: str,
|
|
2919
3376
|
error_trace: t.Optional[bool] = None,
|
|
2920
|
-
expiration: t.Optional[t.Union[
|
|
3377
|
+
expiration: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
2921
3378
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
2922
3379
|
human: t.Optional[bool] = None,
|
|
2923
3380
|
metadata: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
@@ -2926,9 +3383,24 @@ class SecurityClient(NamespacedClient):
|
|
|
2926
3383
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
2927
3384
|
) -> ObjectApiResponse[t.Any]:
|
|
2928
3385
|
"""
|
|
2929
|
-
Updates attributes of an existing API key.
|
|
2930
|
-
|
|
2931
|
-
|
|
3386
|
+
Updates attributes of an existing API key. Users can only update API keys that
|
|
3387
|
+
they created or that were granted to them. Use this API to update API keys created
|
|
3388
|
+
by the create API Key or grant API Key APIs. If you need to apply the same update
|
|
3389
|
+
to many API keys, you can use bulk update API Keys to reduce overhead. It’s not
|
|
3390
|
+
possible to update expired API keys, or API keys that have been invalidated by
|
|
3391
|
+
invalidate API Key. This API supports updates to an API key’s access scope and
|
|
3392
|
+
metadata. The access scope of an API key is derived from the `role_descriptors`
|
|
3393
|
+
you specify in the request, and a snapshot of the owner user’s permissions at
|
|
3394
|
+
the time of the request. The snapshot of the owner’s permissions is updated automatically
|
|
3395
|
+
on every call. If you don’t specify `role_descriptors` in the request, a call
|
|
3396
|
+
to this API might still change the API key’s access scope. This change can occur
|
|
3397
|
+
if the owner user’s permissions have changed since the API key was created or
|
|
3398
|
+
last modified. To update another user’s API key, use the `run_as` feature to
|
|
3399
|
+
submit a request on behalf of another user. IMPORTANT: It’s not possible to use
|
|
3400
|
+
an API key as the authentication credential for this API. To update an API key,
|
|
3401
|
+
the owner user’s credentials are required.
|
|
3402
|
+
|
|
3403
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-update-api-key.html>`_
|
|
2932
3404
|
|
|
2933
3405
|
:param id: The ID of the API key to update.
|
|
2934
3406
|
:param expiration: Expiration time for the API key.
|
|
@@ -2996,14 +3468,15 @@ class SecurityClient(NamespacedClient):
|
|
|
2996
3468
|
labels: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
2997
3469
|
pretty: t.Optional[bool] = None,
|
|
2998
3470
|
refresh: t.Optional[
|
|
2999
|
-
t.Union[
|
|
3471
|
+
t.Union[bool, str, t.Literal["false", "true", "wait_for"]]
|
|
3000
3472
|
] = None,
|
|
3001
3473
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
3002
3474
|
) -> ObjectApiResponse[t.Any]:
|
|
3003
3475
|
"""
|
|
3004
|
-
|
|
3476
|
+
Updates specific data for the user profile that's associated with the specified
|
|
3477
|
+
unique ID.
|
|
3005
3478
|
|
|
3006
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3479
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/security-api-update-user-profile-data.html>`_
|
|
3007
3480
|
|
|
3008
3481
|
:param uid: A unique identifier for the user profile.
|
|
3009
3482
|
:param data: Non-searchable data that you want to associate with the user profile.
|