Monitoring Sites

View Current Monitoring Sites

URL

https://api.ddosmon.net/open/site

Request

  • Method: GET

Response

{
  "data": [
    {
      "create_time": "2017-04-17T03:30:29+00:00",
      "group_id": null,
      "group_name": "",
      "host": "www.example.com",
      "is_enable": true,
      "user_email": "ddosmon@360.cn"
    },
  ],
  "status": 1
}

The response body are json encode message, status 1 indicate request sucess, 0 indicate error


Add Sites

URL

https://api.ddosmon.net/open/site/add

Request

  • Method: POST
  • Body: json encode data

The request body are json encode site list that wanna be monitoring.

{"hosts":["1.1.1.1", "1.1.1.1/24", "www.example.com", "*.example.com"]}

note: If invalid request body be received, HTTP 400 BAD REQUEST will be return.

Full Example

curl -i -X POST \
         -H "Content-Type: application/json" \
         -H "X-NISS-AuthToken:13f9c3c0-ea2b-403b-ba47-599f2a8fdf08" \
         -H "X-NISS-AuthEmail:example@example.com"      \
         -d '{"hosts":["1.1.1.1", "1.1.1.1/24", "www.example.com", "*.example.com"]}' \
         https://api.ddosmon.net/open/site/add

Host records support the four formats:

  • FQDN

    www.example.com

  • Domain Wildcard

    *.example.com

  • IPv4

    127.0.0.1

  • IPv4/CIDR (CIDR must be >= 24)

    127.0.0.1/24

Response

{
 "status": 0,
  "error": [
    {
      "1.1.1.1/14": "The CIDR prefix must be >=24"
    }
  ],
  "success": [
    "1.1.1.1",
    "www.example.com",
    "*.example.com"
  ]
}
  • status
    has three possible value:
    • 1: All sites be add successfully
    • 0: Some of sites add failed
    • -1: All sites be failed
  • error
    list all failed sites, and value explains why the site be reject
  • success
    list the sites be add successfully

Delete Sites

URL

https://api.ddosmon.net/open/site/delete

Request

  • Method: POST
  • Body: json encode data

The request body are json encode site list that wanna be delete.

{"hosts":["1.1.1.1", "www.example.com", "a.com"]}

note: If invalid request body be received, HTTP 400 BAD REQUEST will be return.

Full Example

curl -i -X POST \
         -H "Content-Type: application/json" \
         -H "X-NISS-AuthToken:13f9c3c0-ea2b-403b-ba47-599f2a8fdf08" \
         -H "X-NISS-AuthEmail:example@example.com"      \
         -d '{"hosts":["1.1.1.1", "www.example.com", "a.com"]}' \
         https://api.ddosmon.net/open/site/delete

Response

{
  "status": 0,
  "error": [
    "a.com"
  ],
  "success": [
    "1.1.1.1",
    "www.example.com"
  ]
}
  • status
    has three possible value:
    • 1: All sites be delete successfully
    • 0: Some of sites delete failed
    • -1: All sites be failed
  • error
    list all sites be delete failed. Most of the time, error is caused by trying to delete not owner yourself sites.
  • success
    list the sites be delete successfully

Enable Sites

URL

https://api.ddosmon.net/open/site/enable

Enable monitoring the sites you have added. This API is highly similar as delete-sites. API. Both request and response are identical except the request URL


Disable Sites

URL

https://api.ddosmon.net/open/site/disable

Disable monitoring the sites you have added. This API is highly similar as delete-sites. API. Both request and response are identical except the request URL