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.
Instructions for using the Specified Protection Mode:
Note:
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: 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. |
| 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. |
| 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. |
| 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. |
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.
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"
]
}
{
"Response": {
"RequestId": "b90202f3-7368-436d-ba36-7358e722259d"
}
}
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.
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"
]
}
{
"Response": {
"RequestId": "9e0a2b4f-df6d-4d2a-ac39-1706cbf8a869"
}
}
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.
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"
}
{
"Response": {
"RequestId": "97a988a5-6ff1-437f-9c84-f327bee9771c"
}
}
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.
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"
]
}
{
"Response": {
"RequestId": "9e0a2b4f-df6d-4d2a-ac39-1706cbf8a869"
}
}
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.
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"
}
{
"Response": {
"RequestId": "9e0a2b4f-df6d-4d2a-ac39-1706wdf8a869"
}
}
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.
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"
}
{
"Response": {
"RequestId": "9e0a2b4f-df6d-4d2a-ac39-1706wdf8a869"
}
}
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.
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"
}
{
"Response": {
"RequestId": "9e0a2b4f-df6d-4d2a-ac39-1706wdf8a869"
}
}
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 | 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. |
피드백