N4S4 / synology-api

A Python wrapper around Synology API
MIT License
400 stars 145 forks source link

Implement Task Scheduler / Event Scheduler API #176

Closed joeperpetua closed 2 months ago

joeperpetua commented 2 months ago

Adding implementation for Scheduled and Event Triggered tasks.

Includes all from #158 and some more, especially about Event Triggered tasks.

Implemented them in two different classes to avoid usage confusion, as they use different identifications and arguments for the same actions.

I also added password_confirm() to SysInfo as it was needed for creating/modifying tasks with root privileges.

Methods implemented:

task_scheduler

Functions Description
get_output_config() Retrieve the task output configuration.
get_task_list() Retrieve list of Scheduled and Event tasks.
get_task_config() Get Scheduled task settings.
get_task_results() Get results of a Scheduled task.
set_output_config() Set the task output configuration.
task_set_enable() Enable or disable a Scheduled task.
task_run() Run a Scheduled task.
task_delete() Delete a Scheduled task.
create_script_task() Create a "User defined script scheduled task".
modify_script_task() Modify a "User defined script scheduled task".
create_beep_control_task() Create a "Beep control scheduled task".
modify_beep_control_task() Modify a "Beep control scheduled task".
create_service_control_task() Create a "Service scheduled task".
modify_service_control_task() Modify a "Service scheduled task".
create_recycle_bin_task() Create a "Recycle Bin scheduled task".
modify_recycle_bin_task() Modify a "Recycle Bin scheduled task".

event_scheduler

Functions Description
get_task_results() Get results of a Event Triggered task.
get_result_output() Get the output for a given result.
task_set_enable() Enable or disable a Event Triggered task.
task_run() Run a Event Triggered task.
task_delete() Delete a Event Triggered task.
task_create_or_set() Create or modify a Event Triggered task.