tencent cloud

Tencent Cloud Observability Platform

Release Notes and Announcements
Release Notes
Product Introduction
Overview
Strengths
Basic Features
Basic Concepts
Use Cases
Use Limits
Purchase Guide
Tencent Cloud Product Monitoring
Application Performance Management
Mobile App Performance Monitoring
Real User Monitoring
Cloud Automated Testing
Prometheus Monitoring
Grafana
EventBridge
PTS
Quick Start
Monitoring Overview
Instance Group
Tencent Cloud Product Monitoring
Application Performance Management
Real User Monitoring
Cloud Automated Testing
Performance Testing Service
Prometheus Getting Started
Grafana
Dashboard Creation
EventBridge
Alarm Service
Cloud Product Monitoring
Tencent Cloud Service Metrics
Operation Guide
CVM Agents
Cloud Product Monitoring Integration with Grafana
Troubleshooting
Practical Tutorial
Application Performance Management
Product Introduction
Access Guide
Operation Guide
Practical Tutorial
Parameter Information
FAQs
Mobile App Performance Monitoring
Overview
Operation Guide
Access Guide
Practical Tutorial
Tencent Cloud Real User Monitoring
Product Introduction
Operation Guide
Connection Guide
FAQs
Cloud Automated Testing
Product Introduction
Operation Guide
FAQs
Performance Testing Service
Overview
Operation Guide
Practice Tutorial
JavaScript API List
FAQs
Prometheus Monitoring
Product Introduction
Access Guide
Operation Guide
Practical Tutorial
Terraform
FAQs
Grafana
Product Introduction
Operation Guide
Guide on Grafana Common Features
FAQs
Dashboard
Overview
Operation Guide
Alarm Management
Console Operation Guide
Troubleshooting
FAQs
EventBridge
Product Introduction
Operation Guide
Practical Tutorial
FAQs
Report Management
FAQs
General
Alarm Service
Concepts
Monitoring Charts
CVM Agents
Dynamic Alarm Threshold
CM Connection to Grafana
Documentation Guide
Related Agreements
Application Performance Management Service Level Agreement
APM Privacy Policy
APM Data Processing And Security Agreement
RUM Service Level Agreement
Mobile Performance Monitoring Service Level Agreement
Cloud Automated Testing Service Level Agreement
Prometheus Service Level Agreement
TCMG Service Level Agreements
PTS Service Level Agreement
PTS Use Limits
Cloud Monitor Service Level Agreement
API Documentation
History
Introduction
API Category
Making API Requests
Monitoring Data Query APIs
Alarm APIs
Legacy Alert APIs
Notification Template APIs
TMP APIs
Grafana Service APIs
Event Center APIs
TencentCloud Managed Service for Prometheus APIs
Monitoring APIs
Data Types
Error Codes
Glossary

CreateAlarmPolicy

PDF
Focus Mode
Font Size
Last updated: 2025-11-13 20:45:51

1. API Description

Domain name for API request: monitor.intl.tencentcloudapi.com.

This API is used to create an alarm policy.

A maximum of 20 requests can be initiated per second for this API.

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 Params. The value used for this API: CreateAlarmPolicy.
Version Yes String Common Params. The value used for this API: 2018-07-24.
Region No String Common Params. This parameter is not required.
Module Yes String Value fixed at "monitor"
PolicyName Yes String Policy name, which can contain up to 20 characters
MonitorType Yes String Monitor type. Valid values: MT_QCE (Tencent Cloud service monitoring)
Namespace Yes String Type of alarm policy, which can be obtained via DescribeAllNamespaces. For the monitoring of Tencent Cloud services, the value of this parameter is QceNamespacesNew.N.Id of the output parameter of DescribeAllNamespaces, for example, cvm_device.
Remark No String Remarks with up to 100 letters, digits, underscores, and hyphens
Enable No Integer Whether to enable. Valid values: 0 (no), 1 (yes). Default value: 1. This parameter can be left empty
ProjectId No Integer Project ID. For products with different projects, a value other than -1 must be passed in. -1: no project; 0: default project. If no value is passed in, -1 will be used. The supported project IDs can be viewed on the Account Center > Project Management page of the console.
ConditionTemplateId No Integer Trigger condition template ID. Pass in this parameter if the policy is associated with the trigger condition template; otherwise, pass in the Condition parameter. The trigger condition template ID can be obtained via DescribeConditionsTemplateList.
Condition No AlarmPolicyCondition Metric trigger condition. The supported metrics can be queried via DescribeAlarmMetrics.
EventCondition No AlarmPolicyEventCondition Event trigger condition. The supported events can be queried via DescribeAlarmEvents.
NoticeIds.N No Array of String List of notification rule IDs, which can be obtained via DescribeAlarmNotices
TriggerTasks.N No Array of AlarmPolicyTriggerTask Triggered task list
Filter No AlarmPolicyFilter Global filter.
GroupBy.N No Array of String Aggregation dimension list, which is used to specify which dimension keys data is grouped by.
Tags.N No Array of Tag Tags bound to a template
LogAlarmReqInfo No LogAlarmReq Log alarm information
HierarchicalNotices.N No Array of AlarmHierarchicalNotice Notification rules for different alarm levels
MigrateFlag No Integer A dedicated field for migration policies. 0: Implement authentication logic; 1: Skip authentication logic.
EbSubject No String The alert configured for an event

3. Output Parameters

Parameter Name Type Description
PolicyId String Alarm policy ID
OriginId String Alarm policy ID, which can be used when you call APIs (BindingPolicyObject, UnBindingAllPolicyObject, UnBindingPolicyObject) to bind/unbind instances or instance groups to/from an alarm policy
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 Creating an alarm policy

This example shows you how to associate two notification rules and one auto scaling policy where the policy type is "CVM - basic monitoring", triggering metric is "CPU utilization >= 99.9%", and triggering event is "unpingable".

Input Example

POST / HTTP/1.1
Host: monitor.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateAlarmPolicy
<Common request parameters>

{
    "Module": "monitor",
    "PolicyName": "CVM alarm policy",
    "Remark": "This is the remark",
    "MonitorType": "MT_QCE",
    "Enable": 1,
    "ProjectId": 0,
    "Namespace": "cvm_device",
    "Condition": {
        "IsUnionRule": 1,
        "Rules": [
            {
                "MetricName": "cpu_usage",
                "Period": 60,
                "Operator": "ge",
                "Value": "99.9",
                "ContinuePeriod": 1,
                "NoticeFrequency": 3600,
                "IsPowerNotice": 0
            }
        ]
    },
    "EventCondition": {
        "Rules": [
            {
                "MetricName": "ping_unreach"
            }
        ]
    },
    "NoticeIds": [
        "notice-bv9b4ghqbg",
        "notice-gj2n9wnt29"
    ],
    "TriggerTasks": [
        {
            "Type": "AS",
            "TaskConfig": "{\"Region\":\"ap-guangzhou\",\"Group\":\"asg-0zhspjx\",\"Policy\":\"asp-ganig28\"}"
        }
    ]
}

Output Example

{
    "Response": {
        "RequestId": "29ghj2hh-45-h53h234h-23",
        "PolicyId": "policy-hi498gw3h2",
        "OriginId": "1234556"
    }
}

5. Developer Resources

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.
FailedOperation.DoHTTPTransferFailed Backend service timed out.
InternalError Internal error.
InvalidParameter Invalid parameter.
InvalidParameterValue The parameter value is incorrect.
LimitExceeded Quota limit is reached.
ResourceNotFound The resource is not found.
UnsupportedOperation Unsupported operation.

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback