EnableOriginACL

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. Enabled, EdgeOne will use specific origin IP ranges to backhaul traffic for L7 acceleration domains/L4 proxy instances. The maximum allowed number of L7 acceleration domains per submission is 200, and the maximum allowed number of L4 proxy instances is 100. Mixing L7 acceleration domains and L4 proxy instances in a single submission is supported, with a total maximum of 200 instances. To enable more than 200 resources, first enable the maximum quantity via specified resources, then enable the remaining resources via the ModifyOriginACL API. Subsequent addition of L7 acceleration domains/L4 proxy instances should be configured via the ModifyOriginACL API.

Create and bind policy Query instance Reset instance access password.
-Call this API to deem as consent to the origin protection enablement special agreement (https://intl.cloud.tencent.com/document/product/1552/120141?from_cn_redirect=1);.
-The origin IP range may change irregularly. tencent cloud EdgeOne (EdgeOne) will trigger notifications via message Center, SMS, or email 14 days, 7 days, 3 days, and 1 day before the change. To ensure you receive the change notification for the origin IP range, please ensure you have selected EdgeOne product services in the tencent cloud message Center console and configured the correct message recipient. For the setting method, 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 NameRequiredTypeDescription
ActionYesStringCommon Params. The value used for this API: EnableOriginACL.
VersionYesStringCommon Params. The value used for this API: 2022-09-01.
RegionNoStringCommon Params. This parameter is not required.
ZoneIdYesStringZone ID.
L7EnableModeNoStringL7 acceleration domain name activation in origin protection mode.
  • all: enable layer-7 acceleration domain names for the site.
  • .
  • Specific: enable for the site's designated layer-7 acceleration domain name.
  • when no parameter is defined, the default is specific.
    L7Hosts.NNoArray of StringEnable the list of layer-7 acceleration domain names with origin protection. this parameter is valid only when L7EnableMode is set to specific. when L7EnableMode is set to all, retain this parameter as empty. only supports up to 200 layer-7 acceleration domain names in a single operation.
    L4EnableModeNoStringSpecifies the origin protection mode of the l4 proxy instance.
  • ALL: enable for all l4 proxy instances under the site.
  • .
  • Specific: enable for the designated layer 4 proxy instance of the site.
  • when no parameter is defined, the default is specific.
    L4ProxyIds.NNoArray of StringThe list of L4 proxy instances with origin protection enabled. this parameter is valid only when L4EnableMode is set to specific. retain this parameter empty when L4EnableMode is set to all. only supports up to 100 layer-4 proxy instances per operation.

    3. Output Parameters

    Parameter NameTypeDescription
    RequestIdStringThe 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 Enable Origin Protection for the Site for the First Time and Configure It to Assign a Specific IP Range for Origin Retrieval to the Designated Layer-7 Acceleration Domain or Layer-4 Proxy Instance

    This example shows you how to turn on origin protection for the selected site with ZoneId 'zone-276zs184g93m', configure L7 acceleration for domain name 'www.qq.com', and enable specific IP range for origin return on L4 proxy instance 'sid-19389e5dwwxfs'.

    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": "9e0a2b4f-df6d-4d2a-ac39-1706cbf8a869"
        }
    }
    

    Example2 Site First-Time Origin Protection Enablement, Configured to Specify L7 Acceleration Domain Activation with Specific Origin IP Range

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

    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 a Site for the First Time and Configuring a Specific IP Range for Origin Return on an L4 Proxy Instance

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

    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"
        }
    }
    

    Example4 First-Time Origin Protection Enablement for a Site and Configuring Specific IP Range Back-To-Origin for All Layer-7 Acceleration Domain Names and L4 Proxy Instances under the Site

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

    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"
        }
    }
    

    Example5 Enable Origin Protection for the Site for the First Time and Configure ALL L7 Acceleration Domains under the Site to Use a Specific IP Range for Origin

    This example shows you how to enable origin protection for the selected site with ZoneId 'zone-276zs184g93m' and configure all layer-7 acceleration domain names to use a specific 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 Site First-Time Enablement of Origin Protection and Configuration of ALL L4 Proxy Instances under the Site to Enable Specific IP Range for Origin Pull

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

    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 CodeDescription
    FailedOperationOperation failed.
    InternalErrorInternal error.
    InvalidParameterParameter error.
    InvalidParameter.InvalidDomainsThe domain name is illegal. check whether a non-existent domain name is passed in the input parameters.
    InvalidParameter.InvalidProxiesThe layer 4 proxy is illegal. check whether a non-existing proxy is passed in the input parameters.
    OperationDeniedOperation denied.
    OperationDenied.UnsupportedPlanThe package is not supported.
    OperationDenied.VersionControlIsGrayingThere is a test version in use. Please release the test version to the live environment, or roll back the test version and try again.
    UnauthorizedOperation.CamUnauthorizedCAM is not authorized.