Retrieve IP blacklist entry or whitelist entry.
GET
/show
Path parameters
-
access_token
string
required
token to be passed as a header -
id
integer
required
The unique id of the IP blacklist entry or whitelist entry.
Sample Request
curl -v -X GET http://127.0.0.1:8990/api/ip_filter/show \
-H "Content-Type: application/json" \
-H "access_token: 4DFCF1D4C30B4D798ECE3AE43769F008" \
Responses
200
Successful operation
application/json
-
expires_time
string
IP rule's expires time. Date-time string in ISO 8601 format (e.g. 2017-01-01 00:00:00) -
ip
string
IP rule's IP V4 address. -
description
string
Remarks for the IP rule. -
id
integer
The unique id of the IP blacklist entry or whitelist entry. -
type
string
IP rule's type. -
mask
string
IP rule's IP mask.
Sample Response
{}
Destroy an IP blacklist entry or whitelist entry.
POST
/destroy
Destroy a certain IP blacklist entry or whitelist entry.
Path parameters
-
access_token
string
required
token to be passed as a header
Request body
application/json
-
id
integer
required
The unique id of the IP blacklist entry or whitelist entry.
Sample Request
curl -v -X POST http://127.0.0.1:8990/api/ip_filter/destroy \
-H "Content-Type: application/json" \
-H "access_token: 4DFCF1D4C30B4D798ECE3AE43769F008" \
-d '{
"id": 123
}'
Responses
200
Successful operation
400
Invalid rule ID supplied.
Sample Response
Update IP blacklist entry or whitelist entry
POST
/update
Update IP blacklist entry or whitelist entry that already exists.
Path parameters
-
access_token
string
required
token to be passed as a header
Request body
application/json
-
expires_time
string
required
IP rule's expires time. Date-time string in ISO 8601 format (e.g. 2017-01-01 00:00:00) -
mask
string
required
IP rule's IP mask. -
description
string
required
Remarks for the IP rule. -
ip
string
required
IP rule's IP V4 address. -
type
string
required
IP rule's type. -
id
integer
required
The unique id of the IP blacklist entry or whitelist entry.
Sample Request
curl -v -X POST http://127.0.0.1:8990/api/ip_filter/update \
-H "Content-Type: application/json" \
-H "access_token: 4DFCF1D4C30B4D798ECE3AE43769F008" \
-d '{
"mask": "255.255.255.0",
"id": 123,
"ip": "192.168.1.1"
}'
Responses
200
Successful operation
Sample Response
Add a new IP blacklist entry or whitelist entry to the system.
POST
/create
Path parameters
-
access_token
string
required
token to be passed as a header
Request body
application/json
-
expires_time
string
required
IP rule's expires time. Date-time string in ISO 8601 format (e.g. 2017-01-01 00:00:00) -
ip
string
required
IP rule's IP V4 address. -
description
string
required
Remarks for the IP rule. -
type
string
required
IP rule's type. -
mask
string
required
IP rule's IP mask.
Sample Request
curl -v -X POST http://127.0.0.1:8990/api/ip_filter/create \
-H "Content-Type: application/json" \
-H "access_token: 4DFCF1D4C30B4D798ECE3AE43769F008" \
-d '{
"ip": "192.168.1.1",
"mask": "255.255.255.0"
}'
Responses
200
Created blacklist entry or whitelist entry.
application/json
-
id
integer
The unique id of the IP blacklist entry or whitelist entry.
Sample Response
{
"id": 123
}
Retrieve a collection of IP blacklist entries or whitelist entries.
GET
/list
Retrieve a collection of IP blacklist entries or whitelist entries.
Path parameters
-
access_token
string
required
token to be passed as a header -
pagination
integer
required
The pagination of paging. -
pagesize
integer
required
The size of paging. -
sort_by
string
optional
Default value will be used when user does not specify value for this field.
Sample Request
curl -v -X GET http://127.0.0.1:8990/api/ip_filter/list \
-H "Content-Type: application/json" \
-H "access_token: 4DFCF1D4C30B4D798ECE3AE43769F008" \
Responses
200
Successful operation
application/json
-
pagesize
integer
-
count
integer
-
pagination
integer
-
ip_filters
array
-
sort_by
string
Sample Response
{
"pagesize": 10,
"count": 100,
"pagination": 8,
"sort_by": "DEFAULT"
}