百度智能云

All Product Document

          CDN

          Update the Domain Name Configuration in Parallel

          Interface

          This interface is used to update multiple configuration items at the same time. At present, this interface supports the following configuration items:
          cacheTTL
          cacheFullUrl
          ipACL
          refererACL
          https
          requestAuth
          followProtocol
          rangeSwitch
          cors
          dsa
          seoSwitch
          mediaDragConf
          origin
          httpHeader
          clientIp
          errorPage
          fileTrim
          mobileAccess
          accessLimit
          compress
          trafficLimit

          Method Path Description
          PUT /v2/domain/{domain}/config?multiConfigs Multi-configuration updating interface

          domain: Modify the configured CDN acceleration domain name.

          Request body

          Parameter Optional Type Description
          multiConfigs Required list<config> config is single configuration, same as the parameter of the single configuration item interface. Note You have to set a cacheFullUrl outside the single configuration parameter for the cacheFullUrl configuration parameter. For details, please see the request example 2.

          Response code (Http Status Code)

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

          Request example 1 - update origin server configuration

          PUT /v2/domain/myself.baidu.com/config?multiConfigs HTTP/1.1 
          Host: cdn.baidubce.com 
          Content-Length: 118
          Content-Type: text/json;utf-8
          
          { 
              "multiConfigs": { 
                  "origin": [ 
                      { 
                          "peer": "http:\/\/[2001:da8:1:100::13]:80", 
                          "host": "ipv6.tsinghua.edu.cn" 
                      }, 
                      { 
                          "peer": "https:\/\/222.111.8.205", 
                          "host": "ipv6.tsinghua.edu.cn", 
                          "backup": true 
                      } 
                  ] 
              } 
          } 

          Response example 1

          HTTP/1.1 200 OK 
          Server: nginx/1.14.0 
          Date: Sun, 09 Feb 2020 11:34:30 GMT 
          Content-Type: application/json; charset=utf-8 
          Transfer-Encoding: chunked 
          Connection: keep-alive 
          X-Powered-By: PHP/5.6.36 
          x-bce-request-id: dcecbaaa-7e81-add-171a-93e988b87ed5
           
          {"status":"RUNNING"} 

          Request example 2 - update the origin server configuration and cached parameter filtration rule configuration at the same time

          PUT /v2/domain/myself.baidu.com/config?multiConfigs HTTP/1.1 
          Host: cdn.baidubce.com 
          Content-Length: 218
          Content-Type: text/json;utf-8
          
          { 
              "multiConfigs": { 
                  "origin": [ 
                      { 
                          "peer": "http:\/\/[2001:da8:1:100::13]:80", 
                          "host": "ipv6.tsinghua.edu.cn" 
                      }, 
                      { 
                          "peer": "https:\/\/222.111.8.205", 
                          "host": "ipv6.tsinghua.edu.cn", 
                          "backup": true 
                      } 
                  ], 
                  "cacheFullUrl": { 
                      "cacheFullUrl": false, 
                      "cacheUrlArgs": [ 
                          "a", 
                          "b" 
                      ] 
                  } 
              } 
          } 

          Response example 2

          HTTP/1.1 200 OK 
          Server: nginx/1.14.0 
          Date: Sun, 09 Feb 2020 11:34:30 GMT 
          Content-Type: application/json; charset=utf-8 
          Transfer-Encoding: chunked 
          Connection: keep-alive 
          X-Powered-By: PHP/5.6.36 
          x-bce-request-id: dcecbaaa-7e81-add-171a-93e988b87ed5
           
          {"status":"RUNNING"} 

          Request example 3 - update all configurations at the same time

          PUT /v2/domain/myself.baidu.com/config?multiConfigs HTTP/1.1 
          Host: cdn.baidubce.com 
          Content-Length: 218
          Content-Type: text/json;utf-8
          
          { 
              "multiConfigs": { 
                  "origin": [ 
                      { 
                          "peer": "111.111.8.205", 
                          "host": "ipv6.tsinghua.edu.cn" 
                      } 
                  ], 
                  "cacheTTL": [ 
                      { 
                          "type": "suffix", 
                          "value": ".jpg", 
                          "ttl": 3600, 
                          "weight": 10 
                      } 
                  ], 
                  "cacheFullUrl": { 
                      "cacheFullUrl": false, 
                      "cacheUrlArgs": [ 
                          "a", 
                          "b" 
                      ] 
                  }, 
                  "ipACL": { 
                      "blackList": [ 
                          "1.1.1.2",
                          "1.1.1.3"
                      ] 
                  }, 
                  "refererACL": { 
                      "blackList": [ 
                          "www.xxx.com",
                          ".abcde.com." 
                      ], 
                      "allowEmpty": true 
                  }, 
                  "https": { 
                      "enabled": false 
                  }, 
                  "requestAuth": { 
                      "type": "A", 
                      "key1": "JFSDKFJLS", 
                      "key2": "JLFS2fjkd", 
                      "timeout": 1800, 
                      "timestampMetric": 10 
                  }, 
                  "followProtocol": true, 
                  "rangeSwitch": true, 
                  "cors": { 
                      "allow": "on", 
                      "originList": [ 
                          "http:\/\/www.baidu.com", 
                          "http:\/\/*.bce.com" 
                      ] 
                  }, 
                  "dsa": { 
                      "enabled": true, 
                      "rules": [ 
                          { 
                              "type": "suffix", 
                              "value": ".mp4;.jpg;.php" 
                          }, 
                          { 
                              "type": "path", 
                              "value": "\/path" 
                          }, 
                          { 
                              "type": "exactPath", 
                              "value": "\/path\/to\/file.mp4" 
                          } 
                      ], 
                      "comment": "test" 
                  }, 
                  "httpHeader": [ 
                      { 
                          "type": "origin", 
                          "header": "x-auth-cn", 
                          "value": "xxxxxxxxx", 
                          "action": "add" 
                      }, 
                      { 
                          "type": "response", 
                          "header": "content-type", 
                          "value": "application\/octet-stream", 
                          "action": "add" 
                      } 
                  ], 
                  "seoSwitch": { 
                      "diretlyOrigin": "ON", 
                      "pushRecord": "OFF" 
                  }, 
                  "clientIp": { 
                      "enabled": true, 
                      "name": "X-Real-IP" 
                  }, 
                  "errorPage": [ 
                      { 
                          "code": 404, 
                          "redirectCode": 302, 
                          "url": "\/customer_404.html" 
                      } 
                  ], 
                  "mediaDragConf": { 
                      "mp4": { 
                          "fileSuffix": [ 
                              "mp4",
                              "m4a" 
                          ], 
                          "startArgName": "startIndex", 
                          "dragMode": "second" 
                      }, 
                      "flv": { 
                          "dragMode": "byteAV" 
                      } 
                  }, 
                  "fileTrim": true, 
                  "mobileAccess": { 
                      "distinguishClient": true 
                  }, 
                  "accessLimit": { 
                      "enabled": true, 
                      "limit": 200 
                  }, 
                  "compress": { 
                      "allow": true, 
                      "type": "br" 
                  }, 
                  "trafficLimit": { 
                      "enable": true, 
                      "limitRate": 10485760, 
                      "limitStartHour": 10, 
                      "limitEndHour": 19, 
                      "limitRateAfter": 0, 
                      "trafficLimitArg": "rate", 
                      "trafficLimitUnit": "m" 
                  }, 
              } 
          } 

          Response example 3

          HTTP/1.1 200 OK 
          Server: nginx/1.14.0 
          Date: Sun, 09 Feb 2020 11:34:30 GMT 
          Content-Type: application/json; charset=utf-8 
          Transfer-Encoding: chunked 
          Connection: keep-alive 
          X-Powered-By: PHP/5.6.36 
          x-bce-request-id: dcecbaaa-7e81-add-171a-93e988b87ed5
           
          {"status":"RUNNING"} 
          Previous
          Set HTTPS Acceleration
          Next
          Access Control Interface