百度智能云

All Product Document

          CDN

          url Blocking Related Interfaces

          Quota Query Interface

          This interface is used to query the url blocked capacity and the used capacity of the current user.

          Method Path Description
          GET /v2/firewalls/forbidden/quota Query the URL forbidden capacity and the capacity used of the current user.

          Request Example:

          GET /v2/firewalls/forbidden/quota HTTP/1.1
          Host: cdn.baidubce.com

          Response Body

          Parameters Optional Type Description
          quota Required unsigned int Total URL blocking capacity
          count Required unsigned int Number of the currently-blocked urls

          Response Example:

          HTTP/1.1 200 OK
          Server: nginx/1.1.10
          Date: Thu, 17 Dec 2020 12:14:38 GMT
          Content-Type: application/json; charset=utf-8
          Transfer-Encoding: chunked
          Connection: keep-alive
          X-Powered-By: PHP/7.2.28
          x-bce-request-id: b1c22e2f-6a28-2f7b-a06a-df4de49cee98
           
          
          {"quota":50,"count":5}

          Blocked url List Query Interface

          This interface is used to query the url blocking list-the query result does not contain the protocol and url parameter and supports paging.

          Method Path Description
          GET /v2/firewalls/forbidden/urls Query blocked URL list.

          Url Parameter

          Parameters Optional Type Description
          pageSize Optional unsigned int The page size for paging query, whose default value is 10, and the maximum value does not exceed 100.
          pageNo Optional unsigned int Specifies the page number. The default value is 1.
          orderBy Optional string The value is desc or asc, which specifies whether the results are output in descending or ascending order. The default value is desc, indicating that the information is output in reverse order. When it is set to asc, it is output in chronological order.
          url Optional string For the specified URL query, the URL path cannot exceed 1,024 characters.

          Request Example:

          GET /v2/firewalls/forbidden/urls HTTP/1.1
          Host: cdn.baidubce.com

          Response Body

          Parameters Optional Type Description
          count Required unsigned int Total number of query results, which is used for paging.
          urlRecords Required list<urlRecord> Query results

          urlRecord type description

          Parameters Optional Type Description
          url Required string Blocked URL
          time Required string Blocking time (Beijing time)

          Response Example:

          HTTP/1.1 200 OK
          Server: nginx/1.1.10
          Date: Thu, 17 Dec 2020 12:02:36 GMT
          Content-Type: application/json; charset=utf-8
          Transfer-Encoding: chunked
          Connection: keep-alive
          X-Powered-By: PHP/7.2.28
          x-bce-request-id: 847dd852-5f97-d906-e2c8-af6fd1231b97
           
          
          {
              "count": "5",
              "urlRecords": [
                  {
                      "url": "test.aaa.baidu.com\/1.html",
                      "time": "2020-08-18 16:31:13"
                  },
                  {
                      "url": "test.aaa.baidu.com\/3.html",
                      "time": "2020-08-18 16:31:13"
                  },
                  {
                      "url": "test.aaa.baidu.com\/a.html",
                      "time": "2020-08-18 16:31:13"
                  },
                  {
                      "url": "test.aaa.baidu.com\/b.html",
                      "time": "2020-08-18 16:31:13"
                  },
                  {
                      "url": "test.aaa.baidu.com\/c.html",
                      "time": "2020-08-18 16:31:13"
                  }
              ]
          }

          url Blocking Record Query

          This interface is used to query the url blocking operation record-the query result url has no protocol, no parameters, and supports paging

          Method Path Description
          GET /v2/firewalls/forbidden/operateHistories Query the url blocking records.

          url Parameter

          Parameters Optional Type Description
          pageSize Optional unsigned int The page size for paging query, whose default value is 10, and the maximum value does not exceed 100.
          pageNo Optional unsigned int Specify the page number. The default value is 1.
          startTime Optional string Specify a time range for query. The start time should not be more than 90 days from the current time (Beijing time).
          endTime Optional string Specify a time range for query. The deadline cannot be greater than the current time (Beijing time).
          orderBy Optional string The value is desc or asc, which specifies whether the results are output in descending or ascending order. The default value is desc, indicating that the information is output in reverse order. When it is set to asc, it is output in chronological order.
          url Optional string For the specified URL query, the URL path cannot exceed 1,024 characters.

          Request Example:

          GET /v2/firewalls/forbidden/operateHistories HTTP/1.1
          Host: cdn.baidubce.com

          Response Body

          Parameters Optional Type Description
          count Required unsigned int Total number of query results, which is used for paging.
          operateHistories Required list<operateHistory> Query results

          operateHistory Type Description

          Parameters Optional Type Description
          url Required string Blocked URL
          action Required unsigned int Operation executed. 1 indicates the ban operation, and 0 indicates the unban operation.
          time Required string Blocking time (Beijing time)

          Response Example:

          HTTP/1.1 200 OK
          Server: nginx/1.1.10
          Date: Thu, 17 Dec 2020 12:05:17 GMT
          Content-Type: application/json; charset=utf-8
          Transfer-Encoding: chunked
          Connection: keep-alive
          X-Powered-By: PHP/7.2.28
          x-bce-request-id: 88a24d76-5348-4c22-60d1-d31ddfc8f12
           
           
          {
              "count": "7",
              "urlHistories": [
                  {
                      "url": "test.aaa.baidu.com\/1.html",
                      "action": 1,
                      "time": "2020-08-18 16:31:13"
                  },
                  {
                      "url": "test.aaa.baidu.com\/3.html",
                      "action": 1,
                      "time": "2020-08-18 16:31:13"
                  },
                  {
                      "url": "test.aaa.baidu.com\/a.html",
                      "action": 1,
                      "time": "2020-08-18 16:31:13"
                  },
                  {
                      "url": "test.aaa.baidu.com\/7.html",
                      "action": 0,
                      "time": "2020-08-18 12:52:55"
                  },
                  {
                      "url": "test.aaa.baidu.com\/4.html",
                      "action": 0,
                      "time": "2020-08-18 12:52:55"
                  },
                  {
                      "url": "test.aaa.baidu.com\/b.html",
                      "action": 1,
                      "time": "2020-08-18 16:31:13"
                  },
                  {
                      "url": "test.aaa.baidu.com\/c.html",
                      "action": 1,
                      "time": "2020-08-18 16:31:13"
                  }
              ]
          }

          URL Blocking Interface

          This interface is used to perform the URL blocking.

          Method Path Description
          POST /v2/firewalls/forbidden/ban url blocking

          Request Body

          Parameters Optional Type Description
          urls Required list<string> The list of urls to be blocked. The protocol and parameters are ignored during blocking. The urls list cannot exceed 10. The url path cannot have more than 1024 characters.

          Request Example:

          POST /v2/firewalls/forbidden/ban HTTP/1.1
          Host: cdn.baidubce.com
          
          {
              "urls": [
                  "www.test.com/case.xml",
                  "https://www.test.com/case.index",
                  "http://www.test.com/case.xml"
              ]
          }

          Response Body

          None

          URL Unblocking Interface

          This interface is used to perform the URL unblocking operation.

          Method Path Description
          POST /v2/firewalls/forbidden/unban URL Unblocking

          Request Body

          Parameters Optional Type Description
          urls Required list<string> The list of URLs to be blocked. The protocol and parameters are ignored during blocking. The URL list cannot exceed 10. The url path cannot have more than 1024 characters.

          Request Example:

          GET /v2/firewalls/forbidden/unban HTTP/1.1
          Host: cdn.baidubce.com
          
          {
              "urls": [
                  "www.test.com/case.xml",
                  "https://www.test.com/case.index",
                  "http://www.test.com/case.xml"
              ]
          }

          Response Body

          None

          Previous
          IP Query Interface
          Next
          SDK Reference