呼叫BatchSetCdnDomainConfig進行網域名稱批次配置。
介面說明
單一使用者呼叫頻率:3 次/秒。
呼叫 BatchSetCdnDomainConfig 為網域名稱配置某些功能後,將會產生唯一的 ConfigId,透過 ConfigId 可以完成更新和刪除配置操作。具體使用方法,請參閱 ConfigId 使用與查詢。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
cdn:BatchSetCdnDomainConfig |
update |
*Domain
|
無 |
|
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| DomainNames |
string |
是 |
加速網域名稱,多個網域名稱使用半形逗號(,)分隔,請注意以下配置限制:
|
www.example.com |
| Functions |
string |
是 |
需要設定的功能配置清單。請注意以下配置限制:
格式如下:
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"
}
]
}
}
錯誤碼
|
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. | 網域設定的功能參數錯誤。 |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。