批次更新轉寄規則屬性。
介面說明
UpdateRulesAttribute 介面屬於非同步介面,即系統返回一個請求 ID,但該轉寄規則屬性尚未批次更新成功,系統背景更新任務仍在進行。您可以調用 ListRules 查詢轉寄規則屬性的更新狀態:
-
當多條轉寄規則屬性處於 Configuring 狀態時,表示轉寄規則屬性正在批次更新中。
-
當多條轉寄規則屬性處於 Available 狀態時,表示轉寄規則屬性批次更新成功。
-
一條轉寄規則最多支援添加的條件數(RuleConditions)和動作數(RuleActions)如下:
條件數:基礎版 5 條,標準版 10 條,WAF 增強版 10 條。
動作數:基礎版 3 條,標準版 5 條,WAF 增強版 5 條。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
alb:UpdateRulesAttribute |
update |
*LoadBalancer
*ServerGroup
|
無 | 無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| ClientToken |
string |
否 |
用戶端 Token,用於保證請求的等冪性。 由用戶端產生該參數值,要保證在不同請求間唯一。ClientToken 只支援 ASCII 字元。 說明
若您未指定,則系統自動使用 API 請求的 RequestId 作為 ClientToken 標識。每次 API 請求的 RequestId 不一樣。 |
123e4567-e89b-12d3-a456-42665544*** |
| Rules |
array<object> |
是 |
轉寄規則列表 |
|
|
array<object> |
是 |
轉寄規則 |
||
| Priority |
integer |
否 |
轉寄規則優先順序 |
80 |
| RuleName |
string |
否 |
轉寄規則名稱 |
rule_111 |
| RuleActions |
array |
否 |
轉寄規則動作列表 |
|
|
array<object> |
是 |
轉寄規則動作 |
||
| FixedResponseConfig |
object |
否 |
返回固定內容動作配置 |
|
| Content |
string |
否 |
內容 |
dssacav |
| ContentType |
string |
否 |
內容類型 |
text/plain |
| HttpCode |
string |
否 |
HTTP 響應碼 |
200 |
| ForwardGroupConfig |
object |
否 |
轉寄組動作配置 |
|
| ServerGroupTuples |
array |
否 |
轉寄到的目的伺服器組列表 |
|
|
object |
否 |
轉寄到的目的伺服器組 |
||
| ServerGroupId |
string |
否 |
伺服器組標識 |
sgp-3kbj35ay7cvi****** |
| Weight |
integer |
否 |
權重 |
100 |
| ServerGroupStickySession |
object |
否 |
伺服器組之間會話保持 |
|
| Enabled |
boolean |
否 |
是否開啟會話保持 |
true |
| Timeout |
integer |
否 |
逾時時間 |
100 |
| InsertHeaderConfig |
object |
否 |
插入頭部動作配置 |
|
| CoverEnabled |
boolean |
否 |
是否覆蓋請求中的值 |
False |
| Key |
string |
否 |
HTTP 標題 |
key |
| Value |
string |
否 |
HTTP 標題內容 |
value |
| ValueType |
string |
否 |
取實值型別 |
SystemDefined |
| Order |
integer |
是 |
優先順序 |
1 |
| RedirectConfig |
object |
否 |
重新導向動作配置 |
|
| Host |
string |
否 |
要跳轉的主機地址 |
test.alb.com |
| HttpCode |
string |
否 |
跳轉方式 |
301 |
| Path |
string |
否 |
要跳轉的路徑 |
/ |
| Port |
string |
否 |
要跳轉的連接埠 |
443 |
| Protocol |
string |
否 |
要跳轉的協議 |
HTTPS |
| Query |
string |
否 |
要跳轉的查詢字串 |
${query} |
| RewriteConfig |
object |
否 |
內部重新導向動作配置 |
|
| Host |
string |
否 |
主機名稱 |
${host} |
| Path |
string |
否 |
路徑 |
/ |
| Query |
string |
否 |
查詢 |
${query} |
| Type |
string |
是 |
轉寄規則動作類型 |
ForwardGroup |
| TrafficLimitConfig |
object |
否 |
流量限速 |
|
| QPS |
integer |
否 |
每秒請求次數。 |
1000 |
| PerIpQps |
integer |
否 |
單 IP 每秒請求次數。 |
100 |
| TrafficMirrorConfig |
object |
否 |
流量鏡像 |
|
| TargetType |
string |
否 |
鏡像目標類型 |
ForwardGroupMirror |
| MirrorGroupConfig |
object |
否 |
鏡像至伺服器組 |
|
| ServerGroupTuples |
array |
否 |
流量鏡像至伺服器組。 |
|
|
object |
否 |
流量鏡像至伺服器組。 |
||
| ServerGroupId |
string |
否 |
伺服器組 ID。 |
sgp-vlnjo1rhw0vc****** |
| RemoveHeaderConfig |
object |
否 |
去除 HTTP 標題 |
|
| Key |
string |
否 |
HTTP 標題鍵 |
key |
| CorsConfig |
object |
否 |
跨域 |
|
| AllowOrigin |
array |
否 |
允許的訪問來源 |
|
|
string |
否 |
允許的訪問來源 |
* |
|
| AllowMethods |
array |
否 |
選擇跨域訪問時允許的 HTTP 方法 |
|
|
string |
否 |
選擇跨域訪問時允許的 HTTP 方法。取值:
|
GET |
|
| AllowHeaders |
array |
否 |
允許跨域的 Header 列表 |
|
|
string |
否 |
允許跨域的 Header |
test |
|
| ExposeHeaders |
array |
否 |
允許暴露的 Header 列表 |
|
|
string |
否 |
允許暴露的 Header |
test |
|
| AllowCredentials |
string |
否 |
是否允許攜帶憑證資訊 |
off |
| MaxAge |
integer |
否 |
預檢請求在瀏覽器的最大緩衝時間 |
60 |
| RuleConditions |
array |
否 |
轉寄規則條件列表 |
|
|
array<object> |
是 |
轉寄規則條件 |
||
| CookieConfig |
object |
否 |
Cookie 條件配置 |
|
| Values |
array |
否 |
Cookie 索引值對列表 |
|
|
object |
否 |
Cookie 索引值對 |
||
| Key |
string |
否 |
Cookie 條件鍵 |
key |
| Value |
string |
否 |
Cookie 條件值 |
value |
| HeaderConfig |
object |
否 |
HTTP 標題條件配置 |
|
| Key |
string |
否 |
HTTP 標題鍵 |
key |
| Values |
array |
否 |
HTTP 標題值列表 |
|
|
string |
否 |
HTTP 標題值 |
value |
|
| HostConfig |
object |
否 |
主機名稱條件配置 |
|
| Values |
array |
否 |
主機名稱列表 |
|
|
string |
否 |
主機名稱 |
www.example.com |
|
| MethodConfig |
object |
否 |
HTTP 要求方法條件配置 |
|
| Values |
array |
否 |
HTTP 要求方法列表 |
|
|
string |
否 |
HTTP 要求方法 |
PUT |
|
| PathConfig |
object |
否 |
查詢字串條件配置 |
|
| Values |
array |
否 |
路徑條件列表 |
|
|
string |
否 |
路徑條件 |
/test |
|
| QueryStringConfig |
object |
否 |
查詢字串條件配置 |
|
| Values |
array |
否 |
查詢字串條件索引值對列表 |
|
|
object |
否 |
查詢字串條件索引值對 |
||
| Key |
string |
否 |
查詢字串條件鍵 |
account |
| Value |
string |
否 |
查詢字串條件值 |
on |
| ResponseHeaderConfig |
object |
否 |
返回 HTTP 標題 |
|
| Key |
string |
否 |
返回 HTTP 標題鍵 |
test |
| Values |
array |
否 |
返回 HTTP 標題值 |
|
|
string |
否 |
返回 HTTP 標題值 |
value |
|
| ResponseStatusCodeConfig |
object |
否 |
返回狀態代碼條件 |
|
| Values |
array |
否 |
返回狀態代碼條件 |
|
|
string |
否 |
返回狀態代碼條件 |
200 |
|
| Type |
string |
否 |
條件類型 |
Header |
| SourceIpConfig |
object |
否 |
基於源 IP 業務流量匹配 |
|
| Values |
array |
否 |
添加一個或多個 IP 位址或者 IP 位址段。 |
|
|
string |
否 |
添加一個或多個 IP 位址或者 IP 位址段。 |
192.168.1.1 |
|
| RuleId |
string |
是 |
轉寄規則 ID |
rule-n4hfecmmtmfl****** |
| DryRun |
boolean |
否 |
是否只預檢此次請求,取值:
|
false |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
Schema of Response |
||
| RequestId |
string |
請求 ID。 |
365F4154-92F6-4AE4-92F8-7FF34B540710 |
| JobId |
string |
非同步任務 ID。 |
72dcd26b-f12d-4c27-b3af-18f6aed5**** |
樣本
正常返回樣本
JSON格式
{
"RequestId": "365F4154-92F6-4AE4-92F8-7FF34B540710",
"JobId": "72dcd26b-f12d-4c27-b3af-18f6aed5****"
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 400 | OperationDenied.IpGroupCanNotUsedForMirrorAction | The operation is not allowed because of %s. | 操作被拒絕,原因是%s。 |
| 400 | IncorrectStatus.Rule | The status of %s [%s] is incorrect. | 轉寄規則的目前狀態不支援本次操作。 |
| 400 | OperationDenied.SameGroupForForwardAndMirrorAction | The operation is not allowed because of %s. | 操作被拒絕,原因是%s。 |
| 400 | OperationDenied.GRPCServerGroup | The operation is not allowed because of %s. | 操作被拒絕,原因是存在綁定本GRPC伺服器組的監聽沒有啟用HTTP2.0。 |
| 400 | Conflict.Priority | There is already %s having the same configuration with %s. | 優先順序衝突,已經存在相同配置 |
| 400 | ResourceQuotaExceeded.ServerGroupAttachedNum | The quota of %s is exceeded for resource %s, usage %s/%s. | 伺服器組可被關聯數已超額度限制。 |
| 400 | ResourceQuotaExceeded.LoadBalancerServersNum | The quota of %s is exceeded for resource %s, usage %s/%s. | 後端伺服器數已超額度限制。 |
| 400 | ResourceQuotaExceeded.ServerAddedNum | The quota of %s is exceeded for resource %s, usage %s/%s. | 伺服器添加到組已超額度限制。 |
| 400 | QuotaExceeded.RuleWildcardsNum | The quota of %s is exceeded, usage %s/%s. | 配額%s已超額度限制,目前已使用%s,配額為%s。 |
| 400 | QuotaExceeded.RuleMatchEvaluationsNum | The quota of %s is exceeded, usage %s/%s. | 轉寄規則條件數已超額度限制。 |
| 400 | QuotaExceeded.RuleActionsNum | The quota of %s is exceeded, usage %s/%s. | 配額%s已超額度限制,目前已使用%s,配額為%s。 |
| 400 | Mismatch.Protocol | The %s is mismatched for %s and %s. | %s在%s和%s中不匹配。 |
| 400 | Mismatch.VpcId | The %s is mismatched for %s and %s. | %s在%s和%s中不匹配。 |
| 400 | OperationDenied.ServiceManagedResource | The operation is not allowed because the current resource of %s is managed resource. | 操作被拒絕,原因是資源%s為託管資源。 |
| 400 | OperationDenied.ListenerIdInconsistent | The operation is not allowed because of ListenerIdInconsistent. | 操作被拒絕,原因是當前轉寄規則屬於不同的監聽。 |
| 400 | IllegalParam.Priority | The param of Priority is illegal. | 參數Priority非法 |
| 400 | OperationDenied.MirrorActionSupportHttpGroupOnly | The operation is not allowed because of MirrorActionSupportHttpGroupOnly. | 操作被拒絕,原因是流量鏡像動作只支援HTTP類型的伺服器組。 |
| 400 | OperationDenied.ProtocolMustSameForForwardGroupAction | The operation is not allowed because of ProtocolMustSameForForwardGroupAction. | 操作被禁止,原因:必須是相同的協議 |
| 404 | ResourceNotFound.Rule | The specified resource %s is not found. | 資源%s不存在。 |
| 404 | ResourceNotFound.ServerGroup | The specified resource %s is not found. | 後端伺服器組不存在。 |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。