Get list of blocked requests

GET /node/api/limit-block-log

Returns the list of requests blocked by REST-server limits.
Permissions: manage-users.

Request parameters

Query parameters

Parameter
Type
Description
from
integer optional
A lower-bound timestamp for log records.
ip
boolean
optional
Whether to retrieve all records or the records with non-empty ip value only. If set to true, only the records with non-empty ip value will be retrieved. Default is false.
limit
integer
optional
The maximum number of records to be retrieved.
login
boolean
optional
Whether to retrieve all records or the records with non-empty login value only. If set to true, only the records with non-empty login value will be retrieved. Default is false.
skip
integer
optional
The number of the first records to be skipped.
to
integer optional
An upper-bound timestamp for log records.
uri
boolean
optional
Whether to retrieve all records or the records with non-empty uri value only. If set to true, only the records with non-empty uri value will be retrieved. Default is false.
user
boolean
optional
Whether to retrieve all records or the records with non-empty user value only. If set to true, only the records with non-empty user value will be retrieved. Default is false.

Response description

Field
Type
Description
ip
string
Blocked IP-address.
login
string
The login of the blocked user.
timestamp
integer
The timestamp of the block activation.
ttl
integer
The lifetime of the block in seconds.
uri
string
Blocked uri.
user
string
The ID of the blocked user.

Examples

Request examples

Bash
JavaScript
NodeJS
Python
1
login=<...>
2
password=<...>
3
saymon_hostname=<...>
4
url=http://$saymon_hostname/node/api/limit-block-log?ip=false
5
curl -X GET $url -u $login:$password
Copied!
1
let login = <...>
2
let password = <...>
3
let auth = "Basic " + btoa(login + ":" + password)
4
let path = "/node/api/limit-block-log?limit=1&user=true"
5
let saymonHostname = <...>
6
7
let myHeaders = new Headers();
8
myHeaders.append("Authorization", auth);
9
10
let requestOptions = {
11
method: 'GET',
12
headers: myHeaders,
13
redirect: 'follow'
14
};
15
16
fetch(saymonHostname + path, requestOptions)
17
.then(response => response.text())
18
.then(result => console.log(result))
19
.catch(error => console.log('error', error));
Copied!
1
let http = require('follow-redirects').http;
2
let fs = require('fs');
3
let saymonHostname = <...>;
4
let login = <...>;
5
let password = <...>;
6
let path = '/node/api/limit-block-log?limit=1&user=true';
7
let auth = 'Basic ' + Buffer.from(login + ':' + password).toString('base64');
8
9
let options = {
10
'method': 'GET',
11
'hostname': saymonHostname,
12
'path': path,
13
'headers': {
14
'Authorization': auth
15
},
16
'maxRedirects': 20
17
};
18
19
let req = http.request(options, function (res) {
20
let chunks = [];
21
22
res.on("data", function (chunk) {
23
chunks.push(chunk);
24
});
25
26
res.on("end", function (chunk) {
27
let body = Buffer.concat(chunks);
28
console.log(body.toString());
29
});
30
31
res.on("error", function (error) {
32
console.error(error);
33
});
34
});
35
36
req.end();
Copied!
1
import requests
2
login = <...>
3
password = <...>
4
saymon_hostname = <...>
5
path = "/node/api/limit-block-log?limit=1&user=true"
6
7
url = "http://" + saymon_hostname + path
8
9
response = requests.request("GET", url, auth=(login, password))
10
11
print(response.text)
Copied!

Response example

1
[
2
{
3
"timestamp": 1617960251155,
4
"ttl": 47,
5
"user": "57ff6853fa6db3a63d16d07b",
6
"uri": "/api/objects/:id/stat",
7
"login": "user"
8
}
9
]
Copied!
Last modified 5mo ago