Class CreateCrossClusterApiKeyRequest
- All Implemented Interfaces:
JsonpSerializable
Create an API key of the cross_cluster
type for the API key
based remote cluster access. A cross_cluster
API key cannot be
used to authenticate through the REST interface.
IMPORTANT: To authenticate this request you must use a credential that is not an API key. Even if you use an API key that has the required privilege, the API returns an error.
Cross-cluster API keys are created by the Elasticsearch API key service, which is automatically enabled.
NOTE: Unlike REST API keys, a cross-cluster API key does not capture
permissions of the authenticated user. The API key’s effective permission is
exactly as specified with the access
property.
A successful request returns a JSON structure that contains the API key, its unique ID, and its name. If applicable, it also returns expiration information for the API key in milliseconds.
By default, API keys never expire. You can specify expiration information when you create the API keys.
Cross-cluster API keys can only be updated with the update cross-cluster API key API. Attempting to update them with the update REST API key API or the bulk update REST API keys API will result in an error.
- 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<CreateCrossClusterApiKeyRequest>
Json deserializer forCreateCrossClusterApiKeyRequest
static final Endpoint<CreateCrossClusterApiKeyRequest,
CreateCrossClusterApiKeyResponse, ErrorResponse> Endpoint "security.create_cross_cluster_api_key
". -
Method Summary
Modifier and TypeMethodDescriptionfinal Access
access()
Required - The access to be granted to this API key.final Time
Expiration time for the API key.metadata()
Arbitrary metadata that you want to associate with the API key.final String
name()
Required - Specifies the name for this API key.of
(Function<CreateCrossClusterApiKeyRequest.Builder, ObjectBuilder<CreateCrossClusterApiKeyRequest>> fn) 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
setupCreateCrossClusterApiKeyRequestDeserializer
(ObjectDeserializer<CreateCrossClusterApiKeyRequest.Builder> op) Methods inherited from class co.elastic.clients.elasticsearch._types.RequestBase
toString
-
Field Details
-
_DESERIALIZER
Json deserializer forCreateCrossClusterApiKeyRequest
-
_ENDPOINT
public static final Endpoint<CreateCrossClusterApiKeyRequest,CreateCrossClusterApiKeyResponse, _ENDPOINTErrorResponse> Endpoint "security.create_cross_cluster_api_key
".
-
-
Method Details
-
of
-
access
Required - The access to be granted to this API key. The access is composed of permissions for cross-cluster search and cross-cluster replication. At least one of them must be specified.NOTE: No explicit privileges should be specified for either search or replication access. The creation process automatically converts the access specification to a role descriptor which has relevant privileges assigned accordingly.
API name:
access
-
expiration
Expiration time for the API key. By default, API keys never expire.API name:
expiration
-
metadata
Arbitrary metadata that you want to associate with the API key. It supports nested data structure. Within the metadata object, keys beginning with_
are reserved for system usage.API name:
metadata
-
name
Required - Specifies the name for this API key.API name:
name
-
serialize
Serialize this object to JSON.- Specified by:
serialize
in interfaceJsonpSerializable
-
serializeInternal
-
setupCreateCrossClusterApiKeyRequestDeserializer
protected static void setupCreateCrossClusterApiKeyRequestDeserializer(ObjectDeserializer<CreateCrossClusterApiKeyRequest.Builder> op)
-