百度智能云

All Product Document

          CDN

          Set the IP Access Frequency Limit

          Limit the number of visits per second of a single IP, and it is targeted at all paths. This interface is used to set IP access limit.

          Method Path Description
          PUT /v2/domain/{domain}/config?accessLimit Limit the count of access per second to a single node of IP

          domain: CDN accelerated domain name.

          Request body

          Parameter Optional Type Description
          accessLimit Required AccessLimit Control IP access limit

          AccessLimit:

          Parameter Optional Type Description
          enabled Required bool true means enabling visit frequency limit for a single IP node, and false means cancelling frequency limit.
          limit Optional int Maximum number of requests of a single IP node in one second. When enabled is true, this item is 1000 by default, and when enabled is false, this item is meaningless.

          Response code (Http Status Code)

          HTTP Status Code Description
          200 Success
          400 Update failures, parameter errors, etc.

          Request example

          PUT /v2/domain/myself.baidu.com/config?accessLimit HTTP/1.1 
          Host: cdn.baidubce.com 
          Content-Length: 45
          Content-Type: application/json
          
          { 
              "accessLimit":{ 
                  "enabled":true, 
                  "limit":200 
              } 
          } 

          Response example

          HTTP/1.1 200 OK 
          Content-Type: application/json; charset=utf-8 
          Transfer-Encoding: chunked 
          
          { 
              "status":"OPERATING" 
          } 
          Previous
          Query for Access IP of Real User
          Next
          Query IP Access Frequency Limit