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
usernameandrealm_nameto 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
idsfield.
- 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 forInvalidateApiKeyRequeststatic final Endpoint<InvalidateApiKeyRequest,InvalidateApiKeyResponse, ErrorResponse> Endpoint "security.invalidate_api_key". -
Method Summary
Modifier and TypeMethodDescriptionfinal Stringid()API name:idids()A list of API key ids.final Stringname()An API key name.static InvalidateApiKeyRequestfinal Booleanowner()Query API keys owned by the currently authenticated user.final StringThe name of an authentication realm.voidserialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) Serialize this object to JSON.protected voidserializeInternal(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) protected static voidfinal Stringusername()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_nameorusername.API name:
name -
owner
Query API keys owned by the currently authenticated user. Therealm_nameorusernameparameters cannot be specified when this parameter is set totrueas they are assumed to be the currently authenticated ones.NOTE: At least one of
ids,name,username, andrealm_namemust be specified ifownerisfalse.API name:
owner -
realmName
The name of an authentication realm. This parameter cannot be used with eitheridsorname, or whenownerflag is set totrue.API name:
realm_name -
username
The username of a user. This parameter cannot be used with eitheridsornameor whenownerflag is set totrue.API name:
username -
serialize
Serialize this object to JSON.- Specified by:
serializein interfaceJsonpSerializable
-
serializeInternal
-
setupInvalidateApiKeyRequestDeserializer
protected static void setupInvalidateApiKeyRequestDeserializer(ObjectDeserializer<InvalidateApiKeyRequest.Builder> op)
-