N4S4 / synology-api

A Python wrapper around Synology API
MIT License
360 stars 137 forks source link

Tasks for Active Backup for Business #135

Closed righter83 closed 7 months ago

righter83 commented 11 months ago

Is your feature request related to a problem? Please describe. I'm using your code to monitor the Hyper Backup Tasks -> Works very well, thanks for that!! I want also to monitor the Active Backup for Business Tasks (Fileserver and PC at the moment) To get this information you need to add these functions

Describe the solution you'd like Same like Hyperbackup: backup_task_list and backup_task_result

Describe alternatives you've considered Monitor over SSH a local script -> it's a ugly hack solution, which is not working very well all the time

Additional context

N4S4 commented 11 months ago

Hi, thank you. I will try to do my best to integrate the feature!

insanity67 commented 8 months ago

Hi,

had the same problem, and did it the hacky way... just add this to your .../dist-packages/synology_api/core_active_backup.py:

def list_syno_active_backup_tasks(self) -> dict[str, object] | str:
    api_name = 'SYNO.ActiveBackup.Task'
    info = self.gen_list[api_name]
    api_path = info['path']

    req_param = {'version': '1',
                 'method': 'list',
                 'load_status': 'true',
                 'load_result': 'true'}

    return self.request_data(api_name, api_path, req_param)

Can be called via: list_syno_active_backup_tasks()

Unfortunately I was too lazy to do a pull request until now...

N4S4 commented 8 months ago

Hey, thank you. I will try it out! If u want, u can make a pr, or I'll add directly in case. Let me know!

insanity67 commented 8 months ago

Hey,

please add directly, no credit needed :) did not want to make a pr not knowing your exact naming scheme.

BTW, thx for that great project, helped me so much with Synology monitoring 👍🏻

N4S4 commented 8 months ago

I will thank you for supporting!

insanity67 commented 8 months ago

Hey there, just added a PR. Please report back if all is ok, thats my first pr ever :)

N4S4 commented 7 months ago

Integrated with PR #142