Working with Policies with ADx REST API
This page provides insight on working with Policy Administration endpoints, used to create and delete policies for ADx. Policy Administration API is synchronous
On this page
Creating Default Type Policy
This request created a Default Type policy matching your specification.
cURL Example
You can use the example below as a template for your request. Adapt the following properties before executing the request:
- SESSION_ID - replace with your session ID
- POLICY_NAME - replace with your policy name
- DEFAULT_TYPE - replace with the name of the default type to be used by this policy
curl --location --request POST 'ADX_HOST/tribefire-services/api/v1/access.adx.admin/v1/policy/default-type?sessionId=SESSION_ID' \
--form 'name=POLICY_NAME' \
--form 'defaultTypeName=DEFAULT_TYPE'
Endpoint Description
Request type | Service description | Endpoint | Request query parameters | Form data | Returns |
---|---|---|---|---|---|
POST | Create Default Type Policy | ADX_HOST/tribefire-services/api/v1/access.adx.admin/v1/policy/default-type | sessionId | name, defaultTypeName | Metadata of the created policy |
Parameters
Parameter | Data type | Description |
---|---|---|
sessionId | string | Session ID returned when you authenticate |
name | string | Created policy name |
defaultType | string | Default type this policy assigns to entries |
Creating Inheritance Policy
This request creates an Inheritance Policy matching your specification.
cURL Example
You can use the example below as a template for your request. Adapt the following properties before executing the request:
- SESSION_ID - replace with your session ID
- POLICY_NAME - replace with your policy name
- Inheritance properties - set to
true
orfalse
in accordance with your business needs (all set totrue
by default)
curl --location --request POST 'ADX_HOST/tribefire-services/api/v1/access.adx.admin/v1/policy/inheritance?sessionId=[SESSION_ID]' \
--form 'name=POLICY_NAME' \
--form 'inheritAcl=true' \
--form 'inheritClassification=true' \
--form 'inheritCommonProperties=true' \
--form 'inheritPolicies=true' \
--form 'inheritTags=true'
Endpoint Description
Request type | Service description | Endpoint | Request query parameters | Form data | Returns |
---|---|---|---|---|---|
POST | Create Inheritance Policy | ADX_HOST/tribefire-services/api/v1/access.adx.admin/v1/policy/inheritance | sessionId | name, inheritAcl, inheritClassification, inheritCommonProperties, inheritPolicies, inheritTags | Metadata of the created policy |
Parameters
Parameter | Data type | Description |
---|---|---|
name | string | Policy name |
inheritAcl | boolean | When true , ACL will be inherited from parent by entries affected by this policy |
inheritClassification | boolean | When true , classifications will be inherited from parent by entries affected by this policy |
inheritCommonProperties | boolean | When true , common properties (between the child and the parent) will be inherited from parent by entries affected by this policy |
inheritPolicies | boolean | When true , policies will be inherited from parent by entries affected by this policy |
inheritTags | boolean | When true , tags will be inherited from parent by entries affected by this policy |
Creating Type Restriction Policy
This request creates a Type Restriction Policy matching your specification.
cURL Example
You can use the example below as a template for your request. Adapt the following properties before executing the request:
curl --location --request POST 'ADX_HOST/tribefire-services/api/v1/access.adx.admin/v1/policy/type-restriction?sessionId=20201002172057753-956e81a9-094f-4d53-853b-21dd6b4488e2' \
--form 'name=RestrictionPolicy' \
--form 'description=' \
--form 'includeSubTypes=true' \
--form 'restrictedTypeNames
=CustomContent'
Endpoint Description
Request type | Service description | Endpoint | Request query parameters | Form data | Returns |
---|---|---|---|---|---|
POST | Create Type Restriction Policy | ADX_HOST/tribefire-services/api/v1/access.adx.admin/v1/policy/type-restriction | sessionId | name, description, allowedTypeNames, deniedTypeNames, includeSubTypes | Metadata of the created policy |
Parameters
Parameter | Data type | Description |
---|---|---|
sessionId | string | Session ID returned after authenticating |
name, | string | Policy name |
description, | string | Policy description |
allowedTypeNames, | array | Array of type names identifying the content/folder types allowed in folders where this policy is in effect |
deniedTypeNames | array | Array of type names identifying the content/folder types denied from folders where this policy is in effect |
includeSubTypes | boolean | When true , the policy is extended to sub-types. When false, only the types explicitly mentioned in allowedTypeNames or deniedTypeNames are affected. |
Deleting Policies
cURL Example
The example below shows how to delete multiple policies by IDs. Replace the following parts of the query:
- [ADX_HOST] - enter your ADx host
- [POLICY_ID_1], [POLICY_ID_2] - enter policy IDs to identify the policies to be deleted
- [SESSION_ID] - session ID obtained by authenticating
curl -X DELETE "[ADX_HOST]/tribefire-services/api/v1/access.adx.admin/v1/policies?policyIds=[POLICY_ID_1]&policyIds=[POLICY_ID_2]" -H "accept: application/json"
Note that deleting by technical names is also possible. ADx provides endpoints for deleting a batch of policies (as in the example above) as well as for deleting single policies (check the endpoint descriptions below).
Endpoints
Request type | Service description | Endpoint | Request query parameters | Form data | Returns |
---|---|---|---|---|---|
DELETE | Delete Policies By Ids | ADX_HOST/tribefire-services/api/v1/access.adx.admin/v1/policies | sessionId, policyIds | none | Job response quoting the duration of execution |
DELETE | Delete Policies By Technical Names | ADX_HOST/tribefire-services/api/v1/access.adx.admin/v1/policies/by-technical-names | sessionId, technicalNames (deletes all custom policies if empty!) | none | Job response quoting the duration of execution |
DELETE | Delete Policy By Id | ADX_HOST/tribefire-services/api/v1/access.adx.admin/v1/policy | sessionId, policyId | none | Job response quoting the duration of execution |
DELETE | Delete Policy By Technical Name | ADX_HOST/tribefire-services/api/v1/access.adx.admin/v1/policy/by-technical-name | sessionId, technicalName | none | Job response quoting the duration of execution |
UI Equivalent
These operations can also be done in ADx UI. For details, check Configuring Policies.