@@ -2343,12 +2343,22 @@ async def put_user(
2343
2343
)
2344
2344
2345
2345
@_rewrite_parameters (
2346
- body_fields = ("from_" , "query" , "search_after" , "size" , "sort" ),
2346
+ body_fields = (
2347
+ "aggregations" ,
2348
+ "aggs" ,
2349
+ "from_" ,
2350
+ "query" ,
2351
+ "search_after" ,
2352
+ "size" ,
2353
+ "sort" ,
2354
+ ),
2347
2355
parameter_aliases = {"from" : "from_" },
2348
2356
)
2349
2357
async def query_api_keys (
2350
2358
self ,
2351
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 ,
2352
2362
error_trace : t .Optional [bool ] = None ,
2353
2363
filter_path : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
2354
2364
from_ : t .Optional [int ] = None ,
@@ -2373,13 +2383,28 @@ async def query_api_keys(
2373
2383
2374
2384
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-query-api-key.html>`_
2375
2385
2386
+ :param aggregations: Any aggregations to run over the corpus of returned API
2387
+ keys. Aggregations and queries work together. Aggregations are computed only
2388
+ on the API keys that match the query. This supports only a subset of aggregation
2389
+ types, namely: `terms`, `range`, `date_range`, `missing`, `cardinality`,
2390
+ `value_count`, `composite`, `filter`, and `filters`. Additionally, aggregations
2391
+ only run over the same subset of fields that query works with.
2392
+ :param aggs: Any aggregations to run over the corpus of returned API keys. Aggregations
2393
+ and queries work together. Aggregations are computed only on the API keys
2394
+ that match the query. This supports only a subset of aggregation types, namely:
2395
+ `terms`, `range`, `date_range`, `missing`, `cardinality`, `value_count`,
2396
+ `composite`, `filter`, and `filters`. Additionally, aggregations only run
2397
+ over the same subset of fields that query works with.
2376
2398
:param from_: Starting document offset. By default, you cannot page through more
2377
2399
than 10,000 hits using the from and size parameters. To page through more
2378
2400
hits, use the `search_after` parameter.
2379
- :param query: A query to filter which API keys to return. The query supports
2380
- a subset of query types, including `match_all`, `bool`, `term`, `terms`,
2381
- `ids`, `prefix`, `wildcard`, and `range`. You can query all public information
2382
- associated with an API key.
2401
+ :param query: A query to filter which API keys to return. If the query parameter
2402
+ is missing, it is equivalent to a `match_all` query. The query supports a
2403
+ subset of query types, including `match_all`, `bool`, `term`, `terms`, `match`,
2404
+ `ids`, `prefix`, `wildcard`, `exists`, `range`, and `simple_query_string`.
2405
+ You can query the following public information associated with an API key:
2406
+ `id`, `type`, `name`, `creation`, `expiration`, `invalidated`, `invalidation`,
2407
+ `username`, `realm`, and `metadata`.
2383
2408
:param search_after: Search after definition
2384
2409
:param size: The number of hits to return. By default, you cannot page through
2385
2410
more than 10,000 hits using the `from` and `size` parameters. To page through
@@ -2417,6 +2442,10 @@ async def query_api_keys(
2417
2442
if with_limited_by is not None :
2418
2443
__query ["with_limited_by" ] = with_limited_by
2419
2444
if not __body :
2445
+ if aggregations is not None :
2446
+ __body ["aggregations" ] = aggregations
2447
+ if aggs is not None :
2448
+ __body ["aggs" ] = aggs
2420
2449
if from_ is not None :
2421
2450
__body ["from" ] = from_
2422
2451
if query is not None :
0 commit comments