add_fine – charge fines to IP addresses

April 17, 2024

ID 249345

add_fine(Auth, client_id, resource_id, ip_list, fine, ttl)

Description: the method charges active for the specified period of time fines to IP addresses.

Input parameters:

client_id (int) – customer ID (integer from 1 to 4 294 967 295).

resource_id (int) – resource ID (integer from 1 to 4 294 967 295), or -1 for all resources of the customer.

ip_list (str) – list of IP addresses in text format (CIDR, IP_first-IP_last, IP).

fine (int) – charged fine (integer, from -100 to 100, except 0).

ttl (int) – blocking time in seconds. In case of unblocking it is time of trust to the address (integer, from 600 to 3600).

Note:

The number of IP addresses must be from 1 to 256.

It is forbidden to add 0.0.0.0 IP address.

Result:

A JSON notation string of the following structure:

{

result (str) - OK or ERROR

errors (dict): {

<RESOURCE_ID_1>: [IP1, IP2, ...], //list of blocked IP addresses (when transmitting fine > 0) or

<RESOURCE_ID_2>: [IP3, IP4, ...], //list of trusted IP addresses (when transmitting fine < 0) for each resource.

...

}

}

For more information about the fines system, see the article about the KDP fines system.

Did you find this article helpful?
What can we do better?
Thank you for your feedback! You're helping us improve.
Thank you for your feedback! You're helping us improve.