Skip to main content

Group

Overview

Core Group API implementation.

Supported methods

  • Getters :

    • Get all groups
    • Get group members
    • Get group shares permissions
    • Get group shares quota
    • Get group services speed limits
  • Setters :

    • Set group name/description
    • Set group share permissions
    • Set group share quotas
    • Set group service speed limit
  • Actions :

    • Create new group
    • Delete groups
    • Add users to a group
    • Remove users from a group

Methods

get_groups

Retrieve groups information.

Internal API

SYNO.Core.Group

Parameters

offset int
The offset of the groups to retrieve. Defaults to 0.

limit int
The maximum number of groups to retrieve. Defaults to -1 (all groups).

name_only bool
If True, returns only group names. If False, returns full group information. Defaults to False.

Returns

dict[str, object]
A dictionary containing the groups information.

Example return

Click to expand
{
"data": {
"groups": [
{
"description": "System default admin group",
"gid": 101,
"name": "administrators"
},
{
"description": "System default group for Web services",
"gid": 1023,
"name": "http"
},
{
"description": "A test group",
"gid": 65536,
"name": "Test"
},
{
"description": "System default group",
"gid": 100,
"name": "users"
}
],
"offset": 0,
"total": 4
},
"success": true
}

get_users

Retrieve users members or not of a group.

Internal API

SYNO.Core.Group.Member

Parameters

group str
The group to list users from.

in_group bool
Defaults to True.
If True, retrieves users who are members of the specified group.
If False, retrieves users who are not members of the group.

Returns

dict[str, object]
A dictionary containing the result of the request.

Example return

Click to expand
{
"data": {
"offset": 0,
"total": 3,
"users": [
{
"description": "System default user",
"name": "admin",
"uid": 1024
},
{
"description": "",
"name": "customAdmin",
"uid": 1026
},
{
"description": "",
"name": "test",
"uid": 1032
}
]
},
"success": true
}

get_speed_limits

Retrieve bandwidth control settings for a given group.

Internal API

SYNO.Core.BandwidthControl

Parameters

group str
The group to retrieve settings for.

Returns

dict[str, object]
A dictionary containing the result of the request.


get_quota

Retrieve quota settings for a given group.

Internal API

SYNO.Core.Quota

Parameters

group str
The group to retrieve quota settings for.

Returns

dict[str, object]
A dictionary containing the result of the request.

Example return

Click to expand
{
"data": {
"group_quota": [
{
"deduped": false,
"quota_status": "v1",
"shares": [
{
"description": "",
"name": "ActiveBackupforBusiness",
"quota": 1024
}
],
"support_share_quota": true,
"volume": "/volume3"
}
]
},
"success": true
}

get_permissions

Retrieve share permissions for a given group.

Internal API

SYNO.Core.Share.Permission

Parameters

group str
The group to list permissions for.

Returns

dict[str, object]
A dictionary containing the result of the request.

Example return

Click to expand
{
"data": {
"shares": [
{
"is_aclmode": true,
"is_custom": false,
"is_deny": true,
"is_mask": false,
"is_readonly": false,
"is_sync_share": false,
"is_unite_permission": false,
"is_writable": false,
"name": "ActiveBackupforBusiness",
"share_path": "/volume3/ActiveBackupforBusiness"
}
],
"total": 1
},
"success": true
}

set_group_info

Change group name and/or description.

Internal API

SYNO.Core.Group

Parameters

group str
The group to set information for.

new_name str
The new name of the group. Defaults to current value.

new_description str
The new description of the group. Defaults to current value.

Returns

dict[str, object]
A dictionary containing the result of the request.

Example return

Click to expand
{
"data": {
"gid": 65536,
"name": "Test_mod"
},
"success": true
}

set_share_quota

Set group quota for a given share.

Internal API

SYNO.Core.Quota

Parameters

group str
The group to set the quota for.

share_quotas (list[dict[str, Any]]) ``
The quotas to set for the group.
Example:

[
{
"share": "web",
"quota": 1024, # in MB
},
{
"share": "photo",
"quota": 5120, # in MB
}
]

Returns

dict[str, object]
A dictionary containing the result of the request.

Example return

Click to expand
{
"data": {},
"success": true
}

set_share_permissions

Set group permissions for a given share.

Internal API

SYNO.Core.Share.Permission

Parameters

group str
The group to set the permissions for.

permissions list[dict[str, object]]:
The permissions to set for the group.
Example:

[
{
"name": "web",
"is_readonly": False,
"is_writable": False,
"is_deny": True
},
{
"name": "ActiveBackupforBusiness",
"is_readonly": False,
"is_writable": True,
"is_deny": False
}
]

Returns

dict[str, object]
A dictionary containing the result of the request.

Example return

Click to expand
{
"success": true
}

set_speed_limit

Set speed limit for a given share.

info

Doesn't support scheduled speed limits, only on/off.

Internal API

SYNO.Core.BandwidthControl

Parameters

group str
The group to set the speed limit for.

upload_limit int
The maximum upload speed in KB/s.

download_limit int
The maximum download speed in KB/s.

protocol str
The protocol to set the speed limit for.
Possible values:

  • FileStation
  • WebDAV
  • FTP
  • NetworkBackup (Rsync)
  • CloudStation (Synology Drive)

Returns

dict[str, object]
A dictionary containing the result of the request.

Example return

Click to expand
{
"data": {
"results": [
true
]
},
"success": true
}

add_users

Add users to a group.

Internal API

SYNO.Core.Group.Member

Parameters

group str
The group to add users to.

users list[str]
The users to add to the group.

Returns

dict[str, object]
A dictionary containing the result of the request.

Example return

Click to expand
{
"data": {},
"success": true
}

remove_users

Remove users from a group.

Internal API

SYNO.Core.Group.Member

Parameters

group str
The group to remove users from.

users list[str]
The users to remove from the group.

Returns

dict[str, object]
A dictionary containing the result of the request.

Example return

Click to expand
{
"data": {},
"success": true
}

create

Create group.

Internal API

SYNO.Core.Group

Parameters

name str
Name to assign to the group.

description str
Description to assign to the group. Defaults to empty string.

Returns

dict[str, object]
A dictionary containing the result of the request.

Example return

Click to expand
{
"data": {
"gid": 65541,
"name": "new_group"
},
"success": true
}

delete

Delete specified groups.

Internal API

SYNO.Core.Group

Parameters

groups list[str]
The groups to delete.

Returns

dict[str, object]
A dictionary containing the result of the request.

Example return

Click to expand
{
"data": {},
"success": true
}