Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

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
New Member

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
New Member

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