Skip to content

Release - v0.9.6

Latest

Choose a tag to compare

@N4S4 N4S4 released this 01 Dec 22:48
· 12 commits to master since this release
1809d0d

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). Returns allow_upgrade and status; status is
    "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_to is a
    JSON object with integer base and nano, 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.Upgrade start, 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.Download start, version 2). Download only,
    it installs nothing.
  • CoreUpgrade.upgrade_download_cancel(): cancels a download in progress
    (.Server.Download cancel, version 1).

Update panel request variants (synology_api/core_sys_info.py)

  • SysInfo.upgrade_status(feasibility_check=True) sends SYNO.Core.Upgrade status
    at version 1 with the flag the panel uses for its feasibility check.
  • SysInfo.sys_upgrade_download(need_download_target=True) sends .Server.Download
    progress at version 2 with need_download_target.
  • CoreUpgrade.upgrade_precheck_start(lang=None, upgrade_type=None) switches to
    PreCheck start version 2 with lang and type when 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 send contact_id, a
    parameter that the get method of SYNO.Contacts.Contact does 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 sends ids as a JSON array
    string, takes a single ID or a list of IDs, and returns data["contact"], a list even
    for one ID. The argument is contact_ids now; 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_ids in and data["photo"] out, one entry per contact. This closes the gap
    where the contact list exposes a photo field 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 /stargazers endpoint, 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