Security
Also available as:
PDF
loading table of contents...
Create Policy

API name

Create Policy

Request Type

POST

Request URL

service/public/v2/api/policy

Request Parameters

Application/json

HDFS Example:

{
 "policyName": "HomePolicy",
 "resourceName": "/home,/apps",
 "description": "Home",
 "repositoryName": "hadoopdev",
 "repositoryType": "hdfs",
 "isEnabled": "true",
 "isRecursive": false,
 "isAuditEnabled": true,
 "permMapList": [
 {
 "userList": [
 "john",
 "andrew"
 ],
 "permList": [
 "SELECT",
 "UPDATE"
 ]
 },
 {
 "userList": [
 "hr"
 ],
 "groupList": [
 "admin"
 ],
 "permList": [
 "DROP",
 "ALTER",
 "ADMIN"
 ]
 }
 ]
}

HBase Example:

{
 "policyName": "FinancePolicy",
 "tables": "finance,hr",
 "columnFamilies": "invoices,emps",
 "columns": "amt, emp_id",
 "description": "HBase Policy",
 "repositoryName": "hbasedev",
 "repositoryType": "hbase",
 "isEnabled": "true",
 "isAuditEnabled": true,
 "tableType": "Inclusion",
 "columnType": "Inclusion",
 "permMapList": [
 {
 "userList": [
 "john",
 "andrew"
 ],
 "permList": [
 "Write",
 "Admin"
 ]
 },
 {
 "userList": [
 "hr"
 ],
 "groupList": [
 "admin"
 ],
 "permList": [
 "Read",
 "Write",
 "Admin"
 ]
 }
 ]
}

Hive Example:

{
 "policyName": "FinancePolicy",
 "databases": "finance,hr",
 "tables": "invoices,emps",
 "columns": "amt, emp_id",
 "udfs": "",
 "description": "Hive Policy",
 "repositoryName": "hivedev",
 "repositoryType": "hive",
 "tableType": "Exclusion",
 "columnType": "Inclusion",
 "isEnabled": true,
 "isAuditEnabled": true,
 "permMapList": [
 {
 "userList": [
 "john",
 "andrew"
 ],
 "permList": [
 "Write",
 "Admin"
 ]
 },
 {
 "userList": [
 "hr"
 ],
 "groupList": [
 "admin"
 ],
 "permList": [
 "Read",
 "Write",
 "Admin"
 ]
 }
 ]
}

Knox Example:

{
 "policyName": "Fin Department Policy",
 "description": "Fin policy for Knox",
 "repositoryName": "knoxdev",
 "repositoryType": "Knox",
 "permMapList": [
 {
 "userList": [
 "policymgr_hbase",
 "policymgr_hive"
 ],
 "permList": [
 "Allow"
 ],
 "ipAddress": "192.168.0.1, 192.168.200.90"
 },
 {
 "userList": [
 "policymgr"
 ],
 "groupList": [
 "Grp1",
 "Grp2"
 ],
 "permList": [
 "Allow",
 "Admin"
 ]
 }
 ],
 "topologies": "topo1, topo2, topo3",
 "services": "service1, service2, service3",
 "isEnabled": true,
 "isRecursive": false,
 "isAuditEnabled": true
}

Storm Example:

{
 "policyName": "Marketing Department Policy",
 "description": "Marketing Department policy",
 "repositoryName": "stormdev_updated",
 "repositoryType": "Storm",
 "permMapList": [
 {
 "userList": [
 "policymgr"
 ],
 "permList": [
 "getNimbusConf",
 "getClusterInfo",
 "rebalance"
 ]
 },
 {
 "userList": [
 "policymgr_hbase",
 "policymgr_hive"
 ],
 "permList": [
 "fileDownload",
 "fileUpload"
 ]
 }
 ],
 "topologies": "topo1, topo3",
 "isEnabled": true,
 "isRecursive": false,
 "isAuditEnabled": true
}

Response

200 - Application/json