Class QueryApiKeysRequest
- All Implemented Interfaces:
JsonpSerializable
Get a paginated list of API keys and their information. You can optionally filter the results with a query.
To use this API, you must have at least the manage_own_api_key
or the read_security
cluster privileges. If you have only the
manage_own_api_key
privilege, this API returns only the API keys
that you own. If you have the read_security
,
manage_api_key
, or greater privileges (including
manage_security
), this API returns all API keys regardless of
ownership.
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class co.elastic.clients.elasticsearch._types.RequestBase
RequestBase.AbstractBuilder<BuilderT extends RequestBase.AbstractBuilder<BuilderT>>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final JsonpDeserializer<QueryApiKeysRequest>
Json deserializer forQueryApiKeysRequest
static final Endpoint<QueryApiKeysRequest,
QueryApiKeysResponse, ErrorResponse> Endpoint "security.query_api_keys
". -
Method Summary
Modifier and TypeMethodDescriptionfinal Map<String,
ApiKeyAggregation> Any aggregations to run over the corpus of returned API keys.final Integer
from()
The starting document offset.static QueryApiKeysRequest
final ApiKeyQuery
query()
A query to filter which API keys to return.final List<FieldValue>
The search after definition.void
serialize
(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) Serialize this object to JSON.protected void
serializeInternal
(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) protected static void
final Integer
size()
The number of hits to return.final List<SortOptions>
sort()
The sort definition.final Boolean
Return the snapshot of the owner user's role descriptors associated with the API key.final Boolean
Determines whether to also retrieve the profile UID for the API key owner principal.Methods inherited from class co.elastic.clients.elasticsearch._types.RequestBase
toString
-
Field Details
-
_DESERIALIZER
Json deserializer forQueryApiKeysRequest
-
_ENDPOINT
Endpoint "security.query_api_keys
".
-
-
Method Details
-
of
public static QueryApiKeysRequest of(Function<QueryApiKeysRequest.Builder, ObjectBuilder<QueryApiKeysRequest>> fn) -
aggregations
Any aggregations to run over the corpus of returned API keys. Aggregations and queries work together. Aggregations are computed only on the API keys that match the query. This supports only a subset of aggregation types, namely:terms
,range
,date_range
,missing
,cardinality
,value_count
,composite
,filter
, andfilters
. Additionally, aggregations only run over the same subset of fields that query works with.API name:
aggregations
-
from
The starting document offset. It must not be negative. By default, you cannot page through more than 10,000 hits using thefrom
andsize
parameters. To page through more hits, use thesearch_after
parameter.API name:
from
-
query
A query to filter which API keys to return. If the query parameter is missing, it is equivalent to amatch_all
query. The query supports a subset of query types, includingmatch_all
,bool
,term
,terms
,match
,ids
,prefix
,wildcard
,exists
,range
, andsimple_query_string
. You can query the following public information associated with an API key:id
,type
,name
,creation
,expiration
,invalidated
,invalidation
,username
,realm
, andmetadata
.NOTE: The queryable string values associated with API keys are internally mapped as keywords. Consequently, if no
analyzer
parameter is specified for amatch
query, then the provided match query string is interpreted as a single keyword value. Such a match query is hence equivalent to aterm
query.API name:
query
-
searchAfter
The search after definition.API name:
search_after
-
size
The number of hits to return. It must not be negative. Thesize
parameter can be set to0
, in which case no API key matches are returned, only the aggregation results. By default, you cannot page through more than 10,000 hits using thefrom
andsize
parameters. To page through more hits, use thesearch_after
parameter.API name:
size
-
sort
The sort definition. Other thanid
, all public fields of an API key are eligible for sorting. In addition, sort can also be applied to the_doc
field to sort by index order.API name:
sort
-
withLimitedBy
Return the snapshot of the owner user's role descriptors associated with the API key. An API key's actual permission is the intersection of its assigned role descriptors and the owner user's role descriptors (effectively limited by it). An API key cannot retrieve any API key’s limited-by role descriptors (including itself) unless it hasmanage_api_key
or higher privileges.API name:
with_limited_by
-
withProfileUid
Determines whether to also retrieve the profile UID for the API key owner principal. If it exists, the profile UID is returned under theprofile_uid
response field for each API key.API name:
with_profile_uid
-
serialize
Serialize this object to JSON.- Specified by:
serialize
in interfaceJsonpSerializable
-
serializeInternal
-
setupQueryApiKeysRequestDeserializer
protected static void setupQueryApiKeysRequestDeserializer(ObjectDeserializer<QueryApiKeysRequest.Builder> op)
-