API Action "remove-downtime": Also remove child downtimes#8913
Merged
Conversation
Member
|
Why not have each downtime keep track of its child/service downtimes, similar to how a checkable keeps track of its downtimes ( |
0d7af54 to
d936776
Compare
d936776 to
7217959
Compare
lippserd
approved these changes
Jul 26, 2021
Al2Klimov
reviewed
Jul 26, 2021
Member
Al2Klimov
left a comment
There was a problem hiding this comment.
- What’s the use case for not deleting children?
- Why don’t let Downtimes disappear à la the scheduled ones?
Al2Klimov
reviewed
Jul 27, 2021
|
|
||
| try { | ||
| Downtime::RemoveDowntime(downtime->GetName(), true); | ||
| Downtime::RemoveDowntime(downtime->GetName(), true, true); |
|
|
||
| try { | ||
| Downtime::RemoveDowntime(rid, true); | ||
| Downtime::RemoveDowntime(rid, false, true); |
Member
There was a problem hiding this comment.
... but here and below false?
Contributor
Author
There was a problem hiding this comment.
Because I didn't want to touch anything, but the behavior of the API action. If we add it here, we would also need to change the behavior of downtime creation via the external command processor.
yhabteab
added a commit
that referenced
this pull request
Feb 5, 2025
Services downtimes scheduled via the `all_services` parameter already Services downtimes scheduled via the `all_services` flag get already removed automatically when removing their parent downtimes (introduced with #8913). Now, this commit makes it possible to perform the same actions for all child downtimes, i.e. not only for those of service objects, but for all child objects represented in the dependency tree.
yhabteab
added a commit
that referenced
this pull request
Feb 5, 2025
Services downtimes scheduled via the `all_services` flag get already removed automatically when removing their parent downtimes (introduced with #8913). Now, this commit makes it possible to perform the same actions for all child downtimes, i.e. not only for those of service objects, but for all child objects represented in the dependency tree.
yhabteab
added a commit
that referenced
this pull request
Mar 13, 2025
Services downtimes scheduled via the `all_services` flag get already removed automatically when removing their parent downtimes (introduced with #8913). Now, this commit makes it possible to perform the same actions for all child downtimes, i.e. not only for those of service objects, but for all child objects represented in the dependency tree.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds the attribute
parentto theDowntimeobject. This allows us to delete downtimes that have been created as child downtimes on a hosts services (using API parameterall_services) while deleting the hosts downtime.Attribute PR in Icinga DB (used for testing): Icinga/icingadb#323
Testing
Config
Steps
all_servicesoption:Results
Before
After
parent_idset to the hosts downtime id)