tencent cloud

APIs

ModifyZoneCustomVariables

下载
聚焦模式
字号
最后更新时间: 2026-10-22 16:18:20

1. API Description

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

This API is used to manage site-level custom variables, supporting the creation, modification, and deletion of variable definitions and variable operations. The submitted list will override the corresponding existing configuration. To clear the configuration, pass in an empty list. Configuration items not passed in remain unchanged. The default values for variable definitions and variable operations are both empty.

For operations related to rule-level custom variables, call the CreateL7AccRules or ModifyL7AccRule API.

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: ModifyZoneCustomVariables.
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

Site ID.

CustomVariables.N No Array of CustomVariable

List of site-level custom variables. CustomVariable.Name must use user.zone. as a prefix. Variables are initialized sequentially in array order. InitialValue can only reference variables before the current variable. It does not support referencing the current variable itself or variables after it.

CustomVariableOperations.N No Array of CustomVariableOperation

Site-level custom variable calculation rules. The calculation supports references to defined site-level custom variables. This list currently only supports filling in one rule; additional entries are invalid.

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 Configure Site-Level Custom Variables

Create a site-level custom variable user.zone.testa and configure its calculation rules.

Input Example

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

{
    "ZoneId": "zone-3n1uzjzxffby",
    "CustomVariables": [
        {
            "Name": "user.zone.testa",
            "InitialValue": "${http.request.headers[\"key\"]}",
            "Description": ""
        }
    ],
    "CustomVariableOperations": [
        {
            "Branches": [
                {
                    "Condition": "${eo.variable['user.zone.testa']} in ['aBc']",
                    "Actions": [
                        {
                            "Name": "Set",
                            "SetParameters": {
                                "Name": "user.zone.testa",
                                "Value": "${http.request.host}"
                            }
                        }
                    ]
                }
            ]
        }
    ]
}

Output Example

{
    "Response": {
        "RequestId": "a33d2e57-25db-43de-add9-cf43748af91c"
    }
}

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.
FailedOperation.CertificateNotFound The edge HTTPS certificate does not exist.
InternalError.ConfigLocked The configuration is locked. Please unlock and try again.
InternalError.RouteError The backend routing address is incorrect.
InternalError.SystemError Internal system error.
InternalError.UnknowError Unknown error.
InvalidParameter.ActionInProgress Too many attempts. Please try again later.
InvalidParameter.CacheKeyQueryStringRequiresFullUrlCacheOff Invalid query string.
InvalidParameter.CacheKeyQueryStringTooManyValue The query string has too many values.
InvalidParameter.CertSystemError Internal error.
InvalidParameter.ClientIpCountryConflictsWithIpv6 IPv6 access conflicts with client IP geographical location.
InvalidParameter.GrpcRequireHttp2 To enable gRPC support, HTTP/2 support must be enabled as well.
InvalidParameter.InvalidAwsPrivateAccess Invalid third-party object storage.
InvalidParameter.InvalidCacheConfigFollowOrigin Invalid node cache. The origin behavior is followed.
InvalidParameter.InvalidCacheKeyQueryStringValue Invalid query string.
InvalidParameter.InvalidCacheOnlyOnSwitch Invalid node cache.
InvalidParameter.InvalidCacheTime Invalid node cache validity.
InvalidParameter.InvalidClientIpCountryHeaderName Invalid client IP location configuration. HeaderName consists of 1-100 alphanumeric characters and cannot start or end with hyphens (-).
InvalidParameter.InvalidClientIpHeaderName Invalid client IP request header.
InvalidParameter.InvalidDynamicRoutine Invalid smart acceleration.
InvalidParameter.InvalidDynamicRoutineBilling The package does not support Smart Acceleration.
InvalidParameter.InvalidForceRedirectType Invalid enforced HTTPS redirect.
InvalidParameter.InvalidHttps Invalid parameter "https".
InvalidParameter.InvalidHttpsCertInfo Invalid edge HTTPS certificate configuration. The certificate content is invalid.
InvalidParameter.InvalidHttpsCipherSuiteAndTlsVersion The cipher suite does not match the TLS version.
InvalidParameter.InvalidHttpsHstsMaxAge Invalid HTTPS HSTS.
InvalidParameter.InvalidHttpsTlsVersion Invalid HTTPS TLS version.
InvalidParameter.InvalidIpv6Switch Invalid IPv6 settings.
InvalidParameter.InvalidMaxAgeTime Invalid browser cache.
InvalidParameter.InvalidOrigin Invalid origin server.
InvalidParameter.InvalidOriginType Incorrect origin server type.
InvalidParameter.InvalidParameter Invalid parameter.
InvalidParameter.InvalidPostMaxSizeBilling The speciThe plan does not support limiting the max upload size.
InvalidParameter.InvalidPostSizeValue Invalid POST request size.
InvalidParameter.InvalidRangeOriginPull Invalid Range GETs.
InvalidParameter.InvalidRequestHeaderName Invalid request header.
InvalidParameter.InvalidResourceIdBilling You have not purchased a plan yet.
InvalidParameter.InvalidStandardDebugClientIp Invalid client IP or CIDR block.
InvalidParameter.InvalidStandardDebugEmptyList The AllowClientIPList parameter is mandatory. The IPv4 and IPv6 network segments are supported. 0.0.0.0/0 indicates that all IPv4 clients can be debugged, and ::/0 indicates that all IPv6 clients can be debugged.
InvalidParameter.InvalidStandardDebugExpireTimeLimit The expiration time is exceeded.
InvalidParameter.InvalidWebSocketTimeout Invalid WebSocket.
InvalidParameter.MultiplyLayerNotSupportSmartRouting Smart routing is not supported.
InvalidParameter.OCDirectOriginRequiresSmartRouting The domain name is configured to forward requests to the origin directly. iSmart Acceleration must be enabled.
InvalidParameter.PostMaxSizeLimitExceeded Maximum upload size exceeded.
InvalidParameter.SettingInvalidParam Configuration parameter error.
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.ZoneIsGrayPublishing The site is being upgraded. Changing is not supported. Please try again later.
InvalidParameter.ZoneNotFound The site does not exist.
InvalidParameterValue.FormatMismatch Format mismatch.
InvalidParameterValue.GeneralMismatch Configuration parameter format mismatch.
InvalidParameterValue.IncludeInvalidValue Contains invalid value.
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.UnrecognizableValue Configuration item error.
OperationDenied Operation denied.
OperationDenied.AccelerateMainlandDisable Cross-MLC-border acceleration is in beta. To join the beta, submit a ticket.
OperationDenied.AccelerateMainlandIpv6Conflict Cross-MLC-border acceleration and IPv6 cannot be configured at the same time.
OperationDenied.AccelerateMainlandMultiplyLayerConflict The existing domain feature under the current site conflicts with the Chinese mainland network optimization, and cannot be configured at the same time.
OperationDenied.ConfigLocked The configuration is locked. Please unlock and try again.
OperationDenied.DisableZoneNotCompleted The EdgeOne service of the site is being disabled. Please try again later.
OperationDenied.ErrZoneIsAlreadyPaused The EdgeOne service of the site is disabled. Please enable it and try again.
OperationDenied.NotAllowCloseAccelerateMainlandWhenDomainBoundExclusiveIP The current site has a domain name associated with an exclusive accelerated IP. To disable "network optimization in the Chinese mainland", unbind the exclusive IP first and try again after.
OperationDenied.SharedCNAMEUnsupportedAccelerateMainland The domain name is bound with a shared CNAME and cannot be changed to "Cross-MLC-border acceleration". Please unbind the domain name from the shared CNAME first.
OperationDenied.SharedCNAMEUnsupportedIPv6 The domain name is bound with a shared CNAME and cannot be changed to "IPv6 access". Please unbind the domain name from the shared CNAME first.
ResourceInUse The resource is occupied.
ResourceNotFound The resource doesn’t exist.
ResourceNotFound.PostMaxSizeQuotaNotFound Maximum upload size is not configured.
ResourceUnavailable.CertNotFound The certificate does not exist or is not authorized.
UnauthorizedOperation.CamUnauthorized CAM is not authorized.
UnauthorizedOperation.NoPermission The sub-account is not authorized for the operation. Please get permissions first.

帮助和支持

本页内容是否解决了您的问题?

填写满意度调查问卷,共创更好文档体验。

文档反馈