A group must belong to a domain and one domain only. A group can contain one or many (member, child) group, and a group can belong to one or many (memberof, parent) groups. In other words, the relationship between groups are many-many.
Attributes
Attribute |
type |
values |
default |
mandate |
comment |
name |
string |
|
|
true |
|
description |
string |
|
|
false |
|
|
|
|
|
|
|
domain |
object |
|
|
true |
the parent domain |
parents |
coll |
|
|
false |
the parent groups |
members |
coll |
|
|
false |
the member groups |
users |
coll |
|
|
false |
the member users |
policies |
coll |
|
|
false |
assigned policies |
roles |
coll |
|
|
false |
assigned roles |
hasMembers |
boolean |
|
|
|
|
radiusProfile |
object |
|
|
|
|
radiusAttributes |
coll |
|
|
|
|
/group/create
To create a new group, we must specify the name of the group and its parent: either a domain or a group. On success, the method always returns the internal group id of the newly created group.
Parameters:
{
"attrs":{list of attribute value pairs}
}
Response:
{
"error":0,
"result":{"id":the id of the newly created group}
}
Examples:
Method:/group/create
Parameters:
{
"attrs":
{
"name":"sales",
"description":"sales dept.",
"domain.id":2
}
}
Response: {"error":0, "result":{"id":1}}
/group/search
Examples:
Search groups in the entire domain
Method:/group/search
Parameters:
{
"match":
[
[domain.id", "=", 1]
],
"return":["name", "id"],
"sort":"name",
"order":"asc",
"max": 20,
"offset": 0
}
Response:
{
"error":0,
"result":
[
{
"name":"sales",
"id":1,
},
{
...
}
]
}
/group/get
Method:/group/get
Example:
- Get member/child groups of a specific group (hasMember)
Parameters:
{
"match":
[
[id", "=", 1]
],
"return":[ {"members": [{elements:["name", "id"]}]}],
}
Response:
{
"error":0,
"result":
{
"members":
{
elements:
[
{
"name":"sales - london",
"id":2
},
{
...
}
]
}
}
}
- Get parent groups of a specific group (memberOf)
Parameters:
{
"match":
[
[id", "=", 9],
],
"return":[{"parents":[{elements:["id","name"]}]}]
}
Response:
{
"error":0,
"result":
{
"parents":
{
elements:
[
{
"name":"sales",
"id":1
},
{
"name":"sales - london",
"id":2
},
{
...
}
]
}
}
}
/group/set
Method:/group/set
Parameters:
{
"id":1,
"attrs":{"description":"new description"}
}
Response:
{
"error":0
}
/group/delete
Method:/group/delete
Parameters:
{
"id":1
}
Response:
{
"error":0
}
/group/join
Parameters:
{
"child":{"id":1},
"parent":{"id":2},
"action":"join | unjoin"
}
Response:
{
"error":0
}
/group/deployTokens
Method:/group/deployTokens
Parameters:
{
"attrs":
{
"group.id":group_id,
"product.id":product_id
}
}
Response:
{
"error":0
}
Other methods
- applyPolicy(apply/unapply)
- assignRole(assign/unassign)