Domain name for API request: teo.intl.tencentcloudapi.com.
This API is used to create rules in the rule engine, with support for batch creation.
A maximum of 20 requests can be initiated per second for this API.
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: CreateL7AccRules. |
| 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. |
| Rules.N | Yes | Array of RuleEngineItem | Rule content. |
| Parameter Name | Type | Description |
|---|---|---|
| RuleIds | Array of String | Rule ID list. |
| 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. |
Create an L7 acceleration rule.
POST / HTTP/1.1
Host: teo.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateL7AccRules
<Common request parameters>
{
"ZoneId": "zone-27q0p0bali12",
"Rules": [
{
"RuleName": "test rule",
"Status": "disable",
"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 pre-refresh 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 sample code
],
"Branches": [
{
"Condition": "${http.request.host} in ['www.example.com']",
"Actions": [
{
"Name": "HTTP2",
"HTTP2Parameters": {
"Switch": "on"
}
}
]
}
]
},
{
"Description": [
QUIC sample code
],
"Branches": [
{
"Condition": "${http.request.host} in ['www.example.com']",
"Actions": [
{
"Name": "QUIC",
"QUICParameters": {
"Switch": "on"
}
}
]
}
]
},
{
"Description": [
WebSocket sample code
],
"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": [
Intelligent compression sample code
],
"Branches": [
{
"Condition": "${http.request.host} in ['www.example.com']",
"Actions": [
{
"Name": "Compression",
"CompressionParameters": {
"Switch": "on",
"Algorithms": [
"gzip"
]
}
}
]
}
]
},
{
"Description": [
Smart acceleration sample code
],
"Branches": [
{
"Condition": "${http.request.host} in ['www.example.com']",
"Actions": [
{
"Name": "SmartRouting",
"SmartRoutingParameters": {
"Switch": "on"
}
}
]
}
]
},
{
"Description": [
HTTP/2 origin pull sample code
],
"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": [
Force HTTPS sample code
],
"Branches": [
{
"Condition": "${http.request.host} in ['www.example.com']",
"Actions": [
{
"Name": "ForceRedirectHTTPS",
"ForceRedirectHTTPSParameters": {
"Switch": "on",
"RedirectStatusCode": 302
}
}
]
}
]
},
{
"Description": [
HSTS sample code
],
"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 sample code
],
"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 setting example
Example of redirection during origin pull
Sample code for customizing the error page
Range-based origin pull sample code
],
"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 sample code
Example of modifying an HTTP back-to-origin request header
Host Header rewrite example
URL redirection sample code
Token authentication sample code
],
"Branches": [
{
"Condition": "${http.request.host} in ['www.example.com']",
"Actions": [
{
"Name": "OriginPullProtocol",
"OriginPullProtocolParameters": {
"Protocol": "follow"
}
},
{
"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": [
Sample code for modifying an HTTP node response header
Client IP header sample code
Client IP Geolocation Header sample code
sample
Origin-pull URL rewrite sample code
],
"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": "testheader"
}
},
{
"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"
}
}
]
}
]
}
]
}
]
}
]
}
{
"Response": {
"RuleIds": [
"rule-sjuq23"
],
"RequestId": "811d2583-310c-41f4-b5e7-abe407404sxsd"
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
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.ConfigLocked | The configuration has been locked. Unlock it and retry. |
| InternalError.ProxyServer | Unknown error occurs on the real server. |
| InternalError.SystemError | Internal error. System error. |
| InvalidParameter.AccessRedirectRegexError | Regular expression is in non-standard RE2 format. |
| InvalidParameter.ActionInProgress | Operations are too frequent. Please try again later. |
| InvalidParameter.AdvancedOriginRoutingNotSupportAccelerateMainland | The current domain name does not support enabling advanced origin optimization and network optimization in the Chinese mainland (international acceleration) simultaneously. |
| InvalidParameter.AdvancedOriginRoutingNotSupportCurrentPlanOriginWhitelist | The source IP whitelist package for the current domain name does not support advanced origin optimization. |
| InvalidParameter.AdvancedOriginRoutingNotSupportMultiplyLayer | The current domain name does not support enabling advanced origin optimization and multi-layer architecture simultaneously. |
| InvalidParameter.AdvancedOriginRoutingNotSupportOCDirectOrigin | The current domain name does not support enabling advanced origin optimization and OC switching simultaneously. |
| InvalidParameter.AdvancedOriginRoutingNotSupportRacingPlatform | Unsupported to enable advanced origin optimization and racing platform simultaneously. |
| InvalidParameter.CertSystemError | Internal error. |
| InvalidParameter.ErrActionUnsupportTarget | The operation does not support conditions. |
| InvalidParameter.ErrInvalidAction | Unauthorized operation. |
| InvalidParameter.ErrInvalidActionOriginPrivateAddress | Invalid rule engine operation. The origin server IP does not support private IP addresses or loopback addresses. |
| InvalidParameter.ErrInvalidActionParam | Unauthorized operations - Illegal parameters. |
| InvalidParameter.ErrInvalidActionParamAction | Unauthorized operations - Illegal parameters - Invalid action. |
| InvalidParameter.ErrInvalidActionParamBadValueType | Unauthorized operations - Illegal parameters - Invalid parameter value type. |
| InvalidParameter.ErrInvalidActionParamDuplicateName | Unauthorized operations - illegal parameters - duplicate parameter name. |
| InvalidParameter.ErrInvalidActionParamName | Unauthorized operations - illegal parameters - invalid parameter value type. |
| InvalidParameter.ErrInvalidActionParamValue | Unauthorized operations - Illegal parameters - Invalid parameter value. |
| InvalidParameter.ErrInvalidActionType | Unauthorized operation - illegal type. |
| InvalidParameter.ErrInvalidCondition | Invalid condition. |
| InvalidParameter.ErrInvalidConditionCannotOnlyContainHostWhenModifyOriginActionConfigured | Operation of modifying the origin server cannot only configure host match type. |
| InvalidParameter.ErrInvalidConditionIgnoreCase | Invalid condition - illegal ignore case. |
| InvalidParameter.ErrInvalidConditionNameBadName | Invalid condition - Illegal parameter name - Invalid parameter name. |
| InvalidParameter.ErrInvalidConditionNameTargetNotSupportName | Invalid condition - Invalid parameter name - The match type does not support the parameter name. |
| InvalidParameter.ErrInvalidConditionValueBadRegular | Invalid condition - Illegal parameter value - Invalid regular expression. |
| InvalidParameter.ErrInvalidConditionValueBadUrl | Invalid condition - Illegal parameter value - Invalid url. |
| InvalidParameter.ErrInvalidConditionValueBadValue | Invalid condition - Illegal parameter value - Invalid parameter value. |
| InvalidParameter.ErrInvalidConditionValueBadValueContainFileNameExtension | Invalid condition - illegal parameter value - invalid parameter value - file name should not include a file suffix. |
| InvalidParameter.ErrInvalidConditionValueTooLongValue | Invalid condition - illegal parameter value - parameter value length exceeds the limit. |
| InvalidParameter.ErrInvalidConditionValueTooManyRegular | Invalid condition - illegal parameter value - the number of regular expressions exceeds the limit. |
| InvalidParameter.ErrInvalidConditionValueTooManyValues | Invalid condition - illegal parameter value - the number of parameter values exceeds the limit. |
| InvalidParameter.ErrInvalidConditionValueTooManyWildcard | Invalid condition - illegal parameter value - the number of wildcards exceeds the limit. |
| InvalidParameter.ErrInvalidConditionValueZeroLength | Invalid condition - Illegal parameter value - Number of parameter values is 0. |
| InvalidParameter.ErrNilCondition | Condition is empty. |
| InvalidParameter.GrpcRequireHttp2 | Enabling Grpc protocol support requires enabling HTTP/2 protocol support simultaneously. |
| InvalidParameter.HostNotFound | The domain name does not exist. |
| InvalidParameter.InvalidAdvancedOriginRoutingUnsupported | The set match condition does not support advanced origin optimization. Delete the configuration. |
| InvalidParameter.InvalidAuthentication | Invalid token authentication. |
| InvalidParameter.InvalidAuthenticationTypeExpireTime | Invalid token authentication expiration time. |
| InvalidParameter.InvalidAuthenticationTypeSignParam | Invalid token authentication parameter. |
| InvalidParameter.InvalidAwsRegion | Fill in the region correctly as a private network access parameter for third-party object storage. |
| InvalidParameter.InvalidBackupServerName | Invalid backup origin-pull Host. |
| InvalidParameter.InvalidCacheConfigCache | Invalid node cache. |
| InvalidParameter.InvalidCacheKey | Invalid cache key. |
| InvalidParameter.InvalidCacheKeyQueryStringValue | Invalid query string. |
| InvalidParameter.InvalidCacheTime | Invalid node cache time. |
| InvalidParameter.InvalidClientIpHeaderName | Invalid client IP request header. |
| InvalidParameter.InvalidDynamicRoutine | Invalid smart acceleration. |
| InvalidParameter.InvalidDynamicRoutineBilling | The package does not support intelligent acceleration configuration. |
| InvalidParameter.InvalidErrorPageRedirectUrl | Invalid custom error page. |
| InvalidParameter.InvalidHttpsCipherSuiteAndTlsVersion | Encryption suite and TLS version mismatch. |
| InvalidParameter.InvalidHttpsHstsMaxAge | Invalid HTTPS HSTS. |
| InvalidParameter.InvalidIpv6Switch | Invalid Ipv6 switch configuration. |
| InvalidParameter.InvalidMaxAgeTime | Invalid browser cache. |
| InvalidParameter.InvalidOrigin | Invalid origin server. |
| InvalidParameter.InvalidParameter | Parameter error. |
| InvalidParameter.InvalidPostSizeValue | Invalid maximum upload size. |
| InvalidParameter.InvalidRangeOriginPull | Invalid range-based origin pull. |
| InvalidParameter.InvalidRequestHeaderName | Invalid request header. |
| InvalidParameter.InvalidRequestHeaderNameXff | Invalid x-forwarded-for request header configuration |
| InvalidParameter.InvalidRequestHeaderValue | Invalid request header. |
| InvalidParameter.InvalidResponseHeaderName | Invalid response header. |
| InvalidParameter.InvalidResponseHeaderValue | Invalid response header. |
| InvalidParameter.InvalidRuleEngineAction | Invalid rule engine operation. |
| InvalidParameter.InvalidRuleEngineTarget | Invalid rule engine condition. |
| InvalidParameter.InvalidRuleEngineTargetsExtension | Invalid rule engine file suffix condition. |
| InvalidParameter.InvalidRuleEngineTargetsUrl | Invalid rule engine URL condition. |
| InvalidParameter.InvalidServerName | Invalid origin-pull Host. |
| InvalidParameter.InvalidShieldUnsupported | The set match condition does not support EdgeOne Shield operations. Delete the configuration. |
| InvalidParameter.InvalidStandardDebugExpireTimeLimit | The valid period exceeds the limit. |
| InvalidParameter.InvalidUpstreamRequestQueryStringValue | Invalid origin-pull request parameter setting - invalid query string value. |
| InvalidParameter.InvalidUrlRedirect | Invalid URL rewrite. |
| InvalidParameter.InvalidUrlRedirectHost | The target HOST for URL rewrite is invalid. |
| InvalidParameter.InvalidUrlRedirectUrl | Invalid target URL for URL rewrite. |
| InvalidParameter.InvalidWebSocketTimeout | Invalid WebSocket. |
| InvalidParameter.KeyRulesInvalidQueryStringValue | Invalid cache key. |
| InvalidParameter.LoadBalanceInstanceIdIsRequired | Load balancing instance Id is required in the operation of modifying the origin server. |
| InvalidParameter.NotSupportThisPreset | The operation configuration contains unsupported preset variables. |
| InvalidParameter.OriginOriginGroupIdIsRequired | Origin server group Id is required in the operation of modifying the origin server. |
| InvalidParameter.PostMaxSizeLimitExceeded | Maximum upload size exceeds limit |
| InvalidParameter.ShieldNotSupportHostCachePrefresh | The current domain name does not support enabling EdgeOne Shield and cache pre-refresh simultaneously. |
| InvalidParameter.ShieldNotSupportHostOriginWhitelist | The current domain name does not support enabling both EdgeOne Shield and origin protection at the same time. |
| InvalidParameter.ShieldNotSupportHostSmartRouting | The current domain name does not support enabling EdgeOne Shield and smart acceleration simultaneously. |
| InvalidParameter.ShieldNotSupportZoneCachePrefresh | The current site does not support enabling EdgeOne Shield and cache pre-refresh simultaneously. |
| InvalidParameter.ShieldNotSupportZoneSmartRouting | The current site does not support enabling EdgeOne Shield and smart acceleration simultaneously. |
| InvalidParameter.ShieldSpaceNotFound | EdgeOne Shield space not found. |
| InvalidParameter.ShieldSpaceRequiredError | EdgeOne Shield space parameter required. |
| InvalidParameter.ShieldSpaceStatusMustOnline | EdgeOne Shield space status must be online. |
| InvalidParameter.TaskSystemError | Internal error. |
| InvalidParameterValue.FormatMismatch | Format mismatch. |
| InvalidParameterValue.GeneralMismatch | Configuration parameter format mismatch. |
| InvalidParameterValue.IncludeInvalidValue | Contains invalid value. |
| InvalidParameterValue.InvalidSiteFailoverUnsupported | A source station fault migration configuration item is configured under an unsupported match condition. Delete the configuration. |
| InvalidParameterValue.MissingNecessaryParam | Missing required configuration parameters. |
| InvalidParameterValue.NotInEnumeration | The value is not within the required collection. |
| InvalidParameterValue.NotWithinRange | The value is not within the specified range. |
| InvalidParameterValue.RegExMismatch | Does not match the specified regular expression. |
| InvalidParameterValue.SiteFailoverNotSupportHostOriginPullRateLimit | Enabling origin server failover and origin-pull rate limiting simultaneously is not supported. |
| InvalidParameterValue.SiteFailoverNotSupportHostOriginTypeVod | Origin server failover does not support VOD origin servers. |
| InvalidParameterValue.SiteFailoverNotSupportHostUpstreamVerify | Enabling origin server failover and origin-pull mutual authentication/origin certificate verification simultaneously is not supported. |
| InvalidParameterValue.UnrecognizableValue | Configuration item error. |
| LimitExceeded | The quota limit is exceeded. |
| OperationDenied | Operation denied. |
| OperationDenied.AccelerateMainlandMultiplyLayerConflict | A domain name feature under the current site conflicts with network optimization in the Chinese mainland and cannot be configured simultaneously. |
| OperationDenied.AdvancedOriginRoutingConflictWithDciOverseaLan | The current domain name does not support enabling advanced origin optimization and cross-border direct connect simultaneously. |
| OperationDenied.ErrZoneIsAlreadyPaused | Site disabled. Turn it on and try again. |
| OperationDenied.InvalidAdvancedDefenseSecurityType | To enable Anti-DDoS, security must be enabled. |
| OperationDenied.InvalidAdvancedOriginRoutingBilling | The package does not support advanced origin-pull optimization configuration. |
| OperationDenied.NotInAdvancedOriginRoutingWhiteList | The advanced origin optimization feature is currently only available to allowlist users. |
| OperationDenied.NotInShieldSpaceWhiteList | EdgeOne Shield is currently only available to allowlist users. |
| OperationDenied.NotInSiteFailoverWhiteList | The current origin server failure failover feature is only available to allowlist users. |
| ResourceInUse | The resource is occupied. |
| UnauthorizedOperation.CamUnauthorized | Unauthorized Cam operation. |
피드백