WAF、Application Shield
CDNW的WAF计费需要用到WAF域名使用记录信息用于确认域名带宽的计算逻辑,CDNW的接口调用无法通过内部XDR同步,因此需要封装一个W+接口给CDNW调用。
参数名称 | 类型 | 必填 | 描述 |
---|---|---|---|
beginTime | String | 是 | 开始时间,格式为yyyy-mm-dd hh:mm:ss |
#!/bin/bash username="example_username" apiKey="example_apiKey" date=`env LANG="en_US.UTF-8" date -u "+%a, %d %b %Y %H:%M:%S GMT"` password=`echo -en "$date" | openssl dgst -sha1 -hmac $apiKey -binary | openssl enc -base64` curl -i --url " https://open.chinanetcenter.com/waf/api/secDomainBillingCDNW" \ -X "POST" \ -u "$username:$password" \ -H "Date: $date" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d ' { "beginTime":"2019-02-11 16:09:00", "endTime":"2019-02-11 16:10:00", "customer":"customer", } '
{ "code": 200, "data": [ { "serviceType": "1", "enddate": "-", "domain": "www.test.com", "id": 1, "startdate": "2018-12-19 10:48:45" } ] }