Delete Incident Properties

Remove properties from an incident with the specified ID.

In this context, a property is a key-value pair, where a key is the name of the property.

Not to be confused with the Property model.

Request

HTTP Request

DELETE /node/api/incidents/:id/props

Path parameters

Parameter Type Description

id

String
required

The ID of an incident whose properties should be deleted.

Body parameters

Request body contains an array of property names which should be deleted. If the request body is empty, this requests deletes all incident’s properties.

You can specify non-existent properties in the request body. The request will remove only those properties that exist in the specified incident.

Request body

[
    property1,
    ...
    propertyN
]

Response

Response body contains the updated incident.

If you send a request with an incorrect request body, you get a response with a code 200 and an empty response body.

Example

Request

  • Bash

  • JavaScript

  • NodeJS

  • Python

login=<...>
password=<...>
saymon_hostname=<...>
incident_id=<...>
url=https://$saymon_hostname/node/api/incidents/$incident_id/props

curl -X DELETE $url -u $login:$password \
    -H "Content-Type: application/json" \
    -d @- <<EOF
{
"foo"
}
EOF
let login = <...>
let password = <...>
let saymonHostname = <...>
let incidentId = <...>
let path = "/node/api/incidents/" + incidentId + "/props";
let auth = "Basic " + btoa(login + ":" + password);

let headers = new Headers();
    headers.append("Content-Type", "application/json");
headers.append("Authorization", auth);

let data = JSON.stringify({
"foo"
});

let requestOptions = {
    method: "DELETE",
    headers: headers,
        body: data
};

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 saymonHostname = <...>
let incidentId = <...>
let path = "/node/api/incidents/" + incidentId + "/props";
let auth = "Basic " + Buffer.from(login + ":" + password).toString("base64");

    let body = JSON.stringify({
"foo"
});

let options = {
    "method": "DELETE",
    "hostname": saymonHostname,
    "headers": {
        "Authorization": auth
    },
    "path": path,
        "json": body
};

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 = <...>
saymon_hostname = <...>
incident_id = <...>
url = "https://" + saymon_hostname + "/node/api/incidents/" + incident_id + "/props"

body = {
"foo"
}

response = requests.request("DELETE", url, auth=(login, password), json=body)
print(response.text)

Response

  • Before

  • After

{
    "id": "62bda3ce7e66ea4c50c8efd4",
    "entityId": "5c9104ba9344f77f8c5fc196",
    "entityType": 1,
    "type": 1,
    "data": "{}",
    "lastState": 1,
    "localTimestamp": null,
    "parentChainId": "5c9104ba9344f77f8c5fc196",
    "reason": {
        "code": 4,
        "data": "{"exceptionClass":"java.net.ConnectException","message":"Connection refused (Connection refused)"}"
    },
    "state": 1,
    "text": null,
    "timestamp": 1656595406252,
    "clearTimestamp": 1676896920904,
    "properties": {
"foo": "value",
        "test": 123
    }
}
{
    "id": "62bda3ce7e66ea4c50c8efd4",
    "entityId": "5c9104ba9344f77f8c5fc196",
    "entityType": 1,
    "type": 1,
    "data": "{}",
    "lastState": 1,
    "localTimestamp": null,
    "parentChainId": "5c9104ba9344f77f8c5fc196",
    "reason": {
        "code": 4,
        "data": "{\"exceptionClass\":\"java.net.ConnectException\",\"message\":\"Connection refused (Connection refused)\"}"
    },
    "state": 1,
    "text": null,
    "timestamp": 1656595406252,
    "clearTimestamp": 1676896920904,
    "properties": {
        "test": 123
    }
}