Update Policy

Updates policies or policy types.

The Policy Management APIs provided an abstracted layer on top of entity extraction, categorization and related functionality to allow the definition of policies for the management of information. Classifications can be created to group documents and other objects into collections. Policies enact actions upon documents associated with a collection such as indexing.

Classification involves sorting documents into Collections; all documents in a collection share some common criteria, identified using Conditions.

The collection or collections that a document matches can influence how it is indexed and determine policies that are executed against it.

The Update Policy API allows policy objects to be updated.

Quick Start

To update a policy object you must specify a policy object id, type, and supply additional parameters in additional.

For example:

/1/api/[async|sync]/updatepolicyobjects/v1?id=3&type=policy&description=NewDescription

The id identifies the policy object to be updated.

The following policy object types can be updated:

  • policy. A policy is updated.

  • policy_type. A policy type is updated.

The additional parameter takes a JSON object specifying additional parameters that can be provided for the policy object type.

Policy

An example of the required format for additional JSON for a policy is:

{
    "policy_type_id": 1,
    "priority": 0,
    "details": {
        "fieldActions": [
            {
                "action": "ADD_FIELD_VALUE",
                "name": "FLAGGED",
                "value": "TRUE"
            }
        ],
        "idolIndexAction": "FULL"
    }
}

The policy_type_id field is mandatory, identifying the type of policy being created. Valid values are:

1 – Indexing policy

The priority field is mandatory. It contains the priority of the policy which is used when resolving policy conflicts.

The details field is mandatory. It provides information for the policy being created.

Policy Type

An example of the required format for additional JSON for a policy type is:

{
    "definition": {
        "title": "Indexing Policy Type",
        "description": "An indexing policy.",
        "type": "object",
        "properties": {
            "idolIndexAction": {
                "enum": [
                    "FULL",
                    "NONE"
                ],
                "type": "string"
            },
            "fieldActions": {
                "items": {
                    "properties": {
                        "action": {
                            "description": "The type of action to perform on the field.",
                            "enum": [
                                "ADD_FIELD_VALUE"
                            ],
                            "type": "string"
                        },
                        "name": {
                            "description": "The name of the field to perform the action on.",
                            "minLength": 1,
                            "type": "string"
                        },
                        "value": {
                            "description": "The value to use for the field action.",
                            "type": "string"
                        }
                    },
                    "required": [
                        "name",
                        "action"
                    ],
                    "title": "Field Action",
                    "type": "object"
                },
                "type": "array"
            }
        },
        "required": [
            "idolIndexAction"
        ]
    }
}
Synchronous
https://api.havenondemand.com/1/api/sync/updatepolicyobjects/v1
Asynchronous
https://api.havenondemand.com/1/api/async/updatepolicyobjects/v1
Authentication

This API requires an authentication token to be supplied in the following parameter:

Parameter Description
apikey The API key to use to authenticate the API request.
Parameters

This API accepts the following parameters:

Required
Name Type Description
id
number The ID of the policy object to update.
name
string The new name for the policy object.
type
enum The type of policy object to update.
additional
json Specify a JSON object of additional parameters relevant for the type of policy object being updated.
Optional
Name Type Description
description
string A new description for the policy object. Leave this parameter empty to remove the existing description.
Enumeration Types

This API's parameters use the enumerations described below:

type
The type of policy object to update.
policy Policy
A policy object of type policy.
policy_type Policy Type
A policy object of type policy_type.

This API returns a JSON response that is described by the model below. This single model is presented both as an easy to read abstract definition and as the formal JSON schema.

Asynchronous Use

Additional requests are required to get the result if this API is invoked asynchronously.

You can use /1/job/status/<job-id> to get the status of the job, including results if the job is finished.

You can also use /1/job/result/<job-id>, which waits until the job has finished and then returns the result.

Model
This is an abstract definition of the response that describes each of the properties that might be returned.
Update Policy Response {
additional ( object , optional) A JSON object of additional parameters relevant for the type of policy object.
description ( , optional) The description of the policy object.
id ( number , optional) The ID of the policy object.
name ( string , optional) The name of the policy object.
type ( enum<Type> , optional) The type of policy object.
}
enum<Update Policy Response:Type> {
'policy' , 'policy_type'
}
Model Schema
This is a JSON schema that describes the syntax of the response. See json-schema.org for a complete reference.
{
    "properties": {
        "additional": {
            "type": "object"
        },
        "id": {
            "multipleOf": 1,
            "type": "number"
        },
        "name": {
            "minLength": 1,
            "type": "string"
        },
        "type": {
            "enum": [
                "policy",
                "policy_type"
            ]
        }
    },
    "type": "object"
}


If you would like to provide us with more information then please use the box below:

We will use your submission to help improve our product.