Module org.elasticsearch.xcore
Class CloneApiKeyRequest
java.lang.Object
org.elasticsearch.transport.TransportMessage
org.elasticsearch.transport.AbstractTransportRequest
org.elasticsearch.action.ActionRequest
org.elasticsearch.action.LegacyActionRequest
org.elasticsearch.xpack.core.security.action.apikey.CloneApiKeyRequest
- All Implemented Interfaces:
Writeable,org.elasticsearch.core.RefCounted,TaskAwareRequest,TransportRequest
Request for cloning an existing API key. The source key is identified by its encoded credential
(Base64(id + ":" + secret)). The new key has the same role descriptors as the source, with a new
name, id, and optional expiration and metadata.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
Fields inherited from interface org.elasticsearch.core.RefCounted
ALWAYS_REFERENCED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.elasticsearch.core.TimeValuegetId()getName()Parses the source API key credential into anApiKeyCredentialsinstance.voidsetApiKey(SecureString apiKey) voidsetExpiration(org.elasticsearch.core.TimeValue expiration) voidsetMetadata(Map<String, Object> metadata) voidvoidsetRefreshPolicy(WriteRequest.RefreshPolicy refreshPolicy) validate()voidwriteTo(StreamOutput out) Methods inherited from class org.elasticsearch.action.ActionRequest
getShouldStoreResultMethods inherited from class org.elasticsearch.transport.AbstractTransportRequest
getParentTask, getRequestId, remoteAddress, remoteAddress, setParentTask, setRequestId, toStringMethods inherited from class org.elasticsearch.transport.TransportMessage
decRef, hasReferences, incRef, tryIncRefMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.core.RefCounted
decRef, hasReferences, incRef, mustIncRef, tryIncRefMethods inherited from interface org.elasticsearch.tasks.TaskAwareRequest
createTask, createTask, getDescription, setParentTask
-
Constructor Details
-
CloneApiKeyRequest
public CloneApiKeyRequest() -
CloneApiKeyRequest
- Throws:
IOException
-
-
Method Details
-
writeTo
- Specified by:
writeToin interfaceWriteable- Overrides:
writeToin classActionRequest- Throws:
IOException
-
getApiKey
-
setApiKey
-
getSourceApiKey
Parses the source API key credential into anApiKeyCredentialsinstance. The clone endpoint only supports REST API keys as the source.- Returns:
- the parsed source API key credentials, or
nullif there is no API key - Throws:
IllegalArgumentException- if the api key is null, empty, or not valid (e.g. malformed Base64 or missing colon)
-
getId
-
getName
-
setName
-
getExpiration
@Nullable public org.elasticsearch.core.TimeValue getExpiration() -
setExpiration
public void setExpiration(@Nullable org.elasticsearch.core.TimeValue expiration) -
getMetadata
-
setMetadata
-
getRefreshPolicy
-
setRefreshPolicy
-
validate
- Specified by:
validatein classActionRequest
-