- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Create Ranger hive policy through REST API
Created ‎07-05-2021 08:57 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi All,
I have a requirement like, I need to create hive policy through REST API in CDP Env with two groups .Here , we are giving permission at group level not at user level.
one group with "ALL" permissions and 2nd group with "select" permission.
I have created policy through REST API with one group with "all" permissions but how to mention 2nd group with "select" permission in same create policy command.
I have tried the below method but did not worked.
CURLURL="https://host:6182/service/public/v2/api/policy/"
CURLDATA='{ "isEnabled":true,"service":"cm_hive","name":"policy_test1","description":"Policy for employees database access","isAuditEnabled":true,"resources":{"database":{"values":["DBNAME"],"isExcludes":false,"isRecursive":false},"table":{"values":["*"],"isExcludes":false,"isRecursive":false}},"policyItems":[{"accesses":[{"type":"ALL","isAllowed":true}],"users":[""],"groups":["GROUP1"],[{"type":"SELECT","isAllowed":true}],"users":[""],"groups":["GROUP2"]"conditions":[],"delegateAdmin":false}],"denyPolicyItems":[],"allowExceptions":[],"denyExceptions":[],"dataMaskPolicyItems":[],"rowFilterPolicyItems":[]}'
RESPONSE=`curl -k -iv -u username:password -H "Content-Type: application/json" -X POST "$CURLURL" -d "$CURLDATA"`
Thanks in advance!
Srini Podili
Created ‎07-05-2021 10:06 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi All,
It worked ,i did mistake .i forgot to add "access" before second group permission.
Thanks
Srinivas
Created ‎07-05-2021 10:06 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi All,
It worked ,i did mistake .i forgot to add "access" before second group permission.
Thanks
Srinivas
