DescribeAlertLogCount
Queries the statistics of alert history.
Operation description
This operation can only query the statistics of alert history within the last year.
This topic provides an example to query the alert history statistics of Elastic Compute Service (ECS) by the product dimension of Alibaba Cloud services.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
cms:DescribeAlertLogCount |
get |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| StartTime |
integer |
No |
The start timestamp for querying alert history. Unit: milliseconds. You can only query the alert history within the last year. If the query time range exceeds one year, the return value of the Note
The interval between the start time (StartTime) and the end time (EndTime) must be less than or equal to 15 days. You must specify both parameters or neither. If you do not specify these parameters, the alert history within the last 15 minutes is queried by default. |
1609988009694 |
| EndTime |
integer |
No |
The end timestamp for querying alert history. Unit: milliseconds. You can only query the alert history within the last year. If the query time range exceeds one year, the return value of the Note
The interval between the start time (StartTime) and the end time (EndTime) must be less than or equal to 15 days. You must specify both parameters or neither. If you do not specify these parameters, the alert history within the last 15 minutes is queried by default. |
1610074409694 |
| PageNumber |
integer |
No |
The page number. Default value: 1. |
1 |
| PageSize |
integer |
No |
The number of entries per page. Default value: 10. |
10 |
| SearchKey |
string |
No |
The search keyword for alert history statistics. |
test |
| Namespace |
string |
No |
The namespace of the Alibaba Cloud service. Note
For more information about the namespaces of Alibaba Cloud services, see Metrics of Alibaba Cloud services. |
acs_ecs_dashboard |
| GroupId |
string |
No |
The ID of the application group. |
7301**** |
| Product |
string |
No |
The abbreviation of the Alibaba Cloud service name. |
ECS |
| Level |
string |
No |
The alert level and notification method. Valid values:
|
P4 |
| SendStatus |
string |
No |
The alert status. Valid values:
When the alert status is 0, if the value of Level is P2, P3, or P4, an alert is triggered. If the value of Level is OK, the alert is recovered to Normal. |
0 |
| ContactGroup |
string |
No |
The alert contact 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 Alibaba Cloud services, see Metrics of Alibaba Cloud services. |
cpu_total |
| LastMin |
string |
No |
The time range for retrieving logs. Unit: minutes. |
360 |
| GroupBy |
string |
Yes |
Aggregates data by spatial dimension, which is equivalent to the GROUP BY clause in SQL. Valid values:
|
product |
SourceType
deprecated
|
string |
No |
[Deprecated] This parameter is deprecated. You can ignore this parameter. |
None |
| EventType |
string |
No |
The Alarm Metric. 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 elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| Code |
string |
The status code. Note
200 indicates success. |
200 |
| Message |
string |
The error message. |
The specified resource is not found. |
| RequestId |
string |
The request ID. |
1C4A3709-BF52-42EE-87B5-7435F0929585 |
| Success |
boolean |
Indicates whether the operation is successful. Valid values:
|
true |
| AlertLogCount |
array<object> |
The statistics of the alert history count. |
|
|
array<object> |
|||
| Count |
integer |
The number of alert history records. |
1 |
| Logs |
array<object> |
The details of the alert history statistics. |
|
|
object |
|||
| Name |
string |
The field name of the alert history statistics. |
product |
| Value |
string |
The field value of the alert history statistics. |
ECS |
Examples
Success response
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 | Parameter invalid. | The parameter is missing or invalid. |
| 500 | InternalError | The request processing has failed due to some unknown error. | |
| 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. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.