DescribeL7AccRules
1. API Description
Domain name for API request: teo.intl.tencentcloudapi.com.
This API is used to query the rule list of the rule engine (https://intl.cloud.tencent.com/document/product/1552/70901?from_cn_redirect=1).
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: DescribeL7AccRules. |
Version | Yes | String | Common Params. The value used for this API: 2022-09-01. |
Region | No | String | Common Params. This parameter is not required. |
ZoneId | Yes | String | Zone id. |
Filters.N | No | Array of Filter | Filter conditions. the upper limit for filters.values is 20. if this parameter is not filled in, the rules under the site are returned in order by default. detailed filtering conditions are as follows:. |
Limit | No | Integer | Number limit of paginated query. default value: 20. maximum value: 1000. |
Offset | No | Integer | Offset of paginated query. default value: 0. |
3. Output Parameters
Parameter Name | Type | Description |
---|---|---|
TotalCount | Integer | Total number of rules. |
Rules | Array of RuleEngineItem | Rule list. rules are executed in top-down order. for details, refer to rule priority. Note: this field may return null, which indicates a failure to obtain a valid value. |
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 Query the Rule List In the Rule Engine
Query the rule list in the rule engine.
Input Example
POST / HTTP/1.1
Host: teo.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeL7AccRules
<Common request parameters>
{
"ZoneId": "zone-27q0p0lali12"
}
Output Example
{
"Response": {
"TotalCount": 1,
"RequestId": "3c140219-cfe9-470e-b241-907877d6fb03",
"Rules": [
{
"RuleName": "Test Rule",
"Status": "disable",
"RuleId": "rule-djuq23",
"Description": [
"Annotation 1",
"Annotation 2",
],
"Branches": [
{
"Condition": "${http.request.host} in ['www.example.com']",
"Actions": [
{
"Name": "ModifyOrigin",
"ModifyOriginParameters": {
"OriginType": "IPDomain",
"Origin": "1.1.1.1",
"OriginProtocol": "follow",
"HTTPOriginPort": 80,
"HTTPSOriginPort": 443
}
}
],
"SubRules": [
{
"Description": [
Node Cache TTL Example
],
"Branches": [
{
"Condition": "${http.request.host} in ['www.example.com']",
"Actions": [
{
"Name": "Cache",
"CacheParameters": {
"FollowOrigin": {
"Switch": "on",
"DefaultCache": "on",
"DefaultCacheStrategy": "on",
"DefaultCacheTime": 0
}
}
}
]
}
]
},
{
"Description": [
Browser Cache TTL Example
],
"Branches": [
{
"Condition": "${http.request.host} in ['www.example.com']",
"Actions": [
{
"Name": "MaxAge",
"MaxAgeParameters": {
"FollowOrigin": "off",
"CacheTime": 0
}
}
]
}
]
},
{
"Description": [
Custom `CacheKey` Example
],
"Branches": [
{
"Condition": "${http.request.host} in ['www.example.com']",
"Actions": [
{
"Name": "CacheKey",
"CacheKeyParameters": {
"FullURLCache": "off",
"QueryString": {
"Switch": "on",
"Action": "includeCustom",
"Values": [
"name1",
"name2"
]
},
"IgnoreCase": "on",
"Header": {
"Switch": "on",
"Values": [
"EO-Client-Device",
"EO-Client-OS"
]
},
"Scheme": "on",
"Cookie": {
"Switch": "off"
}
}
}
]
}
]
},
{
"Description": [
Status Code Cache TTL Example
],
"Branches": [
{
"Condition": "${http.request.host} in ['www.example.com']",
"Actions": [
{
"Name": "StatusCodeCache",
"StatusCodeCacheParameters": {
"StatusCodeCacheParams": [
{
"StatusCode": 400,
"CacheTime": 4
},
{
"StatusCode": 401,
"CacheTime": 180
},
{
"StatusCode": 403,
"CacheTime": 7200
},
{
"StatusCode": 404,
"CacheTime": 86400
}
]
}
}
]
}
]
},
{
"Description": [
Cache Prefresh Example
],
"Branches": [
{
"Condition": "${http.request.host} in ['www.example.com']",
"Actions": [
{
"Name": "CachePrefresh",
"CachePrefreshParameters": {
"Switch": "on",
"CacheTimePercent": 80
}
}
]
}
]
},
{
"Description": [
Offline Cache Example
],
"Branches": [
{
"Condition": "${http.request.host} in ['www.example.com']",
"Actions": [
{
"Name": "OfflineCache",
"OfflineCacheParameters": {
"Switch": "on"
}
}
]
}
]
},
{
"Description": [
HTTP/2 Example
],
"Branches": [
{
"Condition": "${http.request.host} in ['www.example.com']",
"Actions": [
{
"Name": "HTTP2",
"HTTP2Parameters": {
"Switch": "on"
}
}
]
}
]
},
{
"Description": [
"QUIC Example"
],
"Branches": [
{
"Condition": "${http.request.host} in ['www.example.com']",
"Actions": [
{
"Name": "QUIC",
"QUICParameters": {
"Switch": "on"
}
}
]
}
]
},
{
"Description": [
WebSocket Example
],
"Branches": [
{
"Condition": "${http.request.host} in ['www.example.com']",
"Actions": [
{
"Name": "WebSocket",
"WebSocketParameters": {
"Switch": "on",
"Timeout": 30
}
}
]
}
]
},
{
"Description": [
Maximum Upload Size Example
],
"Branches": [
{
"Condition": "${http.request.host} in ['www.example.com']",
"Actions": [
{
"Name": "PostMaxSize",
"PostMaxSizeParameters": {
"Switch": "on",
"MaxSize": 524288000
}
}
]
}
]
},
{
"Description": [
Smart Compression Example
],
"Branches": [
{
"Condition": "${http.request.host} in ['www.example.com']",
"Actions": [
{
"Name": "Compression",
"CompressionParameters": {
"Switch": "on",
"Algorithms": [
"gzip"
]
}
}
]
}
]
},
{
"Description": [
Smart Acceleration Example
],
"Branches": [
{
"Condition": "${http.request.host} in ['www.example.com']",
"Actions": [
{
"Name": "SmartRouting",
"SmartRoutingParameters": {
"Switch": "on"
}
}
]
}
]
},
{
"Description": [
HTTP/2 Origin-Pull Example
],
"Branches": [
{
"Condition": "${http.request.host} in ['www.example.com']",
"Actions": [
{
"Name": "UpstreamHTTP2",
"UpstreamHTTP2Parameters": {
"Switch": "off"
}
}
]
}
]
},
{
"Description": [
Origin-Pull Timeout Example
],
"Branches": [
{
"Condition": "${http.request.host} in ['www.example.com']",
"Actions": [
{
"Name": "HTTPUpstreamTimeout",
"HTTPUpstreamTimeoutParameters": {
"ResponseTimeout": 15
}
}
]
}
]
},
{
"Description": [
Forced HTTPS Example
],
"Branches": [
{
"Condition": "${http.request.host} in ['www.example.com']",
"Actions": [
{
"Name": "ForceRedirectHTTPS",
"ForceRedirectHTTPSParameters": {
"Switch": "on",
"RedirectStatusCode": 302
}
}
]
}
]
},
{
"Description": [
<HSTS Example>
],
"Branches": [
{
"Condition": "${http.request.host} in ['www.example.com']",
"Actions": [
{
"Name": "HSTS",
"HSTSParameters": {
"Switch": "on",
"Timeout": 1000,
"IncludeSubDomains": "on",
"Preload": "on"
}
}
]
}
]
},
{
"Description": [
SSL/TLS Security Configuration Example
],
"Branches": [
{
"Condition": "${http.request.host} in ['www.example.com']",
"Actions": [
{
"Name": "TLSConfig",
"TLSConfigParameters": {
"Version": [
"TLSv1",
"TLSv1.1",
"TLSv1.2",
"TLSv1.3"
],
"CipherSuite": "loose-v2023"
}
}
]
}
]
},
{
"Description": [
OCSP Stapling Example
Origin-Pull Request Parameter Configuration Example
Redirection during Origin Pull Example
Custom Error Page Example
Example of Range Back-to-Origin
],
"Branches": [
{
"Condition": "${http.request.host} in ['www.example.com']",
"Actions": [
{
"Name": "OCSPStapling",
"OCSPStaplingParameters": {
"Switch": "on"
}
},
{
"Name": "UpstreamRequest",
"UpstreamRequestParameters": {
"QueryString": {
"Switch": "on",
"Action": "includeCustom",
"Values": [
"name1",
"name2"
]
},
"Cookie": {
"Switch": "on",
"Action": "full"
}
}
},
{
"Name": "UpstreamFollowRedirect",
"UpstreamFollowRedirectParameters": {
"Switch": "on",
"MaxTimes": 3
}
},
{
"Name": "ErrorPage",
"ErrorPageParameters": {
"ErrorPageParams": [
{
"StatusCode": 400,
"RedirectURL": "http://www.test-v.com/custom-page.html"
},
{
"StatusCode": 403,
"RedirectURL": "http://www.test-v.com/custom-page1.html"
}
]
}
},
{
"Name": "RangeOriginPull",
"RangeOriginPullParameters": {
"Switch": "on"
}
}
]
}
]
},
{
"Description": [
Origin-pull HTTPS example
Example of Modifying HTTP Request Headers
Host Header Rewrite example
Access URL Redirection example
Token Authentication example
],
"Branches": [
{
"Condition": "${http.request.host} in ['www.example.com']",
"Actions": [
{
"Name": "OriginPullProtocol"
},
{
"Name": "ModifyRequestHeader",
"ModifyRequestHeaderParameters": {
"HeaderActions": [
{
"Action": "add",
"Name": "EO-Client-Browser"
},
{
"Action": "del",
"Name": "EO-Client-Device"
},
{
"Action": "set",
"Name": "EO-Client-OS"
}
]
}
},
{
"Name": "HostHeader",
"HostHeaderParameters": {
"Action": "followOrigin"
}
},
{
"Name": "AccessURLRedirect",
"AccessURLRedirectParameters": {
"StatusCode": 302,
"Protocol": "follow",
"HostName": {
"Action": "follow"
},
"URLPath": {
"Action": "follow"
},
"QueryString": {
"Action": "full"
}
}
},
{
"Name": "Authentication",
"AuthenticationParameters": {
"AuthType": "TypeA",
"Timeout": 5,
"SecretKey": "BCChgIM4o0k08Uk0Jgi3f27ir3",
"BackupSecretKey": "3deJ7O6CsqlIk",
"AuthParam": "test123QQ"
}
}
]
}
]
},
{
"Description": [
"Modifying HTTP Node Response Headers Example"
Client IP Header Example
Client IP Geographical Location Header Example
HTTP Response Example
Origin-Pull URL Rewrite Example
],
"Branches": [
{
"Condition": "${http.request.host} in ['www.example.com']",
"Actions": [
{
"Name": "ModifyResponseHeader",
"ModifyResponseHeaderParameters": {
"HeaderActions": [
{
"Action": "add",
"Name": "Access-Control-Allow-Methods",
"Value": "POST,GET"
},
{
"Action": "set",
"Name": "Access-Control-Allow-Origin",
"Value": "http://test.com,http://1.1.1.1"
},
{
"Action": "del",
"Name": "Content-Disposition"
}
]
}
},
{
"Name": "ClientIPHeader",
"ClientIPHeaderParameters": {
"Switch": "on",
"HeaderName": "test"
}
},
{
"Name": "ClientIPCountry",
"ClientIPCountryParameters": {
"Switch": "on",
"HeaderName": "EO-Client-IPCountry"
}
},
{
"Name": "HttpResponse",
"HttpResponseParameters": {
"StatusCode": 400,
"ResponsePage": "p-30tcxgl8i0ls"
}
},
{
"Name": "UpstreamURLRewrite",
"UpstreamURLRewriteParameters": {
"Type": "Path",
"Action": "addPrefix",
"Value": "/prefix"
}
}
]
}
]
}
]
}
]
}
]
}
}
5. Developer Resources
SDK
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
- Tencent Cloud SDK 3.0 for Python
- Tencent Cloud SDK 3.0 for Java
- Tencent Cloud SDK 3.0 for PHP
- Tencent Cloud SDK 3.0 for Go
- Tencent Cloud SDK 3.0 for Node.js
- Tencent Cloud SDK 3.0 for .NET
- Tencent Cloud SDK 3.0 for C++
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 |
---|---|
InternalError.RouteError | The backend routing address is incorrect. |
UnauthorizedOperation.CamUnauthorized | CAM is not authorized. |
UnauthorizedOperation.Unknown | An unknown error occurred in the backend server. |