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
Authorization information
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
StartTime | long | No | 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 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 |
EndTime | long | No | 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 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 |
PageNumber | integer | No | The dimension based on which data is aggregated. This parameter is equivalent to the GROUP BY clause in SQL. Valid values:
| 1 |
PageSize | integer | No | The number of entries to return on each page. Default value: 10. | 10 |
SearchKey | string | No | The keyword based on which the alert logs to be counted are searched. | test |
Namespace | string | No | The namespace of the cloud service. Note
For more information about the namespaces of cloud services, see Appendix 1: Metrics.
| acs_ecs_dashboard |
GroupId | string | No | The ID of the application group. | 7301**** |
Product | string | No | The abbreviation of the service name. | ECS |
Level | string | No | The level and notification method of the alert. Valid values:
| P4 |
SendStatus | string | No | The status of the alert. Valid values:
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 |
ContactGroup | string | No | The alert group. | ECS_Group |
RuleName | string | No | The name of the alert rule. | test123 |
MetricName | string | No | The name of the metric. Note
For more information about the metrics of different cloud services, see Appendix 1: Metrics.
| cpu_total |
LastMin | string | No | The statistical period of alert logs. Unit: minutes. | 360 |
GroupBy | string | Yes | The dimension based on which data is aggregated. This parameter is similar to the Group By clause of SQL statements. Valid values:
| product |
SourceType | string | No | This parameter is deprecated. | None |
EventType | string | No | The type of the alert event. Valid values:
| TRIGGERED |
RuleId | string | No | 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
Examples
Sample success responses
JSON
format
{
"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 code | Error code | Error message | Description |
---|---|---|---|
400 | ParameterInvalid | %s | - |
403 | AccessForbidden | User not authorized to operate on the specified resource. | - |
404 | ResourceNotFound | The specified resource is not found. | The specified resource is not found. |
409 | ResourceConflict | Concurrent modification of resources. | - |
409 | ResourceExist | Resources already exist. | - |
500 | InternalError | The request processing has failed due to some unknown error. | - |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2023-12-07 | The Error code has changed. The request parameters of the API has changed | see changesets | ||||||||||||||||||
| ||||||||||||||||||||
2023-07-27 | The Error code has changed. The request parameters of the API has changed | see changesets | ||||||||||||||||||
|