Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Ranger Policies using API

avatar
Super Collaborator

Can anyone guide me link on how to create policies in Ranger using API?

1 ACCEPTED SOLUTION

avatar
Super Guru
@chennuri gouri shankar

Can you check the link which guides you on how to create policies using api -

https://cwiki.apache.org/confluence/display/RANGER/REST+APIs+for+Policy+Management#RESTAPIsforPolicy...

Let me know if that helps.

View solution in original post

10 REPLIES 10

avatar
Super Guru
@chennuri gouri shankar

Can you check the link which guides you on how to create policies using api -

https://cwiki.apache.org/confluence/display/RANGER/REST+APIs+for+Policy+Management#RESTAPIsforPolicy...

Let me know if that helps.

avatar
Super Collaborator

Thanks for the link.

avatar
Contributor

 

Hi,

I have a requirement like, i need to create hive policy with two groups .one group with "ALL" permissions to some "x" user and 2nd group with "select" permission to "y" user.

 

i have created policy through REST APi with one group but with "all" permissions but how to mention 2nd group with "select" permission in same create policy command.

 

Thanks in advance!

 

 

Srini Podili

avatar
Community Manager

Hi @srinivasp, I see that you posted similar concerns in multiple posts. I recommend you create a start a new thread and provide details specific to your environment that could aid others in assisting you with a more accurate answer to your question. 



Regards,

Vidya Sargur,
Community Manager


Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.
Learn more about the Cloudera Community:

avatar
Master Mentor

@chennuri gouri shankar

The following link has the details:

https://cwiki.apache.org/confluence/display/RANGER/REST+APIs+for+Policy+Management

.

Example:

curl -u $RangerAdmin:$Password -X GET http://$RANGERHOST:6080/service/public/api/policy/ 

Above will list the policies then you can navigate to the desired policy make changes/post/delete

avatar
Expert Contributor

@Jay SenSharma It's worth pointing out that unless you're using Ranger 0.4 or below, that API is obsolete. You should be using the v2 API linked to by @mvaradkar:

https://cwiki.apache.org/confluence/display/RANGER/REST+APIs+for+Service+Definition%2C+Service+and+P...

avatar
Master Mentor

@Terry Stebbens

Thank you for sharing the latest v2 API link.

avatar
Contributor

Hi,

what's the maximum number of policies retrieved via curl -iv -u admin:admin -H "Content-type:application/json" -X GET http://xxxx:6080/service/public/api/policy

i get max 200 rules for hive i know for sure thee are more rules..how to get that using ranger api