Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

API Name

Search Policies in a Service

API Name

Search Policies in a Service

Request Type

GET

Request URL

service/public/v2/api/service/{service-name}/policy

Request Params

Query Parameters:

pageSize int The page size required

startIndex int The start record index

serviceType string Name of the component (such as "hbase", "hdfs", etc)

serviceTypeId int Id of the component (such as 2 for "hbase", 1 for "hdfs", etc)

serviceName string The exact name of the service

serviceId int Id of the service

policyName string The exact Name of the policy

policyNamePartial string Partial name of the policy

policyId int The policy ID

policyType int Type of policy (0 - access, 1 - data-mask, 2 - row-filter)

polResource string The policy resource value. It may appear at any level (e.g. in hbase policy, as table, column-family or column value)

resource:resource-type string The policy resource value for given resource-type (e.g. for hive policy, database, udf, table or column)

user string The user name

group string The group name

isRecursive boolean The isRecursive property ("true" or "false")

isEnabled boolean The enable/disabled property ("true" or "false")

Example =

pageSize=25&startIndex=0&resource:database=finance

Response

200 - Application/json

Example:

 

Code Block
languagejs
collapsetrue
[
    {
        "allowExceptions": [],
        "createTime": 1450757992000,
        "createdBy": "amb_ranger_admin",
        "denyExceptions": [],
	    "dataMaskPolicyItems": [],
	    "rowFilterPolicyItems": [],
        "denyPolicyItems": [],
        "description": "Default Policy for Service: cl1_hive",
        "guid": "4a322a05-c17f-4d6c-b291-94cae3e6c353",
        "id": 3,
        "isAuditEnabled": true,
        "isEnabled": true,
        "name": "cl1_hive-1-20151222041951",
        "policyItems": [
            {
                "accesses": [
                    {
                        "isAllowed": true,
                        "type": "select"
                    },
                    {
                        "isAllowed": true,
                        "type": "update"
                    },
                    {
                        "isAllowed": true,
                        "type": "create"
                    },
                    {
                        "isAllowed": true,
                        "type": "drop"
                    },
                    {
                        "isAllowed": true,
                        "type": "alter"
                    },
                    {
                        "isAllowed": true,
                        "type": "index"
                    },
                    {
                        "isAllowed": true,
                        "type": "lock"
                    },
                    {
                        "isAllowed": true,
                        "type": "all"
                    }
                ],
                "conditions": [],
                "delegateAdmin": true,
                "groups": [],
                "users": [
                    "ambari-qa"
                ]
            }
        ],
        "resourceSignature": "6e79c1c989c79b7e53af663d3bdc2de6",
        "resources": {
            "column": {
                "isExcludes": false,
                "isRecursive": false,
                "values": [
                    "*"
                ]
            },
            "database": {
                "isExcludes": false,
                "isRecursive": false,
                "values": [
                    "finance*"
                ]
            },
            "table": {
                "isExcludes": false,
                "isRecursive": false,
                "values": [
                    "*"
                ]
            }
        },
        "service": "cl1_hive",
        "updateTime": 1450757994000,
        "updatedBy": "amb_ranger_admin",
        "version": 2
    },
    {
        "allowExceptions": [],
        "createTime": 1450757992000,
        "createdBy": "amb_ranger_admin",
        "denyExceptions": [],
        "denyPolicyItems": [],
	    "dataMaskPolicyItems": [],
	    "rowFilterPolicyItems": [],
        "description": "Default Policy for Service: cl1_hive",
        "guid": "d6218120-1b66-43e6-9fef-9c917a8e9e25",
        "id": 4,
        "isAuditEnabled": true,
        "isEnabled": true,
        "name": "cl1_hive-2-20151222041952",
        "policyItems": [
            {
                "accesses": [
                    {
                        "isAllowed": true,
                        "type": "select"
                    },
                    {
                        "isAllowed": true,
                        "type": "update"
                    },
                    {
                        "isAllowed": true,
                        "type": "create"
                    },
                    {
                        "isAllowed": true,
                        "type": "drop"
                    },
                    {
                        "isAllowed": true,
                        "type": "alter"
                    },
                    {
                        "isAllowed": true,
                        "type": "index"
                    },
                    {
                        "isAllowed": true,
                        "type": "lock"
                    },
                    {
                        "isAllowed": true,
                        "type": "all"
                    }
                ],
                "conditions": [],
                "delegateAdmin": true,
                "groups": [],
                "users": [
                    "ambari-qa"
                ]
            }
        ],
        "resourceSignature": "c834ed2b8c7462d2aa8bbffdb05226c8",
        "resources": {
            "database": {
                "isExcludes": false,
                "isRecursive": false,
                "values": [
                    "finance"
                ]
            },
            "udf": {
                "isExcludes": false,
                "isRecursive": false,
                "values": [
                    "*"
                ]
            }
        },
        "service": "cl1_hive",
        "updateTime": 1450757995000,
        "updatedBy": "amb_ranger_admin",
        "version": 2
    }
]