Policies are divided into categories. A policy also has an administrative scope, i.e. domains.

Attributes

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/Unit/Group,etc)

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.

/policy/create

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}}

/policy/search


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
},
{
...
}
]
}


/policy/get


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"
]
}
}


/policy/set

Method:/policy/set
Parameters:
{
"id":1,
"attrs":{list of attributes}
}
Response:
{
"error":0
}

/policy/delete

Method:/policy/delete
Parameters:
{
"id":1
}
Response:
{
"error":0
}

  • No labels