Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Is there an easiest way to add 100 new users at a time to Hive view Ambari ?

Highlighted

Is there an easiest way to add 100 new users at a time to Hive view Ambari ?

Contributor

I would like to add 100 users to hive view in Ambari in easier way.

3 REPLIES 3

Re: Is there an easiest way to add 100 new users at a time to Hive view Ambari ?

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"
 }
}

Re: Is there an easiest way to add 100 new users at a time to Hive view Ambari ?

@Sai Sankar

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.

Re: Is there an easiest way to add 100 new users at a time to Hive view Ambari ?

Contributor

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

Don't have an account?
Coming from Hortonworks? Activate your account here