# Global IP List

# Create Global IP List

# Uri
POST /admin-api/global/1/ip_list
# Json body
  • name

    type: string

    required: yes

    description: name of global ip list

  • ip

    type: array

    required: both ip and ipv6 must have one

    description: ip list (v4)

  • ipv6

    type: array

    required: both ip and ipv6 must have one

    description: ip list (v4)

# Request example
# Shell
curl \
  -X POST \
  -H "API-token: 1df87165-3593-4eca-a910-9ac20005e6ec" \
  http://admin-site/admin-api/global/1/ip_list \
  -d '{
      "name": "ip-list-1",
      "ip": [
        "127.0.0.1", "127.0.0.2/32"
      ]
  }'
# Response example
Status: 200 OK
{ "status":0, "data": {"id": 1} }

# Modify the Global IP List

# Uri
PUT /admin-api/global/1/ip_list/{ip_list_id}
# Request example
# Shell
curl \
  -X PUT \
  -H "API-token: 1df87165-3593-4eca-a910-9ac20005e6ec" \
  http://admin-site/admin-api/global/1/ip_list/1 \
  -d '{
      "ip": ["10.0.0.100"],
  }'
# Response example
Status: 200 OK
{ "status":0 }

# Fetch Global IP List

# Uri
GET /admin-api/global/1/ip_list
# Request example
# Shell
curl \
  -H "API-token: 1df87165-3593-4eca-a910-9ac20005e6ec" \
  http://admin-site/admin-api/global/1/ip_list
# Response example
Status: 200 OK
{
  "data": [
    {
      "id": 1,
      "ip": [
        "127.0.0.1/32",
        "127.0.0.2/32"
      ],
      "name": "ip-list-1"
    },
    {
      "id": 2,
      "ip": [
        "127.0.0.3/32",
        "127.0.0.4/32"
      ],
      "name": "ip-list-2"
    }
  ],
  "status": 0
}

# Remove IP List by id

# Uri
DELETE /admin-api/global/1/ip_list/{ip_list_id}
# Request example
curl \
  -X DELETE \
  -H "API-token: 1df87165-3593-4eca-a910-9ac20005e6ec" \
  http://admin-site/admin-api/global/1/ip_list/1
# Response example
Status: 200 OK
{"status": 0}