Apache Ranger Public REST APIs
Also available as:
PDF

Update Policy by ID

Reference information for the Ranger REST API service/public/v2/api/policy/{id}.

API Name update policy
Request Type PUT
Request URL service/public/v2/api/policy/{id}
Request Params
{
    "id": 8,
    "allowExceptions": [],
    "denyExceptions": [],
    "denyPolicyItems": [
        {
            "accesses": [
                {
                    "isAllowed": true,
                    "type": "drop"
                }
            ],
            "conditions": [],
            "delegateAdmin": true,
            "groups": [],
            "users": [
        "admin"
            ]
        }
    ],
    "description": "Policy for Service: cl1_test",
    "isAuditEnabled": true,
    "isEnabled": true,
    "name": "cl1_test-1",
    "policyItems": [
        {
            "accesses": [
                {
                    "isAllowed": true,
                    "type": "select"
                },
                {
                    "isAllowed": true,
                    "type": "update"
                },
                {
                    "isAllowed": true,
                    "type": "create"
                },
                {
                    "isAllowed": true,
                    "type": "drop"
                }
            ],
            "conditions": [],
            "delegateAdmin": true,
            "groups": ["public"],
            "users": [
            ]
        }
    ],
    "resources": {
        "root": {
            "isExcludes": false,
            "isRecursive": false,
            "values": [
                "abc"
            ]
        },
        "sub": {
            "isExcludes": false,
            "isRecursive": false,
            "values": [
                "*"
            ]
        }
    },
    "service": "cl1_test",
    "version": 1
}
Response
{
    "allowExceptions": [],
    "createTime": 1451350456000,
    "createdBy": "Admin",
    "denyExceptions": [],
    "denyPolicyItems": [
        {
            "accesses": [
                {
                    "isAllowed": true,
                    "type": "drop"
                }
            ],
            "conditions": [],
            "delegateAdmin": true,
            "groups": [],
            "users": [
                "admin"
            ]
        }
    ],
    "description": "Policy for Service: cl1_test",
    "guid": "ff0b3c4a-6aa0-4803-9314-17f3b8950482",
    "id": 8,
    "isAuditEnabled": true,
    "isEnabled": true,
    "name": "cl1_test-1",
    "policyItems": [
        {
            "accesses": [
                {
                    "isAllowed": true,
                    "type": "select"
                },
                {
                    "isAllowed": true,
                    "type": "update"
                },
                {
                    "isAllowed": true,
                    "type": "create"
                },
                {
                    "isAllowed": true,
                    "type": "drop"
                }
            ],
            "conditions": [],
            "delegateAdmin": true,
            "groups": [
                "public"
            ],
            "users": []
        }
    ],
    "resourceSignature": "8a2fac99ba72c687defacff39d6354fb",
    "resources": {
        "root": {
            "isExcludes": false,
            "isRecursive": false,
            "values": [
                "abc"
            ]
        },
        "sub": {
            "isExcludes": false,
            "isRecursive": false,
            "values": [
                "*"
            ]
        }
    },
    "service": "cl1_test",
    "updateTime": 1451955041580,
    "updatedBy": "Admin",
    "version": 3
}