Domain name for API request: monitor.tencentcloudapi.com.
This API is used to add a policy group.
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: CreatePolicyGroup. |
Version | Yes | String | Common Params. The value used for this API: 2018-07-24. |
Region | No | String | Common Params. This parameter is not required for this API. |
GroupName | Yes | String | Policy group name. |
Module | Yes | String | The value is fixed to monitor. |
ViewName | No | String | Name of the view to which the policy group belongs. If the policy group is created based on a template, this parameter is optional. |
ProjectId | No | Integer | ID of the project to which the policy group belongs, which will be used for authentication. |
ConditionTempGroupId | No | Integer | ID of a template-based policy group. This parameter is required only when the policy group is created based on a template. |
IsShielded | No | Integer | Whether the policy group is shielded. The value 0 indicates that the policy group is not shielded. The value 1 indicates that the policy group is shielded. The default value is 0. |
Remark | No | String | Remarks of the policy group. |
InsertTime | No | Integer | Insertion time in the format of Unix timestamp. If this parameter is not configured, the backend processing time is used. |
Conditions.N | No | Array of CreatePolicyGroupCondition | Alarm threshold rules in the policy group. |
EventConditions.N | No | Array of CreatePolicyGroupEventCondition | Event alarm rules in the policy group. |
BackEndCall | No | Integer | Whether it is a backend call. Rules pulled from the policy template will be used to fill in the Conditions and EventConditions fields only when the value of this parameter is 1 . |
IsUnionRule | No | Integer | The 'AND' and 'OR' rules for alarm metrics. The value 0 indicates 'OR', which means that an alarm will be triggered when any rule is met. The value 1 indicates 'AND', which means that an alarm will be triggered only when all rules are met. |
Parameter Name | Type | Description |
---|---|---|
GroupId | Integer | ID of the created policy group. |
RequestId | String | The unique request ID, which is returned for each request. RequestId is required for locating a problem. |
POST / HTTP/1.1
Host: monitor.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreatePolicyGroup
<Common request parameters>
{
"EventConditions": [
{
"EventId": "42",
"AlarmNotifyType": "0",
"AlarmNotifyPeriod": "0"
}
],
"Remark": "backup_group",
"BackEndCall": "0",
"ViewName": "cvm_device",
"ProjectId": "0",
"Module": "monitor",
"IsUnionRule": "1",
"GroupName": "test_group",
"Conditions": [
{
"MetricId": "19",
"CalcType": "1",
"AlarmNotifyPeriod": "0",
"ContinuePeriod": "1",
"AlarmNotifyType": "0",
CalcPeriod
"CalcValue": "100"
}
]
}
{
"Response": {
"GroupId": 1288099,
"RequestId": "a91f70ed-e385-4817-9928-994ff06e56ec"
}
}
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 | Invalid parameter. |
LimitExceeded | Quota limit is reached. |
MissingParameter | Missing parameter. |
ResourceInUse | The resource is in use. |
ResourceInsufficient | Insufficient resources. |
ResourceNotFound | The resource is not found. |
ResourceUnavailable | The resource is unavailable. |
ResourcesSoldOut | The resources have been sold out. |
UnauthorizedOperation | Unauthorized operation. |
UnknownParameter | Unknown parameter. |
UnsupportedOperation | Unsupported operation. |
本页内容是否解决了您的问题?