Support Questions

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

couldn't find JSON sample for kafka and solr to create ranger policies,Is there REST API for configuring kafka policies in ranger using rest API

avatar
Explorer

I am looking for a sample JSON or example to create ranger policies for kafka and solr using rest API

In this link i am only able to find for other commponents https://cwiki.apache.org/confluence/display/RANGER/REST+APIs+for+Policy+Management

Please share me the link if there is any place where json for kafka and solr are post.

1 ACCEPTED SOLUTION

avatar
@Varma vetukuri

Below is an example to create sample kafka policy in ranger.

curl -iv -k -u <user:password> -H "Content-Type: application/json" -X POST https://<RANGER_HOST>:6182/service/public/v2/api/policy -d '{"allowExceptions": [],"denyExceptions": [],"denyPolicyItems":[],"description": "My first Kafka policy","isAuditEnabled": true,"isEnabled": true,"name": "kafka_policy_1","policyItems": [{"accesses": [{"isAllowed": true,"type": "consume"}],"conditions": [],"delegateAdmin": false,"groups": ["mygroup"],"users": []}],"resources": {"topic": {"isExcludes": false,"isRecursive": false,"values": ["ambari_kafka_service_check"]}},"service": "MYCLUSTER_kafka","version": 1}'

View solution in original post

2 REPLIES 2

avatar
@Varma vetukuri

Below is an example to create sample kafka policy in ranger.

curl -iv -k -u <user:password> -H "Content-Type: application/json" -X POST https://<RANGER_HOST>:6182/service/public/v2/api/policy -d '{"allowExceptions": [],"denyExceptions": [],"denyPolicyItems":[],"description": "My first Kafka policy","isAuditEnabled": true,"isEnabled": true,"name": "kafka_policy_1","policyItems": [{"accesses": [{"isAllowed": true,"type": "consume"}],"conditions": [],"delegateAdmin": false,"groups": ["mygroup"],"users": []}],"resources": {"topic": {"isExcludes": false,"isRecursive": false,"values": ["ambari_kafka_service_check"]}},"service": "MYCLUSTER_kafka","version": 1}'

avatar
Explorer

Thanks, It working. Can you also provide the sample json for creating solr policies in ranger