tencent cloud

APIs

ModifyRulesAttributes

다운로드
포커스 모드
폰트 크기
마지막 업데이트 시간: 2026-09-28 14:18:12

1. API Description

Domain name for API request: alb.intl.tencentcloudapi.com.

This API is used to modify forwarding rule attributes. This is an async API. After the API return succeeds, you can call the DescribeAsyncJobs API with the returned RequestID as an input parameter to check whether this task is successful.
A rule supports up to 10 forward Conditions and 5 forward Actions.

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: ModifyRulesAttributes.
Version Yes String Common Params. The value used for this API: 2025-10-30.
Region Yes String Common Params. For more information, please see the list of regions supported by the product.
ListenerId Yes String Listener ID, format: lst- followed by 8 alphanumeric characters.
LoadBalancerId Yes String Cloud Load Balancer instance ID, in the format of "alb-" followed by 8 alphanumeric characters.
Rules.N Yes Array of RuleModify Forwarding rule list.
DryRun No Boolean Whether it is pre-check only for this request.

3. Output Parameters

Parameter Name Type Description
RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 Modifying Forwarding Rule Attributes

Input Example

POST / HTTP/1.1
Host: alb.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ModifyRulesAttributes
<Common request parameters>

{
    "ListenerId": "lst-d9p3k7wa",
    "LoadBalancerId": "alb-f8q2xk9m",
    "Rules": [
        {
            "Actions": [
                {
                    "FixedResponseConfig": {
                        "Content": "OK",
                        "ContentType": "text/html",
                        "HttpCode": 200
                    },
                    "InsertHeaderConfig": {
                        "Key": "ClientVer",
                        "Value": "1.0",
                        "ValueType": "UserDefined"
                    },
                    "Order": 1,
                    "RedirectConfig": {
                        "Host": "www.redirect.com",
                        "HttpCode": 301,
                        "Path": "/redirecturl",
                        "Port": "443",
                        "Protocol": "HTTPS",
                        "Query": "${query}"
                    },
                    "RemoveHeaderConfig": {
                        "Key": "ClientVer"
                    },
                    "RewriteConfig": {
                        "Host": "www.myhost.com",
                        "Path": "/redirecturl",
                        "Query": "${query}"
                    },
                    "TargetGroupConfig": {
                        "TargetGroupStickySession": {
                            "Enabled": false,
                            "Timeout": 1000
                        },
                        "TargetGroups": [
                            {
                                "TargetGroupId": "lbtg-0zrnc9qa",
                                "Weight": 10
                            }
                        ]
                    },
                    "Type": "TargetGroup"
                }
            ],
            "Conditions": [
                {
                    "CookieConfig": [
                        {
                            "Key": "ClientId",
                            "Value": "xea4cd"
                        }
                    ],
                    "HeaderConfig": {
                        "Key": "ClientVer",
                        "Values": [
                            "1.0",
                            "1.1"
                        ]
                    },
                    "HostConfig": [
                        "www.myhost.com"
                    ],
                    "MethodConfig": [
                        "GET"
                    ],
                    "PathConfig": [
                        "/url"
                    ],
                    "QueryStringConfig": [
                        {
                            "Key": "ClientVer",
                            "Value": "1.1"
                        }
                    ],
                    "SourceIpConfig": [
                        "192.168.1.3/32"
                    ],
                    "Type": "Host"
                }
            ],
            "Priority": 100,
            "RuleId": "rule-h8cy5gwl",
            "RuleName": "newName"
        }
    ]
}

Output Example

{
    "Response": {
        "RequestId": "3b848733-70e5-4558-ae39-4b9938eb7609"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
AuthFailure CAM signature/authentication error.
DryRunOperation DryRun operation means the request will be successful, but the DryRun parameter is passed.
FailedOperation Operation failed.
InternalError Internal error.
InvalidParameter Parameter error.
InvalidParameter.InvalidClientToken Invalid ClientToken format.
InvalidParameter.InvalidFieldType Field type error.
InvalidParameter.InvalidFieldValue Field value is incorrect.
InvalidParameter.InvalidQuotaCheckRequest Quota check request is invalid.
InvalidParameter.MissingAction Action parameter is missing.
InvalidParameter.MissingField Please enter the required parameter.
InvalidParameterValue Parameter value error.
LimitExceeded The quota limit is exceeded.
MissingParameter Parameters are missing.
OperationDenied Operation denied.
RegionError Region error
RequestLimitExceeded Number of requests exceeds the frequency limit.
ResourceInUse The resource is occupied.
ResourceNotFound The resource does not exist.
ResourceNotFound.Listener Listener not found.
ResourceNotFound.LoadBalancer The CLB resource does not exist.
ResourceNotFound.Rule Forwarding rule not found
ResourceUnavailable Resources are unavailable.
ResourceUnavailable.Listener Listener is in unavailable status.
ResourceUnavailable.LoadBalancer ALB status is unavailable.
ResourceUnavailable.Rule Rule status unavailable.
ResourceUnavailable.TargetGroup Target group is in unavailable status
UnauthorizedOperation Unauthorized operation.
UnknownParameter Unknown parameter error.
UnsupportedOperation The operation is not supported.

도움말 및 지원

문제 해결에 도움이 되었나요?

피드백