mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 21:55:03 +02:00
Merge pull request #5026 from Icinga/fix/ack-notify-13939
Fix notify/sticky parameter handling in 'acknowledge-problem' API action
This commit is contained in:
commit
5653f5dde0
@ -905,9 +905,9 @@ Send a `POST` request to the URL endpoint `/v1/actions/acknowledge-problem`.
|
|||||||
----------|-----------|--------------
|
----------|-----------|--------------
|
||||||
author | string | **Required.** Name of the author, may be empty.
|
author | string | **Required.** Name of the author, may be empty.
|
||||||
comment | string | **Required.** Comment text, may be empty.
|
comment | string | **Required.** Comment text, may be empty.
|
||||||
expiry | timestamp | **Optional.** If set, the acknowledgement will vanish after this timestamp.
|
expiry | timestamp | **Optional.** Whether the acknowledgement will be removed at the timestamp.
|
||||||
sticky | boolean | **Optional.** If `true`, the default, the acknowledgement will remain until the service or host fully recovers.
|
sticky | boolean | **Optional.** Whether the acknowledgement will be set until the service or host fully recovers. Defaults to `false`.
|
||||||
notify | boolean | **Optional.** If `true`, a notification will be sent out to contacts to indicate this problem has been acknowledged. The default is false.
|
notify | boolean | **Optional.** Whether a notification of the `Acknowledgement` type will be sent. Defaults to `false`.
|
||||||
|
|
||||||
In addition to these parameters a [filter](12-icinga2-api.md#icinga2-api-filters) must be provided. The valid types for this action are `Host` and `Service`.
|
In addition to these parameters a [filter](12-icinga2-api.md#icinga2-api-filters) must be provided. The valid types for this action are `Host` and `Service`.
|
||||||
|
|
||||||
|
@ -196,10 +196,10 @@ Dictionary::Ptr ApiActions::AcknowledgeProblem(const ConfigObject::Ptr& object,
|
|||||||
bool notify = false;
|
bool notify = false;
|
||||||
double timestamp = 0.0;
|
double timestamp = 0.0;
|
||||||
|
|
||||||
if (params->Contains("sticky"))
|
if (params->Contains("sticky") && HttpUtility::GetLastParameter(params, "sticky"))
|
||||||
sticky = AcknowledgementSticky;
|
sticky = AcknowledgementSticky;
|
||||||
if (params->Contains("notify"))
|
if (params->Contains("notify"))
|
||||||
notify = true;
|
notify = HttpUtility::GetLastParameter(params, "notify");
|
||||||
if (params->Contains("expiry"))
|
if (params->Contains("expiry"))
|
||||||
timestamp = HttpUtility::GetLastParameter(params, "expiry");
|
timestamp = HttpUtility::GetLastParameter(params, "expiry");
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user