Repository navigation
What's Changed
This release adds the DSM system update workflow to the wrapper: the calls the DSM 7
Control Panel makes to check, download, pre-check and install a firmware update.
All new arguments are optional, and every existing call keeps sending exactly the
same request it sent in 0.9.5.
Enhancements
DSM upgrade workflow (synology_api/core_upgrade.py)
CoreUpgrade.upgrade_basic_status(): overall upgrade status (SYNO.Core.Upgrade
basic_status, version 1). Returnsallow_upgradeandstatus;statusis
"none"when the system is up to date.CoreUpgrade.upgrade_check_upgradeable_drives(upgrade_to): per-drive upgrade
eligibility (check_having_upgradeable_drives, version 1).upgrade_tois a
JSON object with integerbaseandnano, for example{"base": 72806, "nano": 0}.
Strings or an empty dict are rejected by DSM with error 101.CoreUpgrade.upgrade_install(upgrade_type="dsm", force=True): starts the install of
an already downloaded update (SYNO.Core.Upgradestart, version 1). This reboots
the NAS and the session normally dies before a response arrives.CoreUpgrade.upgrade_download_start(target="update", need_auto_smallupdate=True):
starts the firmware download (.Server.Downloadstart, version 2). Download only,
it installs nothing.CoreUpgrade.upgrade_download_cancel(): cancels a download in progress
(.Server.Downloadcancel, version 1).
Update panel request variants (synology_api/core_sys_info.py)
SysInfo.upgrade_status(feasibility_check=True)sendsSYNO.Core.Upgradestatus
at version 1 with the flag the panel uses for its feasibility check.SysInfo.sys_upgrade_download(need_download_target=True)sends.Server.Download
progressat version 2 withneed_download_target.CoreUpgrade.upgrade_precheck_start(lang=None, upgrade_type=None)switches to
PreCheckstartversion 2 withlangandtypewhen arguments are given.
The last three were already in the wrapper under the same names, so they were extended
with an optional argument instead of duplicated under a new name. Call them with no
arguments and you get the 0.9.5 request unchanged.
Contacts fix and photo endpoint (synology_api/contacts.py)
Contacts.get_contact(contact_ids): fixed. The method used to sendcontact_id, a
parameter that thegetmethod ofSYNO.Contacts.Contactdoes not accept, so DSM
ignored it and answered error 120, whose message "Preserve for other purpose" is a
reserved code and says nothing about the cause. It now sendsidsas a JSON array
string, takes a single ID or a list of IDs, and returnsdata["contact"], a list even
for one ID. The argument iscontact_idsnow; the old call never returned data, so
nothing working depends on the old name.Contacts.get_photo(contact_ids): new. Reads the separate photo endpoint,
contact_idsin anddata["photo"]out, one entry per contact. This closes the gap
where the contact list exposes aphotofield that always came back empty.
One detail if you call these methods directly: on this API the parameter names change
from method to method (get and delete take ids, get_photo takes contact_ids,
set takes id), and mixing them up is exactly what produces error 120.
Thanks @n1cc00 for the Contacts work (#506).
Documentation
- The docs site no longer calls the
/stargazersendpoint, which now requires
authentication, and reads the star count from the repository info instead
(contributed by @joeperpetua in #500).
Heads-up
The calls were exercised against a DSM 7 NAS: basic_status,
progress at version 2 with need_download_target, check_having_upgradeable_drives
with a real build and status at version 1 with feasibility_check. upgrade_install,
upgrade_download_start, upgrade_download_cancel and upgrade_precheck_start at
version 2 are writes and were not exercised, because no DSM update was pending on the
test unit. Treat them as implemented against the panel contract, not as tested end to end.
get_contact and get_photo were exercised on the same NAS, read only, with a single ID,
a list of IDs and a numeric string.
Full Changelog: v0.9.5...v0.9.6