curl -u abcd:abcd1234 -XPOST 10.10.200.84:9201/_security/role/readIndex -H 'Content-Type: application/json' -d '{ "run_as": [ "watcher_user" ], "cluster": [ "monitor" ], "indices": [ { "names": [ "index*" ], "privileges": [ "read" ] } ]}'
curl -u abcd:abcd1234 -XPOST 10.10.200.84:9201/_security/user/readIndex -H 'Content-Type: application/json' -d '{ "password" : "readIndex1234", "roles" : [ "readIndex" ]}'
curl -u abcd:abcd1234 -XPOST 10.10.200.84:9201/_security/role/writeIndex -H 'Content-Type: application/json' -d '{ "run_as": [ "watcher_user" ], "cluster": [ "monitor" ], "indices": [ { "names": [ "index*" ], "privileges": [ "write" ] } ]}'
curl -u abcd:abcd1234 -XPOST 10.10.200.84:9201/_security/user/writeIndex -H 'Content-Type: application/json' -d '{ "password" : "writeIndex1234", "roles" : [ "writeIndex" ]}'
curl -u abcd:abcd1234 -XPOST 10.10.200.84:9201/_security/role/monitorIndex -H 'Content-Type: application/json' -d '{ "run_as": [ "watcher_user" ], "cluster": [ "monitor" ], "indices": [ { "names": [ "index*" ], "privileges": [ "monitor" ] } ]}'
curl -u abcd:abcd1234 -XPOST 10.10.200.84:9201/_security/user/monitorIndex -H 'Content-Type: application/json' -d '{ "password" : "monitorIndex1234", "roles" : [ "monitorIndex" ]}'
curl -u abcd:abcd1234 -XPOST 10.10.200.84:9201/_security/role/manageIndex -H 'Content-Type: application/json' -d '{ "run_as": [ "watcher_user" ], "cluster": [ "monitor" ], "indices": [ { "names": [ "index*" ], "privileges": [ "manage" ] } ]}'
curl -u abcd:abcd1234 -XPOST 10.10.200.84:9201/_security/user/manageIndex -H 'Content-Type: application/json' -d '{ "password" : "manageIndex1234", "roles" : [ "manageIndex" ]}'
curl -u abcd:abcd1234 -XPOST 10.10.200.84:9201/_security/role/createIndex -H 'Content-Type: application/json' -d '{ "run_as": [ "watcher_user" ], "cluster": [ "monitor" ], "indices": [ { "names": [ "index*" ], "privileges": [ "create_index" ] } ]}'
curl -u abcd:abcd1234 -XPOST 10.10.200.84:9201/_security/user/createIndex -H 'Content-Type: application/json' -d '{ "password" : "createIndex1234", "roles" : [ "createIndex" ]}'
curl -u abcd:abcd1234 -XPUT 10.10.200.84:9201/index4 -H 'Content-Type: application/json' -d '{ "settings": { "index": { "number_of_shards": 3, "number_of_replicas": 2 } }}'
curl -u readIndex:readIndex1234 -XPUT 10.10.200.84:9201/index5 -H 'Content-Type: application/json' -d '{ "settings": { "index": { "number_of_shards": 3, "number_of_replicas": 2 } }}'
{"error":{"root_cause":[{"type":"security_exception","reason":"action [indices:admin/create] is unauthorized for user [readIndex]"}],"type":"security_exception","reason":"action [indices:admin/create] is unauthorized for user [readIndex]"},"status":403}
curl -u writeIndex:writeIndex1234 -XPUT 10.10.200.84:9201/index5 -H 'Content-Type: application/json' -d '{ "settings": { "index": { "number_of_shards": 3, "number_of_replicas": 2 } }}'
{"error":{"root_cause":[{"type":"security_exception","reason":"action [indices:admin/create] is unauthorized for user [writeIndex]"}],"type":"security_exception","reason":"action [indices:admin/create] is unauthorized for user [writeIndex]"},"status":403}
curl -u monitorIndex:monitorIndex1234 -XPUT 10.10.200.84:9201/index5 -H 'Content-Type: application/json' -d '{ "settings": { "index": { "number_of_shards": 3, "number_of_replicas": 2 } }}'
{"error":{"root_cause":[{"type":"security_exception","reason":"action [indices:admin/create] is unauthorized for user [monitorIndex]"}],"type":"security_exception","reason":"action [indices:admin/create] is unauthorized for user [monitorIndex]"},"status":403}
curl -u manageIndex:manageIndex1234 -XPUT 10.10.200.84:9201/index5 -H 'Content-Type: application/json' -d '{ "settings": { "index": { "number_of_shards": 3, "number_of_replicas": 2 } }}'
{"acknowledged":true,"shards_acknowledged":true,"index":"index5"}
curl -u manageIndex:manageIndex1234 -XPUT 10.10.200.84:9201/test1 -H 'Content-Type: application/json' -d '{ "settings": { "index": { "number_of_shards": 3, "number_of_replicas": 2 } }}'
{"error":{"root_cause":[{"type":"security_exception","reason":"action [indices:admin/create] is unauthorized for user [manageIndex]"}],"type":"security_exception","reason":"action [indices:admin/create] is unauthorized for user [manageIndex]"},"status":403}
curl -u createIndex:createIndex1234 -XPUT 10.10.200.84:9201/index6 -H 'Content-Type: application/json' -d '{ "settings": { "index": { "number_of_shards": 3, "number_of_replicas": 2 } }}'
{"acknowledged":true,"shards_acknowledged":true,"index":"index6"}
curl -u createIndex:createIndex1234 -XPUT 10.10.200.84:9201/test -H 'Content-Type: application/json' -d '{ "settings": { "index": { "number_of_shards": 3, "number_of_replicas": 2 } }}'
{"error":{"root_cause":[{"type":"security_exception","reason":"action [indices:admin/create] is unauthorized for user [createIndex]"}],"type":"security_exception","reason":"action [indices:admin/create] is unauthorized for user [createIndex]"},"status":403}