Undo Clear Incident
Undo the Clear Incident action before the incident is put into incident history. Note that you can’t undo clear action of incidents that have been removed from the list of active incidents.
Note that this doesn’t undo the remove action. You can choose to undo only the clear action and still keep the remove flag.
Response
The response body is empty.
When you undo the clear action, the incident reverts to its state before it has been marked for clearing. This state is stored in the incident’s lastState
field.
-
Initial State
-
Cleared State
-
Un-Cleared State
{
"entityId": "576bd6a04cbe34576bb662d3",
"entityType": 1,
"type": 1,
"localTimestamp": 1666083275092,
"state": 2,
"text": null,
"timestamp": 1666083275092,
"id": "634e69cb88a014a922a6f663"
}
{
"entityId": "576bd6a04cbe34576bb662d3",
"entityType": 1,
"type": 1,
"localTimestamp": 1666083275092,
"state": 3,
"text": null,
"timestamp": 1666083275092,
"clearTimestamp": 1666703637929,
"id": "634e69cb88a014a922a6f663"
}
{
"entityId": "576bd6a04cbe34576bb662d3",
"entityType": 1,
"type": 1,
"localTimestamp": 1666083275092,
"state": 2,
"text": null,
"timestamp": 1666083275092,
"id": "634e69cb88a014a922a6f663"
}
Example
Request
-
Bash
-
JavaScript
-
NodeJS
-
Python
login=<...>
password=<...>
incident_id=<...>
saymon_hostname=<...>
url=https://$saymon_hostname/node/api/incidents/$incident_id/undo-clear
curl -X POST $url -u $login:$password
let login = <...>
let password = <...>
let incidentId = <...>
let saymonHostname = <...>
let path = "/node/api/incidents/" + incidentId + "/undo-clear";
let auth = "Basic " + btoa(login + ":" + password);
let headers = new Headers();
headers.append("Authorization", auth);
let requestOptions = {
method: "POST",
headers: headers
};
fetch(saymonHostname + path, requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log("error", error));
const http = require("http");
let login = <...>
let password = <...>
let incidentId = <...>
let saymonHostname = <...>
let path = "/node/api/incidents/" + incidentId + "/undo-clear";
let auth = "Basic " + Buffer.from(login + ":" + password).toString("base64");
let options = {
"method": "POST",
"hostname": saymonHostname,
"headers": {
Authorization: auth
},
"path": path
};
let req = http.request(options, function (res) {
let chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
let body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
req.end();
import requests
login = <...>
password = <...>
incident_id = <...>
saymon_hostname = <...>
url = "https://" + saymon_hostname + "/node/api/incidents/" + \
incident_id + "/undo-clear"
response = requests.request("POST", url, auth=(login, password))
print(response.text)