Created 01-15-2018 11:18 AM
Hi,
I want to fetch policy details of a particular user using rest api . I do want to get policies and then corresponding users to this , but in reverse way.
curl -u admin:admin -X GET http://<Ranger_hsot>:6080/service/public/api/policy
I have executed above rest api but it details policies and its all information but I wanted to get policy corresponding to user .
Basically if I pass user id or its name then when rest api is executed it should details its corresponding policy.
could some one please refer some rest api to achieve above requirement ?
Created 06-13-2018 10:03 AM
Same question
Created 06-13-2018 12:09 PM
What about search a policy by username:
service/public/api/policy?userName=anurag
HTH
*** If you found this answer addressed your question, please take a moment to login and click the "accept" link on the answer.
Created 06-13-2018 12:21 PM
Best solution , it works. Thank you Anurag.
Created 10-09-2018 05:08 PM
In Apache Ranger 0.6 the path is:
If you want to get the result on a pretty json format you can do:
curl -u admin:admin -XGET $url | python -mjson.tool > output.json
Created 02-07-2022 04:12 AM
To fetch the policy details in Json format. Use the below command :
curl -v -k -u {username} -H "Content-Type: application/json" -H "Accept: application/json" -X GET https://{Ranger_Host}:6182/service/public/v2/api/service/cm_hive/policy/ | python -m json.tool