DescribeAlarmHistories

Last updated: 2021-04-19 11:25:44

1. API Description

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

This API is used to query the alarm records.

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: DescribeAlarmHistories.
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.
Module Yes String Value fixed at "monitor"
PageNumber No Integer Page number starting from 1. Default value: 1
PageSize No Integer Number of entries per page. Value range: 1–100. Default value: 20
Order No String Sort by the first occurrence time in descending order by default. Valid values: ASC (ascending), DESC (descending)
StartTime No Integer Start time, which corresponds to FirstOccurTime (time when an alarm first occurred). The default value is the timestamp of a day earlier.
EndTime No Integer End time, which corresponds to FirstOccurTime (time when an alarm first occurred). The default value is the current timestamp.
MonitorTypes.N No Array of String Filter by monitor type. Valid values: MT_QCE (Tencent Cloud service monitoring). If this parameter is left empty, all will be queried by default
AlarmObject No String Filter by alarm object. Fuzzy search with string is supported
AlarmStatus.N No Array of String Filter by alarm status. Valid values: ALARM (not resolved), OK (resolved), NO_CONF (expired), NO_DATA (insufficient data). If this parameter is left empty, all will be queried by default
ProjectIds.N No Array of Integer Filter by project ID. Valid values: -1 (no project), 0 (default project)
InstanceGroupIds.N No Array of Integer Filter by instance group ID
Namespaces.N No Array of MonitorTypeNamespace Filter by policy type
MetricNames.N No Array of String Filter by metric name
PolicyName No String Fuzzy search by policy name
Content No String Fuzzy search by alarm content
ReceiverUids.N No Array of Integer Search by recipient
ReceiverGroups.N No Array of Integer Search by recipient group
PolicyIds.N No Array of String Search by alarm policy ID list

3. Output Parameters

Parameter Name Type Description
TotalCount Integer Total number
Histories Array of AlarmHistory Alarm record list
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 Querying alarm history

Input Example

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

{
    "Module": "monitor",
    "PolicyName": "policy",
    "PageNumber": "1",
    "PageSize": "10",
    "StartTime": 1598976507,
    "EndTime": 1599019707
}

Output Example

{
  "Response": {
    "Histories": [
      {
        "AlarmId": "c36494f8-ae38-45cb-8089-e14006bcfc67",
        "MonitorType": "MT_QCE",
        "Namespace": "cvm_device",
        "AlarmObject": "10.104.126.8 (private)  | CVM 1 | Classic network",
        "Content": "CPU utilization > 0%",
        "FirstOccurTime": 1603117860,
        "LastOccurTime": 1603162964,
        "AlarmStatus": "ALARM",
        "PolicyId": "policy-abc01",
        "PolicyName": "CVM alarm policy 1",
        "VPC": "0",
        "ProjectId": 0,
        "ProjectName": "Default project",
        "InstanceGroup": [
          {
            "Id": 430,
            "Name": "example-instance-group"
          }
        ],
        "ReceiverUids": [],
        "ReceiverGroups": [
          1544
        ],
        "NoticeWays": [
          "SMS",
          "EMAIL",
          "WECHAT"
        ],
        "EventId": 0,
        "AlarmType": "METRIC",
        "OriginId": "1278441",
        "Region": "gz",
        "PolicyExists": 1,
        "MetricsInfo": null
      },
      {
        "AlarmId": "779d129a-40a1-4acf-b226-d9c2ae26e63b",
        "MonitorType": "MT_QCE",
        "Namespace": "cvm_device",
        "AlarmObject": "10.104.126.8 (private)  | CVM 1 | Classic network",
        "Content": "CPU utilization > 0%",
        "FirstOccurTime": 1603117860,
        "LastOccurTime": 1603162964,
        "AlarmStatus": "ALARM",
        "PolicyId": "policy-abc02",
        "PolicyName": "CVM alarm policy 2",
        "VPC": "0",
        "ProjectId": 0,
        "ProjectName": "Default project",
        "InstanceGroup": [
          {
            "Id": 430,
            "Name": "example-instance-group"
          }
        ],
        "ReceiverUids": [],
        "ReceiverGroups": [],
        "NoticeWays": [],
        "EventId": 0,
        "AlarmType": "METRIC",
        "OriginId": "1276973",
        "Region": "gz",
        "PolicyExists": 1,
        "MetricsInfo": null
      }
    ],
    "RequestId": "4bzogxhgsgs95hgmxne5ei6y9jjxvi1f",
    "TotalCount": 486
  }
}

5. Developer Resources

SDK

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