tencent cloud

APIs

AddAlarmPolicy

Baixar
Modo Foco
Tamanho da Fonte
Última atualização: 2026-10-19 15:48:56

1. API Description

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

This API is used to add alarm monitoring rules.

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: AddAlarmPolicy.
Version Yes String Common Params. The value used for this API: 2022-08-02.
Region No String Common Params. This parameter is not required.
Name Yes String

Alarm policy name

Type Yes Integer

Event type 1: Resource non-compliance event.

EventScope.N Yes Array of Integer

Event range. Valid values: 1 (current account) and 2 (multi-account).

RiskLevel.N Yes Array of Integer

Risk level. 1: high-risk 2: medium-risk 3: low risk

NoticeTime Yes String

Notification period

NotificationMechanism Yes String

Notification mechanism

Status Yes Integer

Status. Valid values: 1 (enabled) and 2 (disabled).

NoticePeriod.N Yes Array of Integer

Notification cycle

Description No String

Policy description

3. Output Parameters

Parameter Name Type Description
AlarmPolicyId Integer

Unique id of the alarm policy

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 Creating Alarm

Input Example

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

{
    "Name": "Alarm Rule 1",
    "Type": 1,
    "EventScope": [
        1
    ],
    "RiskLevel": [
        1
    ],
    "NoticeTime": "09:30:00~23:30:00",
    "NotificationMechanism": "real-time sending",
    "Status": 1,
    "NoticePeriod": [
        1
    ]
}

Output Example

{
    "Response": {
        "AlarmPolicyId": 2,
        "RequestId": "e2c458f6-dedc-46eb-955a-6d2c3555c597"
    }
}

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
InvalidParameter Parameter error.
LimitExceeded.AlertPolicyLimit Alarm policy count cap
ResourceNotFound.ResourceTypeNotExist The resource type does not exist.

Ajuda e Suporte

Esta página foi útil?

comentários