Pivotal Knowledge Base

Follow

How to import Ranger policies

Environment

Product Version
Pivotal HD 3.x
Ranger 0.4,0.5

Purpose

After exporting a Ranger policy in preparation for a migration or upgrade, it will be necessary to import the policy into Ranger. This article explains how to import a Ranger policy using the Ranger API.

Procedure

In the same way that an API call is used to export the policy, an API call is used to import the policy.

The format of the API call should be as shown here:

curl -iv -u <user>:<password> -H "Content-Type: application/json" -X POST http://<RANGER-Host>:6080/service/public/api/policy/ -d '<policy payload>'

An example is shown below:

curl -iv -u admin:admin -H "Content-Type: application/json" -X POST http://sandbox.hortonworks.com:6080/service/public/api/policy/ -d '{ "policyName": "Test", "resourceName": "/tmp", "description": "Testing", "repositoryName": "Sandbox_hadoop", "repositoryType": "hdfs", "isEnabled": "true", "isRecursive": "true", "isAuditEnabled": "true", "permMapList": [{ "groupList": ["public"], "permList": ["Read","Execute", "Write", "Admin"] 

 

 

 

Comments

Powered by Zendesk