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.
| Anchor | ||||
|---|---|---|---|---|
|
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 |
|
|
|
|
| Anchor | ||||
|---|---|---|---|---|
|
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}}
| Anchor | ||||
|---|---|---|---|---|
|
| Wiki Markup |
|---|
+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,
\},
\{
...
\}
\]
\} |
| Anchor | ||||
|---|---|---|---|---|
|
Method:/group/get
Example:
- Get member/child groups of a specific group (hasMember)
| Wiki Markup |
|---|
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)
| Wiki Markup |
|---|
Parameters:
\{
"match":
\[
\[id", "=", 9\],
\],
"return":\[\{"parents":\[\{elements:\["id","name"\]\}\]\}\]
\}
Response:
\{
"error":0,
"result":
\{
"parents":
\{
elements:
\[
\{
"name":"sales",
"id":1
\},
\{
"name":"sales - london",
"id":2
\},
\{
...
\}
\]
\}
\}
\} |
| Anchor | ||||
|---|---|---|---|---|
|
Method:/group/set
Parameters:
{
"id":1,
"attrs":{"description":"new description"}
}
Response:
{
"error":0
}
| Anchor | ||||
|---|---|---|---|---|
|
Method:/group/delete
Parameters:
{
"id":1
}
Response:
{
"error":0
}
| Anchor | ||||
|---|---|---|---|---|
|
Parameters:
{
"child":{"id":1},
"parent":{"id":2},
"action":"join | unjoin"
}
Response:
{
"error":0
}
| Anchor | ||||
|---|---|---|---|---|
|
Method:/group/deployTokens
Parameters:
{
"attrs":
{
"group.id":group_id,
"product.id":product_id
}
}
Response:
{
"error":0
}
Other methods
- applyPolicy(apply/unapply)
- assignRole(assign/unassign)