elasticsearch 8.12.1__py3-none-any.whl → 8.13.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.
- elasticsearch/__init__.py +7 -0
- elasticsearch/_async/client/__init__.py +477 -128
- elasticsearch/_async/client/_base.py +41 -1
- elasticsearch/_async/client/async_search.py +40 -12
- elasticsearch/_async/client/autoscaling.py +37 -11
- elasticsearch/_async/client/cat.py +260 -69
- elasticsearch/_async/client/ccr.py +123 -38
- elasticsearch/_async/client/cluster.py +153 -42
- elasticsearch/_async/client/dangling_indices.py +27 -8
- elasticsearch/_async/client/enrich.py +48 -14
- elasticsearch/_async/client/eql.py +38 -12
- elasticsearch/_async/client/esql.py +10 -2
- elasticsearch/_async/client/features.py +17 -4
- elasticsearch/_async/client/fleet.py +30 -7
- elasticsearch/_async/client/graph.py +11 -3
- elasticsearch/_async/client/ilm.py +101 -29
- elasticsearch/_async/client/indices.py +688 -181
- elasticsearch/_async/client/inference.py +111 -44
- elasticsearch/_async/client/ingest.py +59 -16
- elasticsearch/_async/client/license.py +58 -14
- elasticsearch/_async/client/logstash.py +31 -9
- elasticsearch/_async/client/migration.py +28 -7
- elasticsearch/_async/client/ml.py +781 -214
- elasticsearch/_async/client/monitoring.py +10 -2
- elasticsearch/_async/client/nodes.py +103 -29
- elasticsearch/_async/client/query_ruleset.py +37 -11
- elasticsearch/_async/client/rollup.py +79 -24
- elasticsearch/_async/client/search_application.py +76 -23
- elasticsearch/_async/client/searchable_snapshots.py +49 -12
- elasticsearch/_async/client/security.py +544 -143
- elasticsearch/_async/client/shutdown.py +28 -6
- elasticsearch/_async/client/slm.py +80 -22
- elasticsearch/_async/client/snapshot.py +140 -54
- elasticsearch/_async/client/sql.py +55 -15
- elasticsearch/_async/client/ssl.py +9 -2
- elasticsearch/_async/client/synonyms.py +75 -21
- elasticsearch/_async/client/tasks.py +29 -8
- elasticsearch/_async/client/text_structure.py +74 -2
- elasticsearch/_async/client/transform.py +106 -32
- elasticsearch/_async/client/watcher.py +110 -31
- elasticsearch/_async/client/xpack.py +16 -4
- elasticsearch/_async/helpers.py +1 -1
- elasticsearch/_otel.py +92 -0
- elasticsearch/_sync/client/__init__.py +477 -128
- elasticsearch/_sync/client/_base.py +41 -1
- elasticsearch/_sync/client/async_search.py +40 -12
- elasticsearch/_sync/client/autoscaling.py +37 -11
- elasticsearch/_sync/client/cat.py +260 -69
- elasticsearch/_sync/client/ccr.py +123 -38
- elasticsearch/_sync/client/cluster.py +153 -42
- elasticsearch/_sync/client/dangling_indices.py +27 -8
- elasticsearch/_sync/client/enrich.py +48 -14
- elasticsearch/_sync/client/eql.py +38 -12
- elasticsearch/_sync/client/esql.py +10 -2
- elasticsearch/_sync/client/features.py +17 -4
- elasticsearch/_sync/client/fleet.py +30 -7
- elasticsearch/_sync/client/graph.py +11 -3
- elasticsearch/_sync/client/ilm.py +101 -29
- elasticsearch/_sync/client/indices.py +688 -181
- elasticsearch/_sync/client/inference.py +111 -44
- elasticsearch/_sync/client/ingest.py +59 -16
- elasticsearch/_sync/client/license.py +58 -14
- elasticsearch/_sync/client/logstash.py +31 -9
- elasticsearch/_sync/client/migration.py +28 -7
- elasticsearch/_sync/client/ml.py +781 -214
- elasticsearch/_sync/client/monitoring.py +10 -2
- elasticsearch/_sync/client/nodes.py +103 -29
- elasticsearch/_sync/client/query_ruleset.py +37 -11
- elasticsearch/_sync/client/rollup.py +79 -24
- elasticsearch/_sync/client/search_application.py +76 -23
- elasticsearch/_sync/client/searchable_snapshots.py +49 -12
- elasticsearch/_sync/client/security.py +544 -143
- elasticsearch/_sync/client/shutdown.py +28 -6
- elasticsearch/_sync/client/slm.py +80 -22
- elasticsearch/_sync/client/snapshot.py +140 -54
- elasticsearch/_sync/client/sql.py +55 -15
- elasticsearch/_sync/client/ssl.py +9 -2
- elasticsearch/_sync/client/synonyms.py +75 -21
- elasticsearch/_sync/client/tasks.py +29 -8
- elasticsearch/_sync/client/text_structure.py +74 -2
- elasticsearch/_sync/client/transform.py +106 -32
- elasticsearch/_sync/client/watcher.py +110 -31
- elasticsearch/_sync/client/xpack.py +16 -4
- elasticsearch/_version.py +1 -1
- elasticsearch/helpers/actions.py +1 -1
- elasticsearch/helpers/vectorstore/__init__.py +62 -0
- elasticsearch/helpers/vectorstore/_async/__init__.py +16 -0
- elasticsearch/helpers/vectorstore/_async/_utils.py +39 -0
- elasticsearch/helpers/vectorstore/_async/embedding_service.py +89 -0
- elasticsearch/helpers/vectorstore/_async/strategies.py +466 -0
- elasticsearch/helpers/vectorstore/_async/vectorstore.py +391 -0
- elasticsearch/helpers/vectorstore/_sync/__init__.py +16 -0
- elasticsearch/helpers/vectorstore/_sync/_utils.py +39 -0
- elasticsearch/helpers/vectorstore/_sync/embedding_service.py +89 -0
- elasticsearch/helpers/vectorstore/_sync/strategies.py +466 -0
- elasticsearch/helpers/vectorstore/_sync/vectorstore.py +388 -0
- elasticsearch/helpers/vectorstore/_utils.py +116 -0
- elasticsearch/serializer.py +14 -0
- {elasticsearch-8.12.1.dist-info → elasticsearch-8.13.1.dist-info}/METADATA +28 -8
- elasticsearch-8.13.1.dist-info/RECORD +116 -0
- {elasticsearch-8.12.1.dist-info → elasticsearch-8.13.1.dist-info}/WHEEL +1 -1
- elasticsearch-8.12.1.dist-info/RECORD +0 -103
- {elasticsearch-8.12.1.dist-info → elasticsearch-8.13.1.dist-info}/LICENSE +0 -0
- {elasticsearch-8.12.1.dist-info → elasticsearch-8.13.1.dist-info}/NOTICE +0 -0
- {elasticsearch-8.12.1.dist-info → elasticsearch-8.13.1.dist-info}/top_level.txt +0 -0
|
@@ -24,6 +24,7 @@ from .utils import SKIP_IN_PATH, _quote, _rewrite_parameters
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
class SecurityClient(NamespacedClient):
|
|
27
|
+
|
|
27
28
|
@_rewrite_parameters(
|
|
28
29
|
body_fields=("grant_type", "access_token", "password", "username"),
|
|
29
30
|
)
|
|
@@ -45,7 +46,7 @@ class SecurityClient(NamespacedClient):
|
|
|
45
46
|
"""
|
|
46
47
|
Creates or updates the user profile on behalf of another user.
|
|
47
48
|
|
|
48
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
49
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-activate-user-profile.html>`_
|
|
49
50
|
|
|
50
51
|
:param grant_type:
|
|
51
52
|
:param access_token:
|
|
@@ -54,6 +55,7 @@ class SecurityClient(NamespacedClient):
|
|
|
54
55
|
"""
|
|
55
56
|
if grant_type is None and body is None:
|
|
56
57
|
raise ValueError("Empty value passed for parameter 'grant_type'")
|
|
58
|
+
__path_parts: t.Dict[str, str] = {}
|
|
57
59
|
__path = "/_security/profile/_activate"
|
|
58
60
|
__query: t.Dict[str, t.Any] = {}
|
|
59
61
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
@@ -76,7 +78,13 @@ class SecurityClient(NamespacedClient):
|
|
|
76
78
|
__body["username"] = username
|
|
77
79
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
78
80
|
return await self.perform_request( # type: ignore[return-value]
|
|
79
|
-
"POST",
|
|
81
|
+
"POST",
|
|
82
|
+
__path,
|
|
83
|
+
params=__query,
|
|
84
|
+
headers=__headers,
|
|
85
|
+
body=__body,
|
|
86
|
+
endpoint_id="security.activate_user_profile",
|
|
87
|
+
path_parts=__path_parts,
|
|
80
88
|
)
|
|
81
89
|
|
|
82
90
|
@_rewrite_parameters()
|
|
@@ -92,8 +100,9 @@ class SecurityClient(NamespacedClient):
|
|
|
92
100
|
Enables authentication as a user and retrieve information about the authenticated
|
|
93
101
|
user.
|
|
94
102
|
|
|
95
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
103
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-authenticate.html>`_
|
|
96
104
|
"""
|
|
105
|
+
__path_parts: t.Dict[str, str] = {}
|
|
97
106
|
__path = "/_security/_authenticate"
|
|
98
107
|
__query: t.Dict[str, t.Any] = {}
|
|
99
108
|
if error_trace is not None:
|
|
@@ -106,7 +115,12 @@ class SecurityClient(NamespacedClient):
|
|
|
106
115
|
__query["pretty"] = pretty
|
|
107
116
|
__headers = {"accept": "application/json"}
|
|
108
117
|
return await self.perform_request( # type: ignore[return-value]
|
|
109
|
-
"GET",
|
|
118
|
+
"GET",
|
|
119
|
+
__path,
|
|
120
|
+
params=__query,
|
|
121
|
+
headers=__headers,
|
|
122
|
+
endpoint_id="security.authenticate",
|
|
123
|
+
path_parts=__path_parts,
|
|
110
124
|
)
|
|
111
125
|
|
|
112
126
|
@_rewrite_parameters(
|
|
@@ -130,7 +144,7 @@ class SecurityClient(NamespacedClient):
|
|
|
130
144
|
"""
|
|
131
145
|
Changes the passwords of users in the native realm and built-in users.
|
|
132
146
|
|
|
133
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
147
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-change-password.html>`_
|
|
134
148
|
|
|
135
149
|
:param username: The user whose password you want to change. If you do not specify
|
|
136
150
|
this parameter, the password is changed for the current user.
|
|
@@ -144,9 +158,12 @@ class SecurityClient(NamespacedClient):
|
|
|
144
158
|
this operation visible to search, if `wait_for` then wait for a refresh to
|
|
145
159
|
make this operation visible to search, if `false` then do nothing with refreshes.
|
|
146
160
|
"""
|
|
161
|
+
__path_parts: t.Dict[str, str]
|
|
147
162
|
if username not in SKIP_IN_PATH:
|
|
148
|
-
|
|
163
|
+
__path_parts = {"username": _quote(username)}
|
|
164
|
+
__path = f'/_security/user/{__path_parts["username"]}/_password'
|
|
149
165
|
else:
|
|
166
|
+
__path_parts = {}
|
|
150
167
|
__path = "/_security/user/_password"
|
|
151
168
|
__query: t.Dict[str, t.Any] = {}
|
|
152
169
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
@@ -167,7 +184,13 @@ class SecurityClient(NamespacedClient):
|
|
|
167
184
|
__body["password_hash"] = password_hash
|
|
168
185
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
169
186
|
return await self.perform_request( # type: ignore[return-value]
|
|
170
|
-
"PUT",
|
|
187
|
+
"PUT",
|
|
188
|
+
__path,
|
|
189
|
+
params=__query,
|
|
190
|
+
headers=__headers,
|
|
191
|
+
body=__body,
|
|
192
|
+
endpoint_id="security.change_password",
|
|
193
|
+
path_parts=__path_parts,
|
|
171
194
|
)
|
|
172
195
|
|
|
173
196
|
@_rewrite_parameters()
|
|
@@ -183,14 +206,15 @@ class SecurityClient(NamespacedClient):
|
|
|
183
206
|
"""
|
|
184
207
|
Clear a subset or all entries from the API key cache.
|
|
185
208
|
|
|
186
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
209
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-clear-api-key-cache.html>`_
|
|
187
210
|
|
|
188
211
|
:param ids: Comma-separated list of API key IDs to evict from the API key cache.
|
|
189
212
|
To evict all API keys, use `*`. Does not support other wildcard patterns.
|
|
190
213
|
"""
|
|
191
214
|
if ids in SKIP_IN_PATH:
|
|
192
215
|
raise ValueError("Empty value passed for parameter 'ids'")
|
|
193
|
-
|
|
216
|
+
__path_parts: t.Dict[str, str] = {"ids": _quote(ids)}
|
|
217
|
+
__path = f'/_security/api_key/{__path_parts["ids"]}/_clear_cache'
|
|
194
218
|
__query: t.Dict[str, t.Any] = {}
|
|
195
219
|
if error_trace is not None:
|
|
196
220
|
__query["error_trace"] = error_trace
|
|
@@ -202,7 +226,12 @@ class SecurityClient(NamespacedClient):
|
|
|
202
226
|
__query["pretty"] = pretty
|
|
203
227
|
__headers = {"accept": "application/json"}
|
|
204
228
|
return await self.perform_request( # type: ignore[return-value]
|
|
205
|
-
"POST",
|
|
229
|
+
"POST",
|
|
230
|
+
__path,
|
|
231
|
+
params=__query,
|
|
232
|
+
headers=__headers,
|
|
233
|
+
endpoint_id="security.clear_api_key_cache",
|
|
234
|
+
path_parts=__path_parts,
|
|
206
235
|
)
|
|
207
236
|
|
|
208
237
|
@_rewrite_parameters()
|
|
@@ -218,13 +247,14 @@ class SecurityClient(NamespacedClient):
|
|
|
218
247
|
"""
|
|
219
248
|
Evicts application privileges from the native application privileges cache.
|
|
220
249
|
|
|
221
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
250
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-clear-privilege-cache.html>`_
|
|
222
251
|
|
|
223
252
|
:param application: A comma-separated list of application names
|
|
224
253
|
"""
|
|
225
254
|
if application in SKIP_IN_PATH:
|
|
226
255
|
raise ValueError("Empty value passed for parameter 'application'")
|
|
227
|
-
|
|
256
|
+
__path_parts: t.Dict[str, str] = {"application": _quote(application)}
|
|
257
|
+
__path = f'/_security/privilege/{__path_parts["application"]}/_clear_cache'
|
|
228
258
|
__query: t.Dict[str, t.Any] = {}
|
|
229
259
|
if error_trace is not None:
|
|
230
260
|
__query["error_trace"] = error_trace
|
|
@@ -236,7 +266,12 @@ class SecurityClient(NamespacedClient):
|
|
|
236
266
|
__query["pretty"] = pretty
|
|
237
267
|
__headers = {"accept": "application/json"}
|
|
238
268
|
return await self.perform_request( # type: ignore[return-value]
|
|
239
|
-
"POST",
|
|
269
|
+
"POST",
|
|
270
|
+
__path,
|
|
271
|
+
params=__query,
|
|
272
|
+
headers=__headers,
|
|
273
|
+
endpoint_id="security.clear_cached_privileges",
|
|
274
|
+
path_parts=__path_parts,
|
|
240
275
|
)
|
|
241
276
|
|
|
242
277
|
@_rewrite_parameters()
|
|
@@ -254,14 +289,15 @@ class SecurityClient(NamespacedClient):
|
|
|
254
289
|
Evicts users from the user cache. Can completely clear the cache or evict specific
|
|
255
290
|
users.
|
|
256
291
|
|
|
257
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
292
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-clear-cache.html>`_
|
|
258
293
|
|
|
259
294
|
:param realms: Comma-separated list of realms to clear
|
|
260
295
|
:param usernames: Comma-separated list of usernames to clear from the cache
|
|
261
296
|
"""
|
|
262
297
|
if realms in SKIP_IN_PATH:
|
|
263
298
|
raise ValueError("Empty value passed for parameter 'realms'")
|
|
264
|
-
|
|
299
|
+
__path_parts: t.Dict[str, str] = {"realms": _quote(realms)}
|
|
300
|
+
__path = f'/_security/realm/{__path_parts["realms"]}/_clear_cache'
|
|
265
301
|
__query: t.Dict[str, t.Any] = {}
|
|
266
302
|
if error_trace is not None:
|
|
267
303
|
__query["error_trace"] = error_trace
|
|
@@ -275,7 +311,12 @@ class SecurityClient(NamespacedClient):
|
|
|
275
311
|
__query["usernames"] = usernames
|
|
276
312
|
__headers = {"accept": "application/json"}
|
|
277
313
|
return await self.perform_request( # type: ignore[return-value]
|
|
278
|
-
"POST",
|
|
314
|
+
"POST",
|
|
315
|
+
__path,
|
|
316
|
+
params=__query,
|
|
317
|
+
headers=__headers,
|
|
318
|
+
endpoint_id="security.clear_cached_realms",
|
|
319
|
+
path_parts=__path_parts,
|
|
279
320
|
)
|
|
280
321
|
|
|
281
322
|
@_rewrite_parameters()
|
|
@@ -291,13 +332,14 @@ class SecurityClient(NamespacedClient):
|
|
|
291
332
|
"""
|
|
292
333
|
Evicts roles from the native role cache.
|
|
293
334
|
|
|
294
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
335
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-clear-role-cache.html>`_
|
|
295
336
|
|
|
296
337
|
:param name: Role name
|
|
297
338
|
"""
|
|
298
339
|
if name in SKIP_IN_PATH:
|
|
299
340
|
raise ValueError("Empty value passed for parameter 'name'")
|
|
300
|
-
|
|
341
|
+
__path_parts: t.Dict[str, str] = {"name": _quote(name)}
|
|
342
|
+
__path = f'/_security/role/{__path_parts["name"]}/_clear_cache'
|
|
301
343
|
__query: t.Dict[str, t.Any] = {}
|
|
302
344
|
if error_trace is not None:
|
|
303
345
|
__query["error_trace"] = error_trace
|
|
@@ -309,7 +351,12 @@ class SecurityClient(NamespacedClient):
|
|
|
309
351
|
__query["pretty"] = pretty
|
|
310
352
|
__headers = {"accept": "application/json"}
|
|
311
353
|
return await self.perform_request( # type: ignore[return-value]
|
|
312
|
-
"POST",
|
|
354
|
+
"POST",
|
|
355
|
+
__path,
|
|
356
|
+
params=__query,
|
|
357
|
+
headers=__headers,
|
|
358
|
+
endpoint_id="security.clear_cached_roles",
|
|
359
|
+
path_parts=__path_parts,
|
|
313
360
|
)
|
|
314
361
|
|
|
315
362
|
@_rewrite_parameters()
|
|
@@ -327,7 +374,7 @@ class SecurityClient(NamespacedClient):
|
|
|
327
374
|
"""
|
|
328
375
|
Evicts tokens from the service account token caches.
|
|
329
376
|
|
|
330
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
377
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-clear-service-token-caches.html>`_
|
|
331
378
|
|
|
332
379
|
:param namespace: An identifier for the namespace
|
|
333
380
|
:param service: An identifier for the service name
|
|
@@ -339,7 +386,12 @@ class SecurityClient(NamespacedClient):
|
|
|
339
386
|
raise ValueError("Empty value passed for parameter 'service'")
|
|
340
387
|
if name in SKIP_IN_PATH:
|
|
341
388
|
raise ValueError("Empty value passed for parameter 'name'")
|
|
342
|
-
|
|
389
|
+
__path_parts: t.Dict[str, str] = {
|
|
390
|
+
"namespace": _quote(namespace),
|
|
391
|
+
"service": _quote(service),
|
|
392
|
+
"name": _quote(name),
|
|
393
|
+
}
|
|
394
|
+
__path = f'/_security/service/{__path_parts["namespace"]}/{__path_parts["service"]}/credential/token/{__path_parts["name"]}/_clear_cache'
|
|
343
395
|
__query: t.Dict[str, t.Any] = {}
|
|
344
396
|
if error_trace is not None:
|
|
345
397
|
__query["error_trace"] = error_trace
|
|
@@ -351,7 +403,12 @@ class SecurityClient(NamespacedClient):
|
|
|
351
403
|
__query["pretty"] = pretty
|
|
352
404
|
__headers = {"accept": "application/json"}
|
|
353
405
|
return await self.perform_request( # type: ignore[return-value]
|
|
354
|
-
"POST",
|
|
406
|
+
"POST",
|
|
407
|
+
__path,
|
|
408
|
+
params=__query,
|
|
409
|
+
headers=__headers,
|
|
410
|
+
endpoint_id="security.clear_cached_service_tokens",
|
|
411
|
+
path_parts=__path_parts,
|
|
355
412
|
)
|
|
356
413
|
|
|
357
414
|
@_rewrite_parameters(
|
|
@@ -376,7 +433,7 @@ class SecurityClient(NamespacedClient):
|
|
|
376
433
|
"""
|
|
377
434
|
Creates an API key for access without requiring basic authentication.
|
|
378
435
|
|
|
379
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
436
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-create-api-key.html>`_
|
|
380
437
|
|
|
381
438
|
:param expiration: Expiration time for the API key. By default, API keys never
|
|
382
439
|
expire.
|
|
@@ -396,6 +453,7 @@ class SecurityClient(NamespacedClient):
|
|
|
396
453
|
is the same as the request for create role API. For more details, see create
|
|
397
454
|
or update roles API.
|
|
398
455
|
"""
|
|
456
|
+
__path_parts: t.Dict[str, str] = {}
|
|
399
457
|
__path = "/_security/api_key"
|
|
400
458
|
__query: t.Dict[str, t.Any] = {}
|
|
401
459
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
@@ -420,7 +478,13 @@ class SecurityClient(NamespacedClient):
|
|
|
420
478
|
__body["role_descriptors"] = role_descriptors
|
|
421
479
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
422
480
|
return await self.perform_request( # type: ignore[return-value]
|
|
423
|
-
"PUT",
|
|
481
|
+
"PUT",
|
|
482
|
+
__path,
|
|
483
|
+
params=__query,
|
|
484
|
+
headers=__headers,
|
|
485
|
+
body=__body,
|
|
486
|
+
endpoint_id="security.create_api_key",
|
|
487
|
+
path_parts=__path_parts,
|
|
424
488
|
)
|
|
425
489
|
|
|
426
490
|
@_rewrite_parameters()
|
|
@@ -441,7 +505,7 @@ class SecurityClient(NamespacedClient):
|
|
|
441
505
|
"""
|
|
442
506
|
Creates a service account token for access without requiring basic authentication.
|
|
443
507
|
|
|
444
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
508
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-create-service-token.html>`_
|
|
445
509
|
|
|
446
510
|
:param namespace: An identifier for the namespace
|
|
447
511
|
:param service: An identifier for the service name
|
|
@@ -454,15 +518,22 @@ class SecurityClient(NamespacedClient):
|
|
|
454
518
|
raise ValueError("Empty value passed for parameter 'namespace'")
|
|
455
519
|
if service in SKIP_IN_PATH:
|
|
456
520
|
raise ValueError("Empty value passed for parameter 'service'")
|
|
521
|
+
__path_parts: t.Dict[str, str]
|
|
457
522
|
if (
|
|
458
523
|
namespace not in SKIP_IN_PATH
|
|
459
524
|
and service not in SKIP_IN_PATH
|
|
460
525
|
and name not in SKIP_IN_PATH
|
|
461
526
|
):
|
|
462
|
-
|
|
527
|
+
__path_parts = {
|
|
528
|
+
"namespace": _quote(namespace),
|
|
529
|
+
"service": _quote(service),
|
|
530
|
+
"name": _quote(name),
|
|
531
|
+
}
|
|
532
|
+
__path = f'/_security/service/{__path_parts["namespace"]}/{__path_parts["service"]}/credential/token/{__path_parts["name"]}'
|
|
463
533
|
__method = "PUT"
|
|
464
534
|
elif namespace not in SKIP_IN_PATH and service not in SKIP_IN_PATH:
|
|
465
|
-
|
|
535
|
+
__path_parts = {"namespace": _quote(namespace), "service": _quote(service)}
|
|
536
|
+
__path = f'/_security/service/{__path_parts["namespace"]}/{__path_parts["service"]}/credential/token'
|
|
466
537
|
__method = "POST"
|
|
467
538
|
else:
|
|
468
539
|
raise ValueError("Couldn't find a path for the given parameters")
|
|
@@ -479,7 +550,12 @@ class SecurityClient(NamespacedClient):
|
|
|
479
550
|
__query["refresh"] = refresh
|
|
480
551
|
__headers = {"accept": "application/json"}
|
|
481
552
|
return await self.perform_request( # type: ignore[return-value]
|
|
482
|
-
__method,
|
|
553
|
+
__method,
|
|
554
|
+
__path,
|
|
555
|
+
params=__query,
|
|
556
|
+
headers=__headers,
|
|
557
|
+
endpoint_id="security.create_service_token",
|
|
558
|
+
path_parts=__path_parts,
|
|
483
559
|
)
|
|
484
560
|
|
|
485
561
|
@_rewrite_parameters()
|
|
@@ -499,7 +575,7 @@ class SecurityClient(NamespacedClient):
|
|
|
499
575
|
"""
|
|
500
576
|
Removes application privileges.
|
|
501
577
|
|
|
502
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
578
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-delete-privilege.html>`_
|
|
503
579
|
|
|
504
580
|
:param application: Application name
|
|
505
581
|
:param name: Privilege name
|
|
@@ -511,7 +587,13 @@ class SecurityClient(NamespacedClient):
|
|
|
511
587
|
raise ValueError("Empty value passed for parameter 'application'")
|
|
512
588
|
if name in SKIP_IN_PATH:
|
|
513
589
|
raise ValueError("Empty value passed for parameter 'name'")
|
|
514
|
-
|
|
590
|
+
__path_parts: t.Dict[str, str] = {
|
|
591
|
+
"application": _quote(application),
|
|
592
|
+
"name": _quote(name),
|
|
593
|
+
}
|
|
594
|
+
__path = (
|
|
595
|
+
f'/_security/privilege/{__path_parts["application"]}/{__path_parts["name"]}'
|
|
596
|
+
)
|
|
515
597
|
__query: t.Dict[str, t.Any] = {}
|
|
516
598
|
if error_trace is not None:
|
|
517
599
|
__query["error_trace"] = error_trace
|
|
@@ -525,7 +607,12 @@ class SecurityClient(NamespacedClient):
|
|
|
525
607
|
__query["refresh"] = refresh
|
|
526
608
|
__headers = {"accept": "application/json"}
|
|
527
609
|
return await self.perform_request( # type: ignore[return-value]
|
|
528
|
-
"DELETE",
|
|
610
|
+
"DELETE",
|
|
611
|
+
__path,
|
|
612
|
+
params=__query,
|
|
613
|
+
headers=__headers,
|
|
614
|
+
endpoint_id="security.delete_privileges",
|
|
615
|
+
path_parts=__path_parts,
|
|
529
616
|
)
|
|
530
617
|
|
|
531
618
|
@_rewrite_parameters()
|
|
@@ -544,7 +631,7 @@ class SecurityClient(NamespacedClient):
|
|
|
544
631
|
"""
|
|
545
632
|
Removes roles in the native realm.
|
|
546
633
|
|
|
547
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
634
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-delete-role.html>`_
|
|
548
635
|
|
|
549
636
|
:param name: Role name
|
|
550
637
|
:param refresh: If `true` (the default) then refresh the affected shards to make
|
|
@@ -553,7 +640,8 @@ class SecurityClient(NamespacedClient):
|
|
|
553
640
|
"""
|
|
554
641
|
if name in SKIP_IN_PATH:
|
|
555
642
|
raise ValueError("Empty value passed for parameter 'name'")
|
|
556
|
-
|
|
643
|
+
__path_parts: t.Dict[str, str] = {"name": _quote(name)}
|
|
644
|
+
__path = f'/_security/role/{__path_parts["name"]}'
|
|
557
645
|
__query: t.Dict[str, t.Any] = {}
|
|
558
646
|
if error_trace is not None:
|
|
559
647
|
__query["error_trace"] = error_trace
|
|
@@ -567,7 +655,12 @@ class SecurityClient(NamespacedClient):
|
|
|
567
655
|
__query["refresh"] = refresh
|
|
568
656
|
__headers = {"accept": "application/json"}
|
|
569
657
|
return await self.perform_request( # type: ignore[return-value]
|
|
570
|
-
"DELETE",
|
|
658
|
+
"DELETE",
|
|
659
|
+
__path,
|
|
660
|
+
params=__query,
|
|
661
|
+
headers=__headers,
|
|
662
|
+
endpoint_id="security.delete_role",
|
|
663
|
+
path_parts=__path_parts,
|
|
571
664
|
)
|
|
572
665
|
|
|
573
666
|
@_rewrite_parameters()
|
|
@@ -586,7 +679,7 @@ class SecurityClient(NamespacedClient):
|
|
|
586
679
|
"""
|
|
587
680
|
Removes role mappings.
|
|
588
681
|
|
|
589
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
682
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-delete-role-mapping.html>`_
|
|
590
683
|
|
|
591
684
|
:param name: Role-mapping name
|
|
592
685
|
:param refresh: If `true` (the default) then refresh the affected shards to make
|
|
@@ -595,7 +688,8 @@ class SecurityClient(NamespacedClient):
|
|
|
595
688
|
"""
|
|
596
689
|
if name in SKIP_IN_PATH:
|
|
597
690
|
raise ValueError("Empty value passed for parameter 'name'")
|
|
598
|
-
|
|
691
|
+
__path_parts: t.Dict[str, str] = {"name": _quote(name)}
|
|
692
|
+
__path = f'/_security/role_mapping/{__path_parts["name"]}'
|
|
599
693
|
__query: t.Dict[str, t.Any] = {}
|
|
600
694
|
if error_trace is not None:
|
|
601
695
|
__query["error_trace"] = error_trace
|
|
@@ -609,7 +703,12 @@ class SecurityClient(NamespacedClient):
|
|
|
609
703
|
__query["refresh"] = refresh
|
|
610
704
|
__headers = {"accept": "application/json"}
|
|
611
705
|
return await self.perform_request( # type: ignore[return-value]
|
|
612
|
-
"DELETE",
|
|
706
|
+
"DELETE",
|
|
707
|
+
__path,
|
|
708
|
+
params=__query,
|
|
709
|
+
headers=__headers,
|
|
710
|
+
endpoint_id="security.delete_role_mapping",
|
|
711
|
+
path_parts=__path_parts,
|
|
613
712
|
)
|
|
614
713
|
|
|
615
714
|
@_rewrite_parameters()
|
|
@@ -630,7 +729,7 @@ class SecurityClient(NamespacedClient):
|
|
|
630
729
|
"""
|
|
631
730
|
Deletes a service account token.
|
|
632
731
|
|
|
633
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
732
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-delete-service-token.html>`_
|
|
634
733
|
|
|
635
734
|
:param namespace: An identifier for the namespace
|
|
636
735
|
:param service: An identifier for the service name
|
|
@@ -645,7 +744,12 @@ class SecurityClient(NamespacedClient):
|
|
|
645
744
|
raise ValueError("Empty value passed for parameter 'service'")
|
|
646
745
|
if name in SKIP_IN_PATH:
|
|
647
746
|
raise ValueError("Empty value passed for parameter 'name'")
|
|
648
|
-
|
|
747
|
+
__path_parts: t.Dict[str, str] = {
|
|
748
|
+
"namespace": _quote(namespace),
|
|
749
|
+
"service": _quote(service),
|
|
750
|
+
"name": _quote(name),
|
|
751
|
+
}
|
|
752
|
+
__path = f'/_security/service/{__path_parts["namespace"]}/{__path_parts["service"]}/credential/token/{__path_parts["name"]}'
|
|
649
753
|
__query: t.Dict[str, t.Any] = {}
|
|
650
754
|
if error_trace is not None:
|
|
651
755
|
__query["error_trace"] = error_trace
|
|
@@ -659,7 +763,12 @@ class SecurityClient(NamespacedClient):
|
|
|
659
763
|
__query["refresh"] = refresh
|
|
660
764
|
__headers = {"accept": "application/json"}
|
|
661
765
|
return await self.perform_request( # type: ignore[return-value]
|
|
662
|
-
"DELETE",
|
|
766
|
+
"DELETE",
|
|
767
|
+
__path,
|
|
768
|
+
params=__query,
|
|
769
|
+
headers=__headers,
|
|
770
|
+
endpoint_id="security.delete_service_token",
|
|
771
|
+
path_parts=__path_parts,
|
|
663
772
|
)
|
|
664
773
|
|
|
665
774
|
@_rewrite_parameters()
|
|
@@ -678,7 +787,7 @@ class SecurityClient(NamespacedClient):
|
|
|
678
787
|
"""
|
|
679
788
|
Deletes users from the native realm.
|
|
680
789
|
|
|
681
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
790
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-delete-user.html>`_
|
|
682
791
|
|
|
683
792
|
:param username: username
|
|
684
793
|
:param refresh: If `true` (the default) then refresh the affected shards to make
|
|
@@ -687,7 +796,8 @@ class SecurityClient(NamespacedClient):
|
|
|
687
796
|
"""
|
|
688
797
|
if username in SKIP_IN_PATH:
|
|
689
798
|
raise ValueError("Empty value passed for parameter 'username'")
|
|
690
|
-
|
|
799
|
+
__path_parts: t.Dict[str, str] = {"username": _quote(username)}
|
|
800
|
+
__path = f'/_security/user/{__path_parts["username"]}'
|
|
691
801
|
__query: t.Dict[str, t.Any] = {}
|
|
692
802
|
if error_trace is not None:
|
|
693
803
|
__query["error_trace"] = error_trace
|
|
@@ -701,7 +811,12 @@ class SecurityClient(NamespacedClient):
|
|
|
701
811
|
__query["refresh"] = refresh
|
|
702
812
|
__headers = {"accept": "application/json"}
|
|
703
813
|
return await self.perform_request( # type: ignore[return-value]
|
|
704
|
-
"DELETE",
|
|
814
|
+
"DELETE",
|
|
815
|
+
__path,
|
|
816
|
+
params=__query,
|
|
817
|
+
headers=__headers,
|
|
818
|
+
endpoint_id="security.delete_user",
|
|
819
|
+
path_parts=__path_parts,
|
|
705
820
|
)
|
|
706
821
|
|
|
707
822
|
@_rewrite_parameters()
|
|
@@ -720,7 +835,7 @@ class SecurityClient(NamespacedClient):
|
|
|
720
835
|
"""
|
|
721
836
|
Disables users in the native realm.
|
|
722
837
|
|
|
723
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
838
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-disable-user.html>`_
|
|
724
839
|
|
|
725
840
|
:param username: The username of the user to disable
|
|
726
841
|
:param refresh: If `true` (the default) then refresh the affected shards to make
|
|
@@ -729,7 +844,8 @@ class SecurityClient(NamespacedClient):
|
|
|
729
844
|
"""
|
|
730
845
|
if username in SKIP_IN_PATH:
|
|
731
846
|
raise ValueError("Empty value passed for parameter 'username'")
|
|
732
|
-
|
|
847
|
+
__path_parts: t.Dict[str, str] = {"username": _quote(username)}
|
|
848
|
+
__path = f'/_security/user/{__path_parts["username"]}/_disable'
|
|
733
849
|
__query: t.Dict[str, t.Any] = {}
|
|
734
850
|
if error_trace is not None:
|
|
735
851
|
__query["error_trace"] = error_trace
|
|
@@ -743,7 +859,12 @@ class SecurityClient(NamespacedClient):
|
|
|
743
859
|
__query["refresh"] = refresh
|
|
744
860
|
__headers = {"accept": "application/json"}
|
|
745
861
|
return await self.perform_request( # type: ignore[return-value]
|
|
746
|
-
"PUT",
|
|
862
|
+
"PUT",
|
|
863
|
+
__path,
|
|
864
|
+
params=__query,
|
|
865
|
+
headers=__headers,
|
|
866
|
+
endpoint_id="security.disable_user",
|
|
867
|
+
path_parts=__path_parts,
|
|
747
868
|
)
|
|
748
869
|
|
|
749
870
|
@_rewrite_parameters()
|
|
@@ -762,7 +883,7 @@ class SecurityClient(NamespacedClient):
|
|
|
762
883
|
"""
|
|
763
884
|
Disables a user profile so it's not visible in user profile searches.
|
|
764
885
|
|
|
765
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
886
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-disable-user-profile.html>`_
|
|
766
887
|
|
|
767
888
|
:param uid: Unique identifier for the user profile.
|
|
768
889
|
:param refresh: If 'true', Elasticsearch refreshes the affected shards to make
|
|
@@ -771,7 +892,8 @@ class SecurityClient(NamespacedClient):
|
|
|
771
892
|
"""
|
|
772
893
|
if uid in SKIP_IN_PATH:
|
|
773
894
|
raise ValueError("Empty value passed for parameter 'uid'")
|
|
774
|
-
|
|
895
|
+
__path_parts: t.Dict[str, str] = {"uid": _quote(uid)}
|
|
896
|
+
__path = f'/_security/profile/{__path_parts["uid"]}/_disable'
|
|
775
897
|
__query: t.Dict[str, t.Any] = {}
|
|
776
898
|
if error_trace is not None:
|
|
777
899
|
__query["error_trace"] = error_trace
|
|
@@ -785,7 +907,12 @@ class SecurityClient(NamespacedClient):
|
|
|
785
907
|
__query["refresh"] = refresh
|
|
786
908
|
__headers = {"accept": "application/json"}
|
|
787
909
|
return await self.perform_request( # type: ignore[return-value]
|
|
788
|
-
"PUT",
|
|
910
|
+
"PUT",
|
|
911
|
+
__path,
|
|
912
|
+
params=__query,
|
|
913
|
+
headers=__headers,
|
|
914
|
+
endpoint_id="security.disable_user_profile",
|
|
915
|
+
path_parts=__path_parts,
|
|
789
916
|
)
|
|
790
917
|
|
|
791
918
|
@_rewrite_parameters()
|
|
@@ -804,7 +931,7 @@ class SecurityClient(NamespacedClient):
|
|
|
804
931
|
"""
|
|
805
932
|
Enables users in the native realm.
|
|
806
933
|
|
|
807
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
934
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-enable-user.html>`_
|
|
808
935
|
|
|
809
936
|
:param username: The username of the user to enable
|
|
810
937
|
:param refresh: If `true` (the default) then refresh the affected shards to make
|
|
@@ -813,7 +940,8 @@ class SecurityClient(NamespacedClient):
|
|
|
813
940
|
"""
|
|
814
941
|
if username in SKIP_IN_PATH:
|
|
815
942
|
raise ValueError("Empty value passed for parameter 'username'")
|
|
816
|
-
|
|
943
|
+
__path_parts: t.Dict[str, str] = {"username": _quote(username)}
|
|
944
|
+
__path = f'/_security/user/{__path_parts["username"]}/_enable'
|
|
817
945
|
__query: t.Dict[str, t.Any] = {}
|
|
818
946
|
if error_trace is not None:
|
|
819
947
|
__query["error_trace"] = error_trace
|
|
@@ -827,7 +955,12 @@ class SecurityClient(NamespacedClient):
|
|
|
827
955
|
__query["refresh"] = refresh
|
|
828
956
|
__headers = {"accept": "application/json"}
|
|
829
957
|
return await self.perform_request( # type: ignore[return-value]
|
|
830
|
-
"PUT",
|
|
958
|
+
"PUT",
|
|
959
|
+
__path,
|
|
960
|
+
params=__query,
|
|
961
|
+
headers=__headers,
|
|
962
|
+
endpoint_id="security.enable_user",
|
|
963
|
+
path_parts=__path_parts,
|
|
831
964
|
)
|
|
832
965
|
|
|
833
966
|
@_rewrite_parameters()
|
|
@@ -846,7 +979,7 @@ class SecurityClient(NamespacedClient):
|
|
|
846
979
|
"""
|
|
847
980
|
Enables a user profile so it's visible in user profile searches.
|
|
848
981
|
|
|
849
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
982
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-enable-user-profile.html>`_
|
|
850
983
|
|
|
851
984
|
:param uid: Unique identifier for the user profile.
|
|
852
985
|
:param refresh: If 'true', Elasticsearch refreshes the affected shards to make
|
|
@@ -855,7 +988,8 @@ class SecurityClient(NamespacedClient):
|
|
|
855
988
|
"""
|
|
856
989
|
if uid in SKIP_IN_PATH:
|
|
857
990
|
raise ValueError("Empty value passed for parameter 'uid'")
|
|
858
|
-
|
|
991
|
+
__path_parts: t.Dict[str, str] = {"uid": _quote(uid)}
|
|
992
|
+
__path = f'/_security/profile/{__path_parts["uid"]}/_enable'
|
|
859
993
|
__query: t.Dict[str, t.Any] = {}
|
|
860
994
|
if error_trace is not None:
|
|
861
995
|
__query["error_trace"] = error_trace
|
|
@@ -869,7 +1003,12 @@ class SecurityClient(NamespacedClient):
|
|
|
869
1003
|
__query["refresh"] = refresh
|
|
870
1004
|
__headers = {"accept": "application/json"}
|
|
871
1005
|
return await self.perform_request( # type: ignore[return-value]
|
|
872
|
-
"PUT",
|
|
1006
|
+
"PUT",
|
|
1007
|
+
__path,
|
|
1008
|
+
params=__query,
|
|
1009
|
+
headers=__headers,
|
|
1010
|
+
endpoint_id="security.enable_user_profile",
|
|
1011
|
+
path_parts=__path_parts,
|
|
873
1012
|
)
|
|
874
1013
|
|
|
875
1014
|
@_rewrite_parameters()
|
|
@@ -885,8 +1024,9 @@ class SecurityClient(NamespacedClient):
|
|
|
885
1024
|
Allows a kibana instance to configure itself to communicate with a secured elasticsearch
|
|
886
1025
|
cluster.
|
|
887
1026
|
|
|
888
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1027
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-kibana-enrollment.html>`_
|
|
889
1028
|
"""
|
|
1029
|
+
__path_parts: t.Dict[str, str] = {}
|
|
890
1030
|
__path = "/_security/enroll/kibana"
|
|
891
1031
|
__query: t.Dict[str, t.Any] = {}
|
|
892
1032
|
if error_trace is not None:
|
|
@@ -899,7 +1039,12 @@ class SecurityClient(NamespacedClient):
|
|
|
899
1039
|
__query["pretty"] = pretty
|
|
900
1040
|
__headers = {"accept": "application/json"}
|
|
901
1041
|
return await self.perform_request( # type: ignore[return-value]
|
|
902
|
-
"GET",
|
|
1042
|
+
"GET",
|
|
1043
|
+
__path,
|
|
1044
|
+
params=__query,
|
|
1045
|
+
headers=__headers,
|
|
1046
|
+
endpoint_id="security.enroll_kibana",
|
|
1047
|
+
path_parts=__path_parts,
|
|
903
1048
|
)
|
|
904
1049
|
|
|
905
1050
|
@_rewrite_parameters()
|
|
@@ -914,8 +1059,9 @@ class SecurityClient(NamespacedClient):
|
|
|
914
1059
|
"""
|
|
915
1060
|
Allows a new node to enroll to an existing cluster with security enabled.
|
|
916
1061
|
|
|
917
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1062
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-node-enrollment.html>`_
|
|
918
1063
|
"""
|
|
1064
|
+
__path_parts: t.Dict[str, str] = {}
|
|
919
1065
|
__path = "/_security/enroll/node"
|
|
920
1066
|
__query: t.Dict[str, t.Any] = {}
|
|
921
1067
|
if error_trace is not None:
|
|
@@ -928,7 +1074,12 @@ class SecurityClient(NamespacedClient):
|
|
|
928
1074
|
__query["pretty"] = pretty
|
|
929
1075
|
__headers = {"accept": "application/json"}
|
|
930
1076
|
return await self.perform_request( # type: ignore[return-value]
|
|
931
|
-
"GET",
|
|
1077
|
+
"GET",
|
|
1078
|
+
__path,
|
|
1079
|
+
params=__query,
|
|
1080
|
+
headers=__headers,
|
|
1081
|
+
endpoint_id="security.enroll_node",
|
|
1082
|
+
path_parts=__path_parts,
|
|
932
1083
|
)
|
|
933
1084
|
|
|
934
1085
|
@_rewrite_parameters()
|
|
@@ -950,7 +1101,7 @@ class SecurityClient(NamespacedClient):
|
|
|
950
1101
|
"""
|
|
951
1102
|
Retrieves information for one or more API keys.
|
|
952
1103
|
|
|
953
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1104
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-get-api-key.html>`_
|
|
954
1105
|
|
|
955
1106
|
:param active_only: A boolean flag that can be used to query API keys that are
|
|
956
1107
|
currently active. An API key is considered active if it is neither invalidated,
|
|
@@ -973,6 +1124,7 @@ class SecurityClient(NamespacedClient):
|
|
|
973
1124
|
associated with the API key. An API key's actual permission is the intersection
|
|
974
1125
|
of its assigned role descriptors and the owner user's role descriptors.
|
|
975
1126
|
"""
|
|
1127
|
+
__path_parts: t.Dict[str, str] = {}
|
|
976
1128
|
__path = "/_security/api_key"
|
|
977
1129
|
__query: t.Dict[str, t.Any] = {}
|
|
978
1130
|
if active_only is not None:
|
|
@@ -999,7 +1151,12 @@ class SecurityClient(NamespacedClient):
|
|
|
999
1151
|
__query["with_limited_by"] = with_limited_by
|
|
1000
1152
|
__headers = {"accept": "application/json"}
|
|
1001
1153
|
return await self.perform_request( # type: ignore[return-value]
|
|
1002
|
-
"GET",
|
|
1154
|
+
"GET",
|
|
1155
|
+
__path,
|
|
1156
|
+
params=__query,
|
|
1157
|
+
headers=__headers,
|
|
1158
|
+
endpoint_id="security.get_api_key",
|
|
1159
|
+
path_parts=__path_parts,
|
|
1003
1160
|
)
|
|
1004
1161
|
|
|
1005
1162
|
@_rewrite_parameters()
|
|
@@ -1015,8 +1172,9 @@ class SecurityClient(NamespacedClient):
|
|
|
1015
1172
|
Retrieves the list of cluster privileges and index privileges that are available
|
|
1016
1173
|
in this version of Elasticsearch.
|
|
1017
1174
|
|
|
1018
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1175
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-get-builtin-privileges.html>`_
|
|
1019
1176
|
"""
|
|
1177
|
+
__path_parts: t.Dict[str, str] = {}
|
|
1020
1178
|
__path = "/_security/privilege/_builtin"
|
|
1021
1179
|
__query: t.Dict[str, t.Any] = {}
|
|
1022
1180
|
if error_trace is not None:
|
|
@@ -1029,7 +1187,12 @@ class SecurityClient(NamespacedClient):
|
|
|
1029
1187
|
__query["pretty"] = pretty
|
|
1030
1188
|
__headers = {"accept": "application/json"}
|
|
1031
1189
|
return await self.perform_request( # type: ignore[return-value]
|
|
1032
|
-
"GET",
|
|
1190
|
+
"GET",
|
|
1191
|
+
__path,
|
|
1192
|
+
params=__query,
|
|
1193
|
+
headers=__headers,
|
|
1194
|
+
endpoint_id="security.get_builtin_privileges",
|
|
1195
|
+
path_parts=__path_parts,
|
|
1033
1196
|
)
|
|
1034
1197
|
|
|
1035
1198
|
@_rewrite_parameters()
|
|
@@ -1046,16 +1209,20 @@ class SecurityClient(NamespacedClient):
|
|
|
1046
1209
|
"""
|
|
1047
1210
|
Retrieves application privileges.
|
|
1048
1211
|
|
|
1049
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1212
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-get-privileges.html>`_
|
|
1050
1213
|
|
|
1051
1214
|
:param application: Application name
|
|
1052
1215
|
:param name: Privilege name
|
|
1053
1216
|
"""
|
|
1217
|
+
__path_parts: t.Dict[str, str]
|
|
1054
1218
|
if application not in SKIP_IN_PATH and name not in SKIP_IN_PATH:
|
|
1055
|
-
|
|
1219
|
+
__path_parts = {"application": _quote(application), "name": _quote(name)}
|
|
1220
|
+
__path = f'/_security/privilege/{__path_parts["application"]}/{__path_parts["name"]}'
|
|
1056
1221
|
elif application not in SKIP_IN_PATH:
|
|
1057
|
-
|
|
1222
|
+
__path_parts = {"application": _quote(application)}
|
|
1223
|
+
__path = f'/_security/privilege/{__path_parts["application"]}'
|
|
1058
1224
|
else:
|
|
1225
|
+
__path_parts = {}
|
|
1059
1226
|
__path = "/_security/privilege"
|
|
1060
1227
|
__query: t.Dict[str, t.Any] = {}
|
|
1061
1228
|
if error_trace is not None:
|
|
@@ -1068,7 +1235,12 @@ class SecurityClient(NamespacedClient):
|
|
|
1068
1235
|
__query["pretty"] = pretty
|
|
1069
1236
|
__headers = {"accept": "application/json"}
|
|
1070
1237
|
return await self.perform_request( # type: ignore[return-value]
|
|
1071
|
-
"GET",
|
|
1238
|
+
"GET",
|
|
1239
|
+
__path,
|
|
1240
|
+
params=__query,
|
|
1241
|
+
headers=__headers,
|
|
1242
|
+
endpoint_id="security.get_privileges",
|
|
1243
|
+
path_parts=__path_parts,
|
|
1072
1244
|
)
|
|
1073
1245
|
|
|
1074
1246
|
@_rewrite_parameters()
|
|
@@ -1084,15 +1256,18 @@ class SecurityClient(NamespacedClient):
|
|
|
1084
1256
|
"""
|
|
1085
1257
|
Retrieves roles in the native realm.
|
|
1086
1258
|
|
|
1087
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1259
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-get-role.html>`_
|
|
1088
1260
|
|
|
1089
1261
|
:param name: The name of the role. You can specify multiple roles as a comma-separated
|
|
1090
1262
|
list. If you do not specify this parameter, the API returns information about
|
|
1091
1263
|
all roles.
|
|
1092
1264
|
"""
|
|
1265
|
+
__path_parts: t.Dict[str, str]
|
|
1093
1266
|
if name not in SKIP_IN_PATH:
|
|
1094
|
-
|
|
1267
|
+
__path_parts = {"name": _quote(name)}
|
|
1268
|
+
__path = f'/_security/role/{__path_parts["name"]}'
|
|
1095
1269
|
else:
|
|
1270
|
+
__path_parts = {}
|
|
1096
1271
|
__path = "/_security/role"
|
|
1097
1272
|
__query: t.Dict[str, t.Any] = {}
|
|
1098
1273
|
if error_trace is not None:
|
|
@@ -1105,7 +1280,12 @@ class SecurityClient(NamespacedClient):
|
|
|
1105
1280
|
__query["pretty"] = pretty
|
|
1106
1281
|
__headers = {"accept": "application/json"}
|
|
1107
1282
|
return await self.perform_request( # type: ignore[return-value]
|
|
1108
|
-
"GET",
|
|
1283
|
+
"GET",
|
|
1284
|
+
__path,
|
|
1285
|
+
params=__query,
|
|
1286
|
+
headers=__headers,
|
|
1287
|
+
endpoint_id="security.get_role",
|
|
1288
|
+
path_parts=__path_parts,
|
|
1109
1289
|
)
|
|
1110
1290
|
|
|
1111
1291
|
@_rewrite_parameters()
|
|
@@ -1121,7 +1301,7 @@ class SecurityClient(NamespacedClient):
|
|
|
1121
1301
|
"""
|
|
1122
1302
|
Retrieves role mappings.
|
|
1123
1303
|
|
|
1124
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1304
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-get-role-mapping.html>`_
|
|
1125
1305
|
|
|
1126
1306
|
:param name: The distinct name that identifies the role mapping. The name is
|
|
1127
1307
|
used solely as an identifier to facilitate interaction via the API; it does
|
|
@@ -1129,9 +1309,12 @@ class SecurityClient(NamespacedClient):
|
|
|
1129
1309
|
mapping names as a comma-separated list. If you do not specify this parameter,
|
|
1130
1310
|
the API returns information about all role mappings.
|
|
1131
1311
|
"""
|
|
1312
|
+
__path_parts: t.Dict[str, str]
|
|
1132
1313
|
if name not in SKIP_IN_PATH:
|
|
1133
|
-
|
|
1314
|
+
__path_parts = {"name": _quote(name)}
|
|
1315
|
+
__path = f'/_security/role_mapping/{__path_parts["name"]}'
|
|
1134
1316
|
else:
|
|
1317
|
+
__path_parts = {}
|
|
1135
1318
|
__path = "/_security/role_mapping"
|
|
1136
1319
|
__query: t.Dict[str, t.Any] = {}
|
|
1137
1320
|
if error_trace is not None:
|
|
@@ -1144,7 +1327,12 @@ class SecurityClient(NamespacedClient):
|
|
|
1144
1327
|
__query["pretty"] = pretty
|
|
1145
1328
|
__headers = {"accept": "application/json"}
|
|
1146
1329
|
return await self.perform_request( # type: ignore[return-value]
|
|
1147
|
-
"GET",
|
|
1330
|
+
"GET",
|
|
1331
|
+
__path,
|
|
1332
|
+
params=__query,
|
|
1333
|
+
headers=__headers,
|
|
1334
|
+
endpoint_id="security.get_role_mapping",
|
|
1335
|
+
path_parts=__path_parts,
|
|
1148
1336
|
)
|
|
1149
1337
|
|
|
1150
1338
|
@_rewrite_parameters()
|
|
@@ -1161,7 +1349,7 @@ class SecurityClient(NamespacedClient):
|
|
|
1161
1349
|
"""
|
|
1162
1350
|
Retrieves information about service accounts.
|
|
1163
1351
|
|
|
1164
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1352
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-get-service-accounts.html>`_
|
|
1165
1353
|
|
|
1166
1354
|
:param namespace: Name of the namespace. Omit this parameter to retrieve information
|
|
1167
1355
|
about all service accounts. If you omit this parameter, you must also omit
|
|
@@ -1169,11 +1357,15 @@ class SecurityClient(NamespacedClient):
|
|
|
1169
1357
|
:param service: Name of the service name. Omit this parameter to retrieve information
|
|
1170
1358
|
about all service accounts that belong to the specified `namespace`.
|
|
1171
1359
|
"""
|
|
1360
|
+
__path_parts: t.Dict[str, str]
|
|
1172
1361
|
if namespace not in SKIP_IN_PATH and service not in SKIP_IN_PATH:
|
|
1173
|
-
|
|
1362
|
+
__path_parts = {"namespace": _quote(namespace), "service": _quote(service)}
|
|
1363
|
+
__path = f'/_security/service/{__path_parts["namespace"]}/{__path_parts["service"]}'
|
|
1174
1364
|
elif namespace not in SKIP_IN_PATH:
|
|
1175
|
-
|
|
1365
|
+
__path_parts = {"namespace": _quote(namespace)}
|
|
1366
|
+
__path = f'/_security/service/{__path_parts["namespace"]}'
|
|
1176
1367
|
else:
|
|
1368
|
+
__path_parts = {}
|
|
1177
1369
|
__path = "/_security/service"
|
|
1178
1370
|
__query: t.Dict[str, t.Any] = {}
|
|
1179
1371
|
if error_trace is not None:
|
|
@@ -1186,7 +1378,12 @@ class SecurityClient(NamespacedClient):
|
|
|
1186
1378
|
__query["pretty"] = pretty
|
|
1187
1379
|
__headers = {"accept": "application/json"}
|
|
1188
1380
|
return await self.perform_request( # type: ignore[return-value]
|
|
1189
|
-
"GET",
|
|
1381
|
+
"GET",
|
|
1382
|
+
__path,
|
|
1383
|
+
params=__query,
|
|
1384
|
+
headers=__headers,
|
|
1385
|
+
endpoint_id="security.get_service_accounts",
|
|
1386
|
+
path_parts=__path_parts,
|
|
1190
1387
|
)
|
|
1191
1388
|
|
|
1192
1389
|
@_rewrite_parameters()
|
|
@@ -1203,7 +1400,7 @@ class SecurityClient(NamespacedClient):
|
|
|
1203
1400
|
"""
|
|
1204
1401
|
Retrieves information of all service credentials for a service account.
|
|
1205
1402
|
|
|
1206
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1403
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-get-service-credentials.html>`_
|
|
1207
1404
|
|
|
1208
1405
|
:param namespace: Name of the namespace.
|
|
1209
1406
|
:param service: Name of the service name.
|
|
@@ -1212,7 +1409,11 @@ class SecurityClient(NamespacedClient):
|
|
|
1212
1409
|
raise ValueError("Empty value passed for parameter 'namespace'")
|
|
1213
1410
|
if service in SKIP_IN_PATH:
|
|
1214
1411
|
raise ValueError("Empty value passed for parameter 'service'")
|
|
1215
|
-
|
|
1412
|
+
__path_parts: t.Dict[str, str] = {
|
|
1413
|
+
"namespace": _quote(namespace),
|
|
1414
|
+
"service": _quote(service),
|
|
1415
|
+
}
|
|
1416
|
+
__path = f'/_security/service/{__path_parts["namespace"]}/{__path_parts["service"]}/credential'
|
|
1216
1417
|
__query: t.Dict[str, t.Any] = {}
|
|
1217
1418
|
if error_trace is not None:
|
|
1218
1419
|
__query["error_trace"] = error_trace
|
|
@@ -1224,7 +1425,12 @@ class SecurityClient(NamespacedClient):
|
|
|
1224
1425
|
__query["pretty"] = pretty
|
|
1225
1426
|
__headers = {"accept": "application/json"}
|
|
1226
1427
|
return await self.perform_request( # type: ignore[return-value]
|
|
1227
|
-
"GET",
|
|
1428
|
+
"GET",
|
|
1429
|
+
__path,
|
|
1430
|
+
params=__query,
|
|
1431
|
+
headers=__headers,
|
|
1432
|
+
endpoint_id="security.get_service_credentials",
|
|
1433
|
+
path_parts=__path_parts,
|
|
1228
1434
|
)
|
|
1229
1435
|
|
|
1230
1436
|
@_rewrite_parameters(
|
|
@@ -1260,7 +1466,7 @@ class SecurityClient(NamespacedClient):
|
|
|
1260
1466
|
"""
|
|
1261
1467
|
Creates a bearer token for access without requiring basic authentication.
|
|
1262
1468
|
|
|
1263
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1469
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-get-token.html>`_
|
|
1264
1470
|
|
|
1265
1471
|
:param grant_type:
|
|
1266
1472
|
:param kerberos_ticket:
|
|
@@ -1269,6 +1475,7 @@ class SecurityClient(NamespacedClient):
|
|
|
1269
1475
|
:param scope:
|
|
1270
1476
|
:param username:
|
|
1271
1477
|
"""
|
|
1478
|
+
__path_parts: t.Dict[str, str] = {}
|
|
1272
1479
|
__path = "/_security/oauth2/token"
|
|
1273
1480
|
__query: t.Dict[str, t.Any] = {}
|
|
1274
1481
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
@@ -1295,7 +1502,13 @@ class SecurityClient(NamespacedClient):
|
|
|
1295
1502
|
__body["username"] = username
|
|
1296
1503
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
1297
1504
|
return await self.perform_request( # type: ignore[return-value]
|
|
1298
|
-
"POST",
|
|
1505
|
+
"POST",
|
|
1506
|
+
__path,
|
|
1507
|
+
params=__query,
|
|
1508
|
+
headers=__headers,
|
|
1509
|
+
body=__body,
|
|
1510
|
+
endpoint_id="security.get_token",
|
|
1511
|
+
path_parts=__path_parts,
|
|
1299
1512
|
)
|
|
1300
1513
|
|
|
1301
1514
|
@_rewrite_parameters()
|
|
@@ -1312,7 +1525,7 @@ class SecurityClient(NamespacedClient):
|
|
|
1312
1525
|
"""
|
|
1313
1526
|
Retrieves information about users in the native realm and built-in users.
|
|
1314
1527
|
|
|
1315
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1528
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-get-user.html>`_
|
|
1316
1529
|
|
|
1317
1530
|
:param username: An identifier for the user. You can specify multiple usernames
|
|
1318
1531
|
as a comma-separated list. If you omit this parameter, the API retrieves
|
|
@@ -1320,9 +1533,12 @@ class SecurityClient(NamespacedClient):
|
|
|
1320
1533
|
:param with_profile_uid: If true will return the User Profile ID for a user,
|
|
1321
1534
|
if any.
|
|
1322
1535
|
"""
|
|
1536
|
+
__path_parts: t.Dict[str, str]
|
|
1323
1537
|
if username not in SKIP_IN_PATH:
|
|
1324
|
-
|
|
1538
|
+
__path_parts = {"username": _quote(username)}
|
|
1539
|
+
__path = f'/_security/user/{__path_parts["username"]}'
|
|
1325
1540
|
else:
|
|
1541
|
+
__path_parts = {}
|
|
1326
1542
|
__path = "/_security/user"
|
|
1327
1543
|
__query: t.Dict[str, t.Any] = {}
|
|
1328
1544
|
if error_trace is not None:
|
|
@@ -1337,7 +1553,12 @@ class SecurityClient(NamespacedClient):
|
|
|
1337
1553
|
__query["with_profile_uid"] = with_profile_uid
|
|
1338
1554
|
__headers = {"accept": "application/json"}
|
|
1339
1555
|
return await self.perform_request( # type: ignore[return-value]
|
|
1340
|
-
"GET",
|
|
1556
|
+
"GET",
|
|
1557
|
+
__path,
|
|
1558
|
+
params=__query,
|
|
1559
|
+
headers=__headers,
|
|
1560
|
+
endpoint_id="security.get_user",
|
|
1561
|
+
path_parts=__path_parts,
|
|
1341
1562
|
)
|
|
1342
1563
|
|
|
1343
1564
|
@_rewrite_parameters()
|
|
@@ -1355,7 +1576,7 @@ class SecurityClient(NamespacedClient):
|
|
|
1355
1576
|
"""
|
|
1356
1577
|
Retrieves security privileges for the logged in user.
|
|
1357
1578
|
|
|
1358
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1579
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-get-user-privileges.html>`_
|
|
1359
1580
|
|
|
1360
1581
|
:param application: The name of the application. Application privileges are always
|
|
1361
1582
|
associated with exactly one application. If you do not specify this parameter,
|
|
@@ -1364,6 +1585,7 @@ class SecurityClient(NamespacedClient):
|
|
|
1364
1585
|
the API returns information about all privileges for the requested application.
|
|
1365
1586
|
:param username:
|
|
1366
1587
|
"""
|
|
1588
|
+
__path_parts: t.Dict[str, str] = {}
|
|
1367
1589
|
__path = "/_security/user/_privileges"
|
|
1368
1590
|
__query: t.Dict[str, t.Any] = {}
|
|
1369
1591
|
if application is not None:
|
|
@@ -1382,7 +1604,12 @@ class SecurityClient(NamespacedClient):
|
|
|
1382
1604
|
__query["username"] = username
|
|
1383
1605
|
__headers = {"accept": "application/json"}
|
|
1384
1606
|
return await self.perform_request( # type: ignore[return-value]
|
|
1385
|
-
"GET",
|
|
1607
|
+
"GET",
|
|
1608
|
+
__path,
|
|
1609
|
+
params=__query,
|
|
1610
|
+
headers=__headers,
|
|
1611
|
+
endpoint_id="security.get_user_privileges",
|
|
1612
|
+
path_parts=__path_parts,
|
|
1386
1613
|
)
|
|
1387
1614
|
|
|
1388
1615
|
@_rewrite_parameters()
|
|
@@ -1399,7 +1626,7 @@ class SecurityClient(NamespacedClient):
|
|
|
1399
1626
|
"""
|
|
1400
1627
|
Retrieves user profiles for the given unique ID(s).
|
|
1401
1628
|
|
|
1402
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1629
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-get-user-profile.html>`_
|
|
1403
1630
|
|
|
1404
1631
|
:param uid: A unique identifier for the user profile.
|
|
1405
1632
|
:param data: List of filters for the `data` field of the profile document. To
|
|
@@ -1409,7 +1636,8 @@ class SecurityClient(NamespacedClient):
|
|
|
1409
1636
|
"""
|
|
1410
1637
|
if uid in SKIP_IN_PATH:
|
|
1411
1638
|
raise ValueError("Empty value passed for parameter 'uid'")
|
|
1412
|
-
|
|
1639
|
+
__path_parts: t.Dict[str, str] = {"uid": _quote(uid)}
|
|
1640
|
+
__path = f'/_security/profile/{__path_parts["uid"]}'
|
|
1413
1641
|
__query: t.Dict[str, t.Any] = {}
|
|
1414
1642
|
if data is not None:
|
|
1415
1643
|
__query["data"] = data
|
|
@@ -1423,7 +1651,12 @@ class SecurityClient(NamespacedClient):
|
|
|
1423
1651
|
__query["pretty"] = pretty
|
|
1424
1652
|
__headers = {"accept": "application/json"}
|
|
1425
1653
|
return await self.perform_request( # type: ignore[return-value]
|
|
1426
|
-
"GET",
|
|
1654
|
+
"GET",
|
|
1655
|
+
__path,
|
|
1656
|
+
params=__query,
|
|
1657
|
+
headers=__headers,
|
|
1658
|
+
endpoint_id="security.get_user_profile",
|
|
1659
|
+
path_parts=__path_parts,
|
|
1427
1660
|
)
|
|
1428
1661
|
|
|
1429
1662
|
@_rewrite_parameters(
|
|
@@ -1457,7 +1690,7 @@ class SecurityClient(NamespacedClient):
|
|
|
1457
1690
|
"""
|
|
1458
1691
|
Creates an API key on behalf of another user.
|
|
1459
1692
|
|
|
1460
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1693
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-grant-api-key.html>`_
|
|
1461
1694
|
|
|
1462
1695
|
:param api_key: Defines the API key.
|
|
1463
1696
|
:param grant_type: The type of grant. Supported grant types are: `access_token`,
|
|
@@ -1476,6 +1709,7 @@ class SecurityClient(NamespacedClient):
|
|
|
1476
1709
|
raise ValueError("Empty value passed for parameter 'api_key'")
|
|
1477
1710
|
if grant_type is None and body is None:
|
|
1478
1711
|
raise ValueError("Empty value passed for parameter 'grant_type'")
|
|
1712
|
+
__path_parts: t.Dict[str, str] = {}
|
|
1479
1713
|
__path = "/_security/api_key/grant"
|
|
1480
1714
|
__query: t.Dict[str, t.Any] = {}
|
|
1481
1715
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
@@ -1502,7 +1736,13 @@ class SecurityClient(NamespacedClient):
|
|
|
1502
1736
|
__body["username"] = username
|
|
1503
1737
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
1504
1738
|
return await self.perform_request( # type: ignore[return-value]
|
|
1505
|
-
"POST",
|
|
1739
|
+
"POST",
|
|
1740
|
+
__path,
|
|
1741
|
+
params=__query,
|
|
1742
|
+
headers=__headers,
|
|
1743
|
+
body=__body,
|
|
1744
|
+
endpoint_id="security.grant_api_key",
|
|
1745
|
+
path_parts=__path_parts,
|
|
1506
1746
|
)
|
|
1507
1747
|
|
|
1508
1748
|
@_rewrite_parameters(
|
|
@@ -1516,7 +1756,7 @@ class SecurityClient(NamespacedClient):
|
|
|
1516
1756
|
cluster: t.Optional[
|
|
1517
1757
|
t.Sequence[
|
|
1518
1758
|
t.Union[
|
|
1519
|
-
"t.Literal['all', 'cancel_task', 'create_snapshot', 'grant_api_key', 'manage', 'manage_api_key', 'manage_ccr', 'manage_enrich', 'manage_ilm', 'manage_index_templates', 'manage_ingest_pipelines', 'manage_logstash_pipelines', 'manage_ml', 'manage_oidc', 'manage_own_api_key', 'manage_pipeline', 'manage_rollup', 'manage_saml', 'manage_security', 'manage_service_account', 'manage_slm', 'manage_token', 'manage_transform', 'manage_user_profile', 'manage_watcher', 'monitor', 'monitor_ml', 'monitor_rollup', 'monitor_snapshot', 'monitor_text_structure', 'monitor_transform', 'monitor_watcher', 'read_ccr', 'read_ilm', 'read_pipeline', 'read_slm', 'transport_client']",
|
|
1759
|
+
"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_enrich', 'manage_ilm', 'manage_index_templates', '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_enrich', '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']",
|
|
1520
1760
|
str,
|
|
1521
1761
|
]
|
|
1522
1762
|
]
|
|
@@ -1531,16 +1771,19 @@ class SecurityClient(NamespacedClient):
|
|
|
1531
1771
|
"""
|
|
1532
1772
|
Determines whether the specified user has a specified list of privileges.
|
|
1533
1773
|
|
|
1534
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1774
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-has-privileges.html>`_
|
|
1535
1775
|
|
|
1536
1776
|
:param user: Username
|
|
1537
1777
|
:param application:
|
|
1538
1778
|
:param cluster: A list of the cluster privileges that you want to check.
|
|
1539
1779
|
:param index:
|
|
1540
1780
|
"""
|
|
1781
|
+
__path_parts: t.Dict[str, str]
|
|
1541
1782
|
if user not in SKIP_IN_PATH:
|
|
1542
|
-
|
|
1783
|
+
__path_parts = {"user": _quote(user)}
|
|
1784
|
+
__path = f'/_security/user/{__path_parts["user"]}/_has_privileges'
|
|
1543
1785
|
else:
|
|
1786
|
+
__path_parts = {}
|
|
1544
1787
|
__path = "/_security/user/_has_privileges"
|
|
1545
1788
|
__query: t.Dict[str, t.Any] = {}
|
|
1546
1789
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
@@ -1561,7 +1804,13 @@ class SecurityClient(NamespacedClient):
|
|
|
1561
1804
|
__body["index"] = index
|
|
1562
1805
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
1563
1806
|
return await self.perform_request( # type: ignore[return-value]
|
|
1564
|
-
"POST",
|
|
1807
|
+
"POST",
|
|
1808
|
+
__path,
|
|
1809
|
+
params=__query,
|
|
1810
|
+
headers=__headers,
|
|
1811
|
+
body=__body,
|
|
1812
|
+
endpoint_id="security.has_privileges",
|
|
1813
|
+
path_parts=__path_parts,
|
|
1565
1814
|
)
|
|
1566
1815
|
|
|
1567
1816
|
@_rewrite_parameters(
|
|
@@ -1582,7 +1831,7 @@ class SecurityClient(NamespacedClient):
|
|
|
1582
1831
|
Determines whether the users associated with the specified profile IDs have all
|
|
1583
1832
|
the requested privileges.
|
|
1584
1833
|
|
|
1585
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1834
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-has-privileges-user-profile.html>`_
|
|
1586
1835
|
|
|
1587
1836
|
:param privileges:
|
|
1588
1837
|
:param uids: A list of profile IDs. The privileges are checked for associated
|
|
@@ -1592,6 +1841,7 @@ class SecurityClient(NamespacedClient):
|
|
|
1592
1841
|
raise ValueError("Empty value passed for parameter 'privileges'")
|
|
1593
1842
|
if uids is None and body is None:
|
|
1594
1843
|
raise ValueError("Empty value passed for parameter 'uids'")
|
|
1844
|
+
__path_parts: t.Dict[str, str] = {}
|
|
1595
1845
|
__path = "/_security/profile/_has_privileges"
|
|
1596
1846
|
__query: t.Dict[str, t.Any] = {}
|
|
1597
1847
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
@@ -1610,7 +1860,13 @@ class SecurityClient(NamespacedClient):
|
|
|
1610
1860
|
__body["uids"] = uids
|
|
1611
1861
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
1612
1862
|
return await self.perform_request( # type: ignore[return-value]
|
|
1613
|
-
"POST",
|
|
1863
|
+
"POST",
|
|
1864
|
+
__path,
|
|
1865
|
+
params=__query,
|
|
1866
|
+
headers=__headers,
|
|
1867
|
+
body=__body,
|
|
1868
|
+
endpoint_id="security.has_privileges_user_profile",
|
|
1869
|
+
path_parts=__path_parts,
|
|
1614
1870
|
)
|
|
1615
1871
|
|
|
1616
1872
|
@_rewrite_parameters(
|
|
@@ -1634,7 +1890,7 @@ class SecurityClient(NamespacedClient):
|
|
|
1634
1890
|
"""
|
|
1635
1891
|
Invalidates one or more API keys.
|
|
1636
1892
|
|
|
1637
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1893
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-invalidate-api-key.html>`_
|
|
1638
1894
|
|
|
1639
1895
|
:param id:
|
|
1640
1896
|
:param ids: A list of API key ids. This parameter cannot be used with any of
|
|
@@ -1650,6 +1906,7 @@ class SecurityClient(NamespacedClient):
|
|
|
1650
1906
|
:param username: The username of a user. This parameter cannot be used with either
|
|
1651
1907
|
`ids` or `name`, or when `owner` flag is set to `true`.
|
|
1652
1908
|
"""
|
|
1909
|
+
__path_parts: t.Dict[str, str] = {}
|
|
1653
1910
|
__path = "/_security/api_key"
|
|
1654
1911
|
__query: t.Dict[str, t.Any] = {}
|
|
1655
1912
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
@@ -1676,7 +1933,13 @@ class SecurityClient(NamespacedClient):
|
|
|
1676
1933
|
__body["username"] = username
|
|
1677
1934
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
1678
1935
|
return await self.perform_request( # type: ignore[return-value]
|
|
1679
|
-
"DELETE",
|
|
1936
|
+
"DELETE",
|
|
1937
|
+
__path,
|
|
1938
|
+
params=__query,
|
|
1939
|
+
headers=__headers,
|
|
1940
|
+
body=__body,
|
|
1941
|
+
endpoint_id="security.invalidate_api_key",
|
|
1942
|
+
path_parts=__path_parts,
|
|
1680
1943
|
)
|
|
1681
1944
|
|
|
1682
1945
|
@_rewrite_parameters(
|
|
@@ -1698,13 +1961,14 @@ class SecurityClient(NamespacedClient):
|
|
|
1698
1961
|
"""
|
|
1699
1962
|
Invalidates one or more access tokens or refresh tokens.
|
|
1700
1963
|
|
|
1701
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1964
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-invalidate-token.html>`_
|
|
1702
1965
|
|
|
1703
1966
|
:param realm_name:
|
|
1704
1967
|
:param refresh_token:
|
|
1705
1968
|
:param token:
|
|
1706
1969
|
:param username:
|
|
1707
1970
|
"""
|
|
1971
|
+
__path_parts: t.Dict[str, str] = {}
|
|
1708
1972
|
__path = "/_security/oauth2/token"
|
|
1709
1973
|
__query: t.Dict[str, t.Any] = {}
|
|
1710
1974
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
@@ -1727,7 +1991,13 @@ class SecurityClient(NamespacedClient):
|
|
|
1727
1991
|
__body["username"] = username
|
|
1728
1992
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
1729
1993
|
return await self.perform_request( # type: ignore[return-value]
|
|
1730
|
-
"DELETE",
|
|
1994
|
+
"DELETE",
|
|
1995
|
+
__path,
|
|
1996
|
+
params=__query,
|
|
1997
|
+
headers=__headers,
|
|
1998
|
+
body=__body,
|
|
1999
|
+
endpoint_id="security.invalidate_token",
|
|
2000
|
+
path_parts=__path_parts,
|
|
1731
2001
|
)
|
|
1732
2002
|
|
|
1733
2003
|
@_rewrite_parameters(
|
|
@@ -1751,7 +2021,7 @@ class SecurityClient(NamespacedClient):
|
|
|
1751
2021
|
"""
|
|
1752
2022
|
Adds or updates application privileges.
|
|
1753
2023
|
|
|
1754
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2024
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-put-privileges.html>`_
|
|
1755
2025
|
|
|
1756
2026
|
:param privileges:
|
|
1757
2027
|
:param refresh: If `true` (the default) then refresh the affected shards to make
|
|
@@ -1764,6 +2034,7 @@ class SecurityClient(NamespacedClient):
|
|
|
1764
2034
|
)
|
|
1765
2035
|
elif privileges is not None and body is not None:
|
|
1766
2036
|
raise ValueError("Cannot set both 'privileges' and 'body'")
|
|
2037
|
+
__path_parts: t.Dict[str, str] = {}
|
|
1767
2038
|
__path = "/_security/privilege"
|
|
1768
2039
|
__query: t.Dict[str, t.Any] = {}
|
|
1769
2040
|
if error_trace is not None:
|
|
@@ -1779,7 +2050,13 @@ class SecurityClient(NamespacedClient):
|
|
|
1779
2050
|
__body = privileges if privileges is not None else body
|
|
1780
2051
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
1781
2052
|
return await self.perform_request( # type: ignore[return-value]
|
|
1782
|
-
"PUT",
|
|
2053
|
+
"PUT",
|
|
2054
|
+
__path,
|
|
2055
|
+
params=__query,
|
|
2056
|
+
headers=__headers,
|
|
2057
|
+
body=__body,
|
|
2058
|
+
endpoint_id="security.put_privileges",
|
|
2059
|
+
path_parts=__path_parts,
|
|
1783
2060
|
)
|
|
1784
2061
|
|
|
1785
2062
|
@_rewrite_parameters(
|
|
@@ -1802,7 +2079,7 @@ class SecurityClient(NamespacedClient):
|
|
|
1802
2079
|
cluster: t.Optional[
|
|
1803
2080
|
t.Sequence[
|
|
1804
2081
|
t.Union[
|
|
1805
|
-
"t.Literal['all', 'cancel_task', 'create_snapshot', 'grant_api_key', 'manage', 'manage_api_key', 'manage_ccr', 'manage_enrich', 'manage_ilm', 'manage_index_templates', 'manage_ingest_pipelines', 'manage_logstash_pipelines', 'manage_ml', 'manage_oidc', 'manage_own_api_key', 'manage_pipeline', 'manage_rollup', 'manage_saml', 'manage_security', 'manage_service_account', 'manage_slm', 'manage_token', 'manage_transform', 'manage_user_profile', 'manage_watcher', 'monitor', 'monitor_ml', 'monitor_rollup', 'monitor_snapshot', 'monitor_text_structure', 'monitor_transform', 'monitor_watcher', 'read_ccr', 'read_ilm', 'read_pipeline', 'read_slm', 'transport_client']",
|
|
2082
|
+
"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_enrich', 'manage_ilm', 'manage_index_templates', '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_enrich', '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']",
|
|
1806
2083
|
str,
|
|
1807
2084
|
]
|
|
1808
2085
|
]
|
|
@@ -1824,7 +2101,7 @@ class SecurityClient(NamespacedClient):
|
|
|
1824
2101
|
"""
|
|
1825
2102
|
Adds and updates roles in the native realm.
|
|
1826
2103
|
|
|
1827
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2104
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-put-role.html>`_
|
|
1828
2105
|
|
|
1829
2106
|
:param name: The name of the role.
|
|
1830
2107
|
:param applications: A list of application privilege entries.
|
|
@@ -1849,7 +2126,8 @@ class SecurityClient(NamespacedClient):
|
|
|
1849
2126
|
"""
|
|
1850
2127
|
if name in SKIP_IN_PATH:
|
|
1851
2128
|
raise ValueError("Empty value passed for parameter 'name'")
|
|
1852
|
-
|
|
2129
|
+
__path_parts: t.Dict[str, str] = {"name": _quote(name)}
|
|
2130
|
+
__path = f'/_security/role/{__path_parts["name"]}'
|
|
1853
2131
|
__query: t.Dict[str, t.Any] = {}
|
|
1854
2132
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
1855
2133
|
if error_trace is not None:
|
|
@@ -1879,7 +2157,13 @@ class SecurityClient(NamespacedClient):
|
|
|
1879
2157
|
__body["transient_metadata"] = transient_metadata
|
|
1880
2158
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
1881
2159
|
return await self.perform_request( # type: ignore[return-value]
|
|
1882
|
-
"PUT",
|
|
2160
|
+
"PUT",
|
|
2161
|
+
__path,
|
|
2162
|
+
params=__query,
|
|
2163
|
+
headers=__headers,
|
|
2164
|
+
body=__body,
|
|
2165
|
+
endpoint_id="security.put_role",
|
|
2166
|
+
path_parts=__path_parts,
|
|
1883
2167
|
)
|
|
1884
2168
|
|
|
1885
2169
|
@_rewrite_parameters(
|
|
@@ -1914,7 +2198,7 @@ class SecurityClient(NamespacedClient):
|
|
|
1914
2198
|
"""
|
|
1915
2199
|
Creates and updates role mappings.
|
|
1916
2200
|
|
|
1917
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2201
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-put-role-mapping.html>`_
|
|
1918
2202
|
|
|
1919
2203
|
:param name: Role-mapping name
|
|
1920
2204
|
:param enabled:
|
|
@@ -1929,7 +2213,8 @@ class SecurityClient(NamespacedClient):
|
|
|
1929
2213
|
"""
|
|
1930
2214
|
if name in SKIP_IN_PATH:
|
|
1931
2215
|
raise ValueError("Empty value passed for parameter 'name'")
|
|
1932
|
-
|
|
2216
|
+
__path_parts: t.Dict[str, str] = {"name": _quote(name)}
|
|
2217
|
+
__path = f'/_security/role_mapping/{__path_parts["name"]}'
|
|
1933
2218
|
__query: t.Dict[str, t.Any] = {}
|
|
1934
2219
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
1935
2220
|
if error_trace is not None:
|
|
@@ -1957,7 +2242,13 @@ class SecurityClient(NamespacedClient):
|
|
|
1957
2242
|
__body["run_as"] = run_as
|
|
1958
2243
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
1959
2244
|
return await self.perform_request( # type: ignore[return-value]
|
|
1960
|
-
"PUT",
|
|
2245
|
+
"PUT",
|
|
2246
|
+
__path,
|
|
2247
|
+
params=__query,
|
|
2248
|
+
headers=__headers,
|
|
2249
|
+
body=__body,
|
|
2250
|
+
endpoint_id="security.put_role_mapping",
|
|
2251
|
+
path_parts=__path_parts,
|
|
1961
2252
|
)
|
|
1962
2253
|
|
|
1963
2254
|
@_rewrite_parameters(
|
|
@@ -1995,7 +2286,7 @@ class SecurityClient(NamespacedClient):
|
|
|
1995
2286
|
Adds and updates users in the native realm. These users are commonly referred
|
|
1996
2287
|
to as native users.
|
|
1997
2288
|
|
|
1998
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2289
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-put-user.html>`_
|
|
1999
2290
|
|
|
2000
2291
|
:param username: The username of the User
|
|
2001
2292
|
:param email:
|
|
@@ -2011,7 +2302,8 @@ class SecurityClient(NamespacedClient):
|
|
|
2011
2302
|
"""
|
|
2012
2303
|
if username in SKIP_IN_PATH:
|
|
2013
2304
|
raise ValueError("Empty value passed for parameter 'username'")
|
|
2014
|
-
|
|
2305
|
+
__path_parts: t.Dict[str, str] = {"username": _quote(username)}
|
|
2306
|
+
__path = f'/_security/user/{__path_parts["username"]}'
|
|
2015
2307
|
__query: t.Dict[str, t.Any] = {}
|
|
2016
2308
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
2017
2309
|
if error_trace is not None:
|
|
@@ -2041,16 +2333,32 @@ class SecurityClient(NamespacedClient):
|
|
|
2041
2333
|
__body["roles"] = roles
|
|
2042
2334
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
2043
2335
|
return await self.perform_request( # type: ignore[return-value]
|
|
2044
|
-
"PUT",
|
|
2336
|
+
"PUT",
|
|
2337
|
+
__path,
|
|
2338
|
+
params=__query,
|
|
2339
|
+
headers=__headers,
|
|
2340
|
+
body=__body,
|
|
2341
|
+
endpoint_id="security.put_user",
|
|
2342
|
+
path_parts=__path_parts,
|
|
2045
2343
|
)
|
|
2046
2344
|
|
|
2047
2345
|
@_rewrite_parameters(
|
|
2048
|
-
body_fields=(
|
|
2346
|
+
body_fields=(
|
|
2347
|
+
"aggregations",
|
|
2348
|
+
"aggs",
|
|
2349
|
+
"from_",
|
|
2350
|
+
"query",
|
|
2351
|
+
"search_after",
|
|
2352
|
+
"size",
|
|
2353
|
+
"sort",
|
|
2354
|
+
),
|
|
2049
2355
|
parameter_aliases={"from": "from_"},
|
|
2050
2356
|
)
|
|
2051
2357
|
async def query_api_keys(
|
|
2052
2358
|
self,
|
|
2053
2359
|
*,
|
|
2360
|
+
aggregations: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
|
|
2361
|
+
aggs: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
|
|
2054
2362
|
error_trace: t.Optional[bool] = None,
|
|
2055
2363
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
2056
2364
|
from_: t.Optional[int] = None,
|
|
@@ -2067,21 +2375,37 @@ class SecurityClient(NamespacedClient):
|
|
|
2067
2375
|
t.Union[str, t.Mapping[str, t.Any]],
|
|
2068
2376
|
]
|
|
2069
2377
|
] = None,
|
|
2378
|
+
typed_keys: t.Optional[bool] = None,
|
|
2070
2379
|
with_limited_by: t.Optional[bool] = None,
|
|
2071
2380
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
2072
2381
|
) -> ObjectApiResponse[t.Any]:
|
|
2073
2382
|
"""
|
|
2074
2383
|
Retrieves information for API keys using a subset of query DSL
|
|
2075
2384
|
|
|
2076
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2077
|
-
|
|
2385
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-query-api-key.html>`_
|
|
2386
|
+
|
|
2387
|
+
:param aggregations: Any aggregations to run over the corpus of returned API
|
|
2388
|
+
keys. Aggregations and queries work together. Aggregations are computed only
|
|
2389
|
+
on the API keys that match the query. This supports only a subset of aggregation
|
|
2390
|
+
types, namely: `terms`, `range`, `date_range`, `missing`, `cardinality`,
|
|
2391
|
+
`value_count`, `composite`, `filter`, and `filters`. Additionally, aggregations
|
|
2392
|
+
only run over the same subset of fields that query works with.
|
|
2393
|
+
:param aggs: Any aggregations to run over the corpus of returned API keys. Aggregations
|
|
2394
|
+
and queries work together. Aggregations are computed only on the API keys
|
|
2395
|
+
that match the query. This supports only a subset of aggregation types, namely:
|
|
2396
|
+
`terms`, `range`, `date_range`, `missing`, `cardinality`, `value_count`,
|
|
2397
|
+
`composite`, `filter`, and `filters`. Additionally, aggregations only run
|
|
2398
|
+
over the same subset of fields that query works with.
|
|
2078
2399
|
:param from_: Starting document offset. By default, you cannot page through more
|
|
2079
2400
|
than 10,000 hits using the from and size parameters. To page through more
|
|
2080
2401
|
hits, use the `search_after` parameter.
|
|
2081
|
-
:param query: A query to filter which API keys to return.
|
|
2082
|
-
|
|
2083
|
-
`
|
|
2084
|
-
|
|
2402
|
+
:param query: A query to filter which API keys to return. If the query parameter
|
|
2403
|
+
is missing, it is equivalent to a `match_all` query. The query supports a
|
|
2404
|
+
subset of query types, including `match_all`, `bool`, `term`, `terms`, `match`,
|
|
2405
|
+
`ids`, `prefix`, `wildcard`, `exists`, `range`, and `simple_query_string`.
|
|
2406
|
+
You can query the following public information associated with an API key:
|
|
2407
|
+
`id`, `type`, `name`, `creation`, `expiration`, `invalidated`, `invalidation`,
|
|
2408
|
+
`username`, `realm`, and `metadata`.
|
|
2085
2409
|
:param search_after: Search after definition
|
|
2086
2410
|
:param size: The number of hits to return. By default, you cannot page through
|
|
2087
2411
|
more than 10,000 hits using the `from` and `size` parameters. To page through
|
|
@@ -2089,10 +2413,13 @@ class SecurityClient(NamespacedClient):
|
|
|
2089
2413
|
:param sort: Other than `id`, all public fields of an API key are eligible for
|
|
2090
2414
|
sorting. In addition, sort can also be applied to the `_doc` field to sort
|
|
2091
2415
|
by index order.
|
|
2416
|
+
:param typed_keys: Determines whether aggregation names are prefixed by their
|
|
2417
|
+
respective types in the response.
|
|
2092
2418
|
:param with_limited_by: Return the snapshot of the owner user's role descriptors
|
|
2093
2419
|
associated with the API key. An API key's actual permission is the intersection
|
|
2094
2420
|
of its assigned role descriptors and the owner user's role descriptors.
|
|
2095
2421
|
"""
|
|
2422
|
+
__path_parts: t.Dict[str, str] = {}
|
|
2096
2423
|
__path = "/_security/_query/api_key"
|
|
2097
2424
|
__query: t.Dict[str, t.Any] = {}
|
|
2098
2425
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
@@ -2115,9 +2442,15 @@ class SecurityClient(NamespacedClient):
|
|
|
2115
2442
|
__query["human"] = human
|
|
2116
2443
|
if pretty is not None:
|
|
2117
2444
|
__query["pretty"] = pretty
|
|
2445
|
+
if typed_keys is not None:
|
|
2446
|
+
__query["typed_keys"] = typed_keys
|
|
2118
2447
|
if with_limited_by is not None:
|
|
2119
2448
|
__query["with_limited_by"] = with_limited_by
|
|
2120
2449
|
if not __body:
|
|
2450
|
+
if aggregations is not None:
|
|
2451
|
+
__body["aggregations"] = aggregations
|
|
2452
|
+
if aggs is not None:
|
|
2453
|
+
__body["aggs"] = aggs
|
|
2121
2454
|
if from_ is not None:
|
|
2122
2455
|
__body["from"] = from_
|
|
2123
2456
|
if query is not None:
|
|
@@ -2134,7 +2467,13 @@ class SecurityClient(NamespacedClient):
|
|
|
2134
2467
|
if __body is not None:
|
|
2135
2468
|
__headers["content-type"] = "application/json"
|
|
2136
2469
|
return await self.perform_request( # type: ignore[return-value]
|
|
2137
|
-
"POST",
|
|
2470
|
+
"POST",
|
|
2471
|
+
__path,
|
|
2472
|
+
params=__query,
|
|
2473
|
+
headers=__headers,
|
|
2474
|
+
body=__body,
|
|
2475
|
+
endpoint_id="security.query_api_keys",
|
|
2476
|
+
path_parts=__path_parts,
|
|
2138
2477
|
)
|
|
2139
2478
|
|
|
2140
2479
|
@_rewrite_parameters(
|
|
@@ -2156,7 +2495,7 @@ class SecurityClient(NamespacedClient):
|
|
|
2156
2495
|
Exchanges a SAML Response message for an Elasticsearch access token and refresh
|
|
2157
2496
|
token pair
|
|
2158
2497
|
|
|
2159
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2498
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-saml-authenticate.html>`_
|
|
2160
2499
|
|
|
2161
2500
|
:param content: The SAML response as it was sent by the user’s browser, usually
|
|
2162
2501
|
a Base64 encoded XML document.
|
|
@@ -2169,6 +2508,7 @@ class SecurityClient(NamespacedClient):
|
|
|
2169
2508
|
raise ValueError("Empty value passed for parameter 'content'")
|
|
2170
2509
|
if ids is None and body is None:
|
|
2171
2510
|
raise ValueError("Empty value passed for parameter 'ids'")
|
|
2511
|
+
__path_parts: t.Dict[str, str] = {}
|
|
2172
2512
|
__path = "/_security/saml/authenticate"
|
|
2173
2513
|
__query: t.Dict[str, t.Any] = {}
|
|
2174
2514
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
@@ -2189,7 +2529,13 @@ class SecurityClient(NamespacedClient):
|
|
|
2189
2529
|
__body["realm"] = realm
|
|
2190
2530
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
2191
2531
|
return await self.perform_request( # type: ignore[return-value]
|
|
2192
|
-
"POST",
|
|
2532
|
+
"POST",
|
|
2533
|
+
__path,
|
|
2534
|
+
params=__query,
|
|
2535
|
+
headers=__headers,
|
|
2536
|
+
body=__body,
|
|
2537
|
+
endpoint_id="security.saml_authenticate",
|
|
2538
|
+
path_parts=__path_parts,
|
|
2193
2539
|
)
|
|
2194
2540
|
|
|
2195
2541
|
@_rewrite_parameters(
|
|
@@ -2211,7 +2557,7 @@ class SecurityClient(NamespacedClient):
|
|
|
2211
2557
|
"""
|
|
2212
2558
|
Verifies the logout response sent from the SAML IdP
|
|
2213
2559
|
|
|
2214
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2560
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-saml-complete-logout.html>`_
|
|
2215
2561
|
|
|
2216
2562
|
:param ids: A json array with all the valid SAML Request Ids that the caller
|
|
2217
2563
|
of the API has for the current user.
|
|
@@ -2227,6 +2573,7 @@ class SecurityClient(NamespacedClient):
|
|
|
2227
2573
|
raise ValueError("Empty value passed for parameter 'ids'")
|
|
2228
2574
|
if realm is None and body is None:
|
|
2229
2575
|
raise ValueError("Empty value passed for parameter 'realm'")
|
|
2576
|
+
__path_parts: t.Dict[str, str] = {}
|
|
2230
2577
|
__path = "/_security/saml/complete_logout"
|
|
2231
2578
|
__query: t.Dict[str, t.Any] = {}
|
|
2232
2579
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
@@ -2249,7 +2596,13 @@ class SecurityClient(NamespacedClient):
|
|
|
2249
2596
|
__body["query_string"] = query_string
|
|
2250
2597
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
2251
2598
|
return await self.perform_request( # type: ignore[return-value]
|
|
2252
|
-
"POST",
|
|
2599
|
+
"POST",
|
|
2600
|
+
__path,
|
|
2601
|
+
params=__query,
|
|
2602
|
+
headers=__headers,
|
|
2603
|
+
body=__body,
|
|
2604
|
+
endpoint_id="security.saml_complete_logout",
|
|
2605
|
+
path_parts=__path_parts,
|
|
2253
2606
|
)
|
|
2254
2607
|
|
|
2255
2608
|
@_rewrite_parameters(
|
|
@@ -2270,7 +2623,7 @@ class SecurityClient(NamespacedClient):
|
|
|
2270
2623
|
"""
|
|
2271
2624
|
Consumes a SAML LogoutRequest
|
|
2272
2625
|
|
|
2273
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2626
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-saml-invalidate.html>`_
|
|
2274
2627
|
|
|
2275
2628
|
:param query_string: The query part of the URL that the user was redirected to
|
|
2276
2629
|
by the SAML IdP to initiate the Single Logout. This query should include
|
|
@@ -2290,6 +2643,7 @@ class SecurityClient(NamespacedClient):
|
|
|
2290
2643
|
"""
|
|
2291
2644
|
if query_string is None and body is None:
|
|
2292
2645
|
raise ValueError("Empty value passed for parameter 'query_string'")
|
|
2646
|
+
__path_parts: t.Dict[str, str] = {}
|
|
2293
2647
|
__path = "/_security/saml/invalidate"
|
|
2294
2648
|
__query: t.Dict[str, t.Any] = {}
|
|
2295
2649
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
@@ -2310,7 +2664,13 @@ class SecurityClient(NamespacedClient):
|
|
|
2310
2664
|
__body["realm"] = realm
|
|
2311
2665
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
2312
2666
|
return await self.perform_request( # type: ignore[return-value]
|
|
2313
|
-
"POST",
|
|
2667
|
+
"POST",
|
|
2668
|
+
__path,
|
|
2669
|
+
params=__query,
|
|
2670
|
+
headers=__headers,
|
|
2671
|
+
body=__body,
|
|
2672
|
+
endpoint_id="security.saml_invalidate",
|
|
2673
|
+
path_parts=__path_parts,
|
|
2314
2674
|
)
|
|
2315
2675
|
|
|
2316
2676
|
@_rewrite_parameters(
|
|
@@ -2331,7 +2691,7 @@ class SecurityClient(NamespacedClient):
|
|
|
2331
2691
|
Invalidates an access token and a refresh token that were generated via the SAML
|
|
2332
2692
|
Authenticate API
|
|
2333
2693
|
|
|
2334
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2694
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-saml-logout.html>`_
|
|
2335
2695
|
|
|
2336
2696
|
:param token: The access token that was returned as a response to calling the
|
|
2337
2697
|
SAML authenticate API. Alternatively, the most recent token that was received
|
|
@@ -2342,6 +2702,7 @@ class SecurityClient(NamespacedClient):
|
|
|
2342
2702
|
"""
|
|
2343
2703
|
if token is None and body is None:
|
|
2344
2704
|
raise ValueError("Empty value passed for parameter 'token'")
|
|
2705
|
+
__path_parts: t.Dict[str, str] = {}
|
|
2345
2706
|
__path = "/_security/saml/logout"
|
|
2346
2707
|
__query: t.Dict[str, t.Any] = {}
|
|
2347
2708
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
@@ -2360,7 +2721,13 @@ class SecurityClient(NamespacedClient):
|
|
|
2360
2721
|
__body["refresh_token"] = refresh_token
|
|
2361
2722
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
2362
2723
|
return await self.perform_request( # type: ignore[return-value]
|
|
2363
|
-
"POST",
|
|
2724
|
+
"POST",
|
|
2725
|
+
__path,
|
|
2726
|
+
params=__query,
|
|
2727
|
+
headers=__headers,
|
|
2728
|
+
body=__body,
|
|
2729
|
+
endpoint_id="security.saml_logout",
|
|
2730
|
+
path_parts=__path_parts,
|
|
2364
2731
|
)
|
|
2365
2732
|
|
|
2366
2733
|
@_rewrite_parameters(
|
|
@@ -2381,7 +2748,7 @@ class SecurityClient(NamespacedClient):
|
|
|
2381
2748
|
"""
|
|
2382
2749
|
Creates a SAML authentication request
|
|
2383
2750
|
|
|
2384
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2751
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-saml-prepare-authentication.html>`_
|
|
2385
2752
|
|
|
2386
2753
|
:param acs: The Assertion Consumer Service URL that matches the one of the SAML
|
|
2387
2754
|
realms in Elasticsearch. The realm is used to generate the authentication
|
|
@@ -2393,6 +2760,7 @@ class SecurityClient(NamespacedClient):
|
|
|
2393
2760
|
API returns as the RelayState query parameter. If the Authentication Request
|
|
2394
2761
|
is signed, this value is used as part of the signature computation.
|
|
2395
2762
|
"""
|
|
2763
|
+
__path_parts: t.Dict[str, str] = {}
|
|
2396
2764
|
__path = "/_security/saml/prepare"
|
|
2397
2765
|
__query: t.Dict[str, t.Any] = {}
|
|
2398
2766
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
@@ -2413,7 +2781,13 @@ class SecurityClient(NamespacedClient):
|
|
|
2413
2781
|
__body["relay_state"] = relay_state
|
|
2414
2782
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
2415
2783
|
return await self.perform_request( # type: ignore[return-value]
|
|
2416
|
-
"POST",
|
|
2784
|
+
"POST",
|
|
2785
|
+
__path,
|
|
2786
|
+
params=__query,
|
|
2787
|
+
headers=__headers,
|
|
2788
|
+
body=__body,
|
|
2789
|
+
endpoint_id="security.saml_prepare_authentication",
|
|
2790
|
+
path_parts=__path_parts,
|
|
2417
2791
|
)
|
|
2418
2792
|
|
|
2419
2793
|
@_rewrite_parameters()
|
|
@@ -2429,13 +2803,14 @@ class SecurityClient(NamespacedClient):
|
|
|
2429
2803
|
"""
|
|
2430
2804
|
Generates SAML metadata for the Elastic stack SAML 2.0 Service Provider
|
|
2431
2805
|
|
|
2432
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2806
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-saml-sp-metadata.html>`_
|
|
2433
2807
|
|
|
2434
2808
|
:param realm_name: The name of the SAML realm in Elasticsearch.
|
|
2435
2809
|
"""
|
|
2436
2810
|
if realm_name in SKIP_IN_PATH:
|
|
2437
2811
|
raise ValueError("Empty value passed for parameter 'realm_name'")
|
|
2438
|
-
|
|
2812
|
+
__path_parts: t.Dict[str, str] = {"realm_name": _quote(realm_name)}
|
|
2813
|
+
__path = f'/_security/saml/metadata/{__path_parts["realm_name"]}'
|
|
2439
2814
|
__query: t.Dict[str, t.Any] = {}
|
|
2440
2815
|
if error_trace is not None:
|
|
2441
2816
|
__query["error_trace"] = error_trace
|
|
@@ -2447,7 +2822,12 @@ class SecurityClient(NamespacedClient):
|
|
|
2447
2822
|
__query["pretty"] = pretty
|
|
2448
2823
|
__headers = {"accept": "application/json"}
|
|
2449
2824
|
return await self.perform_request( # type: ignore[return-value]
|
|
2450
|
-
"GET",
|
|
2825
|
+
"GET",
|
|
2826
|
+
__path,
|
|
2827
|
+
params=__query,
|
|
2828
|
+
headers=__headers,
|
|
2829
|
+
endpoint_id="security.saml_service_provider_metadata",
|
|
2830
|
+
path_parts=__path_parts,
|
|
2451
2831
|
)
|
|
2452
2832
|
|
|
2453
2833
|
@_rewrite_parameters(
|
|
@@ -2469,7 +2849,7 @@ class SecurityClient(NamespacedClient):
|
|
|
2469
2849
|
"""
|
|
2470
2850
|
Get suggestions for user profiles that match specified search criteria.
|
|
2471
2851
|
|
|
2472
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2852
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-suggest-user-profile.html>`_
|
|
2473
2853
|
|
|
2474
2854
|
:param data: List of filters for the `data` field of the profile document. To
|
|
2475
2855
|
return all content use `data=*`. To return a subset of content use `data=<key>`
|
|
@@ -2483,6 +2863,7 @@ class SecurityClient(NamespacedClient):
|
|
|
2483
2863
|
Name-related fields are the user's `username`, `full_name`, and `email`.
|
|
2484
2864
|
:param size: Number of profiles to return.
|
|
2485
2865
|
"""
|
|
2866
|
+
__path_parts: t.Dict[str, str] = {}
|
|
2486
2867
|
__path = "/_security/profile/_suggest"
|
|
2487
2868
|
__query: t.Dict[str, t.Any] = {}
|
|
2488
2869
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
@@ -2509,7 +2890,13 @@ class SecurityClient(NamespacedClient):
|
|
|
2509
2890
|
if __body is not None:
|
|
2510
2891
|
__headers["content-type"] = "application/json"
|
|
2511
2892
|
return await self.perform_request( # type: ignore[return-value]
|
|
2512
|
-
"POST",
|
|
2893
|
+
"POST",
|
|
2894
|
+
__path,
|
|
2895
|
+
params=__query,
|
|
2896
|
+
headers=__headers,
|
|
2897
|
+
body=__body,
|
|
2898
|
+
endpoint_id="security.suggest_user_profiles",
|
|
2899
|
+
path_parts=__path_parts,
|
|
2513
2900
|
)
|
|
2514
2901
|
|
|
2515
2902
|
@_rewrite_parameters(
|
|
@@ -2531,7 +2918,7 @@ class SecurityClient(NamespacedClient):
|
|
|
2531
2918
|
"""
|
|
2532
2919
|
Updates attributes of an existing API key.
|
|
2533
2920
|
|
|
2534
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2921
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-update-api-key.html>`_
|
|
2535
2922
|
|
|
2536
2923
|
:param id: The ID of the API key to update.
|
|
2537
2924
|
:param expiration: Expiration time for the API key.
|
|
@@ -2549,7 +2936,8 @@ class SecurityClient(NamespacedClient):
|
|
|
2549
2936
|
"""
|
|
2550
2937
|
if id in SKIP_IN_PATH:
|
|
2551
2938
|
raise ValueError("Empty value passed for parameter 'id'")
|
|
2552
|
-
|
|
2939
|
+
__path_parts: t.Dict[str, str] = {"id": _quote(id)}
|
|
2940
|
+
__path = f'/_security/api_key/{__path_parts["id"]}'
|
|
2553
2941
|
__query: t.Dict[str, t.Any] = {}
|
|
2554
2942
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
2555
2943
|
if error_trace is not None:
|
|
@@ -2573,7 +2961,13 @@ class SecurityClient(NamespacedClient):
|
|
|
2573
2961
|
if __body is not None:
|
|
2574
2962
|
__headers["content-type"] = "application/json"
|
|
2575
2963
|
return await self.perform_request( # type: ignore[return-value]
|
|
2576
|
-
"PUT",
|
|
2964
|
+
"PUT",
|
|
2965
|
+
__path,
|
|
2966
|
+
params=__query,
|
|
2967
|
+
headers=__headers,
|
|
2968
|
+
body=__body,
|
|
2969
|
+
endpoint_id="security.update_api_key",
|
|
2970
|
+
path_parts=__path_parts,
|
|
2577
2971
|
)
|
|
2578
2972
|
|
|
2579
2973
|
@_rewrite_parameters(
|
|
@@ -2599,7 +2993,7 @@ class SecurityClient(NamespacedClient):
|
|
|
2599
2993
|
"""
|
|
2600
2994
|
Update application specific data for the user profile of the given unique ID.
|
|
2601
2995
|
|
|
2602
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2996
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-update-user-profile-data.html>`_
|
|
2603
2997
|
|
|
2604
2998
|
:param uid: A unique identifier for the user profile.
|
|
2605
2999
|
:param data: Non-searchable data that you want to associate with the user profile.
|
|
@@ -2616,7 +3010,8 @@ class SecurityClient(NamespacedClient):
|
|
|
2616
3010
|
"""
|
|
2617
3011
|
if uid in SKIP_IN_PATH:
|
|
2618
3012
|
raise ValueError("Empty value passed for parameter 'uid'")
|
|
2619
|
-
|
|
3013
|
+
__path_parts: t.Dict[str, str] = {"uid": _quote(uid)}
|
|
3014
|
+
__path = f'/_security/profile/{__path_parts["uid"]}/_data'
|
|
2620
3015
|
__query: t.Dict[str, t.Any] = {}
|
|
2621
3016
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
2622
3017
|
if error_trace is not None:
|
|
@@ -2640,5 +3035,11 @@ class SecurityClient(NamespacedClient):
|
|
|
2640
3035
|
__body["labels"] = labels
|
|
2641
3036
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
2642
3037
|
return await self.perform_request( # type: ignore[return-value]
|
|
2643
|
-
"PUT",
|
|
3038
|
+
"PUT",
|
|
3039
|
+
__path,
|
|
3040
|
+
params=__query,
|
|
3041
|
+
headers=__headers,
|
|
3042
|
+
body=__body,
|
|
3043
|
+
endpoint_id="security.update_user_profile_data",
|
|
3044
|
+
path_parts=__path_parts,
|
|
2644
3045
|
)
|