Get list of blocked requests

Returns a list of requests blocked by REST-server limits.

Request

HTTP Request

GET /node/api/limit-block-log

Permissions

manage-users

Path parameters

No parameters required.

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 ip value only. If set to true, only the records with non-empty ip value will be retrieved. Default is false.

limit

Integer

The maximum number of records to be retrieved.

login

Boolean

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

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 uri value only. If set to true, only the records with non-empty uri value will be retrieved. Default is false.

user

Boolean

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.

Request body

The request body is 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)

Response

[
    {
        "timestamp": 1617960251155,
        "ttl": 47,
        "user": "57ff6853fa6db3a63d16d07b",
        "uri": "/api/objects/:id/stat",
        "login": "user"
    },
...
]