Domain name for API request: config.intl.tencentcloudapi.com.
This API is used to create rules.
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: AddConfigRule. |
| Version | Yes | String | Common Params. The value used for this API: 2022-08-02. |
| Region | No | String | Common Params. This parameter is not required. |
| Identifier | Yes | String | Rule template ID. The preset rule template is Identifier and the custom rule is the serverless cloud function ARN (region:functionName). |
| IdentifierType | Yes | String | Rule template type. Valid values: SYSTEM and CUSTOMIZE. |
| RuleName | Yes | String | rule name |
| ResourceType.N | Yes | Array of String | Resources supported by the rule. |
| TriggerType.N | Yes | Array of TriggerType | Trigger types, supporting up to two types. |
| RiskLevel | Yes | Integer | Risk level. Valid values: |
| InputParameter.N | No | Array of InputParameter | Input parameters. |
| Description | No | String | Rule description, which is 0–1024 characters in length. |
| RegionsScope.N | No | Array of String | Rule evaluation region scope. The rule only applies to resources in specified regions. Supported regions are those returned by config:ListResourceRegions. |
| TagsScope.N | No | Array of Tag | Rule evaluation tag scope. The rule only applies to resources bound with specified tags. |
| ExcludeResourceIdsScope.N | No | Array of String | The rule is invalid for the specified resource ID, meaning that evaluation will not be performed on this resource. |
| Parameter Name | Type | Description |
|---|---|---|
| RuleId | String | Rule ID. |
| 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. |
Add Rule
POST / HTTP/1.1
Host: config.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: AddConfigRule
<Common request parameters>
{
"Identifier": "cam-user-group-bound",
"IdentifierType": "SYSTEM",
"RuleName": "A CAM sub-user must be associated with a user group.",
"ResourceType": [
"QCS::CAM::User"
],
"RiskLevel": 3,
"Description": "If a user in CAM is bound with at least one user group, the rule is complied with."
"TriggerType": [
{
"MessageType": "ScheduledNotification",
"MaximumExecutionFrequency": "TwentyFour_Hours"
}
],
"InputParameter": []
}
{
"Response": {
"RequestId": "da85d5e2-4432-4f02-9863-0ab07adeff33",
"RuleId": "cr-3xhsd76j603v0a8ma0i73"
}
}
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.RuleNameIsExist | Rule name already exists. |
| InvalidParameter | Parameter error. |
Esta página foi útil?
Você também pode entrar em contato com a Equipe de vendas ou Enviar um tíquete em caso de ajuda.
comentários