N4S4 / synology-api

A Python wrapper around Synology API
MIT License
345 stars 133 forks source link

[Feature Request] Implement TaskScheduler API #158

Open maddes-b opened 4 months ago

maddes-b commented 4 months ago

Is your feature request related to a problem? Please describe. Want to enable/disable and run tasks via script.

Due to poorly conceived IPv6 support in DSM 7.x I want to run a script every minute after reboot, but only up to 15 minutes. So a reboot script will enable that task (planned minutely) and schedule another task in 15 mins to disable it again.

Describe the solution you'd like Using the API for Task Scheduler

Describe alternatives you've considered Schedules running every 5 mins to check for executing specific scripts, but this will not let NAS go into a deeper sleep mode. Wasting energy.

Additional context Did not find much about the TaskScheduler API, but there is some information to get a hold on it. I assume you are more experienced to find out API parameters than I.

P.S.: Already used APIs locally via script to import renewed certficates, that were done on another machine. See https://github.com/maddes-b/synology-nas-tools

maddes-b commented 4 months ago

Played around on current DSM 7.2

API SYNO.Core.TaskScheduler

= Method list

= Method get

= Method set_enable

= Method delete

= Method run

= Method set

= Method create

= Method view

= Method get_history_status_list

= Method get_history_log

API SYNO.Core.TaskScheduler.Root

= Method set

= Method create

N4S4 commented 4 months ago

Nice! I will look into it!