Created 09-26-2018 04:28 AM
I would like to add 100 users to hive view in Ambari in easier way.
Created 09-26-2018 06:58 AM
Hi @Sai Sankar
Are the users already known to Ambari? If so, you can add a user to a hive view instance using REST.
I just ran this and it worked OK;
curl -u admin:admin -H “Content-Type: application/json” -H "X-Requested-By:ambari" -i -X PUT http://<ambari-server>:8080/api/v1/views/HIVE/versions/2.0.0/instances/AUTO_HIVE20_INSTANCE/privileg... -d @users.json
This is the content of the json file in above example;
{ "PrivilegeInfo": { "permission_name": "VIEW.USER", "principal_name": "someuser", "principal_type": "USER" } }
Created 09-26-2018 10:28 AM
If the users are to be added to Ambari first as well, we would do one prior step to my previous post to first create the user in ambari. Ex;
curl -u admin:admin -H "X-Requested-By: ambari" -X POST -d '{"Users/user_name":"newuser1","Users/password":"newpassw0rd","Users/active":"true","Users/admin":"false"}' http://<ambari-server>:8080/api/v1/users
then follow up with the example from my previous comment, to add the user to the hive view.
Created 09-26-2018 10:17 AM
They are new to Ambari as well. Example : a new team would like to get into Ambari as well as Hive view.
Currently i am doing 1) creating ambari user 2) Assign hive view. This works if users are countable. Now if i would like to do for 100/200 members, what approach should i follow ? @jonathan sneep