調用BatchSetCdnDomainConfig進行網域名稱大量設定。
介面說明
單使用者調用頻率:3 次/秒。
支援大量設定網域名稱,多個網域名稱用半形逗號(,)分隔,一次最多支援配置 50 個網域名稱。
調用 BatchSetCdnDomainConfig 給網域名稱配置某些功能後,將會產生唯一的 ConfigId,通過 ConfigId 可以完成更新和刪除配置操作。具體使用方法,請參見 ConfigId 使用與查詢。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
cdn:BatchSetCdnDomainConfig |
update |
*Domain
|
無 |
|
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| DomainNames |
string |
是 |
加速網域名稱,多個網域名稱用半形逗號(,)分隔,注意以下配置限制:
|
www.example.com |
| Functions |
string |
是 |
功能列表,一次傳入最多 50 條,格式如下:
parentId 為 -1:表示刪除該配置裡面已有的規則條件。
不使用 parentId 的情況下,配置樣本如下: 使用函數origin_request_header添加回源 HTTP 要求頭的時候引用了configid=222728944812032的規則條件,請求參數如下:
使用 parentId 的情況下,配置樣本如下: 使用函數origin_request_header添加回源 HTTP 要求頭的時候引用了configid=222728944812032的規則條件,請求參數如下:
對一個已經使用了 parentId 的功能配置刪除對 parentId 的引用,配置樣本如下: 函數origin_request_header添加回源 HTTP 要求頭的時候已經引用了configid=222728944812032的規則條件,現在要刪掉對規則條件的引用,請求參數如下: |
[{"functionArgs": [{"argName": "key","argValue": "Content-Encoding"},{"argName": "value","argValue": "gzip"}],"functionName": "set_resp_header"} ] |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
|||
| RequestId |
string |
請求 ID。 |
04F0F334-1335-436C-A1D7-6C044FE73368 |
| DomainConfigList |
object |
||
| DomainConfigModel |
array<object> |
網域名稱配置清單。 |
|
|
object |
|||
| ConfigId |
integer |
配置 ID,如果返回為 0,則表示該條配置未配置成功,需要重新設定。 |
1234567 |
| DomainName |
string |
網域名稱。 |
www.example.com |
| FunctionName |
string |
功能名稱。 |
set_resp_header |
樣本
正常返回樣本
JSON格式
{
"RequestId": "04F0F334-1335-436C-A1D7-6C044FE73368",
"DomainConfigList": {
"DomainConfigModel": [
{
"ConfigId": 1234567,
"DomainName": "www.example.com",
"FunctionName": "set_resp_header"
}
]
}
}
異常返回樣本
JSON格式
[{"functionArgs":[{"argName":"file_type","argValue":"jpg"},{"argName":"ttl","argValue":"18"},{"argName":"weight","argValue":"30"}],"functionName":"filetype_based_ttl_set","configId":5068995}]
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 400 | InvalidFunctions.Malformed | The specified Functions is incorrectly formatted. | 配置格式錯誤。 |
| 400 | InvalidArgValue.Malformed | The specified ArgValue is invalid. | 參數格式錯誤,請檢查更新後重試。 |
| 400 | Invalid%s.ValueNotSupported | [%s] is not supported. | |
| 400 | Invalid%s.Malformed | The specified ArgValue [%s] is invalid. | |
| 400 | MissingParameter%s | The specified value of ArgName[%s] is missing. | 參數不可為空。 |
| 400 | InvalidFunctionArgs.Malformed | The specified FunctionArgs is invalid. | 指定的功能參數是錯誤的。 |
| 400 | MissingParameter | The specified ArgValue is missing. | |
| 400 | InvalidHeaderKey.ValueNotSupported | The specified value of parameter HeaderKey is not supported. | 指定的HTTP頭參數不合法,超出可選範圍。取值:Content-Type,Cache-Control,Content-Disposition,Content-Language,Expires,Access-Control-Allow-Origin,Access-Control-Allow-Methods,Access-Control-Allow-Headers,Access-Control-Max-Age,Access-Control-Expose-Headers,Access-Control-Allow-Credentials。 |
| 400 | TooManyDomains | The count of domain is over 50. | |
| 400 | InvalidRule.Malformed | %s | |
| 400 | ConfigurationConflicts | The staging environment has a configuration in effect and cannot modify the production environment configuration. | 現在類比環境的配置和生產環境配置不一致,無法直接修改生產環境配置。請您前往類比環境完成您所需的配置,然後發布到生產環境進行覆蓋。 |
| 400 | InvalidFunction.NotSupported | The domain is not supported to set the function. | 網域名稱不支援設定該功能。 |
| 400 | InvalidDomain.BelongToConfigGroup | This Domain activated in configuration group and should modify by config group. | |
| 400 | EntityNotExist.Role | EntityNotExist.Role | |
| 400 | MissingParameterFunctions | The specified value of Functions is missing. | |
| 400 | NoPermission.SLR | The current user does not have permission to create servicelinkedrole. Please contact the Alibaba Cloud account or administrator to authorize AliyunCDNFullAccess or custom policy:Service Name:cdn-ddos.cdn.aliyuncs.com,Role: AliyunServiceRoleForCDNAccessingDDoS,Permission: ram: CreateServiceLinkedRole | 目前使用者沒有建立服務關聯角色的許可權,請聯絡主帳號或許可權管理員授權AliyunCDNFullAccess或授權建立服務關聯角色的自訂權限原則。自訂權限原則的相關資訊如下: Service Name:cdn-ddos.cdn.aliyuncs.com 服務關聯角色名稱:AliyunServiceRoleForCDNAccessingDDoS 執行該操作所需的使用者權限:ram:CreateServiceLinkedRole |
| 400 | ConfigExceedLimit | Count of config entries exceeds the limit. | 配置條數超過限制。 |
| 400 | EdgeScriptCountExceedLimit | The number of rules exceeds the default limit. | 超過預設規則數量限制,如需提升數量,請提交工單諮詢。 |
| 400 | EdgeScripOptionsHasInnerConfig | The extension has a background configuration or a parameter of this configuration is invalid. For more information, submit a ticket. | 擴充項存在後台配置或該配置的參數不合法,如有疑問,請提交工單諮詢 |
| 400 | EdgeScriptGrammarNotSupport | A background customization rule exists or a parameter of this configuration is invalid. For more information, submit a ticket. | 存在後台定製規則或該配置的參數不合法,如有疑問,請提交工單諮詢 |
| 400 | EdgeScriptNotSupportJs | JavaScript rules are not supported. For more information, submit a ticket. | 未開放JS規則,如有疑問,請提交工單諮詢 |
| 400 | ServiceInvokeFailed | Failed to invoke service. | 調用內部服務失敗。 |
| 400 | ConfigParentExceedLimit | Config parent exceed limit. | 已引用的進階條件規則超過閾值。 |
| 400 | Function.InvalidParentId | The specified parentId does not exist. | 指定的規則條件不存在 |
| 400 | BatchSetBusinessError | some configs error:%s | 發生配置錯誤:%s |
| 400 | ConfigDuplicate | Duplicate configuration. This function has already been configured and cannot be added repeatedly. | 配置重複,該功能已經存在配置,不允許重複添加。 |
| 400 | FunctionArgError | The function parameter of the domain configuration is incorrect. |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。