Policies are divided into categories. A policy also has an administrative scope, i.e. domains.
Anchor | ||||
---|---|---|---|---|
|
Attribute | type | values | default | mandate | comment |
name | string | true | |||
description | string | false | |||
category | object | true | |||
default | boolean | true/false | false | false | |
options | coll | true | Policy options | ||
holder | object | Policy holder | |||
domain | object | These attributes are mapped to holder object, you can also use them directly | |||
unit | object | ||||
group | Object | ||||
application | Object | ||||
product | Object | ||||
user | object | ||||
isTemplate | boolean | false | |||
isTopLevel | boolean | false | |||
isProduct | boolean | false |
Option is a dynamic object with the following attributes
- name
- value
Option does not have any method.
Anchor | ||||
---|---|---|---|---|
|
To create a new policy, we must specify the name of the policy, its category and the administrative domain. On success, the method always returns the internal policy id of the newly created policy.
Parameters:
{
"attrs":{list of attribute value pairs}
}
Response:
{
"error":0,
"result":{"id":the id of the newly created policy}
}
Examples:
Method:/policy/create
Parameters:
{
"attrs":
{
"name":"default password policy",
"holder.id":3,
"category":"staticpass",
"options":
{
"minlen":6,
"lefetime":0,
"history":10,
"characters":"N",
"characters":"S"
}
}
}
Response: {"error":0, "result":{"id":1}}
Anchor | ||||
---|---|---|---|---|
|
Wiki Markup |
---|
+Examples:+ Method:/policy/search Parameters: \{ "match": \[ \["includeInherited", "=", false\], \["category.name", "=", "staticpass"\] \], "return":\["name", "id", "holder.id"\], "sort":"id", "order":"asc", "max": 20, "offset": 10 \} Response: \{ "error":0, "result": \[ \{ "id":"1", "name":"default password policy", "holder.id":3 \}, \{ ... \} \] \} |
Anchor | ||||
---|---|---|---|---|
|
Wiki Markup |
---|
Method:/policy/get Parameters: \{ "match": \[ \["id", "=", 2\], \], "return":\["category","name", "id", "domains.id", "options"\], \} Response: \{ "error":0, "result": \{ "id":"1", "name":"default password policy", "domains.id":\[2,3\], "category":"staticpass", "options": \[ "minlen":6, "lefetime":0, "history":10, "characters":"N", "characters":"S" \] \} \} |
Anchor | ||||
---|---|---|---|---|
|
Method:/policy/set
Parameters:
{
"id":1,
"attrs":{list of attributes}
}
Response:
{
"error":0
}
Anchor | ||||
---|---|---|---|---|
|
Method:/policy/delete
Parameters:
{
"id":1
}
Response:
{
"error":0
}