Get list of blocked requests
Returns a list of requests blocked by REST-server limits.
Request
Query parameters
Parameter | Type | Description |
---|---|---|
from |
Integer |
A lower-bound timestamp for log records. |
ip |
Boolean |
Whether to retrieve all records or the records with non-empty |
limit |
Integer |
The maximum number of records to be retrieved. |
login |
Boolean |
Whether to retrieve all records or the records with non-empty |
skip |
Integer |
The number of the first records to be skipped. |
to |
Integer |
An upper-bound timestamp for log records. |
uri |
Boolean |
Whether to retrieve all records or the records with non-empty |
user |
Boolean |
Whether to retrieve all records or the records with non-empty |
Response
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. |
Example
Request
-
Bash
-
JavaScript
-
NodeJS
-
Python
login=<...>
password=<...>
saymon_hostname=<...>
url=http://$saymon_hostname/node/api/limit-block-log?ip=false
curl -X GET $url -u $login:$password
let login = <...>
let password = <...>
let auth = "Basic " + btoa(login + ":" + password)
let path = "/node/api/limit-block-log?limit=1&user=true"
let saymonHostname = <...>
let myHeaders = new Headers();
myHeaders.append("Authorization", auth);
let requestOptions = {
method: 'GET',
headers: myHeaders,
redirect: 'follow'
};
fetch(saymonHostname + path, requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
let http = require('follow-redirects').http;
let fs = require('fs');
let saymonHostname = <...>;
let login = <...>;
let password = <...>;
let path = '/node/api/limit-block-log?limit=1&user=true';
let auth = 'Basic ' + Buffer.from(login + ':' + password).toString('base64');
let options = {
'method': 'GET',
'hostname': saymonHostname,
'path': path,
'headers': {
'Authorization': auth
},
'maxRedirects': 20
};
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 = <...>
path = "/node/api/limit-block-log?limit=1&user=true"
url = "http://" + saymon_hostname + path
response = requests.request("GET", url, auth=(login, password))
print(response.text)