BindSecurityTemplateToEntity
1. API Description
Domain name for API request: teo.intl.tencentcloudapi.com.
This API is used to bind/unbind a domain name to/from a specific policy template.
A maximum of 20 requests can be initiated per second for this API.
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: 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 to or unbound from. |
Entities.N | Yes | Array of String | List of domain names to bind to/unbind from a policy template |
Operate | Yes | String | Bind or unbind operation option. valid values:.Bind : bind the domain name to the policy template. |
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 has already been bound to a policy template (including a site-level security policy), this parameter indicates whether to replace the template by setting it. the default value is true. values: true : replace the template currently bound to the domain.false : do not replace the template currently bound to the 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 Unbinding a domain name from a policy template
In this example, we unbind the domain name a.test.com
from the policy template temp-cuwg1hki
of the site zone-2aq0e8rhu6jx
. Only one domain name can be unbound at one time. There are two options:
unbind-keep-policy
: Unbind the domain name from the specified policy and create a new policy for the domain name with the same configuration as the original one. This takes additional rule quota.unbind-use-default
: Unbind the domain name from the specified policy and then bind it with the default policy with default configurations. Custom rules no longer take effect.
Note: To use unbind-keep-policy
, make sure your rule quota is enough. If the remaining quota is insufficient, the unbinding fails and the domain name remains bound to the current policy template.
Input Example
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"
}
Output Example
{
"Response": {
"RequestId": "09ce3d28-1119-49cd-xxxx-27cb34dac669"
}
}
Example2 Binding domain names to a policy template
In this example, we bind two domain names (a.test.com and b.example.com) to the policy template temp-cuwg1hki
under the site zone-2aq 0e8rhu6jx
.
Note: You need to have permissions to the related sites.
Input Example
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
}
Output Example
{
"Response": {
"RequestId": "09ce3d28-1119-49cd-xxxx-27cb34dac669"
}
}
5. Developer Resources
SDK
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
- Tencent Cloud SDK 3.0 for Python
- Tencent Cloud SDK 3.0 for Java
- Tencent Cloud SDK 3.0 for PHP
- Tencent Cloud SDK 3.0 for Go
- Tencent Cloud SDK 3.0 for Node.js
- Tencent Cloud SDK 3.0 for .NET
- Tencent Cloud SDK 3.0 for C++
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 |
---|---|
InternalError.ConfigLocked | The configuration is locked. Please unlock and try again. |
InternalError.ProxyServer | An unknown error occurred in the backend server. |
InvalidParameter.Security | Invalid parameter. |
OperationDenied | Operation denied. |
ResourceInUse | The resource is occupied. |
UnauthorizedOperation.CamUnauthorized | CAM is not authorized. |
UnsupportedOperation | Unsupported operation. |