Domain name for API request: teo.intl.tencentcloudapi.com.
This API is used to modify a rule in the rule engine. Only one rule can be modified at a time.
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: ModifyL7AccRule. |
| 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. |
| Rule | Yes | RuleEngineItem | Rule to modify. You can first call the DescribeL7AccRules API to get the Ruleid of the rule to modify, then input the modified rule content. The original rule content will be overwritten. |
| 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. |
Modify a rule content of the rule engine.
POST / HTTP/1.1
Host: teo.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ModifyL7AccRule
<Common request parameters>
{
"ZoneId": "zone-27q0p0bali12",
"Rule": {
"RuleId": "rule-djuq23",
"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 cache key 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 sample code
],
"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 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": [
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
Upstream Follow Redirect example
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
Sample code for modifying an HTTP back-to-origin request header
Host Header rewrite example
URL redirection example
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": [
Example of modifying HTTP node response headers
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": {
"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 |
|---|---|
| InternalError.ConfigLocked | The configuration has been locked. Unlock it and retry. |
| InternalError.SystemError | Internal error. System error. |
| 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.CacheKeyQueryStringTooManyValue | Query string rule exceeds the limit. |
| InvalidParameter.CertSystemError | Internal error. |
| InvalidParameter.CompressionInvalidAlgorithms | Invalid compression algorithm. |
| InvalidParameter.ErrActionUnsupportTarget | The operation does not support conditions. |
| InvalidParameter.ErrInvalidAction | Unauthorized operation. |
| InvalidParameter.ErrInvalidActionDuplicateAction | Unauthorized operations - duplicate operation configuration. |
| InvalidParameter.ErrInvalidActionParam | Unauthorized operations - Illegal parameters. |
| InvalidParameter.ErrInvalidActionParamAction | Unauthorized operations - Illegal parameters - Invalid action. |
| InvalidParameter.ErrInvalidActionParamDuplicateName | Unauthorized operations - illegal parameters - duplicate parameter name. |
| InvalidParameter.ErrInvalidActionParamName | Unauthorized operations - illegal parameters - invalid parameter value type. |
| InvalidParameter.ErrInvalidActionParamTooManyValues | Illegal operation - Illegal parameter - Number of parameter values exceeds the limit. |
| InvalidParameter.ErrInvalidActionParamValue | Unauthorized operations - Illegal parameters - Invalid parameter value. |
| InvalidParameter.ErrInvalidActionType | Unauthorized operation - illegal type. |
| InvalidParameter.ErrInvalidConditionHostTooManyWhenModifyOriginActionConfigured | The operation of modifying the origin server only supports configuring one 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.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.ErrInvalidElseWhenModifyOriginActionConfigured | The operation of modifying the origin server does not support ELSE. |
| 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.InvalidAuthenticationTypeSecretKey | Invalid token authentication key. |
| InvalidParameter.InvalidAuthenticationTypeSignParam | Invalid token authentication parameter. |
| InvalidParameter.InvalidAuthenticationTypeTimeFormat | Invalid token authentication time format. |
| InvalidParameter.InvalidAuthenticationTypeTimeParam | Invalid token authentication time 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.InvalidCacheKey | Invalid cache key. |
| InvalidParameter.InvalidCacheKeyCookie | Invalid custom Cache Key Cookie. |
| InvalidParameter.InvalidCacheKeyIgnoreCase | Invalid cache key. Ignore case. |
| InvalidParameter.InvalidCacheKeyScheme | Invalid custom Cache Key Scheme. |
| InvalidParameter.InvalidCacheTime | Invalid node cache time. |
| InvalidParameter.InvalidClientIpHeaderName | Invalid client IP request header. |
| InvalidParameter.InvalidCosDomain | Invalid origin-pull configuration. When the origin server type is COS, the origin server address must be a COS domain name. |
| 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.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.InvalidRuleEngineNotFound | Rule does not exist. |
| 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.InvalidUpstreamRequestQueryStringValue | Invalid origin-pull request parameter setting - invalid query string value. |
| InvalidParameter.InvalidUrlRedirectHost | The target HOST for URL rewrite is invalid. |
| InvalidParameter.InvalidUrlRedirectUrl | Invalid target URL for URL rewrite. |
| 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.OriginPullProtocolIsRequired | Return protocol is required when modifying the origin server. |
| InvalidParameter.PostMaxSizeLimitExceeded | Maximum upload size exceeds limit |
| InvalidParameter.ResponseHeaderCacheControlNotAllowDelete | Invalid response header. |
| 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.StatusCodeCacheInvalidStatusCode | The status code in the status code cache is invalid. |
| InvalidParameter.TlsVersionNotInSequence | The HTTPS TLS version is not continuous. |
| 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.TrialPlanResponsePage | Custom pages in the trial plan cannot be referenced. |
| InvalidParameterValue.UnrecognizableValue | Configuration item error. |
| LimitExceeded | The quota limit is exceeded. |
| OperationDenied | Operation denied. |
| OperationDenied.AdvancedOriginRoutingConflictWithDciOverseaLan | The current domain name does not support enabling advanced origin optimization and cross-border direct connect simultaneously. |
| OperationDenied.ConfigLocked | The configuration has been locked. Unlock it and retry. |
| 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. |
| UnauthorizedOperation.Unknown | Unknown error occurs on the real server. |
피드백