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.
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 |
|
|
|
|
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}}
+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, \}, \{ ... \} \] \} |
Method:/group/get
Example:
Parameters: \{ "match": \[ \[id", "=", 1\] \], "return":\[ \{"members": \[\{elements:\["name", "id"\]\}\]\}\], \} Response: \{ "error":0, "result": \{ "members": \{ elements: \[ \{ "name":"sales - london", "id":2 \}, \{ ... \} \] \} \} \} |
Parameters: \{ "match": \[ \[id", "=", 9\], \], "return":\[\{"parents":\[\{elements:\["id","name"\]\}\]\}\] \} Response: \{ "error":0, "result": \{ "parents": \{ elements: \[ \{ "name":"sales", "id":1 \}, \{ "name":"sales - london", "id":2 \}, \{ ... \} \] \} \} \} |
Method:/group/set
Parameters:
{
"id":1,
"attrs":{"description":"new description"}
}
Response:
{
"error":0
}
Method:/group/delete
Parameters:
{
"id":1
}
Response:
{
"error":0
}
Parameters:
{
"child":{"id":1},
"parent":{"id":2},
"action":"join | unjoin"
}
Response:
{
"error":0
}
Method:/group/deployTokens
Parameters:
{
"attrs":
{
"group.id":group_id,
"product.id":product_id
}
}
Response:
{
"error":0
}
Other methods