CreatePolicyGroup

Last updated: 2020-07-03 10:55:39

1. API Description

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.

Note: This API supports Finance regions. If the common parameter Region is a Finance region, a domain name with the Finance region needs to be specified, for example: monitor.ap-shanghai-fsi.tencentcloudapi.com

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

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 parameter. The value used for this API: CreatePolicyGroup.
Version Yes String Common parameter. The value used for this API: 2018-07-24.
Region Yes String Common parameter. For more information, please see the list of regions supported by the product.
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. If the value is 1, rules from the policy template will be used to fill in the Conditions and EventConditions fields.
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.

3. Output Parameters

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.

4. Example

Example1 Adding a policy group

Input Example

https://monitor.tencentcloudapi.com/?Action=CreatePolicyGroup
&Module=monitor
&GroupName=test_group
&ViewName=cvm_device
&ProjectId=0
&Remark=backup_group
&BackEndCall=0
&IsUnionRule=1
&Conditions.0.MetricId=19
&Conditions.0.CalcType=1
&Conditions.0.CalcValue=100
&Conditions.0.CalcPeriod=1
&Conditions.0.ContinuePeriod=1
&Conditions.0.AlarmNotifyType=0
&Conditions.0.AlarmNotifyPeriod=0
&EventConditions.0.EventId=42
&EventConditions.0.AlarmNotifyType=0
&EventConditions.0.AlarmNotifyPeriod=0
&<Common request parameter>

Output Example

{
  "Response": {
    "GroupId": 1288099,
    "RequestId": "a91f70ed-e385-4817-9928-994ff06e56ec"
  }
}

5. Developer Resources

API Explorer

This tool allows online call, signature authentication, SDK code generation and quick search of APIs to greatly improve the efficiency of using TencentCloud APIs.

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

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
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.

Was this page helpful?

Was this page helpful?

  • Not at all
  • Not very helpful
  • Somewhat helpful
  • Very helpful
  • Extremely helpful
Send Feedback
Help