Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs_status.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,16 @@ FileStation:
status: partial
Group:
status: finished
ISCSI:
status: finished
KeyManagerStore:
status: not_started
KeyManagerAutoKey:
status: not_started
LogCenter:
status: partial
LUN:
status: finished
NoteStation:
status: partial
OAuth:
Expand All @@ -59,6 +63,8 @@ SurveillanceStation:
status: partial
SysInfo:
status: partial
Target:
status: finished
TaskScheduler:
status: finished
UniversalSearch:
Expand Down
7 changes: 4 additions & 3 deletions synology_api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@
core_active_backup, \
core_backup, \
core_certificate, \
core_sys_info, \
core_group, \
core_user, \
core_share, \
core_iscsi, \
core_package, \
core_share, \
core_sys_info, \
core_user, \
downloadstation, \
log_center, \
vpn, \
Expand Down
14 changes: 14 additions & 0 deletions synology_api/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

from .error_codes import error_codes, CODE_SUCCESS, download_station_error_codes, file_station_error_codes
from .error_codes import auth_error_codes, virtualization_error_codes
from .error_codes import iscsi_lun_error_codes, iscsi_target_error_codes
from urllib3 import disable_warnings
from urllib3.exceptions import InsecureRequestWarning
from .exceptions import CoreError
Expand All @@ -17,6 +18,7 @@
from .exceptions import CertificateError, CloudSyncError, DHCPServerError, DirectoryServerError, DockerError, DriveAdminError
from .exceptions import LogCenterError, NoteStationError, OAUTHError, PhotosError, SecurityAdvisorError, TaskSchedulerError, EventSchedulerError
from .exceptions import UniversalSearchError, USBCopyError, VPNError, CoreSysInfoError, UndefinedError
from .exceptions import LunError, TargetError
import hashlib
from os import urandom
from cryptography.hazmat.backends import default_backend
Expand Down Expand Up @@ -782,6 +784,12 @@ def request_data(self,
# Event Scheduler error:
elif api_name.find('SYNO.Core.EventScheduler') > -1:
raise EventSchedulerError(error_code=error_code)
# ISCSI LUN error:
elif api_name.find('SYNO.Core.ISCSI.LUN') > -1:
raise LunError(error_code=error_code)
# ISCSI Target error:
elif api_name.find('SYNO.Core.ISCSI.Target') > -1:
raise TargetError(error_code=error_code)
# Universal search error:
elif api_name.find('SYNO.Finder') > -1:
raise UniversalSearchError(error_code=error_code)
Expand Down Expand Up @@ -863,6 +871,12 @@ def _get_error_message(code: int, api_name: str) -> str:
elif api_name.find('FileStation') > -1:
message = file_station_error_codes.get(
code, "<Undefined.FileStation.Error>")
elif api_name.find('SYNO.Core.ISCSI.LUN') > -1:
message = iscsi_lun_error_codes.get(
code, "<Undefined.ISCSI.LUN.Error>")
elif api_name.find('SYNO.Core.ISCSI.Target') > -1:
message = iscsi_target_error_codes.get(
code, "<Undefined.ISCSI.Target.Error>")
else:
message = "<Undefined.%s.Error>" % api_name
return 'Error {} - {}'.format(code, message)
Expand Down
Loading