tencent cloud

DescribeRewrite
Last updated: 2025-11-25 10:11:00
DescribeRewrite
Last updated: 2025-11-25 10:11:00

1. API Description

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

This API (DescribeRewrite) is used to query the redirection relationship between the forwarding rules of a CLB instance by instance ID. If no listener ID or forwarding rule ID is specified, all redirection relationships in the instance will be returned.

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: DescribeRewrite.
Version Yes String Common Params. The value used for this API: 2018-03-17.
Region Yes String Common Params. For more information, please see the list of regions supported by the product.
LoadBalancerId Yes String CLB instance ID
SourceListenerIds.N No Array of String Array of CLB listener IDs
SourceLocationIds.N No Array of String Array of CLB forwarding rule IDs

3. Output Parameters

Parameter Name Type Description
RewriteSet Array of RuleOutput Array of redirection forwarding rules. If there are no redirection rules, an empty array will be returned.
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 Querying the Redirection Relationship by Specifying the Forwarding Rule ID

This example shows you how to query the redirection relationship by specifying the forwarding rule ID.

Input Example

https://clb.intl.tencentcloudapi.com/?Action=DescribeRewrite
&LoadBalancerId=lb-qc2iq5yc
&SourceListenerIds.0=lbl-j36caqde
&SourceLocationIds.0=loc-5t7526km
&<Common request parameters>

Output Example

{
    "Response": {
        "RewriteSet": [
            {
                "TargetType": "Node",
                "DefaultServer": false,
                "Certificate": {
                    "SSLMode": "UNIDIRECTIONAL",
                    "CertCaId": "Fm8Wnpg8",
                    "CertId": "Gp7qwVYB",
                    "ExtCertIds": [
                        "ByYdJzpw"
                    ]
                },
                "TrpcCallee": "CLB",
                "ListenerId": "lbl-xxxxxxxx",
                "WafDomainId": "waf-qI07Ou7A",
                "HttpGzip": true,
                "Scheduler": "WRR",
                "TargetGroupList": [
                    {
                        "TargetGroupId": "lbtg-xxxxxxxx",
                        "TargetGroupName": "testGroup"
                    }
                ],
                "TargetGroup": {
                    "TargetGroupId": "lbtg-xxxxxxxx",
                    "TargetGroupName": "testGroup"
                },
                "Url": "/redirect",
                "HealthCheck": {
                    "RecvContext": "ping",
                    "HealthSwitch": 1,
                    "HttpCheckPath": "/check",
                    "HttpCheckMethod": "head",
                    "UnHealthNum": 3,
                    "IntervalTime": 5,
                    "HttpCode": 15,
                    "SourceIpType": 0,
                    "CheckPort": 0,
                    "ContextType": "HTTP",
                    "HttpCheckDomain": "test.xxx.com",
                    "ExtendedCode": "12",
                    "HealthNum": 3,
                    "TimeOut": 2,
                    "CheckType": "TCP ",
                    "SendContext": "pong",
                    "HttpVersion": "HTTP/1.0"
                },
                "TrpcFunc": "trpcfunc_xxx",
                "Http2": false,
                "Domains": [
                    "test.abc.com"
                ],
                "BeAutoCreated": false,
                "Domain": "test.abc.com",
                "ForwardType": "HTTP",
                "RewriteTarget": {
                    "TargetListenerId": "lbl-xxxxxxxx",
                    "RewriteType": "Manual",
                    "RewriteCode": 0,
                    "TargetLocationId": "loc-xxxxxxxx",
                    "TakeUrl": true
                },
                "QuicStatus": "OFF",
                "LocationId": "loc-xxxxxxxx",
                "SessionExpireTime": 0,
                "CreateTime": "2022-03-23 10:37:16"
            }
        ],
        "RequestId": "63bee47c-2bf9-4909-a8f7-67495dfe7b42"
    }
}

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
FailedOperation Operation failed.
InternalError Internal error.
InvalidParameter Parameter error.
InvalidParameter.FormatError Wrong parameter format.
InvalidParameter.LBIdNotFound Wrong CLB instance ID.
InvalidParameterValue Incorrect parameter value.
InvalidParameterValue.Length Wrong parameter length.
LimitExceeded Quota exceeded.
ResourceInsufficient Insufficient resources.
ResourceNotFound Resources do not exist.
UnauthorizedOperation Unauthorized operation.
Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback