functions added

This commit is contained in:
Renato
2023-03-23 10:55:32 +01:00
parent a2d35acdeb
commit 63ce514260
2 changed files with 338 additions and 282 deletions

203
README.md
View File

@ -91,18 +91,18 @@ dwn.get_info()
response would be json data
```json
{'data': {'enable_list_usergrp': False,
'hostname': 'MyCloud',
'is_manager': True,
'items': [{'gid': 100}, {'gid': 101}],
'support_file_request': True,
'support_sharing': True,
'support_vfs': True,
'support_virtual': {'enable_iso_mount': True, 'enable_remote_mount': True},
'support_virtual_protocol': ['cifs', 'nfs', 'iso'],
'system_codepage': 'enu',
'uid': 1026},
'success': True}
{"data": {"enable_list_usergrp": "False",
"hostname": "MyCloud",
"is_manager": "True",
"items": [{"gid": 100}, {"gid": 101}],
"support_file_request": "True",
"support_sharing": "True",
"support_vfs": "True",
"support_virtual": {"enable_iso_mount": "True", "enable_remote_mount": "True"},
"support_virtual_protocol": ["cifs", "nfs", "iso"],
"system_codepage": "enu",
"uid": 1026},
"success": "True"}
```
## If required HTTPS (it requires a valid certificate)
@ -128,13 +128,13 @@ I will slowly implement more functions, Synology APIs are plenty, too many for m
This wrapper cover the following APIs for now:
| DownloadStation |
| ------------- |
|-------------------------------|
| SYNO.DownloadStation.Info |
| SYNO.DownloadStation.Schedule |
| SYNO.DownloadStation.Task |
| FileStation |
| ------------- |
|----------------------------------|
| SYNO.FileStation.Info |
| SYNO.FileStation.List |
| SYNO.FileStation.Search |
@ -153,18 +153,21 @@ This wrapper cover the following APIs for now:
| SYNO.FileStation.BackgroundTask |
| Photo |
| -------- |
|SYNO.Foto.UserInfo|
|SYNO.Foto.Browse.Folder|
|SYNO.FotoTeam.Browse.Folder|
|SYNO.Foto.Browse.Album|
|SYNO.Foto.Browse.ConditionAlbum|
|SYNO.Foto.Sharing.Passphrase|
|SYNO.FotoTeam.Sharing.Passphrase|
|SYNO.Foto.Sharing.Misc|
|----------------------------------|
| SYNO.Foto.UserInfo |
| SYNO.Foto.Browse.Folder |
| SYNO.FotoTeam.Browse.Folder |
| SYNO.Foto.Browse.Album |
| SYNO.Foto.Browse.ConditionAlbum |
| SYNO.Foto.Sharing.Passphrase |
| SYNO.FotoTeam.Sharing.Passphrase |
| SYNO.Foto.Sharing.Misc |
| SYNO.Foto.Browse.Item |
| SYNO.Foto.Search.Filter |
| SYNO.Foto.Setting.Guest |
| core_sys_info |
| -------- |
|---------------------------------------|
| SYNO.Core.System |
| SYNO.Core.FileServ.SMB |
| SYNO.Core.FileServ.AFP |
@ -224,7 +227,7 @@ This wrapper cover the following APIs for now:
| SYNO.Storage.CGI.Storage |
| Virtualization |
| -------------- |
|--------------------------------------|
| SYNO.Virtualization.API.Task.Info |
| SYNO.Virtualization.API.Network |
| SYNO.Virtualization.API.Storage |
@ -234,12 +237,12 @@ This wrapper cover the following APIs for now:
| SYNO.Virtualization.API.Guest.Image |
| core_backup |
| ------ |
|------------------------|
| SYNO.Backup.Repository |
| SYNO.Backup.Task |
| core_active_backup (Active Backup for Business) |
| ------ |
|-------------------------------------------------|
| SYNO.ActiveBackup.Inventory |
| SYNO.ActiveBackup.Overview |
@ -251,7 +254,7 @@ you can run the following set of functions at your will entering just the requir
| Function | Description |
| --- | --- |
|-----------------------------------|--------------------------------------------------------------------------------------------------|
| get_info() | Provide File Station information |
| get_list_share() | List all shared folders. |
| get_file_list() | Enumerate files in a given folder |
@ -273,15 +276,15 @@ you can run the following set of functions at your will entering just the requir
| edit_shared_link() | Edit sharing link(s) |
| create_folder() | Create folders. |
| rename_folder() | Rename a file/folder |
| delete_blocking_function() | Delete files/folders. This is a blocking method. The response is not returned until the deletion
operation is completed. |
| delete_blocking_function() | Delete files/folders. This is a blocking method. The response is not returned until the deletion |
| operation is completed. | |
| get_file_list_of_archive() | List archived files contained in an archive |
| get_list_of_all_background_task() | List all background tasks including copy, move, delete, compress and extract tasks |
To run the following functions you'll have to start the task with the start function
| Function | Description |
| --- | --- |
|--------------------------|------------------------------------------------------------|
| search_start() | Search files according to given criteria. |
| get_search_list() | List matched files in a search temporary database. |
| stop_search_task() | Stop the searching task |
@ -306,7 +309,7 @@ To run the following functions you'll have to start the task with the start func
#### DownloadStations functions:
| Function | Description |
| --- | --- |
|-----------------------|------------------------------------------|
| get_info() | Download Station info |
| get_config() | Download Station Settings info |
| set_server_config() | Sets Download Station settings |
@ -323,24 +326,28 @@ To run the following functions you'll have to start the task with the start func
#### Photo functions:
| Function |
| --- |
|get_userinfo()|
|get_folder()|
|list_folders()|
|list_teams_folders()|
|count_folders()|
|count_team_folders()|
|lookup_folder()|
|lookup_team_folder()|
|get_album()|
|list_albums()|
|suggest_condition()|
|create_album()|
|delete_album()|
|set_album_condition()|
|share_album()|
|share_team_folder()|
|list_shareable_users_and_groups()|
|-----------------------------------|
| get_userinfo() |
| get_folder() |
| list_folders() |
| list_teams_folders() |
| count_folders() |
| count_team_folders() |
| lookup_folder() |
| lookup_team_folder() |
| get_album() |
| list_albums() |
| suggest_condition() |
| create_album() |
| delete_album() |
| set_album_condition() |
| share_album() |
| share_team_folder() |
| list_shareable_users_and_groups() |
| list_item_in_folders() |
| list_search_filters() |
| get_guest_settings() |
#### core_sys_info:
@ -457,7 +464,7 @@ DS info with below functions:
### Virtualization
| Functions |
| --- |
|--------------------------|
| get_task_list() |
| clear_task() |
| get_taks_info() |
@ -478,7 +485,7 @@ DS info with below functions:
### core_backup Hyper Backup
| Functions |
| --- |
|--------------------------|
| backup_repository_get() |
| backup_repository_list() |
| backup_task_list |
@ -493,80 +500,80 @@ DS info with below functions:
### core_active_backup Active Backup for Business
| Functions | Description |
| --- | --- |
|-----------------------------|------------------------------------|
| list_vm_hypervisor() | list of all configured hypervisors |
| list_device_transfer_size() | list of all detected vms |
### core_certificate tnx to @ajarzyn
| Functions | Description |
| --- | --- |
|--------------------|-------------------------|
| list_cert() | list certificates |
| set_default_cert() | set default certificate |
| upload_cert() | upload a certificate |
### vpn
| Functions |
| --- |
|settings_list()|
|active_connections_list()|
|log_list()|
|network_interface_setting()|
|security_autoblock_setting()|
|permission_setting()|
|pptp_settings_info()|
|openvpn_settings_info()|
|l2tp_settings_info()|
|------------------------------|
| settings_list() |
| active_connections_list() |
| log_list() |
| network_interface_setting() |
| security_autoblock_setting() |
| permission_setting() |
| pptp_settings_info() |
| openvpn_settings_info() |
| l2tp_settings_info() |
### oauth
| Functions |
| --- |
|clients()|
|tokens()|
|logs()|
|-----------|
| clients() |
| tokens() |
| logs() |
### security_advisor
| Functions |
| --- |
|general_info()|
|security_scan()|
|checklist()|
|login_activity()|
|advisor_config()|
|scan_config()|
|------------------|
| general_info() |
| security_scan() |
| checklist() |
| login_activity() |
| advisor_config() |
| scan_config() |
### dhcp_server
| Functions |
| --- |
|general_info()|
|vendor()|
|pxe()|
|tftp()|
|network_bond()|
|network_ethernet()|
|--------------------|
| general_info() |
| vendor() |
| pxe() |
| tftp() |
| network_bond() |
| network_ethernet() |
### usb_copy
| Functions |
| --- |
|usb_copy_info()|
|toggle_usb_copy()|
|logs()|
|global_settings()|
|-------------------|
| usb_copy_info() |
| toggle_usb_copy() |
| logs() |
| global_settings() |
### log_center
| Functions |
| --- |
|logcenter()|
|client_status_cnt()|
|client_status_eps()|
|remote_log_archives()|
|display_logs()|
|setting_storage_list()|
|registry_send_list()|
|history()|
|------------------------|
| logcenter() |
| client_status_cnt() |
| client_status_eps() |
| remote_log_archives() |
| display_logs() |
| setting_storage_list() |
| registry_send_list() |
| history() |
#### What's still missing
@ -574,11 +581,11 @@ DS info with below functions:
There is still few missing function for the api supplied from Synology which is a work in progress:
| Missing in FileStation |
|----------------------|
|------------------------|
| SYNO.FileStation.Thumb |
| Missing in Virtualization |
|---|
|--------------------------------------|
| SYNO.Virtualization.API.Guest create |
### Bugs

View File

@ -240,3 +240,52 @@ class Photos:
'team_space_sharable_list': team_space_sharable_list}
return self.request_data(api_name, api_path, req_param)
def list_item_in_folders(self, offset: int = 0, limit: int = 0, folder_id: int = 0, sort_by: str = 'filename',
sort_direction: str = 'desc', type: str = None, passphrase: str = None,
additional: list = None) -> dict[str, object] | str:
"""List all items in all folders in Personal Space
Parameters
----------
offset: int Required. Specify how many shared folders are skipped before beginning to return listed shared folders
limit: int Required. Number of shared folders requested. 0 lists all shared folders.
folder_id: int ID of folder
sort_by: str Optional filename, filesize, takentime, item_type
sort_direction: str Optional asc or desc
passphrase: str Optional Passphrase for a shared album
additional: list ["thumbnail","resolution", "orientation", "video_convert", "video_meta", "provider_user_id", "exif", "tag", "description", "gps", "geocoding_id", "address", "person"]
type: str 'Type of data photo: Photo video: Video live: iPhone live photos'
"""
api_name = 'SYNO.Foto.Browse.Item'
info = self.photos_list[api_name]
api_path = info['path']
req_param = {'version': info['maxVersion'], 'method': 'list', 'offset': offset, 'limit': limit,
'folder_id': folder_id, 'sort_by': sort_by, 'sort_direction': sort_direction}
if type:
req_param['type'] = type
if passphrase:
req_param['passphrase']: passphrase
if additional:
req_param['additional']: additional
return self.request_data(api_name, api_path, req_param)
def list_search_filters(self) -> dict[str, object] | str:
api_name = 'SYNO.Foto.Search.Filter'
info = self.photos_list[api_name]
api_path = info['path']
req_param = {'version': info['maxVersion'], 'method': 'list'}
return self.request_data(api_name, api_path, req_param)
def get_guest_settings(self) -> dict[str, object] | str:
api_name = 'SYNO.Foto.Setting.Guest'
info = self.photos_list[api_name]
api_path = info['path']
req_param = {'version': info['maxVersion'], 'method': 'get'}
return self.request_data(api_name, api_path, req_param)