Skip to main content
tip

This page contains documentation for the Share class and its subclasses:

Share

warning

This API is partially documented or under construction.

Overview​

Core Share API implementation.

Methods​

validate_set​

Validate set of parameter for a new / modified shared folder

Internal API​

SYNO.Core.Share

Parameters​

name str
Share name.

vol_path str
Volume path.

desc str
Share description. Defaults to "".

enable_share_compress bool
Enable share compress. Defaults to False.

enable_share_cow bool
Enable share cow. Defaults to False.

enc_passwd str
Encrypted password. Defaults to "".

encryption bool
Enable encryption. Defaults to False.

Returns​

dict
Success.

Example return​

Click to expand
{
"success": true,
}

list_folders​

List all folders informations

Internal API​

SYNO.Core.Share

Parameters​

share_type str
Share type. Defaults to all.

additional list[str]
Additional fields to retrieve. Defaults to []. All fields known are: [ "hidden","encryption","is_aclmode","unite_permission","is_support_acl","is_sync_share","is_force_readonly","force_readonly_reason", "recyclebin","is_share_moving","is_cluster_share","is_exfat_share","is_c2_share","is_cold_storage_share","is_missing_share", "is_offline_share","support_snapshot","share_quota","enable_share_compress","enable_share_cow","enable_share_tiering", "load_worm_attr","include_cold_storage_share","is_cold_storage_share","include_missing_share","is_missing_share", "include_offline_share","is_offline_share","include_worm_share" ].

Returns​

dict
A dictionary containing the shared folders information.

Example return​

Click to expand
{
"data": {
"shares": [
{
"desc": "",
"is_usb_share": false,
"name": "test_shared_folder",
"uuid": "18585c8d-4d74-41a1-b561-21906a7f6f14",
"vol_path": "/volume1"
}
],
"total": 1
},
"success": true
}

get_folder​

Get a folder by name

Internal API​

SYNO.Core.Share

Parameters​

name str
Share name.

additional list
Additional fields to retrieve. Defaults to []. All fields known are: ["disable_list","disable_modify","disable_download","unite_permission","is_aclmode"].

Returns​

dict
A dictionary containing the shared folder information.

Example return​

Click to expand
{
"data": {
"desc": "",
"disable_download": false,
"disable_list": false,
"disable_modify": false,
"is_aclmode": true,
"is_usb_share": false,
"name": "test_shared_folder",
"unite_permission": false,
"uuid": "18585c8d-4d74-41a1-b561-21906a7f6f14",
"vol_path": "/volume1"
},
"success": true,

create_folder​

Create a new shared folder

Internal API​

SYNO.Core.Share

Parameters​

name str
Share name.

vol_path str
Volume path.

desc str
Share description. Defaults to "".

hidden bool
Hide share. Defaults to False.

enable_recycle_bin bool
Enable recycle bin. Defaults to True.

recycle_bin_admin_only bool
Recycle bin admin only. Defaults to True.

hide_unreadable bool
Hide unreadable. Defaults to False.

enable_share_cow bool
Enable share cow. Defaults to False.

enable_share_compress bool
Enable share compress. Defaults to False.

share_quota int, optional
Share quota. Defaults to 0.

name_org str, optional
Defaults to "".

Returns​

dict
Name of the created shared folder

Example return​

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

delete_folders​

Delete folder(s) by name(s)

Internal API​

SYNO.Core.Share

Parameters​

name List[str]
Share names.

Returns​

dict
Success.

Example return​

Click to expand
{
"success": true
}

clone​

Clone existing shared folder.

Internal API​

SYNO.Core.Share

Parameters​

name str
New shared folder name.

name_org str
Original shared folder name.

vol_path str
Volume path.

desc str
Shared folder description. Defaults to "".

hidden bool
Hide shared folder. Defaults to False.

enable_recycle_bin bool
Enable recycle bin. Defaults to True.

recycle_bin_admin_only bool
Recycle bin admin only. Defaults to True.

hide_unreadable bool
Hide unreadable. Defaults to False.

enable_share_cow bool
Enable share cow. Defaults to False.

enable_share_compress bool
Enable share compress. Defaults to False.

share_quota int
Share quota. Defaults to 0.

Returns​

dict
Name of the created shared folder

Example return​

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

SharePermission​

Overview​

Core Share Permission API implementation.

Methods​

get_folder_permission_by_name​

Retrieve share permissions for a given folder filtered by permission name (sub string)

Internal API​

SYNO.Core.Share.Permission

Parameters​

name str
The folder name to list permissions for.

permission_substr str
The substring to search for in the permissions.

offset int
The offset to start at. Defaults to 0.

limit int
The maximum number of results to return. Defaults to 50.

is_unite_permission bool
Whether to return unified permissions. Defaults to False.

with_inherit bool
Whether to include inherited permissions. Defaults to False.

user_group_type str
The type of user group to list permissions for. Defaults to "local_user". All known values are: ["system", "local_user", "local_group", "ldap_user", "ldap_group"].

Returns​

dict
List of permission(s) on the folder

Example return​

Click to expand
{
"data": {
"items": [
{
"inherit": "-",
"is_admin": false,
"is_custom": false,
"is_deny": false,
"is_readonly": false,
"is_writable": false,
"name": "guest"
}
],
"total": 1
},
"success": true
}

get_folder_permissions​

Retrieve share permissions for a given folder.

Internal API​

SYNO.Core.Share.Permission

Parameters​

name str
The folder name to list permissions for.

offset int
The offset to start at. Defaults to 0.

limit int
The maximum number of results to return. Defaults to 50.

is_unite_permission bool
Whether to return unified permissions. Defaults to False.

with_inherit bool
Whether to include inherited permissions. Defaults to False.

user_group_type str
The type of user group to list permissions for. Defaults to "local_user". All known values are: ["system", "local_user", "local_group", "ldap_user", "ldap_group"].

Returns​

dict
All permissions on the folder

Example return​

Click to expand
{
"data": {
"items": [
{
"inherit": "rw",
"is_admin": true,
"is_custom": false,
"is_deny": true,
"is_readonly": false,
"is_writable": false,
"name": "admin"
},
{
"inherit": "-",
"is_admin": false,
"is_custom": false,
"is_deny": false,
"is_readonly": false,
"is_writable": false,
"name": "guest"
},
{
"inherit": "rw",
"is_admin": true,
"is_custom": false,
"is_deny": false,
"is_readonly": false,
"is_writable": true,
"name": "test_api"
},
{
"inherit": "-",
"is_admin": false,
"is_custom": false,
"is_deny": false,
"is_readonly": false,
"is_writable": false,
"name": "test_test"
}
],
"total": 5
},
"success": true
}

set_folder_permissions​

Set folder permissions for a given folder.

Internal API​

SYNO.Core.Share.Permission

Parameters​

name str
The folder name to set permissions for.

user_group_type str
The type of user group to set permissions for. All known values are: ["system", "local_user", "local_group", "ldap_user", "ldap_group"].

permissions dict
The permissions to set for the folder. Example:

[
{
"name":"guest",
"is_readonly":false,
"is_writable":true,
"is_deny":false,
"is_custom":false
}
]

Returns​

dict
Success

Example return​

Click to expand
{
"success": true
}

get_local_group_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
Permissions of a group on Shared folders

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_local_group_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, Any]]
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
Success

Example return​

Click to expand
{
"success": true
}

KeyManagerStore​

Overview​

Core Share KeyManager Store API implementation.

Methods​

init​

Initialize KeyManagerStore API.

Internal API​

SYNO.Core.Share.KeyManager.Store


verify​


explore​

Explore KeyManagerStore API. Get list of existing stores

Internal API​

SYNO.Core.Share.KeyManager.Store

Returns​

dict
List of stores existing on the NAS

Example return​

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

KeyManagerAutoKey​

Overview​

Core Share KeyManager AutoKey API implementation.

Methods​

list​

List KeyManagerStore API.

Internal API​

SYNO.Core.Share.KeyManager.AutoKey

Returns​

dict
List of keys in the manager

Example return​

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