tencent cloud

APIs

EnableOriginACL

ダウンロード
フォーカスモード
フォントサイズ
最終更新日: 2026-11-25 16:58:24

1. API Description

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

This API is used to enable origin protection for a site for the first time. After it is enabled, EdgeOne will use specific origin-pull IP ranges to pull from the origin for layer-7 acceleration domains/layer-4 proxy instances.
This API supports two modes: Automatic Protection Mode and Specified Protection Mode.

  • When Automatic Protection Mode is used (L7EnableMode/L4EnableMode is set to all), the acceleration domain list and layer-4 proxy instances under the site will be automatically added to the origin protection list in real time without manual intervention;
  • When Specified Protection Mode is used (L7EnableMode/L4EnableMode is set to specific), you need to manually specify the resources to be added to origin protection. Unspecified resources will not be added to the origin protection list. If resource adjustment is required, you need to actively call the ModifyOriginACL API to make adjustments.
  • Instructions for using the Specified Protection Mode:

  • The maximum number of layer-7 acceleration domains that can be submitted at a time is 200, and the maximum number of layer-4 proxy instances is 100. Mixed submission of layer-7 acceleration domains/layer-4 proxy instances is supported, with a maximum total of 200 instances;
  • When more than 200 resources need to be enabled, you need to first configure the resources of the first shard through this API, and then configure the remaining shards through the ModifyOriginACL API. For example, if 500 layer-7 acceleration domains need to be added, first use this API to set 200 domains, and then use the ModifyOriginACL API to configure the remaining 300 domains in two batches, with no more than 200 domains per batch.
  • Note:

    • When enabling, accounts on the allowlist can select other origin-pull IP range versions, such as the simplified version, to achieve the effect of pulling from the origin with fewer IP ranges.
    • Calling this API is deemed as your agreement to the Special Agreement on Enabling Origin Protection;
    • Origin-pull IP ranges are subject to change from time to time. EdgeOne will send notifications 14 days, 7 days, 3 days, and 1 day before the change through one or more methods such as in-site messages, SMS, and emails. To ensure that you can receive notifications of origin-pull IP range changes, make sure that you have selected message notifications related to the EdgeOne product in the Tencent Cloud Message Center Console and configured the correct message recipients. For configuration methods, refer to Message Subscription Management.

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

    L7EnableMode No String

    Origin protection mode for Layer 7 accelerated domains. Default value: specific.

  • all: Automatic protection mode. All Layer 7 accelerated domains in the site are automatically added to the origin protection list, including Layer 7 accelerated domains added later.
  • specific: Manual protection mode. You need to manually specify the Layer 7 accelerated domains to be added to origin protection (specified by the L7Hosts parameter). Resources not specified are not added to the origin protection list. You can adjust protected resources later through the ModifyOriginACL API.
  • Note: When the value is all, leave L7Hosts empty. When the number of Layer 7 accelerated domains in the site exceeds 200, enable protection in specific mode first, enable the remaining resources through the ModifyOriginACL API, and then switch to all through the ModifyOriginACL API.

    L7Hosts.N No Array of String

    List of Layer 7 accelerated domains for which origin protection is to be enabled. This parameter takes effect only when L7EnableMode is specific. A maximum of 200 Layer 7 accelerated domains can be enabled at a time. If you want to enable more than 200 domains, use the ModifyOriginACL API for sharded configuration.

    L4EnableMode No String

    Origin protection mode for layer-4 proxy instances. Default value: specific.

  • all: Automatic protection mode. All layer-4 proxy instances in the site are automatically added to the origin protection list, including layer-4 proxy instance resources added later.
  • specific: Manual protection mode. You need to manually specify the layer-4 proxy instances to be added to origin protection (specified by the L4ProxyIds parameter). Resources not specified are not added to the origin protection list. You can adjust protected resources later through the ModifyOriginACL API.
  • Note: When the value is all, leave L4ProxyIds empty. When the number of layer-4 proxy instances in the site exceeds 100, enable protection in specific mode first, enable the remaining resources through the ModifyOriginACL API, and then switch to all through the ModifyOriginACL API.

    L4ProxyIds.N No Array of String

    List of layer-4 proxy instances for which origin protection is to be enabled. This parameter takes effect only when L4EnableMode is specific. A maximum of 100 layer-4 proxy instances can be enabled at a time. If you want to enable more than 100 layer-4 proxy instances, use the ModifyOriginACL API for sharded configuration.

    OriginACLFamily No String

    Origin ACL control domain for origin protection. If not specified, the standard global control domain is used by default. Available control domains can be obtained through the DescribeAvailableOriginACLFamily API.
    Valid values:

  • gaz: standard global AZ control domain;
  • mlc: standard Chinese mainland AZ control domain;
  • emc: standard global (excluding Chinese mainland) AZ control domain;
  • plat-gaz: simplified global AZ control domain;
  • plat-mlc: simplified Chinese mainland AZ control domain;
  • plat-emc: simplified global (excluding Chinese mainland) AZ control domain;
  • 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 Enabling Origin Protection for the First Time and Configuring Specific Origin-Pull IP Ranges for Layer-7 Acceleration Domains/Layer-4 Proxy Instances

    This example shows you how to enable origin protection for the site with ZoneId 'zone-276zs184g93m', and configure the layer-7 acceleration domain 'www.qq.com' and the layer-4 proxy instance 'sid-19389e5dwwxfs' to use a specific origin IP range for origin-pull.

    Input Example

    POST / HTTP/1.1
    Host: teo.intl.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: EnableOriginACL
    <Common request parameters>
    
    {
        "ZoneId": "zone-276zs184g93m",
        "L7EnableMode": "specific",
        "L7Hosts": [
            "www.qq.com"
        ],
        "L4EnableMode": "specific",
        "L4ProxyIds": [
            "sid-19389e5dwwxfs"
        ]
    }

    Output Example

    {
        "Response": {
            "RequestId": "b90202f3-7368-436d-ba36-7358e722259d"
        }
    }

    Example2 Enabling Origin Protection for the First Time and Configuring Specific Origin-Pull IP Ranges for a Layer-7 Acceleration Domain

    This example shows you how to enable origin protection for the site with ZoneId 'zone-276zs184g93m', and configure the layer-7 acceleration domain 'www.qq.com' to use a specific origin IP range for origin-pull.

    Input Example

    POST / HTTP/1.1
    Host: teo.intl.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: EnableOriginACL
    <Common request parameters>
    
    {
        "ZoneId": "zone-276zs184g93m",
        "L7EnableMode": "specific",
        "L7Hosts": [
            "www.qq.com"
        ]
    }

    Output Example

    {
        "Response": {
            "RequestId": "9e0a2b4f-df6d-4d2a-ac39-1706cbf8a869"
        }
    }

    Example3 Enabling Origin Protection for the First Time and Configuring a Specific Control Field Origin-Pull IP Range for a Layer-7 Acceleration Domain

    This example shows you how to enable origin protection for the site with ZoneId 'zone-3ly7orr0u97o', and configure the layer-7 acceleration domain 'www.qq.com' to use the origin IP range with control field 'gaz' for origin-pull.

    Input Example

    POST / HTTP/1.1
    Host: teo.intl.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: EnableOriginACL
    <Common request parameters>
    
    {
        "ZoneId": "zone-3ly7orr0u97o",
        "L7EnableMode": "specific",
        "L7Hosts": [
            "www.qq.com"
        ],
        "OriginACLFamily": "gaz"
    }

    Output Example

    {
        "Response": {
            "RequestId": "97a988a5-6ff1-437f-9c84-f327bee9771c"
        }
    }

    Example4 Enabling Origin Protection for the First Time and Configuring Specific Origin-Pull IP Ranges for a Layer-4 Proxy Instance

    This example shows you how to enable origin protection for the site with ZoneId 'zone-276zs184g93m', and configure the layer-4 proxy instance 'sid-19389e5dwwxfs' to use a specific origin IP range for origin-pull.

    Input Example

    POST / HTTP/1.1
    Host: teo.intl.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: EnableOriginACL
    <Common request parameters>
    
    {
        "ZoneId": "zone-276zs184g93m",
        "L4EnableMode": "specific",
        "L4ProxyIds": [
            "sid-19389e5dwwxfs"
        ]
    }

    Output Example

    {
        "Response": {
            "RequestId": "9e0a2b4f-df6d-4d2a-ac39-1706cbf8a869"
        }
    }

    Example5 Enabling Origin Protection for the First Time and Configuring Specific Origin-Pull IP Ranges for All Layer-7 Acceleration Domains Under the Site

    This example shows you how to enable origin protection for the site with ZoneId 'zone-276zs184g93m', and configure all layer-7 acceleration domains to use a specific origin IP range for origin-pull.

    Input Example

    POST / HTTP/1.1
    Host: teo.intl.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: EnableOriginACL
    <Common request parameters>
    
    {
        "ZoneId": "zone-276zs184g93m",
        "L7EnableMode": "all"
    }

    Output Example

    {
        "Response": {
            "RequestId": "9e0a2b4f-df6d-4d2a-ac39-1706wdf8a869"
        }
    }

    Example6 Enabling Origin Protection for the First Time and Configuring Specific Origin-Pull IP Ranges for All Layer-7 Acceleration Domains and Layer-4 Proxy Instances Under the Site

    This example shows you how to enable origin protection for the site with ZoneId 'zone-276zs184g93m', and configure all layer-7 acceleration domains and layer-4 proxy instances to use a specific origin IP range for origin-pull.

    Input Example

    POST / HTTP/1.1
    Host: teo.intl.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: EnableOriginACL
    <Common request parameters>
    
    {
        "ZoneId": "zone-276zs184g93m",
        "L7EnableMode": "all",
        "L4EnableMode": "all"
    }

    Output Example

    {
        "Response": {
            "RequestId": "9e0a2b4f-df6d-4d2a-ac39-1706wdf8a869"
        }
    }

    Example7 Enabling Origin Protection for the First Time and Configuring Specific Origin-Pull IP Ranges for All Layer-4 Proxy Instances Under the Site

    This example shows you how to enable origin protection for the site with ZoneId 'zone-276zs184g93m', and configure all layer-4 proxy instances to use a specific origin IP range for origin-pull.

    Input Example

    POST / HTTP/1.1
    Host: teo.intl.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: EnableOriginACL
    <Common request parameters>
    
    {
        "ZoneId": "zone-276zs184g93m",
        "L4EnableMode": "all"
    }

    Output Example

    {
        "Response": {
            "RequestId": "9e0a2b4f-df6d-4d2a-ac39-1706wdf8a869"
        }
    }

    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.InvalidDomains Invalid domain name. Check whether the input parameters contain a domain name that does not exist.
    InvalidParameter.InvalidProxies Invalid Layer-4 proxy. Check whether the input parameters contain a proxy that does not exist.
    InvalidParameter.ShieldNotSupportHostOriginWhitelist The current domain name does not support enabling both EdgeOne Shield and origin protection at the same time.
    OperationDenied Operation denied.
    OperationDenied.UnsupportedPlan The plan does not support this operation.
    OperationDenied.VersionControlIsGraying A test version is in use. Publish the test version to the production environment or roll back the test version and try again.
    UnauthorizedOperation.CamUnauthorized Unauthorized Cam operation.

    ヘルプとサポート

    この記事はお役に立ちましたか?

    フィードバック