Class InvalidateApiKeyRequest
- All Implemented Interfaces:
JsonpSerializable
This API invalidates API keys created by the create API key or grant API key APIs. Invalidated API keys fail authentication, but they can still be viewed using the get API key information and query API key information APIs, for at least the configured retention period, until they are automatically deleted.
To use this API, you must have at least the manage_security
,
manage_api_key
, or manage_own_api_key
cluster
privileges. The manage_security
privilege allows deleting any
API key, including both REST and cross cluster API keys. The
manage_api_key
privilege allows deleting any REST API key, but
not cross cluster API keys. The manage_own_api_key
only allows
deleting REST API keys that are owned by the user. In addition, with the
manage_own_api_key
privilege, an invalidation request must be
issued in one of the three formats:
- Set the parameter
owner=true
. - Or, set both
username
andrealm_name
to match the user's identity. - Or, if the request is issued by an API key, that is to say an API key
invalidates itself, specify its ID in the
ids
field.
- 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<InvalidateApiKeyRequest>
Json deserializer forInvalidateApiKeyRequest
static final Endpoint<InvalidateApiKeyRequest,
InvalidateApiKeyResponse, ErrorResponse> Endpoint "security.invalidate_api_key
". -
Method Summary
Modifier and TypeMethodDescriptionfinal String
id()
API name:id
ids()
A list of API key ids.final String
name()
An API key name.static InvalidateApiKeyRequest
final Boolean
owner()
Query API keys owned by the currently authenticated user.final String
The name of an authentication realm.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 String
username()
The username of a user.Methods inherited from class co.elastic.clients.elasticsearch._types.RequestBase
toString
-
Field Details
-
_DESERIALIZER
Json deserializer forInvalidateApiKeyRequest
-
_ENDPOINT
public static final Endpoint<InvalidateApiKeyRequest,InvalidateApiKeyResponse, _ENDPOINTErrorResponse> Endpoint "security.invalidate_api_key
".
-
-
Method Details
-
of
public static InvalidateApiKeyRequest of(Function<InvalidateApiKeyRequest.Builder, ObjectBuilder<InvalidateApiKeyRequest>> fn) -
id
API name:id
-
ids
A list of API key ids. This parameter cannot be used with any ofname
,realm_name
, orusername
.API name:
ids
-
name
An API key name. This parameter cannot be used with any ofids
,realm_name
orusername
.API name:
name
-
owner
Query API keys owned by the currently authenticated user. Therealm_name
orusername
parameters cannot be specified when this parameter is set totrue
as they are assumed to be the currently authenticated ones.NOTE: At least one of
ids
,name
,username
, andrealm_name
must be specified ifowner
isfalse
.API name:
owner
-
realmName
The name of an authentication realm. This parameter cannot be used with eitherids
orname
, or whenowner
flag is set totrue
.API name:
realm_name
-
username
The username of a user. This parameter cannot be used with eitherids
orname
or whenowner
flag is set totrue
.API name:
username
-
serialize
Serialize this object to JSON.- Specified by:
serialize
in interfaceJsonpSerializable
-
serializeInternal
-
setupInvalidateApiKeyRequestDeserializer
protected static void setupInvalidateApiKeyRequestDeserializer(ObjectDeserializer<InvalidateApiKeyRequest.Builder> op)
-