tencent cloud

Feedback

DescribeAlertRecordHistory

Last updated: 2024-04-15 19:58:47

    1. API Description

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

    This API is used to get alarm records, such as today's uncleared alarms.

    A maximum of 40 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: DescribeAlertRecordHistory.
    Version Yes String Common Params. The value used for this API: 2020-10-16.
    Region No String Common Params. This parameter is not required for this API.
    From Yes Integer Start time of the query range, which is a Unix timestamp in ms
    To Yes Integer End time of the query range, which is a Unix timestamp in ms
    Offset Yes Integer Page offset. Default value: 0
    Limit Yes Integer Maximum number of entries per page. Maximum value: 100
    Filters.N No Array of Filter - alertId: Filter by alarm policy ID. Type: String; optional
    - topicId: Filter by ID of monitored object. Type: String; optional
    - status: Filter by alarm status. Type: String, optional. Valid values: 0 (uncleared), 1 (cleared), 2 (expired)
    - alarmLevel: Filter by alarm severity. Type: String, optional. Valid values: 0 (Warn), 1 (Info), 2 (Critical)

    Each request can have up to 10 Filters and 100 Filter.Values.

    3. Output Parameters

    Parameter Name Type Description
    TotalCount Integer Total alarm records
    Records Array of AlertHistoryRecord Alarm record details
    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 Querying Uncleared Alarms

    This example shows you how to query uncleared alarms in a specified period.

    Input Example

    POST / HTTP/1.1
    Host: cls.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: DescribeAlertRecordHistory
    <Common request parameters>
    
    {
        "Offset": 0,
        "Limit": 20,
        "From": 1681401600000,
        "To": 1681487999999,
        "Filters": [
            {
                "Key": "status",
                "Values": [
                    "0"
                ]
            }
        ]
    }
    

    Output Example

    {
        "Response": {
            "Records": [
                {
                    "RecordId": "977c26df-d47f-404c-b0d2-c9ccd73f1407",
                    "AlarmId": "alarm-98ba728c-3888-4049-b510-20e26de53894",
                    "AlarmName": "TKE Demo event log alarm policy_100001001014",
                    "TopicId": "0337bf0c-7a38-456a-bd59-ba2feaa55195",
                    "TopicName": "TKE Demo event log topic_100001001014",
                    "Region": "ap-chongqing",
                    "Trigger": "$1.Warning events > 0",
                    "TriggerCount": 1,
                    "AlarmPeriod": 15,
                    "Notices": [
                        {
                            "Name": "TKE Demo event log notification group_100001001014",
                            "AlarmNoticeId": "notice-117dbad3-cc1b-4455-b112-76b0658dddc2"
                        }
                    ],
                    "Duration": 90,
                    "Status": 0,
                    "CreateTime": 1681439122000,
                    "AlarmLevel": 0,
                    "MonitorObjectType": 0,
                    "GroupTriggerCondition": []
                },
                {
                    "RecordId": "1be40239-505f-4f1a-a6aa-4b71a9757d8a",
                    "AlarmId": "alarm-7be9386d-01e9-4b8b-a54e-fe00f6b15b1d",
                    "AlarmName": "TKE Demo audit log alarm policy_100001001014",
                    "TopicId": "6a4adc63-d145-4da4-a0e7-72bb1a9f8fcd",
                    "TopicName": "TKE Demo audit log topic_100001001014",
                    "Region": "ap-chongqing",
                    "Trigger": "$1.Actions > 10",
                    "TriggerCount": 1,
                    "AlarmPeriod": 15,
                    "Notices": [
                        {
                            "Name": "TKE Demo audit log notification group_100001001014",
                            "AlarmNoticeId": "notice-f7d09113-b870-4f98-b99d-38d8ecf5393b"
                        }
                    ],
                    "Duration": 90,
                    "Status": 0,
                    "CreateTime": 1681438941000,
                    "AlarmLevel": 0,
                    "MonitorObjectType": 0,
                    "GroupTriggerCondition": []
                }
            ],
            "TotalCount": 2,
            "RequestId": "431449a5-95ab-4168-9a0e-7db48692d917"
        }
    }
    

    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.TagQpsLimit The frequency of tag service requests is limited.
    FailedOperation.Timeout Operation timed out
    InternalError Internal error.
    InternalError.SearchError Retrieval error
    InternalError.SearchFailed Retrieval failed
    InvalidParameter Incorrect parameter.
    MissingParameter Missing parameter.
    OperationDenied Operation denied.
    OperationDenied.ACLFailed ACL verification failed.
    OperationDenied.AccountNotExists The account does not exist.