All Products
Search
Document Center

CloudMonitor:DescribeAlertLogCount

Last Updated:Mar 01, 2024

Queries the statistics of alert logs.

Operation description

Queries the statistics of alert logs.

This topic provides an example on how to query the statistics of alert logs for Elastic Compute Service (ECS) based on the product dimension.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
StartTimelongNo

The start timestamp of the alert logs to be queried.

Unit: milliseconds.

You can query only the alert logs within the last year. If the query time is longer than one year, the return value of the AlertLogCount parameter is empty.

Note The interval between the start time (StartTime) and end time (EndTime) must be less than or equal to 15 days. The start time and end time must be specified or left empty at the same time. If you do not specify the start time and end time, the alert logs within the last 15 minutes are queried by default.
1609988009694
EndTimelongNo

The end timestamp of the alert logs to be queried.

Unit: milliseconds.

You can query only the alert logs within the last year. If the query time is longer than one year, the return value of the AlertLogCount parameter is empty.

Note The interval between the start time (StartTime) and end time (EndTime) must be less than or equal to 15 days. The start time and end time must be specified or left empty at the same time. If you do not specify the start time and end time, the alert logs within the last 15 minutes are queried by default.
1610074409694
PageNumberintegerNo

The dimension based on which data is aggregated. This parameter is equivalent to the GROUP BY clause in SQL. Valid values:

  • product: aggregates data by cloud service.
  • level: aggregates data by alert level.
  • groupId: aggregates data by application group.
  • contactGroup: aggregates data by alert contact group.
  • product,metricName: aggregates data both by cloud service and by metric.
1
PageSizeintegerNo

The number of entries to return on each page. Default value: 10.

10
SearchKeystringNo

The keyword based on which the alert logs to be counted are searched.

test
NamespacestringNo

The namespace of the cloud service.

Note For more information about the namespaces of cloud services, see Appendix 1: Metrics.
acs_ecs_dashboard
GroupIdstringNo

The ID of the application group.

7301****
ProductstringNo

The abbreviation of the service name.

ECS
LevelstringNo

The level and notification method of the alert. Valid values:

  • P4: Alert notifications are sent by using emails and DingTalk chatbots.
  • OK: No alert is generated.
P4
SendStatusstringNo

The status of the alert. Valid values:

  • 0: The alert is triggered or cleared.
  • 1: The alert is generated not during the effective period.
  • 2: The alert is muted and not triggered in a specified period.
  • 3: The host is restarting.
  • 4: Notifications are not sent for the alert.

When the value of the SendStatus parameter is 0, the value P4 of the Level parameter indicates a triggered alert and the value OK indicates a cleared alert.

0
ContactGroupstringNo

The alert group.

ECS_Group
RuleNamestringNo

The name of the alert rule.

test123
MetricNamestringNo

The name of the metric.

Note For more information about the metrics of different cloud services, see Appendix 1: Metrics.
cpu_total
LastMinstringNo

The statistical period of alert logs. Unit: minutes.

360
GroupBystringYes

The dimension based on which data is aggregated. This parameter is similar to the Group By clause of SQL statements. Valid values:

  • product: aggregates data by cloud service.
  • level: aggregates data by alert level.
  • groupId: aggregates data by application group.
  • contactGroup: aggregates data by alert group.
  • product,metricName: aggregates data both by cloud service and by metric.
product
SourceTypestringNo

This parameter is deprecated.

None
EventTypestringNo

The type of the alert event. Valid values:

  • TRIGGERED: The alert is triggered.
  • RESOLVED: The alert is resolved.
TRIGGERED
RuleIdstringNo

The ID of the alert rule.

For more information about how to obtain the ID of an alert rule, see DescribeMetricRuleList .

bfae2ca5b4e07d2c7278772e***********

For more information about common request parameters, see Common parameters.

Response parameters

ParameterTypeDescriptionExample
object
Codestring

The HTTP status code.

Note The status code 200 indicates that the request was successful.
200
Messagestring

The error message.

The specified resource is not found.
RequestIdstring

The request ID.

1C4A3709-BF52-42EE-87B5-7435F0929585
Successboolean

Indicates whether the request was successful. Valid values:

  • true
  • false
true
AlertLogCountobject []

The statistics of alert logs.

Countinteger

The number of alert logs.

1
Logsobject []

The details about alert logs.

Namestring

The name of the dimension field based on which alert logs are aggregated.

product
Valuestring

The value of the dimension field based on which alert logs are aggregated.

ECS

Examples

Sample success responses

JSONformat

{
  "Code": "200",
  "Message": "The specified resource is not found.",
  "RequestId": "1C4A3709-BF52-42EE-87B5-7435F0929585",
  "Success": true,
  "AlertLogCount": [
    {
      "Count": 1,
      "Logs": [
        {
          "Name": "product",
          "Value": "ECS"
        }
      ]
    }
  ]
}

Error codes

HTTP status codeError codeError messageDescription
400ParameterInvalid%s-
403AccessForbiddenUser not authorized to operate on the specified resource.-
404ResourceNotFoundThe specified resource is not found.The specified resource is not found.
409ResourceConflictConcurrent modification of resources.-
409ResourceExistResources already exist.-
500InternalErrorThe request processing has failed due to some unknown error.-

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-12-07The Error code has changed. The request parameters of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
    delete Error Codes: 403
    delete Error Codes: 404
    delete Error Codes: 409
    delete Error Codes: 500
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: EventType
    Added Input Parameters: RuleId
2023-07-27The Error code has changed. The request parameters of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
    delete Error Codes: 403
    delete Error Codes: 404
    delete Error Codes: 409
    delete Error Codes: 500
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: SourceType