Class PutUserRequest
java.lang.Object
co.elastic.clients.elasticsearch._types.RequestBase
co.elastic.clients.elasticsearch.security.PutUserRequest
- All Implemented Interfaces:
JsonpSerializable
Create or update users.
Add and update users in the native realm. A password is required for adding a new user but is optional when updating an existing user. To change a user's password without updating any other fields, use the change password API.
- 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<PutUserRequest>
Json deserializer forPutUserRequest
static final Endpoint<PutUserRequest,
PutUserResponse, ErrorResponse> Endpoint "security.put_user
". -
Method Summary
Modifier and TypeMethodDescriptionfinal String
email()
The email of the user.final Boolean
enabled()
Specifies whether the user is enabled.final String
fullName()
The full name of the user.metadata()
Arbitrary metadata that you want to associate with the user.static PutUserRequest
final String
password()
The user's password.final String
A hash of the user's password.final Refresh
refresh()
Valid values aretrue
,false
, andwait_for
.roles()
A set of roles the user has.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()
Required - An identifier for the user.Methods inherited from class co.elastic.clients.elasticsearch._types.RequestBase
toString
-
Field Details
-
_DESERIALIZER
Json deserializer forPutUserRequest
-
_ENDPOINT
Endpoint "security.put_user
".
-
-
Method Details
-
of
-
email
The email of the user.API name:
email
-
enabled
Specifies whether the user is enabled.API name:
enabled
-
fullName
The full name of the user.API name:
full_name
-
metadata
Arbitrary metadata that you want to associate with the user.API name:
metadata
-
password
The user's password. Passwords must be at least 6 characters long. When adding a user, one ofpassword
orpassword_hash
is required. When updating an existing user, the password is optional, so that other fields on the user (such as their roles) may be updated without modifying the user's passwordAPI name:
password
-
passwordHash
A hash of the user's password. This must be produced using the same hashing algorithm as has been configured for password storage. For more details, see the explanation of thexpack.security.authc.password_hashing.algorithm
setting in the user cache and password hash algorithm documentation. Using this parameter allows the client to pre-hash the password for performance and/or confidentiality reasons. Thepassword
parameter and thepassword_hash
parameter cannot be used in the same request.API name:
password_hash
-
refresh
Valid values aretrue
,false
, andwait_for
. These values have the same meaning as in the index API, but the default value for this API is true.API name:
refresh
-
roles
A set of roles the user has. The roles determine the user's access permissions. To create a user without any roles, specify an empty list ([]
).API name:
roles
-
username
Required - An identifier for the user.NOTE: Usernames must be at least 1 and no more than 507 characters. They can contain alphanumeric characters (a-z, A-Z, 0-9), spaces, punctuation, and printable symbols in the Basic Latin (ASCII) block. Leading or trailing whitespace is not allowed.
API name:
username
-
serialize
Serialize this object to JSON.- Specified by:
serialize
in interfaceJsonpSerializable
-
serializeInternal
-
setupPutUserRequestDeserializer
protected static void setupPutUserRequestDeserializer(ObjectDeserializer<PutUserRequest.Builder> op)
-