Assign Event Log Record to User

PATCH /node/api/event-log/:id/assignee

Assigns an event log record to a user. Note that this method is available only for SNMP messages.
Permissions: manage-event-log.

Request parameters

Path parameters

Parameter
Type
Description
id
string
required
The ID of an event log record to be assigned.

Body parameters

Parameter
Type
Description
userId
string
required
The ID of a user to which the record should be assigned.

Response description

The response body is empty.

Request examples

Bash
JavaScript
NodeJS
Python
1
login=<...>
2
password=<...>
3
saymon_hostname=<...>
4
record_id=<...>
5
url=https://$saymon_hostname/node/api/event-log/$record_id/assignee
6
7
curl -X PATCH $url -u $login:$password \
8
-H "Content-Type: application/json" \
9
--data '{"userId": "..."}'
Copied!
1
let login = <...>
2
let password = <...>
3
let saymonHostname = <...>
4
let recordId = <...>
5
let userId = <...>
6
let path = "/node/api/event-log/" + recordId + "/assignee";
7
let auth = "Basic " + btoa(login + ":" + password);
8
9
let headers = new Headers();
10
headers.append("Content-Type", "application/json");
11
headers.append("Authorization", auth);
12
13
let data = JSON.stringify({
14
"userId": userId
15
});
16
17
let requestOptions = {
18
method: "PATCH",
19
headers: headers,
20
body: data
21
};
22
23
fetch(saymonHostname + path, requestOptions)
24
.then(response => response.text())
25
.then(result => console.log(result))
26
.catch(error => console.log("error", error));
Copied!
1
const http = require("http");
2
3
let login = <...>
4
let password = <...>
5
let saymonHostname = <...>
6
let recordId = <...>
7
let userId = <...>
8
let path = "/node/api/event-log/" + recordId + "/assignee";
9
let auth = "Basic " + Buffer.from(login + ":" + password).toString("base64");
10
11
let options = {
12
"method": "PATCH",
13
"hostname": saymonHostname,
14
"headers": {
15
"Authorization": auth,
16
"Content-Type": "application/json"
17
},
18
"path": path
19
};
20
21
let req = http.request(options, function (res) {
22
let chunks = [];
23
24
res.on("data", function (chunk) {
25
chunks.push(chunk);
26
});
27
28
res.on("end", function (chunk) {
29
let body = Buffer.concat(chunks);
30
console.log(body.toString());
31
});
32
33
res.on("error", function (error) {
34
console.error(error);
35
});
36
});
37
38
let data = JSON.stringify({
39
"userId": userId
40
});
41
42
req.write(data);
43
req.end();
Copied!
1
import requests
2
3
login = <...>
4
password = <...>
5
saymon_hostname = <...>
6
record_id = <...>
7
user_id = <...>
8
url = "https://" + saymon_hostname + "/node/api/event-log/" + \
9
record_id + "/assignee"
10
11
body = {
12
"userId": user_id
13
}
14
15
response = requests.request("PATCH", url, json=body, auth=(login, password))
16
print(response.text)
Copied!