Skip to main content
POST
Create or update a single Ranger policy

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Body

application/json

Request to create or update a single Ranger policy.

name
string
required

Policy name.

resources
Resources · object
required

Resource definitions keyed by resource type. For example, catalog, schema, table, column, url.

description
string
default:""

Policy description.

policyType
integer
default:0

0=ACCESS, 1=MASKING, 2=ROWFILTER.

policyPriority
integer
default:0

0=NORMAL, 1=OVERRIDE. Controls evaluation order.

isEnabled
boolean
default:true
isAuditEnabled
boolean
default:true
isDenyAllElse
boolean
default:false

If true, Ranger denies any access not explicitly allowed by this policy.

policyItems
RangerPolicyItemModel · object[]

Allow access items.

denyPolicyItems
RangerPolicyItemModel · object[]

Deny access items.

allowExceptions
RangerPolicyItemModel · object[]

Allow exception items.

denyExceptions
RangerPolicyItemModel · object[]

Deny exception items.

rowFilterPolicyItems
RangerRowFilterItemModel · object[]

Row filter items. Supports policyType=2 only.

dataMaskPolicyItems
RangerDataMaskItemModel · object[]

Masking items. Supports policyType=1 only.

policyLabels
string[]

Labels for grouping/filtering policies.

overwrite
boolean
default:false

Defaults to False. If set to False, a name collision returns a 409 error response. Set to True to intentionally update an existing policy of the same name.

Response

Policy updated.

policy_id
integer
required

Ranger policy ID.

policy_name
string
required

Ranger policy name.

status
string
required

'created' or 'updated'.