Domain name for API request: teo.intl.tencentcloudapi.com.
Operate a security policy template. This API is used to bind or rebind a domain name to a designated policy template, or unbind it from a designated policy template.
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: BindSecurityTemplateToEntity. |
| 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 of the policy template to be bound or unbound. |
| Entities.N | Yes | Array of String | Domain name list bound to the policy template (or unbound from it). |
| Operate | Yes | String | Bind or unbind operation options. Valid values: |
| TemplateId | Yes | String | Specifies the ID of the policy template or the site global policy to be bound or unbound. Note: After unbinding, the domain name will use an independent policy and rule quota will be calculated separately. Please make sure there is sufficient rule quota before unbinding. |
| OverWrite | No | Boolean | If the imported domain name is already bound to a policy template (including a site-level protection strategy), setting this parameter indicates whether to replace the template. Default value: true. Valid values: |
| 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 method unbinds a specified domain name that has been bound to a policy template from the policy template. Currently, it only supports unbinding one domain name at a time. When unbinding, the following options are supported:
Example: To unbind a.test.com from an existing policy template (policy template ID: temp-cuwg1hki, associated site ID: zone-2aq0e8rhu6jx), see the following example to proceed with unbinding.
Note: If you choose to retain the current policy configuration, please ensure the current site has sufficient security rule quota. If the remaining quota is insufficient to support retaining the current policy, unbinding will fail and the domain will remain bound to the current policy template.
POST / HTTP/1.1
Host: teo.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: OperateSecurityTemplate
<Common request parameters>
{
"ZoneId": "zone-2aq0e8rhu6jx",
"Entities": [
"a.test.com"
],
"TemplateId": "temp-cuwg1hki",
"Operate": "unbind-keep-policy"
}
{
"Response": {
"RequestId": "09ce3d28-1119-49cd-xxxx-27cb34dac669"
}
}
This method applies an existing policy template to a specified domain name. It supports simultaneous binding to domain names of multiple sites.
For example, to bind the domain names a.test.com and b.example.com to an existing policy template (template ID: temp-cuwg1hki, associated site ID: zone-2aq0e8rhu6jx), see the following example.
Note: Your account must have operation permissions for all sites that the specified domain name list belongs to.
POST / HTTP/1.1
Host: teo.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: OperateSecurityTemplate
<Common request parameters>
{
"ZoneId": "zone-2aq0e8rhu6jx",
"Entities": [
"a.test.com",
"b.example.com"
],
"TemplateId": "temp-cuwg1hki",
"Operate": "bind",
"OverWrite": true
}
{
"Response": {
"RequestId": "09ce3d28-1119-49cd-xxxx-27cb34dac669"
}
}
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.ProxyServer | Unknown error occurs on the real server. |
| InvalidParameter.Security | Parameter error. |
| OperationDenied | Operation denied. |
| ResourceInUse | The resource is occupied. |
| UnauthorizedOperation.CamUnauthorized | Unauthorized Cam operation. |
| UnsupportedOperation | The operation is not supported. |
Apakah halaman ini membantu?
Anda juga dapat Menghubungi Penjualan atau Mengirimkan Tiket untuk meminta bantuan.
masukan