1.创建对指定索引集合的只读角色(names:* 指所有)
POST /_security/role/read_only
{
"indices": [
{
"names": [
"test-index",
],
"privileges": [
"read"
]
}
]
}
2.创建用户并指定为只读角色
POST /_security/user/test_user
{
"password" : "123456",
"roles" : ["read_only"]
}
标签:只读,read,创建,only,names,test,ES
From: https://www.cnblogs.com/whiteY/p/17198242.html