--- title: Elasticsearch user&role API tags: Elasticsearch description: View the slide with "Slide Mode". --- # Elasticsearch user&role API ## Create User ```htmlmixed= curl -u elastic -X POST "localhost:9200/_security/user/test-user?pretty" -H 'Content-Type: application/json' -d' { "password" : "testpw", "roles" : [ "my_test_role"], "full_name" : "Jack Nicholson_v222222", "email" : "user2@example.com", "metadata" : { "intelligence" : 7 } } ' ``` ## Get Users/ Roles ```htmlmixed= curl -X GET "localhost:9200/_security/role?pretty" -u elastic curl -X GET "localhost:9200/_security/user?pretty" -u elastic ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up