Feature Request: Add functionality to delete all monitors simultaneously #70
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: DGNum/uptime-kuma-api#70
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Feature Description:
I'm proposing to add functionality that allows users of the uptime-kuma-api API to delete all monitors at once. Currently, to perform this task, users need to delete each monitor individually, which can be quite time-consuming and error-prone in scenarios where there are a large number of monitors configured.
Motivation:
In test or development environments, it is common to need to restart the monitor configuration, removing all existing ones to start a new set of tests. The absence of a function that allows the mass deletion of monitors makes this process inefficient.
Proposed solution:
I added a function called delete_all_monitors in the api.py module, which iterates over all monitors returned by get_monitors() and deletes them individually. Additionally, I implemented a test for this new functionality in the tests/test_monitor.py module, ensuring that all monitors are deleted correctly.
Implementation Details:
Modified File: uptime_kuma_api/api.py
New Function: delete_all_monitors()
uptime_kuma_api/api.py
tests/test_monitor.py
Final considerations:
I believe this functionality will bring a huge improvement in terms of usability and efficiency to uptime-kuma-api. I am open to discussing this implementation and making adjustments as recommended by the community and project maintainers.