There is not an API for bulk creation of users or roles.
We've looked at it, but decided it doesn't really help for a few reasons
It's not needed for performance (see below)
Bulk APIs have tricky semantics around reporting success/failure
Having multiple APIs for the same end result can be confusing.
What you need to do is split the response up per-role and sent that to the PUT /_security/role API.
You can improve performance by passing refresh=false as an HTTP parameter. Without that ES Security will force each user/role to be refreshed individually which is unnecessary if you're trying to load a bunch of them.
Note: We don't have a simple way to migrate passwords for users. You can do it by directly querying the .security index to get the password hash, but I'd recommend that the simplest path is for you to give each user a new password and then ask them to change it afterwards.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.