增量修改域名信息
更新時間 2023-11-23 17:12:23
最近更新時間: 2023-11-23 17:12:23
分享文章
本文介紹增量修改域名信息接口
接口描述:調用本接口增量修改加速域名配置信息
請求方式:post
請求路徑:/domain/update-domain
使用說明:
- 修改域名之前,您需要先開通對應產品類型的服務,且保證資源包/按需服務有效;
- 該域名沒有在途工單;
- 單個用戶一分鐘限制調用10000次,并發不超過100
請求參數說明(json):
| 參數名 | 類型 | 是否必填 | 名稱 | 說明 |
|---|---|---|---|---|
| domain | string | 是 | 域名 | |
| product_code | string | 是 | 產品類型 | “007”(安全加速) |
| ipv6_enable | int | 否 | ipv6啟用 | 1(啟用); 2(關閉),未傳代表不修改 |
| origin | list | 否 | 源站信息 | 未傳代表不修改,有傳代表整個數組全量修改 |
| origin[*].origin | string | 是 | 源站ip或域名 | |
| origin[*].port | int | 是 | 源站端口 | 支持http自定義端口,http不支持下發443端口 |
| origin[*].weight | int | 是 | 權重 | 范圍:1-100 |
| origin[*].role | string | 是 | 源站角色 | 取值: master, slave |
| origin[*].protocol | string | 否 | 源站類型 | 默認http,目前不支持自定義配置https源站。 |
| req_host | string | 否 | 回源host | 未傳代表不修改 |
| origin_host_type | int | 否 | 主備源攜帶不同的回源host是否開啟 | 0:關閉 1:開啟,未傳代表不修改 |
| origin_host_http | dict | 否 | http類型origin帶不同的回源host | origin:origin每條的http類型origin當key,不同的回源host當value存儲,例如{ “www.ctyun.1cn”:“www.ctyun.2cn”, },其中key必須是存在的源站origin:origin,未傳代表不修改 |
| black_referer | dict | 否 | referer黑名單 | 未傳代表不修改,有傳代表整個dict全量修改 |
| black_referer.allow_list | list | 是 | referer黑名單列表 | |
| black_referer.allow_empty | string | 是 | 是否允許為空 | “on”(允許為空);“off”(不允許為空) |
| white_referer | dict | 否 | referer白名單 | 未傳代表不修改,有傳代表整個dict全量修改 |
| white_referer.allow_list | list | 是 | referer白名單列表 | |
| white_referer.allow_empty | string | 是 | 是否允許為空 | “on”(允許為空);“off”(不允許為空) |
| filetype_ttl | list | 否 | 文件過期時間設置 | 未傳代表不修改,有傳代表整個數組全量修改 |
| filetype_ttl[*].file_type | string | 是 | 緩存文件類型,多個以逗號隔開 | 0:文件后綴,例如jpg,png,css(以",“分割) 1:目錄,例如/test,/a/b/c(不能以”/"結尾) 2: 首頁,固定為/ 3: 全部文件,固定為/ 4: 全路徑,例如/index.html,/test/*.jpg |
| filetype_ttl[*].ttl | int | 是 | 緩存時間 | 單位秒 |
| filetype_ttl[*].cache_type | int | 是 | 緩存類型 | 1(不緩存);2(優先遵循源站);3(強制緩存) |
| filetype_ttl[*].cache_with_args | int | 是 | 是否帶參數緩存 | 0(不帶參數緩存);1(帶參數緩存) |
| filetype_ttl[*].mode | int | 否 | 模式 | 0(文件后綴);1(目錄);2(首頁); 3(全部文件);4(全路徑);5(正則),不傳默認0 |
| filetype_ttl[*].priority | int | 否 | 優先級 | 不傳默認10 |
| ip_black_list | string | 否 | ip黑名單 | 黑白名單只允許存在一個,若同時存在只處理黑名單,多個ip以逗號分隔,示例:1.1.1.1,2.2.2.2,::1,未傳代表不修改 |
| ip_white_list | string | 否 | ip白名單 | 黑白名單只允許存在一個,若同時存在只處理黑名單,多個ip以逗號分隔,示例:1.1.1.1,2.2.2.2,::1,未傳代表不修改 |
| req_headers | list | 否 | 自定義回源請求頭 | 未傳代表不修改,有傳代表整個數組全量修改 |
| req_headers[*].key | string | 是 | 自定義回源請求頭名稱 | |
| req_headers[*].value | string | 否 | 自定義回源請求頭值 | value為""代表刪除對應的請求頭 |
| resp_headers | list | 否 | 自定義響應頭 | 未傳代表不修改,有傳代表整個數組全量修改 |
| resp_headers[*].key | string | 是 | 自定義響應頭名稱 | |
| resp_headers[*].value | string | 否 | 自定義請求頭值 | value為""代表刪除對應的響應頭 |
| error_code | list | 否 | 錯誤碼緩存配置 | 未傳代表不修改,有傳代表整個數組全量修改 |
| error_code[*].code | list | 是 | 錯誤狀態碼 | 多個用逗號間隔 |
| error_code[*].ttl | int | 是 | 緩存時間 | 單位秒 |
| shared_host | string | 否 | 共享緩存域名 | 未傳代表不修改 |
| https_status | string | 否 | 是否開啟https | 取值:on、off,取值為on時,cert_name為必傳字段,未傳代表不修改 |
| cert_name | string | 否 | 證書備注名 | 證書備注名,如果證書存在,此備注名必須存在,未傳代表不修改 |
| https_basic | dict | 否 | https基礎配置 | 未傳代表不修改,有傳代表整個dict全量修改 |
| https_basic.https_force | string | 否 | https強制跳轉 | “on”(跳轉);“off”(不跳轉) |
| https_basic.http_force | string | 否 | http強制跳轉 | “on”(跳轉);“off”(不跳轉) |
| https_basic.force_status | string | 否 | 強制跳轉狀態碼 | 不傳默認302 |
| https_basic.origin_protocol | string | 是 | https回源協議 | 取值: http:用http協議回源 https:用https協議回源,follow_request:跟隨訪問協議進行回源 |
| basic_conf | dict | 否 | http配置基礎信息 | 未傳代表不修改,有傳代表整個dict全量修改 |
| basic_conf.use_http2 | int | 否 | 是否開啟http2 | 取值0:不開啟,1:開啟 默認0 |
| basic_conf.follow302 | int | 否 | 是否拉取跳轉后文件 | 0: 否 1:是 |
| limit_speed_uri | list | 否 | 基于url參數限速 | 未傳代表不修改,有傳代表整個數組全量修改 |
| limit_speed_uri[*].id | string | 是 | limit_speed_uri列表內唯一 | 可以考慮使用時間戳拼上列表索引,比如時間戳為11657615509083,拼上序列化0,則id為:116576155090830 |
| limit_speed_uri[*].args | string | 是 | uri參數名 | |
| limit_speed_uri[*].unit | string | 是 | 單位 | 可選值b/s,Kb/s,Mb/s |
| limit_speed_uri[*].time_seg | string | 否 | 時段 | 正則表達式,比如:(08:[2-5][0-9] |
| limit_speed_uri[*].weight | int | 否 | 優先級 | 默認值10,取值范圍[1,) |
| limit_speed_uri_condition | dict | 否 | limit_speed_uri的condition配置 | { “{key}”:[ { “mode”:類型, “content”:“配置內容,多個以逗號間隔” } ] } mode類型為int,取值: 默認0, 0:文件后綴 1:目錄 2: 首頁 3: 全部文件 4: 全路徑, key為limit_speed_uri中的id 限制: 一個key對應的數組大小只能是1,因為配置平臺實際只支持配置一條 content必填,長度大于0,不能為空字符串或者空白字符串 使用數組除了保持和已有其他功能使用一致性,也方便將來擴展 |
| limit_speed_const | list | 否 | 基于固定值限速 | 未傳代表不修改,有傳代表整個數組全量修改 |
| limit_speed_const[*].id | string | 是 | limit_speed_const列表內唯一 | 可以考慮使用時間戳拼上列表索引,比如時間戳為11657615509083,拼上序列化0,則id為:116576155090830 |
| limit_speed_const[*].unit | string | 是 | 單位 | 可選值b/s,Kb/s,Mb/s |
| limit_speed_const[*].rate | int | 是 | 限速值 | 取值范圍[0,) |
| limit_speed_const[*].time_seg | string | 否 | 時段 | 正則表達式,比如:(08:[2-5][0-9] |
| limit_speed_const[*].weight | int | 否 | 優先級 | 默認值10,取值范圍[1,) |
| limit_speed_const_condition | dict | 否 | limit_speed_const的condition配置 | { “{key}”:[ { “mode”:類型, “content”:“配置內容,多個以逗號間隔” } ] } mode類型為int,取值: 默認0, 0:文件后綴 1:目錄 2: 首頁 3: 全部文件 4: 全路徑, key為limit_speed_const中的id 限制: 一個key對應的數組大小只能是1,因為配置平臺實際只支持配置一條 content必填,長度大于0,不能為空字符串或者空白字符串 使用數組除了保持和已有其他功能使用一致性,也方便將來擴展 |
返回參數說明:
| 參數 | 類型 | 是否必傳 | 名稱及描述 |
|---|---|---|---|
| code | int | 是 | 狀態碼,成功100000 |
| message | string | 是 | 描述信息,成功返回success,其他返回異常信息描述 |
示例:
請求路徑://cdnapi-global.ctapi.daliqc.cn/domain/update-domain
示例1:
請求參數:
{
"domain": "www.daliqc.cn",
"product_code": "007",
"ipv6_enable": 2,
"origin": [
{
"role": "master",
"port": 80,
"origin": "1.1.1.1",
"weight": 10
}
],
"req_host": "www.daliqc.cn",
"black_referer": {
"allow_list": [
"www.daliqc.cn1"
],
"allow_empty": "on"
},
"white_referer": {
"allow_list": [
"www.daliqc.cn"
],
"allow_empty": "on"
},
"filetype_ttl": [
{
"ttl": 300,
"file_type": "ts,mp4",
"cache_type": 2,
"mode": 0,
"cache_with_args": 0
}
],
"ip_black_list": "1.1.1.1,2.2.2.2,3.3.3.3",
"resp_headers": [
{
"value": "reqheadertest",
"key": "Test"
}
],
"https_status": "off",
"https_basic": {
"https_force": "on",
"origin_protocol": "https"
},
"basic_conf": {
"https_return": "off"
},
"limit_speed_uri": [
{
"id": "116576155090830",
"unit": "Kb/s",
"args": "good",
"weight": 2
}
],
"limit_speed_uri_condition": {
"116576155090830": [
{
"mode": 1,
"content": "/sss"
}
]
},
"limit_speed_const": [
{
"id": "116576155090830",
"unit": "Mb/s",
"rate": 1,
"weight": 2
}
],
"limit_speed_const_condition": {
"116576155090830": [
{
"mode": 1,
"content": "/sss"
}
]
}
}
返回結果:
{
"code": 100000,
"message": "success"
}
錯誤碼請參考:API返回參數code和message含義